From 7c9e968760a85bf4f5bbbc3339f48de4b7411476 Mon Sep 17 00:00:00 2001 From: Owlbot Bootstrapper Date: Thu, 15 Aug 2024 19:24:47 +0000 Subject: [PATCH 01/11] feat: initial commit From ce484e6a30921db1a24baea1bf2b78f78daaea71 Mon Sep 17 00:00:00 2001 From: Owlbot Bootstrapper Date: Thu, 15 Aug 2024 19:26:12 +0000 Subject: [PATCH 02/11] feat: initial generation of library Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWFwaWh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMWE1M2VmZDQwMzRmMTJiZDQ1M2MzNmYxZjNiOWRiYWYwMTY5NWNmNSJ9 --- packages/google-cloud-apihub/.OwlBot.yaml | 19 ++ .../google-cloud-apihub/.repo-metadata.json | 17 ++ packages/google-cloud-apihub/LICENSE | 202 ++++++++++++++++++ packages/google-cloud-apihub/package.json | 70 ++++++ .../google-cloud-apihub/samples/package.json | 24 +++ .../samples/test/quickstart.js | 39 ++++ 6 files changed, 371 insertions(+) create mode 100644 packages/google-cloud-apihub/.OwlBot.yaml create mode 100644 packages/google-cloud-apihub/.repo-metadata.json create mode 100644 packages/google-cloud-apihub/LICENSE create mode 100644 packages/google-cloud-apihub/package.json create mode 100644 packages/google-cloud-apihub/samples/package.json create mode 100644 packages/google-cloud-apihub/samples/test/quickstart.js diff --git a/packages/google-cloud-apihub/.OwlBot.yaml b/packages/google-cloud-apihub/.OwlBot.yaml new file mode 100644 index 00000000000..0463f06a4e4 --- /dev/null +++ b/packages/google-cloud-apihub/.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/apihub/(.*)/.*-nodejs + dest: /owl-bot-staging/google-cloud-apihub/$1 + +api-name: apihub \ No newline at end of file diff --git a/packages/google-cloud-apihub/.repo-metadata.json b/packages/google-cloud-apihub/.repo-metadata.json new file mode 100644 index 00000000000..3a663491ef1 --- /dev/null +++ b/packages/google-cloud-apihub/.repo-metadata.json @@ -0,0 +1,17 @@ +{ + "name": "apihub", + "name_pretty": "API hub API", + "product_documentation": "https://cloud.google.com/apigee/docs/apihub/what-is-api-hub", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/apihub/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/apihub", + "api_id": "apihub.googleapis.com", + "default_version": "v1", + "requires_billing": true, + "library_type": "GAPIC_AUTO", + "api_shortname": "apihub" +} + diff --git a/packages/google-cloud-apihub/LICENSE b/packages/google-cloud-apihub/LICENSE new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/packages/google-cloud-apihub/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-apihub/package.json b/packages/google-cloud-apihub/package.json new file mode 100644 index 00000000000..fa625933547 --- /dev/null +++ b/packages/google-cloud-apihub/package.json @@ -0,0 +1,70 @@ +{ + "name": "@google-cloud/apihub", + "version": "0.0.0", + "description": "API hub API client for Node.js", + "repository": { + "type": "git", + "url": "https://github.com/googleapis/google-cloud-node.git", + "directory": "packages/google-cloud-apihub" + }, + "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-apihub", + "keywords": [ + "google apis client", + "google api client", + "google apis", + "google api", + "google", + "google cloud platform", + "google cloud", + "cloud", + "google apihub", + "apihub", + "API hub 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", + "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": "^17.0.0", + "c8": "^9.0.0", + "gapic-tools": "^0.4.0", + "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": "^2.0.0", + "sinon": "^18.0.0", + "typescript": "^5.1.6" + }, + "engines": { + "node": ">=14.0.0" + } +} diff --git a/packages/google-cloud-apihub/samples/package.json b/packages/google-cloud-apihub/samples/package.json new file mode 100644 index 00000000000..4b95db4d454 --- /dev/null +++ b/packages/google-cloud-apihub/samples/package.json @@ -0,0 +1,24 @@ +{ + "name": "apihub-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/apihub": "0.0.0" + }, + "devDependencies": { + "c8": "^9.0.0", + "chai": "^4.2.0", + "mocha": "^8.0.0" + } +} diff --git a/packages/google-cloud-apihub/samples/test/quickstart.js b/packages/google-cloud-apihub/samples/test/quickstart.js new file mode 100644 index 00000000000..655d178f42b --- /dev/null +++ b/packages/google-cloud-apihub/samples/test/quickstart.js @@ -0,0 +1,39 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +const assert = require('assert'); +const path = require('path'); +const cp = require('child_process'); +const {describe, it, before} = require('mocha'); +const { RuntimeProjectAttachmentServiceClient } = require('@google-cloud/apihub').v1; +const apihubClient = new RuntimeProjectAttachmentServiceClient(); + +const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); + +const cwd = path.join(__dirname, '..'); + +describe('Quickstart', () => { + let projectId; + + before(async () => { + projectId = await apihubClient.getProjectId(); + }); + + it('should run quickstart', async () => { + const output = execSync(`node ./quickstart.js projects/${projectId}/locations/us-central1`, {cwd}); + assert(output !== null); + }); +}); From 75b04e4c55c28cdbb79b49c84d783bf12f711227 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Thu, 15 Aug 2024 19:37:39 +0000 Subject: [PATCH 03/11] Owl Bot copied code from https://github.com/googleapis/googleapis-gen/commit/1a53efd4034f12bd453c36f1f3b9dbaf01695cf5 --- .../google-cloud-apihub/v1/.eslintignore | 7 + .../google-cloud-apihub/v1/.eslintrc.json | 3 + .../google-cloud-apihub/v1/.gitignore | 14 + .../google-cloud-apihub/v1/.jsdoc.js | 55 + .../google-cloud-apihub/v1/.mocharc.js | 33 + .../google-cloud-apihub/v1/.prettierrc.js | 22 + .../google-cloud-apihub/v1/README.md | 1 + .../google-cloud-apihub/v1/package.json | 64 + .../cloud/apihub/v1/apihub_service.proto | 1836 + .../cloud/apihub/v1/common_fields.proto | 1297 + .../host_project_registration_service.proto | 207 + .../cloud/apihub/v1/linting_service.proto | 159 + .../cloud/apihub/v1/plugin_service.proto | 148 + .../apihub/v1/provisioning_service.proto | 136 + .../runtime_project_attachment_service.proto | 261 + .../google-cloud-apihub/v1/protos/protos.d.ts | 21434 +++++++ .../google-cloud-apihub/v1/protos/protos.js | 53441 ++++++++++++++++ .../google-cloud-apihub/v1/protos/protos.json | 6321 ++ .../generated/v1/api_hub.create_api.js | 77 + .../generated/v1/api_hub.create_attribute.js | 78 + .../generated/v1/api_hub.create_deployment.js | 78 + .../v1/api_hub.create_external_api.js | 79 + .../generated/v1/api_hub.create_spec.js | 79 + .../generated/v1/api_hub.create_version.js | 77 + .../generated/v1/api_hub.delete_api.js | 67 + .../generated/v1/api_hub.delete_attribute.js | 63 + .../generated/v1/api_hub.delete_deployment.js | 62 + .../v1/api_hub.delete_external_api.js | 63 + .../generated/v1/api_hub.delete_spec.js | 63 + .../generated/v1/api_hub.delete_version.js | 68 + .../samples/generated/v1/api_hub.get_api.js | 62 + .../generated/v1/api_hub.get_api_operation.js | 63 + .../generated/v1/api_hub.get_attribute.js | 63 + .../generated/v1/api_hub.get_definition.js | 63 + .../generated/v1/api_hub.get_deployment.js | 62 + .../generated/v1/api_hub.get_external_api.js | 63 + .../samples/generated/v1/api_hub.get_spec.js | 63 + .../generated/v1/api_hub.get_spec_contents.js | 63 + .../generated/v1/api_hub.get_version.js | 63 + .../v1/api_hub.list_api_operations.js | 117 + .../samples/generated/v1/api_hub.list_apis.js | 146 + .../generated/v1/api_hub.list_attributes.js | 118 + .../generated/v1/api_hub.list_deployments.js | 133 + .../v1/api_hub.list_external_apis.js | 78 + .../generated/v1/api_hub.list_specs.js | 127 + .../generated/v1/api_hub.list_versions.js | 134 + .../generated/v1/api_hub.search_resources.js | 108 + .../generated/v1/api_hub.update_api.js | 69 + .../generated/v1/api_hub.update_attribute.js | 69 + .../generated/v1/api_hub.update_deployment.js | 69 + .../v1/api_hub.update_external_api.js | 69 + .../generated/v1/api_hub.update_spec.js | 69 + .../generated/v1/api_hub.update_version.js | 69 + .../api_hub_dependencies.create_dependency.js | 77 + .../api_hub_dependencies.delete_dependency.js | 62 + .../v1/api_hub_dependencies.get_dependency.js | 62 + .../api_hub_dependencies.list_dependencies.js | 110 + .../api_hub_dependencies.update_dependency.js | 68 + .../v1/api_hub_plugin.disable_plugin.js | 62 + .../v1/api_hub_plugin.enable_plugin.js | 62 + .../generated/v1/api_hub_plugin.get_plugin.js | 62 + ...ervice.create_host_project_registration.js | 75 + ...n_service.get_host_project_registration.js | 62 + ...service.list_host_project_registrations.js | 100 + .../v1/linting_service.get_style_guide.js | 63 + ...inting_service.get_style_guide_contents.js | 64 + .../generated/v1/linting_service.lint_spec.js | 63 + .../v1/linting_service.update_style_guide.js | 65 + .../provisioning.create_api_hub_instance.js | 76 + .../v1/provisioning.get_api_hub_instance.js | 63 + .../provisioning.lookup_api_hub_instance.js | 64 + ...rvice.create_runtime_project_attachment.js | 75 + ...rvice.delete_runtime_project_attachment.js | 63 + ..._service.get_runtime_project_attachment.js | 63 + ...ervice.list_runtime_project_attachments.js | 100 + ...rvice.lookup_runtime_project_attachment.js | 63 + ...ippet_metadata_google.cloud.apihub.v1.json | 2595 + .../google-cloud-apihub/v1/src/index.ts | 37 + .../v1/src/v1/api_hub_client.ts | 6151 ++ .../v1/src/v1/api_hub_client_config.json | 213 + .../v1/src/v1/api_hub_dependencies_client.ts | 1927 + .../api_hub_dependencies_client_config.json | 63 + .../v1/api_hub_dependencies_proto_list.json | 9 + .../v1/src/v1/api_hub_plugin_client.ts | 1463 + .../src/v1/api_hub_plugin_client_config.json | 53 + .../v1/src/v1/api_hub_plugin_proto_list.json | 9 + .../v1/src/v1/api_hub_proto_list.json | 9 + .../v1/src/v1/gapic_metadata.json | 731 + ...ost_project_registration_service_client.ts | 1732 + ...ct_registration_service_client_config.json | 53 + ...oject_registration_service_proto_list.json | 9 + .../google-cloud-apihub/v1/src/v1/index.ts | 25 + .../v1/src/v1/linting_service_client.ts | 1539 + .../src/v1/linting_service_client_config.json | 58 + .../v1/src/v1/linting_service_proto_list.json | 9 + .../v1/src/v1/provisioning_client.ts | 1761 + .../v1/src/v1/provisioning_client_config.json | 53 + .../v1/src/v1/provisioning_proto_list.json | 9 + ...ntime_project_attachment_service_client.ts | 1875 + ...ject_attachment_service_client_config.json | 63 + ...project_attachment_service_proto_list.json | 9 + .../system-test/fixtures/sample/src/index.js | 33 + .../system-test/fixtures/sample/src/index.ts | 68 + .../v1/system-test/install.ts | 49 + .../v1/test/gapic_api_hub_dependencies_v1.ts | 1879 + .../v1/test/gapic_api_hub_plugin_v1.ts | 1427 + .../v1/test/gapic_api_hub_v1.ts | 6098 ++ ...ic_host_project_registration_service_v1.ts | 1659 + .../v1/test/gapic_linting_service_v1.ts | 1539 + .../v1/test/gapic_provisioning_v1.ts | 1812 + ...c_runtime_project_attachment_service_v1.ts | 1875 + .../google-cloud-apihub/v1/tsconfig.json | 19 + .../google-cloud-apihub/v1/webpack.config.js | 64 + 113 files changed, 126834 insertions(+) create mode 100644 owl-bot-staging/google-cloud-apihub/v1/.eslintignore create mode 100644 owl-bot-staging/google-cloud-apihub/v1/.eslintrc.json create mode 100644 owl-bot-staging/google-cloud-apihub/v1/.gitignore create mode 100644 owl-bot-staging/google-cloud-apihub/v1/.jsdoc.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/.mocharc.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/.prettierrc.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/README.md create mode 100644 owl-bot-staging/google-cloud-apihub/v1/package.json create mode 100644 owl-bot-staging/google-cloud-apihub/v1/protos/google/cloud/apihub/v1/apihub_service.proto create mode 100644 owl-bot-staging/google-cloud-apihub/v1/protos/google/cloud/apihub/v1/common_fields.proto create mode 100644 owl-bot-staging/google-cloud-apihub/v1/protos/google/cloud/apihub/v1/host_project_registration_service.proto create mode 100644 owl-bot-staging/google-cloud-apihub/v1/protos/google/cloud/apihub/v1/linting_service.proto create mode 100644 owl-bot-staging/google-cloud-apihub/v1/protos/google/cloud/apihub/v1/plugin_service.proto create mode 100644 owl-bot-staging/google-cloud-apihub/v1/protos/google/cloud/apihub/v1/provisioning_service.proto create mode 100644 owl-bot-staging/google-cloud-apihub/v1/protos/google/cloud/apihub/v1/runtime_project_attachment_service.proto create mode 100644 owl-bot-staging/google-cloud-apihub/v1/protos/protos.d.ts create mode 100644 owl-bot-staging/google-cloud-apihub/v1/protos/protos.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/protos/protos.json create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.create_api.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.create_attribute.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.create_deployment.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.create_external_api.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.create_spec.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.create_version.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.delete_api.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.delete_attribute.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.delete_deployment.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.delete_external_api.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.delete_spec.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.delete_version.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_api.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_api_operation.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_attribute.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_definition.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_deployment.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_external_api.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_spec.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_spec_contents.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_version.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.list_api_operations.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.list_apis.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.list_attributes.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.list_deployments.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.list_external_apis.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.list_specs.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.list_versions.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.search_resources.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.update_api.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.update_attribute.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.update_deployment.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.update_external_api.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.update_spec.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.update_version.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_dependencies.create_dependency.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_dependencies.delete_dependency.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_dependencies.get_dependency.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_dependencies.list_dependencies.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_dependencies.update_dependency.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_plugin.disable_plugin.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_plugin.enable_plugin.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_plugin.get_plugin.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/host_project_registration_service.create_host_project_registration.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/host_project_registration_service.get_host_project_registration.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/host_project_registration_service.list_host_project_registrations.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/linting_service.get_style_guide.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/linting_service.get_style_guide_contents.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/linting_service.lint_spec.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/linting_service.update_style_guide.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/provisioning.create_api_hub_instance.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/provisioning.get_api_hub_instance.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/provisioning.lookup_api_hub_instance.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/runtime_project_attachment_service.create_runtime_project_attachment.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/runtime_project_attachment_service.delete_runtime_project_attachment.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/runtime_project_attachment_service.get_runtime_project_attachment.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/runtime_project_attachment_service.list_runtime_project_attachments.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/runtime_project_attachment_service.lookup_runtime_project_attachment.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/snippet_metadata_google.cloud.apihub.v1.json create mode 100644 owl-bot-staging/google-cloud-apihub/v1/src/index.ts create mode 100644 owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_client.ts create mode 100644 owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_client_config.json create mode 100644 owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_dependencies_client.ts create mode 100644 owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_dependencies_client_config.json create mode 100644 owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_dependencies_proto_list.json create mode 100644 owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_plugin_client.ts create mode 100644 owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_plugin_client_config.json create mode 100644 owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_plugin_proto_list.json create mode 100644 owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_proto_list.json create mode 100644 owl-bot-staging/google-cloud-apihub/v1/src/v1/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-apihub/v1/src/v1/host_project_registration_service_client.ts create mode 100644 owl-bot-staging/google-cloud-apihub/v1/src/v1/host_project_registration_service_client_config.json create mode 100644 owl-bot-staging/google-cloud-apihub/v1/src/v1/host_project_registration_service_proto_list.json create mode 100644 owl-bot-staging/google-cloud-apihub/v1/src/v1/index.ts create mode 100644 owl-bot-staging/google-cloud-apihub/v1/src/v1/linting_service_client.ts create mode 100644 owl-bot-staging/google-cloud-apihub/v1/src/v1/linting_service_client_config.json create mode 100644 owl-bot-staging/google-cloud-apihub/v1/src/v1/linting_service_proto_list.json create mode 100644 owl-bot-staging/google-cloud-apihub/v1/src/v1/provisioning_client.ts create mode 100644 owl-bot-staging/google-cloud-apihub/v1/src/v1/provisioning_client_config.json create mode 100644 owl-bot-staging/google-cloud-apihub/v1/src/v1/provisioning_proto_list.json create mode 100644 owl-bot-staging/google-cloud-apihub/v1/src/v1/runtime_project_attachment_service_client.ts create mode 100644 owl-bot-staging/google-cloud-apihub/v1/src/v1/runtime_project_attachment_service_client_config.json create mode 100644 owl-bot-staging/google-cloud-apihub/v1/src/v1/runtime_project_attachment_service_proto_list.json create mode 100644 owl-bot-staging/google-cloud-apihub/v1/system-test/fixtures/sample/src/index.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/system-test/fixtures/sample/src/index.ts create mode 100644 owl-bot-staging/google-cloud-apihub/v1/system-test/install.ts create mode 100644 owl-bot-staging/google-cloud-apihub/v1/test/gapic_api_hub_dependencies_v1.ts create mode 100644 owl-bot-staging/google-cloud-apihub/v1/test/gapic_api_hub_plugin_v1.ts create mode 100644 owl-bot-staging/google-cloud-apihub/v1/test/gapic_api_hub_v1.ts create mode 100644 owl-bot-staging/google-cloud-apihub/v1/test/gapic_host_project_registration_service_v1.ts create mode 100644 owl-bot-staging/google-cloud-apihub/v1/test/gapic_linting_service_v1.ts create mode 100644 owl-bot-staging/google-cloud-apihub/v1/test/gapic_provisioning_v1.ts create mode 100644 owl-bot-staging/google-cloud-apihub/v1/test/gapic_runtime_project_attachment_service_v1.ts create mode 100644 owl-bot-staging/google-cloud-apihub/v1/tsconfig.json create mode 100644 owl-bot-staging/google-cloud-apihub/v1/webpack.config.js diff --git a/owl-bot-staging/google-cloud-apihub/v1/.eslintignore b/owl-bot-staging/google-cloud-apihub/v1/.eslintignore new file mode 100644 index 00000000000..cfc348ec4d1 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/.coverage +build/ +docs/ +protos/ +system-test/ +samples/generated/ diff --git a/owl-bot-staging/google-cloud-apihub/v1/.eslintrc.json b/owl-bot-staging/google-cloud-apihub/v1/.eslintrc.json new file mode 100644 index 00000000000..78215349546 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/owl-bot-staging/google-cloud-apihub/v1/.gitignore b/owl-bot-staging/google-cloud-apihub/v1/.gitignore new file mode 100644 index 00000000000..d4f03a0df2e --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/.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/owl-bot-staging/google-cloud-apihub/v1/.jsdoc.js b/owl-bot-staging/google-cloud-apihub/v1/.jsdoc.js new file mode 100644 index 00000000000..267f9e6b16e --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/.jsdoc.js @@ -0,0 +1,55 @@ +// Copyright 2024 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 2024 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: '@google-cloud/apihub', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/owl-bot-staging/google-cloud-apihub/v1/.mocharc.js b/owl-bot-staging/google-cloud-apihub/v1/.mocharc.js new file mode 100644 index 00000000000..13b67c34edc --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/.mocharc.js @@ -0,0 +1,33 @@ +// Copyright 2024 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. ** + +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000 +} +if (process.env.MOCHA_THROW_DEPRECATION === 'false') { + delete config['throw-deprecation']; +} +if (process.env.MOCHA_REPORTER) { + config.reporter = process.env.MOCHA_REPORTER; +} +if (process.env.MOCHA_REPORTER_OUTPUT) { + config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; +} +module.exports = config diff --git a/owl-bot-staging/google-cloud-apihub/v1/.prettierrc.js b/owl-bot-staging/google-cloud-apihub/v1/.prettierrc.js new file mode 100644 index 00000000000..9a8fd690982 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/.prettierrc.js @@ -0,0 +1,22 @@ +// Copyright 2024 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. ** + + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/owl-bot-staging/google-cloud-apihub/v1/README.md b/owl-bot-staging/google-cloud-apihub/v1/README.md new file mode 100644 index 00000000000..dc4fd3e19f6 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/README.md @@ -0,0 +1 @@ +Apihub: Nodejs Client diff --git a/owl-bot-staging/google-cloud-apihub/v1/package.json b/owl-bot-staging/google-cloud-apihub/v1/package.json new file mode 100644 index 00000000000..92b7f5f827b --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/package.json @@ -0,0 +1,64 @@ +{ + "name": "@google-cloud/apihub", + "version": "0.1.0", + "description": "Apihub client for Node.js", + "repository": "googleapis/nodejs-apihub", + "license": "Apache-2.0", + "author": "Google LLC", + "main": "build/src/index.js", + "files": [ + "build/src", + "build/protos" + ], + "keywords": [ + "google apis client", + "google api client", + "google apis", + "google api", + "google", + "google cloud platform", + "google cloud", + "cloud", + "google apihub", + "apihub", + "api hub", + "api hub dependencies", + "api hub plugin", + "host project registration service", + "linting service", + "provisioning", + "runtime project attachment service" + ], + "scripts": { + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/ && minifyProtoJson", + "compile-protos": "compileProtos src", + "docs": "jsdoc -c .jsdoc.js", + "fix": "gts fix", + "lint": "gts check", + "prepare": "npm run compile-protos && npm run compile", + "system-test": "c8 mocha build/system-test", + "test": "c8 mocha build/test" + }, + "dependencies": { + "google-gax": "^4.3.4" + }, + "devDependencies": { + "@types/mocha": "^10.0.6", + "@types/node": "^20.12.12", + "@types/sinon": "^10.0.20", + "c8": "^9.1.0", + "gapic-tools": "^0.4.2", + "gts": "5.3.0", + "jsdoc": "^4.0.3", + "jsdoc-fresh": "^3.0.0", + "jsdoc-region-tag": "^3.0.0", + "mocha": "^10.4.0", + "pack-n-play": "^2.0.3", + "sinon": "^15.2.0", + "typescript": "5.1.6" + }, + "engines": { + "node": ">=v14" + } +} diff --git a/owl-bot-staging/google-cloud-apihub/v1/protos/google/cloud/apihub/v1/apihub_service.proto b/owl-bot-staging/google-cloud-apihub/v1/protos/google/cloud/apihub/v1/apihub_service.proto new file mode 100644 index 00000000000..bbc89cae32d --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/protos/google/cloud/apihub/v1/apihub_service.proto @@ -0,0 +1,1836 @@ +// Copyright 2024 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.apihub.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/apihub/v1/common_fields.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Cloud.ApiHub.V1"; +option go_package = "cloud.google.com/go/apihub/apiv1/apihubpb;apihubpb"; +option java_multiple_files = true; +option java_outer_classname = "ApiHubServiceProto"; +option java_package = "com.google.cloud.apihub.v1"; +option php_namespace = "Google\\Cloud\\ApiHub\\V1"; +option ruby_package = "Google::Cloud::ApiHub::V1"; + +// This service provides all methods related to the API hub. +service ApiHub { + option (google.api.default_host) = "apihub.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Create an API resource in the API hub. + // Once an API resource is created, versions can be added to it. + rpc CreateApi(CreateApiRequest) returns (Api) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/apis" + body: "api" + }; + option (google.api.method_signature) = "parent,api,api_id"; + } + + // Get API resource details including the API versions contained in it. + rpc GetApi(GetApiRequest) returns (Api) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/apis/*}" + }; + option (google.api.method_signature) = "name"; + } + + // List API resources in the API hub. + rpc ListApis(ListApisRequest) returns (ListApisResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/apis" + }; + option (google.api.method_signature) = "parent"; + } + + // Update an API resource in the API hub. The following fields in the + // [API][] can be updated: + // + // * [display_name][google.cloud.apihub.v1.Api.display_name] + // * [description][google.cloud.apihub.v1.Api.description] + // * [owner][google.cloud.apihub.v1.Api.owner] + // * [documentation][google.cloud.apihub.v1.Api.documentation] + // * [target_user][google.cloud.apihub.v1.Api.target_user] + // * [team][google.cloud.apihub.v1.Api.team] + // * [business_unit][google.cloud.apihub.v1.Api.business_unit] + // * [maturity_level][google.cloud.apihub.v1.Api.maturity_level] + // * [attributes][google.cloud.apihub.v1.Api.attributes] + // + // The + // [update_mask][google.cloud.apihub.v1.UpdateApiRequest.update_mask] + // should be used to specify the fields being updated. + // + // Updating the owner field requires complete owner message + // and updates both owner and email fields. + rpc UpdateApi(UpdateApiRequest) returns (Api) { + option (google.api.http) = { + patch: "/v1/{api.name=projects/*/locations/*/apis/*}" + body: "api" + }; + option (google.api.method_signature) = "api,update_mask"; + } + + // Delete an API resource in the API hub. API can only be deleted if all + // underlying versions are deleted. + rpc DeleteApi(DeleteApiRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/apis/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Create an API version for an API resource in the API hub. + rpc CreateVersion(CreateVersionRequest) returns (Version) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/apis/*}/versions" + body: "version" + }; + option (google.api.method_signature) = "parent,version,version_id"; + } + + // Get details about the API version of an API resource. This will include + // information about the specs and operations present in the API + // version as well as the deployments linked to it. + rpc GetVersion(GetVersionRequest) returns (Version) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/apis/*/versions/*}" + }; + option (google.api.method_signature) = "name"; + } + + // List API versions of an API resource in the API hub. + rpc ListVersions(ListVersionsRequest) returns (ListVersionsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/apis/*}/versions" + }; + option (google.api.method_signature) = "parent"; + } + + // Update API version. The following fields in the + // [version][google.cloud.apihub.v1.Version] can be updated currently: + // + // * [display_name][google.cloud.apihub.v1.Version.display_name] + // * [description][google.cloud.apihub.v1.Version.description] + // * [documentation][google.cloud.apihub.v1.Version.documentation] + // * [deployments][google.cloud.apihub.v1.Version.deployments] + // * [lifecycle][google.cloud.apihub.v1.Version.lifecycle] + // * [compliance][google.cloud.apihub.v1.Version.compliance] + // * [accreditation][google.cloud.apihub.v1.Version.accreditation] + // * [attributes][google.cloud.apihub.v1.Version.attributes] + // + // The + // [update_mask][google.cloud.apihub.v1.UpdateVersionRequest.update_mask] + // should be used to specify the fields being updated. + rpc UpdateVersion(UpdateVersionRequest) returns (Version) { + option (google.api.http) = { + patch: "/v1/{version.name=projects/*/locations/*/apis/*/versions/*}" + body: "version" + }; + option (google.api.method_signature) = "version,update_mask"; + } + + // Delete an API version. Version can only be deleted if all underlying specs, + // operations, definitions and linked deployments are deleted. + rpc DeleteVersion(DeleteVersionRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/apis/*/versions/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Add a spec to an API version in the API hub. + // Multiple specs can be added to an API version. + // Note, while adding a spec, at least one of `contents` or `source_uri` must + // be provided. If `contents` is provided, then `spec_type` must also be + // provided. + // + // On adding a spec with contents to the version, the operations present in it + // will be added to the version.Note that the file contents in the spec should + // be of the same type as defined in the + // `projects/{project}/locations/{location}/attributes/system-spec-type` + // attribute associated with spec resource. Note that specs of various types + // can be uploaded, however parsing of details is supported for OpenAPI spec + // currently. + // + // In order to access the information parsed from the spec, use the + // [GetSpec][google.cloud.apihub.v1.ApiHub.GetSpec] method. + // In order to access the raw contents for a particular spec, use the + // [GetSpecContents][google.cloud.apihub.v1.ApiHub.GetSpecContents] method. + // In order to access the operations parsed from the spec, use the + // [ListAPIOperations][google.cloud.apihub.v1.ApiHub.ListApiOperations] + // method. + rpc CreateSpec(CreateSpecRequest) returns (Spec) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/apis/*/versions/*}/specs" + body: "spec" + }; + option (google.api.method_signature) = "parent,spec,spec_id"; + } + + // Get details about the information parsed from a spec. + // Note that this method does not return the raw spec contents. + // Use [GetSpecContents][google.cloud.apihub.v1.ApiHub.GetSpecContents] method + // to retrieve the same. + rpc GetSpec(GetSpecRequest) returns (Spec) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Get spec contents. + rpc GetSpecContents(GetSpecContentsRequest) returns (SpecContents) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*}:contents" + }; + option (google.api.method_signature) = "name"; + } + + // List specs corresponding to a particular API resource. + rpc ListSpecs(ListSpecsRequest) returns (ListSpecsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/apis/*/versions/*}/specs" + }; + option (google.api.method_signature) = "parent"; + } + + // Update spec. The following fields in the + // [spec][google.cloud.apihub.v1.Spec] can be updated: + // + // * [display_name][google.cloud.apihub.v1.Spec.display_name] + // * [source_uri][google.cloud.apihub.v1.Spec.source_uri] + // * [lint_response][google.cloud.apihub.v1.Spec.lint_response] + // * [attributes][google.cloud.apihub.v1.Spec.attributes] + // * [contents][google.cloud.apihub.v1.Spec.contents] + // * [spec_type][google.cloud.apihub.v1.Spec.spec_type] + // + // In case of an OAS spec, updating spec contents can lead to: + // 1. Creation, deletion and update of operations. + // 2. Creation, deletion and update of definitions. + // 3. Update of other info parsed out from the new spec. + // + // In case of contents or source_uri being present in update mask, spec_type + // must also be present. Also, spec_type can not be present in update mask if + // contents or source_uri is not present. + // + // The + // [update_mask][google.cloud.apihub.v1.UpdateSpecRequest.update_mask] + // should be used to specify the fields being updated. + rpc UpdateSpec(UpdateSpecRequest) returns (Spec) { + option (google.api.http) = { + patch: "/v1/{spec.name=projects/*/locations/*/apis/*/versions/*/specs/*}" + body: "spec" + }; + option (google.api.method_signature) = "spec,update_mask"; + } + + // Delete a spec. + // Deleting a spec will also delete the associated operations from the + // version. + rpc DeleteSpec(DeleteSpecRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Get details about a particular operation in API version. + rpc GetApiOperation(GetApiOperationRequest) returns (ApiOperation) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/apis/*/versions/*/operations/*}" + }; + option (google.api.method_signature) = "name"; + } + + // List operations in an API version. + rpc ListApiOperations(ListApiOperationsRequest) + returns (ListApiOperationsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/apis/*/versions/*}/operations" + }; + option (google.api.method_signature) = "parent"; + } + + // Get details about a definition in an API version. + rpc GetDefinition(GetDefinitionRequest) returns (Definition) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/apis/*/versions/*/definitions/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Create a deployment resource in the API hub. + // Once a deployment resource is created, it can be associated with API + // versions. + rpc CreateDeployment(CreateDeploymentRequest) returns (Deployment) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/deployments" + body: "deployment" + }; + option (google.api.method_signature) = "parent,deployment,deployment_id"; + } + + // Get details about a deployment and the API versions linked to it. + rpc GetDeployment(GetDeploymentRequest) returns (Deployment) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/deployments/*}" + }; + option (google.api.method_signature) = "name"; + } + + // List deployment resources in the API hub. + rpc ListDeployments(ListDeploymentsRequest) + returns (ListDeploymentsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/deployments" + }; + option (google.api.method_signature) = "parent"; + } + + // Update a deployment resource in the API hub. The following fields in the + // [deployment resource][google.cloud.apihub.v1.Deployment] can be + // updated: + // + // * [display_name][google.cloud.apihub.v1.Deployment.display_name] + // * [description][google.cloud.apihub.v1.Deployment.description] + // * [documentation][google.cloud.apihub.v1.Deployment.documentation] + // * [deployment_type][google.cloud.apihub.v1.Deployment.deployment_type] + // * [resource_uri][google.cloud.apihub.v1.Deployment.resource_uri] + // * [endpoints][google.cloud.apihub.v1.Deployment.endpoints] + // * [slo][google.cloud.apihub.v1.Deployment.slo] + // * [environment][google.cloud.apihub.v1.Deployment.environment] + // * [attributes][google.cloud.apihub.v1.Deployment.attributes] + // + // The + // [update_mask][google.cloud.apihub.v1.UpdateDeploymentRequest.update_mask] + // should be used to specify the fields being updated. + rpc UpdateDeployment(UpdateDeploymentRequest) returns (Deployment) { + option (google.api.http) = { + patch: "/v1/{deployment.name=projects/*/locations/*/deployments/*}" + body: "deployment" + }; + option (google.api.method_signature) = "deployment,update_mask"; + } + + // Delete a deployment resource in the API hub. + rpc DeleteDeployment(DeleteDeploymentRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/deployments/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Create a user defined attribute. + // + // Certain pre defined attributes are already created by the API hub. These + // attributes will have type as `SYSTEM_DEFINED` and can be listed via + // [ListAttributes][google.cloud.apihub.v1.ApiHub.ListAttributes] method. + // Allowed values for the same can be updated via + // [UpdateAttribute][google.cloud.apihub.v1.ApiHub.UpdateAttribute] method. + rpc CreateAttribute(CreateAttributeRequest) returns (Attribute) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/attributes" + body: "attribute" + }; + option (google.api.method_signature) = "parent,attribute,attribute_id"; + } + + // Get details about the attribute. + rpc GetAttribute(GetAttributeRequest) returns (Attribute) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/attributes/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Update the attribute. The following fields in the + // [Attribute resource][google.cloud.apihub.v1.Attribute] can be updated: + // + // * [display_name][google.cloud.apihub.v1.Attribute.display_name] + // The display name can be updated for user defined attributes only. + // * [description][google.cloud.apihub.v1.Attribute.description] + // The description can be updated for user defined attributes only. + // * [allowed_values][google.cloud.apihub.v1.Attribute.allowed_values] + // To update the list of allowed values, clients need to use the fetched list + // of allowed values and add or remove values to or from the same list. + // The mutable allowed values can be updated for both user defined and System + // defined attributes. The immutable allowed values cannot be updated or + // deleted. The updated list of allowed values cannot be empty. If an allowed + // value that is already used by some resource's attribute is deleted, then + // the association between the resource and the attribute value will also be + // deleted. + // * [cardinality][google.cloud.apihub.v1.Attribute.cardinality] + // The cardinality can be updated for user defined attributes only. + // Cardinality can only be increased during an update. + // + // The + // [update_mask][google.cloud.apihub.v1.UpdateAttributeRequest.update_mask] + // should be used to specify the fields being updated. + rpc UpdateAttribute(UpdateAttributeRequest) returns (Attribute) { + option (google.api.http) = { + patch: "/v1/{attribute.name=projects/*/locations/*/attributes/*}" + body: "attribute" + }; + option (google.api.method_signature) = "attribute,update_mask"; + } + + // Delete an attribute. + // + // Note: System defined attributes cannot be deleted. All + // associations of the attribute being deleted with any API hub resource will + // also get deleted. + rpc DeleteAttribute(DeleteAttributeRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/attributes/*}" + }; + option (google.api.method_signature) = "name"; + } + + // List all attributes. + rpc ListAttributes(ListAttributesRequest) returns (ListAttributesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/attributes" + }; + option (google.api.method_signature) = "parent"; + } + + // Search across API-Hub resources. + rpc SearchResources(SearchResourcesRequest) + returns (SearchResourcesResponse) { + option (google.api.http) = { + post: "/v1/{location=projects/*/locations/*}:searchResources" + body: "*" + }; + option (google.api.method_signature) = "location,query"; + } + + // Create an External API resource in the API hub. + rpc CreateExternalApi(CreateExternalApiRequest) returns (ExternalApi) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/externalApis" + body: "external_api" + }; + option (google.api.method_signature) = + "parent,external_api,external_api_id"; + } + + // Get details about an External API resource in the API hub. + rpc GetExternalApi(GetExternalApiRequest) returns (ExternalApi) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/externalApis/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Update an External API resource in the API hub. The following fields can be + // updated: + // + // * [display_name][google.cloud.apihub.v1.ExternalApi.display_name] + // * [description][google.cloud.apihub.v1.ExternalApi.description] + // * [documentation][google.cloud.apihub.v1.ExternalApi.documentation] + // * [endpoints][google.cloud.apihub.v1.ExternalApi.endpoints] + // * [paths][google.cloud.apihub.v1.ExternalApi.paths] + // + // The + // [update_mask][google.cloud.apihub.v1.UpdateExternalApiRequest.update_mask] + // should be used to specify the fields being updated. + rpc UpdateExternalApi(UpdateExternalApiRequest) returns (ExternalApi) { + option (google.api.http) = { + patch: "/v1/{external_api.name=projects/*/locations/*/externalApis/*}" + body: "external_api" + }; + option (google.api.method_signature) = "external_api,update_mask"; + } + + // Delete an External API resource in the API hub. + rpc DeleteExternalApi(DeleteExternalApiRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/externalApis/*}" + }; + option (google.api.method_signature) = "name"; + } + + // List External API resources in the API hub. + rpc ListExternalApis(ListExternalApisRequest) + returns (ListExternalApisResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/externalApis" + }; + option (google.api.method_signature) = "parent"; + } +} + +// This service provides methods for various operations related to a +// [Dependency][google.cloud.apihub.v1.Dependency] in the API hub. +service ApiHubDependencies { + option (google.api.default_host) = "apihub.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Create a dependency between two entities in the API hub. + rpc CreateDependency(CreateDependencyRequest) returns (Dependency) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/dependencies" + body: "dependency" + }; + option (google.api.method_signature) = "parent,dependency,dependency_id"; + } + + // Get details about a dependency resource in the API hub. + rpc GetDependency(GetDependencyRequest) returns (Dependency) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/dependencies/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Update a dependency based on the + // [update_mask][google.cloud.apihub.v1.UpdateDependencyRequest.update_mask] + // provided in the request. + // + // The following fields in the [dependency][google.cloud.apihub.v1.Dependency] + // can be updated: + // * [description][google.cloud.apihub.v1.Dependency.description] + rpc UpdateDependency(UpdateDependencyRequest) returns (Dependency) { + option (google.api.http) = { + patch: "/v1/{dependency.name=projects/*/locations/*/dependencies/*}" + body: "dependency" + }; + option (google.api.method_signature) = "dependency,update_mask"; + } + + // Delete the dependency resource. + rpc DeleteDependency(DeleteDependencyRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/dependencies/*}" + }; + option (google.api.method_signature) = "name"; + } + + // List dependencies based on the provided filter and pagination parameters. + rpc ListDependencies(ListDependenciesRequest) + returns (ListDependenciesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/dependencies" + }; + option (google.api.method_signature) = "parent"; + } +} + +// The [CreateApi][google.cloud.apihub.v1.ApiHub.CreateApi] method's request. +message CreateApiRequest { + // Required. The parent resource for the API resource. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "apihub.googleapis.com/Api" + } + ]; + + // Optional. The ID to use for the API resource, which will become the final + // component of the API's resource name. This field is optional. + // + // * If provided, the same will be used. The service will throw an error if + // the specified id is already used by another API resource in the API hub. + // * If not provided, a system generated id will be used. + // + // This value should be 4-500 characters, and valid characters + // are /[a-z][A-Z][0-9]-_/. + string api_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The API resource to create. + Api api = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// The [GetApi][google.cloud.apihub.v1.ApiHub.GetApi] method's request. +message GetApiRequest { + // Required. The name of the API resource to retrieve. + // Format: `projects/{project}/locations/{location}/apis/{api}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "apihub.googleapis.com/Api" } + ]; +} + +// The [UpdateApi][google.cloud.apihub.v1.ApiHub.UpdateApi] method's request. +message UpdateApiRequest { + // Required. The API resource to update. + // + // The API resource's `name` field is used to identify the API resource to + // update. + // Format: `projects/{project}/locations/{location}/apis/{api}` + Api api = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The list of fields to update. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// The [DeleteApi][google.cloud.apihub.v1.ApiHub.DeleteApi] method's request. +message DeleteApiRequest { + // Required. The name of the API resource to delete. + // Format: `projects/{project}/locations/{location}/apis/{api}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "apihub.googleapis.com/Api" } + ]; + + // Optional. If set to true, any versions from this API will also be deleted. + // Otherwise, the request will only work if the API has no versions. + bool force = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// The [ListApis][google.cloud.apihub.v1.ApiHub.ListApis] method's request. +message ListApisRequest { + // Required. The parent, which owns this collection of API resources. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "apihub.googleapis.com/Api" + } + ]; + + // Optional. An expression that filters the list of ApiResources. + // + // A filter expression consists of a field name, a comparison + // operator, and a value for filtering. The value must be a string. The + // comparison operator must be one of: `<`, `>`, `:` or `=`. Filters are not + // case sensitive. + // + // The following fields in the `ApiResource` are eligible for filtering: + // + // * `owner.email` - The email of the team which owns the ApiResource. + // Allowed comparison operators: `=`. + // * `create_time` - The time at which the ApiResource was created. The + // value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] + // format. Allowed comparison operators: `>` and `<`. + // * `display_name` - The display name of the ApiResource. Allowed + // comparison operators: `=`. + // * `target_user.enum_values.values.id` - The allowed value id of the + // target users attribute associated with the ApiResource. Allowed + // comparison operator is `:`. + // * `target_user.enum_values.values.display_name` - The allowed value + // display name of the target users attribute associated with the + // ApiResource. Allowed comparison operator is `:`. + // * `team.enum_values.values.id` - The allowed value id of the team + // attribute associated with the ApiResource. Allowed comparison operator is + // `:`. + // * `team.enum_values.values.display_name` - The allowed value display name + // of the team attribute associated with the ApiResource. Allowed comparison + // operator is `:`. + // * `business_unit.enum_values.values.id` - The allowed value id of the + // business unit attribute associated with the ApiResource. Allowed + // comparison operator is `:`. + // * `business_unit.enum_values.values.display_name` - The allowed value + // display name of the business unit attribute associated with the + // ApiResource. Allowed comparison operator is `:`. + // * `maturity_level.enum_values.values.id` - The allowed value id of the + // maturity level attribute associated with the ApiResource. Allowed + // comparison operator is `:`. + // * `maturity_level.enum_values.values.display_name` - The allowed value + // display name of the maturity level attribute associated with the + // ApiResource. Allowed comparison operator is `:`. + // * `api_style.enum_values.values.id` - The allowed value id of the + // api style attribute associated with the ApiResource. Allowed + // comparison operator is `:`. + // * `api_style.enum_values.values.display_name` - The allowed value display + // name of the api style attribute associated with the ApiResource. Allowed + // comparison operator is `:`. + // + // Expressions are combined with either `AND` logic operator or `OR` logical + // operator but not both of them together i.e. only one of the `AND` or `OR` + // operator can be used throughout the filter string and both the operators + // cannot be used together. No other logical operators are supported. At most + // three filter fields are allowed in the filter string and if provided + // more than that then `INVALID_ARGUMENT` error is returned by the API. + // + // Here are a few examples: + // + // * `owner.email = \"apihub@google.com\"` - - The owner team email is + // _apihub@google.com_. + // * `owner.email = \"apihub@google.com\" AND create_time < + // \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - + // The owner team email is _apihub@google.com_ and the api was created + // before _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_. + // * `owner.email = \"apihub@google.com\" OR team.enum_values.values.id: + // apihub-team-id` - The filter string specifies the APIs where the owner + // team email is _apihub@google.com_ or the id of the allowed value + // associated with the team attribute is _apihub-team-id_. + // * `owner.email = \"apihub@google.com\" OR + // team.enum_values.values.display_name: ApiHub Team` - The filter string + // specifies the APIs where the owner team email is _apihub@google.com_ or + // the display name of the allowed value associated with the team attribute + // is `ApiHub Team`. + string filter = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The maximum number of API resources to return. The service may + // return fewer than this value. If unspecified, at most 50 Apis will be + // returned. The maximum value is 1000; values above 1000 will be coerced to + // 1000. + int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous `ListApis` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters (except page_size) provided to + // `ListApis` must match the call that provided the page token. + string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// The [ListApis][google.cloud.apihub.v1.ApiHub.ListApis] method's response. +message ListApisResponse { + // The API resources present in the API hub. + repeated Api apis = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// The [CreateVersion][google.cloud.apihub.v1.ApiHub.CreateVersion] method's +// request. +message CreateVersionRequest { + // Required. The parent resource for API version. + // Format: `projects/{project}/locations/{location}/apis/{api}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "apihub.googleapis.com/Api" } + ]; + + // Optional. The ID to use for the API version, which will become the final + // component of the version's resource name. This field is optional. + // + // * If provided, the same will be used. The service will throw an error if + // the specified id is already used by another version in the API resource. + // * If not provided, a system generated id will be used. + // + // This value should be 4-500 characters, and valid characters + // are /[a-z][A-Z][0-9]-_/. + string version_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The version to create. + Version version = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// The [GetVersion][google.cloud.apihub.v1.ApiHub.GetVersion] method's request. +message GetVersionRequest { + // Required. The name of the API version to retrieve. + // Format: + // `projects/{project}/locations/{location}/apis/{api}/versions/{version}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "apihub.googleapis.com/Version" } + ]; +} + +// The [UpdateVersion][google.cloud.apihub.v1.ApiHub.UpdateVersion] method's +// request. +message UpdateVersionRequest { + // Required. The API version to update. + // + // The version's `name` field is used to identify the API version to update. + // Format: + // `projects/{project}/locations/{location}/apis/{api}/versions/{version}` + Version version = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The list of fields to update. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// The [DeleteVersion][google.cloud.apihub.v1.ApiHub.DeleteVersion] method's +// request. +message DeleteVersionRequest { + // Required. The name of the version to delete. + // Format: + // `projects/{project}/locations/{location}/apis/{api}/versions/{version}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "apihub.googleapis.com/Version" } + ]; + + // Optional. If set to true, any specs from this version will also be deleted. + // Otherwise, the request will only work if the version has no specs. + bool force = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// The [ListVersions][google.cloud.apihub.v1.ApiHub.ListVersions] method's +// request. +message ListVersionsRequest { + // Required. The parent which owns this collection of API versions i.e., the + // API resource Format: `projects/{project}/locations/{location}/apis/{api}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "apihub.googleapis.com/Version" + } + ]; + + // Optional. An expression that filters the list of Versions. + // + // A filter expression consists of a field name, a comparison + // operator, and a value for filtering. The value must be a string, a + // number, or a boolean. The comparison operator must be one of: `<`, `>` or + // `=`. Filters are not case sensitive. + // + // The following fields in the `Version` are eligible for filtering: + // + // * `display_name` - The display name of the Version. Allowed + // comparison operators: `=`. + // * `create_time` - The time at which the Version was created. The + // value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] + // format. Allowed comparison operators: `>` and `<`. + // * `lifecycle.enum_values.values.id` - The allowed value id of the + // lifecycle attribute associated with the Version. Allowed comparison + // operators: `:`. + // * `lifecycle.enum_values.values.display_name` - The allowed value display + // name of the lifecycle attribute associated with the Version. Allowed + // comparison operators: `:`. + // * `compliance.enum_values.values.id` - The allowed value id of the + // compliances attribute associated with the Version. Allowed comparison + // operators: `:`. + // * `compliance.enum_values.values.display_name` - The allowed value + // display name of the compliances attribute associated with the Version. + // Allowed comparison operators: `:`. + // * `accreditation.enum_values.values.id` - The allowed value id of the + // accreditations attribute associated with the Version. Allowed + // comparison operators: `:`. + // * `accreditation.enum_values.values.display_name` - The allowed value + // display name of the accreditations attribute associated with the Version. + // Allowed comparison operators: `:`. + // + // Expressions are combined with either `AND` logic operator or `OR` logical + // operator but not both of them together i.e. only one of the `AND` or `OR` + // operator can be used throughout the filter string and both the operators + // cannot be used together. No other logical operators are + // supported. At most three filter fields are allowed in the filter + // string and if provided more than that then `INVALID_ARGUMENT` error is + // returned by the API. + // + // Here are a few examples: + // + // * `lifecycle.enum_values.values.id: preview-id` - The filter string + // specifies that the id of the allowed value associated with the lifecycle + // attribute of the Version is _preview-id_. + // * `lifecycle.enum_values.values.display_name: \"Preview Display Name\"` - + // The filter string specifies that the display name of the allowed value + // associated with the lifecycle attribute of the Version is `Preview + // Display Name`. + // * `lifecycle.enum_values.values.id: preview-id AND create_time < + // \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - + // The id of the allowed value associated with the lifecycle attribute of + // the Version is _preview-id_ and it was created before _2021-08-15 + // 14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_. + // * `compliance.enum_values.values.id: gdpr-id OR + // compliance.enum_values.values.id: pci-dss-id` + // - The id of the allowed value associated with the compliance attribute is + // _gdpr-id_ or _pci-dss-id_. + string filter = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The maximum number of versions to return. The service may return + // fewer than this value. If unspecified, at most 50 versions will be + // returned. The maximum value is 1000; values above 1000 will be coerced to + // 1000. + int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous `ListVersions` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters (except page_size) provided to + // `ListVersions` must match the call that provided the page token. + string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// The [ListVersions][google.cloud.apihub.v1.ApiHub.ListVersions] method's +// response. +message ListVersionsResponse { + // The versions corresponding to an API. + repeated Version versions = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// The [CreateSpec][google.cloud.apihub.v1.ApiHub.CreateSpec] method's request. +message CreateSpecRequest { + // Required. The parent resource for Spec. + // Format: + // `projects/{project}/locations/{location}/apis/{api}/versions/{version}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "apihub.googleapis.com/Version" } + ]; + + // Optional. The ID to use for the spec, which will become the final component + // of the spec's resource name. This field is optional. + // + // * If provided, the same will be used. The service will throw an error if + // the specified id is already used by another spec in the API + // resource. + // * If not provided, a system generated id will be used. + // + // This value should be 4-500 characters, and valid characters + // are /[a-z][A-Z][0-9]-_/. + string spec_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The spec to create. + Spec spec = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// The [GetSpec][google.cloud.apihub.v1.ApiHub.GetSpec] method's request. +message GetSpecRequest { + // Required. The name of the spec to retrieve. + // Format: + // `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "apihub.googleapis.com/Spec" } + ]; +} + +// The [UpdateSpec][google.cloud.apihub.v1.ApiHub.UpdateSpec] method's request. +message UpdateSpecRequest { + // Required. The spec to update. + // + // The spec's `name` field is used to identify the spec to + // update. Format: + // `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}` + Spec spec = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The list of fields to update. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// The [DeleteSpec][google.cloud.apihub.v1.ApiHub.DeleteSpec] method's request. +message DeleteSpecRequest { + // Required. The name of the spec to delete. + // Format: + // `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "apihub.googleapis.com/Spec" } + ]; +} + +// The [ListSpecs][ListSpecs] method's request. +message ListSpecsRequest { + // Required. The parent, which owns this collection of specs. + // Format: + // `projects/{project}/locations/{location}/apis/{api}/versions/{version}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "apihub.googleapis.com/Spec" + } + ]; + + // Optional. An expression that filters the list of Specs. + // + // A filter expression consists of a field name, a comparison + // operator, and a value for filtering. The value must be a string. The + // comparison operator must be one of: `<`, `>`, `:` or `=`. Filters are not + // case sensitive. + // + // The following fields in the `Spec` are eligible for filtering: + // + // * `display_name` - The display name of the Spec. Allowed comparison + // operators: `=`. + // * `create_time` - The time at which the Spec was created. The + // value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] + // format. Allowed comparison operators: `>` and `<`. + // * `spec_type.enum_values.values.id` - The allowed value id of the + // spec_type attribute associated with the Spec. Allowed comparison + // operators: `:`. + // * `spec_type.enum_values.values.display_name` - The allowed value display + // name of the spec_type attribute associated with the Spec. Allowed + // comparison operators: `:`. + // * `lint_response.json_values.values` - The json value of the + // lint_response attribute associated with the Spec. Allowed comparison + // operators: `:`. + // * `mime_type` - The MIME type of the Spec. Allowed comparison + // operators: `=`. + // + // Expressions are combined with either `AND` logic operator or `OR` logical + // operator but not both of them together i.e. only one of the `AND` or `OR` + // operator can be used throughout the filter string and both the operators + // cannot be used together. No other logical operators are + // supported. At most three filter fields are allowed in the filter + // string and if provided more than that then `INVALID_ARGUMENT` error is + // returned by the API. + // + // Here are a few examples: + // + // * `spec_type.enum_values.values.id: rest-id` - The filter + // string specifies that the id of the allowed value associated with the + // spec_type attribute is _rest-id_. + // * `spec_type.enum_values.values.display_name: \"Rest Display Name\"` - + // The filter string specifies that the display name of the allowed value + // associated with the spec_type attribute is `Rest Display Name`. + // * `spec_type.enum_values.values.id: grpc-id AND create_time < + // \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - + // The id of the allowed value associated with the spec_type attribute is + // _grpc-id_ and the spec was created before _2021-08-15 14:50:00 UTC_ and + // after _2021-08-10 12:00:00 UTC_. + // * `spec_type.enum_values.values.id: rest-id OR + // spec_type.enum_values.values.id: grpc-id` + // - The id of the allowed value associated with the spec_type attribute is + // _rest-id_ or _grpc-id_. + string filter = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The maximum number of specs to return. The service may return + // fewer than this value. If unspecified, at most 50 specs will be + // returned. The maximum value is 1000; values above 1000 will be coerced to + // 1000. + int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous `ListSpecs` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListSpecs` must + // match the call that provided the page token. + string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// The [ListSpecs][google.cloud.apihub.v1.ApiHub.ListSpecs] method's response. +message ListSpecsResponse { + // The specs corresponding to an API. + repeated Spec specs = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// The [GetSpecContents][google.cloud.apihub.v1.ApiHub.GetSpecContents] method's +// request. +message GetSpecContentsRequest { + // Required. The name of the spec whose contents need to be retrieved. + // Format: + // `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "apihub.googleapis.com/Spec" } + ]; +} + +// The [GetApiOperation][google.cloud.apihub.v1.ApiHub.GetApiOperation] method's +// request. +message GetApiOperationRequest { + // Required. The name of the operation to retrieve. + // Format: + // `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "apihub.googleapis.com/ApiOperation" + } + ]; +} + +// The [ListApiOperations][google.cloud.apihub.v1.ApiHub.ListApiOperations] +// method's request. +message ListApiOperationsRequest { + // Required. The parent which owns this collection of operations i.e., the API + // version. Format: + // `projects/{project}/locations/{location}/apis/{api}/versions/{version}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "apihub.googleapis.com/ApiOperation" + } + ]; + + // Optional. An expression that filters the list of ApiOperations. + // + // A filter expression consists of a field name, a comparison + // operator, and a value for filtering. The value must be a string or a + // boolean. The comparison operator must be one of: `<`, `>` or + // `=`. Filters are not case sensitive. + // + // The following fields in the `ApiOperation` are eligible for filtering: + // * `name` - The ApiOperation resource name. Allowed comparison + // operators: + // `=`. + // * `details.http_operation.path.path` - The http operation's complete path + // relative to server endpoint. Allowed comparison operators: `=`. + // * `details.http_operation.method` - The http operation method type. + // Allowed comparison operators: `=`. + // * `details.deprecated` - Indicates if the ApiOperation is deprecated. + // Allowed values are True / False indicating the deprycation status of the + // ApiOperation. Allowed comparison operators: `=`. + // * `create_time` - The time at which the ApiOperation was created. The + // value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] + // format. Allowed comparison operators: `>` and `<`. + // + // Expressions are combined with either `AND` logic operator or `OR` logical + // operator but not both of them together i.e. only one of the `AND` or `OR` + // operator can be used throughout the filter string and both the operators + // cannot be used together. No other logical operators are supported. At most + // three filter fields are allowed in the filter string and if provided + // more than that then `INVALID_ARGUMENT` error is returned by the API. + // + // Here are a few examples: + // + // * `details.deprecated = True` - The ApiOperation is deprecated. + // * `details.http_operation.method = GET AND create_time < + // \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - + // The method of the http operation of the ApiOperation is _GET_ and the + // spec was created before _2021-08-15 14:50:00 UTC_ and after _2021-08-10 + // 12:00:00 UTC_. + // * `details.http_operation.method = GET OR details.http_operation.method = + // POST`. - The http operation of the method of ApiOperation is _GET_ or + // _POST_. + string filter = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The maximum number of operations to return. The service may + // return fewer than this value. If unspecified, at most 50 operations will be + // returned. The maximum value is 1000; values above 1000 will be coerced to + // 1000. + int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous `ListApiOperations` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters (except page_size) provided to + // `ListApiOperations` must match the call that provided the page token. + string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// The [ListApiOperations][google.cloud.apihub.v1.ApiHub.ListApiOperations] +// method's response. +message ListApiOperationsResponse { + // The operations corresponding to an API version. + // Only following field will be populated in the response: name, + // spec, details.deprecated, details.http_operation.path.path, + // details.http_operation.method and details.documentation.external_uri. + repeated ApiOperation api_operations = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// The [GetDefinition][google.cloud.apihub.v1.ApiHub.GetDefinition] method's +// request. +message GetDefinitionRequest { + // Required. The name of the definition to retrieve. + // Format: + // `projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "apihub.googleapis.com/Definition" + } + ]; +} + +// The [CreateDeployment][google.cloud.apihub.v1.ApiHub.CreateDeployment] +// method's request. +message CreateDeploymentRequest { + // Required. The parent resource for the deployment resource. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "apihub.googleapis.com/Deployment" + } + ]; + + // Optional. The ID to use for the deployment resource, which will become the + // final component of the deployment's resource name. This field is optional. + // + // * If provided, the same will be used. The service will throw an error if + // the specified id is already used by another deployment resource in the API + // hub. + // * If not provided, a system generated id will be used. + // + // This value should be 4-500 characters, and valid characters + // are /[a-z][A-Z][0-9]-_/. + string deployment_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The deployment resource to create. + Deployment deployment = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// The [GetDeployment][google.cloud.apihub.v1.ApiHub.GetDeployment] method's +// request. +message GetDeploymentRequest { + // Required. The name of the deployment resource to retrieve. + // Format: `projects/{project}/locations/{location}/deployments/{deployment}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "apihub.googleapis.com/Deployment" + } + ]; +} + +// The [UpdateDeployment][google.cloud.apihub.v1.ApiHub.UpdateDeployment] +// method's request. +message UpdateDeploymentRequest { + // Required. The deployment resource to update. + // + // The deployment resource's `name` field is used to identify the deployment + // resource to update. + // Format: `projects/{project}/locations/{location}/deployments/{deployment}` + Deployment deployment = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The list of fields to update. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// The [DeleteDeployment][google.cloud.apihub.v1.ApiHub.DeleteDeployment] +// method's request. +message DeleteDeploymentRequest { + // Required. The name of the deployment resource to delete. + // Format: `projects/{project}/locations/{location}/deployments/{deployment}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "apihub.googleapis.com/Deployment" + } + ]; +} + +// The [ListDeployments][google.cloud.apihub.v1.ApiHub.ListDeployments] method's +// request. +message ListDeploymentsRequest { + // Required. The parent, which owns this collection of deployment resources. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "apihub.googleapis.com/Deployment" + } + ]; + + // Optional. An expression that filters the list of Deployments. + // + // A filter expression consists of a field name, a comparison + // operator, and a value for filtering. The value must be a string. The + // comparison operator must be one of: `<`, `>` or + // `=`. Filters are not case sensitive. + // + // The following fields in the `Deployments` are eligible for filtering: + // + // * `display_name` - The display name of the Deployment. Allowed + // comparison operators: `=`. + // * `create_time` - The time at which the Deployment was created. The + // value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] + // format. Allowed comparison operators: `>` and `<`. + // * `resource_uri` - A URI to the deployment resource. Allowed + // comparison operators: `=`. + // * `api_versions` - The API versions linked to this deployment. Allowed + // comparison operators: `:`. + // * `deployment_type.enum_values.values.id` - The allowed value id of the + // deployment_type attribute associated with the Deployment. Allowed + // comparison operators: `:`. + // * `deployment_type.enum_values.values.display_name` - The allowed value + // display name of the deployment_type attribute associated with the + // Deployment. Allowed comparison operators: `:`. + // * `slo.string_values.values` -The allowed string value of the slo + // attribute associated with the deployment. Allowed comparison + // operators: `:`. + // * `environment.enum_values.values.id` - The allowed value id of the + // environment attribute associated with the deployment. Allowed + // comparison operators: `:`. + // * `environment.enum_values.values.display_name` - The allowed value + // display name of the environment attribute associated with the deployment. + // Allowed comparison operators: `:`. + // + // Expressions are combined with either `AND` logic operator or `OR` logical + // operator but not both of them together i.e. only one of the `AND` or `OR` + // operator can be used throughout the filter string and both the operators + // cannot be used together. No other logical operators are supported. At most + // three filter fields are allowed in the filter string and if provided + // more than that then `INVALID_ARGUMENT` error is returned by the API. + // + // Here are a few examples: + // + // * `environment.enum_values.values.id: staging-id` - The allowed value id + // of the environment attribute associated with the Deployment is + // _staging-id_. + // * `environment.enum_values.values.display_name: \"Staging Deployment\"` - + // The allowed value display name of the environment attribute associated + // with the Deployment is `Staging Deployment`. + // * `environment.enum_values.values.id: production-id AND create_time < + // \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - + // The allowed value id of the environment attribute associated with the + // Deployment is _production-id_ and Deployment was created before + // _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_. + // * `environment.enum_values.values.id: production-id OR + // slo.string_values.values: \"99.99%\"` + // - The allowed value id of the environment attribute Deployment is + // _production-id_ or string value of the slo attribute is _99.99%_. + string filter = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The maximum number of deployment resources to return. The service + // may return fewer than this value. If unspecified, at most 50 deployments + // will be returned. The maximum value is 1000; values above 1000 will be + // coerced to 1000. + int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous `ListDeployments` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters (except page_size) provided to + // `ListDeployments` must match the call that provided the page token. + string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// The [ListDeployments][google.cloud.apihub.v1.ApiHub.ListDeployments] method's +// response. +message ListDeploymentsResponse { + // The deployment resources present in the API hub. + repeated Deployment deployments = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// The [CreateAttribute][google.cloud.apihub.v1.ApiHub.CreateAttribute] method's +// request. +message CreateAttributeRequest { + // Required. The parent resource for Attribute. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "apihub.googleapis.com/Attribute" + } + ]; + + // Optional. The ID to use for the attribute, which will become the final + // component of the attribute's resource name. This field is optional. + // + // * If provided, the same will be used. The service will throw an error if + // the specified id is already used by another attribute resource in the API + // hub. + // * If not provided, a system generated id will be used. + // + // This value should be 4-500 characters, and valid characters + // are /[a-z][A-Z][0-9]-_/. + string attribute_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The attribute to create. + Attribute attribute = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// The [GetAttribute][google.cloud.apihub.v1.ApiHub.GetAttribute] method's +// request. +message GetAttributeRequest { + // Required. The name of the attribute to retrieve. + // Format: + // `projects/{project}/locations/{location}/attributes/{attribute}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "apihub.googleapis.com/Attribute" + } + ]; +} + +// The [UpdateAttribute][google.cloud.apihub.v1.ApiHub.UpdateAttribute] method's +// request. +message UpdateAttributeRequest { + // Required. The attribute to update. + // + // The attribute's `name` field is used to identify the attribute to update. + // Format: + // `projects/{project}/locations/{location}/attributes/{attribute}` + Attribute attribute = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The list of fields to update. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// The [DeleteAttribute][google.cloud.apihub.v1.ApiHub.DeleteAttribute] method's +// request. +message DeleteAttributeRequest { + // Required. The name of the attribute to delete. + // Format: + // `projects/{project}/locations/{location}/attributes/{attribute}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "apihub.googleapis.com/Attribute" + } + ]; +} + +// The [ListAttributes][google.cloud.apihub.v1.ApiHub.ListAttributes] method's +// request. +message ListAttributesRequest { + // Required. The parent resource for Attribute. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "apihub.googleapis.com/Attribute" + } + ]; + + // Optional. An expression that filters the list of Attributes. + // + // A filter expression consists of a field name, a comparison + // operator, and a value for filtering. The value must be a string or a + // boolean. The comparison operator must be one of: `<`, `>` or + // `=`. Filters are not case sensitive. + // + // The following fields in the `Attribute` are eligible for filtering: + // + // * `display_name` - The display name of the Attribute. Allowed + // comparison operators: `=`. + // * `definition_type` - The definition type of the attribute. Allowed + // comparison operators: `=`. + // * `scope` - The scope of the attribute. Allowed comparison operators: + // `=`. + // * `data_type` - The type of the data of the attribute. Allowed + // comparison operators: `=`. + // * `mandatory` - Denotes whether the attribute is mandatory or not. + // Allowed comparison operators: `=`. + // * `create_time` - The time at which the Attribute was created. The + // value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] + // format. Allowed comparison operators: `>` and `<`. + // + // Expressions are combined with either `AND` logic operator or `OR` logical + // operator but not both of them together i.e. only one of the `AND` or `OR` + // operator can be used throughout the filter string and both the operators + // cannot be used together. No other logical operators are + // supported. At most three filter fields are allowed in the filter + // string and if provided more than that then `INVALID_ARGUMENT` error is + // returned by the API. + // + // Here are a few examples: + // + // * `display_name = production` - - The display name of the attribute is + // _production_. + // * `(display_name = production) AND (create_time < + // \"2021-08-15T14:50:00Z\") AND (create_time > \"2021-08-10T12:00:00Z\")` - + // The display name of the attribute is _production_ and the attribute was + // created before _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00 + // UTC_. + // * `display_name = production OR scope = api` - + // The attribute where the display name is _production_ or the scope is + // _api_. + string filter = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The maximum number of attribute resources to return. The service + // may return fewer than this value. If unspecified, at most 50 attributes + // will be returned. The maximum value is 1000; values above 1000 will be + // coerced to 1000. + int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous `ListAttributes` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListAttributes` must + // match the call that provided the page token. + string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// The [ListAttributes][google.cloud.apihub.v1.ApiHub.ListAttributes] method's +// response. +message ListAttributesResponse { + // The list of all attributes. + repeated Attribute attributes = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// The [SearchResources][google.cloud.apihub.v1.ApiHub.SearchResources] method's +// request. +message SearchResourcesRequest { + // Required. The resource name of the location which will be of the type + // `projects/{project_id}/locations/{location_id}`. This field is used to + // identify the instance of API-Hub in which resources should be searched. + string location = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. The free text search query. This query can contain keywords which + // could be related to any detail of the API-Hub resources such display names, + // descriptions, attributes etc. + string query = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An expression that filters the list of search results. + // + // A filter expression consists of a field name, a comparison operator, + // and a value for filtering. The value must be a string, a number, or a + // boolean. The comparison operator must be `=`. Filters are not case + // sensitive. + // + // The following field names are eligible for filtering: + // * `resource_type` - The type of resource in the search results. + // Must be one of the following: `Api`, `ApiOperation`, `Deployment`, + // `Definition`, `Spec` or `Version`. This field can only be specified once + // in the filter. + // + // Here are is an example: + // + // * `resource_type = Api` - The resource_type is _Api_. + string filter = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The maximum number of search results to return. The service may + // return fewer than this value. If unspecified at most 10 search results will + // be returned. If value is negative then `INVALID_ARGUMENT` error is + // returned. The maximum value is 25; values above 25 will be coerced to 25. + // While paginating, you can specify a new page size parameter for each page + // of search results to be listed. + int32 page_size = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous + // [SearchResources][SearchResources] + // call. Specify this parameter to retrieve the next page of transactions. + // + // When paginating, you must specify the `page_token` parameter and all the + // other parameters except + // [page_size][google.cloud.apihub.v1.SearchResourcesRequest.page_size] + // should be specified with the same value which was used in the previous + // call. If the other fields are set with a different value than the previous + // call then `INVALID_ARGUMENT` error is returned. + string page_token = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// ApiHubResource is one of the resources such as Api, Operation, Deployment, +// Definition, Spec and Version resources stored in API-Hub. +message ApiHubResource { + oneof resource { + // This represents Api resource in search results. Only name, display_name, + // description and owner fields are populated in search results. + Api api = 1; + + // This represents ApiOperation resource in search results. Only name, + // and description fields are populated in search results. + ApiOperation operation = 2; + + // This represents Deployment resource in search results. Only name, + // display_name and description fields are populated in search results. + Deployment deployment = 3; + + // This represents Spec resource in search results. Only name, + // display_name and description fields are populated in search results. + Spec spec = 4; + + // This represents Definition resource in search results. + // Only name field is populated in search results. + Definition definition = 5; + + // This represents Version resource in search results. Only name, + // display_name and description fields are populated in search results. + Version version = 6; + } +} + +// Represents the search results. +message SearchResult { + // This represents the ApiHubResource. + // Note: Only selected fields of the resources are populated in response. + ApiHubResource resource = 1; +} + +// Response for the +// [SearchResources][google.cloud.apihub.v1.ApiHub.SearchResources] method. +message SearchResourcesResponse { + // List of search results according to the filter and search query specified. + // The order of search results represents the ranking. + repeated SearchResult search_results = 1; + + // Pass this token in the + // [SearchResourcesRequest][google.cloud.apihub.v1.SearchResourcesRequest] + // to continue to list results. If all results have been returned, this field + // is an empty string or not present in the response. + string next_page_token = 2; +} + +// The +// [CreateDependency][google.cloud.apihub.v1.ApiHubDependencies.CreateDependency] +// method's request. +message CreateDependencyRequest { + // Required. The parent resource for the dependency resource. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "apihub.googleapis.com/Dependency" + } + ]; + + // Optional. The ID to use for the dependency resource, which will become the + // final component of the dependency's resource name. This field is optional. + // * If provided, the same will be used. The service will throw an error if + // duplicate id is provided by the client. + // * If not provided, a system generated id will be used. + // + // This value should be 4-500 characters, and valid characters + // are `[a-z][A-Z][0-9]-_`. + string dependency_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The dependency resource to create. + Dependency dependency = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// The [GetDependency][.ApiHubDependencies.GetDependency] +// method's request. +message GetDependencyRequest { + // Required. The name of the dependency resource to retrieve. + // Format: `projects/{project}/locations/{location}/dependencies/{dependency}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "apihub.googleapis.com/Dependency" + } + ]; +} + +// The +// [UpdateDependency][google.cloud.apihub.v1.ApiHubDependencies.UpdateDependency] +// method's request. +message UpdateDependencyRequest { + // Required. The dependency resource to update. + // + // The dependency's `name` field is used to identify the dependency to update. + // Format: `projects/{project}/locations/{location}/dependencies/{dependency}` + Dependency dependency = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The list of fields to update. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// The +// [DeleteDependency][google.cloud.apihub.v1.ApiHubDependencies.DeleteDependency] +// method's request. +message DeleteDependencyRequest { + // Required. The name of the dependency resource to delete. + // Format: `projects/{project}/locations/{location}/dependencies/{dependency}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "apihub.googleapis.com/Dependency" + } + ]; +} + +// The +// [ListDependencies][google.cloud.apihub.v1.ApiHubDependencies.ListDependencies] +// method's request. +message ListDependenciesRequest { + // Required. The parent which owns this collection of dependency resources. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "apihub.googleapis.com/Dependency" + } + ]; + + // Optional. An expression that filters the list of Dependencies. + // + // A filter expression consists of a field name, a comparison operator, and + // a value for filtering. The value must be a string. Allowed comparison + // operator is `=`. Filters are not case sensitive. + // + // The following fields in the `Dependency` are eligible for filtering: + // + // * `consumer.operation_resource_name` - The operation resource name for + // the consumer entity involved in a dependency. Allowed comparison + // operators: `=`. + // * `consumer.external_api_resource_name` - The external api resource name + // for the consumer entity involved in a dependency. Allowed comparison + // operators: `=`. + // * `supplier.operation_resource_name` - The operation resource name for + // the supplier entity involved in a dependency. Allowed comparison + // operators: `=`. + // * `supplier.external_api_resource_name` - The external api resource name + // for the supplier entity involved in a dependency. Allowed comparison + // operators: `=`. + // + // Expressions are combined with either `AND` logic operator or `OR` logical + // operator but not both of them together i.e. only one of the `AND` or `OR` + // operator can be used throughout the filter string and both the operators + // cannot be used together. No other logical operators are supported. At most + // three filter fields are allowed in the filter string and if provided + // more than that then `INVALID_ARGUMENT` error is returned by the API. + // + // For example, `consumer.operation_resource_name = + // \"projects/p1/locations/global/apis/a1/versions/v1/operations/o1\" OR + // supplier.operation_resource_name = + // \"projects/p1/locations/global/apis/a1/versions/v1/operations/o1\"` - The + // dependencies with either consumer or supplier operation resource name as + // _projects/p1/locations/global/apis/a1/versions/v1/operations/o1_. + string filter = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The maximum number of dependency resources to return. The service + // may return fewer than this value. If unspecified, at most 50 dependencies + // will be returned. The maximum value is 1000; values above 1000 will be + // coerced to 1000. + int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous `ListDependencies` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListDependencies` must + // match the call that provided the page token. + string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// The +// [ListDependencies][google.cloud.apihub.v1.ApiHubDependencies.ListDependencies] +// method's response. +message ListDependenciesResponse { + // The dependency resources present in the API hub. + // Only following field will be populated in the response: name. + repeated Dependency dependencies = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// The [CreateExternalApi][google.cloud.apihub.v1.ApiHub.CreateExternalApi] +// method's request. +message CreateExternalApiRequest { + // Required. The parent resource for the External API resource. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "apihub.googleapis.com/ExternalApi" + } + ]; + + // Optional. The ID to use for the External API resource, which will become + // the final component of the External API's resource name. This field is + // optional. + // + // * If provided, the same will be used. The service will throw an error if + // the specified id is already used by another External API resource in the + // API hub. + // * If not provided, a system generated id will be used. + // + // This value should be 4-500 characters, and valid characters + // are /[a-z][A-Z][0-9]-_/. + string external_api_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The External API resource to create. + ExternalApi external_api = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// The [GetExternalApi][google.cloud.apihub.v1.ApiHub.GetExternalApi] method's +// request. +message GetExternalApiRequest { + // Required. The name of the External API resource to retrieve. + // Format: + // `projects/{project}/locations/{location}/externalApis/{externalApi}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "apihub.googleapis.com/ExternalApi" + } + ]; +} + +// The [UpdateExternalApi][google.cloud.apihub.v1.ApiHub.UpdateExternalApi] +// method's request. +message UpdateExternalApiRequest { + // Required. The External API resource to update. + // + // The External API resource's `name` field is used to identify the External + // API resource to update. Format: + // `projects/{project}/locations/{location}/externalApis/{externalApi}` + ExternalApi external_api = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The list of fields to update. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// The [DeleteExternalApi][google.cloud.apihub.v1.ApiHub.DeleteExternalApi] +// method's request. +message DeleteExternalApiRequest { + // Required. The name of the External API resource to delete. + // Format: + // `projects/{project}/locations/{location}/externalApis/{externalApi}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "apihub.googleapis.com/ExternalApi" + } + ]; +} + +// The [ListExternalApis][google.cloud.apihub.v1.ApiHub.ListExternalApis] +// method's request. +message ListExternalApisRequest { + // Required. The parent, which owns this collection of External API resources. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "apihub.googleapis.com/ExternalApi" + } + ]; + + // Optional. The maximum number of External API resources to return. The + // service may return fewer than this value. If unspecified, at most 50 + // ExternalApis will be returned. The maximum value is 1000; values above 1000 + // will be coerced to 1000. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous `ListExternalApis` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters (except page_size) provided to + // `ListExternalApis` must match the call that provided the page token. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// The [ListExternalApis][google.cloud.apihub.v1.ApiHub.ListExternalApis] +// method's response. +message ListExternalApisResponse { + // The External API resources present in the API hub. + // Only following fields will be populated in the response: name, + // display_name, documentation.external_uri. + repeated ExternalApi external_apis = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} diff --git a/owl-bot-staging/google-cloud-apihub/v1/protos/google/cloud/apihub/v1/common_fields.proto b/owl-bot-staging/google-cloud-apihub/v1/protos/google/cloud/apihub/v1/common_fields.proto new file mode 100644 index 00000000000..9d1c87f19a1 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/protos/google/cloud/apihub/v1/common_fields.proto @@ -0,0 +1,1297 @@ +// Copyright 2024 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.apihub.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.ApiHub.V1"; +option go_package = "cloud.google.com/go/apihub/apiv1/apihubpb;apihubpb"; +option java_multiple_files = true; +option java_outer_classname = "CommonFieldsProto"; +option java_package = "com.google.cloud.apihub.v1"; +option php_namespace = "Google\\Cloud\\ApiHub\\V1"; +option ruby_package = "Google::Cloud::ApiHub::V1"; +option (google.api.resource_definition) = { + type: "aiplatform.googleapis.com/Extension" + pattern: "projects/{project}/locations/{location}/extensions/{extension}" +}; + +// Lint state represents success or failure for linting. +enum LintState { + // Lint state unspecified. + LINT_STATE_UNSPECIFIED = 0; + + // Linting was completed successfully. + LINT_STATE_SUCCESS = 1; + + // Linting encountered errors. + LINT_STATE_ERROR = 2; +} + +// Enumeration of linter types. +enum Linter { + // Linter type unspecified. + LINTER_UNSPECIFIED = 0; + + // Linter type spectral. + SPECTRAL = 1; + + // Linter type other. + OTHER = 2; +} + +// Severity of the issue. +enum Severity { + // Severity unspecified. + SEVERITY_UNSPECIFIED = 0; + + // Severity error. + SEVERITY_ERROR = 1; + + // Severity warning. + SEVERITY_WARNING = 2; + + // Severity info. + SEVERITY_INFO = 3; + + // Severity hint. + SEVERITY_HINT = 4; +} + +// An API resource in the API Hub. +message Api { + option (google.api.resource) = { + type: "apihub.googleapis.com/Api" + pattern: "projects/{project}/locations/{location}/apis/{api}" + plural: "apis" + singular: "api" + }; + + // Identifier. The name of the API resource in the API Hub. + // + // Format: + // `projects/{project}/locations/{location}/apis/{api}` + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Required. The display name of the API resource. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The description of the API resource. + string description = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The documentation for the API resource. + Documentation documentation = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Owner details for the API resource. + Owner owner = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The list of versions present in an API resource. + // Note: An API resource can be associated with more than 1 version. + // Format is + // `projects/{project}/locations/{location}/apis/{api}/versions/{version}` + repeated string versions = 6 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { type: "apihub.googleapis.com/Version" } + ]; + + // Output only. The time at which the API resource was created. + google.protobuf.Timestamp create_time = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which the API resource was last updated. + google.protobuf.Timestamp update_time = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The target users for the API. + // This maps to the following system defined attribute: + // `projects/{project}/locations/{location}/attributes/system-target-user` + // attribute. + // The number of values for this attribute will be based on the + // cardinality of the attribute. The same can be retrieved via GetAttribute + // API. All values should be from the list of allowed values defined for the + // attribute. + AttributeValues target_user = 9 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The team owning the API. + // This maps to the following system defined attribute: + // `projects/{project}/locations/{location}/attributes/system-team` + // attribute. + // The number of values for this attribute will be based on the + // cardinality of the attribute. The same can be retrieved via GetAttribute + // API. All values should be from the list of allowed values defined for the + // attribute. + AttributeValues team = 10 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The business unit owning the API. + // This maps to the following system defined attribute: + // `projects/{project}/locations/{location}/attributes/system-business-unit` + // attribute. + // The number of values for this attribute will be based on the + // cardinality of the attribute. The same can be retrieved via GetAttribute + // API. All values should be from the list of allowed values defined for the + // attribute. + AttributeValues business_unit = 11 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The maturity level of the API. + // This maps to the following system defined attribute: + // `projects/{project}/locations/{location}/attributes/system-maturity-level` + // attribute. + // The number of values for this attribute will be based on the + // cardinality of the attribute. The same can be retrieved via GetAttribute + // API. All values should be from the list of allowed values defined for the + // attribute. + AttributeValues maturity_level = 12 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The list of user defined attributes associated with the API + // resource. The key is the attribute name. It will be of the format: + // `projects/{project}/locations/{location}/attributes/{attribute}`. + // The value is the attribute values associated with the resource. + map attributes = 13 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The style of the API. + // This maps to the following system defined attribute: + // `projects/{project}/locations/{location}/attributes/system-api-style` + // attribute. + // The number of values for this attribute will be based on the + // cardinality of the attribute. The same can be retrieved via GetAttribute + // API. All values should be from the list of allowed values defined for the + // attribute. + AttributeValues api_style = 14 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The selected version for an API resource. + // This can be used when special handling is needed on client side for + // particular version of the API. Format is + // `projects/{project}/locations/{location}/apis/{api}/versions/{version}` + string selected_version = 15 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { type: "apihub.googleapis.com/Version" } + ]; +} + +// Represents a version of the API resource in API hub. This is also referred +// to as the API version. +message Version { + option (google.api.resource) = { + type: "apihub.googleapis.com/Version" + pattern: "projects/{project}/locations/{location}/apis/{api}/versions/{version}" + plural: "versions" + singular: "version" + }; + + // Identifier. The name of the version. + // + // Format: + // `projects/{project}/locations/{location}/apis/{api}/versions/{version}` + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Required. The display name of the version. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The description of the version. + string description = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The documentation of the version. + Documentation documentation = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The specs associated with this version. + // Note that an API version can be associated with multiple specs. + // Format is + // `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}` + repeated string specs = 5 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { type: "apihub.googleapis.com/Spec" } + ]; + + // Output only. The operations contained in the API version. + // These operations will be added to the version when a new spec is + // added or when an existing spec is updated. Format is + // `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}` + repeated string api_operations = 6 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "apihub.googleapis.com/ApiOperation" + } + ]; + + // Output only. The definitions contained in the API version. + // These definitions will be added to the version when a new spec is + // added or when an existing spec is updated. Format is + // `projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}` + repeated string definitions = 7 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "apihub.googleapis.com/Definition" + } + ]; + + // Optional. The deployments linked to this API version. + // Note: A particular API version could be deployed to multiple deployments + // (for dev deployment, UAT deployment, etc) + // Format is + // `projects/{project}/locations/{location}/deployments/{deployment}` + repeated string deployments = 8 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "apihub.googleapis.com/Deployment" + } + ]; + + // Output only. The time at which the version was created. + google.protobuf.Timestamp create_time = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which the version was last updated. + google.protobuf.Timestamp update_time = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The lifecycle of the API version. + // This maps to the following system defined attribute: + // `projects/{project}/locations/{location}/attributes/system-lifecycle` + // attribute. + // The number of values for this attribute will be based on the + // cardinality of the attribute. The same can be retrieved via GetAttribute + // API. All values should be from the list of allowed values defined for the + // attribute. + AttributeValues lifecycle = 11 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The compliance associated with the API version. + // This maps to the following system defined attribute: + // `projects/{project}/locations/{location}/attributes/system-compliance` + // attribute. + // The number of values for this attribute will be based on the + // cardinality of the attribute. The same can be retrieved via GetAttribute + // API. All values should be from the list of allowed values defined for the + // attribute. + AttributeValues compliance = 12 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The accreditations associated with the API version. + // This maps to the following system defined attribute: + // `projects/{project}/locations/{location}/attributes/system-accreditation` + // attribute. + // The number of values for this attribute will be based on the + // cardinality of the attribute. The same can be retrieved via GetAttribute + // API. All values should be from the list of allowed values defined for the + // attribute. + AttributeValues accreditation = 13 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The list of user defined attributes associated with the Version + // resource. The key is the attribute name. It will be of the format: + // `projects/{project}/locations/{location}/attributes/{attribute}`. + // The value is the attribute values associated with the resource. + map attributes = 14 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The selected deployment for a Version resource. + // This can be used when special handling is needed on client side for a + // particular deployment linked to the version. + // Format is + // `projects/{project}/locations/{location}/deployments/{deployment}` + string selected_deployment = 16 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "apihub.googleapis.com/Deployment" + } + ]; +} + +// Represents a spec associated with an API version in the API +// Hub. Note that specs of various types can be uploaded, however +// parsing of details is supported for OpenAPI spec currently. +message Spec { + option (google.api.resource) = { + type: "apihub.googleapis.com/Spec" + pattern: "projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}" + plural: "specs" + singular: "spec" + }; + + // Specifies the parsing mode for API specifications during creation and + // update. + // - `RELAXED`: Parsing errors in the specification content do not fail the + // API call. + // - `STRICT`: Parsing errors in the specification content result in failure + // of the API call. + // If not specified, defaults to `RELAXED`. + enum ParsingMode { + // Defaults to `RELAXED`. + PARSING_MODE_UNSPECIFIED = 0; + + // Parsing of the Spec on create and update is relaxed, meaning that + // parsing errors the spec contents will not fail the API call. + RELAXED = 1; + + // Parsing of the Spec on create and update is strict, meaning that + // parsing errors in the spec contents will fail the API call. + STRICT = 2; + } + + // Identifier. The name of the spec. + // + // Format: + // `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}` + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Required. The display name of the spec. + // This can contain the file name of the spec. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The type of spec. + // The value should be one of the allowed values defined for + // `projects/{project}/locations/{location}/attributes/system-spec-type` + // attribute. + // The number of values for this attribute will be based on the + // cardinality of the attribute. The same can be retrieved via GetAttribute + // API. + // + // Note, this field is mandatory if content is provided. + AttributeValues spec_type = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Input only. The contents of the uploaded spec. + SpecContents contents = 4 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.field_behavior) = INPUT_ONLY + ]; + + // Output only. Details parsed from the spec. + SpecDetails details = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The URI of the spec source in case file is uploaded + // from an external version control system. + string source_uri = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The time at which the spec was created. + google.protobuf.Timestamp create_time = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which the spec was last updated. + google.protobuf.Timestamp update_time = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The lint response for the spec. + LintResponse lint_response = 9 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The list of user defined attributes associated with the spec. + // The key is the attribute name. It will be of the format: + // `projects/{project}/locations/{location}/attributes/{attribute}`. + // The value is the attribute values associated with the resource. + map attributes = 10 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The documentation of the spec. + // For OpenAPI spec, this will be populated from `externalDocs` in OpenAPI + // spec. + Documentation documentation = 11 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Input only. Enum specifying the parsing mode for OpenAPI + // Specification (OAS) parsing. + ParsingMode parsing_mode = 12 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.field_behavior) = INPUT_ONLY + ]; +} + +// Details of the deployment where APIs are hosted. +// A deployment could represent an Apigee proxy, API gateway, other Google Cloud +// services or non-Google Cloud services as well. A deployment entity is a root +// level entity in the API hub and exists independent of any API. +message Deployment { + option (google.api.resource) = { + type: "apihub.googleapis.com/Deployment" + pattern: "projects/{project}/locations/{location}/deployments/{deployment}" + plural: "deployments" + singular: "deployment" + }; + + // Identifier. The name of the deployment. + // + // Format: + // `projects/{project}/locations/{location}/deployments/{deployment}` + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Required. The display name of the deployment. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The description of the deployment. + string description = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The documentation of the deployment. + Documentation documentation = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The type of deployment. + // This maps to the following system defined attribute: + // `projects/{project}/locations/{location}/attributes/system-deployment-type` + // attribute. + // The number of values for this attribute will be based on the + // cardinality of the attribute. The same can be retrieved via GetAttribute + // API. All values should be from the list of allowed values defined for the + // attribute. + AttributeValues deployment_type = 5 [(google.api.field_behavior) = REQUIRED]; + + // Required. A URI to the runtime resource. This URI can be used to manage the + // resource. For example, if the runtime resource is of type APIGEE_PROXY, + // then this field will contain the URI to the management UI of the proxy. + string resource_uri = 6 [(google.api.field_behavior) = REQUIRED]; + + // Required. The endpoints at which this deployment resource is listening for + // API requests. This could be a list of complete URIs, hostnames or an IP + // addresses. + repeated string endpoints = 7 [(google.api.field_behavior) = REQUIRED]; + + // Output only. The API versions linked to this deployment. + // Note: A particular deployment could be linked to multiple different API + // versions (of same or different APIs). + repeated string api_versions = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which the deployment was created. + google.protobuf.Timestamp create_time = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which the deployment was last updated. + google.protobuf.Timestamp update_time = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The SLO for this deployment. + // This maps to the following system defined attribute: + // `projects/{project}/locations/{location}/attributes/system-slo` + // attribute. + // The number of values for this attribute will be based on the + // cardinality of the attribute. The same can be retrieved via GetAttribute + // API. All values should be from the list of allowed values defined for the + // attribute. + AttributeValues slo = 11 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The environment mapping to this deployment. + // This maps to the following system defined attribute: + // `projects/{project}/locations/{location}/attributes/system-environment` + // attribute. + // The number of values for this attribute will be based on the + // cardinality of the attribute. The same can be retrieved via GetAttribute + // API. All values should be from the list of allowed values defined for the + // attribute. + AttributeValues environment = 12 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The list of user defined attributes associated with the + // deployment resource. The key is the attribute name. It will be of the + // format: `projects/{project}/locations/{location}/attributes/{attribute}`. + // The value is the attribute values associated with the resource. + map attributes = 13 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Represents an operation contained in an API version in the API Hub. +// An operation is added/updated/deleted in an API version when a new spec is +// added or an existing spec is updated/deleted in a version. +// Currently, an operation will be created only corresponding to OpenAPI spec as +// parsing is supported for OpenAPI spec. +message ApiOperation { + option (google.api.resource) = { + type: "apihub.googleapis.com/ApiOperation" + pattern: "projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}" + plural: "apiOperations" + singular: "apiOperation" + }; + + // Identifier. The name of the operation. + // + // Format: + // `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}` + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Output only. The name of the spec from where the operation was parsed. + // Format is + // `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}` + string spec = 2 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { type: "apihub.googleapis.com/Spec" } + ]; + + // Output only. Operation details. + OperationDetails details = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which the operation was created. + google.protobuf.Timestamp create_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which the operation was last updated. + google.protobuf.Timestamp update_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The list of user defined attributes associated with the API + // operation resource. The key is the attribute name. It will be of the + // format: `projects/{project}/locations/{location}/attributes/{attribute}`. + // The value is the attribute values associated with the resource. + map attributes = 6 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Represents a definition for example schema, request, response definitions +// contained in an API version. +// A definition is added/updated/deleted in an API version when a new spec is +// added or an existing spec is updated/deleted in a version. Currently, +// definition will be created only corresponding to OpenAPI spec as parsing is +// supported for OpenAPI spec. Also, within OpenAPI spec, only `schema` object +// is supported. +message Definition { + option (google.api.resource) = { + type: "apihub.googleapis.com/Definition" + pattern: "projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}" + plural: "definitions" + singular: "definition" + }; + + // Enumeration of definition types. + enum Type { + // Definition type unspecified. + TYPE_UNSPECIFIED = 0; + + // Definition type schema. + SCHEMA = 1; + } + + oneof value { + // Output only. The value of a schema definition. + Schema schema = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Identifier. The name of the definition. + // + // Format: + // `projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}` + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Output only. The name of the spec from where the definition was parsed. + // Format is + // `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}` + string spec = 2 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { type: "apihub.googleapis.com/Spec" } + ]; + + // Output only. The type of the definition. + Type type = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which the definition was created. + google.protobuf.Timestamp create_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which the definition was last updated. + google.protobuf.Timestamp update_time = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The list of user defined attributes associated with the + // definition resource. The key is the attribute name. It will be of the + // format: `projects/{project}/locations/{location}/attributes/{attribute}`. + // The value is the attribute values associated with the resource. + map attributes = 7 + [(google.api.field_behavior) = OPTIONAL]; +} + +// An attribute in the API Hub. +// An attribute is a name value pair which can be attached to different +// resources in the API hub based on the scope of the attribute. Attributes can +// either be pre-defined by the API Hub or created by users. +message Attribute { + option (google.api.resource) = { + type: "apihub.googleapis.com/Attribute" + pattern: "projects/{project}/locations/{location}/attributes/{attribute}" + plural: "attributes" + singular: "attribute" + }; + + // The value that can be assigned to the attribute when the data type is + // enum. + message AllowedValue { + // Required. The ID of the allowed value. + // * If provided, the same will be used. The service will throw an error if + // the specified id is already used by another allowed value in the same + // attribute resource. + // * If not provided, a system generated id derived from the display name + // will be used. In this case, the service will handle conflict resolution + // by adding a system generated suffix in case of duplicates. + // + // This value should be 4-63 characters, and valid characters + // are /[a-z][0-9]-/. + string id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The display name of the allowed value. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The detailed description of the allowed value. + string description = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. When set to true, the allowed value cannot be updated or + // deleted by the user. It can only be true for System defined attributes. + bool immutable = 4 [(google.api.field_behavior) = OPTIONAL]; + } + + // Enumeration of attribute definition types. + enum DefinitionType { + // Attribute definition type unspecified. + DEFINITION_TYPE_UNSPECIFIED = 0; + + // The attribute is predefined by the API Hub. Note that only the list of + // allowed values can be updated in this case via UpdateAttribute method. + SYSTEM_DEFINED = 1; + + // The attribute is defined by the user. + USER_DEFINED = 2; + } + + // Enumeration for the scope of the attribute representing the resource in the + // API Hub to which the attribute can be linked. + enum Scope { + // Scope Unspecified. + SCOPE_UNSPECIFIED = 0; + + // Attribute can be linked to an API. + API = 1; + + // Attribute can be linked to an API version. + VERSION = 2; + + // Attribute can be linked to a Spec. + SPEC = 3; + + // Attribute can be linked to an API Operation. + API_OPERATION = 4; + + // Attribute can be linked to a Deployment. + DEPLOYMENT = 5; + + // Attribute can be linked to a Dependency. + DEPENDENCY = 6; + + // Attribute can be linked to a definition. + DEFINITION = 7; + + // Attribute can be linked to a ExternalAPI. + EXTERNAL_API = 8; + + // Attribute can be linked to a Plugin. + PLUGIN = 9; + } + + // Enumeration of attribute's data type. + enum DataType { + // Attribute data type unspecified. + DATA_TYPE_UNSPECIFIED = 0; + + // Attribute's value is of type enum. + ENUM = 1; + + // Attribute's value is of type json. + JSON = 2; + + // Attribute's value is of type string. + STRING = 3; + } + + // Identifier. The name of the attribute in the API Hub. + // + // Format: + // `projects/{project}/locations/{location}/attributes/{attribute}` + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Required. The display name of the attribute. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The description of the attribute. + string description = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The definition type of the attribute. + DefinitionType definition_type = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The scope of the attribute. It represents the resource in the API + // Hub to which the attribute can be linked. + Scope scope = 5 [(google.api.field_behavior) = REQUIRED]; + + // Required. The type of the data of the attribute. + DataType data_type = 6 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The list of allowed values when the attribute value is of type + // enum. This is required when the data_type of the attribute is ENUM. The + // maximum number of allowed values of an attribute will be 1000. + repeated AllowedValue allowed_values = 7 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The maximum number of values that the attribute can have when + // associated with an API Hub resource. Cardinality 1 would represent a + // single-valued attribute. It must not be less than 1 or greater than 20. If + // not specified, the cardinality would be set to 1 by default and represent a + // single-valued attribute. + int32 cardinality = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. When mandatory is true, the attribute is mandatory for the + // resource specified in the scope. Only System defined attributes can be + // mandatory. + bool mandatory = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which the attribute was created. + google.protobuf.Timestamp create_time = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which the attribute was last updated. + google.protobuf.Timestamp update_time = 11 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// The spec contents. +message SpecContents { + // Required. The contents of the spec. + bytes contents = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The mime type of the content for example application/json, + // application/yaml, application/wsdl etc. + string mime_type = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// SpecDetails contains the details parsed from supported +// spec types. +message SpecDetails { + oneof details { + // Output only. Additional details apart from `OperationDetails` parsed from + // an OpenAPI spec. The OperationDetails parsed from the spec can be + // obtained by using + // [ListAPIOperations][google.cloud.apihub.v1.ApiHub.ListApiOperations] + // method. + OpenApiSpecDetails open_api_spec_details = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Output only. The description of the spec. + string description = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// OpenApiSpecDetails contains the details parsed from an OpenAPI spec in +// addition to the fields mentioned in +// [SpecDetails][google.cloud.apihub.v1.SpecDetails]. +message OpenApiSpecDetails { + // Enumeration of spec formats. + enum Format { + // SpecFile type unspecified. + FORMAT_UNSPECIFIED = 0; + + // OpenAPI Spec v2.0. + OPEN_API_SPEC_2_0 = 1; + + // OpenAPI Spec v3.0. + OPEN_API_SPEC_3_0 = 2; + + // OpenAPI Spec v3.1. + OPEN_API_SPEC_3_1 = 3; + } + + // Output only. The format of the spec. + Format format = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The version in the spec. + // This maps to `info.version` in OpenAPI spec. + string version = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Owner details for the spec. + // This maps to `info.contact` in OpenAPI spec. + Owner owner = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// The operation details parsed from the spec. +message OperationDetails { + oneof operation { + // The HTTP Operation. + HttpOperation http_operation = 4; + } + + // Output only. Description of the operation behavior. + // For OpenAPI spec, this will map to `operation.description` in the + // spec, in case description is empty, `operation.summary` will be used. + string description = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Additional external documentation for this operation. + // For OpenAPI spec, this will map to `operation.documentation` in the spec. + Documentation documentation = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. For OpenAPI spec, this will be set if `operation.deprecated`is + // marked as `true` in the spec. + bool deprecated = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// The HTTP Operation. +message HttpOperation { + // Enumeration of Method types. + enum Method { + // Method unspecified. + METHOD_UNSPECIFIED = 0; + + // Get Operation type. + GET = 1; + + // Put Operation type. + PUT = 2; + + // Post Operation type. + POST = 3; + + // Delete Operation type. + DELETE = 4; + + // Options Operation type. + OPTIONS = 5; + + // Head Operation type. + HEAD = 6; + + // Patch Operation type. + PATCH = 7; + + // Trace Operation type. + TRACE = 8; + } + + // Output only. The path details for the Operation. + Path path = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Operation method + Method method = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// The path details derived from the spec. +message Path { + // Output only. Complete path relative to server endpoint. + string path = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A short description for the path applicable to all operations. + string description = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// The schema details derived from the spec. Currently, this entity is supported +// for OpenAPI spec only. +// For OpenAPI spec, this maps to the schema defined in +// the `definitions` section for OpenAPI 2.0 version and in +// `components.schemas` section for OpenAPI 3.0 and 3.1 version. +message Schema { + // Output only. The display name of the schema. + // This will map to the name of the schema in the spec. + string display_name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The raw value of the schema definition corresponding to the + // schema name in the spec. + bytes raw_value = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Owner details. +message Owner { + // Optional. The name of the owner. + string display_name = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The email of the owner. + string email = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Documentation details. +message Documentation { + // Optional. The uri of the externally hosted documentation. + string external_uri = 1 [(google.api.field_behavior) = OPTIONAL]; +} + +// The attribute values associated with resource. +message AttributeValues { + // The attribute values of data type enum. + message EnumAttributeValues { + // Required. The attribute values in case attribute data type is enum. + repeated Attribute.AllowedValue values = 1 + [(google.api.field_behavior) = REQUIRED]; + } + + // The attribute values of data type string or JSON. + message StringAttributeValues { + // Required. The attribute values in case attribute data type is string or + // JSON. + repeated string values = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // The attribute values associated with the resource. + oneof Value { + // The attribute values associated with a resource in case attribute data + // type is enum. + EnumAttributeValues enum_values = 2; + + // The attribute values associated with a resource in case attribute data + // type is string. + StringAttributeValues string_values = 3; + + // The attribute values associated with a resource in case attribute data + // type is JSON. + StringAttributeValues json_values = 4; + } + + // Output only. The name of the attribute. + // Format: projects/{project}/locations/{location}/attributes/{attribute} + string attribute = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "apihub.googleapis.com/Attribute" + } + ]; +} + +// A dependency resource defined in the API hub describes a dependency directed +// from a consumer to a supplier entity. A dependency can be defined between two +// [Operations][google.cloud.apihub.v1.Operation] or between +// an [Operation][google.cloud.apihub.v1.Operation] and [External +// API][google.cloud.apihub.v1.ExternalApi]. +message Dependency { + option (google.api.resource) = { + type: "apihub.googleapis.com/Dependency" + pattern: "projects/{project}/locations/{location}/dependencies/{dependency}" + plural: "dependencies" + singular: "dependency" + }; + + // Possible states for a dependency. + enum State { + // Default value. This value is unused. + STATE_UNSPECIFIED = 0; + + // Dependency will be in a proposed state when it is newly identified by the + // API hub on its own. + PROPOSED = 1; + + // Dependency will be in a validated state when it is validated by the + // admin or manually created in the API hub. + VALIDATED = 2; + } + + // Possible modes of discovering the dependency. + enum DiscoveryMode { + // Default value. This value is unused. + DISCOVERY_MODE_UNSPECIFIED = 0; + + // Manual mode of discovery when the dependency is defined by the user. + MANUAL = 1; + } + + // Identifier. The name of the dependency in the API Hub. + // + // Format: `projects/{project}/locations/{location}/dependencies/{dependency}` + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Required. Immutable. The entity acting as the consumer in the dependency. + DependencyEntityReference consumer = 2 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.field_behavior) = REQUIRED + ]; + + // Required. Immutable. The entity acting as the supplier in the dependency. + DependencyEntityReference supplier = 3 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.field_behavior) = REQUIRED + ]; + + // Output only. State of the dependency. + State state = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Human readable description corresponding of the dependency. + string description = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Discovery mode of the dependency. + DiscoveryMode discovery_mode = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Error details of a dependency if the system has detected it + // internally. + DependencyErrorDetail error_detail = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which the dependency was created. + google.protobuf.Timestamp create_time = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which the dependency was last updated. + google.protobuf.Timestamp update_time = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The list of user defined attributes associated with the + // dependency resource. The key is the attribute name. It will be of the + // format: `projects/{project}/locations/{location}/attributes/{attribute}`. + // The value is the attribute values associated with the resource. + map attributes = 10 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Reference to an entity participating in a dependency. +message DependencyEntityReference { + // Required. Unique identifier for the participating entity. + oneof identifier { + // The resource name of an operation in the API Hub. + // + // Format: + // `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}` + string operation_resource_name = 2; + + // The resource name of an external API in the API Hub. + // + // Format: + // `projects/{project}/locations/{location}/externalApis/{external_api}` + string external_api_resource_name = 3; + } + + // Output only. Display name of the entity. + string display_name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Details describing error condition of a dependency. +message DependencyErrorDetail { + // Possible values representing an error in the dependency. + enum Error { + // Default value used for no error in the dependency. + ERROR_UNSPECIFIED = 0; + + // Supplier entity has been deleted. + SUPPLIER_NOT_FOUND = 1; + + // Supplier entity has been recreated. + SUPPLIER_RECREATED = 2; + } + + // Optional. Error in the dependency. + Error error = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Timestamp at which the error was found. + google.protobuf.Timestamp error_time = 2 + [(google.api.field_behavior) = OPTIONAL]; +} + +// LintResponse contains the response from the linter. +message LintResponse { + // Count of issues with a given severity. + message SummaryEntry { + // Required. Severity of the issue. + Severity severity = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Count of issues with the given severity. + int32 count = 2 [(google.api.field_behavior) = REQUIRED]; + } + + // Optional. Array of issues found in the analyzed document. + repeated Issue issues = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Summary of all issue types and counts for each severity level. + repeated SummaryEntry summary = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. Lint state represents success or failure for linting. + LintState state = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. Name of the linting application. + string source = 4 [(google.api.field_behavior) = REQUIRED]; + + // Required. Name of the linter used. + Linter linter = 5 [(google.api.field_behavior) = REQUIRED]; + + // Required. Timestamp when the linting response was generated. + google.protobuf.Timestamp create_time = 6 + [(google.api.field_behavior) = REQUIRED]; +} + +// Issue contains the details of a single issue found by the linter. +message Issue { + // Required. Rule code unique to each rule defined in linter. + string code = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. An array of strings indicating the location in the analyzed + // document where the rule was triggered. + repeated string path = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Human-readable message describing the issue found by the linter. + string message = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. Severity level of the rule violation. + Severity severity = 4 [(google.api.field_behavior) = REQUIRED]; + + // Required. Object describing where in the file the issue was found. + Range range = 5 [(google.api.field_behavior) = REQUIRED]; +} + +// Object describing where in the file the issue was found. +message Range { + // Required. Start of the issue. + Point start = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. End of the issue. + Point end = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Point within the file (line and character). +message Point { + // Required. Line number (zero-indexed). + int32 line = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Character position within the line (zero-indexed). + int32 character = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// 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 been cancelled successfully + // 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]; +} + +// An ApiHubInstance represents the instance resources of the API Hub. +// Currently, only one ApiHub instance is allowed for each project. +message ApiHubInstance { + option (google.api.resource) = { + type: "apihub.googleapis.com/ApiHubInstance" + pattern: "projects/{project}/locations/{location}/apiHubInstances/{api_hub_instance}" + plural: "apiHubInstances" + singular: "apiHubInstance" + }; + + // Available configurations to provision an ApiHub Instance. + message Config { + // Required. The Customer Managed Encryption Key (CMEK) used for data + // encryption. The CMEK name should follow the format of + // `projects/([^/]+)/locations/([^/]+)/keyRings/([^/]+)/cryptoKeys/([^/]+)`, + // where the location must match the instance location. + string cmek_key_name = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // State of the ApiHub Instance. + enum State { + // The default value. This value is used if the state is omitted. + STATE_UNSPECIFIED = 0; + + // The ApiHub instance has not been initialized or has been deleted. + INACTIVE = 1; + + // The ApiHub instance is being created. + CREATING = 2; + + // The ApiHub instance has been created and is ready for use. + ACTIVE = 3; + + // The ApiHub instance is being updated. + UPDATING = 4; + + // The ApiHub instance is being deleted. + DELETING = 5; + + // The ApiHub instance encountered an error during a state change. + FAILED = 6; + } + + // Identifier. Format: + // `projects/{project}/locations/{location}/apiHubInstances/{apiHubInstance}`. + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Output only. Creation timestamp. + google.protobuf.Timestamp create_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Last update timestamp. + google.protobuf.Timestamp update_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The current state of the ApiHub instance. + State state = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Extra information about ApiHub instance state. Currently the + // message would be populated when state is `FAILED`. + string state_message = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. Config of the ApiHub instance. + Config config = 6 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Instance 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 = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Description of the ApiHub instance. + string description = 8 [(google.api.field_behavior) = OPTIONAL]; +} + +// An external API represents an API being provided by external sources. This +// can be used to model third-party APIs and can be used to define dependencies. +message ExternalApi { + option (google.api.resource) = { + type: "apihub.googleapis.com/ExternalApi" + pattern: "projects/{project}/locations/{location}/externalApis/{external_api}" + plural: "externalApis" + singular: "externalApi" + }; + + // Identifier. Format: + // `projects/{project}/locations/{location}/externalApi/{externalApi}`. + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Required. Display name of the external API. Max length is 63 characters + // (Unicode Code Points). + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Description of the external API. Max length is 2000 characters + // (Unicode Code Points). + string description = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. List of endpoints on which this API is accessible. + repeated string endpoints = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. List of paths served by this API. + repeated string paths = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Documentation of the external API. + Documentation documentation = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The list of user defined attributes associated with the Version + // resource. The key is the attribute name. It will be of the format: + // `projects/{project}/locations/{location}/attributes/{attribute}`. + // The value is the attribute values associated with the resource. + map attributes = 7 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Creation timestamp. + google.protobuf.Timestamp create_time = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Last update timestamp. + google.protobuf.Timestamp update_time = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/owl-bot-staging/google-cloud-apihub/v1/protos/google/cloud/apihub/v1/host_project_registration_service.proto b/owl-bot-staging/google-cloud-apihub/v1/protos/google/cloud/apihub/v1/host_project_registration_service.proto new file mode 100644 index 00000000000..2f9f370c870 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/protos/google/cloud/apihub/v1/host_project_registration_service.proto @@ -0,0 +1,207 @@ +// Copyright 2024 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.apihub.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.ApiHub.V1"; +option go_package = "cloud.google.com/go/apihub/apiv1/apihubpb;apihubpb"; +option java_multiple_files = true; +option java_outer_classname = "HostProjectRegistrationServiceProto"; +option java_package = "com.google.cloud.apihub.v1"; +option php_namespace = "Google\\Cloud\\ApiHub\\V1"; +option ruby_package = "Google::Cloud::ApiHub::V1"; + +// This service is used for managing the host project registrations. +service HostProjectRegistrationService { + option (google.api.default_host) = "apihub.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Create a host project registration. + // A Google cloud project can be registered as a host project if it is not + // attached as a runtime project to another host project. + // A project can be registered as a host project only once. Subsequent + // register calls for the same project will fail. + rpc CreateHostProjectRegistration(CreateHostProjectRegistrationRequest) + returns (HostProjectRegistration) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/hostProjectRegistrations" + body: "host_project_registration" + }; + option (google.api.method_signature) = + "parent,host_project_registration,host_project_registration_id"; + } + + // Get a host project registration. + rpc GetHostProjectRegistration(GetHostProjectRegistrationRequest) + returns (HostProjectRegistration) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/hostProjectRegistrations/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists host project registrations. + rpc ListHostProjectRegistrations(ListHostProjectRegistrationsRequest) + returns (ListHostProjectRegistrationsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/hostProjectRegistrations" + }; + option (google.api.method_signature) = "parent"; + } +} + +// The +// [CreateHostProjectRegistration][google.cloud.apihub.v1.HostProjectRegistrationService.CreateHostProjectRegistration] +// method's request. +message CreateHostProjectRegistrationRequest { + // Required. The parent resource for the host project. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "apihub.googleapis.com/HostProjectRegistration" + } + ]; + + // Required. The ID to use for the Host Project Registration, which will + // become the final component of the host project registration's resource + // name. The ID must be the same as the Google cloud project specified in the + // host_project_registration.gcp_project field. + string host_project_registration_id = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Required. The host project registration to register. + HostProjectRegistration host_project_registration = 3 + [(google.api.field_behavior) = REQUIRED]; +} + +// The +// [GetHostProjectRegistration][google.cloud.apihub.v1.HostProjectRegistrationService.GetHostProjectRegistration] +// method's request. +message GetHostProjectRegistrationRequest { + // Required. Host project registration resource name. + // projects/{project}/locations/{location}/hostProjectRegistrations/{host_project_registration_id} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "apihub.googleapis.com/HostProjectRegistration" + } + ]; +} + +// The +// [ListHostProjectRegistrations][google.cloud.apihub.v1.HostProjectRegistrationService.ListHostProjectRegistrations] +// method's request. +message ListHostProjectRegistrationsRequest { + // Required. The parent, which owns this collection of host projects. + // Format: `projects/*/locations/*` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "apihub.googleapis.com/HostProjectRegistration" + } + ]; + + // Optional. The maximum number of host project registrations to return. The + // service may return fewer than this value. If unspecified, at most 50 host + // project registrations will be returned. The maximum value is 1000; values + // above 1000 will be coerced to 1000. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous + // `ListHostProjectRegistrations` call. Provide this to retrieve the + // subsequent page. + // + // When paginating, all other parameters (except page_size) provided to + // `ListHostProjectRegistrations` must match the call that provided the page + // token. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. An expression that filters the list of HostProjectRegistrations. + // + // A filter expression consists of a field name, a comparison + // operator, and a value for filtering. The value must be a string. All + // standard operators as documented at https://google.aip.dev/160 are + // supported. + // + // The following fields in the `HostProjectRegistration` are eligible for + // filtering: + // + // * `name` - The name of the HostProjectRegistration. + // * `create_time` - The time at which the HostProjectRegistration was + // created. The value should be in the + // (RFC3339)[https://tools.ietf.org/html/rfc3339] format. + // * `gcp_project` - The Google cloud project associated with the + // HostProjectRegistration. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Hint for how to order the results. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// The +// [ListHostProjectRegistrations][google.cloud.apihub.v1.HostProjectRegistrationService.ListHostProjectRegistrations] +// method's response. +message ListHostProjectRegistrationsResponse { + // The list of host project registrations. + repeated HostProjectRegistration host_project_registrations = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// Host project registration refers to the registration of a Google cloud +// project with Api Hub as a host project. This is the project where Api Hub is +// provisioned. It acts as the consumer project for the Api Hub instance +// provisioned. Multiple runtime projects can be attached to the host project +// and these attachments define the scope of Api Hub. +message HostProjectRegistration { + option (google.api.resource) = { + type: "apihub.googleapis.com/HostProjectRegistration" + pattern: "projects/{project}/locations/{location}/hostProjectRegistrations/{host_project_registration}" + plural: "hostProjectRegistrations" + singular: "hostProjectRegistration" + }; + + // Identifier. The name of the host project registration. + // Format: + // "projects/{project}/locations/{location}/hostProjectRegistrations/{host_project_registration}". + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Required. Immutable. Google cloud project name in the format: + // "projects/abc" or "projects/123". As input, project name with either + // project id or number are accepted. As output, this field will contain + // project number. + string gcp_project = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + // Output only. The time at which the host project registration was created. + google.protobuf.Timestamp create_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/owl-bot-staging/google-cloud-apihub/v1/protos/google/cloud/apihub/v1/linting_service.proto b/owl-bot-staging/google-cloud-apihub/v1/protos/google/cloud/apihub/v1/linting_service.proto new file mode 100644 index 00000000000..9001c551a40 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/protos/google/cloud/apihub/v1/linting_service.proto @@ -0,0 +1,159 @@ +// Copyright 2024 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.apihub.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/apihub/v1/common_fields.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Cloud.ApiHub.V1"; +option go_package = "cloud.google.com/go/apihub/apiv1/apihubpb;apihubpb"; +option java_multiple_files = true; +option java_outer_classname = "LintingServiceProto"; +option java_package = "com.google.cloud.apihub.v1"; +option php_namespace = "Google\\Cloud\\ApiHub\\V1"; +option ruby_package = "Google::Cloud::ApiHub::V1"; + +// This service provides all methods related to the 1p Linter. +service LintingService { + option (google.api.default_host) = "apihub.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Get the style guide being used for linting. + rpc GetStyleGuide(GetStyleGuideRequest) returns (StyleGuide) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/plugins/*/styleGuide}" + }; + option (google.api.method_signature) = "name"; + } + + // Update the styleGuide to be used for liniting in by API hub. + rpc UpdateStyleGuide(UpdateStyleGuideRequest) returns (StyleGuide) { + option (google.api.http) = { + patch: "/v1/{style_guide.name=projects/*/locations/*/plugins/*/styleGuide}" + body: "style_guide" + }; + option (google.api.method_signature) = "style_guide,update_mask"; + } + + // Get the contents of the style guide. + rpc GetStyleGuideContents(GetStyleGuideContentsRequest) + returns (StyleGuideContents) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/plugins/*/styleGuide}:contents" + }; + option (google.api.method_signature) = "name"; + } + + // Lints the requested spec and updates the corresponding API Spec with the + // lint response. This lint response will be available in all subsequent + // Get and List Spec calls to Core service. + rpc LintSpec(LintSpecRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*}:lint" + body: "*" + }; + } +} + +// The [GetStyleGuide][ApiHub.GetStyleGuide] method's request. +message GetStyleGuideRequest { + // Required. The name of the spec to retrieve. + // Format: + // `projects/{project}/locations/{location}/plugins/{plugin}/styleGuide`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "apihub.googleapis.com/StyleGuide" + } + ]; +} + +// The [UpdateStyleGuide][ApiHub.UpdateStyleGuide] method's request. +message UpdateStyleGuideRequest { + // Required. The Style guide resource to update. + StyleGuide style_guide = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The list of fields to update. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = OPTIONAL]; +} + +// The [GetStyleGuideContents][ApiHub.GetStyleGuideContents] method's request. +message GetStyleGuideContentsRequest { + // Required. The name of the StyleGuide whose contents need to be retrieved. + // There is exactly one style guide resource per project per location. + // The expected format is + // `projects/{project}/locations/{location}/plugins/{plugin}/styleGuide`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "apihub.googleapis.com/StyleGuide" + } + ]; +} + +// The [LintSpec][ApiHub.LintSpec] method's request. +message LintSpecRequest { + // Required. The name of the spec to be linted. + // Format: + // `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "apihub.googleapis.com/Spec" } + ]; +} + +// The style guide contents. +message StyleGuideContents { + // Required. The contents of the style guide. + bytes contents = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The mime type of the content. + string mime_type = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Represents a singleton style guide resource to be used for linting Open API +// specs. +message StyleGuide { + option (google.api.resource) = { + type: "apihub.googleapis.com/StyleGuide" + pattern: "projects/{project}/locations/{location}/plugins/{plugin}/styleGuide" + plural: "styleGuides" + singular: "styleGuide" + }; + + // Identifier. The name of the style guide. + // + // Format: + // `projects/{project}/locations/{location}/plugins/{plugin}/styleGuide` + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Required. Target linter for the style guide. + Linter linter = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Input only. The contents of the uploaded style guide. + StyleGuideContents contents = 3 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = INPUT_ONLY + ]; +} diff --git a/owl-bot-staging/google-cloud-apihub/v1/protos/google/cloud/apihub/v1/plugin_service.proto b/owl-bot-staging/google-cloud-apihub/v1/protos/google/cloud/apihub/v1/plugin_service.proto new file mode 100644 index 00000000000..233c0669af0 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/protos/google/cloud/apihub/v1/plugin_service.proto @@ -0,0 +1,148 @@ +// Copyright 2024 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.apihub.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/apihub/v1/common_fields.proto"; + +option csharp_namespace = "Google.Cloud.ApiHub.V1"; +option go_package = "cloud.google.com/go/apihub/apiv1/apihubpb;apihubpb"; +option java_multiple_files = true; +option java_outer_classname = "PluginServiceProto"; +option java_package = "com.google.cloud.apihub.v1"; +option php_namespace = "Google\\Cloud\\ApiHub\\V1"; +option ruby_package = "Google::Cloud::ApiHub::V1"; + +// This service is used for managing plugins inside the API Hub. +service ApiHubPlugin { + option (google.api.default_host) = "apihub.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Get details about an API Hub plugin. + rpc GetPlugin(GetPluginRequest) returns (Plugin) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/plugins/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Enables a plugin. + // The `state` of the plugin after enabling is `ENABLED` + rpc EnablePlugin(EnablePluginRequest) returns (Plugin) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/plugins/*}:enable" + body: "*" + }; + option (google.api.method_signature) = "name"; + } + + // Disables a plugin. + // The `state` of the plugin after disabling is `DISABLED` + rpc DisablePlugin(DisablePluginRequest) returns (Plugin) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/plugins/*}:disable" + body: "*" + }; + option (google.api.method_signature) = "name"; + } +} + +// A plugin resource in the API Hub. +message Plugin { + option (google.api.resource) = { + type: "apihub.googleapis.com/Plugin" + pattern: "projects/{project}/locations/{location}/plugins/{plugin}" + plural: "plugins" + singular: "plugin" + }; + + // Possible states a plugin can have. Note that this enum may receive new + // values in the future. Consumers are advised to always code against the + // enum values expecting new states can be added later on. + enum State { + // The default value. This value is used if the state is omitted. + STATE_UNSPECIFIED = 0; + + // The plugin is enabled. + ENABLED = 1; + + // The plugin is disabled. + DISABLED = 2; + } + + // Identifier. The name of the plugin. + // Format: `projects/{project}/locations/{location}/plugins/{plugin}` + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Required. The display name of the plugin. Max length is 50 characters + // (Unicode code points). + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The type of the API. + // This maps to the following system defined attribute: + // `projects/{project}/locations/{location}/attributes/system-plugin-type` + // attribute. + // The number of allowed values for this attribute will be based on the + // cardinality of the attribute. The same can be retrieved via GetAttribute + // API. All values should be from the list of allowed values defined for the + // attribute. + AttributeValues type = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The plugin description. Max length is 2000 characters (Unicode + // code points). + string description = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Represents the state of the plugin. + State state = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// The [GetPlugin][google.cloud.apihub.v1.ApiHubPlugin.GetPlugin] method's +// request. +message GetPluginRequest { + // Required. The name of the plugin to retrieve. + // Format: `projects/{project}/locations/{location}/plugins/{plugin}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "apihub.googleapis.com/Plugin" } + ]; +} + +// The [EnablePlugin][google.cloud.apihub.v1.ApiHubPlugin.EnablePlugin] method's +// request. +message EnablePluginRequest { + // Required. The name of the plugin to enable. + // Format: `projects/{project}/locations/{location}/plugins/{plugin}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "apihub.googleapis.com/Plugin" } + ]; +} + +// The [DisablePlugin][google.cloud.apihub.v1.ApiHubPlugin.DisablePlugin] +// method's request. +message DisablePluginRequest { + // Required. The name of the plugin to disable. + // Format: `projects/{project}/locations/{location}/plugins/{plugin}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "apihub.googleapis.com/Plugin" } + ]; +} diff --git a/owl-bot-staging/google-cloud-apihub/v1/protos/google/cloud/apihub/v1/provisioning_service.proto b/owl-bot-staging/google-cloud-apihub/v1/protos/google/cloud/apihub/v1/provisioning_service.proto new file mode 100644 index 00000000000..2bf39fab779 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/protos/google/cloud/apihub/v1/provisioning_service.proto @@ -0,0 +1,136 @@ +// Copyright 2024 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.apihub.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/apihub/v1/common_fields.proto"; +import "google/longrunning/operations.proto"; + +option csharp_namespace = "Google.Cloud.ApiHub.V1"; +option go_package = "cloud.google.com/go/apihub/apiv1/apihubpb;apihubpb"; +option java_multiple_files = true; +option java_outer_classname = "ProvisioningServiceProto"; +option java_package = "com.google.cloud.apihub.v1"; +option php_namespace = "Google\\Cloud\\ApiHub\\V1"; +option ruby_package = "Google::Cloud::ApiHub::V1"; + +// This service is used for managing the data plane provisioning of the API hub. +service Provisioning { + option (google.api.default_host) = "apihub.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Provisions instance resources for the API Hub. + rpc CreateApiHubInstance(CreateApiHubInstanceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/apiHubInstances" + body: "api_hub_instance" + }; + option (google.api.method_signature) = + "parent,api_hub_instance,api_hub_instance_id"; + option (google.longrunning.operation_info) = { + response_type: "ApiHubInstance" + metadata_type: "OperationMetadata" + }; + } + + // Gets details of a single API Hub instance. + rpc GetApiHubInstance(GetApiHubInstanceRequest) returns (ApiHubInstance) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/apiHubInstances/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Looks up an Api Hub instance in a given GCP project. There will always be + // only one Api Hub instance for a GCP project across all locations. + rpc LookupApiHubInstance(LookupApiHubInstanceRequest) + returns (LookupApiHubInstanceResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/apiHubInstances:lookup" + }; + option (google.api.method_signature) = "parent"; + } +} + +// The +// [CreateApiHubInstance][google.cloud.apihub.v1.Provisioning.CreateApiHubInstance] +// method's request. +message CreateApiHubInstanceRequest { + // Required. The parent resource for the Api Hub instance resource. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Optional. Identifier to assign to the Api Hub instance. Must be unique + // within scope of the parent resource. If the field is not provided, system + // generated id will be used. + // + // This value should be 4-40 characters, and valid characters + // are `/[a-z][A-Z][0-9]-_/`. + string api_hub_instance_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The ApiHub instance. + ApiHubInstance api_hub_instance = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// The +// [GetApiHubInstance][google.cloud.apihub.v1.Provisioning.GetApiHubInstance] +// method's request. +message GetApiHubInstanceRequest { + // Required. The name of the Api Hub instance to retrieve. + // Format: + // `projects/{project}/locations/{location}/apiHubInstances/{apiHubInstance}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "apihub.googleapis.com/ApiHubInstance" + } + ]; +} + +// The +// [LookupApiHubInstance][google.cloud.apihub.v1.Provisioning.LookupApiHubInstance] +// method's request. +message LookupApiHubInstanceRequest { + // Required. There will always be only one Api Hub instance for a GCP project + // across all locations. + // The parent resource for the Api Hub instance resource. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "apihub.googleapis.com/ApiHubInstance" + } + ]; +} + +// The +// [LookupApiHubInstance][google.cloud.apihub.v1.Provisioning.LookupApiHubInstance] +// method's response.` +message LookupApiHubInstanceResponse { + // API Hub instance for a project if it exists, empty otherwise. + ApiHubInstance api_hub_instance = 1; +} diff --git a/owl-bot-staging/google-cloud-apihub/v1/protos/google/cloud/apihub/v1/runtime_project_attachment_service.proto b/owl-bot-staging/google-cloud-apihub/v1/protos/google/cloud/apihub/v1/runtime_project_attachment_service.proto new file mode 100644 index 00000000000..71c361c028a --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/protos/google/cloud/apihub/v1/runtime_project_attachment_service.proto @@ -0,0 +1,261 @@ +// Copyright 2024 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.apihub.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.ApiHub.V1"; +option go_package = "cloud.google.com/go/apihub/apiv1/apihubpb;apihubpb"; +option java_multiple_files = true; +option java_outer_classname = "RuntimeProjectAttachmentServiceProto"; +option java_package = "com.google.cloud.apihub.v1"; +option php_namespace = "Google\\Cloud\\ApiHub\\V1"; +option ruby_package = "Google::Cloud::ApiHub::V1"; + +// This service is used for managing the runtime project attachments. +service RuntimeProjectAttachmentService { + option (google.api.default_host) = "apihub.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Attaches a runtime project to the host project. + rpc CreateRuntimeProjectAttachment(CreateRuntimeProjectAttachmentRequest) + returns (RuntimeProjectAttachment) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/runtimeProjectAttachments" + body: "runtime_project_attachment" + }; + option (google.api.method_signature) = + "parent,runtime_project_attachment,runtime_project_attachment_id"; + } + + // Gets a runtime project attachment. + rpc GetRuntimeProjectAttachment(GetRuntimeProjectAttachmentRequest) + returns (RuntimeProjectAttachment) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/runtimeProjectAttachments/*}" + }; + option (google.api.method_signature) = "name"; + } + + // List runtime projects attached to the host project. + rpc ListRuntimeProjectAttachments(ListRuntimeProjectAttachmentsRequest) + returns (ListRuntimeProjectAttachmentsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/runtimeProjectAttachments" + }; + option (google.api.method_signature) = "parent"; + } + + // Delete a runtime project attachment in the API Hub. This call will detach + // the runtime project from the host project. + rpc DeleteRuntimeProjectAttachment(DeleteRuntimeProjectAttachmentRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/runtimeProjectAttachments/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Look up a runtime project attachment. This API can be called in the context + // of any project. + rpc LookupRuntimeProjectAttachment(LookupRuntimeProjectAttachmentRequest) + returns (LookupRuntimeProjectAttachmentResponse) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*}:lookupRuntimeProjectAttachment" + }; + option (google.api.method_signature) = "name"; + } +} + +// The +// [CreateRuntimeProjectAttachment][google.cloud.apihub.v1.RuntimeProjectAttachmentService.CreateRuntimeProjectAttachment] +// method's request. +message CreateRuntimeProjectAttachmentRequest { + // Required. The parent resource for the Runtime Project Attachment. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "apihub.googleapis.com/RuntimeProjectAttachment" + } + ]; + + // Required. The ID to use for the Runtime Project Attachment, which will + // become the final component of the Runtime Project Attachment's name. The ID + // must be the same as the project ID of the Google cloud project specified in + // the runtime_project_attachment.runtime_project field. + string runtime_project_attachment_id = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Required. The Runtime Project Attachment to create. + RuntimeProjectAttachment runtime_project_attachment = 3 + [(google.api.field_behavior) = REQUIRED]; +} + +// The +// [GetRuntimeProjectAttachment][google.cloud.apihub.v1.RuntimeProjectAttachmentService.GetRuntimeProjectAttachment] +// method's request. +message GetRuntimeProjectAttachmentRequest { + // Required. The name of the API resource to retrieve. + // Format: + // `projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "apihub.googleapis.com/RuntimeProjectAttachment" + } + ]; +} + +// The +// [ListRuntimeProjectAttachments][google.cloud.apihub.v1.RuntimeProjectAttachmentService.ListRuntimeProjectAttachments] +// method's request. +message ListRuntimeProjectAttachmentsRequest { + // Required. The parent, which owns this collection of runtime project + // attachments. Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "apihub.googleapis.com/RuntimeProjectAttachment" + } + ]; + + // Optional. The maximum number of runtime project attachments to return. The + // service may return fewer than this value. If unspecified, at most 50 + // runtime project attachments will be returned. The maximum value is 1000; + // values above 1000 will be coerced to 1000. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous + // `ListRuntimeProjectAttachments` call. Provide this to retrieve the + // subsequent page. + // + // When paginating, all other parameters (except page_size) provided to + // `ListRuntimeProjectAttachments` must match the call that provided the page + // token. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. An expression that filters the list of RuntimeProjectAttachments. + // + // A filter expression consists of a field name, a comparison + // operator, and a value for filtering. The value must be a string. All + // standard operators as documented at https://google.aip.dev/160 are + // supported. + // + // The following fields in the `RuntimeProjectAttachment` are eligible for + // filtering: + // + // * `name` - The name of the RuntimeProjectAttachment. + // * `create_time` - The time at which the RuntimeProjectAttachment was + // created. The value should be in the + // (RFC3339)[https://tools.ietf.org/html/rfc3339] format. + // * `runtime_project` - The Google cloud project associated with the + // RuntimeProjectAttachment. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Hint for how to order the results. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// The +// [ListRuntimeProjectAttachments][google.cloud.apihub.v1.RuntimeProjectAttachmentService.ListRuntimeProjectAttachments] +// method's response. +message ListRuntimeProjectAttachmentsResponse { + // List of runtime project attachments. + repeated RuntimeProjectAttachment runtime_project_attachments = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// The +// [DeleteRuntimeProjectAttachment][google.cloud.apihub.v1.RuntimeProjectAttachmentService.DeleteRuntimeProjectAttachment] +// method's request. +message DeleteRuntimeProjectAttachmentRequest { + // Required. The name of the Runtime Project Attachment to delete. + // Format: + // `projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "apihub.googleapis.com/RuntimeProjectAttachment" + } + ]; +} + +// The +// [LookupRuntimeProjectAttachment][google.cloud.apihub.v1.RuntimeProjectAttachmentService.LookupRuntimeProjectAttachment] +// method's request. +message LookupRuntimeProjectAttachmentRequest { + // Required. Runtime project ID to look up runtime project attachment for. + // Lookup happens across all regions. Expected format: + // `projects/{project}/locations/{location}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; +} + +// The +// [ListRuntimeProjectAttachments][google.cloud.apihub.v1.RuntimeProjectAttachmentService.ListRuntimeProjectAttachments] +// method's response. +message LookupRuntimeProjectAttachmentResponse { + // Runtime project attachment for a project if exists, empty otherwise. + RuntimeProjectAttachment runtime_project_attachment = 1; +} + +// Runtime project attachment represents an attachment from the runtime project +// to the host project. Api Hub looks for deployments in the attached runtime +// projects and creates corresponding resources in Api Hub for the discovered +// deployments. +message RuntimeProjectAttachment { + option (google.api.resource) = { + type: "apihub.googleapis.com/RuntimeProjectAttachment" + pattern: "projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}" + plural: "runtimeProjectAttachments" + singular: "runtimeProjectAttachment" + }; + + // Identifier. The resource name of a runtime project attachment. Format: + // "projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}". + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Required. Immutable. Google cloud project name in the format: + // "projects/abc" or "projects/123". As input, project name with either + // project id or number are accepted. As output, this field will contain + // project number. + string runtime_project = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + // Output only. Create time. + google.protobuf.Timestamp create_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/owl-bot-staging/google-cloud-apihub/v1/protos/protos.d.ts b/owl-bot-staging/google-cloud-apihub/v1/protos/protos.d.ts new file mode 100644 index 00000000000..0ec6d0a3e62 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/protos/protos.d.ts @@ -0,0 +1,21434 @@ +// Copyright 2024 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 apihub. */ + namespace apihub { + + /** Namespace v1. */ + namespace v1 { + + /** Represents an ApiHub */ + class ApiHub extends $protobuf.rpc.Service { + + /** + * Constructs a new ApiHub 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 ApiHub 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): ApiHub; + + /** + * Calls CreateApi. + * @param request CreateApiRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Api + */ + public createApi(request: google.cloud.apihub.v1.ICreateApiRequest, callback: google.cloud.apihub.v1.ApiHub.CreateApiCallback): void; + + /** + * Calls CreateApi. + * @param request CreateApiRequest message or plain object + * @returns Promise + */ + public createApi(request: google.cloud.apihub.v1.ICreateApiRequest): Promise; + + /** + * Calls GetApi. + * @param request GetApiRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Api + */ + public getApi(request: google.cloud.apihub.v1.IGetApiRequest, callback: google.cloud.apihub.v1.ApiHub.GetApiCallback): void; + + /** + * Calls GetApi. + * @param request GetApiRequest message or plain object + * @returns Promise + */ + public getApi(request: google.cloud.apihub.v1.IGetApiRequest): Promise; + + /** + * Calls ListApis. + * @param request ListApisRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListApisResponse + */ + public listApis(request: google.cloud.apihub.v1.IListApisRequest, callback: google.cloud.apihub.v1.ApiHub.ListApisCallback): void; + + /** + * Calls ListApis. + * @param request ListApisRequest message or plain object + * @returns Promise + */ + public listApis(request: google.cloud.apihub.v1.IListApisRequest): Promise; + + /** + * Calls UpdateApi. + * @param request UpdateApiRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Api + */ + public updateApi(request: google.cloud.apihub.v1.IUpdateApiRequest, callback: google.cloud.apihub.v1.ApiHub.UpdateApiCallback): void; + + /** + * Calls UpdateApi. + * @param request UpdateApiRequest message or plain object + * @returns Promise + */ + public updateApi(request: google.cloud.apihub.v1.IUpdateApiRequest): Promise; + + /** + * Calls DeleteApi. + * @param request DeleteApiRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteApi(request: google.cloud.apihub.v1.IDeleteApiRequest, callback: google.cloud.apihub.v1.ApiHub.DeleteApiCallback): void; + + /** + * Calls DeleteApi. + * @param request DeleteApiRequest message or plain object + * @returns Promise + */ + public deleteApi(request: google.cloud.apihub.v1.IDeleteApiRequest): Promise; + + /** + * Calls CreateVersion. + * @param request CreateVersionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Version + */ + public createVersion(request: google.cloud.apihub.v1.ICreateVersionRequest, callback: google.cloud.apihub.v1.ApiHub.CreateVersionCallback): void; + + /** + * Calls CreateVersion. + * @param request CreateVersionRequest message or plain object + * @returns Promise + */ + public createVersion(request: google.cloud.apihub.v1.ICreateVersionRequest): Promise; + + /** + * Calls GetVersion. + * @param request GetVersionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Version + */ + public getVersion(request: google.cloud.apihub.v1.IGetVersionRequest, callback: google.cloud.apihub.v1.ApiHub.GetVersionCallback): void; + + /** + * Calls GetVersion. + * @param request GetVersionRequest message or plain object + * @returns Promise + */ + public getVersion(request: google.cloud.apihub.v1.IGetVersionRequest): Promise; + + /** + * Calls ListVersions. + * @param request ListVersionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListVersionsResponse + */ + public listVersions(request: google.cloud.apihub.v1.IListVersionsRequest, callback: google.cloud.apihub.v1.ApiHub.ListVersionsCallback): void; + + /** + * Calls ListVersions. + * @param request ListVersionsRequest message or plain object + * @returns Promise + */ + public listVersions(request: google.cloud.apihub.v1.IListVersionsRequest): Promise; + + /** + * Calls UpdateVersion. + * @param request UpdateVersionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Version + */ + public updateVersion(request: google.cloud.apihub.v1.IUpdateVersionRequest, callback: google.cloud.apihub.v1.ApiHub.UpdateVersionCallback): void; + + /** + * Calls UpdateVersion. + * @param request UpdateVersionRequest message or plain object + * @returns Promise + */ + public updateVersion(request: google.cloud.apihub.v1.IUpdateVersionRequest): Promise; + + /** + * Calls DeleteVersion. + * @param request DeleteVersionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteVersion(request: google.cloud.apihub.v1.IDeleteVersionRequest, callback: google.cloud.apihub.v1.ApiHub.DeleteVersionCallback): void; + + /** + * Calls DeleteVersion. + * @param request DeleteVersionRequest message or plain object + * @returns Promise + */ + public deleteVersion(request: google.cloud.apihub.v1.IDeleteVersionRequest): Promise; + + /** + * Calls CreateSpec. + * @param request CreateSpecRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Spec + */ + public createSpec(request: google.cloud.apihub.v1.ICreateSpecRequest, callback: google.cloud.apihub.v1.ApiHub.CreateSpecCallback): void; + + /** + * Calls CreateSpec. + * @param request CreateSpecRequest message or plain object + * @returns Promise + */ + public createSpec(request: google.cloud.apihub.v1.ICreateSpecRequest): Promise; + + /** + * Calls GetSpec. + * @param request GetSpecRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Spec + */ + public getSpec(request: google.cloud.apihub.v1.IGetSpecRequest, callback: google.cloud.apihub.v1.ApiHub.GetSpecCallback): void; + + /** + * Calls GetSpec. + * @param request GetSpecRequest message or plain object + * @returns Promise + */ + public getSpec(request: google.cloud.apihub.v1.IGetSpecRequest): Promise; + + /** + * Calls GetSpecContents. + * @param request GetSpecContentsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SpecContents + */ + public getSpecContents(request: google.cloud.apihub.v1.IGetSpecContentsRequest, callback: google.cloud.apihub.v1.ApiHub.GetSpecContentsCallback): void; + + /** + * Calls GetSpecContents. + * @param request GetSpecContentsRequest message or plain object + * @returns Promise + */ + public getSpecContents(request: google.cloud.apihub.v1.IGetSpecContentsRequest): Promise; + + /** + * Calls ListSpecs. + * @param request ListSpecsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListSpecsResponse + */ + public listSpecs(request: google.cloud.apihub.v1.IListSpecsRequest, callback: google.cloud.apihub.v1.ApiHub.ListSpecsCallback): void; + + /** + * Calls ListSpecs. + * @param request ListSpecsRequest message or plain object + * @returns Promise + */ + public listSpecs(request: google.cloud.apihub.v1.IListSpecsRequest): Promise; + + /** + * Calls UpdateSpec. + * @param request UpdateSpecRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Spec + */ + public updateSpec(request: google.cloud.apihub.v1.IUpdateSpecRequest, callback: google.cloud.apihub.v1.ApiHub.UpdateSpecCallback): void; + + /** + * Calls UpdateSpec. + * @param request UpdateSpecRequest message or plain object + * @returns Promise + */ + public updateSpec(request: google.cloud.apihub.v1.IUpdateSpecRequest): Promise; + + /** + * Calls DeleteSpec. + * @param request DeleteSpecRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteSpec(request: google.cloud.apihub.v1.IDeleteSpecRequest, callback: google.cloud.apihub.v1.ApiHub.DeleteSpecCallback): void; + + /** + * Calls DeleteSpec. + * @param request DeleteSpecRequest message or plain object + * @returns Promise + */ + public deleteSpec(request: google.cloud.apihub.v1.IDeleteSpecRequest): Promise; + + /** + * Calls GetApiOperation. + * @param request GetApiOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ApiOperation + */ + public getApiOperation(request: google.cloud.apihub.v1.IGetApiOperationRequest, callback: google.cloud.apihub.v1.ApiHub.GetApiOperationCallback): void; + + /** + * Calls GetApiOperation. + * @param request GetApiOperationRequest message or plain object + * @returns Promise + */ + public getApiOperation(request: google.cloud.apihub.v1.IGetApiOperationRequest): Promise; + + /** + * Calls ListApiOperations. + * @param request ListApiOperationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListApiOperationsResponse + */ + public listApiOperations(request: google.cloud.apihub.v1.IListApiOperationsRequest, callback: google.cloud.apihub.v1.ApiHub.ListApiOperationsCallback): void; + + /** + * Calls ListApiOperations. + * @param request ListApiOperationsRequest message or plain object + * @returns Promise + */ + public listApiOperations(request: google.cloud.apihub.v1.IListApiOperationsRequest): Promise; + + /** + * Calls GetDefinition. + * @param request GetDefinitionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Definition + */ + public getDefinition(request: google.cloud.apihub.v1.IGetDefinitionRequest, callback: google.cloud.apihub.v1.ApiHub.GetDefinitionCallback): void; + + /** + * Calls GetDefinition. + * @param request GetDefinitionRequest message or plain object + * @returns Promise + */ + public getDefinition(request: google.cloud.apihub.v1.IGetDefinitionRequest): Promise; + + /** + * Calls CreateDeployment. + * @param request CreateDeploymentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Deployment + */ + public createDeployment(request: google.cloud.apihub.v1.ICreateDeploymentRequest, callback: google.cloud.apihub.v1.ApiHub.CreateDeploymentCallback): void; + + /** + * Calls CreateDeployment. + * @param request CreateDeploymentRequest message or plain object + * @returns Promise + */ + public createDeployment(request: google.cloud.apihub.v1.ICreateDeploymentRequest): Promise; + + /** + * Calls GetDeployment. + * @param request GetDeploymentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Deployment + */ + public getDeployment(request: google.cloud.apihub.v1.IGetDeploymentRequest, callback: google.cloud.apihub.v1.ApiHub.GetDeploymentCallback): void; + + /** + * Calls GetDeployment. + * @param request GetDeploymentRequest message or plain object + * @returns Promise + */ + public getDeployment(request: google.cloud.apihub.v1.IGetDeploymentRequest): Promise; + + /** + * Calls ListDeployments. + * @param request ListDeploymentsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListDeploymentsResponse + */ + public listDeployments(request: google.cloud.apihub.v1.IListDeploymentsRequest, callback: google.cloud.apihub.v1.ApiHub.ListDeploymentsCallback): void; + + /** + * Calls ListDeployments. + * @param request ListDeploymentsRequest message or plain object + * @returns Promise + */ + public listDeployments(request: google.cloud.apihub.v1.IListDeploymentsRequest): Promise; + + /** + * Calls UpdateDeployment. + * @param request UpdateDeploymentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Deployment + */ + public updateDeployment(request: google.cloud.apihub.v1.IUpdateDeploymentRequest, callback: google.cloud.apihub.v1.ApiHub.UpdateDeploymentCallback): void; + + /** + * Calls UpdateDeployment. + * @param request UpdateDeploymentRequest message or plain object + * @returns Promise + */ + public updateDeployment(request: google.cloud.apihub.v1.IUpdateDeploymentRequest): Promise; + + /** + * Calls DeleteDeployment. + * @param request DeleteDeploymentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteDeployment(request: google.cloud.apihub.v1.IDeleteDeploymentRequest, callback: google.cloud.apihub.v1.ApiHub.DeleteDeploymentCallback): void; + + /** + * Calls DeleteDeployment. + * @param request DeleteDeploymentRequest message or plain object + * @returns Promise + */ + public deleteDeployment(request: google.cloud.apihub.v1.IDeleteDeploymentRequest): Promise; + + /** + * Calls CreateAttribute. + * @param request CreateAttributeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Attribute + */ + public createAttribute(request: google.cloud.apihub.v1.ICreateAttributeRequest, callback: google.cloud.apihub.v1.ApiHub.CreateAttributeCallback): void; + + /** + * Calls CreateAttribute. + * @param request CreateAttributeRequest message or plain object + * @returns Promise + */ + public createAttribute(request: google.cloud.apihub.v1.ICreateAttributeRequest): Promise; + + /** + * Calls GetAttribute. + * @param request GetAttributeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Attribute + */ + public getAttribute(request: google.cloud.apihub.v1.IGetAttributeRequest, callback: google.cloud.apihub.v1.ApiHub.GetAttributeCallback): void; + + /** + * Calls GetAttribute. + * @param request GetAttributeRequest message or plain object + * @returns Promise + */ + public getAttribute(request: google.cloud.apihub.v1.IGetAttributeRequest): Promise; + + /** + * Calls UpdateAttribute. + * @param request UpdateAttributeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Attribute + */ + public updateAttribute(request: google.cloud.apihub.v1.IUpdateAttributeRequest, callback: google.cloud.apihub.v1.ApiHub.UpdateAttributeCallback): void; + + /** + * Calls UpdateAttribute. + * @param request UpdateAttributeRequest message or plain object + * @returns Promise + */ + public updateAttribute(request: google.cloud.apihub.v1.IUpdateAttributeRequest): Promise; + + /** + * Calls DeleteAttribute. + * @param request DeleteAttributeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteAttribute(request: google.cloud.apihub.v1.IDeleteAttributeRequest, callback: google.cloud.apihub.v1.ApiHub.DeleteAttributeCallback): void; + + /** + * Calls DeleteAttribute. + * @param request DeleteAttributeRequest message or plain object + * @returns Promise + */ + public deleteAttribute(request: google.cloud.apihub.v1.IDeleteAttributeRequest): Promise; + + /** + * Calls ListAttributes. + * @param request ListAttributesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListAttributesResponse + */ + public listAttributes(request: google.cloud.apihub.v1.IListAttributesRequest, callback: google.cloud.apihub.v1.ApiHub.ListAttributesCallback): void; + + /** + * Calls ListAttributes. + * @param request ListAttributesRequest message or plain object + * @returns Promise + */ + public listAttributes(request: google.cloud.apihub.v1.IListAttributesRequest): Promise; + + /** + * Calls SearchResources. + * @param request SearchResourcesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SearchResourcesResponse + */ + public searchResources(request: google.cloud.apihub.v1.ISearchResourcesRequest, callback: google.cloud.apihub.v1.ApiHub.SearchResourcesCallback): void; + + /** + * Calls SearchResources. + * @param request SearchResourcesRequest message or plain object + * @returns Promise + */ + public searchResources(request: google.cloud.apihub.v1.ISearchResourcesRequest): Promise; + + /** + * Calls CreateExternalApi. + * @param request CreateExternalApiRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ExternalApi + */ + public createExternalApi(request: google.cloud.apihub.v1.ICreateExternalApiRequest, callback: google.cloud.apihub.v1.ApiHub.CreateExternalApiCallback): void; + + /** + * Calls CreateExternalApi. + * @param request CreateExternalApiRequest message or plain object + * @returns Promise + */ + public createExternalApi(request: google.cloud.apihub.v1.ICreateExternalApiRequest): Promise; + + /** + * Calls GetExternalApi. + * @param request GetExternalApiRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ExternalApi + */ + public getExternalApi(request: google.cloud.apihub.v1.IGetExternalApiRequest, callback: google.cloud.apihub.v1.ApiHub.GetExternalApiCallback): void; + + /** + * Calls GetExternalApi. + * @param request GetExternalApiRequest message or plain object + * @returns Promise + */ + public getExternalApi(request: google.cloud.apihub.v1.IGetExternalApiRequest): Promise; + + /** + * Calls UpdateExternalApi. + * @param request UpdateExternalApiRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ExternalApi + */ + public updateExternalApi(request: google.cloud.apihub.v1.IUpdateExternalApiRequest, callback: google.cloud.apihub.v1.ApiHub.UpdateExternalApiCallback): void; + + /** + * Calls UpdateExternalApi. + * @param request UpdateExternalApiRequest message or plain object + * @returns Promise + */ + public updateExternalApi(request: google.cloud.apihub.v1.IUpdateExternalApiRequest): Promise; + + /** + * Calls DeleteExternalApi. + * @param request DeleteExternalApiRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteExternalApi(request: google.cloud.apihub.v1.IDeleteExternalApiRequest, callback: google.cloud.apihub.v1.ApiHub.DeleteExternalApiCallback): void; + + /** + * Calls DeleteExternalApi. + * @param request DeleteExternalApiRequest message or plain object + * @returns Promise + */ + public deleteExternalApi(request: google.cloud.apihub.v1.IDeleteExternalApiRequest): Promise; + + /** + * Calls ListExternalApis. + * @param request ListExternalApisRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListExternalApisResponse + */ + public listExternalApis(request: google.cloud.apihub.v1.IListExternalApisRequest, callback: google.cloud.apihub.v1.ApiHub.ListExternalApisCallback): void; + + /** + * Calls ListExternalApis. + * @param request ListExternalApisRequest message or plain object + * @returns Promise + */ + public listExternalApis(request: google.cloud.apihub.v1.IListExternalApisRequest): Promise; + } + + namespace ApiHub { + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|createApi}. + * @param error Error, if any + * @param [response] Api + */ + type CreateApiCallback = (error: (Error|null), response?: google.cloud.apihub.v1.Api) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|getApi}. + * @param error Error, if any + * @param [response] Api + */ + type GetApiCallback = (error: (Error|null), response?: google.cloud.apihub.v1.Api) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|listApis}. + * @param error Error, if any + * @param [response] ListApisResponse + */ + type ListApisCallback = (error: (Error|null), response?: google.cloud.apihub.v1.ListApisResponse) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|updateApi}. + * @param error Error, if any + * @param [response] Api + */ + type UpdateApiCallback = (error: (Error|null), response?: google.cloud.apihub.v1.Api) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|deleteApi}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteApiCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|createVersion}. + * @param error Error, if any + * @param [response] Version + */ + type CreateVersionCallback = (error: (Error|null), response?: google.cloud.apihub.v1.Version) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|getVersion}. + * @param error Error, if any + * @param [response] Version + */ + type GetVersionCallback = (error: (Error|null), response?: google.cloud.apihub.v1.Version) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|listVersions}. + * @param error Error, if any + * @param [response] ListVersionsResponse + */ + type ListVersionsCallback = (error: (Error|null), response?: google.cloud.apihub.v1.ListVersionsResponse) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|updateVersion}. + * @param error Error, if any + * @param [response] Version + */ + type UpdateVersionCallback = (error: (Error|null), response?: google.cloud.apihub.v1.Version) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|deleteVersion}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteVersionCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|createSpec}. + * @param error Error, if any + * @param [response] Spec + */ + type CreateSpecCallback = (error: (Error|null), response?: google.cloud.apihub.v1.Spec) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|getSpec}. + * @param error Error, if any + * @param [response] Spec + */ + type GetSpecCallback = (error: (Error|null), response?: google.cloud.apihub.v1.Spec) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|getSpecContents}. + * @param error Error, if any + * @param [response] SpecContents + */ + type GetSpecContentsCallback = (error: (Error|null), response?: google.cloud.apihub.v1.SpecContents) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|listSpecs}. + * @param error Error, if any + * @param [response] ListSpecsResponse + */ + type ListSpecsCallback = (error: (Error|null), response?: google.cloud.apihub.v1.ListSpecsResponse) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|updateSpec}. + * @param error Error, if any + * @param [response] Spec + */ + type UpdateSpecCallback = (error: (Error|null), response?: google.cloud.apihub.v1.Spec) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|deleteSpec}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteSpecCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|getApiOperation}. + * @param error Error, if any + * @param [response] ApiOperation + */ + type GetApiOperationCallback = (error: (Error|null), response?: google.cloud.apihub.v1.ApiOperation) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|listApiOperations}. + * @param error Error, if any + * @param [response] ListApiOperationsResponse + */ + type ListApiOperationsCallback = (error: (Error|null), response?: google.cloud.apihub.v1.ListApiOperationsResponse) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|getDefinition}. + * @param error Error, if any + * @param [response] Definition + */ + type GetDefinitionCallback = (error: (Error|null), response?: google.cloud.apihub.v1.Definition) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|createDeployment}. + * @param error Error, if any + * @param [response] Deployment + */ + type CreateDeploymentCallback = (error: (Error|null), response?: google.cloud.apihub.v1.Deployment) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|getDeployment}. + * @param error Error, if any + * @param [response] Deployment + */ + type GetDeploymentCallback = (error: (Error|null), response?: google.cloud.apihub.v1.Deployment) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|listDeployments}. + * @param error Error, if any + * @param [response] ListDeploymentsResponse + */ + type ListDeploymentsCallback = (error: (Error|null), response?: google.cloud.apihub.v1.ListDeploymentsResponse) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|updateDeployment}. + * @param error Error, if any + * @param [response] Deployment + */ + type UpdateDeploymentCallback = (error: (Error|null), response?: google.cloud.apihub.v1.Deployment) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|deleteDeployment}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteDeploymentCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|createAttribute}. + * @param error Error, if any + * @param [response] Attribute + */ + type CreateAttributeCallback = (error: (Error|null), response?: google.cloud.apihub.v1.Attribute) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|getAttribute}. + * @param error Error, if any + * @param [response] Attribute + */ + type GetAttributeCallback = (error: (Error|null), response?: google.cloud.apihub.v1.Attribute) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|updateAttribute}. + * @param error Error, if any + * @param [response] Attribute + */ + type UpdateAttributeCallback = (error: (Error|null), response?: google.cloud.apihub.v1.Attribute) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|deleteAttribute}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteAttributeCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|listAttributes}. + * @param error Error, if any + * @param [response] ListAttributesResponse + */ + type ListAttributesCallback = (error: (Error|null), response?: google.cloud.apihub.v1.ListAttributesResponse) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|searchResources}. + * @param error Error, if any + * @param [response] SearchResourcesResponse + */ + type SearchResourcesCallback = (error: (Error|null), response?: google.cloud.apihub.v1.SearchResourcesResponse) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|createExternalApi}. + * @param error Error, if any + * @param [response] ExternalApi + */ + type CreateExternalApiCallback = (error: (Error|null), response?: google.cloud.apihub.v1.ExternalApi) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|getExternalApi}. + * @param error Error, if any + * @param [response] ExternalApi + */ + type GetExternalApiCallback = (error: (Error|null), response?: google.cloud.apihub.v1.ExternalApi) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|updateExternalApi}. + * @param error Error, if any + * @param [response] ExternalApi + */ + type UpdateExternalApiCallback = (error: (Error|null), response?: google.cloud.apihub.v1.ExternalApi) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|deleteExternalApi}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteExternalApiCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|listExternalApis}. + * @param error Error, if any + * @param [response] ListExternalApisResponse + */ + type ListExternalApisCallback = (error: (Error|null), response?: google.cloud.apihub.v1.ListExternalApisResponse) => void; + } + + /** Represents an ApiHubDependencies */ + class ApiHubDependencies extends $protobuf.rpc.Service { + + /** + * Constructs a new ApiHubDependencies 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 ApiHubDependencies 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): ApiHubDependencies; + + /** + * Calls CreateDependency. + * @param request CreateDependencyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Dependency + */ + public createDependency(request: google.cloud.apihub.v1.ICreateDependencyRequest, callback: google.cloud.apihub.v1.ApiHubDependencies.CreateDependencyCallback): void; + + /** + * Calls CreateDependency. + * @param request CreateDependencyRequest message or plain object + * @returns Promise + */ + public createDependency(request: google.cloud.apihub.v1.ICreateDependencyRequest): Promise; + + /** + * Calls GetDependency. + * @param request GetDependencyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Dependency + */ + public getDependency(request: google.cloud.apihub.v1.IGetDependencyRequest, callback: google.cloud.apihub.v1.ApiHubDependencies.GetDependencyCallback): void; + + /** + * Calls GetDependency. + * @param request GetDependencyRequest message or plain object + * @returns Promise + */ + public getDependency(request: google.cloud.apihub.v1.IGetDependencyRequest): Promise; + + /** + * Calls UpdateDependency. + * @param request UpdateDependencyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Dependency + */ + public updateDependency(request: google.cloud.apihub.v1.IUpdateDependencyRequest, callback: google.cloud.apihub.v1.ApiHubDependencies.UpdateDependencyCallback): void; + + /** + * Calls UpdateDependency. + * @param request UpdateDependencyRequest message or plain object + * @returns Promise + */ + public updateDependency(request: google.cloud.apihub.v1.IUpdateDependencyRequest): Promise; + + /** + * Calls DeleteDependency. + * @param request DeleteDependencyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteDependency(request: google.cloud.apihub.v1.IDeleteDependencyRequest, callback: google.cloud.apihub.v1.ApiHubDependencies.DeleteDependencyCallback): void; + + /** + * Calls DeleteDependency. + * @param request DeleteDependencyRequest message or plain object + * @returns Promise + */ + public deleteDependency(request: google.cloud.apihub.v1.IDeleteDependencyRequest): Promise; + + /** + * Calls ListDependencies. + * @param request ListDependenciesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListDependenciesResponse + */ + public listDependencies(request: google.cloud.apihub.v1.IListDependenciesRequest, callback: google.cloud.apihub.v1.ApiHubDependencies.ListDependenciesCallback): void; + + /** + * Calls ListDependencies. + * @param request ListDependenciesRequest message or plain object + * @returns Promise + */ + public listDependencies(request: google.cloud.apihub.v1.IListDependenciesRequest): Promise; + } + + namespace ApiHubDependencies { + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHubDependencies|createDependency}. + * @param error Error, if any + * @param [response] Dependency + */ + type CreateDependencyCallback = (error: (Error|null), response?: google.cloud.apihub.v1.Dependency) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHubDependencies|getDependency}. + * @param error Error, if any + * @param [response] Dependency + */ + type GetDependencyCallback = (error: (Error|null), response?: google.cloud.apihub.v1.Dependency) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHubDependencies|updateDependency}. + * @param error Error, if any + * @param [response] Dependency + */ + type UpdateDependencyCallback = (error: (Error|null), response?: google.cloud.apihub.v1.Dependency) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHubDependencies|deleteDependency}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteDependencyCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHubDependencies|listDependencies}. + * @param error Error, if any + * @param [response] ListDependenciesResponse + */ + type ListDependenciesCallback = (error: (Error|null), response?: google.cloud.apihub.v1.ListDependenciesResponse) => void; + } + + /** Properties of a CreateApiRequest. */ + interface ICreateApiRequest { + + /** CreateApiRequest parent */ + parent?: (string|null); + + /** CreateApiRequest apiId */ + apiId?: (string|null); + + /** CreateApiRequest api */ + api?: (google.cloud.apihub.v1.IApi|null); + } + + /** Represents a CreateApiRequest. */ + class CreateApiRequest implements ICreateApiRequest { + + /** + * Constructs a new CreateApiRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.ICreateApiRequest); + + /** CreateApiRequest parent. */ + public parent: string; + + /** CreateApiRequest apiId. */ + public apiId: string; + + /** CreateApiRequest api. */ + public api?: (google.cloud.apihub.v1.IApi|null); + + /** + * Creates a new CreateApiRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateApiRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.ICreateApiRequest): google.cloud.apihub.v1.CreateApiRequest; + + /** + * Encodes the specified CreateApiRequest message. Does not implicitly {@link google.cloud.apihub.v1.CreateApiRequest.verify|verify} messages. + * @param message CreateApiRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.ICreateApiRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateApiRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.CreateApiRequest.verify|verify} messages. + * @param message CreateApiRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.ICreateApiRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateApiRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateApiRequest + * @throws {Error} If the payload is not 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.apihub.v1.CreateApiRequest; + + /** + * Decodes a CreateApiRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateApiRequest + * @throws {Error} If the payload 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.apihub.v1.CreateApiRequest; + + /** + * Verifies a CreateApiRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateApiRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateApiRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.CreateApiRequest; + + /** + * Creates a plain object from a CreateApiRequest message. Also converts values to other types if specified. + * @param message CreateApiRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.CreateApiRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateApiRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateApiRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetApiRequest. */ + interface IGetApiRequest { + + /** GetApiRequest name */ + name?: (string|null); + } + + /** Represents a GetApiRequest. */ + class GetApiRequest implements IGetApiRequest { + + /** + * Constructs a new GetApiRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IGetApiRequest); + + /** GetApiRequest name. */ + public name: string; + + /** + * Creates a new GetApiRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetApiRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.IGetApiRequest): google.cloud.apihub.v1.GetApiRequest; + + /** + * Encodes the specified GetApiRequest message. Does not implicitly {@link google.cloud.apihub.v1.GetApiRequest.verify|verify} messages. + * @param message GetApiRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IGetApiRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetApiRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.GetApiRequest.verify|verify} messages. + * @param message GetApiRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IGetApiRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetApiRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetApiRequest + * @throws {Error} If the payload is not 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.apihub.v1.GetApiRequest; + + /** + * Decodes a GetApiRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetApiRequest + * @throws {Error} If the payload 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.apihub.v1.GetApiRequest; + + /** + * Verifies a GetApiRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetApiRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetApiRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.GetApiRequest; + + /** + * Creates a plain object from a GetApiRequest message. Also converts values to other types if specified. + * @param message GetApiRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.GetApiRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetApiRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetApiRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateApiRequest. */ + interface IUpdateApiRequest { + + /** UpdateApiRequest api */ + api?: (google.cloud.apihub.v1.IApi|null); + + /** UpdateApiRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateApiRequest. */ + class UpdateApiRequest implements IUpdateApiRequest { + + /** + * Constructs a new UpdateApiRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IUpdateApiRequest); + + /** UpdateApiRequest api. */ + public api?: (google.cloud.apihub.v1.IApi|null); + + /** UpdateApiRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateApiRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateApiRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.IUpdateApiRequest): google.cloud.apihub.v1.UpdateApiRequest; + + /** + * Encodes the specified UpdateApiRequest message. Does not implicitly {@link google.cloud.apihub.v1.UpdateApiRequest.verify|verify} messages. + * @param message UpdateApiRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IUpdateApiRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateApiRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.UpdateApiRequest.verify|verify} messages. + * @param message UpdateApiRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IUpdateApiRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateApiRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateApiRequest + * @throws {Error} If the payload is not 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.apihub.v1.UpdateApiRequest; + + /** + * Decodes an UpdateApiRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateApiRequest + * @throws {Error} If the payload 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.apihub.v1.UpdateApiRequest; + + /** + * Verifies an UpdateApiRequest message. + * @param message Plain 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 UpdateApiRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateApiRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.UpdateApiRequest; + + /** + * Creates a plain object from an UpdateApiRequest message. Also converts values to other types if specified. + * @param message UpdateApiRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.UpdateApiRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateApiRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateApiRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteApiRequest. */ + interface IDeleteApiRequest { + + /** DeleteApiRequest name */ + name?: (string|null); + + /** DeleteApiRequest force */ + force?: (boolean|null); + } + + /** Represents a DeleteApiRequest. */ + class DeleteApiRequest implements IDeleteApiRequest { + + /** + * Constructs a new DeleteApiRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IDeleteApiRequest); + + /** DeleteApiRequest name. */ + public name: string; + + /** DeleteApiRequest force. */ + public force: boolean; + + /** + * Creates a new DeleteApiRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteApiRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.IDeleteApiRequest): google.cloud.apihub.v1.DeleteApiRequest; + + /** + * Encodes the specified DeleteApiRequest message. Does not implicitly {@link google.cloud.apihub.v1.DeleteApiRequest.verify|verify} messages. + * @param message DeleteApiRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IDeleteApiRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteApiRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.DeleteApiRequest.verify|verify} messages. + * @param message DeleteApiRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IDeleteApiRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteApiRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteApiRequest + * @throws {Error} If the payload is not 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.apihub.v1.DeleteApiRequest; + + /** + * Decodes a DeleteApiRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteApiRequest + * @throws {Error} If the payload 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.apihub.v1.DeleteApiRequest; + + /** + * Verifies a DeleteApiRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteApiRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteApiRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.DeleteApiRequest; + + /** + * Creates a plain object from a DeleteApiRequest message. Also converts values to other types if specified. + * @param message DeleteApiRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.DeleteApiRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteApiRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteApiRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListApisRequest. */ + interface IListApisRequest { + + /** ListApisRequest parent */ + parent?: (string|null); + + /** ListApisRequest filter */ + filter?: (string|null); + + /** ListApisRequest pageSize */ + pageSize?: (number|null); + + /** ListApisRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListApisRequest. */ + class ListApisRequest implements IListApisRequest { + + /** + * Constructs a new ListApisRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IListApisRequest); + + /** ListApisRequest parent. */ + public parent: string; + + /** ListApisRequest filter. */ + public filter: string; + + /** ListApisRequest pageSize. */ + public pageSize: number; + + /** ListApisRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListApisRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListApisRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.IListApisRequest): google.cloud.apihub.v1.ListApisRequest; + + /** + * Encodes the specified ListApisRequest message. Does not implicitly {@link google.cloud.apihub.v1.ListApisRequest.verify|verify} messages. + * @param message ListApisRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IListApisRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListApisRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListApisRequest.verify|verify} messages. + * @param message ListApisRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IListApisRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListApisRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListApisRequest + * @throws {Error} If the payload is not 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.apihub.v1.ListApisRequest; + + /** + * Decodes a ListApisRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListApisRequest + * @throws {Error} If the payload 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.apihub.v1.ListApisRequest; + + /** + * Verifies a ListApisRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListApisRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListApisRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.ListApisRequest; + + /** + * Creates a plain object from a ListApisRequest message. Also converts values to other types if specified. + * @param message ListApisRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.ListApisRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListApisRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListApisRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListApisResponse. */ + interface IListApisResponse { + + /** ListApisResponse apis */ + apis?: (google.cloud.apihub.v1.IApi[]|null); + + /** ListApisResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListApisResponse. */ + class ListApisResponse implements IListApisResponse { + + /** + * Constructs a new ListApisResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IListApisResponse); + + /** ListApisResponse apis. */ + public apis: google.cloud.apihub.v1.IApi[]; + + /** ListApisResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListApisResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListApisResponse instance + */ + public static create(properties?: google.cloud.apihub.v1.IListApisResponse): google.cloud.apihub.v1.ListApisResponse; + + /** + * Encodes the specified ListApisResponse message. Does not implicitly {@link google.cloud.apihub.v1.ListApisResponse.verify|verify} messages. + * @param message ListApisResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IListApisResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListApisResponse message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListApisResponse.verify|verify} messages. + * @param message ListApisResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IListApisResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListApisResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListApisResponse + * @throws {Error} If the payload is not 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.apihub.v1.ListApisResponse; + + /** + * Decodes a ListApisResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListApisResponse + * @throws {Error} If the payload 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.apihub.v1.ListApisResponse; + + /** + * Verifies a ListApisResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListApisResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListApisResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.ListApisResponse; + + /** + * Creates a plain object from a ListApisResponse message. Also converts values to other types if specified. + * @param message ListApisResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.ListApisResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListApisResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListApisResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateVersionRequest. */ + interface ICreateVersionRequest { + + /** CreateVersionRequest parent */ + parent?: (string|null); + + /** CreateVersionRequest versionId */ + versionId?: (string|null); + + /** CreateVersionRequest version */ + version?: (google.cloud.apihub.v1.IVersion|null); + } + + /** Represents a CreateVersionRequest. */ + class CreateVersionRequest implements ICreateVersionRequest { + + /** + * Constructs a new CreateVersionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.ICreateVersionRequest); + + /** CreateVersionRequest parent. */ + public parent: string; + + /** CreateVersionRequest versionId. */ + public versionId: string; + + /** CreateVersionRequest version. */ + public version?: (google.cloud.apihub.v1.IVersion|null); + + /** + * Creates a new CreateVersionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateVersionRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.ICreateVersionRequest): google.cloud.apihub.v1.CreateVersionRequest; + + /** + * Encodes the specified CreateVersionRequest message. Does not implicitly {@link google.cloud.apihub.v1.CreateVersionRequest.verify|verify} messages. + * @param message CreateVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.ICreateVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateVersionRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.CreateVersionRequest.verify|verify} messages. + * @param message CreateVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.ICreateVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateVersionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateVersionRequest + * @throws {Error} If the payload is not 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.apihub.v1.CreateVersionRequest; + + /** + * Decodes a CreateVersionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateVersionRequest + * @throws {Error} If the payload 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.apihub.v1.CreateVersionRequest; + + /** + * Verifies a CreateVersionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateVersionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateVersionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.CreateVersionRequest; + + /** + * Creates a plain object from a CreateVersionRequest message. Also converts values to other types if specified. + * @param message CreateVersionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.CreateVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateVersionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateVersionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetVersionRequest. */ + interface IGetVersionRequest { + + /** GetVersionRequest name */ + name?: (string|null); + } + + /** Represents a GetVersionRequest. */ + class GetVersionRequest implements IGetVersionRequest { + + /** + * Constructs a new GetVersionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IGetVersionRequest); + + /** GetVersionRequest name. */ + public name: string; + + /** + * Creates a new GetVersionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetVersionRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.IGetVersionRequest): google.cloud.apihub.v1.GetVersionRequest; + + /** + * Encodes the specified GetVersionRequest message. Does not implicitly {@link google.cloud.apihub.v1.GetVersionRequest.verify|verify} messages. + * @param message GetVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IGetVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetVersionRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.GetVersionRequest.verify|verify} messages. + * @param message GetVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IGetVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetVersionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetVersionRequest + * @throws {Error} If the payload is not 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.apihub.v1.GetVersionRequest; + + /** + * Decodes a GetVersionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetVersionRequest + * @throws {Error} If the payload 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.apihub.v1.GetVersionRequest; + + /** + * Verifies a GetVersionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetVersionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetVersionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.GetVersionRequest; + + /** + * Creates a plain object from a GetVersionRequest message. Also converts values to other types if specified. + * @param message GetVersionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.GetVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetVersionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetVersionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateVersionRequest. */ + interface IUpdateVersionRequest { + + /** UpdateVersionRequest version */ + version?: (google.cloud.apihub.v1.IVersion|null); + + /** UpdateVersionRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateVersionRequest. */ + class UpdateVersionRequest implements IUpdateVersionRequest { + + /** + * Constructs a new UpdateVersionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IUpdateVersionRequest); + + /** UpdateVersionRequest version. */ + public version?: (google.cloud.apihub.v1.IVersion|null); + + /** UpdateVersionRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateVersionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateVersionRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.IUpdateVersionRequest): google.cloud.apihub.v1.UpdateVersionRequest; + + /** + * Encodes the specified UpdateVersionRequest message. Does not implicitly {@link google.cloud.apihub.v1.UpdateVersionRequest.verify|verify} messages. + * @param message UpdateVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IUpdateVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateVersionRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.UpdateVersionRequest.verify|verify} messages. + * @param message UpdateVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IUpdateVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateVersionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateVersionRequest + * @throws {Error} If the payload is not 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.apihub.v1.UpdateVersionRequest; + + /** + * Decodes an UpdateVersionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateVersionRequest + * @throws {Error} If the payload 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.apihub.v1.UpdateVersionRequest; + + /** + * Verifies an UpdateVersionRequest message. + * @param message Plain 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 UpdateVersionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateVersionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.UpdateVersionRequest; + + /** + * Creates a plain object from an UpdateVersionRequest message. Also converts values to other types if specified. + * @param message UpdateVersionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.UpdateVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateVersionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateVersionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteVersionRequest. */ + interface IDeleteVersionRequest { + + /** DeleteVersionRequest name */ + name?: (string|null); + + /** DeleteVersionRequest force */ + force?: (boolean|null); + } + + /** Represents a DeleteVersionRequest. */ + class DeleteVersionRequest implements IDeleteVersionRequest { + + /** + * Constructs a new DeleteVersionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IDeleteVersionRequest); + + /** DeleteVersionRequest name. */ + public name: string; + + /** DeleteVersionRequest force. */ + public force: boolean; + + /** + * Creates a new DeleteVersionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteVersionRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.IDeleteVersionRequest): google.cloud.apihub.v1.DeleteVersionRequest; + + /** + * Encodes the specified DeleteVersionRequest message. Does not implicitly {@link google.cloud.apihub.v1.DeleteVersionRequest.verify|verify} messages. + * @param message DeleteVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IDeleteVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteVersionRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.DeleteVersionRequest.verify|verify} messages. + * @param message DeleteVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IDeleteVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteVersionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteVersionRequest + * @throws {Error} If the payload is not 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.apihub.v1.DeleteVersionRequest; + + /** + * Decodes a DeleteVersionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteVersionRequest + * @throws {Error} If the payload 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.apihub.v1.DeleteVersionRequest; + + /** + * Verifies a DeleteVersionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteVersionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteVersionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.DeleteVersionRequest; + + /** + * Creates a plain object from a DeleteVersionRequest message. Also converts values to other types if specified. + * @param message DeleteVersionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.DeleteVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteVersionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteVersionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListVersionsRequest. */ + interface IListVersionsRequest { + + /** ListVersionsRequest parent */ + parent?: (string|null); + + /** ListVersionsRequest filter */ + filter?: (string|null); + + /** ListVersionsRequest pageSize */ + pageSize?: (number|null); + + /** ListVersionsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListVersionsRequest. */ + class ListVersionsRequest implements IListVersionsRequest { + + /** + * Constructs a new ListVersionsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IListVersionsRequest); + + /** ListVersionsRequest parent. */ + public parent: string; + + /** ListVersionsRequest filter. */ + public filter: string; + + /** ListVersionsRequest pageSize. */ + public pageSize: number; + + /** ListVersionsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListVersionsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListVersionsRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.IListVersionsRequest): google.cloud.apihub.v1.ListVersionsRequest; + + /** + * Encodes the specified ListVersionsRequest message. Does not implicitly {@link google.cloud.apihub.v1.ListVersionsRequest.verify|verify} messages. + * @param message ListVersionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IListVersionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListVersionsRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListVersionsRequest.verify|verify} messages. + * @param message ListVersionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IListVersionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListVersionsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListVersionsRequest + * @throws {Error} If the payload is not 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.apihub.v1.ListVersionsRequest; + + /** + * Decodes a ListVersionsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListVersionsRequest + * @throws {Error} If the payload 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.apihub.v1.ListVersionsRequest; + + /** + * Verifies a ListVersionsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListVersionsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListVersionsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.ListVersionsRequest; + + /** + * Creates a plain object from a ListVersionsRequest message. Also converts values to other types if specified. + * @param message ListVersionsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.ListVersionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListVersionsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListVersionsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListVersionsResponse. */ + interface IListVersionsResponse { + + /** ListVersionsResponse versions */ + versions?: (google.cloud.apihub.v1.IVersion[]|null); + + /** ListVersionsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListVersionsResponse. */ + class ListVersionsResponse implements IListVersionsResponse { + + /** + * Constructs a new ListVersionsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IListVersionsResponse); + + /** ListVersionsResponse versions. */ + public versions: google.cloud.apihub.v1.IVersion[]; + + /** ListVersionsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListVersionsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListVersionsResponse instance + */ + public static create(properties?: google.cloud.apihub.v1.IListVersionsResponse): google.cloud.apihub.v1.ListVersionsResponse; + + /** + * Encodes the specified ListVersionsResponse message. Does not implicitly {@link google.cloud.apihub.v1.ListVersionsResponse.verify|verify} messages. + * @param message ListVersionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IListVersionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListVersionsResponse message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListVersionsResponse.verify|verify} messages. + * @param message ListVersionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IListVersionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListVersionsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListVersionsResponse + * @throws {Error} If the payload is not 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.apihub.v1.ListVersionsResponse; + + /** + * Decodes a ListVersionsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListVersionsResponse + * @throws {Error} If the payload 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.apihub.v1.ListVersionsResponse; + + /** + * Verifies a ListVersionsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListVersionsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListVersionsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.ListVersionsResponse; + + /** + * Creates a plain object from a ListVersionsResponse message. Also converts values to other types if specified. + * @param message ListVersionsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.ListVersionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListVersionsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListVersionsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateSpecRequest. */ + interface ICreateSpecRequest { + + /** CreateSpecRequest parent */ + parent?: (string|null); + + /** CreateSpecRequest specId */ + specId?: (string|null); + + /** CreateSpecRequest spec */ + spec?: (google.cloud.apihub.v1.ISpec|null); + } + + /** Represents a CreateSpecRequest. */ + class CreateSpecRequest implements ICreateSpecRequest { + + /** + * Constructs a new CreateSpecRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.ICreateSpecRequest); + + /** CreateSpecRequest parent. */ + public parent: string; + + /** CreateSpecRequest specId. */ + public specId: string; + + /** CreateSpecRequest spec. */ + public spec?: (google.cloud.apihub.v1.ISpec|null); + + /** + * Creates a new CreateSpecRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateSpecRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.ICreateSpecRequest): google.cloud.apihub.v1.CreateSpecRequest; + + /** + * Encodes the specified CreateSpecRequest message. Does not implicitly {@link google.cloud.apihub.v1.CreateSpecRequest.verify|verify} messages. + * @param message CreateSpecRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.ICreateSpecRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateSpecRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.CreateSpecRequest.verify|verify} messages. + * @param message CreateSpecRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.ICreateSpecRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateSpecRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateSpecRequest + * @throws {Error} If the payload is not 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.apihub.v1.CreateSpecRequest; + + /** + * Decodes a CreateSpecRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateSpecRequest + * @throws {Error} If the payload 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.apihub.v1.CreateSpecRequest; + + /** + * Verifies a CreateSpecRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateSpecRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateSpecRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.CreateSpecRequest; + + /** + * Creates a plain object from a CreateSpecRequest message. Also converts values to other types if specified. + * @param message CreateSpecRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.CreateSpecRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateSpecRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateSpecRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetSpecRequest. */ + interface IGetSpecRequest { + + /** GetSpecRequest name */ + name?: (string|null); + } + + /** Represents a GetSpecRequest. */ + class GetSpecRequest implements IGetSpecRequest { + + /** + * Constructs a new GetSpecRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IGetSpecRequest); + + /** GetSpecRequest name. */ + public name: string; + + /** + * Creates a new GetSpecRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetSpecRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.IGetSpecRequest): google.cloud.apihub.v1.GetSpecRequest; + + /** + * Encodes the specified GetSpecRequest message. Does not implicitly {@link google.cloud.apihub.v1.GetSpecRequest.verify|verify} messages. + * @param message GetSpecRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IGetSpecRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetSpecRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.GetSpecRequest.verify|verify} messages. + * @param message GetSpecRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IGetSpecRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetSpecRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetSpecRequest + * @throws {Error} If the payload is not 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.apihub.v1.GetSpecRequest; + + /** + * Decodes a GetSpecRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetSpecRequest + * @throws {Error} If the payload 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.apihub.v1.GetSpecRequest; + + /** + * Verifies a GetSpecRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetSpecRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetSpecRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.GetSpecRequest; + + /** + * Creates a plain object from a GetSpecRequest message. Also converts values to other types if specified. + * @param message GetSpecRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.GetSpecRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetSpecRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetSpecRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateSpecRequest. */ + interface IUpdateSpecRequest { + + /** UpdateSpecRequest spec */ + spec?: (google.cloud.apihub.v1.ISpec|null); + + /** UpdateSpecRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateSpecRequest. */ + class UpdateSpecRequest implements IUpdateSpecRequest { + + /** + * Constructs a new UpdateSpecRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IUpdateSpecRequest); + + /** UpdateSpecRequest spec. */ + public spec?: (google.cloud.apihub.v1.ISpec|null); + + /** UpdateSpecRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateSpecRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateSpecRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.IUpdateSpecRequest): google.cloud.apihub.v1.UpdateSpecRequest; + + /** + * Encodes the specified UpdateSpecRequest message. Does not implicitly {@link google.cloud.apihub.v1.UpdateSpecRequest.verify|verify} messages. + * @param message UpdateSpecRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IUpdateSpecRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateSpecRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.UpdateSpecRequest.verify|verify} messages. + * @param message UpdateSpecRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IUpdateSpecRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateSpecRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateSpecRequest + * @throws {Error} If the payload is not 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.apihub.v1.UpdateSpecRequest; + + /** + * Decodes an UpdateSpecRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateSpecRequest + * @throws {Error} If the payload 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.apihub.v1.UpdateSpecRequest; + + /** + * Verifies an UpdateSpecRequest message. + * @param message Plain 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 UpdateSpecRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateSpecRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.UpdateSpecRequest; + + /** + * Creates a plain object from an UpdateSpecRequest message. Also converts values to other types if specified. + * @param message UpdateSpecRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.UpdateSpecRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateSpecRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateSpecRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteSpecRequest. */ + interface IDeleteSpecRequest { + + /** DeleteSpecRequest name */ + name?: (string|null); + } + + /** Represents a DeleteSpecRequest. */ + class DeleteSpecRequest implements IDeleteSpecRequest { + + /** + * Constructs a new DeleteSpecRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IDeleteSpecRequest); + + /** DeleteSpecRequest name. */ + public name: string; + + /** + * Creates a new DeleteSpecRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteSpecRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.IDeleteSpecRequest): google.cloud.apihub.v1.DeleteSpecRequest; + + /** + * Encodes the specified DeleteSpecRequest message. Does not implicitly {@link google.cloud.apihub.v1.DeleteSpecRequest.verify|verify} messages. + * @param message DeleteSpecRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IDeleteSpecRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteSpecRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.DeleteSpecRequest.verify|verify} messages. + * @param message DeleteSpecRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IDeleteSpecRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteSpecRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteSpecRequest + * @throws {Error} If the payload is not 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.apihub.v1.DeleteSpecRequest; + + /** + * Decodes a DeleteSpecRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteSpecRequest + * @throws {Error} If the payload 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.apihub.v1.DeleteSpecRequest; + + /** + * Verifies a DeleteSpecRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteSpecRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteSpecRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.DeleteSpecRequest; + + /** + * Creates a plain object from a DeleteSpecRequest message. Also converts values to other types if specified. + * @param message DeleteSpecRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.DeleteSpecRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteSpecRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteSpecRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListSpecsRequest. */ + interface IListSpecsRequest { + + /** ListSpecsRequest parent */ + parent?: (string|null); + + /** ListSpecsRequest filter */ + filter?: (string|null); + + /** ListSpecsRequest pageSize */ + pageSize?: (number|null); + + /** ListSpecsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListSpecsRequest. */ + class ListSpecsRequest implements IListSpecsRequest { + + /** + * Constructs a new ListSpecsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IListSpecsRequest); + + /** ListSpecsRequest parent. */ + public parent: string; + + /** ListSpecsRequest filter. */ + public filter: string; + + /** ListSpecsRequest pageSize. */ + public pageSize: number; + + /** ListSpecsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListSpecsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSpecsRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.IListSpecsRequest): google.cloud.apihub.v1.ListSpecsRequest; + + /** + * Encodes the specified ListSpecsRequest message. Does not implicitly {@link google.cloud.apihub.v1.ListSpecsRequest.verify|verify} messages. + * @param message ListSpecsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IListSpecsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSpecsRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListSpecsRequest.verify|verify} messages. + * @param message ListSpecsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IListSpecsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSpecsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSpecsRequest + * @throws {Error} If the payload is not 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.apihub.v1.ListSpecsRequest; + + /** + * Decodes a ListSpecsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSpecsRequest + * @throws {Error} If the payload 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.apihub.v1.ListSpecsRequest; + + /** + * Verifies a ListSpecsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListSpecsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSpecsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.ListSpecsRequest; + + /** + * Creates a plain object from a ListSpecsRequest message. Also converts values to other types if specified. + * @param message ListSpecsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.ListSpecsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSpecsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSpecsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListSpecsResponse. */ + interface IListSpecsResponse { + + /** ListSpecsResponse specs */ + specs?: (google.cloud.apihub.v1.ISpec[]|null); + + /** ListSpecsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListSpecsResponse. */ + class ListSpecsResponse implements IListSpecsResponse { + + /** + * Constructs a new ListSpecsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IListSpecsResponse); + + /** ListSpecsResponse specs. */ + public specs: google.cloud.apihub.v1.ISpec[]; + + /** ListSpecsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListSpecsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSpecsResponse instance + */ + public static create(properties?: google.cloud.apihub.v1.IListSpecsResponse): google.cloud.apihub.v1.ListSpecsResponse; + + /** + * Encodes the specified ListSpecsResponse message. Does not implicitly {@link google.cloud.apihub.v1.ListSpecsResponse.verify|verify} messages. + * @param message ListSpecsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IListSpecsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSpecsResponse message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListSpecsResponse.verify|verify} messages. + * @param message ListSpecsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IListSpecsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSpecsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSpecsResponse + * @throws {Error} If the payload is not 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.apihub.v1.ListSpecsResponse; + + /** + * Decodes a ListSpecsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSpecsResponse + * @throws {Error} If the payload 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.apihub.v1.ListSpecsResponse; + + /** + * Verifies a ListSpecsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListSpecsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSpecsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.ListSpecsResponse; + + /** + * Creates a plain object from a ListSpecsResponse message. Also converts values to other types if specified. + * @param message ListSpecsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.ListSpecsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSpecsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSpecsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetSpecContentsRequest. */ + interface IGetSpecContentsRequest { + + /** GetSpecContentsRequest name */ + name?: (string|null); + } + + /** Represents a GetSpecContentsRequest. */ + class GetSpecContentsRequest implements IGetSpecContentsRequest { + + /** + * Constructs a new GetSpecContentsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IGetSpecContentsRequest); + + /** GetSpecContentsRequest name. */ + public name: string; + + /** + * Creates a new GetSpecContentsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetSpecContentsRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.IGetSpecContentsRequest): google.cloud.apihub.v1.GetSpecContentsRequest; + + /** + * Encodes the specified GetSpecContentsRequest message. Does not implicitly {@link google.cloud.apihub.v1.GetSpecContentsRequest.verify|verify} messages. + * @param message GetSpecContentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IGetSpecContentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetSpecContentsRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.GetSpecContentsRequest.verify|verify} messages. + * @param message GetSpecContentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IGetSpecContentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetSpecContentsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetSpecContentsRequest + * @throws {Error} If the payload is not 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.apihub.v1.GetSpecContentsRequest; + + /** + * Decodes a GetSpecContentsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetSpecContentsRequest + * @throws {Error} If the payload 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.apihub.v1.GetSpecContentsRequest; + + /** + * Verifies a GetSpecContentsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetSpecContentsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetSpecContentsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.GetSpecContentsRequest; + + /** + * Creates a plain object from a GetSpecContentsRequest message. Also converts values to other types if specified. + * @param message GetSpecContentsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.GetSpecContentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetSpecContentsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetSpecContentsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetApiOperationRequest. */ + interface IGetApiOperationRequest { + + /** GetApiOperationRequest name */ + name?: (string|null); + } + + /** Represents a GetApiOperationRequest. */ + class GetApiOperationRequest implements IGetApiOperationRequest { + + /** + * Constructs a new GetApiOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IGetApiOperationRequest); + + /** GetApiOperationRequest name. */ + public name: string; + + /** + * Creates a new GetApiOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetApiOperationRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.IGetApiOperationRequest): google.cloud.apihub.v1.GetApiOperationRequest; + + /** + * Encodes the specified GetApiOperationRequest message. Does not implicitly {@link google.cloud.apihub.v1.GetApiOperationRequest.verify|verify} messages. + * @param message GetApiOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IGetApiOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetApiOperationRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.GetApiOperationRequest.verify|verify} messages. + * @param message GetApiOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IGetApiOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetApiOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetApiOperationRequest + * @throws {Error} If the payload is not 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.apihub.v1.GetApiOperationRequest; + + /** + * Decodes a GetApiOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetApiOperationRequest + * @throws {Error} If the payload 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.apihub.v1.GetApiOperationRequest; + + /** + * Verifies a GetApiOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetApiOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetApiOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.GetApiOperationRequest; + + /** + * Creates a plain object from a GetApiOperationRequest message. Also converts values to other types if specified. + * @param message GetApiOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.GetApiOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetApiOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetApiOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListApiOperationsRequest. */ + interface IListApiOperationsRequest { + + /** ListApiOperationsRequest parent */ + parent?: (string|null); + + /** ListApiOperationsRequest filter */ + filter?: (string|null); + + /** ListApiOperationsRequest pageSize */ + pageSize?: (number|null); + + /** ListApiOperationsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListApiOperationsRequest. */ + class ListApiOperationsRequest implements IListApiOperationsRequest { + + /** + * Constructs a new ListApiOperationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IListApiOperationsRequest); + + /** ListApiOperationsRequest parent. */ + public parent: string; + + /** ListApiOperationsRequest filter. */ + public filter: string; + + /** ListApiOperationsRequest pageSize. */ + public pageSize: number; + + /** ListApiOperationsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListApiOperationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListApiOperationsRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.IListApiOperationsRequest): google.cloud.apihub.v1.ListApiOperationsRequest; + + /** + * Encodes the specified ListApiOperationsRequest message. Does not implicitly {@link google.cloud.apihub.v1.ListApiOperationsRequest.verify|verify} messages. + * @param message ListApiOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IListApiOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListApiOperationsRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListApiOperationsRequest.verify|verify} messages. + * @param message ListApiOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IListApiOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListApiOperationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListApiOperationsRequest + * @throws {Error} If the payload is not 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.apihub.v1.ListApiOperationsRequest; + + /** + * Decodes a ListApiOperationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListApiOperationsRequest + * @throws {Error} If the payload 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.apihub.v1.ListApiOperationsRequest; + + /** + * Verifies a ListApiOperationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListApiOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListApiOperationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.ListApiOperationsRequest; + + /** + * Creates a plain object from a ListApiOperationsRequest message. Also converts values to other types if specified. + * @param message ListApiOperationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.ListApiOperationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListApiOperationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListApiOperationsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListApiOperationsResponse. */ + interface IListApiOperationsResponse { + + /** ListApiOperationsResponse apiOperations */ + apiOperations?: (google.cloud.apihub.v1.IApiOperation[]|null); + + /** ListApiOperationsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListApiOperationsResponse. */ + class ListApiOperationsResponse implements IListApiOperationsResponse { + + /** + * Constructs a new ListApiOperationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IListApiOperationsResponse); + + /** ListApiOperationsResponse apiOperations. */ + public apiOperations: google.cloud.apihub.v1.IApiOperation[]; + + /** ListApiOperationsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListApiOperationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListApiOperationsResponse instance + */ + public static create(properties?: google.cloud.apihub.v1.IListApiOperationsResponse): google.cloud.apihub.v1.ListApiOperationsResponse; + + /** + * Encodes the specified ListApiOperationsResponse message. Does not implicitly {@link google.cloud.apihub.v1.ListApiOperationsResponse.verify|verify} messages. + * @param message ListApiOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IListApiOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListApiOperationsResponse message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListApiOperationsResponse.verify|verify} messages. + * @param message ListApiOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IListApiOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListApiOperationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListApiOperationsResponse + * @throws {Error} If the payload is not 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.apihub.v1.ListApiOperationsResponse; + + /** + * Decodes a ListApiOperationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListApiOperationsResponse + * @throws {Error} If the payload 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.apihub.v1.ListApiOperationsResponse; + + /** + * Verifies a ListApiOperationsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListApiOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListApiOperationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.ListApiOperationsResponse; + + /** + * Creates a plain object from a ListApiOperationsResponse message. Also converts values to other types if specified. + * @param message ListApiOperationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.ListApiOperationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListApiOperationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListApiOperationsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetDefinitionRequest. */ + interface IGetDefinitionRequest { + + /** GetDefinitionRequest name */ + name?: (string|null); + } + + /** Represents a GetDefinitionRequest. */ + class GetDefinitionRequest implements IGetDefinitionRequest { + + /** + * Constructs a new GetDefinitionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IGetDefinitionRequest); + + /** GetDefinitionRequest name. */ + public name: string; + + /** + * Creates a new GetDefinitionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetDefinitionRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.IGetDefinitionRequest): google.cloud.apihub.v1.GetDefinitionRequest; + + /** + * Encodes the specified GetDefinitionRequest message. Does not implicitly {@link google.cloud.apihub.v1.GetDefinitionRequest.verify|verify} messages. + * @param message GetDefinitionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IGetDefinitionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetDefinitionRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.GetDefinitionRequest.verify|verify} messages. + * @param message GetDefinitionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IGetDefinitionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetDefinitionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetDefinitionRequest + * @throws {Error} If the payload is not 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.apihub.v1.GetDefinitionRequest; + + /** + * Decodes a GetDefinitionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetDefinitionRequest + * @throws {Error} If the payload 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.apihub.v1.GetDefinitionRequest; + + /** + * Verifies a GetDefinitionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetDefinitionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetDefinitionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.GetDefinitionRequest; + + /** + * Creates a plain object from a GetDefinitionRequest message. Also converts values to other types if specified. + * @param message GetDefinitionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.GetDefinitionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetDefinitionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetDefinitionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateDeploymentRequest. */ + interface ICreateDeploymentRequest { + + /** CreateDeploymentRequest parent */ + parent?: (string|null); + + /** CreateDeploymentRequest deploymentId */ + deploymentId?: (string|null); + + /** CreateDeploymentRequest deployment */ + deployment?: (google.cloud.apihub.v1.IDeployment|null); + } + + /** Represents a CreateDeploymentRequest. */ + class CreateDeploymentRequest implements ICreateDeploymentRequest { + + /** + * Constructs a new CreateDeploymentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.ICreateDeploymentRequest); + + /** CreateDeploymentRequest parent. */ + public parent: string; + + /** CreateDeploymentRequest deploymentId. */ + public deploymentId: string; + + /** CreateDeploymentRequest deployment. */ + public deployment?: (google.cloud.apihub.v1.IDeployment|null); + + /** + * Creates a new CreateDeploymentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateDeploymentRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.ICreateDeploymentRequest): google.cloud.apihub.v1.CreateDeploymentRequest; + + /** + * Encodes the specified CreateDeploymentRequest message. Does not implicitly {@link google.cloud.apihub.v1.CreateDeploymentRequest.verify|verify} messages. + * @param message CreateDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.ICreateDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.CreateDeploymentRequest.verify|verify} messages. + * @param message CreateDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.ICreateDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateDeploymentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateDeploymentRequest + * @throws {Error} If the payload is not 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.apihub.v1.CreateDeploymentRequest; + + /** + * Decodes a CreateDeploymentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateDeploymentRequest + * @throws {Error} If the payload 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.apihub.v1.CreateDeploymentRequest; + + /** + * Verifies a CreateDeploymentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateDeploymentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.CreateDeploymentRequest; + + /** + * Creates a plain object from a CreateDeploymentRequest message. Also converts values to other types if specified. + * @param message CreateDeploymentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.CreateDeploymentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateDeploymentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateDeploymentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetDeploymentRequest. */ + interface IGetDeploymentRequest { + + /** GetDeploymentRequest name */ + name?: (string|null); + } + + /** Represents a GetDeploymentRequest. */ + class GetDeploymentRequest implements IGetDeploymentRequest { + + /** + * Constructs a new GetDeploymentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IGetDeploymentRequest); + + /** GetDeploymentRequest name. */ + public name: string; + + /** + * Creates a new GetDeploymentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetDeploymentRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.IGetDeploymentRequest): google.cloud.apihub.v1.GetDeploymentRequest; + + /** + * Encodes the specified GetDeploymentRequest message. Does not implicitly {@link google.cloud.apihub.v1.GetDeploymentRequest.verify|verify} messages. + * @param message GetDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IGetDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.GetDeploymentRequest.verify|verify} messages. + * @param message GetDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IGetDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetDeploymentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetDeploymentRequest + * @throws {Error} If the payload is not 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.apihub.v1.GetDeploymentRequest; + + /** + * Decodes a GetDeploymentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetDeploymentRequest + * @throws {Error} If the payload 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.apihub.v1.GetDeploymentRequest; + + /** + * Verifies a GetDeploymentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetDeploymentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.GetDeploymentRequest; + + /** + * Creates a plain object from a GetDeploymentRequest message. Also converts values to other types if specified. + * @param message GetDeploymentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.GetDeploymentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetDeploymentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetDeploymentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateDeploymentRequest. */ + interface IUpdateDeploymentRequest { + + /** UpdateDeploymentRequest deployment */ + deployment?: (google.cloud.apihub.v1.IDeployment|null); + + /** UpdateDeploymentRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateDeploymentRequest. */ + class UpdateDeploymentRequest implements IUpdateDeploymentRequest { + + /** + * Constructs a new UpdateDeploymentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IUpdateDeploymentRequest); + + /** UpdateDeploymentRequest deployment. */ + public deployment?: (google.cloud.apihub.v1.IDeployment|null); + + /** UpdateDeploymentRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateDeploymentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateDeploymentRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.IUpdateDeploymentRequest): google.cloud.apihub.v1.UpdateDeploymentRequest; + + /** + * Encodes the specified UpdateDeploymentRequest message. Does not implicitly {@link google.cloud.apihub.v1.UpdateDeploymentRequest.verify|verify} messages. + * @param message UpdateDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IUpdateDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.UpdateDeploymentRequest.verify|verify} messages. + * @param message UpdateDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IUpdateDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateDeploymentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateDeploymentRequest + * @throws {Error} If the payload is not 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.apihub.v1.UpdateDeploymentRequest; + + /** + * Decodes an UpdateDeploymentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateDeploymentRequest + * @throws {Error} If the payload 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.apihub.v1.UpdateDeploymentRequest; + + /** + * Verifies an UpdateDeploymentRequest message. + * @param message Plain 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 UpdateDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateDeploymentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.UpdateDeploymentRequest; + + /** + * Creates a plain object from an UpdateDeploymentRequest message. Also converts values to other types if specified. + * @param message UpdateDeploymentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.UpdateDeploymentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateDeploymentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateDeploymentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteDeploymentRequest. */ + interface IDeleteDeploymentRequest { + + /** DeleteDeploymentRequest name */ + name?: (string|null); + } + + /** Represents a DeleteDeploymentRequest. */ + class DeleteDeploymentRequest implements IDeleteDeploymentRequest { + + /** + * Constructs a new DeleteDeploymentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IDeleteDeploymentRequest); + + /** DeleteDeploymentRequest name. */ + public name: string; + + /** + * Creates a new DeleteDeploymentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteDeploymentRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.IDeleteDeploymentRequest): google.cloud.apihub.v1.DeleteDeploymentRequest; + + /** + * Encodes the specified DeleteDeploymentRequest message. Does not implicitly {@link google.cloud.apihub.v1.DeleteDeploymentRequest.verify|verify} messages. + * @param message DeleteDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IDeleteDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.DeleteDeploymentRequest.verify|verify} messages. + * @param message DeleteDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IDeleteDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteDeploymentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteDeploymentRequest + * @throws {Error} If the payload is not 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.apihub.v1.DeleteDeploymentRequest; + + /** + * Decodes a DeleteDeploymentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteDeploymentRequest + * @throws {Error} If the payload 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.apihub.v1.DeleteDeploymentRequest; + + /** + * Verifies a DeleteDeploymentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteDeploymentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.DeleteDeploymentRequest; + + /** + * Creates a plain object from a DeleteDeploymentRequest message. Also converts values to other types if specified. + * @param message DeleteDeploymentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.DeleteDeploymentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteDeploymentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteDeploymentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListDeploymentsRequest. */ + interface IListDeploymentsRequest { + + /** ListDeploymentsRequest parent */ + parent?: (string|null); + + /** ListDeploymentsRequest filter */ + filter?: (string|null); + + /** ListDeploymentsRequest pageSize */ + pageSize?: (number|null); + + /** ListDeploymentsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListDeploymentsRequest. */ + class ListDeploymentsRequest implements IListDeploymentsRequest { + + /** + * Constructs a new ListDeploymentsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IListDeploymentsRequest); + + /** ListDeploymentsRequest parent. */ + public parent: string; + + /** ListDeploymentsRequest filter. */ + public filter: string; + + /** ListDeploymentsRequest pageSize. */ + public pageSize: number; + + /** ListDeploymentsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListDeploymentsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDeploymentsRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.IListDeploymentsRequest): google.cloud.apihub.v1.ListDeploymentsRequest; + + /** + * Encodes the specified ListDeploymentsRequest message. Does not implicitly {@link google.cloud.apihub.v1.ListDeploymentsRequest.verify|verify} messages. + * @param message ListDeploymentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IListDeploymentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDeploymentsRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListDeploymentsRequest.verify|verify} messages. + * @param message ListDeploymentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IListDeploymentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDeploymentsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDeploymentsRequest + * @throws {Error} If the payload is not 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.apihub.v1.ListDeploymentsRequest; + + /** + * Decodes a ListDeploymentsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDeploymentsRequest + * @throws {Error} If the payload 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.apihub.v1.ListDeploymentsRequest; + + /** + * Verifies a ListDeploymentsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListDeploymentsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDeploymentsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.ListDeploymentsRequest; + + /** + * Creates a plain object from a ListDeploymentsRequest message. Also converts values to other types if specified. + * @param message ListDeploymentsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.ListDeploymentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDeploymentsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListDeploymentsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListDeploymentsResponse. */ + interface IListDeploymentsResponse { + + /** ListDeploymentsResponse deployments */ + deployments?: (google.cloud.apihub.v1.IDeployment[]|null); + + /** ListDeploymentsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListDeploymentsResponse. */ + class ListDeploymentsResponse implements IListDeploymentsResponse { + + /** + * Constructs a new ListDeploymentsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IListDeploymentsResponse); + + /** ListDeploymentsResponse deployments. */ + public deployments: google.cloud.apihub.v1.IDeployment[]; + + /** ListDeploymentsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListDeploymentsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDeploymentsResponse instance + */ + public static create(properties?: google.cloud.apihub.v1.IListDeploymentsResponse): google.cloud.apihub.v1.ListDeploymentsResponse; + + /** + * Encodes the specified ListDeploymentsResponse message. Does not implicitly {@link google.cloud.apihub.v1.ListDeploymentsResponse.verify|verify} messages. + * @param message ListDeploymentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IListDeploymentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDeploymentsResponse message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListDeploymentsResponse.verify|verify} messages. + * @param message ListDeploymentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IListDeploymentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDeploymentsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDeploymentsResponse + * @throws {Error} If the payload is not 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.apihub.v1.ListDeploymentsResponse; + + /** + * Decodes a ListDeploymentsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDeploymentsResponse + * @throws {Error} If the payload 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.apihub.v1.ListDeploymentsResponse; + + /** + * Verifies a ListDeploymentsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListDeploymentsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDeploymentsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.ListDeploymentsResponse; + + /** + * Creates a plain object from a ListDeploymentsResponse message. Also converts values to other types if specified. + * @param message ListDeploymentsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.ListDeploymentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDeploymentsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListDeploymentsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateAttributeRequest. */ + interface ICreateAttributeRequest { + + /** CreateAttributeRequest parent */ + parent?: (string|null); + + /** CreateAttributeRequest attributeId */ + attributeId?: (string|null); + + /** CreateAttributeRequest attribute */ + attribute?: (google.cloud.apihub.v1.IAttribute|null); + } + + /** Represents a CreateAttributeRequest. */ + class CreateAttributeRequest implements ICreateAttributeRequest { + + /** + * Constructs a new CreateAttributeRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.ICreateAttributeRequest); + + /** CreateAttributeRequest parent. */ + public parent: string; + + /** CreateAttributeRequest attributeId. */ + public attributeId: string; + + /** CreateAttributeRequest attribute. */ + public attribute?: (google.cloud.apihub.v1.IAttribute|null); + + /** + * Creates a new CreateAttributeRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateAttributeRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.ICreateAttributeRequest): google.cloud.apihub.v1.CreateAttributeRequest; + + /** + * Encodes the specified CreateAttributeRequest message. Does not implicitly {@link google.cloud.apihub.v1.CreateAttributeRequest.verify|verify} messages. + * @param message CreateAttributeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.ICreateAttributeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateAttributeRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.CreateAttributeRequest.verify|verify} messages. + * @param message CreateAttributeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.ICreateAttributeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateAttributeRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateAttributeRequest + * @throws {Error} If the payload is not 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.apihub.v1.CreateAttributeRequest; + + /** + * Decodes a CreateAttributeRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateAttributeRequest + * @throws {Error} If the payload 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.apihub.v1.CreateAttributeRequest; + + /** + * Verifies a CreateAttributeRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateAttributeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateAttributeRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.CreateAttributeRequest; + + /** + * Creates a plain object from a CreateAttributeRequest message. Also converts values to other types if specified. + * @param message CreateAttributeRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.CreateAttributeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateAttributeRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateAttributeRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetAttributeRequest. */ + interface IGetAttributeRequest { + + /** GetAttributeRequest name */ + name?: (string|null); + } + + /** Represents a GetAttributeRequest. */ + class GetAttributeRequest implements IGetAttributeRequest { + + /** + * Constructs a new GetAttributeRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IGetAttributeRequest); + + /** GetAttributeRequest name. */ + public name: string; + + /** + * Creates a new GetAttributeRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetAttributeRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.IGetAttributeRequest): google.cloud.apihub.v1.GetAttributeRequest; + + /** + * Encodes the specified GetAttributeRequest message. Does not implicitly {@link google.cloud.apihub.v1.GetAttributeRequest.verify|verify} messages. + * @param message GetAttributeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IGetAttributeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetAttributeRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.GetAttributeRequest.verify|verify} messages. + * @param message GetAttributeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IGetAttributeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetAttributeRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetAttributeRequest + * @throws {Error} If the payload is not 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.apihub.v1.GetAttributeRequest; + + /** + * Decodes a GetAttributeRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetAttributeRequest + * @throws {Error} If the payload 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.apihub.v1.GetAttributeRequest; + + /** + * Verifies a GetAttributeRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetAttributeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetAttributeRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.GetAttributeRequest; + + /** + * Creates a plain object from a GetAttributeRequest message. Also converts values to other types if specified. + * @param message GetAttributeRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.GetAttributeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetAttributeRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetAttributeRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateAttributeRequest. */ + interface IUpdateAttributeRequest { + + /** UpdateAttributeRequest attribute */ + attribute?: (google.cloud.apihub.v1.IAttribute|null); + + /** UpdateAttributeRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateAttributeRequest. */ + class UpdateAttributeRequest implements IUpdateAttributeRequest { + + /** + * Constructs a new UpdateAttributeRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IUpdateAttributeRequest); + + /** UpdateAttributeRequest attribute. */ + public attribute?: (google.cloud.apihub.v1.IAttribute|null); + + /** UpdateAttributeRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateAttributeRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateAttributeRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.IUpdateAttributeRequest): google.cloud.apihub.v1.UpdateAttributeRequest; + + /** + * Encodes the specified UpdateAttributeRequest message. Does not implicitly {@link google.cloud.apihub.v1.UpdateAttributeRequest.verify|verify} messages. + * @param message UpdateAttributeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IUpdateAttributeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateAttributeRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.UpdateAttributeRequest.verify|verify} messages. + * @param message UpdateAttributeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IUpdateAttributeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateAttributeRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateAttributeRequest + * @throws {Error} If the payload is not 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.apihub.v1.UpdateAttributeRequest; + + /** + * Decodes an UpdateAttributeRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateAttributeRequest + * @throws {Error} If the payload 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.apihub.v1.UpdateAttributeRequest; + + /** + * Verifies an UpdateAttributeRequest message. + * @param message Plain 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 UpdateAttributeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateAttributeRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.UpdateAttributeRequest; + + /** + * Creates a plain object from an UpdateAttributeRequest message. Also converts values to other types if specified. + * @param message UpdateAttributeRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.UpdateAttributeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateAttributeRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateAttributeRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteAttributeRequest. */ + interface IDeleteAttributeRequest { + + /** DeleteAttributeRequest name */ + name?: (string|null); + } + + /** Represents a DeleteAttributeRequest. */ + class DeleteAttributeRequest implements IDeleteAttributeRequest { + + /** + * Constructs a new DeleteAttributeRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IDeleteAttributeRequest); + + /** DeleteAttributeRequest name. */ + public name: string; + + /** + * Creates a new DeleteAttributeRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteAttributeRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.IDeleteAttributeRequest): google.cloud.apihub.v1.DeleteAttributeRequest; + + /** + * Encodes the specified DeleteAttributeRequest message. Does not implicitly {@link google.cloud.apihub.v1.DeleteAttributeRequest.verify|verify} messages. + * @param message DeleteAttributeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IDeleteAttributeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteAttributeRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.DeleteAttributeRequest.verify|verify} messages. + * @param message DeleteAttributeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IDeleteAttributeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteAttributeRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteAttributeRequest + * @throws {Error} If the payload is not 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.apihub.v1.DeleteAttributeRequest; + + /** + * Decodes a DeleteAttributeRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteAttributeRequest + * @throws {Error} If the payload 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.apihub.v1.DeleteAttributeRequest; + + /** + * Verifies a DeleteAttributeRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteAttributeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteAttributeRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.DeleteAttributeRequest; + + /** + * Creates a plain object from a DeleteAttributeRequest message. Also converts values to other types if specified. + * @param message DeleteAttributeRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.DeleteAttributeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteAttributeRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteAttributeRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListAttributesRequest. */ + interface IListAttributesRequest { + + /** ListAttributesRequest parent */ + parent?: (string|null); + + /** ListAttributesRequest filter */ + filter?: (string|null); + + /** ListAttributesRequest pageSize */ + pageSize?: (number|null); + + /** ListAttributesRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListAttributesRequest. */ + class ListAttributesRequest implements IListAttributesRequest { + + /** + * Constructs a new ListAttributesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IListAttributesRequest); + + /** ListAttributesRequest parent. */ + public parent: string; + + /** ListAttributesRequest filter. */ + public filter: string; + + /** ListAttributesRequest pageSize. */ + public pageSize: number; + + /** ListAttributesRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListAttributesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAttributesRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.IListAttributesRequest): google.cloud.apihub.v1.ListAttributesRequest; + + /** + * Encodes the specified ListAttributesRequest message. Does not implicitly {@link google.cloud.apihub.v1.ListAttributesRequest.verify|verify} messages. + * @param message ListAttributesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IListAttributesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAttributesRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListAttributesRequest.verify|verify} messages. + * @param message ListAttributesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IListAttributesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAttributesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAttributesRequest + * @throws {Error} If the payload is not 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.apihub.v1.ListAttributesRequest; + + /** + * Decodes a ListAttributesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAttributesRequest + * @throws {Error} If the payload 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.apihub.v1.ListAttributesRequest; + + /** + * Verifies a ListAttributesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListAttributesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAttributesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.ListAttributesRequest; + + /** + * Creates a plain object from a ListAttributesRequest message. Also converts values to other types if specified. + * @param message ListAttributesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.ListAttributesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAttributesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAttributesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListAttributesResponse. */ + interface IListAttributesResponse { + + /** ListAttributesResponse attributes */ + attributes?: (google.cloud.apihub.v1.IAttribute[]|null); + + /** ListAttributesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListAttributesResponse. */ + class ListAttributesResponse implements IListAttributesResponse { + + /** + * Constructs a new ListAttributesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IListAttributesResponse); + + /** ListAttributesResponse attributes. */ + public attributes: google.cloud.apihub.v1.IAttribute[]; + + /** ListAttributesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListAttributesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAttributesResponse instance + */ + public static create(properties?: google.cloud.apihub.v1.IListAttributesResponse): google.cloud.apihub.v1.ListAttributesResponse; + + /** + * Encodes the specified ListAttributesResponse message. Does not implicitly {@link google.cloud.apihub.v1.ListAttributesResponse.verify|verify} messages. + * @param message ListAttributesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IListAttributesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAttributesResponse message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListAttributesResponse.verify|verify} messages. + * @param message ListAttributesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IListAttributesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAttributesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAttributesResponse + * @throws {Error} If the payload is not 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.apihub.v1.ListAttributesResponse; + + /** + * Decodes a ListAttributesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAttributesResponse + * @throws {Error} If the payload 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.apihub.v1.ListAttributesResponse; + + /** + * Verifies a ListAttributesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListAttributesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAttributesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.ListAttributesResponse; + + /** + * Creates a plain object from a ListAttributesResponse message. Also converts values to other types if specified. + * @param message ListAttributesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.ListAttributesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAttributesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAttributesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SearchResourcesRequest. */ + interface ISearchResourcesRequest { + + /** SearchResourcesRequest location */ + location?: (string|null); + + /** SearchResourcesRequest query */ + query?: (string|null); + + /** SearchResourcesRequest filter */ + filter?: (string|null); + + /** SearchResourcesRequest pageSize */ + pageSize?: (number|null); + + /** SearchResourcesRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a SearchResourcesRequest. */ + class SearchResourcesRequest implements ISearchResourcesRequest { + + /** + * Constructs a new SearchResourcesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.ISearchResourcesRequest); + + /** SearchResourcesRequest location. */ + public location: string; + + /** SearchResourcesRequest query. */ + public query: string; + + /** SearchResourcesRequest filter. */ + public filter: string; + + /** SearchResourcesRequest pageSize. */ + public pageSize: number; + + /** SearchResourcesRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new SearchResourcesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SearchResourcesRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.ISearchResourcesRequest): google.cloud.apihub.v1.SearchResourcesRequest; + + /** + * Encodes the specified SearchResourcesRequest message. Does not implicitly {@link google.cloud.apihub.v1.SearchResourcesRequest.verify|verify} messages. + * @param message SearchResourcesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.ISearchResourcesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SearchResourcesRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.SearchResourcesRequest.verify|verify} messages. + * @param message SearchResourcesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.ISearchResourcesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SearchResourcesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SearchResourcesRequest + * @throws {Error} If the payload is not 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.apihub.v1.SearchResourcesRequest; + + /** + * Decodes a SearchResourcesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SearchResourcesRequest + * @throws {Error} If the payload 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.apihub.v1.SearchResourcesRequest; + + /** + * Verifies a SearchResourcesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SearchResourcesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SearchResourcesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.SearchResourcesRequest; + + /** + * Creates a plain object from a SearchResourcesRequest message. Also converts values to other types if specified. + * @param message SearchResourcesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.SearchResourcesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SearchResourcesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SearchResourcesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ApiHubResource. */ + interface IApiHubResource { + + /** ApiHubResource api */ + api?: (google.cloud.apihub.v1.IApi|null); + + /** ApiHubResource operation */ + operation?: (google.cloud.apihub.v1.IApiOperation|null); + + /** ApiHubResource deployment */ + deployment?: (google.cloud.apihub.v1.IDeployment|null); + + /** ApiHubResource spec */ + spec?: (google.cloud.apihub.v1.ISpec|null); + + /** ApiHubResource definition */ + definition?: (google.cloud.apihub.v1.IDefinition|null); + + /** ApiHubResource version */ + version?: (google.cloud.apihub.v1.IVersion|null); + } + + /** Represents an ApiHubResource. */ + class ApiHubResource implements IApiHubResource { + + /** + * Constructs a new ApiHubResource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IApiHubResource); + + /** ApiHubResource api. */ + public api?: (google.cloud.apihub.v1.IApi|null); + + /** ApiHubResource operation. */ + public operation?: (google.cloud.apihub.v1.IApiOperation|null); + + /** ApiHubResource deployment. */ + public deployment?: (google.cloud.apihub.v1.IDeployment|null); + + /** ApiHubResource spec. */ + public spec?: (google.cloud.apihub.v1.ISpec|null); + + /** ApiHubResource definition. */ + public definition?: (google.cloud.apihub.v1.IDefinition|null); + + /** ApiHubResource version. */ + public version?: (google.cloud.apihub.v1.IVersion|null); + + /** ApiHubResource resource. */ + public resource?: ("api"|"operation"|"deployment"|"spec"|"definition"|"version"); + + /** + * Creates a new ApiHubResource instance using the specified properties. + * @param [properties] Properties to set + * @returns ApiHubResource instance + */ + public static create(properties?: google.cloud.apihub.v1.IApiHubResource): google.cloud.apihub.v1.ApiHubResource; + + /** + * Encodes the specified ApiHubResource message. Does not implicitly {@link google.cloud.apihub.v1.ApiHubResource.verify|verify} messages. + * @param message ApiHubResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IApiHubResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ApiHubResource message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ApiHubResource.verify|verify} messages. + * @param message ApiHubResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IApiHubResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ApiHubResource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ApiHubResource + * @throws {Error} If the payload is not 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.apihub.v1.ApiHubResource; + + /** + * Decodes an ApiHubResource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ApiHubResource + * @throws {Error} If the payload 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.apihub.v1.ApiHubResource; + + /** + * Verifies an ApiHubResource message. + * @param message Plain 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 ApiHubResource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ApiHubResource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.ApiHubResource; + + /** + * Creates a plain object from an ApiHubResource message. Also converts values to other types if specified. + * @param message ApiHubResource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.ApiHubResource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ApiHubResource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ApiHubResource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SearchResult. */ + interface ISearchResult { + + /** SearchResult resource */ + resource?: (google.cloud.apihub.v1.IApiHubResource|null); + } + + /** Represents a SearchResult. */ + class SearchResult implements ISearchResult { + + /** + * Constructs a new SearchResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.ISearchResult); + + /** SearchResult resource. */ + public resource?: (google.cloud.apihub.v1.IApiHubResource|null); + + /** + * Creates a new SearchResult instance using the specified properties. + * @param [properties] Properties to set + * @returns SearchResult instance + */ + public static create(properties?: google.cloud.apihub.v1.ISearchResult): google.cloud.apihub.v1.SearchResult; + + /** + * Encodes the specified SearchResult message. Does not implicitly {@link google.cloud.apihub.v1.SearchResult.verify|verify} messages. + * @param message SearchResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.ISearchResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SearchResult message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.SearchResult.verify|verify} messages. + * @param message SearchResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.ISearchResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SearchResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SearchResult + * @throws {Error} If the payload is not 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.apihub.v1.SearchResult; + + /** + * Decodes a SearchResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SearchResult + * @throws {Error} If the payload 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.apihub.v1.SearchResult; + + /** + * Verifies a SearchResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SearchResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SearchResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.SearchResult; + + /** + * Creates a plain object from a SearchResult message. Also converts values to other types if specified. + * @param message SearchResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.SearchResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SearchResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SearchResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SearchResourcesResponse. */ + interface ISearchResourcesResponse { + + /** SearchResourcesResponse searchResults */ + searchResults?: (google.cloud.apihub.v1.ISearchResult[]|null); + + /** SearchResourcesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a SearchResourcesResponse. */ + class SearchResourcesResponse implements ISearchResourcesResponse { + + /** + * Constructs a new SearchResourcesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.ISearchResourcesResponse); + + /** SearchResourcesResponse searchResults. */ + public searchResults: google.cloud.apihub.v1.ISearchResult[]; + + /** SearchResourcesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new SearchResourcesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns SearchResourcesResponse instance + */ + public static create(properties?: google.cloud.apihub.v1.ISearchResourcesResponse): google.cloud.apihub.v1.SearchResourcesResponse; + + /** + * Encodes the specified SearchResourcesResponse message. Does not implicitly {@link google.cloud.apihub.v1.SearchResourcesResponse.verify|verify} messages. + * @param message SearchResourcesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.ISearchResourcesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SearchResourcesResponse message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.SearchResourcesResponse.verify|verify} messages. + * @param message SearchResourcesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.ISearchResourcesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SearchResourcesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SearchResourcesResponse + * @throws {Error} If the payload is not 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.apihub.v1.SearchResourcesResponse; + + /** + * Decodes a SearchResourcesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SearchResourcesResponse + * @throws {Error} If the payload 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.apihub.v1.SearchResourcesResponse; + + /** + * Verifies a SearchResourcesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SearchResourcesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SearchResourcesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.SearchResourcesResponse; + + /** + * Creates a plain object from a SearchResourcesResponse message. Also converts values to other types if specified. + * @param message SearchResourcesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.SearchResourcesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SearchResourcesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SearchResourcesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateDependencyRequest. */ + interface ICreateDependencyRequest { + + /** CreateDependencyRequest parent */ + parent?: (string|null); + + /** CreateDependencyRequest dependencyId */ + dependencyId?: (string|null); + + /** CreateDependencyRequest dependency */ + dependency?: (google.cloud.apihub.v1.IDependency|null); + } + + /** Represents a CreateDependencyRequest. */ + class CreateDependencyRequest implements ICreateDependencyRequest { + + /** + * Constructs a new CreateDependencyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.ICreateDependencyRequest); + + /** CreateDependencyRequest parent. */ + public parent: string; + + /** CreateDependencyRequest dependencyId. */ + public dependencyId: string; + + /** CreateDependencyRequest dependency. */ + public dependency?: (google.cloud.apihub.v1.IDependency|null); + + /** + * Creates a new CreateDependencyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateDependencyRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.ICreateDependencyRequest): google.cloud.apihub.v1.CreateDependencyRequest; + + /** + * Encodes the specified CreateDependencyRequest message. Does not implicitly {@link google.cloud.apihub.v1.CreateDependencyRequest.verify|verify} messages. + * @param message CreateDependencyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.ICreateDependencyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateDependencyRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.CreateDependencyRequest.verify|verify} messages. + * @param message CreateDependencyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.ICreateDependencyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateDependencyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateDependencyRequest + * @throws {Error} If the payload is not 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.apihub.v1.CreateDependencyRequest; + + /** + * Decodes a CreateDependencyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateDependencyRequest + * @throws {Error} If the payload 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.apihub.v1.CreateDependencyRequest; + + /** + * Verifies a CreateDependencyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateDependencyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateDependencyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.CreateDependencyRequest; + + /** + * Creates a plain object from a CreateDependencyRequest message. Also converts values to other types if specified. + * @param message CreateDependencyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.CreateDependencyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateDependencyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateDependencyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetDependencyRequest. */ + interface IGetDependencyRequest { + + /** GetDependencyRequest name */ + name?: (string|null); + } + + /** Represents a GetDependencyRequest. */ + class GetDependencyRequest implements IGetDependencyRequest { + + /** + * Constructs a new GetDependencyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IGetDependencyRequest); + + /** GetDependencyRequest name. */ + public name: string; + + /** + * Creates a new GetDependencyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetDependencyRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.IGetDependencyRequest): google.cloud.apihub.v1.GetDependencyRequest; + + /** + * Encodes the specified GetDependencyRequest message. Does not implicitly {@link google.cloud.apihub.v1.GetDependencyRequest.verify|verify} messages. + * @param message GetDependencyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IGetDependencyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetDependencyRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.GetDependencyRequest.verify|verify} messages. + * @param message GetDependencyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IGetDependencyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetDependencyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetDependencyRequest + * @throws {Error} If the payload is not 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.apihub.v1.GetDependencyRequest; + + /** + * Decodes a GetDependencyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetDependencyRequest + * @throws {Error} If the payload 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.apihub.v1.GetDependencyRequest; + + /** + * Verifies a GetDependencyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetDependencyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetDependencyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.GetDependencyRequest; + + /** + * Creates a plain object from a GetDependencyRequest message. Also converts values to other types if specified. + * @param message GetDependencyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.GetDependencyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetDependencyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetDependencyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateDependencyRequest. */ + interface IUpdateDependencyRequest { + + /** UpdateDependencyRequest dependency */ + dependency?: (google.cloud.apihub.v1.IDependency|null); + + /** UpdateDependencyRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateDependencyRequest. */ + class UpdateDependencyRequest implements IUpdateDependencyRequest { + + /** + * Constructs a new UpdateDependencyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IUpdateDependencyRequest); + + /** UpdateDependencyRequest dependency. */ + public dependency?: (google.cloud.apihub.v1.IDependency|null); + + /** UpdateDependencyRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateDependencyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateDependencyRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.IUpdateDependencyRequest): google.cloud.apihub.v1.UpdateDependencyRequest; + + /** + * Encodes the specified UpdateDependencyRequest message. Does not implicitly {@link google.cloud.apihub.v1.UpdateDependencyRequest.verify|verify} messages. + * @param message UpdateDependencyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IUpdateDependencyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateDependencyRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.UpdateDependencyRequest.verify|verify} messages. + * @param message UpdateDependencyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IUpdateDependencyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateDependencyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateDependencyRequest + * @throws {Error} If the payload is not 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.apihub.v1.UpdateDependencyRequest; + + /** + * Decodes an UpdateDependencyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateDependencyRequest + * @throws {Error} If the payload 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.apihub.v1.UpdateDependencyRequest; + + /** + * Verifies an UpdateDependencyRequest message. + * @param message Plain 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 UpdateDependencyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateDependencyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.UpdateDependencyRequest; + + /** + * Creates a plain object from an UpdateDependencyRequest message. Also converts values to other types if specified. + * @param message UpdateDependencyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.UpdateDependencyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateDependencyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateDependencyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteDependencyRequest. */ + interface IDeleteDependencyRequest { + + /** DeleteDependencyRequest name */ + name?: (string|null); + } + + /** Represents a DeleteDependencyRequest. */ + class DeleteDependencyRequest implements IDeleteDependencyRequest { + + /** + * Constructs a new DeleteDependencyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IDeleteDependencyRequest); + + /** DeleteDependencyRequest name. */ + public name: string; + + /** + * Creates a new DeleteDependencyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteDependencyRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.IDeleteDependencyRequest): google.cloud.apihub.v1.DeleteDependencyRequest; + + /** + * Encodes the specified DeleteDependencyRequest message. Does not implicitly {@link google.cloud.apihub.v1.DeleteDependencyRequest.verify|verify} messages. + * @param message DeleteDependencyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IDeleteDependencyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteDependencyRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.DeleteDependencyRequest.verify|verify} messages. + * @param message DeleteDependencyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IDeleteDependencyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteDependencyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteDependencyRequest + * @throws {Error} If the payload is not 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.apihub.v1.DeleteDependencyRequest; + + /** + * Decodes a DeleteDependencyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteDependencyRequest + * @throws {Error} If the payload 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.apihub.v1.DeleteDependencyRequest; + + /** + * Verifies a DeleteDependencyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteDependencyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteDependencyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.DeleteDependencyRequest; + + /** + * Creates a plain object from a DeleteDependencyRequest message. Also converts values to other types if specified. + * @param message DeleteDependencyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.DeleteDependencyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteDependencyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteDependencyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListDependenciesRequest. */ + interface IListDependenciesRequest { + + /** ListDependenciesRequest parent */ + parent?: (string|null); + + /** ListDependenciesRequest filter */ + filter?: (string|null); + + /** ListDependenciesRequest pageSize */ + pageSize?: (number|null); + + /** ListDependenciesRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListDependenciesRequest. */ + class ListDependenciesRequest implements IListDependenciesRequest { + + /** + * Constructs a new ListDependenciesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IListDependenciesRequest); + + /** ListDependenciesRequest parent. */ + public parent: string; + + /** ListDependenciesRequest filter. */ + public filter: string; + + /** ListDependenciesRequest pageSize. */ + public pageSize: number; + + /** ListDependenciesRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListDependenciesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDependenciesRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.IListDependenciesRequest): google.cloud.apihub.v1.ListDependenciesRequest; + + /** + * Encodes the specified ListDependenciesRequest message. Does not implicitly {@link google.cloud.apihub.v1.ListDependenciesRequest.verify|verify} messages. + * @param message ListDependenciesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IListDependenciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDependenciesRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListDependenciesRequest.verify|verify} messages. + * @param message ListDependenciesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IListDependenciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDependenciesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDependenciesRequest + * @throws {Error} If the payload is not 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.apihub.v1.ListDependenciesRequest; + + /** + * Decodes a ListDependenciesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDependenciesRequest + * @throws {Error} If the payload 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.apihub.v1.ListDependenciesRequest; + + /** + * Verifies a ListDependenciesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListDependenciesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDependenciesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.ListDependenciesRequest; + + /** + * Creates a plain object from a ListDependenciesRequest message. Also converts values to other types if specified. + * @param message ListDependenciesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.ListDependenciesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDependenciesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListDependenciesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListDependenciesResponse. */ + interface IListDependenciesResponse { + + /** ListDependenciesResponse dependencies */ + dependencies?: (google.cloud.apihub.v1.IDependency[]|null); + + /** ListDependenciesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListDependenciesResponse. */ + class ListDependenciesResponse implements IListDependenciesResponse { + + /** + * Constructs a new ListDependenciesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IListDependenciesResponse); + + /** ListDependenciesResponse dependencies. */ + public dependencies: google.cloud.apihub.v1.IDependency[]; + + /** ListDependenciesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListDependenciesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDependenciesResponse instance + */ + public static create(properties?: google.cloud.apihub.v1.IListDependenciesResponse): google.cloud.apihub.v1.ListDependenciesResponse; + + /** + * Encodes the specified ListDependenciesResponse message. Does not implicitly {@link google.cloud.apihub.v1.ListDependenciesResponse.verify|verify} messages. + * @param message ListDependenciesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IListDependenciesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDependenciesResponse message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListDependenciesResponse.verify|verify} messages. + * @param message ListDependenciesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IListDependenciesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDependenciesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDependenciesResponse + * @throws {Error} If the payload is not 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.apihub.v1.ListDependenciesResponse; + + /** + * Decodes a ListDependenciesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDependenciesResponse + * @throws {Error} If the payload 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.apihub.v1.ListDependenciesResponse; + + /** + * Verifies a ListDependenciesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListDependenciesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDependenciesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.ListDependenciesResponse; + + /** + * Creates a plain object from a ListDependenciesResponse message. Also converts values to other types if specified. + * @param message ListDependenciesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.ListDependenciesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDependenciesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListDependenciesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateExternalApiRequest. */ + interface ICreateExternalApiRequest { + + /** CreateExternalApiRequest parent */ + parent?: (string|null); + + /** CreateExternalApiRequest externalApiId */ + externalApiId?: (string|null); + + /** CreateExternalApiRequest externalApi */ + externalApi?: (google.cloud.apihub.v1.IExternalApi|null); + } + + /** Represents a CreateExternalApiRequest. */ + class CreateExternalApiRequest implements ICreateExternalApiRequest { + + /** + * Constructs a new CreateExternalApiRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.ICreateExternalApiRequest); + + /** CreateExternalApiRequest parent. */ + public parent: string; + + /** CreateExternalApiRequest externalApiId. */ + public externalApiId: string; + + /** CreateExternalApiRequest externalApi. */ + public externalApi?: (google.cloud.apihub.v1.IExternalApi|null); + + /** + * Creates a new CreateExternalApiRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateExternalApiRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.ICreateExternalApiRequest): google.cloud.apihub.v1.CreateExternalApiRequest; + + /** + * Encodes the specified CreateExternalApiRequest message. Does not implicitly {@link google.cloud.apihub.v1.CreateExternalApiRequest.verify|verify} messages. + * @param message CreateExternalApiRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.ICreateExternalApiRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateExternalApiRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.CreateExternalApiRequest.verify|verify} messages. + * @param message CreateExternalApiRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.ICreateExternalApiRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateExternalApiRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateExternalApiRequest + * @throws {Error} If the payload is not 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.apihub.v1.CreateExternalApiRequest; + + /** + * Decodes a CreateExternalApiRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateExternalApiRequest + * @throws {Error} If the payload 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.apihub.v1.CreateExternalApiRequest; + + /** + * Verifies a CreateExternalApiRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateExternalApiRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateExternalApiRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.CreateExternalApiRequest; + + /** + * Creates a plain object from a CreateExternalApiRequest message. Also converts values to other types if specified. + * @param message CreateExternalApiRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.CreateExternalApiRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateExternalApiRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateExternalApiRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetExternalApiRequest. */ + interface IGetExternalApiRequest { + + /** GetExternalApiRequest name */ + name?: (string|null); + } + + /** Represents a GetExternalApiRequest. */ + class GetExternalApiRequest implements IGetExternalApiRequest { + + /** + * Constructs a new GetExternalApiRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IGetExternalApiRequest); + + /** GetExternalApiRequest name. */ + public name: string; + + /** + * Creates a new GetExternalApiRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetExternalApiRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.IGetExternalApiRequest): google.cloud.apihub.v1.GetExternalApiRequest; + + /** + * Encodes the specified GetExternalApiRequest message. Does not implicitly {@link google.cloud.apihub.v1.GetExternalApiRequest.verify|verify} messages. + * @param message GetExternalApiRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IGetExternalApiRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetExternalApiRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.GetExternalApiRequest.verify|verify} messages. + * @param message GetExternalApiRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IGetExternalApiRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetExternalApiRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetExternalApiRequest + * @throws {Error} If the payload is not 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.apihub.v1.GetExternalApiRequest; + + /** + * Decodes a GetExternalApiRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetExternalApiRequest + * @throws {Error} If the payload 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.apihub.v1.GetExternalApiRequest; + + /** + * Verifies a GetExternalApiRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetExternalApiRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetExternalApiRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.GetExternalApiRequest; + + /** + * Creates a plain object from a GetExternalApiRequest message. Also converts values to other types if specified. + * @param message GetExternalApiRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.GetExternalApiRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetExternalApiRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetExternalApiRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateExternalApiRequest. */ + interface IUpdateExternalApiRequest { + + /** UpdateExternalApiRequest externalApi */ + externalApi?: (google.cloud.apihub.v1.IExternalApi|null); + + /** UpdateExternalApiRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateExternalApiRequest. */ + class UpdateExternalApiRequest implements IUpdateExternalApiRequest { + + /** + * Constructs a new UpdateExternalApiRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IUpdateExternalApiRequest); + + /** UpdateExternalApiRequest externalApi. */ + public externalApi?: (google.cloud.apihub.v1.IExternalApi|null); + + /** UpdateExternalApiRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateExternalApiRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateExternalApiRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.IUpdateExternalApiRequest): google.cloud.apihub.v1.UpdateExternalApiRequest; + + /** + * Encodes the specified UpdateExternalApiRequest message. Does not implicitly {@link google.cloud.apihub.v1.UpdateExternalApiRequest.verify|verify} messages. + * @param message UpdateExternalApiRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IUpdateExternalApiRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateExternalApiRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.UpdateExternalApiRequest.verify|verify} messages. + * @param message UpdateExternalApiRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IUpdateExternalApiRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateExternalApiRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateExternalApiRequest + * @throws {Error} If the payload is not 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.apihub.v1.UpdateExternalApiRequest; + + /** + * Decodes an UpdateExternalApiRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateExternalApiRequest + * @throws {Error} If the payload 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.apihub.v1.UpdateExternalApiRequest; + + /** + * Verifies an UpdateExternalApiRequest message. + * @param message Plain 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 UpdateExternalApiRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateExternalApiRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.UpdateExternalApiRequest; + + /** + * Creates a plain object from an UpdateExternalApiRequest message. Also converts values to other types if specified. + * @param message UpdateExternalApiRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.UpdateExternalApiRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateExternalApiRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateExternalApiRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteExternalApiRequest. */ + interface IDeleteExternalApiRequest { + + /** DeleteExternalApiRequest name */ + name?: (string|null); + } + + /** Represents a DeleteExternalApiRequest. */ + class DeleteExternalApiRequest implements IDeleteExternalApiRequest { + + /** + * Constructs a new DeleteExternalApiRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IDeleteExternalApiRequest); + + /** DeleteExternalApiRequest name. */ + public name: string; + + /** + * Creates a new DeleteExternalApiRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteExternalApiRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.IDeleteExternalApiRequest): google.cloud.apihub.v1.DeleteExternalApiRequest; + + /** + * Encodes the specified DeleteExternalApiRequest message. Does not implicitly {@link google.cloud.apihub.v1.DeleteExternalApiRequest.verify|verify} messages. + * @param message DeleteExternalApiRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IDeleteExternalApiRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteExternalApiRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.DeleteExternalApiRequest.verify|verify} messages. + * @param message DeleteExternalApiRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IDeleteExternalApiRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteExternalApiRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteExternalApiRequest + * @throws {Error} If the payload is not 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.apihub.v1.DeleteExternalApiRequest; + + /** + * Decodes a DeleteExternalApiRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteExternalApiRequest + * @throws {Error} If the payload 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.apihub.v1.DeleteExternalApiRequest; + + /** + * Verifies a DeleteExternalApiRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteExternalApiRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteExternalApiRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.DeleteExternalApiRequest; + + /** + * Creates a plain object from a DeleteExternalApiRequest message. Also converts values to other types if specified. + * @param message DeleteExternalApiRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.DeleteExternalApiRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteExternalApiRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteExternalApiRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListExternalApisRequest. */ + interface IListExternalApisRequest { + + /** ListExternalApisRequest parent */ + parent?: (string|null); + + /** ListExternalApisRequest pageSize */ + pageSize?: (number|null); + + /** ListExternalApisRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListExternalApisRequest. */ + class ListExternalApisRequest implements IListExternalApisRequest { + + /** + * Constructs a new ListExternalApisRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IListExternalApisRequest); + + /** ListExternalApisRequest parent. */ + public parent: string; + + /** ListExternalApisRequest pageSize. */ + public pageSize: number; + + /** ListExternalApisRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListExternalApisRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListExternalApisRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.IListExternalApisRequest): google.cloud.apihub.v1.ListExternalApisRequest; + + /** + * Encodes the specified ListExternalApisRequest message. Does not implicitly {@link google.cloud.apihub.v1.ListExternalApisRequest.verify|verify} messages. + * @param message ListExternalApisRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IListExternalApisRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListExternalApisRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListExternalApisRequest.verify|verify} messages. + * @param message ListExternalApisRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IListExternalApisRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListExternalApisRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListExternalApisRequest + * @throws {Error} If the payload is not 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.apihub.v1.ListExternalApisRequest; + + /** + * Decodes a ListExternalApisRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListExternalApisRequest + * @throws {Error} If the payload 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.apihub.v1.ListExternalApisRequest; + + /** + * Verifies a ListExternalApisRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListExternalApisRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListExternalApisRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.ListExternalApisRequest; + + /** + * Creates a plain object from a ListExternalApisRequest message. Also converts values to other types if specified. + * @param message ListExternalApisRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.ListExternalApisRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListExternalApisRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListExternalApisRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListExternalApisResponse. */ + interface IListExternalApisResponse { + + /** ListExternalApisResponse externalApis */ + externalApis?: (google.cloud.apihub.v1.IExternalApi[]|null); + + /** ListExternalApisResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListExternalApisResponse. */ + class ListExternalApisResponse implements IListExternalApisResponse { + + /** + * Constructs a new ListExternalApisResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IListExternalApisResponse); + + /** ListExternalApisResponse externalApis. */ + public externalApis: google.cloud.apihub.v1.IExternalApi[]; + + /** ListExternalApisResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListExternalApisResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListExternalApisResponse instance + */ + public static create(properties?: google.cloud.apihub.v1.IListExternalApisResponse): google.cloud.apihub.v1.ListExternalApisResponse; + + /** + * Encodes the specified ListExternalApisResponse message. Does not implicitly {@link google.cloud.apihub.v1.ListExternalApisResponse.verify|verify} messages. + * @param message ListExternalApisResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IListExternalApisResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListExternalApisResponse message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListExternalApisResponse.verify|verify} messages. + * @param message ListExternalApisResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IListExternalApisResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListExternalApisResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListExternalApisResponse + * @throws {Error} If the payload is not 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.apihub.v1.ListExternalApisResponse; + + /** + * Decodes a ListExternalApisResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListExternalApisResponse + * @throws {Error} If the payload 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.apihub.v1.ListExternalApisResponse; + + /** + * Verifies a ListExternalApisResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListExternalApisResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListExternalApisResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.ListExternalApisResponse; + + /** + * Creates a plain object from a ListExternalApisResponse message. Also converts values to other types if specified. + * @param message ListExternalApisResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.ListExternalApisResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListExternalApisResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListExternalApisResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** LintState enum. */ + enum LintState { + LINT_STATE_UNSPECIFIED = 0, + LINT_STATE_SUCCESS = 1, + LINT_STATE_ERROR = 2 + } + + /** Linter enum. */ + enum Linter { + LINTER_UNSPECIFIED = 0, + SPECTRAL = 1, + OTHER = 2 + } + + /** Severity enum. */ + enum Severity { + SEVERITY_UNSPECIFIED = 0, + SEVERITY_ERROR = 1, + SEVERITY_WARNING = 2, + SEVERITY_INFO = 3, + SEVERITY_HINT = 4 + } + + /** Properties of an Api. */ + interface IApi { + + /** Api name */ + name?: (string|null); + + /** Api displayName */ + displayName?: (string|null); + + /** Api description */ + description?: (string|null); + + /** Api documentation */ + documentation?: (google.cloud.apihub.v1.IDocumentation|null); + + /** Api owner */ + owner?: (google.cloud.apihub.v1.IOwner|null); + + /** Api versions */ + versions?: (string[]|null); + + /** Api createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Api updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Api targetUser */ + targetUser?: (google.cloud.apihub.v1.IAttributeValues|null); + + /** Api team */ + team?: (google.cloud.apihub.v1.IAttributeValues|null); + + /** Api businessUnit */ + businessUnit?: (google.cloud.apihub.v1.IAttributeValues|null); + + /** Api maturityLevel */ + maturityLevel?: (google.cloud.apihub.v1.IAttributeValues|null); + + /** Api attributes */ + attributes?: ({ [k: string]: google.cloud.apihub.v1.IAttributeValues }|null); + + /** Api apiStyle */ + apiStyle?: (google.cloud.apihub.v1.IAttributeValues|null); + + /** Api selectedVersion */ + selectedVersion?: (string|null); + } + + /** Represents an Api. */ + class Api implements IApi { + + /** + * Constructs a new Api. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IApi); + + /** Api name. */ + public name: string; + + /** Api displayName. */ + public displayName: string; + + /** Api description. */ + public description: string; + + /** Api documentation. */ + public documentation?: (google.cloud.apihub.v1.IDocumentation|null); + + /** Api owner. */ + public owner?: (google.cloud.apihub.v1.IOwner|null); + + /** Api versions. */ + public versions: string[]; + + /** Api createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Api updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Api targetUser. */ + public targetUser?: (google.cloud.apihub.v1.IAttributeValues|null); + + /** Api team. */ + public team?: (google.cloud.apihub.v1.IAttributeValues|null); + + /** Api businessUnit. */ + public businessUnit?: (google.cloud.apihub.v1.IAttributeValues|null); + + /** Api maturityLevel. */ + public maturityLevel?: (google.cloud.apihub.v1.IAttributeValues|null); + + /** Api attributes. */ + public attributes: { [k: string]: google.cloud.apihub.v1.IAttributeValues }; + + /** Api apiStyle. */ + public apiStyle?: (google.cloud.apihub.v1.IAttributeValues|null); + + /** Api selectedVersion. */ + public selectedVersion: string; + + /** + * Creates a new Api instance using the specified properties. + * @param [properties] Properties to set + * @returns Api instance + */ + public static create(properties?: google.cloud.apihub.v1.IApi): google.cloud.apihub.v1.Api; + + /** + * Encodes the specified Api message. Does not implicitly {@link google.cloud.apihub.v1.Api.verify|verify} messages. + * @param message Api message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IApi, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Api message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.Api.verify|verify} messages. + * @param message Api message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IApi, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Api message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Api + * @throws {Error} If the payload is not 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.apihub.v1.Api; + + /** + * Decodes an Api message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Api + * @throws {Error} If the payload 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.apihub.v1.Api; + + /** + * Verifies an Api message. + * @param message Plain 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 Api message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Api + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.Api; + + /** + * Creates a plain object from an Api message. Also converts values to other types if specified. + * @param message Api + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.Api, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Api to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Api + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Version. */ + interface IVersion { + + /** Version name */ + name?: (string|null); + + /** Version displayName */ + displayName?: (string|null); + + /** Version description */ + description?: (string|null); + + /** Version documentation */ + documentation?: (google.cloud.apihub.v1.IDocumentation|null); + + /** Version specs */ + specs?: (string[]|null); + + /** Version apiOperations */ + apiOperations?: (string[]|null); + + /** Version definitions */ + definitions?: (string[]|null); + + /** Version deployments */ + deployments?: (string[]|null); + + /** Version createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Version updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Version lifecycle */ + lifecycle?: (google.cloud.apihub.v1.IAttributeValues|null); + + /** Version compliance */ + compliance?: (google.cloud.apihub.v1.IAttributeValues|null); + + /** Version accreditation */ + accreditation?: (google.cloud.apihub.v1.IAttributeValues|null); + + /** Version attributes */ + attributes?: ({ [k: string]: google.cloud.apihub.v1.IAttributeValues }|null); + + /** Version selectedDeployment */ + selectedDeployment?: (string|null); + } + + /** Represents a Version. */ + class Version implements IVersion { + + /** + * Constructs a new Version. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IVersion); + + /** Version name. */ + public name: string; + + /** Version displayName. */ + public displayName: string; + + /** Version description. */ + public description: string; + + /** Version documentation. */ + public documentation?: (google.cloud.apihub.v1.IDocumentation|null); + + /** Version specs. */ + public specs: string[]; + + /** Version apiOperations. */ + public apiOperations: string[]; + + /** Version definitions. */ + public definitions: string[]; + + /** Version deployments. */ + public deployments: string[]; + + /** Version createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Version updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Version lifecycle. */ + public lifecycle?: (google.cloud.apihub.v1.IAttributeValues|null); + + /** Version compliance. */ + public compliance?: (google.cloud.apihub.v1.IAttributeValues|null); + + /** Version accreditation. */ + public accreditation?: (google.cloud.apihub.v1.IAttributeValues|null); + + /** Version attributes. */ + public attributes: { [k: string]: google.cloud.apihub.v1.IAttributeValues }; + + /** Version selectedDeployment. */ + public selectedDeployment: string; + + /** + * Creates a new Version instance using the specified properties. + * @param [properties] Properties to set + * @returns Version instance + */ + public static create(properties?: google.cloud.apihub.v1.IVersion): google.cloud.apihub.v1.Version; + + /** + * Encodes the specified Version message. Does not implicitly {@link google.cloud.apihub.v1.Version.verify|verify} messages. + * @param message Version message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IVersion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Version message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.Version.verify|verify} messages. + * @param message Version message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IVersion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Version message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Version + * @throws {Error} If the payload is not 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.apihub.v1.Version; + + /** + * Decodes a Version message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Version + * @throws {Error} If the payload 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.apihub.v1.Version; + + /** + * Verifies a Version message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Version message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Version + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.Version; + + /** + * Creates a plain object from a Version message. Also converts values to other types if specified. + * @param message Version + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.Version, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Version to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Version + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Spec. */ + interface ISpec { + + /** Spec name */ + name?: (string|null); + + /** Spec displayName */ + displayName?: (string|null); + + /** Spec specType */ + specType?: (google.cloud.apihub.v1.IAttributeValues|null); + + /** Spec contents */ + contents?: (google.cloud.apihub.v1.ISpecContents|null); + + /** Spec details */ + details?: (google.cloud.apihub.v1.ISpecDetails|null); + + /** Spec sourceUri */ + sourceUri?: (string|null); + + /** Spec createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Spec updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Spec lintResponse */ + lintResponse?: (google.cloud.apihub.v1.ILintResponse|null); + + /** Spec attributes */ + attributes?: ({ [k: string]: google.cloud.apihub.v1.IAttributeValues }|null); + + /** Spec documentation */ + documentation?: (google.cloud.apihub.v1.IDocumentation|null); + + /** Spec parsingMode */ + parsingMode?: (google.cloud.apihub.v1.Spec.ParsingMode|keyof typeof google.cloud.apihub.v1.Spec.ParsingMode|null); + } + + /** Represents a Spec. */ + class Spec implements ISpec { + + /** + * Constructs a new Spec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.ISpec); + + /** Spec name. */ + public name: string; + + /** Spec displayName. */ + public displayName: string; + + /** Spec specType. */ + public specType?: (google.cloud.apihub.v1.IAttributeValues|null); + + /** Spec contents. */ + public contents?: (google.cloud.apihub.v1.ISpecContents|null); + + /** Spec details. */ + public details?: (google.cloud.apihub.v1.ISpecDetails|null); + + /** Spec sourceUri. */ + public sourceUri: string; + + /** Spec createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Spec updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Spec lintResponse. */ + public lintResponse?: (google.cloud.apihub.v1.ILintResponse|null); + + /** Spec attributes. */ + public attributes: { [k: string]: google.cloud.apihub.v1.IAttributeValues }; + + /** Spec documentation. */ + public documentation?: (google.cloud.apihub.v1.IDocumentation|null); + + /** Spec parsingMode. */ + public parsingMode: (google.cloud.apihub.v1.Spec.ParsingMode|keyof typeof google.cloud.apihub.v1.Spec.ParsingMode); + + /** + * Creates a new Spec instance using the specified properties. + * @param [properties] Properties to set + * @returns Spec instance + */ + public static create(properties?: google.cloud.apihub.v1.ISpec): google.cloud.apihub.v1.Spec; + + /** + * Encodes the specified Spec message. Does not implicitly {@link google.cloud.apihub.v1.Spec.verify|verify} messages. + * @param message Spec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.ISpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Spec message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.Spec.verify|verify} messages. + * @param message Spec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.ISpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Spec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Spec + * @throws {Error} If the payload is not 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.apihub.v1.Spec; + + /** + * Decodes a Spec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Spec + * @throws {Error} If the payload 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.apihub.v1.Spec; + + /** + * Verifies a Spec message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Spec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Spec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.Spec; + + /** + * Creates a plain object from a Spec message. Also converts values to other types if specified. + * @param message Spec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.Spec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Spec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Spec + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Spec { + + /** ParsingMode enum. */ + enum ParsingMode { + PARSING_MODE_UNSPECIFIED = 0, + RELAXED = 1, + STRICT = 2 + } + } + + /** Properties of a Deployment. */ + interface IDeployment { + + /** Deployment name */ + name?: (string|null); + + /** Deployment displayName */ + displayName?: (string|null); + + /** Deployment description */ + description?: (string|null); + + /** Deployment documentation */ + documentation?: (google.cloud.apihub.v1.IDocumentation|null); + + /** Deployment deploymentType */ + deploymentType?: (google.cloud.apihub.v1.IAttributeValues|null); + + /** Deployment resourceUri */ + resourceUri?: (string|null); + + /** Deployment endpoints */ + endpoints?: (string[]|null); + + /** Deployment apiVersions */ + apiVersions?: (string[]|null); + + /** Deployment createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Deployment updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Deployment slo */ + slo?: (google.cloud.apihub.v1.IAttributeValues|null); + + /** Deployment environment */ + environment?: (google.cloud.apihub.v1.IAttributeValues|null); + + /** Deployment attributes */ + attributes?: ({ [k: string]: google.cloud.apihub.v1.IAttributeValues }|null); + } + + /** Represents a Deployment. */ + class Deployment implements IDeployment { + + /** + * Constructs a new Deployment. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IDeployment); + + /** Deployment name. */ + public name: string; + + /** Deployment displayName. */ + public displayName: string; + + /** Deployment description. */ + public description: string; + + /** Deployment documentation. */ + public documentation?: (google.cloud.apihub.v1.IDocumentation|null); + + /** Deployment deploymentType. */ + public deploymentType?: (google.cloud.apihub.v1.IAttributeValues|null); + + /** Deployment resourceUri. */ + public resourceUri: string; + + /** Deployment endpoints. */ + public endpoints: string[]; + + /** Deployment apiVersions. */ + public apiVersions: string[]; + + /** Deployment createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Deployment updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Deployment slo. */ + public slo?: (google.cloud.apihub.v1.IAttributeValues|null); + + /** Deployment environment. */ + public environment?: (google.cloud.apihub.v1.IAttributeValues|null); + + /** Deployment attributes. */ + public attributes: { [k: string]: google.cloud.apihub.v1.IAttributeValues }; + + /** + * Creates a new Deployment instance using the specified properties. + * @param [properties] Properties to set + * @returns Deployment instance + */ + public static create(properties?: google.cloud.apihub.v1.IDeployment): google.cloud.apihub.v1.Deployment; + + /** + * Encodes the specified Deployment message. Does not implicitly {@link google.cloud.apihub.v1.Deployment.verify|verify} messages. + * @param message Deployment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IDeployment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Deployment message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.Deployment.verify|verify} messages. + * @param message Deployment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IDeployment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Deployment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Deployment + * @throws {Error} If the payload is not 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.apihub.v1.Deployment; + + /** + * Decodes a Deployment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Deployment + * @throws {Error} If the payload 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.apihub.v1.Deployment; + + /** + * Verifies a Deployment message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Deployment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Deployment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.Deployment; + + /** + * Creates a plain object from a Deployment message. Also converts values to other types if specified. + * @param message Deployment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.Deployment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Deployment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Deployment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ApiOperation. */ + interface IApiOperation { + + /** ApiOperation name */ + name?: (string|null); + + /** ApiOperation spec */ + spec?: (string|null); + + /** ApiOperation details */ + details?: (google.cloud.apihub.v1.IOperationDetails|null); + + /** ApiOperation createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** ApiOperation updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** ApiOperation attributes */ + attributes?: ({ [k: string]: google.cloud.apihub.v1.IAttributeValues }|null); + } + + /** Represents an ApiOperation. */ + class ApiOperation implements IApiOperation { + + /** + * Constructs a new ApiOperation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IApiOperation); + + /** ApiOperation name. */ + public name: string; + + /** ApiOperation spec. */ + public spec: string; + + /** ApiOperation details. */ + public details?: (google.cloud.apihub.v1.IOperationDetails|null); + + /** ApiOperation createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** ApiOperation updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** ApiOperation attributes. */ + public attributes: { [k: string]: google.cloud.apihub.v1.IAttributeValues }; + + /** + * Creates a new ApiOperation instance using the specified properties. + * @param [properties] Properties to set + * @returns ApiOperation instance + */ + public static create(properties?: google.cloud.apihub.v1.IApiOperation): google.cloud.apihub.v1.ApiOperation; + + /** + * Encodes the specified ApiOperation message. Does not implicitly {@link google.cloud.apihub.v1.ApiOperation.verify|verify} messages. + * @param message ApiOperation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IApiOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ApiOperation message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ApiOperation.verify|verify} messages. + * @param message ApiOperation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IApiOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ApiOperation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ApiOperation + * @throws {Error} If the payload is not 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.apihub.v1.ApiOperation; + + /** + * Decodes an ApiOperation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ApiOperation + * @throws {Error} If the payload 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.apihub.v1.ApiOperation; + + /** + * Verifies an ApiOperation message. + * @param message Plain 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 ApiOperation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ApiOperation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.ApiOperation; + + /** + * Creates a plain object from an ApiOperation message. Also converts values to other types if specified. + * @param message ApiOperation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.ApiOperation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ApiOperation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ApiOperation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Definition. */ + interface IDefinition { + + /** Definition schema */ + schema?: (google.cloud.apihub.v1.ISchema|null); + + /** Definition name */ + name?: (string|null); + + /** Definition spec */ + spec?: (string|null); + + /** Definition type */ + type?: (google.cloud.apihub.v1.Definition.Type|keyof typeof google.cloud.apihub.v1.Definition.Type|null); + + /** Definition createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Definition updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Definition attributes */ + attributes?: ({ [k: string]: google.cloud.apihub.v1.IAttributeValues }|null); + } + + /** Represents a Definition. */ + class Definition implements IDefinition { + + /** + * Constructs a new Definition. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IDefinition); + + /** Definition schema. */ + public schema?: (google.cloud.apihub.v1.ISchema|null); + + /** Definition name. */ + public name: string; + + /** Definition spec. */ + public spec: string; + + /** Definition type. */ + public type: (google.cloud.apihub.v1.Definition.Type|keyof typeof google.cloud.apihub.v1.Definition.Type); + + /** Definition createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Definition updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Definition attributes. */ + public attributes: { [k: string]: google.cloud.apihub.v1.IAttributeValues }; + + /** Definition value. */ + public value?: "schema"; + + /** + * Creates a new Definition instance using the specified properties. + * @param [properties] Properties to set + * @returns Definition instance + */ + public static create(properties?: google.cloud.apihub.v1.IDefinition): google.cloud.apihub.v1.Definition; + + /** + * Encodes the specified Definition message. Does not implicitly {@link google.cloud.apihub.v1.Definition.verify|verify} messages. + * @param message Definition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IDefinition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Definition message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.Definition.verify|verify} messages. + * @param message Definition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IDefinition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Definition message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Definition + * @throws {Error} If the payload is not 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.apihub.v1.Definition; + + /** + * Decodes a Definition message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Definition + * @throws {Error} If the payload 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.apihub.v1.Definition; + + /** + * Verifies a Definition message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Definition message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Definition + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.Definition; + + /** + * Creates a plain object from a Definition message. Also converts values to other types if specified. + * @param message Definition + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.Definition, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Definition to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Definition + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Definition { + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + SCHEMA = 1 + } + } + + /** Properties of an Attribute. */ + interface IAttribute { + + /** Attribute name */ + name?: (string|null); + + /** Attribute displayName */ + displayName?: (string|null); + + /** Attribute description */ + description?: (string|null); + + /** Attribute definitionType */ + definitionType?: (google.cloud.apihub.v1.Attribute.DefinitionType|keyof typeof google.cloud.apihub.v1.Attribute.DefinitionType|null); + + /** Attribute scope */ + scope?: (google.cloud.apihub.v1.Attribute.Scope|keyof typeof google.cloud.apihub.v1.Attribute.Scope|null); + + /** Attribute dataType */ + dataType?: (google.cloud.apihub.v1.Attribute.DataType|keyof typeof google.cloud.apihub.v1.Attribute.DataType|null); + + /** Attribute allowedValues */ + allowedValues?: (google.cloud.apihub.v1.Attribute.IAllowedValue[]|null); + + /** Attribute cardinality */ + cardinality?: (number|null); + + /** Attribute mandatory */ + mandatory?: (boolean|null); + + /** Attribute createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Attribute updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents an Attribute. */ + class Attribute implements IAttribute { + + /** + * Constructs a new Attribute. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IAttribute); + + /** Attribute name. */ + public name: string; + + /** Attribute displayName. */ + public displayName: string; + + /** Attribute description. */ + public description: string; + + /** Attribute definitionType. */ + public definitionType: (google.cloud.apihub.v1.Attribute.DefinitionType|keyof typeof google.cloud.apihub.v1.Attribute.DefinitionType); + + /** Attribute scope. */ + public scope: (google.cloud.apihub.v1.Attribute.Scope|keyof typeof google.cloud.apihub.v1.Attribute.Scope); + + /** Attribute dataType. */ + public dataType: (google.cloud.apihub.v1.Attribute.DataType|keyof typeof google.cloud.apihub.v1.Attribute.DataType); + + /** Attribute allowedValues. */ + public allowedValues: google.cloud.apihub.v1.Attribute.IAllowedValue[]; + + /** Attribute cardinality. */ + public cardinality: number; + + /** Attribute mandatory. */ + public mandatory: boolean; + + /** Attribute createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Attribute updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new Attribute instance using the specified properties. + * @param [properties] Properties to set + * @returns Attribute instance + */ + public static create(properties?: google.cloud.apihub.v1.IAttribute): google.cloud.apihub.v1.Attribute; + + /** + * Encodes the specified Attribute message. Does not implicitly {@link google.cloud.apihub.v1.Attribute.verify|verify} messages. + * @param message Attribute message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IAttribute, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Attribute message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.Attribute.verify|verify} messages. + * @param message Attribute message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IAttribute, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Attribute message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Attribute + * @throws {Error} If the payload is not 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.apihub.v1.Attribute; + + /** + * Decodes an Attribute message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Attribute + * @throws {Error} If the payload 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.apihub.v1.Attribute; + + /** + * Verifies an Attribute message. + * @param message Plain 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 Attribute message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Attribute + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.Attribute; + + /** + * Creates a plain object from an Attribute message. Also converts values to other types if specified. + * @param message Attribute + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.Attribute, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Attribute to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Attribute + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Attribute { + + /** Properties of an AllowedValue. */ + interface IAllowedValue { + + /** AllowedValue id */ + id?: (string|null); + + /** AllowedValue displayName */ + displayName?: (string|null); + + /** AllowedValue description */ + description?: (string|null); + + /** AllowedValue immutable */ + immutable?: (boolean|null); + } + + /** Represents an AllowedValue. */ + class AllowedValue implements IAllowedValue { + + /** + * Constructs a new AllowedValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.Attribute.IAllowedValue); + + /** AllowedValue id. */ + public id: string; + + /** AllowedValue displayName. */ + public displayName: string; + + /** AllowedValue description. */ + public description: string; + + /** AllowedValue immutable. */ + public immutable: boolean; + + /** + * Creates a new AllowedValue instance using the specified properties. + * @param [properties] Properties to set + * @returns AllowedValue instance + */ + public static create(properties?: google.cloud.apihub.v1.Attribute.IAllowedValue): google.cloud.apihub.v1.Attribute.AllowedValue; + + /** + * Encodes the specified AllowedValue message. Does not implicitly {@link google.cloud.apihub.v1.Attribute.AllowedValue.verify|verify} messages. + * @param message AllowedValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.Attribute.IAllowedValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AllowedValue message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.Attribute.AllowedValue.verify|verify} messages. + * @param message AllowedValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.Attribute.IAllowedValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AllowedValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AllowedValue + * @throws {Error} If the payload is not 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.apihub.v1.Attribute.AllowedValue; + + /** + * Decodes an AllowedValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AllowedValue + * @throws {Error} If the payload 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.apihub.v1.Attribute.AllowedValue; + + /** + * Verifies an AllowedValue message. + * @param message Plain 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 AllowedValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AllowedValue + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.Attribute.AllowedValue; + + /** + * Creates a plain object from an AllowedValue message. Also converts values to other types if specified. + * @param message AllowedValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.Attribute.AllowedValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AllowedValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AllowedValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** DefinitionType enum. */ + enum DefinitionType { + DEFINITION_TYPE_UNSPECIFIED = 0, + SYSTEM_DEFINED = 1, + USER_DEFINED = 2 + } + + /** Scope enum. */ + enum Scope { + SCOPE_UNSPECIFIED = 0, + API = 1, + VERSION = 2, + SPEC = 3, + API_OPERATION = 4, + DEPLOYMENT = 5, + DEPENDENCY = 6, + DEFINITION = 7, + EXTERNAL_API = 8, + PLUGIN = 9 + } + + /** DataType enum. */ + enum DataType { + DATA_TYPE_UNSPECIFIED = 0, + ENUM = 1, + JSON = 2, + STRING = 3 + } + } + + /** Properties of a SpecContents. */ + interface ISpecContents { + + /** SpecContents contents */ + contents?: (Uint8Array|string|null); + + /** SpecContents mimeType */ + mimeType?: (string|null); + } + + /** Represents a SpecContents. */ + class SpecContents implements ISpecContents { + + /** + * Constructs a new SpecContents. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.ISpecContents); + + /** SpecContents contents. */ + public contents: (Uint8Array|string); + + /** SpecContents mimeType. */ + public mimeType: string; + + /** + * Creates a new SpecContents instance using the specified properties. + * @param [properties] Properties to set + * @returns SpecContents instance + */ + public static create(properties?: google.cloud.apihub.v1.ISpecContents): google.cloud.apihub.v1.SpecContents; + + /** + * Encodes the specified SpecContents message. Does not implicitly {@link google.cloud.apihub.v1.SpecContents.verify|verify} messages. + * @param message SpecContents message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.ISpecContents, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SpecContents message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.SpecContents.verify|verify} messages. + * @param message SpecContents message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.ISpecContents, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SpecContents message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SpecContents + * @throws {Error} If the payload is not 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.apihub.v1.SpecContents; + + /** + * Decodes a SpecContents message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SpecContents + * @throws {Error} If the payload 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.apihub.v1.SpecContents; + + /** + * Verifies a SpecContents message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SpecContents message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SpecContents + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.SpecContents; + + /** + * Creates a plain object from a SpecContents message. Also converts values to other types if specified. + * @param message SpecContents + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.SpecContents, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SpecContents to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SpecContents + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SpecDetails. */ + interface ISpecDetails { + + /** SpecDetails openApiSpecDetails */ + openApiSpecDetails?: (google.cloud.apihub.v1.IOpenApiSpecDetails|null); + + /** SpecDetails description */ + description?: (string|null); + } + + /** Represents a SpecDetails. */ + class SpecDetails implements ISpecDetails { + + /** + * Constructs a new SpecDetails. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.ISpecDetails); + + /** SpecDetails openApiSpecDetails. */ + public openApiSpecDetails?: (google.cloud.apihub.v1.IOpenApiSpecDetails|null); + + /** SpecDetails description. */ + public description: string; + + /** SpecDetails details. */ + public details?: "openApiSpecDetails"; + + /** + * Creates a new SpecDetails instance using the specified properties. + * @param [properties] Properties to set + * @returns SpecDetails instance + */ + public static create(properties?: google.cloud.apihub.v1.ISpecDetails): google.cloud.apihub.v1.SpecDetails; + + /** + * Encodes the specified SpecDetails message. Does not implicitly {@link google.cloud.apihub.v1.SpecDetails.verify|verify} messages. + * @param message SpecDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.ISpecDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SpecDetails message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.SpecDetails.verify|verify} messages. + * @param message SpecDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.ISpecDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SpecDetails message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SpecDetails + * @throws {Error} If the payload is not 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.apihub.v1.SpecDetails; + + /** + * Decodes a SpecDetails message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SpecDetails + * @throws {Error} If the payload 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.apihub.v1.SpecDetails; + + /** + * Verifies a SpecDetails message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SpecDetails message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SpecDetails + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.SpecDetails; + + /** + * Creates a plain object from a SpecDetails message. Also converts values to other types if specified. + * @param message SpecDetails + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.SpecDetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SpecDetails to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SpecDetails + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OpenApiSpecDetails. */ + interface IOpenApiSpecDetails { + + /** OpenApiSpecDetails format */ + format?: (google.cloud.apihub.v1.OpenApiSpecDetails.Format|keyof typeof google.cloud.apihub.v1.OpenApiSpecDetails.Format|null); + + /** OpenApiSpecDetails version */ + version?: (string|null); + + /** OpenApiSpecDetails owner */ + owner?: (google.cloud.apihub.v1.IOwner|null); + } + + /** Represents an OpenApiSpecDetails. */ + class OpenApiSpecDetails implements IOpenApiSpecDetails { + + /** + * Constructs a new OpenApiSpecDetails. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IOpenApiSpecDetails); + + /** OpenApiSpecDetails format. */ + public format: (google.cloud.apihub.v1.OpenApiSpecDetails.Format|keyof typeof google.cloud.apihub.v1.OpenApiSpecDetails.Format); + + /** OpenApiSpecDetails version. */ + public version: string; + + /** OpenApiSpecDetails owner. */ + public owner?: (google.cloud.apihub.v1.IOwner|null); + + /** + * Creates a new OpenApiSpecDetails instance using the specified properties. + * @param [properties] Properties to set + * @returns OpenApiSpecDetails instance + */ + public static create(properties?: google.cloud.apihub.v1.IOpenApiSpecDetails): google.cloud.apihub.v1.OpenApiSpecDetails; + + /** + * Encodes the specified OpenApiSpecDetails message. Does not implicitly {@link google.cloud.apihub.v1.OpenApiSpecDetails.verify|verify} messages. + * @param message OpenApiSpecDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IOpenApiSpecDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OpenApiSpecDetails message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.OpenApiSpecDetails.verify|verify} messages. + * @param message OpenApiSpecDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IOpenApiSpecDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OpenApiSpecDetails message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OpenApiSpecDetails + * @throws {Error} If the payload is not 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.apihub.v1.OpenApiSpecDetails; + + /** + * Decodes an OpenApiSpecDetails message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OpenApiSpecDetails + * @throws {Error} If the payload 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.apihub.v1.OpenApiSpecDetails; + + /** + * Verifies an OpenApiSpecDetails message. + * @param message Plain 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 OpenApiSpecDetails message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OpenApiSpecDetails + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.OpenApiSpecDetails; + + /** + * Creates a plain object from an OpenApiSpecDetails message. Also converts values to other types if specified. + * @param message OpenApiSpecDetails + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.OpenApiSpecDetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OpenApiSpecDetails to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OpenApiSpecDetails + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace OpenApiSpecDetails { + + /** Format enum. */ + enum Format { + FORMAT_UNSPECIFIED = 0, + OPEN_API_SPEC_2_0 = 1, + OPEN_API_SPEC_3_0 = 2, + OPEN_API_SPEC_3_1 = 3 + } + } + + /** Properties of an OperationDetails. */ + interface IOperationDetails { + + /** OperationDetails httpOperation */ + httpOperation?: (google.cloud.apihub.v1.IHttpOperation|null); + + /** OperationDetails description */ + description?: (string|null); + + /** OperationDetails documentation */ + documentation?: (google.cloud.apihub.v1.IDocumentation|null); + + /** OperationDetails deprecated */ + deprecated?: (boolean|null); + } + + /** Represents an OperationDetails. */ + class OperationDetails implements IOperationDetails { + + /** + * Constructs a new OperationDetails. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IOperationDetails); + + /** OperationDetails httpOperation. */ + public httpOperation?: (google.cloud.apihub.v1.IHttpOperation|null); + + /** OperationDetails description. */ + public description: string; + + /** OperationDetails documentation. */ + public documentation?: (google.cloud.apihub.v1.IDocumentation|null); + + /** OperationDetails deprecated. */ + public deprecated: boolean; + + /** OperationDetails operation. */ + public operation?: "httpOperation"; + + /** + * Creates a new OperationDetails instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationDetails instance + */ + public static create(properties?: google.cloud.apihub.v1.IOperationDetails): google.cloud.apihub.v1.OperationDetails; + + /** + * Encodes the specified OperationDetails message. Does not implicitly {@link google.cloud.apihub.v1.OperationDetails.verify|verify} messages. + * @param message OperationDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IOperationDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationDetails message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.OperationDetails.verify|verify} messages. + * @param message OperationDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IOperationDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationDetails message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationDetails + * @throws {Error} If the payload is not 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.apihub.v1.OperationDetails; + + /** + * Decodes an OperationDetails message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationDetails + * @throws {Error} If the payload 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.apihub.v1.OperationDetails; + + /** + * Verifies an OperationDetails message. + * @param message Plain 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 OperationDetails message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationDetails + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.OperationDetails; + + /** + * Creates a plain object from an OperationDetails message. Also converts values to other types if specified. + * @param message OperationDetails + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.OperationDetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationDetails to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OperationDetails + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a HttpOperation. */ + interface IHttpOperation { + + /** HttpOperation path */ + path?: (google.cloud.apihub.v1.IPath|null); + + /** HttpOperation method */ + method?: (google.cloud.apihub.v1.HttpOperation.Method|keyof typeof google.cloud.apihub.v1.HttpOperation.Method|null); + } + + /** Represents a HttpOperation. */ + class HttpOperation implements IHttpOperation { + + /** + * Constructs a new HttpOperation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IHttpOperation); + + /** HttpOperation path. */ + public path?: (google.cloud.apihub.v1.IPath|null); + + /** HttpOperation method. */ + public method: (google.cloud.apihub.v1.HttpOperation.Method|keyof typeof google.cloud.apihub.v1.HttpOperation.Method); + + /** + * Creates a new HttpOperation instance using the specified properties. + * @param [properties] Properties to set + * @returns HttpOperation instance + */ + public static create(properties?: google.cloud.apihub.v1.IHttpOperation): google.cloud.apihub.v1.HttpOperation; + + /** + * Encodes the specified HttpOperation message. Does not implicitly {@link google.cloud.apihub.v1.HttpOperation.verify|verify} messages. + * @param message HttpOperation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IHttpOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HttpOperation message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.HttpOperation.verify|verify} messages. + * @param message HttpOperation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IHttpOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HttpOperation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HttpOperation + * @throws {Error} If the payload is not 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.apihub.v1.HttpOperation; + + /** + * Decodes a HttpOperation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HttpOperation + * @throws {Error} If the payload 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.apihub.v1.HttpOperation; + + /** + * Verifies a HttpOperation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HttpOperation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HttpOperation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.HttpOperation; + + /** + * Creates a plain object from a HttpOperation message. Also converts values to other types if specified. + * @param message HttpOperation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.HttpOperation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HttpOperation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HttpOperation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace HttpOperation { + + /** Method enum. */ + enum Method { + METHOD_UNSPECIFIED = 0, + GET = 1, + PUT = 2, + POST = 3, + DELETE = 4, + OPTIONS = 5, + HEAD = 6, + PATCH = 7, + TRACE = 8 + } + } + + /** Properties of a Path. */ + interface IPath { + + /** Path path */ + path?: (string|null); + + /** Path description */ + description?: (string|null); + } + + /** Represents a Path. */ + class Path implements IPath { + + /** + * Constructs a new Path. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IPath); + + /** Path path. */ + public path: string; + + /** Path description. */ + public description: string; + + /** + * Creates a new Path instance using the specified properties. + * @param [properties] Properties to set + * @returns Path instance + */ + public static create(properties?: google.cloud.apihub.v1.IPath): google.cloud.apihub.v1.Path; + + /** + * Encodes the specified Path message. Does not implicitly {@link google.cloud.apihub.v1.Path.verify|verify} messages. + * @param message Path message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IPath, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Path message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.Path.verify|verify} messages. + * @param message Path message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IPath, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Path message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Path + * @throws {Error} If the payload is not 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.apihub.v1.Path; + + /** + * Decodes a Path message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Path + * @throws {Error} If the payload 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.apihub.v1.Path; + + /** + * Verifies a Path message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Path message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Path + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.Path; + + /** + * Creates a plain object from a Path message. Also converts values to other types if specified. + * @param message Path + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.Path, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Path to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Path + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Schema. */ + interface ISchema { + + /** Schema displayName */ + displayName?: (string|null); + + /** Schema rawValue */ + rawValue?: (Uint8Array|string|null); + } + + /** Represents a Schema. */ + class Schema implements ISchema { + + /** + * Constructs a new Schema. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.ISchema); + + /** Schema displayName. */ + public displayName: string; + + /** Schema rawValue. */ + public rawValue: (Uint8Array|string); + + /** + * Creates a new Schema instance using the specified properties. + * @param [properties] Properties to set + * @returns Schema instance + */ + public static create(properties?: google.cloud.apihub.v1.ISchema): google.cloud.apihub.v1.Schema; + + /** + * Encodes the specified Schema message. Does not implicitly {@link google.cloud.apihub.v1.Schema.verify|verify} messages. + * @param message Schema message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.ISchema, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Schema message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.Schema.verify|verify} messages. + * @param message Schema message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.ISchema, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Schema message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Schema + * @throws {Error} If the payload is not 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.apihub.v1.Schema; + + /** + * Decodes a Schema message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Schema + * @throws {Error} If the payload 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.apihub.v1.Schema; + + /** + * Verifies a Schema message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Schema message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Schema + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.Schema; + + /** + * Creates a plain object from a Schema message. Also converts values to other types if specified. + * @param message Schema + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.Schema, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Schema to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Schema + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Owner. */ + interface IOwner { + + /** Owner displayName */ + displayName?: (string|null); + + /** Owner email */ + email?: (string|null); + } + + /** Represents an Owner. */ + class Owner implements IOwner { + + /** + * Constructs a new Owner. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IOwner); + + /** Owner displayName. */ + public displayName: string; + + /** Owner email. */ + public email: string; + + /** + * Creates a new Owner instance using the specified properties. + * @param [properties] Properties to set + * @returns Owner instance + */ + public static create(properties?: google.cloud.apihub.v1.IOwner): google.cloud.apihub.v1.Owner; + + /** + * Encodes the specified Owner message. Does not implicitly {@link google.cloud.apihub.v1.Owner.verify|verify} messages. + * @param message Owner message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IOwner, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Owner message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.Owner.verify|verify} messages. + * @param message Owner message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IOwner, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Owner message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Owner + * @throws {Error} If the payload is not 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.apihub.v1.Owner; + + /** + * Decodes an Owner message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Owner + * @throws {Error} If the payload 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.apihub.v1.Owner; + + /** + * Verifies an Owner message. + * @param message Plain 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 Owner message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Owner + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.Owner; + + /** + * Creates a plain object from an Owner message. Also converts values to other types if specified. + * @param message Owner + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.Owner, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Owner to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Owner + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Documentation. */ + interface IDocumentation { + + /** Documentation externalUri */ + externalUri?: (string|null); + } + + /** Represents a Documentation. */ + class Documentation implements IDocumentation { + + /** + * Constructs a new Documentation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IDocumentation); + + /** Documentation externalUri. */ + public externalUri: string; + + /** + * Creates a new Documentation instance using the specified properties. + * @param [properties] Properties to set + * @returns Documentation instance + */ + public static create(properties?: google.cloud.apihub.v1.IDocumentation): google.cloud.apihub.v1.Documentation; + + /** + * Encodes the specified Documentation message. Does not implicitly {@link google.cloud.apihub.v1.Documentation.verify|verify} messages. + * @param message Documentation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IDocumentation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Documentation message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.Documentation.verify|verify} messages. + * @param message Documentation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IDocumentation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Documentation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Documentation + * @throws {Error} If the payload is not 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.apihub.v1.Documentation; + + /** + * Decodes a Documentation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Documentation + * @throws {Error} If the payload 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.apihub.v1.Documentation; + + /** + * Verifies a Documentation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Documentation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Documentation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.Documentation; + + /** + * Creates a plain object from a Documentation message. Also converts values to other types if specified. + * @param message Documentation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.Documentation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Documentation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Documentation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AttributeValues. */ + interface IAttributeValues { + + /** AttributeValues enumValues */ + enumValues?: (google.cloud.apihub.v1.AttributeValues.IEnumAttributeValues|null); + + /** AttributeValues stringValues */ + stringValues?: (google.cloud.apihub.v1.AttributeValues.IStringAttributeValues|null); + + /** AttributeValues jsonValues */ + jsonValues?: (google.cloud.apihub.v1.AttributeValues.IStringAttributeValues|null); + + /** AttributeValues attribute */ + attribute?: (string|null); + } + + /** Represents an AttributeValues. */ + class AttributeValues implements IAttributeValues { + + /** + * Constructs a new AttributeValues. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IAttributeValues); + + /** AttributeValues enumValues. */ + public enumValues?: (google.cloud.apihub.v1.AttributeValues.IEnumAttributeValues|null); + + /** AttributeValues stringValues. */ + public stringValues?: (google.cloud.apihub.v1.AttributeValues.IStringAttributeValues|null); + + /** AttributeValues jsonValues. */ + public jsonValues?: (google.cloud.apihub.v1.AttributeValues.IStringAttributeValues|null); + + /** AttributeValues attribute. */ + public attribute: string; + + /** AttributeValues Value. */ + public Value?: ("enumValues"|"stringValues"|"jsonValues"); + + /** + * Creates a new AttributeValues instance using the specified properties. + * @param [properties] Properties to set + * @returns AttributeValues instance + */ + public static create(properties?: google.cloud.apihub.v1.IAttributeValues): google.cloud.apihub.v1.AttributeValues; + + /** + * Encodes the specified AttributeValues message. Does not implicitly {@link google.cloud.apihub.v1.AttributeValues.verify|verify} messages. + * @param message AttributeValues message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IAttributeValues, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AttributeValues message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.AttributeValues.verify|verify} messages. + * @param message AttributeValues message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IAttributeValues, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AttributeValues message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AttributeValues + * @throws {Error} If the payload is not 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.apihub.v1.AttributeValues; + + /** + * Decodes an AttributeValues message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AttributeValues + * @throws {Error} If the payload 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.apihub.v1.AttributeValues; + + /** + * Verifies an AttributeValues message. + * @param message Plain 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 AttributeValues message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AttributeValues + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.AttributeValues; + + /** + * Creates a plain object from an AttributeValues message. Also converts values to other types if specified. + * @param message AttributeValues + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.AttributeValues, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AttributeValues to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AttributeValues + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AttributeValues { + + /** Properties of an EnumAttributeValues. */ + interface IEnumAttributeValues { + + /** EnumAttributeValues values */ + values?: (google.cloud.apihub.v1.Attribute.IAllowedValue[]|null); + } + + /** Represents an EnumAttributeValues. */ + class EnumAttributeValues implements IEnumAttributeValues { + + /** + * Constructs a new EnumAttributeValues. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.AttributeValues.IEnumAttributeValues); + + /** EnumAttributeValues values. */ + public values: google.cloud.apihub.v1.Attribute.IAllowedValue[]; + + /** + * Creates a new EnumAttributeValues instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumAttributeValues instance + */ + public static create(properties?: google.cloud.apihub.v1.AttributeValues.IEnumAttributeValues): google.cloud.apihub.v1.AttributeValues.EnumAttributeValues; + + /** + * Encodes the specified EnumAttributeValues message. Does not implicitly {@link google.cloud.apihub.v1.AttributeValues.EnumAttributeValues.verify|verify} messages. + * @param message EnumAttributeValues message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.AttributeValues.IEnumAttributeValues, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumAttributeValues message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.AttributeValues.EnumAttributeValues.verify|verify} messages. + * @param message EnumAttributeValues message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.AttributeValues.IEnumAttributeValues, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumAttributeValues message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumAttributeValues + * @throws {Error} If the payload is not 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.apihub.v1.AttributeValues.EnumAttributeValues; + + /** + * Decodes an EnumAttributeValues message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumAttributeValues + * @throws {Error} If the payload 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.apihub.v1.AttributeValues.EnumAttributeValues; + + /** + * Verifies an EnumAttributeValues message. + * @param message Plain 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 EnumAttributeValues message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumAttributeValues + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.AttributeValues.EnumAttributeValues; + + /** + * Creates a plain object from an EnumAttributeValues message. Also converts values to other types if specified. + * @param message EnumAttributeValues + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.AttributeValues.EnumAttributeValues, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumAttributeValues to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumAttributeValues + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StringAttributeValues. */ + interface IStringAttributeValues { + + /** StringAttributeValues values */ + values?: (string[]|null); + } + + /** Represents a StringAttributeValues. */ + class StringAttributeValues implements IStringAttributeValues { + + /** + * Constructs a new StringAttributeValues. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.AttributeValues.IStringAttributeValues); + + /** StringAttributeValues values. */ + public values: string[]; + + /** + * Creates a new StringAttributeValues instance using the specified properties. + * @param [properties] Properties to set + * @returns StringAttributeValues instance + */ + public static create(properties?: google.cloud.apihub.v1.AttributeValues.IStringAttributeValues): google.cloud.apihub.v1.AttributeValues.StringAttributeValues; + + /** + * Encodes the specified StringAttributeValues message. Does not implicitly {@link google.cloud.apihub.v1.AttributeValues.StringAttributeValues.verify|verify} messages. + * @param message StringAttributeValues message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.AttributeValues.IStringAttributeValues, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StringAttributeValues message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.AttributeValues.StringAttributeValues.verify|verify} messages. + * @param message StringAttributeValues message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.AttributeValues.IStringAttributeValues, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StringAttributeValues message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StringAttributeValues + * @throws {Error} If the payload is not 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.apihub.v1.AttributeValues.StringAttributeValues; + + /** + * Decodes a StringAttributeValues message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StringAttributeValues + * @throws {Error} If the payload 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.apihub.v1.AttributeValues.StringAttributeValues; + + /** + * Verifies a StringAttributeValues message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StringAttributeValues message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StringAttributeValues + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.AttributeValues.StringAttributeValues; + + /** + * Creates a plain object from a StringAttributeValues message. Also converts values to other types if specified. + * @param message StringAttributeValues + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.AttributeValues.StringAttributeValues, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StringAttributeValues to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StringAttributeValues + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a Dependency. */ + interface IDependency { + + /** Dependency name */ + name?: (string|null); + + /** Dependency consumer */ + consumer?: (google.cloud.apihub.v1.IDependencyEntityReference|null); + + /** Dependency supplier */ + supplier?: (google.cloud.apihub.v1.IDependencyEntityReference|null); + + /** Dependency state */ + state?: (google.cloud.apihub.v1.Dependency.State|keyof typeof google.cloud.apihub.v1.Dependency.State|null); + + /** Dependency description */ + description?: (string|null); + + /** Dependency discoveryMode */ + discoveryMode?: (google.cloud.apihub.v1.Dependency.DiscoveryMode|keyof typeof google.cloud.apihub.v1.Dependency.DiscoveryMode|null); + + /** Dependency errorDetail */ + errorDetail?: (google.cloud.apihub.v1.IDependencyErrorDetail|null); + + /** Dependency createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Dependency updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Dependency attributes */ + attributes?: ({ [k: string]: google.cloud.apihub.v1.IAttributeValues }|null); + } + + /** Represents a Dependency. */ + class Dependency implements IDependency { + + /** + * Constructs a new Dependency. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IDependency); + + /** Dependency name. */ + public name: string; + + /** Dependency consumer. */ + public consumer?: (google.cloud.apihub.v1.IDependencyEntityReference|null); + + /** Dependency supplier. */ + public supplier?: (google.cloud.apihub.v1.IDependencyEntityReference|null); + + /** Dependency state. */ + public state: (google.cloud.apihub.v1.Dependency.State|keyof typeof google.cloud.apihub.v1.Dependency.State); + + /** Dependency description. */ + public description: string; + + /** Dependency discoveryMode. */ + public discoveryMode: (google.cloud.apihub.v1.Dependency.DiscoveryMode|keyof typeof google.cloud.apihub.v1.Dependency.DiscoveryMode); + + /** Dependency errorDetail. */ + public errorDetail?: (google.cloud.apihub.v1.IDependencyErrorDetail|null); + + /** Dependency createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Dependency updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Dependency attributes. */ + public attributes: { [k: string]: google.cloud.apihub.v1.IAttributeValues }; + + /** + * Creates a new Dependency instance using the specified properties. + * @param [properties] Properties to set + * @returns Dependency instance + */ + public static create(properties?: google.cloud.apihub.v1.IDependency): google.cloud.apihub.v1.Dependency; + + /** + * Encodes the specified Dependency message. Does not implicitly {@link google.cloud.apihub.v1.Dependency.verify|verify} messages. + * @param message Dependency message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IDependency, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Dependency message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.Dependency.verify|verify} messages. + * @param message Dependency message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IDependency, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Dependency message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Dependency + * @throws {Error} If the payload is not 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.apihub.v1.Dependency; + + /** + * Decodes a Dependency message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Dependency + * @throws {Error} If the payload 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.apihub.v1.Dependency; + + /** + * Verifies a Dependency message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Dependency message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Dependency + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.Dependency; + + /** + * Creates a plain object from a Dependency message. Also converts values to other types if specified. + * @param message Dependency + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.Dependency, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Dependency to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Dependency + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Dependency { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + PROPOSED = 1, + VALIDATED = 2 + } + + /** DiscoveryMode enum. */ + enum DiscoveryMode { + DISCOVERY_MODE_UNSPECIFIED = 0, + MANUAL = 1 + } + } + + /** Properties of a DependencyEntityReference. */ + interface IDependencyEntityReference { + + /** DependencyEntityReference operationResourceName */ + operationResourceName?: (string|null); + + /** DependencyEntityReference externalApiResourceName */ + externalApiResourceName?: (string|null); + + /** DependencyEntityReference displayName */ + displayName?: (string|null); + } + + /** Represents a DependencyEntityReference. */ + class DependencyEntityReference implements IDependencyEntityReference { + + /** + * Constructs a new DependencyEntityReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IDependencyEntityReference); + + /** DependencyEntityReference operationResourceName. */ + public operationResourceName?: (string|null); + + /** DependencyEntityReference externalApiResourceName. */ + public externalApiResourceName?: (string|null); + + /** DependencyEntityReference displayName. */ + public displayName: string; + + /** DependencyEntityReference identifier. */ + public identifier?: ("operationResourceName"|"externalApiResourceName"); + + /** + * Creates a new DependencyEntityReference instance using the specified properties. + * @param [properties] Properties to set + * @returns DependencyEntityReference instance + */ + public static create(properties?: google.cloud.apihub.v1.IDependencyEntityReference): google.cloud.apihub.v1.DependencyEntityReference; + + /** + * Encodes the specified DependencyEntityReference message. Does not implicitly {@link google.cloud.apihub.v1.DependencyEntityReference.verify|verify} messages. + * @param message DependencyEntityReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IDependencyEntityReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DependencyEntityReference message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.DependencyEntityReference.verify|verify} messages. + * @param message DependencyEntityReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IDependencyEntityReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DependencyEntityReference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DependencyEntityReference + * @throws {Error} If the payload is not 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.apihub.v1.DependencyEntityReference; + + /** + * Decodes a DependencyEntityReference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DependencyEntityReference + * @throws {Error} If the payload 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.apihub.v1.DependencyEntityReference; + + /** + * Verifies a DependencyEntityReference message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DependencyEntityReference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DependencyEntityReference + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.DependencyEntityReference; + + /** + * Creates a plain object from a DependencyEntityReference message. Also converts values to other types if specified. + * @param message DependencyEntityReference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.DependencyEntityReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DependencyEntityReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DependencyEntityReference + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DependencyErrorDetail. */ + interface IDependencyErrorDetail { + + /** DependencyErrorDetail error */ + error?: (google.cloud.apihub.v1.DependencyErrorDetail.Error|keyof typeof google.cloud.apihub.v1.DependencyErrorDetail.Error|null); + + /** DependencyErrorDetail errorTime */ + errorTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a DependencyErrorDetail. */ + class DependencyErrorDetail implements IDependencyErrorDetail { + + /** + * Constructs a new DependencyErrorDetail. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IDependencyErrorDetail); + + /** DependencyErrorDetail error. */ + public error: (google.cloud.apihub.v1.DependencyErrorDetail.Error|keyof typeof google.cloud.apihub.v1.DependencyErrorDetail.Error); + + /** DependencyErrorDetail errorTime. */ + public errorTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new DependencyErrorDetail instance using the specified properties. + * @param [properties] Properties to set + * @returns DependencyErrorDetail instance + */ + public static create(properties?: google.cloud.apihub.v1.IDependencyErrorDetail): google.cloud.apihub.v1.DependencyErrorDetail; + + /** + * Encodes the specified DependencyErrorDetail message. Does not implicitly {@link google.cloud.apihub.v1.DependencyErrorDetail.verify|verify} messages. + * @param message DependencyErrorDetail message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IDependencyErrorDetail, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DependencyErrorDetail message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.DependencyErrorDetail.verify|verify} messages. + * @param message DependencyErrorDetail message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IDependencyErrorDetail, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DependencyErrorDetail message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DependencyErrorDetail + * @throws {Error} If the payload is not 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.apihub.v1.DependencyErrorDetail; + + /** + * Decodes a DependencyErrorDetail message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DependencyErrorDetail + * @throws {Error} If the payload 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.apihub.v1.DependencyErrorDetail; + + /** + * Verifies a DependencyErrorDetail message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DependencyErrorDetail message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DependencyErrorDetail + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.DependencyErrorDetail; + + /** + * Creates a plain object from a DependencyErrorDetail message. Also converts values to other types if specified. + * @param message DependencyErrorDetail + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.DependencyErrorDetail, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DependencyErrorDetail to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DependencyErrorDetail + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DependencyErrorDetail { + + /** Error enum. */ + enum Error { + ERROR_UNSPECIFIED = 0, + SUPPLIER_NOT_FOUND = 1, + SUPPLIER_RECREATED = 2 + } + } + + /** Properties of a LintResponse. */ + interface ILintResponse { + + /** LintResponse issues */ + issues?: (google.cloud.apihub.v1.IIssue[]|null); + + /** LintResponse summary */ + summary?: (google.cloud.apihub.v1.LintResponse.ISummaryEntry[]|null); + + /** LintResponse state */ + state?: (google.cloud.apihub.v1.LintState|keyof typeof google.cloud.apihub.v1.LintState|null); + + /** LintResponse source */ + source?: (string|null); + + /** LintResponse linter */ + linter?: (google.cloud.apihub.v1.Linter|keyof typeof google.cloud.apihub.v1.Linter|null); + + /** LintResponse createTime */ + createTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a LintResponse. */ + class LintResponse implements ILintResponse { + + /** + * Constructs a new LintResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.ILintResponse); + + /** LintResponse issues. */ + public issues: google.cloud.apihub.v1.IIssue[]; + + /** LintResponse summary. */ + public summary: google.cloud.apihub.v1.LintResponse.ISummaryEntry[]; + + /** LintResponse state. */ + public state: (google.cloud.apihub.v1.LintState|keyof typeof google.cloud.apihub.v1.LintState); + + /** LintResponse source. */ + public source: string; + + /** LintResponse linter. */ + public linter: (google.cloud.apihub.v1.Linter|keyof typeof google.cloud.apihub.v1.Linter); + + /** LintResponse createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new LintResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns LintResponse instance + */ + public static create(properties?: google.cloud.apihub.v1.ILintResponse): google.cloud.apihub.v1.LintResponse; + + /** + * Encodes the specified LintResponse message. Does not implicitly {@link google.cloud.apihub.v1.LintResponse.verify|verify} messages. + * @param message LintResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.ILintResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LintResponse message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.LintResponse.verify|verify} messages. + * @param message LintResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.ILintResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LintResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LintResponse + * @throws {Error} If the payload is not 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.apihub.v1.LintResponse; + + /** + * Decodes a LintResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LintResponse + * @throws {Error} If the payload 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.apihub.v1.LintResponse; + + /** + * Verifies a LintResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LintResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LintResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.LintResponse; + + /** + * Creates a plain object from a LintResponse message. Also converts values to other types if specified. + * @param message LintResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.LintResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LintResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LintResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace LintResponse { + + /** Properties of a SummaryEntry. */ + interface ISummaryEntry { + + /** SummaryEntry severity */ + severity?: (google.cloud.apihub.v1.Severity|keyof typeof google.cloud.apihub.v1.Severity|null); + + /** SummaryEntry count */ + count?: (number|null); + } + + /** Represents a SummaryEntry. */ + class SummaryEntry implements ISummaryEntry { + + /** + * Constructs a new SummaryEntry. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.LintResponse.ISummaryEntry); + + /** SummaryEntry severity. */ + public severity: (google.cloud.apihub.v1.Severity|keyof typeof google.cloud.apihub.v1.Severity); + + /** SummaryEntry count. */ + public count: number; + + /** + * Creates a new SummaryEntry instance using the specified properties. + * @param [properties] Properties to set + * @returns SummaryEntry instance + */ + public static create(properties?: google.cloud.apihub.v1.LintResponse.ISummaryEntry): google.cloud.apihub.v1.LintResponse.SummaryEntry; + + /** + * Encodes the specified SummaryEntry message. Does not implicitly {@link google.cloud.apihub.v1.LintResponse.SummaryEntry.verify|verify} messages. + * @param message SummaryEntry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.LintResponse.ISummaryEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SummaryEntry message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.LintResponse.SummaryEntry.verify|verify} messages. + * @param message SummaryEntry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.LintResponse.ISummaryEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SummaryEntry message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SummaryEntry + * @throws {Error} If the payload is not 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.apihub.v1.LintResponse.SummaryEntry; + + /** + * Decodes a SummaryEntry message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SummaryEntry + * @throws {Error} If the payload 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.apihub.v1.LintResponse.SummaryEntry; + + /** + * Verifies a SummaryEntry message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SummaryEntry message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SummaryEntry + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.LintResponse.SummaryEntry; + + /** + * Creates a plain object from a SummaryEntry message. Also converts values to other types if specified. + * @param message SummaryEntry + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.LintResponse.SummaryEntry, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SummaryEntry to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SummaryEntry + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an Issue. */ + interface IIssue { + + /** Issue code */ + code?: (string|null); + + /** Issue path */ + path?: (string[]|null); + + /** Issue message */ + message?: (string|null); + + /** Issue severity */ + severity?: (google.cloud.apihub.v1.Severity|keyof typeof google.cloud.apihub.v1.Severity|null); + + /** Issue range */ + range?: (google.cloud.apihub.v1.IRange|null); + } + + /** Represents an Issue. */ + class Issue implements IIssue { + + /** + * Constructs a new Issue. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IIssue); + + /** Issue code. */ + public code: string; + + /** Issue path. */ + public path: string[]; + + /** Issue message. */ + public message: string; + + /** Issue severity. */ + public severity: (google.cloud.apihub.v1.Severity|keyof typeof google.cloud.apihub.v1.Severity); + + /** Issue range. */ + public range?: (google.cloud.apihub.v1.IRange|null); + + /** + * Creates a new Issue instance using the specified properties. + * @param [properties] Properties to set + * @returns Issue instance + */ + public static create(properties?: google.cloud.apihub.v1.IIssue): google.cloud.apihub.v1.Issue; + + /** + * Encodes the specified Issue message. Does not implicitly {@link google.cloud.apihub.v1.Issue.verify|verify} messages. + * @param message Issue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IIssue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Issue message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.Issue.verify|verify} messages. + * @param message Issue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IIssue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Issue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Issue + * @throws {Error} If the payload is not 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.apihub.v1.Issue; + + /** + * Decodes an Issue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Issue + * @throws {Error} If the payload 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.apihub.v1.Issue; + + /** + * Verifies an Issue message. + * @param message Plain 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 Issue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Issue + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.Issue; + + /** + * Creates a plain object from an Issue message. Also converts values to other types if specified. + * @param message Issue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.Issue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Issue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Issue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Range. */ + interface IRange { + + /** Range start */ + start?: (google.cloud.apihub.v1.IPoint|null); + + /** Range end */ + end?: (google.cloud.apihub.v1.IPoint|null); + } + + /** Represents a Range. */ + class Range implements IRange { + + /** + * Constructs a new Range. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IRange); + + /** Range start. */ + public start?: (google.cloud.apihub.v1.IPoint|null); + + /** Range end. */ + public end?: (google.cloud.apihub.v1.IPoint|null); + + /** + * Creates a new Range instance using the specified properties. + * @param [properties] Properties to set + * @returns Range instance + */ + public static create(properties?: google.cloud.apihub.v1.IRange): google.cloud.apihub.v1.Range; + + /** + * Encodes the specified Range message. Does not implicitly {@link google.cloud.apihub.v1.Range.verify|verify} messages. + * @param message Range message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Range message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.Range.verify|verify} messages. + * @param message Range message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Range message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Range + * @throws {Error} If the payload is not 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.apihub.v1.Range; + + /** + * Decodes a Range message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Range + * @throws {Error} If the payload 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.apihub.v1.Range; + + /** + * Verifies a Range message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Range message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Range + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.Range; + + /** + * Creates a plain object from a Range message. Also converts values to other types if specified. + * @param message Range + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.Range, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Range to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Range + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Point. */ + interface IPoint { + + /** Point line */ + line?: (number|null); + + /** Point character */ + character?: (number|null); + } + + /** Represents a Point. */ + class Point implements IPoint { + + /** + * Constructs a new Point. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IPoint); + + /** Point line. */ + public line: number; + + /** Point character. */ + public character: number; + + /** + * Creates a new Point instance using the specified properties. + * @param [properties] Properties to set + * @returns Point instance + */ + public static create(properties?: google.cloud.apihub.v1.IPoint): google.cloud.apihub.v1.Point; + + /** + * Encodes the specified Point message. Does not implicitly {@link google.cloud.apihub.v1.Point.verify|verify} messages. + * @param message Point message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IPoint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Point message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.Point.verify|verify} messages. + * @param message Point message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IPoint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Point message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Point + * @throws {Error} If the payload is not 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.apihub.v1.Point; + + /** + * Decodes a Point message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Point + * @throws {Error} If the payload 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.apihub.v1.Point; + + /** + * Verifies a Point message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Point message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Point + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.Point; + + /** + * Creates a plain object from a Point message. Also converts values to other types if specified. + * @param message Point + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.Point, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Point to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Point + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** 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.apihub.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.apihub.v1.IOperationMetadata): google.cloud.apihub.v1.OperationMetadata; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.apihub.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.apihub.v1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.apihub.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.apihub.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.apihub.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.apihub.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.apihub.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.apihub.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 an ApiHubInstance. */ + interface IApiHubInstance { + + /** ApiHubInstance name */ + name?: (string|null); + + /** ApiHubInstance createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** ApiHubInstance updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** ApiHubInstance state */ + state?: (google.cloud.apihub.v1.ApiHubInstance.State|keyof typeof google.cloud.apihub.v1.ApiHubInstance.State|null); + + /** ApiHubInstance stateMessage */ + stateMessage?: (string|null); + + /** ApiHubInstance config */ + config?: (google.cloud.apihub.v1.ApiHubInstance.IConfig|null); + + /** ApiHubInstance labels */ + labels?: ({ [k: string]: string }|null); + + /** ApiHubInstance description */ + description?: (string|null); + } + + /** Represents an ApiHubInstance. */ + class ApiHubInstance implements IApiHubInstance { + + /** + * Constructs a new ApiHubInstance. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IApiHubInstance); + + /** ApiHubInstance name. */ + public name: string; + + /** ApiHubInstance createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** ApiHubInstance updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** ApiHubInstance state. */ + public state: (google.cloud.apihub.v1.ApiHubInstance.State|keyof typeof google.cloud.apihub.v1.ApiHubInstance.State); + + /** ApiHubInstance stateMessage. */ + public stateMessage: string; + + /** ApiHubInstance config. */ + public config?: (google.cloud.apihub.v1.ApiHubInstance.IConfig|null); + + /** ApiHubInstance labels. */ + public labels: { [k: string]: string }; + + /** ApiHubInstance description. */ + public description: string; + + /** + * Creates a new ApiHubInstance instance using the specified properties. + * @param [properties] Properties to set + * @returns ApiHubInstance instance + */ + public static create(properties?: google.cloud.apihub.v1.IApiHubInstance): google.cloud.apihub.v1.ApiHubInstance; + + /** + * Encodes the specified ApiHubInstance message. Does not implicitly {@link google.cloud.apihub.v1.ApiHubInstance.verify|verify} messages. + * @param message ApiHubInstance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IApiHubInstance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ApiHubInstance message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ApiHubInstance.verify|verify} messages. + * @param message ApiHubInstance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IApiHubInstance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ApiHubInstance message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ApiHubInstance + * @throws {Error} If the payload is not 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.apihub.v1.ApiHubInstance; + + /** + * Decodes an ApiHubInstance message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ApiHubInstance + * @throws {Error} If the payload 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.apihub.v1.ApiHubInstance; + + /** + * Verifies an ApiHubInstance message. + * @param message Plain 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 ApiHubInstance message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ApiHubInstance + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.ApiHubInstance; + + /** + * Creates a plain object from an ApiHubInstance message. Also converts values to other types if specified. + * @param message ApiHubInstance + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.ApiHubInstance, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ApiHubInstance to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ApiHubInstance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ApiHubInstance { + + /** Properties of a Config. */ + interface IConfig { + + /** Config cmekKeyName */ + cmekKeyName?: (string|null); + } + + /** Represents a Config. */ + class Config implements IConfig { + + /** + * Constructs a new Config. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.ApiHubInstance.IConfig); + + /** Config cmekKeyName. */ + public cmekKeyName: string; + + /** + * Creates a new Config instance using the specified properties. + * @param [properties] Properties to set + * @returns Config instance + */ + public static create(properties?: google.cloud.apihub.v1.ApiHubInstance.IConfig): google.cloud.apihub.v1.ApiHubInstance.Config; + + /** + * Encodes the specified Config message. Does not implicitly {@link google.cloud.apihub.v1.ApiHubInstance.Config.verify|verify} messages. + * @param message Config message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.ApiHubInstance.IConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Config message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ApiHubInstance.Config.verify|verify} messages. + * @param message Config message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.ApiHubInstance.IConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Config message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Config + * @throws {Error} If the payload is not 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.apihub.v1.ApiHubInstance.Config; + + /** + * Decodes a Config message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Config + * @throws {Error} If the payload 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.apihub.v1.ApiHubInstance.Config; + + /** + * Verifies a Config message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Config message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Config + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.ApiHubInstance.Config; + + /** + * Creates a plain object from a Config message. Also converts values to other types if specified. + * @param message Config + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.ApiHubInstance.Config, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Config to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Config + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + INACTIVE = 1, + CREATING = 2, + ACTIVE = 3, + UPDATING = 4, + DELETING = 5, + FAILED = 6 + } + } + + /** Properties of an ExternalApi. */ + interface IExternalApi { + + /** ExternalApi name */ + name?: (string|null); + + /** ExternalApi displayName */ + displayName?: (string|null); + + /** ExternalApi description */ + description?: (string|null); + + /** ExternalApi endpoints */ + endpoints?: (string[]|null); + + /** ExternalApi paths */ + paths?: (string[]|null); + + /** ExternalApi documentation */ + documentation?: (google.cloud.apihub.v1.IDocumentation|null); + + /** ExternalApi attributes */ + attributes?: ({ [k: string]: google.cloud.apihub.v1.IAttributeValues }|null); + + /** ExternalApi createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** ExternalApi updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents an ExternalApi. */ + class ExternalApi implements IExternalApi { + + /** + * Constructs a new ExternalApi. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IExternalApi); + + /** ExternalApi name. */ + public name: string; + + /** ExternalApi displayName. */ + public displayName: string; + + /** ExternalApi description. */ + public description: string; + + /** ExternalApi endpoints. */ + public endpoints: string[]; + + /** ExternalApi paths. */ + public paths: string[]; + + /** ExternalApi documentation. */ + public documentation?: (google.cloud.apihub.v1.IDocumentation|null); + + /** ExternalApi attributes. */ + public attributes: { [k: string]: google.cloud.apihub.v1.IAttributeValues }; + + /** ExternalApi createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** ExternalApi updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new ExternalApi instance using the specified properties. + * @param [properties] Properties to set + * @returns ExternalApi instance + */ + public static create(properties?: google.cloud.apihub.v1.IExternalApi): google.cloud.apihub.v1.ExternalApi; + + /** + * Encodes the specified ExternalApi message. Does not implicitly {@link google.cloud.apihub.v1.ExternalApi.verify|verify} messages. + * @param message ExternalApi message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IExternalApi, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExternalApi message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ExternalApi.verify|verify} messages. + * @param message ExternalApi message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IExternalApi, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExternalApi message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExternalApi + * @throws {Error} If the payload is not 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.apihub.v1.ExternalApi; + + /** + * Decodes an ExternalApi message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExternalApi + * @throws {Error} If the payload 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.apihub.v1.ExternalApi; + + /** + * Verifies an ExternalApi message. + * @param message Plain 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 ExternalApi message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExternalApi + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.ExternalApi; + + /** + * Creates a plain object from an ExternalApi message. Also converts values to other types if specified. + * @param message ExternalApi + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.ExternalApi, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExternalApi to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExternalApi + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a HostProjectRegistrationService */ + class HostProjectRegistrationService extends $protobuf.rpc.Service { + + /** + * Constructs a new HostProjectRegistrationService 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 HostProjectRegistrationService 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): HostProjectRegistrationService; + + /** + * Calls CreateHostProjectRegistration. + * @param request CreateHostProjectRegistrationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and HostProjectRegistration + */ + public createHostProjectRegistration(request: google.cloud.apihub.v1.ICreateHostProjectRegistrationRequest, callback: google.cloud.apihub.v1.HostProjectRegistrationService.CreateHostProjectRegistrationCallback): void; + + /** + * Calls CreateHostProjectRegistration. + * @param request CreateHostProjectRegistrationRequest message or plain object + * @returns Promise + */ + public createHostProjectRegistration(request: google.cloud.apihub.v1.ICreateHostProjectRegistrationRequest): Promise; + + /** + * Calls GetHostProjectRegistration. + * @param request GetHostProjectRegistrationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and HostProjectRegistration + */ + public getHostProjectRegistration(request: google.cloud.apihub.v1.IGetHostProjectRegistrationRequest, callback: google.cloud.apihub.v1.HostProjectRegistrationService.GetHostProjectRegistrationCallback): void; + + /** + * Calls GetHostProjectRegistration. + * @param request GetHostProjectRegistrationRequest message or plain object + * @returns Promise + */ + public getHostProjectRegistration(request: google.cloud.apihub.v1.IGetHostProjectRegistrationRequest): Promise; + + /** + * Calls ListHostProjectRegistrations. + * @param request ListHostProjectRegistrationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListHostProjectRegistrationsResponse + */ + public listHostProjectRegistrations(request: google.cloud.apihub.v1.IListHostProjectRegistrationsRequest, callback: google.cloud.apihub.v1.HostProjectRegistrationService.ListHostProjectRegistrationsCallback): void; + + /** + * Calls ListHostProjectRegistrations. + * @param request ListHostProjectRegistrationsRequest message or plain object + * @returns Promise + */ + public listHostProjectRegistrations(request: google.cloud.apihub.v1.IListHostProjectRegistrationsRequest): Promise; + } + + namespace HostProjectRegistrationService { + + /** + * Callback as used by {@link google.cloud.apihub.v1.HostProjectRegistrationService|createHostProjectRegistration}. + * @param error Error, if any + * @param [response] HostProjectRegistration + */ + type CreateHostProjectRegistrationCallback = (error: (Error|null), response?: google.cloud.apihub.v1.HostProjectRegistration) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.HostProjectRegistrationService|getHostProjectRegistration}. + * @param error Error, if any + * @param [response] HostProjectRegistration + */ + type GetHostProjectRegistrationCallback = (error: (Error|null), response?: google.cloud.apihub.v1.HostProjectRegistration) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.HostProjectRegistrationService|listHostProjectRegistrations}. + * @param error Error, if any + * @param [response] ListHostProjectRegistrationsResponse + */ + type ListHostProjectRegistrationsCallback = (error: (Error|null), response?: google.cloud.apihub.v1.ListHostProjectRegistrationsResponse) => void; + } + + /** Properties of a CreateHostProjectRegistrationRequest. */ + interface ICreateHostProjectRegistrationRequest { + + /** CreateHostProjectRegistrationRequest parent */ + parent?: (string|null); + + /** CreateHostProjectRegistrationRequest hostProjectRegistrationId */ + hostProjectRegistrationId?: (string|null); + + /** CreateHostProjectRegistrationRequest hostProjectRegistration */ + hostProjectRegistration?: (google.cloud.apihub.v1.IHostProjectRegistration|null); + } + + /** Represents a CreateHostProjectRegistrationRequest. */ + class CreateHostProjectRegistrationRequest implements ICreateHostProjectRegistrationRequest { + + /** + * Constructs a new CreateHostProjectRegistrationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.ICreateHostProjectRegistrationRequest); + + /** CreateHostProjectRegistrationRequest parent. */ + public parent: string; + + /** CreateHostProjectRegistrationRequest hostProjectRegistrationId. */ + public hostProjectRegistrationId: string; + + /** CreateHostProjectRegistrationRequest hostProjectRegistration. */ + public hostProjectRegistration?: (google.cloud.apihub.v1.IHostProjectRegistration|null); + + /** + * Creates a new CreateHostProjectRegistrationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateHostProjectRegistrationRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.ICreateHostProjectRegistrationRequest): google.cloud.apihub.v1.CreateHostProjectRegistrationRequest; + + /** + * Encodes the specified CreateHostProjectRegistrationRequest message. Does not implicitly {@link google.cloud.apihub.v1.CreateHostProjectRegistrationRequest.verify|verify} messages. + * @param message CreateHostProjectRegistrationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.ICreateHostProjectRegistrationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateHostProjectRegistrationRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.CreateHostProjectRegistrationRequest.verify|verify} messages. + * @param message CreateHostProjectRegistrationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.ICreateHostProjectRegistrationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateHostProjectRegistrationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateHostProjectRegistrationRequest + * @throws {Error} If the payload is not 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.apihub.v1.CreateHostProjectRegistrationRequest; + + /** + * Decodes a CreateHostProjectRegistrationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateHostProjectRegistrationRequest + * @throws {Error} If the payload 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.apihub.v1.CreateHostProjectRegistrationRequest; + + /** + * Verifies a CreateHostProjectRegistrationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateHostProjectRegistrationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateHostProjectRegistrationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.CreateHostProjectRegistrationRequest; + + /** + * Creates a plain object from a CreateHostProjectRegistrationRequest message. Also converts values to other types if specified. + * @param message CreateHostProjectRegistrationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.CreateHostProjectRegistrationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateHostProjectRegistrationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateHostProjectRegistrationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetHostProjectRegistrationRequest. */ + interface IGetHostProjectRegistrationRequest { + + /** GetHostProjectRegistrationRequest name */ + name?: (string|null); + } + + /** Represents a GetHostProjectRegistrationRequest. */ + class GetHostProjectRegistrationRequest implements IGetHostProjectRegistrationRequest { + + /** + * Constructs a new GetHostProjectRegistrationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IGetHostProjectRegistrationRequest); + + /** GetHostProjectRegistrationRequest name. */ + public name: string; + + /** + * Creates a new GetHostProjectRegistrationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetHostProjectRegistrationRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.IGetHostProjectRegistrationRequest): google.cloud.apihub.v1.GetHostProjectRegistrationRequest; + + /** + * Encodes the specified GetHostProjectRegistrationRequest message. Does not implicitly {@link google.cloud.apihub.v1.GetHostProjectRegistrationRequest.verify|verify} messages. + * @param message GetHostProjectRegistrationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IGetHostProjectRegistrationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetHostProjectRegistrationRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.GetHostProjectRegistrationRequest.verify|verify} messages. + * @param message GetHostProjectRegistrationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IGetHostProjectRegistrationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetHostProjectRegistrationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetHostProjectRegistrationRequest + * @throws {Error} If the payload is not 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.apihub.v1.GetHostProjectRegistrationRequest; + + /** + * Decodes a GetHostProjectRegistrationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetHostProjectRegistrationRequest + * @throws {Error} If the payload 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.apihub.v1.GetHostProjectRegistrationRequest; + + /** + * Verifies a GetHostProjectRegistrationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetHostProjectRegistrationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetHostProjectRegistrationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.GetHostProjectRegistrationRequest; + + /** + * Creates a plain object from a GetHostProjectRegistrationRequest message. Also converts values to other types if specified. + * @param message GetHostProjectRegistrationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.GetHostProjectRegistrationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetHostProjectRegistrationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetHostProjectRegistrationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListHostProjectRegistrationsRequest. */ + interface IListHostProjectRegistrationsRequest { + + /** ListHostProjectRegistrationsRequest parent */ + parent?: (string|null); + + /** ListHostProjectRegistrationsRequest pageSize */ + pageSize?: (number|null); + + /** ListHostProjectRegistrationsRequest pageToken */ + pageToken?: (string|null); + + /** ListHostProjectRegistrationsRequest filter */ + filter?: (string|null); + + /** ListHostProjectRegistrationsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListHostProjectRegistrationsRequest. */ + class ListHostProjectRegistrationsRequest implements IListHostProjectRegistrationsRequest { + + /** + * Constructs a new ListHostProjectRegistrationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IListHostProjectRegistrationsRequest); + + /** ListHostProjectRegistrationsRequest parent. */ + public parent: string; + + /** ListHostProjectRegistrationsRequest pageSize. */ + public pageSize: number; + + /** ListHostProjectRegistrationsRequest pageToken. */ + public pageToken: string; + + /** ListHostProjectRegistrationsRequest filter. */ + public filter: string; + + /** ListHostProjectRegistrationsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListHostProjectRegistrationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListHostProjectRegistrationsRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.IListHostProjectRegistrationsRequest): google.cloud.apihub.v1.ListHostProjectRegistrationsRequest; + + /** + * Encodes the specified ListHostProjectRegistrationsRequest message. Does not implicitly {@link google.cloud.apihub.v1.ListHostProjectRegistrationsRequest.verify|verify} messages. + * @param message ListHostProjectRegistrationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IListHostProjectRegistrationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListHostProjectRegistrationsRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListHostProjectRegistrationsRequest.verify|verify} messages. + * @param message ListHostProjectRegistrationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IListHostProjectRegistrationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListHostProjectRegistrationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListHostProjectRegistrationsRequest + * @throws {Error} If the payload is not 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.apihub.v1.ListHostProjectRegistrationsRequest; + + /** + * Decodes a ListHostProjectRegistrationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListHostProjectRegistrationsRequest + * @throws {Error} If the payload 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.apihub.v1.ListHostProjectRegistrationsRequest; + + /** + * Verifies a ListHostProjectRegistrationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListHostProjectRegistrationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListHostProjectRegistrationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.ListHostProjectRegistrationsRequest; + + /** + * Creates a plain object from a ListHostProjectRegistrationsRequest message. Also converts values to other types if specified. + * @param message ListHostProjectRegistrationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.ListHostProjectRegistrationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListHostProjectRegistrationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListHostProjectRegistrationsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListHostProjectRegistrationsResponse. */ + interface IListHostProjectRegistrationsResponse { + + /** ListHostProjectRegistrationsResponse hostProjectRegistrations */ + hostProjectRegistrations?: (google.cloud.apihub.v1.IHostProjectRegistration[]|null); + + /** ListHostProjectRegistrationsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListHostProjectRegistrationsResponse. */ + class ListHostProjectRegistrationsResponse implements IListHostProjectRegistrationsResponse { + + /** + * Constructs a new ListHostProjectRegistrationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IListHostProjectRegistrationsResponse); + + /** ListHostProjectRegistrationsResponse hostProjectRegistrations. */ + public hostProjectRegistrations: google.cloud.apihub.v1.IHostProjectRegistration[]; + + /** ListHostProjectRegistrationsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListHostProjectRegistrationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListHostProjectRegistrationsResponse instance + */ + public static create(properties?: google.cloud.apihub.v1.IListHostProjectRegistrationsResponse): google.cloud.apihub.v1.ListHostProjectRegistrationsResponse; + + /** + * Encodes the specified ListHostProjectRegistrationsResponse message. Does not implicitly {@link google.cloud.apihub.v1.ListHostProjectRegistrationsResponse.verify|verify} messages. + * @param message ListHostProjectRegistrationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IListHostProjectRegistrationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListHostProjectRegistrationsResponse message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListHostProjectRegistrationsResponse.verify|verify} messages. + * @param message ListHostProjectRegistrationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IListHostProjectRegistrationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListHostProjectRegistrationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListHostProjectRegistrationsResponse + * @throws {Error} If the payload is not 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.apihub.v1.ListHostProjectRegistrationsResponse; + + /** + * Decodes a ListHostProjectRegistrationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListHostProjectRegistrationsResponse + * @throws {Error} If the payload 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.apihub.v1.ListHostProjectRegistrationsResponse; + + /** + * Verifies a ListHostProjectRegistrationsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListHostProjectRegistrationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListHostProjectRegistrationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.ListHostProjectRegistrationsResponse; + + /** + * Creates a plain object from a ListHostProjectRegistrationsResponse message. Also converts values to other types if specified. + * @param message ListHostProjectRegistrationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.ListHostProjectRegistrationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListHostProjectRegistrationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListHostProjectRegistrationsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a HostProjectRegistration. */ + interface IHostProjectRegistration { + + /** HostProjectRegistration name */ + name?: (string|null); + + /** HostProjectRegistration gcpProject */ + gcpProject?: (string|null); + + /** HostProjectRegistration createTime */ + createTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a HostProjectRegistration. */ + class HostProjectRegistration implements IHostProjectRegistration { + + /** + * Constructs a new HostProjectRegistration. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IHostProjectRegistration); + + /** HostProjectRegistration name. */ + public name: string; + + /** HostProjectRegistration gcpProject. */ + public gcpProject: string; + + /** HostProjectRegistration createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new HostProjectRegistration instance using the specified properties. + * @param [properties] Properties to set + * @returns HostProjectRegistration instance + */ + public static create(properties?: google.cloud.apihub.v1.IHostProjectRegistration): google.cloud.apihub.v1.HostProjectRegistration; + + /** + * Encodes the specified HostProjectRegistration message. Does not implicitly {@link google.cloud.apihub.v1.HostProjectRegistration.verify|verify} messages. + * @param message HostProjectRegistration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IHostProjectRegistration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HostProjectRegistration message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.HostProjectRegistration.verify|verify} messages. + * @param message HostProjectRegistration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IHostProjectRegistration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HostProjectRegistration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HostProjectRegistration + * @throws {Error} If the payload is not 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.apihub.v1.HostProjectRegistration; + + /** + * Decodes a HostProjectRegistration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HostProjectRegistration + * @throws {Error} If the payload 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.apihub.v1.HostProjectRegistration; + + /** + * Verifies a HostProjectRegistration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HostProjectRegistration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HostProjectRegistration + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.HostProjectRegistration; + + /** + * Creates a plain object from a HostProjectRegistration message. Also converts values to other types if specified. + * @param message HostProjectRegistration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.HostProjectRegistration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HostProjectRegistration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HostProjectRegistration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a LintingService */ + class LintingService extends $protobuf.rpc.Service { + + /** + * Constructs a new LintingService 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 LintingService 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): LintingService; + + /** + * Calls GetStyleGuide. + * @param request GetStyleGuideRequest message or plain object + * @param callback Node-style callback called with the error, if any, and StyleGuide + */ + public getStyleGuide(request: google.cloud.apihub.v1.IGetStyleGuideRequest, callback: google.cloud.apihub.v1.LintingService.GetStyleGuideCallback): void; + + /** + * Calls GetStyleGuide. + * @param request GetStyleGuideRequest message or plain object + * @returns Promise + */ + public getStyleGuide(request: google.cloud.apihub.v1.IGetStyleGuideRequest): Promise; + + /** + * Calls UpdateStyleGuide. + * @param request UpdateStyleGuideRequest message or plain object + * @param callback Node-style callback called with the error, if any, and StyleGuide + */ + public updateStyleGuide(request: google.cloud.apihub.v1.IUpdateStyleGuideRequest, callback: google.cloud.apihub.v1.LintingService.UpdateStyleGuideCallback): void; + + /** + * Calls UpdateStyleGuide. + * @param request UpdateStyleGuideRequest message or plain object + * @returns Promise + */ + public updateStyleGuide(request: google.cloud.apihub.v1.IUpdateStyleGuideRequest): Promise; + + /** + * Calls GetStyleGuideContents. + * @param request GetStyleGuideContentsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and StyleGuideContents + */ + public getStyleGuideContents(request: google.cloud.apihub.v1.IGetStyleGuideContentsRequest, callback: google.cloud.apihub.v1.LintingService.GetStyleGuideContentsCallback): void; + + /** + * Calls GetStyleGuideContents. + * @param request GetStyleGuideContentsRequest message or plain object + * @returns Promise + */ + public getStyleGuideContents(request: google.cloud.apihub.v1.IGetStyleGuideContentsRequest): Promise; + + /** + * Calls LintSpec. + * @param request LintSpecRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public lintSpec(request: google.cloud.apihub.v1.ILintSpecRequest, callback: google.cloud.apihub.v1.LintingService.LintSpecCallback): void; + + /** + * Calls LintSpec. + * @param request LintSpecRequest message or plain object + * @returns Promise + */ + public lintSpec(request: google.cloud.apihub.v1.ILintSpecRequest): Promise; + } + + namespace LintingService { + + /** + * Callback as used by {@link google.cloud.apihub.v1.LintingService|getStyleGuide}. + * @param error Error, if any + * @param [response] StyleGuide + */ + type GetStyleGuideCallback = (error: (Error|null), response?: google.cloud.apihub.v1.StyleGuide) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.LintingService|updateStyleGuide}. + * @param error Error, if any + * @param [response] StyleGuide + */ + type UpdateStyleGuideCallback = (error: (Error|null), response?: google.cloud.apihub.v1.StyleGuide) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.LintingService|getStyleGuideContents}. + * @param error Error, if any + * @param [response] StyleGuideContents + */ + type GetStyleGuideContentsCallback = (error: (Error|null), response?: google.cloud.apihub.v1.StyleGuideContents) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.LintingService|lintSpec}. + * @param error Error, if any + * @param [response] Empty + */ + type LintSpecCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + } + + /** Properties of a GetStyleGuideRequest. */ + interface IGetStyleGuideRequest { + + /** GetStyleGuideRequest name */ + name?: (string|null); + } + + /** Represents a GetStyleGuideRequest. */ + class GetStyleGuideRequest implements IGetStyleGuideRequest { + + /** + * Constructs a new GetStyleGuideRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IGetStyleGuideRequest); + + /** GetStyleGuideRequest name. */ + public name: string; + + /** + * Creates a new GetStyleGuideRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetStyleGuideRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.IGetStyleGuideRequest): google.cloud.apihub.v1.GetStyleGuideRequest; + + /** + * Encodes the specified GetStyleGuideRequest message. Does not implicitly {@link google.cloud.apihub.v1.GetStyleGuideRequest.verify|verify} messages. + * @param message GetStyleGuideRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IGetStyleGuideRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetStyleGuideRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.GetStyleGuideRequest.verify|verify} messages. + * @param message GetStyleGuideRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IGetStyleGuideRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetStyleGuideRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetStyleGuideRequest + * @throws {Error} If the payload is not 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.apihub.v1.GetStyleGuideRequest; + + /** + * Decodes a GetStyleGuideRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetStyleGuideRequest + * @throws {Error} If the payload 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.apihub.v1.GetStyleGuideRequest; + + /** + * Verifies a GetStyleGuideRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetStyleGuideRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetStyleGuideRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.GetStyleGuideRequest; + + /** + * Creates a plain object from a GetStyleGuideRequest message. Also converts values to other types if specified. + * @param message GetStyleGuideRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.GetStyleGuideRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetStyleGuideRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetStyleGuideRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateStyleGuideRequest. */ + interface IUpdateStyleGuideRequest { + + /** UpdateStyleGuideRequest styleGuide */ + styleGuide?: (google.cloud.apihub.v1.IStyleGuide|null); + + /** UpdateStyleGuideRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateStyleGuideRequest. */ + class UpdateStyleGuideRequest implements IUpdateStyleGuideRequest { + + /** + * Constructs a new UpdateStyleGuideRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IUpdateStyleGuideRequest); + + /** UpdateStyleGuideRequest styleGuide. */ + public styleGuide?: (google.cloud.apihub.v1.IStyleGuide|null); + + /** UpdateStyleGuideRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateStyleGuideRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateStyleGuideRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.IUpdateStyleGuideRequest): google.cloud.apihub.v1.UpdateStyleGuideRequest; + + /** + * Encodes the specified UpdateStyleGuideRequest message. Does not implicitly {@link google.cloud.apihub.v1.UpdateStyleGuideRequest.verify|verify} messages. + * @param message UpdateStyleGuideRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IUpdateStyleGuideRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateStyleGuideRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.UpdateStyleGuideRequest.verify|verify} messages. + * @param message UpdateStyleGuideRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IUpdateStyleGuideRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateStyleGuideRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateStyleGuideRequest + * @throws {Error} If the payload is not 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.apihub.v1.UpdateStyleGuideRequest; + + /** + * Decodes an UpdateStyleGuideRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateStyleGuideRequest + * @throws {Error} If the payload 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.apihub.v1.UpdateStyleGuideRequest; + + /** + * Verifies an UpdateStyleGuideRequest message. + * @param message Plain 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 UpdateStyleGuideRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateStyleGuideRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.UpdateStyleGuideRequest; + + /** + * Creates a plain object from an UpdateStyleGuideRequest message. Also converts values to other types if specified. + * @param message UpdateStyleGuideRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.UpdateStyleGuideRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateStyleGuideRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateStyleGuideRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetStyleGuideContentsRequest. */ + interface IGetStyleGuideContentsRequest { + + /** GetStyleGuideContentsRequest name */ + name?: (string|null); + } + + /** Represents a GetStyleGuideContentsRequest. */ + class GetStyleGuideContentsRequest implements IGetStyleGuideContentsRequest { + + /** + * Constructs a new GetStyleGuideContentsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IGetStyleGuideContentsRequest); + + /** GetStyleGuideContentsRequest name. */ + public name: string; + + /** + * Creates a new GetStyleGuideContentsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetStyleGuideContentsRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.IGetStyleGuideContentsRequest): google.cloud.apihub.v1.GetStyleGuideContentsRequest; + + /** + * Encodes the specified GetStyleGuideContentsRequest message. Does not implicitly {@link google.cloud.apihub.v1.GetStyleGuideContentsRequest.verify|verify} messages. + * @param message GetStyleGuideContentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IGetStyleGuideContentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetStyleGuideContentsRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.GetStyleGuideContentsRequest.verify|verify} messages. + * @param message GetStyleGuideContentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IGetStyleGuideContentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetStyleGuideContentsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetStyleGuideContentsRequest + * @throws {Error} If the payload is not 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.apihub.v1.GetStyleGuideContentsRequest; + + /** + * Decodes a GetStyleGuideContentsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetStyleGuideContentsRequest + * @throws {Error} If the payload 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.apihub.v1.GetStyleGuideContentsRequest; + + /** + * Verifies a GetStyleGuideContentsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetStyleGuideContentsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetStyleGuideContentsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.GetStyleGuideContentsRequest; + + /** + * Creates a plain object from a GetStyleGuideContentsRequest message. Also converts values to other types if specified. + * @param message GetStyleGuideContentsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.GetStyleGuideContentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetStyleGuideContentsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetStyleGuideContentsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LintSpecRequest. */ + interface ILintSpecRequest { + + /** LintSpecRequest name */ + name?: (string|null); + } + + /** Represents a LintSpecRequest. */ + class LintSpecRequest implements ILintSpecRequest { + + /** + * Constructs a new LintSpecRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.ILintSpecRequest); + + /** LintSpecRequest name. */ + public name: string; + + /** + * Creates a new LintSpecRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns LintSpecRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.ILintSpecRequest): google.cloud.apihub.v1.LintSpecRequest; + + /** + * Encodes the specified LintSpecRequest message. Does not implicitly {@link google.cloud.apihub.v1.LintSpecRequest.verify|verify} messages. + * @param message LintSpecRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.ILintSpecRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LintSpecRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.LintSpecRequest.verify|verify} messages. + * @param message LintSpecRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.ILintSpecRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LintSpecRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LintSpecRequest + * @throws {Error} If the payload is not 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.apihub.v1.LintSpecRequest; + + /** + * Decodes a LintSpecRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LintSpecRequest + * @throws {Error} If the payload 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.apihub.v1.LintSpecRequest; + + /** + * Verifies a LintSpecRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LintSpecRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LintSpecRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.LintSpecRequest; + + /** + * Creates a plain object from a LintSpecRequest message. Also converts values to other types if specified. + * @param message LintSpecRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.LintSpecRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LintSpecRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LintSpecRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StyleGuideContents. */ + interface IStyleGuideContents { + + /** StyleGuideContents contents */ + contents?: (Uint8Array|string|null); + + /** StyleGuideContents mimeType */ + mimeType?: (string|null); + } + + /** Represents a StyleGuideContents. */ + class StyleGuideContents implements IStyleGuideContents { + + /** + * Constructs a new StyleGuideContents. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IStyleGuideContents); + + /** StyleGuideContents contents. */ + public contents: (Uint8Array|string); + + /** StyleGuideContents mimeType. */ + public mimeType: string; + + /** + * Creates a new StyleGuideContents instance using the specified properties. + * @param [properties] Properties to set + * @returns StyleGuideContents instance + */ + public static create(properties?: google.cloud.apihub.v1.IStyleGuideContents): google.cloud.apihub.v1.StyleGuideContents; + + /** + * Encodes the specified StyleGuideContents message. Does not implicitly {@link google.cloud.apihub.v1.StyleGuideContents.verify|verify} messages. + * @param message StyleGuideContents message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IStyleGuideContents, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StyleGuideContents message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.StyleGuideContents.verify|verify} messages. + * @param message StyleGuideContents message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IStyleGuideContents, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StyleGuideContents message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StyleGuideContents + * @throws {Error} If the payload is not 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.apihub.v1.StyleGuideContents; + + /** + * Decodes a StyleGuideContents message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StyleGuideContents + * @throws {Error} If the payload 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.apihub.v1.StyleGuideContents; + + /** + * Verifies a StyleGuideContents message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StyleGuideContents message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StyleGuideContents + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.StyleGuideContents; + + /** + * Creates a plain object from a StyleGuideContents message. Also converts values to other types if specified. + * @param message StyleGuideContents + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.StyleGuideContents, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StyleGuideContents to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StyleGuideContents + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StyleGuide. */ + interface IStyleGuide { + + /** StyleGuide name */ + name?: (string|null); + + /** StyleGuide linter */ + linter?: (google.cloud.apihub.v1.Linter|keyof typeof google.cloud.apihub.v1.Linter|null); + + /** StyleGuide contents */ + contents?: (google.cloud.apihub.v1.IStyleGuideContents|null); + } + + /** Represents a StyleGuide. */ + class StyleGuide implements IStyleGuide { + + /** + * Constructs a new StyleGuide. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IStyleGuide); + + /** StyleGuide name. */ + public name: string; + + /** StyleGuide linter. */ + public linter: (google.cloud.apihub.v1.Linter|keyof typeof google.cloud.apihub.v1.Linter); + + /** StyleGuide contents. */ + public contents?: (google.cloud.apihub.v1.IStyleGuideContents|null); + + /** + * Creates a new StyleGuide instance using the specified properties. + * @param [properties] Properties to set + * @returns StyleGuide instance + */ + public static create(properties?: google.cloud.apihub.v1.IStyleGuide): google.cloud.apihub.v1.StyleGuide; + + /** + * Encodes the specified StyleGuide message. Does not implicitly {@link google.cloud.apihub.v1.StyleGuide.verify|verify} messages. + * @param message StyleGuide message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IStyleGuide, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StyleGuide message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.StyleGuide.verify|verify} messages. + * @param message StyleGuide message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IStyleGuide, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StyleGuide message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StyleGuide + * @throws {Error} If the payload is not 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.apihub.v1.StyleGuide; + + /** + * Decodes a StyleGuide message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StyleGuide + * @throws {Error} If the payload 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.apihub.v1.StyleGuide; + + /** + * Verifies a StyleGuide message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StyleGuide message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StyleGuide + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.StyleGuide; + + /** + * Creates a plain object from a StyleGuide message. Also converts values to other types if specified. + * @param message StyleGuide + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.StyleGuide, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StyleGuide to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StyleGuide + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents an ApiHubPlugin */ + class ApiHubPlugin extends $protobuf.rpc.Service { + + /** + * Constructs a new ApiHubPlugin 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 ApiHubPlugin 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): ApiHubPlugin; + + /** + * Calls GetPlugin. + * @param request GetPluginRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Plugin + */ + public getPlugin(request: google.cloud.apihub.v1.IGetPluginRequest, callback: google.cloud.apihub.v1.ApiHubPlugin.GetPluginCallback): void; + + /** + * Calls GetPlugin. + * @param request GetPluginRequest message or plain object + * @returns Promise + */ + public getPlugin(request: google.cloud.apihub.v1.IGetPluginRequest): Promise; + + /** + * Calls EnablePlugin. + * @param request EnablePluginRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Plugin + */ + public enablePlugin(request: google.cloud.apihub.v1.IEnablePluginRequest, callback: google.cloud.apihub.v1.ApiHubPlugin.EnablePluginCallback): void; + + /** + * Calls EnablePlugin. + * @param request EnablePluginRequest message or plain object + * @returns Promise + */ + public enablePlugin(request: google.cloud.apihub.v1.IEnablePluginRequest): Promise; + + /** + * Calls DisablePlugin. + * @param request DisablePluginRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Plugin + */ + public disablePlugin(request: google.cloud.apihub.v1.IDisablePluginRequest, callback: google.cloud.apihub.v1.ApiHubPlugin.DisablePluginCallback): void; + + /** + * Calls DisablePlugin. + * @param request DisablePluginRequest message or plain object + * @returns Promise + */ + public disablePlugin(request: google.cloud.apihub.v1.IDisablePluginRequest): Promise; + } + + namespace ApiHubPlugin { + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHubPlugin|getPlugin}. + * @param error Error, if any + * @param [response] Plugin + */ + type GetPluginCallback = (error: (Error|null), response?: google.cloud.apihub.v1.Plugin) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHubPlugin|enablePlugin}. + * @param error Error, if any + * @param [response] Plugin + */ + type EnablePluginCallback = (error: (Error|null), response?: google.cloud.apihub.v1.Plugin) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHubPlugin|disablePlugin}. + * @param error Error, if any + * @param [response] Plugin + */ + type DisablePluginCallback = (error: (Error|null), response?: google.cloud.apihub.v1.Plugin) => void; + } + + /** Properties of a Plugin. */ + interface IPlugin { + + /** Plugin name */ + name?: (string|null); + + /** Plugin displayName */ + displayName?: (string|null); + + /** Plugin type */ + type?: (google.cloud.apihub.v1.IAttributeValues|null); + + /** Plugin description */ + description?: (string|null); + + /** Plugin state */ + state?: (google.cloud.apihub.v1.Plugin.State|keyof typeof google.cloud.apihub.v1.Plugin.State|null); + } + + /** Represents a Plugin. */ + class Plugin implements IPlugin { + + /** + * Constructs a new Plugin. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IPlugin); + + /** Plugin name. */ + public name: string; + + /** Plugin displayName. */ + public displayName: string; + + /** Plugin type. */ + public type?: (google.cloud.apihub.v1.IAttributeValues|null); + + /** Plugin description. */ + public description: string; + + /** Plugin state. */ + public state: (google.cloud.apihub.v1.Plugin.State|keyof typeof google.cloud.apihub.v1.Plugin.State); + + /** + * Creates a new Plugin instance using the specified properties. + * @param [properties] Properties to set + * @returns Plugin instance + */ + public static create(properties?: google.cloud.apihub.v1.IPlugin): google.cloud.apihub.v1.Plugin; + + /** + * Encodes the specified Plugin message. Does not implicitly {@link google.cloud.apihub.v1.Plugin.verify|verify} messages. + * @param message Plugin message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IPlugin, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Plugin message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.Plugin.verify|verify} messages. + * @param message Plugin message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IPlugin, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Plugin message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Plugin + * @throws {Error} If the payload is not 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.apihub.v1.Plugin; + + /** + * Decodes a Plugin message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Plugin + * @throws {Error} If the payload 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.apihub.v1.Plugin; + + /** + * Verifies a Plugin message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Plugin message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Plugin + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.Plugin; + + /** + * Creates a plain object from a Plugin message. Also converts values to other types if specified. + * @param message Plugin + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.Plugin, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Plugin to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Plugin + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Plugin { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + ENABLED = 1, + DISABLED = 2 + } + } + + /** Properties of a GetPluginRequest. */ + interface IGetPluginRequest { + + /** GetPluginRequest name */ + name?: (string|null); + } + + /** Represents a GetPluginRequest. */ + class GetPluginRequest implements IGetPluginRequest { + + /** + * Constructs a new GetPluginRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IGetPluginRequest); + + /** GetPluginRequest name. */ + public name: string; + + /** + * Creates a new GetPluginRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetPluginRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.IGetPluginRequest): google.cloud.apihub.v1.GetPluginRequest; + + /** + * Encodes the specified GetPluginRequest message. Does not implicitly {@link google.cloud.apihub.v1.GetPluginRequest.verify|verify} messages. + * @param message GetPluginRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IGetPluginRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetPluginRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.GetPluginRequest.verify|verify} messages. + * @param message GetPluginRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IGetPluginRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetPluginRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetPluginRequest + * @throws {Error} If the payload is not 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.apihub.v1.GetPluginRequest; + + /** + * Decodes a GetPluginRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetPluginRequest + * @throws {Error} If the payload 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.apihub.v1.GetPluginRequest; + + /** + * Verifies a GetPluginRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetPluginRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetPluginRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.GetPluginRequest; + + /** + * Creates a plain object from a GetPluginRequest message. Also converts values to other types if specified. + * @param message GetPluginRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.GetPluginRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetPluginRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetPluginRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnablePluginRequest. */ + interface IEnablePluginRequest { + + /** EnablePluginRequest name */ + name?: (string|null); + } + + /** Represents an EnablePluginRequest. */ + class EnablePluginRequest implements IEnablePluginRequest { + + /** + * Constructs a new EnablePluginRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IEnablePluginRequest); + + /** EnablePluginRequest name. */ + public name: string; + + /** + * Creates a new EnablePluginRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns EnablePluginRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.IEnablePluginRequest): google.cloud.apihub.v1.EnablePluginRequest; + + /** + * Encodes the specified EnablePluginRequest message. Does not implicitly {@link google.cloud.apihub.v1.EnablePluginRequest.verify|verify} messages. + * @param message EnablePluginRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IEnablePluginRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnablePluginRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.EnablePluginRequest.verify|verify} messages. + * @param message EnablePluginRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IEnablePluginRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnablePluginRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnablePluginRequest + * @throws {Error} If the payload is not 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.apihub.v1.EnablePluginRequest; + + /** + * Decodes an EnablePluginRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnablePluginRequest + * @throws {Error} If the payload 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.apihub.v1.EnablePluginRequest; + + /** + * Verifies an EnablePluginRequest message. + * @param message Plain 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 EnablePluginRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnablePluginRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.EnablePluginRequest; + + /** + * Creates a plain object from an EnablePluginRequest message. Also converts values to other types if specified. + * @param message EnablePluginRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.EnablePluginRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnablePluginRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnablePluginRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DisablePluginRequest. */ + interface IDisablePluginRequest { + + /** DisablePluginRequest name */ + name?: (string|null); + } + + /** Represents a DisablePluginRequest. */ + class DisablePluginRequest implements IDisablePluginRequest { + + /** + * Constructs a new DisablePluginRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IDisablePluginRequest); + + /** DisablePluginRequest name. */ + public name: string; + + /** + * Creates a new DisablePluginRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DisablePluginRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.IDisablePluginRequest): google.cloud.apihub.v1.DisablePluginRequest; + + /** + * Encodes the specified DisablePluginRequest message. Does not implicitly {@link google.cloud.apihub.v1.DisablePluginRequest.verify|verify} messages. + * @param message DisablePluginRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IDisablePluginRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DisablePluginRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.DisablePluginRequest.verify|verify} messages. + * @param message DisablePluginRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IDisablePluginRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DisablePluginRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DisablePluginRequest + * @throws {Error} If the payload is not 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.apihub.v1.DisablePluginRequest; + + /** + * Decodes a DisablePluginRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DisablePluginRequest + * @throws {Error} If the payload 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.apihub.v1.DisablePluginRequest; + + /** + * Verifies a DisablePluginRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DisablePluginRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DisablePluginRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.DisablePluginRequest; + + /** + * Creates a plain object from a DisablePluginRequest message. Also converts values to other types if specified. + * @param message DisablePluginRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.DisablePluginRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DisablePluginRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DisablePluginRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a Provisioning */ + class Provisioning extends $protobuf.rpc.Service { + + /** + * Constructs a new Provisioning 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 Provisioning 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): Provisioning; + + /** + * Calls CreateApiHubInstance. + * @param request CreateApiHubInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createApiHubInstance(request: google.cloud.apihub.v1.ICreateApiHubInstanceRequest, callback: google.cloud.apihub.v1.Provisioning.CreateApiHubInstanceCallback): void; + + /** + * Calls CreateApiHubInstance. + * @param request CreateApiHubInstanceRequest message or plain object + * @returns Promise + */ + public createApiHubInstance(request: google.cloud.apihub.v1.ICreateApiHubInstanceRequest): Promise; + + /** + * Calls GetApiHubInstance. + * @param request GetApiHubInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ApiHubInstance + */ + public getApiHubInstance(request: google.cloud.apihub.v1.IGetApiHubInstanceRequest, callback: google.cloud.apihub.v1.Provisioning.GetApiHubInstanceCallback): void; + + /** + * Calls GetApiHubInstance. + * @param request GetApiHubInstanceRequest message or plain object + * @returns Promise + */ + public getApiHubInstance(request: google.cloud.apihub.v1.IGetApiHubInstanceRequest): Promise; + + /** + * Calls LookupApiHubInstance. + * @param request LookupApiHubInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and LookupApiHubInstanceResponse + */ + public lookupApiHubInstance(request: google.cloud.apihub.v1.ILookupApiHubInstanceRequest, callback: google.cloud.apihub.v1.Provisioning.LookupApiHubInstanceCallback): void; + + /** + * Calls LookupApiHubInstance. + * @param request LookupApiHubInstanceRequest message or plain object + * @returns Promise + */ + public lookupApiHubInstance(request: google.cloud.apihub.v1.ILookupApiHubInstanceRequest): Promise; + } + + namespace Provisioning { + + /** + * Callback as used by {@link google.cloud.apihub.v1.Provisioning|createApiHubInstance}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateApiHubInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.Provisioning|getApiHubInstance}. + * @param error Error, if any + * @param [response] ApiHubInstance + */ + type GetApiHubInstanceCallback = (error: (Error|null), response?: google.cloud.apihub.v1.ApiHubInstance) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.Provisioning|lookupApiHubInstance}. + * @param error Error, if any + * @param [response] LookupApiHubInstanceResponse + */ + type LookupApiHubInstanceCallback = (error: (Error|null), response?: google.cloud.apihub.v1.LookupApiHubInstanceResponse) => void; + } + + /** Properties of a CreateApiHubInstanceRequest. */ + interface ICreateApiHubInstanceRequest { + + /** CreateApiHubInstanceRequest parent */ + parent?: (string|null); + + /** CreateApiHubInstanceRequest apiHubInstanceId */ + apiHubInstanceId?: (string|null); + + /** CreateApiHubInstanceRequest apiHubInstance */ + apiHubInstance?: (google.cloud.apihub.v1.IApiHubInstance|null); + } + + /** Represents a CreateApiHubInstanceRequest. */ + class CreateApiHubInstanceRequest implements ICreateApiHubInstanceRequest { + + /** + * Constructs a new CreateApiHubInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.ICreateApiHubInstanceRequest); + + /** CreateApiHubInstanceRequest parent. */ + public parent: string; + + /** CreateApiHubInstanceRequest apiHubInstanceId. */ + public apiHubInstanceId: string; + + /** CreateApiHubInstanceRequest apiHubInstance. */ + public apiHubInstance?: (google.cloud.apihub.v1.IApiHubInstance|null); + + /** + * Creates a new CreateApiHubInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateApiHubInstanceRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.ICreateApiHubInstanceRequest): google.cloud.apihub.v1.CreateApiHubInstanceRequest; + + /** + * Encodes the specified CreateApiHubInstanceRequest message. Does not implicitly {@link google.cloud.apihub.v1.CreateApiHubInstanceRequest.verify|verify} messages. + * @param message CreateApiHubInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.ICreateApiHubInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateApiHubInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.CreateApiHubInstanceRequest.verify|verify} messages. + * @param message CreateApiHubInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.ICreateApiHubInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateApiHubInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateApiHubInstanceRequest + * @throws {Error} If the payload is not 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.apihub.v1.CreateApiHubInstanceRequest; + + /** + * Decodes a CreateApiHubInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateApiHubInstanceRequest + * @throws {Error} If the payload 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.apihub.v1.CreateApiHubInstanceRequest; + + /** + * Verifies a CreateApiHubInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateApiHubInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateApiHubInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.CreateApiHubInstanceRequest; + + /** + * Creates a plain object from a CreateApiHubInstanceRequest message. Also converts values to other types if specified. + * @param message CreateApiHubInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.CreateApiHubInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateApiHubInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateApiHubInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetApiHubInstanceRequest. */ + interface IGetApiHubInstanceRequest { + + /** GetApiHubInstanceRequest name */ + name?: (string|null); + } + + /** Represents a GetApiHubInstanceRequest. */ + class GetApiHubInstanceRequest implements IGetApiHubInstanceRequest { + + /** + * Constructs a new GetApiHubInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IGetApiHubInstanceRequest); + + /** GetApiHubInstanceRequest name. */ + public name: string; + + /** + * Creates a new GetApiHubInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetApiHubInstanceRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.IGetApiHubInstanceRequest): google.cloud.apihub.v1.GetApiHubInstanceRequest; + + /** + * Encodes the specified GetApiHubInstanceRequest message. Does not implicitly {@link google.cloud.apihub.v1.GetApiHubInstanceRequest.verify|verify} messages. + * @param message GetApiHubInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IGetApiHubInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetApiHubInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.GetApiHubInstanceRequest.verify|verify} messages. + * @param message GetApiHubInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IGetApiHubInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetApiHubInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetApiHubInstanceRequest + * @throws {Error} If the payload is not 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.apihub.v1.GetApiHubInstanceRequest; + + /** + * Decodes a GetApiHubInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetApiHubInstanceRequest + * @throws {Error} If the payload 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.apihub.v1.GetApiHubInstanceRequest; + + /** + * Verifies a GetApiHubInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetApiHubInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetApiHubInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.GetApiHubInstanceRequest; + + /** + * Creates a plain object from a GetApiHubInstanceRequest message. Also converts values to other types if specified. + * @param message GetApiHubInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.GetApiHubInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetApiHubInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetApiHubInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LookupApiHubInstanceRequest. */ + interface ILookupApiHubInstanceRequest { + + /** LookupApiHubInstanceRequest parent */ + parent?: (string|null); + } + + /** Represents a LookupApiHubInstanceRequest. */ + class LookupApiHubInstanceRequest implements ILookupApiHubInstanceRequest { + + /** + * Constructs a new LookupApiHubInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.ILookupApiHubInstanceRequest); + + /** LookupApiHubInstanceRequest parent. */ + public parent: string; + + /** + * Creates a new LookupApiHubInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns LookupApiHubInstanceRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.ILookupApiHubInstanceRequest): google.cloud.apihub.v1.LookupApiHubInstanceRequest; + + /** + * Encodes the specified LookupApiHubInstanceRequest message. Does not implicitly {@link google.cloud.apihub.v1.LookupApiHubInstanceRequest.verify|verify} messages. + * @param message LookupApiHubInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.ILookupApiHubInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LookupApiHubInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.LookupApiHubInstanceRequest.verify|verify} messages. + * @param message LookupApiHubInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.ILookupApiHubInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LookupApiHubInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LookupApiHubInstanceRequest + * @throws {Error} If the payload is not 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.apihub.v1.LookupApiHubInstanceRequest; + + /** + * Decodes a LookupApiHubInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LookupApiHubInstanceRequest + * @throws {Error} If the payload 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.apihub.v1.LookupApiHubInstanceRequest; + + /** + * Verifies a LookupApiHubInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LookupApiHubInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LookupApiHubInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.LookupApiHubInstanceRequest; + + /** + * Creates a plain object from a LookupApiHubInstanceRequest message. Also converts values to other types if specified. + * @param message LookupApiHubInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.LookupApiHubInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LookupApiHubInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LookupApiHubInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LookupApiHubInstanceResponse. */ + interface ILookupApiHubInstanceResponse { + + /** LookupApiHubInstanceResponse apiHubInstance */ + apiHubInstance?: (google.cloud.apihub.v1.IApiHubInstance|null); + } + + /** Represents a LookupApiHubInstanceResponse. */ + class LookupApiHubInstanceResponse implements ILookupApiHubInstanceResponse { + + /** + * Constructs a new LookupApiHubInstanceResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.ILookupApiHubInstanceResponse); + + /** LookupApiHubInstanceResponse apiHubInstance. */ + public apiHubInstance?: (google.cloud.apihub.v1.IApiHubInstance|null); + + /** + * Creates a new LookupApiHubInstanceResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns LookupApiHubInstanceResponse instance + */ + public static create(properties?: google.cloud.apihub.v1.ILookupApiHubInstanceResponse): google.cloud.apihub.v1.LookupApiHubInstanceResponse; + + /** + * Encodes the specified LookupApiHubInstanceResponse message. Does not implicitly {@link google.cloud.apihub.v1.LookupApiHubInstanceResponse.verify|verify} messages. + * @param message LookupApiHubInstanceResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.ILookupApiHubInstanceResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LookupApiHubInstanceResponse message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.LookupApiHubInstanceResponse.verify|verify} messages. + * @param message LookupApiHubInstanceResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.ILookupApiHubInstanceResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LookupApiHubInstanceResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LookupApiHubInstanceResponse + * @throws {Error} If the payload is not 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.apihub.v1.LookupApiHubInstanceResponse; + + /** + * Decodes a LookupApiHubInstanceResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LookupApiHubInstanceResponse + * @throws {Error} If the payload 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.apihub.v1.LookupApiHubInstanceResponse; + + /** + * Verifies a LookupApiHubInstanceResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LookupApiHubInstanceResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LookupApiHubInstanceResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.LookupApiHubInstanceResponse; + + /** + * Creates a plain object from a LookupApiHubInstanceResponse message. Also converts values to other types if specified. + * @param message LookupApiHubInstanceResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.LookupApiHubInstanceResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LookupApiHubInstanceResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LookupApiHubInstanceResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a RuntimeProjectAttachmentService */ + class RuntimeProjectAttachmentService extends $protobuf.rpc.Service { + + /** + * Constructs a new RuntimeProjectAttachmentService 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 RuntimeProjectAttachmentService 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): RuntimeProjectAttachmentService; + + /** + * Calls CreateRuntimeProjectAttachment. + * @param request CreateRuntimeProjectAttachmentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and RuntimeProjectAttachment + */ + public createRuntimeProjectAttachment(request: google.cloud.apihub.v1.ICreateRuntimeProjectAttachmentRequest, callback: google.cloud.apihub.v1.RuntimeProjectAttachmentService.CreateRuntimeProjectAttachmentCallback): void; + + /** + * Calls CreateRuntimeProjectAttachment. + * @param request CreateRuntimeProjectAttachmentRequest message or plain object + * @returns Promise + */ + public createRuntimeProjectAttachment(request: google.cloud.apihub.v1.ICreateRuntimeProjectAttachmentRequest): Promise; + + /** + * Calls GetRuntimeProjectAttachment. + * @param request GetRuntimeProjectAttachmentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and RuntimeProjectAttachment + */ + public getRuntimeProjectAttachment(request: google.cloud.apihub.v1.IGetRuntimeProjectAttachmentRequest, callback: google.cloud.apihub.v1.RuntimeProjectAttachmentService.GetRuntimeProjectAttachmentCallback): void; + + /** + * Calls GetRuntimeProjectAttachment. + * @param request GetRuntimeProjectAttachmentRequest message or plain object + * @returns Promise + */ + public getRuntimeProjectAttachment(request: google.cloud.apihub.v1.IGetRuntimeProjectAttachmentRequest): Promise; + + /** + * Calls ListRuntimeProjectAttachments. + * @param request ListRuntimeProjectAttachmentsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListRuntimeProjectAttachmentsResponse + */ + public listRuntimeProjectAttachments(request: google.cloud.apihub.v1.IListRuntimeProjectAttachmentsRequest, callback: google.cloud.apihub.v1.RuntimeProjectAttachmentService.ListRuntimeProjectAttachmentsCallback): void; + + /** + * Calls ListRuntimeProjectAttachments. + * @param request ListRuntimeProjectAttachmentsRequest message or plain object + * @returns Promise + */ + public listRuntimeProjectAttachments(request: google.cloud.apihub.v1.IListRuntimeProjectAttachmentsRequest): Promise; + + /** + * Calls DeleteRuntimeProjectAttachment. + * @param request DeleteRuntimeProjectAttachmentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteRuntimeProjectAttachment(request: google.cloud.apihub.v1.IDeleteRuntimeProjectAttachmentRequest, callback: google.cloud.apihub.v1.RuntimeProjectAttachmentService.DeleteRuntimeProjectAttachmentCallback): void; + + /** + * Calls DeleteRuntimeProjectAttachment. + * @param request DeleteRuntimeProjectAttachmentRequest message or plain object + * @returns Promise + */ + public deleteRuntimeProjectAttachment(request: google.cloud.apihub.v1.IDeleteRuntimeProjectAttachmentRequest): Promise; + + /** + * Calls LookupRuntimeProjectAttachment. + * @param request LookupRuntimeProjectAttachmentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and LookupRuntimeProjectAttachmentResponse + */ + public lookupRuntimeProjectAttachment(request: google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentRequest, callback: google.cloud.apihub.v1.RuntimeProjectAttachmentService.LookupRuntimeProjectAttachmentCallback): void; + + /** + * Calls LookupRuntimeProjectAttachment. + * @param request LookupRuntimeProjectAttachmentRequest message or plain object + * @returns Promise + */ + public lookupRuntimeProjectAttachment(request: google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentRequest): Promise; + } + + namespace RuntimeProjectAttachmentService { + + /** + * Callback as used by {@link google.cloud.apihub.v1.RuntimeProjectAttachmentService|createRuntimeProjectAttachment}. + * @param error Error, if any + * @param [response] RuntimeProjectAttachment + */ + type CreateRuntimeProjectAttachmentCallback = (error: (Error|null), response?: google.cloud.apihub.v1.RuntimeProjectAttachment) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.RuntimeProjectAttachmentService|getRuntimeProjectAttachment}. + * @param error Error, if any + * @param [response] RuntimeProjectAttachment + */ + type GetRuntimeProjectAttachmentCallback = (error: (Error|null), response?: google.cloud.apihub.v1.RuntimeProjectAttachment) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.RuntimeProjectAttachmentService|listRuntimeProjectAttachments}. + * @param error Error, if any + * @param [response] ListRuntimeProjectAttachmentsResponse + */ + type ListRuntimeProjectAttachmentsCallback = (error: (Error|null), response?: google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.RuntimeProjectAttachmentService|deleteRuntimeProjectAttachment}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteRuntimeProjectAttachmentCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.RuntimeProjectAttachmentService|lookupRuntimeProjectAttachment}. + * @param error Error, if any + * @param [response] LookupRuntimeProjectAttachmentResponse + */ + type LookupRuntimeProjectAttachmentCallback = (error: (Error|null), response?: google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse) => void; + } + + /** Properties of a CreateRuntimeProjectAttachmentRequest. */ + interface ICreateRuntimeProjectAttachmentRequest { + + /** CreateRuntimeProjectAttachmentRequest parent */ + parent?: (string|null); + + /** CreateRuntimeProjectAttachmentRequest runtimeProjectAttachmentId */ + runtimeProjectAttachmentId?: (string|null); + + /** CreateRuntimeProjectAttachmentRequest runtimeProjectAttachment */ + runtimeProjectAttachment?: (google.cloud.apihub.v1.IRuntimeProjectAttachment|null); + } + + /** Represents a CreateRuntimeProjectAttachmentRequest. */ + class CreateRuntimeProjectAttachmentRequest implements ICreateRuntimeProjectAttachmentRequest { + + /** + * Constructs a new CreateRuntimeProjectAttachmentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.ICreateRuntimeProjectAttachmentRequest); + + /** CreateRuntimeProjectAttachmentRequest parent. */ + public parent: string; + + /** CreateRuntimeProjectAttachmentRequest runtimeProjectAttachmentId. */ + public runtimeProjectAttachmentId: string; + + /** CreateRuntimeProjectAttachmentRequest runtimeProjectAttachment. */ + public runtimeProjectAttachment?: (google.cloud.apihub.v1.IRuntimeProjectAttachment|null); + + /** + * Creates a new CreateRuntimeProjectAttachmentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateRuntimeProjectAttachmentRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.ICreateRuntimeProjectAttachmentRequest): google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest; + + /** + * Encodes the specified CreateRuntimeProjectAttachmentRequest message. Does not implicitly {@link google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest.verify|verify} messages. + * @param message CreateRuntimeProjectAttachmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.ICreateRuntimeProjectAttachmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateRuntimeProjectAttachmentRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest.verify|verify} messages. + * @param message CreateRuntimeProjectAttachmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.ICreateRuntimeProjectAttachmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateRuntimeProjectAttachmentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateRuntimeProjectAttachmentRequest + * @throws {Error} If the payload is not 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.apihub.v1.CreateRuntimeProjectAttachmentRequest; + + /** + * Decodes a CreateRuntimeProjectAttachmentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateRuntimeProjectAttachmentRequest + * @throws {Error} If the payload 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.apihub.v1.CreateRuntimeProjectAttachmentRequest; + + /** + * Verifies a CreateRuntimeProjectAttachmentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateRuntimeProjectAttachmentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateRuntimeProjectAttachmentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest; + + /** + * Creates a plain object from a CreateRuntimeProjectAttachmentRequest message. Also converts values to other types if specified. + * @param message CreateRuntimeProjectAttachmentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateRuntimeProjectAttachmentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateRuntimeProjectAttachmentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetRuntimeProjectAttachmentRequest. */ + interface IGetRuntimeProjectAttachmentRequest { + + /** GetRuntimeProjectAttachmentRequest name */ + name?: (string|null); + } + + /** Represents a GetRuntimeProjectAttachmentRequest. */ + class GetRuntimeProjectAttachmentRequest implements IGetRuntimeProjectAttachmentRequest { + + /** + * Constructs a new GetRuntimeProjectAttachmentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IGetRuntimeProjectAttachmentRequest); + + /** GetRuntimeProjectAttachmentRequest name. */ + public name: string; + + /** + * Creates a new GetRuntimeProjectAttachmentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetRuntimeProjectAttachmentRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.IGetRuntimeProjectAttachmentRequest): google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest; + + /** + * Encodes the specified GetRuntimeProjectAttachmentRequest message. Does not implicitly {@link google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest.verify|verify} messages. + * @param message GetRuntimeProjectAttachmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IGetRuntimeProjectAttachmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetRuntimeProjectAttachmentRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest.verify|verify} messages. + * @param message GetRuntimeProjectAttachmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IGetRuntimeProjectAttachmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetRuntimeProjectAttachmentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetRuntimeProjectAttachmentRequest + * @throws {Error} If the payload is not 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.apihub.v1.GetRuntimeProjectAttachmentRequest; + + /** + * Decodes a GetRuntimeProjectAttachmentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetRuntimeProjectAttachmentRequest + * @throws {Error} If the payload 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.apihub.v1.GetRuntimeProjectAttachmentRequest; + + /** + * Verifies a GetRuntimeProjectAttachmentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetRuntimeProjectAttachmentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetRuntimeProjectAttachmentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest; + + /** + * Creates a plain object from a GetRuntimeProjectAttachmentRequest message. Also converts values to other types if specified. + * @param message GetRuntimeProjectAttachmentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetRuntimeProjectAttachmentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetRuntimeProjectAttachmentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListRuntimeProjectAttachmentsRequest. */ + interface IListRuntimeProjectAttachmentsRequest { + + /** ListRuntimeProjectAttachmentsRequest parent */ + parent?: (string|null); + + /** ListRuntimeProjectAttachmentsRequest pageSize */ + pageSize?: (number|null); + + /** ListRuntimeProjectAttachmentsRequest pageToken */ + pageToken?: (string|null); + + /** ListRuntimeProjectAttachmentsRequest filter */ + filter?: (string|null); + + /** ListRuntimeProjectAttachmentsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListRuntimeProjectAttachmentsRequest. */ + class ListRuntimeProjectAttachmentsRequest implements IListRuntimeProjectAttachmentsRequest { + + /** + * Constructs a new ListRuntimeProjectAttachmentsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IListRuntimeProjectAttachmentsRequest); + + /** ListRuntimeProjectAttachmentsRequest parent. */ + public parent: string; + + /** ListRuntimeProjectAttachmentsRequest pageSize. */ + public pageSize: number; + + /** ListRuntimeProjectAttachmentsRequest pageToken. */ + public pageToken: string; + + /** ListRuntimeProjectAttachmentsRequest filter. */ + public filter: string; + + /** ListRuntimeProjectAttachmentsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListRuntimeProjectAttachmentsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListRuntimeProjectAttachmentsRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.IListRuntimeProjectAttachmentsRequest): google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest; + + /** + * Encodes the specified ListRuntimeProjectAttachmentsRequest message. Does not implicitly {@link google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest.verify|verify} messages. + * @param message ListRuntimeProjectAttachmentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IListRuntimeProjectAttachmentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListRuntimeProjectAttachmentsRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest.verify|verify} messages. + * @param message ListRuntimeProjectAttachmentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IListRuntimeProjectAttachmentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListRuntimeProjectAttachmentsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListRuntimeProjectAttachmentsRequest + * @throws {Error} If the payload is not 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.apihub.v1.ListRuntimeProjectAttachmentsRequest; + + /** + * Decodes a ListRuntimeProjectAttachmentsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListRuntimeProjectAttachmentsRequest + * @throws {Error} If the payload 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.apihub.v1.ListRuntimeProjectAttachmentsRequest; + + /** + * Verifies a ListRuntimeProjectAttachmentsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListRuntimeProjectAttachmentsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListRuntimeProjectAttachmentsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest; + + /** + * Creates a plain object from a ListRuntimeProjectAttachmentsRequest message. Also converts values to other types if specified. + * @param message ListRuntimeProjectAttachmentsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListRuntimeProjectAttachmentsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListRuntimeProjectAttachmentsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListRuntimeProjectAttachmentsResponse. */ + interface IListRuntimeProjectAttachmentsResponse { + + /** ListRuntimeProjectAttachmentsResponse runtimeProjectAttachments */ + runtimeProjectAttachments?: (google.cloud.apihub.v1.IRuntimeProjectAttachment[]|null); + + /** ListRuntimeProjectAttachmentsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListRuntimeProjectAttachmentsResponse. */ + class ListRuntimeProjectAttachmentsResponse implements IListRuntimeProjectAttachmentsResponse { + + /** + * Constructs a new ListRuntimeProjectAttachmentsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IListRuntimeProjectAttachmentsResponse); + + /** ListRuntimeProjectAttachmentsResponse runtimeProjectAttachments. */ + public runtimeProjectAttachments: google.cloud.apihub.v1.IRuntimeProjectAttachment[]; + + /** ListRuntimeProjectAttachmentsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListRuntimeProjectAttachmentsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListRuntimeProjectAttachmentsResponse instance + */ + public static create(properties?: google.cloud.apihub.v1.IListRuntimeProjectAttachmentsResponse): google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse; + + /** + * Encodes the specified ListRuntimeProjectAttachmentsResponse message. Does not implicitly {@link google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse.verify|verify} messages. + * @param message ListRuntimeProjectAttachmentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IListRuntimeProjectAttachmentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListRuntimeProjectAttachmentsResponse message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse.verify|verify} messages. + * @param message ListRuntimeProjectAttachmentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IListRuntimeProjectAttachmentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListRuntimeProjectAttachmentsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListRuntimeProjectAttachmentsResponse + * @throws {Error} If the payload is not 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.apihub.v1.ListRuntimeProjectAttachmentsResponse; + + /** + * Decodes a ListRuntimeProjectAttachmentsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListRuntimeProjectAttachmentsResponse + * @throws {Error} If the payload 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.apihub.v1.ListRuntimeProjectAttachmentsResponse; + + /** + * Verifies a ListRuntimeProjectAttachmentsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListRuntimeProjectAttachmentsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListRuntimeProjectAttachmentsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse; + + /** + * Creates a plain object from a ListRuntimeProjectAttachmentsResponse message. Also converts values to other types if specified. + * @param message ListRuntimeProjectAttachmentsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListRuntimeProjectAttachmentsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListRuntimeProjectAttachmentsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteRuntimeProjectAttachmentRequest. */ + interface IDeleteRuntimeProjectAttachmentRequest { + + /** DeleteRuntimeProjectAttachmentRequest name */ + name?: (string|null); + } + + /** Represents a DeleteRuntimeProjectAttachmentRequest. */ + class DeleteRuntimeProjectAttachmentRequest implements IDeleteRuntimeProjectAttachmentRequest { + + /** + * Constructs a new DeleteRuntimeProjectAttachmentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IDeleteRuntimeProjectAttachmentRequest); + + /** DeleteRuntimeProjectAttachmentRequest name. */ + public name: string; + + /** + * Creates a new DeleteRuntimeProjectAttachmentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteRuntimeProjectAttachmentRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.IDeleteRuntimeProjectAttachmentRequest): google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest; + + /** + * Encodes the specified DeleteRuntimeProjectAttachmentRequest message. Does not implicitly {@link google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest.verify|verify} messages. + * @param message DeleteRuntimeProjectAttachmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IDeleteRuntimeProjectAttachmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteRuntimeProjectAttachmentRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest.verify|verify} messages. + * @param message DeleteRuntimeProjectAttachmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IDeleteRuntimeProjectAttachmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteRuntimeProjectAttachmentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteRuntimeProjectAttachmentRequest + * @throws {Error} If the payload is not 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.apihub.v1.DeleteRuntimeProjectAttachmentRequest; + + /** + * Decodes a DeleteRuntimeProjectAttachmentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteRuntimeProjectAttachmentRequest + * @throws {Error} If the payload 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.apihub.v1.DeleteRuntimeProjectAttachmentRequest; + + /** + * Verifies a DeleteRuntimeProjectAttachmentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteRuntimeProjectAttachmentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteRuntimeProjectAttachmentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest; + + /** + * Creates a plain object from a DeleteRuntimeProjectAttachmentRequest message. Also converts values to other types if specified. + * @param message DeleteRuntimeProjectAttachmentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteRuntimeProjectAttachmentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteRuntimeProjectAttachmentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LookupRuntimeProjectAttachmentRequest. */ + interface ILookupRuntimeProjectAttachmentRequest { + + /** LookupRuntimeProjectAttachmentRequest name */ + name?: (string|null); + } + + /** Represents a LookupRuntimeProjectAttachmentRequest. */ + class LookupRuntimeProjectAttachmentRequest implements ILookupRuntimeProjectAttachmentRequest { + + /** + * Constructs a new LookupRuntimeProjectAttachmentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentRequest); + + /** LookupRuntimeProjectAttachmentRequest name. */ + public name: string; + + /** + * Creates a new LookupRuntimeProjectAttachmentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns LookupRuntimeProjectAttachmentRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentRequest): google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest; + + /** + * Encodes the specified LookupRuntimeProjectAttachmentRequest message. Does not implicitly {@link google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest.verify|verify} messages. + * @param message LookupRuntimeProjectAttachmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LookupRuntimeProjectAttachmentRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest.verify|verify} messages. + * @param message LookupRuntimeProjectAttachmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LookupRuntimeProjectAttachmentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LookupRuntimeProjectAttachmentRequest + * @throws {Error} If the payload is not 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.apihub.v1.LookupRuntimeProjectAttachmentRequest; + + /** + * Decodes a LookupRuntimeProjectAttachmentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LookupRuntimeProjectAttachmentRequest + * @throws {Error} If the payload 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.apihub.v1.LookupRuntimeProjectAttachmentRequest; + + /** + * Verifies a LookupRuntimeProjectAttachmentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LookupRuntimeProjectAttachmentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LookupRuntimeProjectAttachmentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest; + + /** + * Creates a plain object from a LookupRuntimeProjectAttachmentRequest message. Also converts values to other types if specified. + * @param message LookupRuntimeProjectAttachmentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LookupRuntimeProjectAttachmentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LookupRuntimeProjectAttachmentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LookupRuntimeProjectAttachmentResponse. */ + interface ILookupRuntimeProjectAttachmentResponse { + + /** LookupRuntimeProjectAttachmentResponse runtimeProjectAttachment */ + runtimeProjectAttachment?: (google.cloud.apihub.v1.IRuntimeProjectAttachment|null); + } + + /** Represents a LookupRuntimeProjectAttachmentResponse. */ + class LookupRuntimeProjectAttachmentResponse implements ILookupRuntimeProjectAttachmentResponse { + + /** + * Constructs a new LookupRuntimeProjectAttachmentResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentResponse); + + /** LookupRuntimeProjectAttachmentResponse runtimeProjectAttachment. */ + public runtimeProjectAttachment?: (google.cloud.apihub.v1.IRuntimeProjectAttachment|null); + + /** + * Creates a new LookupRuntimeProjectAttachmentResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns LookupRuntimeProjectAttachmentResponse instance + */ + public static create(properties?: google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentResponse): google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse; + + /** + * Encodes the specified LookupRuntimeProjectAttachmentResponse message. Does not implicitly {@link google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse.verify|verify} messages. + * @param message LookupRuntimeProjectAttachmentResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LookupRuntimeProjectAttachmentResponse message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse.verify|verify} messages. + * @param message LookupRuntimeProjectAttachmentResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LookupRuntimeProjectAttachmentResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LookupRuntimeProjectAttachmentResponse + * @throws {Error} If the payload is not 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.apihub.v1.LookupRuntimeProjectAttachmentResponse; + + /** + * Decodes a LookupRuntimeProjectAttachmentResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LookupRuntimeProjectAttachmentResponse + * @throws {Error} If the payload 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.apihub.v1.LookupRuntimeProjectAttachmentResponse; + + /** + * Verifies a LookupRuntimeProjectAttachmentResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LookupRuntimeProjectAttachmentResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LookupRuntimeProjectAttachmentResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse; + + /** + * Creates a plain object from a LookupRuntimeProjectAttachmentResponse message. Also converts values to other types if specified. + * @param message LookupRuntimeProjectAttachmentResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LookupRuntimeProjectAttachmentResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LookupRuntimeProjectAttachmentResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RuntimeProjectAttachment. */ + interface IRuntimeProjectAttachment { + + /** RuntimeProjectAttachment name */ + name?: (string|null); + + /** RuntimeProjectAttachment runtimeProject */ + runtimeProject?: (string|null); + + /** RuntimeProjectAttachment createTime */ + createTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a RuntimeProjectAttachment. */ + class RuntimeProjectAttachment implements IRuntimeProjectAttachment { + + /** + * Constructs a new RuntimeProjectAttachment. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IRuntimeProjectAttachment); + + /** RuntimeProjectAttachment name. */ + public name: string; + + /** RuntimeProjectAttachment runtimeProject. */ + public runtimeProject: string; + + /** RuntimeProjectAttachment createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new RuntimeProjectAttachment instance using the specified properties. + * @param [properties] Properties to set + * @returns RuntimeProjectAttachment instance + */ + public static create(properties?: google.cloud.apihub.v1.IRuntimeProjectAttachment): google.cloud.apihub.v1.RuntimeProjectAttachment; + + /** + * Encodes the specified RuntimeProjectAttachment message. Does not implicitly {@link google.cloud.apihub.v1.RuntimeProjectAttachment.verify|verify} messages. + * @param message RuntimeProjectAttachment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IRuntimeProjectAttachment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RuntimeProjectAttachment message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.RuntimeProjectAttachment.verify|verify} messages. + * @param message RuntimeProjectAttachment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IRuntimeProjectAttachment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RuntimeProjectAttachment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RuntimeProjectAttachment + * @throws {Error} If the payload is not 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.apihub.v1.RuntimeProjectAttachment; + + /** + * Decodes a RuntimeProjectAttachment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RuntimeProjectAttachment + * @throws {Error} If the payload 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.apihub.v1.RuntimeProjectAttachment; + + /** + * Verifies a RuntimeProjectAttachment message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RuntimeProjectAttachment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RuntimeProjectAttachment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.RuntimeProjectAttachment; + + /** + * Creates a plain object from a RuntimeProjectAttachment message. Also converts values to other types if specified. + * @param message RuntimeProjectAttachment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.RuntimeProjectAttachment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RuntimeProjectAttachment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RuntimeProjectAttachment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + } + + /** Namespace api. */ + namespace api { + + /** Properties of a Http. */ + interface IHttp { + + /** Http rules */ + rules?: (google.api.IHttpRule[]|null); + + /** Http fullyDecodeReservedExpansion */ + fullyDecodeReservedExpansion?: (boolean|null); + } + + /** Represents a Http. */ + class Http implements IHttp { + + /** + * Constructs a new Http. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttp); + + /** Http rules. */ + public rules: google.api.IHttpRule[]; + + /** Http fullyDecodeReservedExpansion. */ + public fullyDecodeReservedExpansion: boolean; + + /** + * Creates a new Http instance using the specified properties. + * @param [properties] Properties to set + * @returns Http instance + */ + public static create(properties?: google.api.IHttp): google.api.Http; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Http message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Http; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Http; + + /** + * Verifies a Http message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Http + */ + public static fromObject(object: { [k: string]: any }): google.api.Http; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @param message Http + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Http, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Http to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * 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); + + /** Publishing protoReferenceDocumentationUri */ + protoReferenceDocumentationUri?: (string|null); + + /** Publishing restReferenceDocumentationUri */ + restReferenceDocumentationUri?: (string|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[]; + + /** Publishing protoReferenceDocumentationUri. */ + public protoReferenceDocumentationUri: string; + + /** Publishing restReferenceDocumentationUri. */ + public restReferenceDocumentationUri: string; + + /** + * 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); + + /** DotnetSettings renamedServices */ + renamedServices?: ({ [k: string]: string }|null); + + /** DotnetSettings renamedResources */ + renamedResources?: ({ [k: string]: string }|null); + + /** DotnetSettings ignoredResources */ + ignoredResources?: (string[]|null); + + /** DotnetSettings forcedNamespaceAliases */ + forcedNamespaceAliases?: (string[]|null); + + /** DotnetSettings handwrittenSignatures */ + handwrittenSignatures?: (string[]|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); + + /** DotnetSettings renamedServices. */ + public renamedServices: { [k: string]: string }; + + /** DotnetSettings renamedResources. */ + public renamedResources: { [k: string]: string }; + + /** DotnetSettings ignoredResources. */ + public ignoredResources: string[]; + + /** DotnetSettings forcedNamespaceAliases. */ + public forcedNamespaceAliases: string[]; + + /** DotnetSettings handwrittenSignatures. */ + public handwrittenSignatures: string[]; + + /** + * 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); + + /** MethodSettings autoPopulatedFields */ + autoPopulatedFields?: (string[]|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); + + /** MethodSettings autoPopulatedFields. */ + public autoPopulatedFields: string[]; + + /** + * 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, + SHOPPING = 5, + GEO = 6, + GENERATIVE_AI = 7 + } + + /** 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 + } + + /** 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, + IDENTIFIER = 8 + } + + /** 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; + } + } + + /** 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; + } + + /** Edition enum. */ + enum Edition { + EDITION_UNKNOWN = 0, + EDITION_PROTO2 = 998, + EDITION_PROTO3 = 999, + EDITION_2023 = 1000, + EDITION_2024 = 1001, + EDITION_1_TEST_ONLY = 1, + EDITION_2_TEST_ONLY = 2, + EDITION_99997_TEST_ONLY = 99997, + EDITION_99998_TEST_ONLY = 99998, + EDITION_99999_TEST_ONLY = 99999, + EDITION_MAX = 2147483647 + } + + /** 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?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|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: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** + * 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); + + /** ExtensionRangeOptions declaration */ + declaration?: (google.protobuf.ExtensionRangeOptions.IDeclaration[]|null); + + /** ExtensionRangeOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** ExtensionRangeOptions verification */ + verification?: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState|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[]; + + /** ExtensionRangeOptions declaration. */ + public declaration: google.protobuf.ExtensionRangeOptions.IDeclaration[]; + + /** ExtensionRangeOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** ExtensionRangeOptions verification. */ + public verification: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState); + + /** + * 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; + } + + namespace ExtensionRangeOptions { + + /** Properties of a Declaration. */ + interface IDeclaration { + + /** Declaration number */ + number?: (number|null); + + /** Declaration fullName */ + fullName?: (string|null); + + /** Declaration type */ + type?: (string|null); + + /** Declaration reserved */ + reserved?: (boolean|null); + + /** Declaration repeated */ + repeated?: (boolean|null); + } + + /** Represents a Declaration. */ + class Declaration implements IDeclaration { + + /** + * Constructs a new Declaration. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration); + + /** Declaration number. */ + public number: number; + + /** Declaration fullName. */ + public fullName: string; + + /** Declaration type. */ + public type: string; + + /** Declaration reserved. */ + public reserved: boolean; + + /** Declaration repeated. */ + public repeated: boolean; + + /** + * Creates a new Declaration instance using the specified properties. + * @param [properties] Properties to set + * @returns Declaration instance + */ + public static create(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @param message Declaration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @param message Declaration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Declaration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Declaration + * @throws {Error} If the payload is not 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.Declaration; + + /** + * Decodes a Declaration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Declaration + * @throws {Error} If the payload 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.Declaration; + + /** + * Verifies a Declaration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Declaration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Declaration + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Creates a plain object from a Declaration message. Also converts values to other types if specified. + * @param message Declaration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ExtensionRangeOptions.Declaration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Declaration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Declaration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** VerificationState enum. */ + enum VerificationState { + DECLARATION = 0, + UNVERIFIED = 1 + } + } + + /** 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_REPEATED = 3, + LABEL_REQUIRED = 2 + } + } + + /** 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 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 features */ + features?: (google.protobuf.IFeatureSet|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 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 features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** 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 features */ + features?: (google.protobuf.IFeatureSet|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 features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** 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 targets */ + targets?: (google.protobuf.FieldOptions.OptionTargetType[]|null); + + /** FieldOptions editionDefaults */ + editionDefaults?: (google.protobuf.FieldOptions.IEditionDefault[]|null); + + /** FieldOptions features */ + features?: (google.protobuf.IFeatureSet|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 targets. */ + public targets: google.protobuf.FieldOptions.OptionTargetType[]; + + /** FieldOptions editionDefaults. */ + public editionDefaults: google.protobuf.FieldOptions.IEditionDefault[]; + + /** FieldOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** 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 EditionDefault. */ + interface IEditionDefault { + + /** EditionDefault edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** EditionDefault value */ + value?: (string|null); + } + + /** Represents an EditionDefault. */ + class EditionDefault implements IEditionDefault { + + /** + * Constructs a new EditionDefault. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FieldOptions.IEditionDefault); + + /** EditionDefault edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** EditionDefault value. */ + public value: string; + + /** + * Creates a new EditionDefault instance using the specified properties. + * @param [properties] Properties to set + * @returns EditionDefault instance + */ + public static create(properties?: google.protobuf.FieldOptions.IEditionDefault): google.protobuf.FieldOptions.EditionDefault; + + /** + * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @param message EditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @param message EditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EditionDefault message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EditionDefault + * @throws {Error} If the payload is not 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.EditionDefault; + + /** + * Decodes an EditionDefault message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EditionDefault + * @throws {Error} If the payload 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.EditionDefault; + + /** + * Verifies an EditionDefault message. + * @param message Plain 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 EditionDefault message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EditionDefault + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions.EditionDefault; + + /** + * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. + * @param message EditionDefault + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions.EditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EditionDefault to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EditionDefault + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an OneofOptions. */ + interface IOneofOptions { + + /** OneofOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** 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 features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** 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 features */ + features?: (google.protobuf.IFeatureSet|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 features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** 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 features */ + features?: (google.protobuf.IFeatureSet|null); + + /** EnumValueOptions debugRedact */ + debugRedact?: (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 features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** EnumValueOptions debugRedact. */ + public debugRedact: 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 features */ + features?: (google.protobuf.IFeatureSet|null); + + /** 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); + + /** ServiceOptions .google.api.apiVersion */ + ".google.api.apiVersion"?: (string|null); + } + + /** Represents a ServiceOptions. */ + class ServiceOptions implements IServiceOptions { + + /** + * Constructs a new ServiceOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceOptions); + + /** ServiceOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** 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 features */ + features?: (google.protobuf.IFeatureSet|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 features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** 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 FeatureSet. */ + interface IFeatureSet { + + /** FeatureSet fieldPresence */ + fieldPresence?: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence|null); + + /** FeatureSet enumType */ + enumType?: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType|null); + + /** FeatureSet repeatedFieldEncoding */ + repeatedFieldEncoding?: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding|null); + + /** FeatureSet utf8Validation */ + utf8Validation?: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation|null); + + /** FeatureSet messageEncoding */ + messageEncoding?: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding|null); + + /** FeatureSet jsonFormat */ + jsonFormat?: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat|null); + } + + /** Represents a FeatureSet. */ + class FeatureSet implements IFeatureSet { + + /** + * Constructs a new FeatureSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFeatureSet); + + /** FeatureSet fieldPresence. */ + public fieldPresence: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence); + + /** FeatureSet enumType. */ + public enumType: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType); + + /** FeatureSet repeatedFieldEncoding. */ + public repeatedFieldEncoding: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding); + + /** FeatureSet utf8Validation. */ + public utf8Validation: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation); + + /** FeatureSet messageEncoding. */ + public messageEncoding: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding); + + /** FeatureSet jsonFormat. */ + public jsonFormat: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat); + + /** + * Creates a new FeatureSet instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSet instance + */ + public static create(properties?: google.protobuf.IFeatureSet): google.protobuf.FeatureSet; + + /** + * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @param message FeatureSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @param message FeatureSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSet + * @throws {Error} If the payload is not 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.FeatureSet; + + /** + * Decodes a FeatureSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSet + * @throws {Error} If the payload 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.FeatureSet; + + /** + * Verifies a FeatureSet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSet + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSet; + + /** + * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. + * @param message FeatureSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FeatureSet { + + /** FieldPresence enum. */ + enum FieldPresence { + FIELD_PRESENCE_UNKNOWN = 0, + EXPLICIT = 1, + IMPLICIT = 2, + LEGACY_REQUIRED = 3 + } + + /** EnumType enum. */ + enum EnumType { + ENUM_TYPE_UNKNOWN = 0, + OPEN = 1, + CLOSED = 2 + } + + /** RepeatedFieldEncoding enum. */ + enum RepeatedFieldEncoding { + REPEATED_FIELD_ENCODING_UNKNOWN = 0, + PACKED = 1, + EXPANDED = 2 + } + + /** Utf8Validation enum. */ + enum Utf8Validation { + UTF8_VALIDATION_UNKNOWN = 0, + VERIFY = 2, + NONE = 3 + } + + /** MessageEncoding enum. */ + enum MessageEncoding { + MESSAGE_ENCODING_UNKNOWN = 0, + LENGTH_PREFIXED = 1, + DELIMITED = 2 + } + + /** JsonFormat enum. */ + enum JsonFormat { + JSON_FORMAT_UNKNOWN = 0, + ALLOW = 1, + LEGACY_BEST_EFFORT = 2 + } + } + + /** Properties of a FeatureSetDefaults. */ + interface IFeatureSetDefaults { + + /** FeatureSetDefaults defaults */ + defaults?: (google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]|null); + + /** FeatureSetDefaults minimumEdition */ + minimumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSetDefaults maximumEdition */ + maximumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + } + + /** Represents a FeatureSetDefaults. */ + class FeatureSetDefaults implements IFeatureSetDefaults { + + /** + * Constructs a new FeatureSetDefaults. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFeatureSetDefaults); + + /** FeatureSetDefaults defaults. */ + public defaults: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]; + + /** FeatureSetDefaults minimumEdition. */ + public minimumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSetDefaults maximumEdition. */ + public maximumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** + * Creates a new FeatureSetDefaults instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSetDefaults instance + */ + public static create(properties?: google.protobuf.IFeatureSetDefaults): google.protobuf.FeatureSetDefaults; + + /** + * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @param message FeatureSetDefaults message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @param message FeatureSetDefaults message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSetDefaults + * @throws {Error} If the payload is not 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.FeatureSetDefaults; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSetDefaults + * @throws {Error} If the payload 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.FeatureSetDefaults; + + /** + * Verifies a FeatureSetDefaults message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSetDefaults + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults; + + /** + * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. + * @param message FeatureSetDefaults + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSetDefaults, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSetDefaults to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSetDefaults + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FeatureSetDefaults { + + /** Properties of a FeatureSetEditionDefault. */ + interface IFeatureSetEditionDefault { + + /** FeatureSetEditionDefault edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSetEditionDefault features */ + features?: (google.protobuf.IFeatureSet|null); + } + + /** Represents a FeatureSetEditionDefault. */ + class FeatureSetEditionDefault implements IFeatureSetEditionDefault { + + /** + * Constructs a new FeatureSetEditionDefault. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault); + + /** FeatureSetEditionDefault edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSetEditionDefault features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** + * Creates a new FeatureSetEditionDefault instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSetEditionDefault instance + */ + public static create(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @param message FeatureSetEditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @param message FeatureSetEditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSetEditionDefault + * @throws {Error} If the payload is not 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.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSetEditionDefault + * @throws {Error} If the payload 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.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Verifies a FeatureSetEditionDefault message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSetEditionDefault + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. + * @param message FeatureSetEditionDefault + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSetEditionDefault to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSetEditionDefault + * @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 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 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 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; + } + + /** 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 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; + } + } + + /** 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/owl-bot-staging/google-cloud-apihub/v1/protos/protos.js b/owl-bot-staging/google-cloud-apihub/v1/protos/protos.js new file mode 100644 index 00000000000..dafb3c6f8b2 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/protos/protos.js @@ -0,0 +1,53441 @@ +// Copyright 2024 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_apihub_protos || ($protobuf.roots._google_cloud_apihub_protos = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.cloud = (function() { + + /** + * Namespace cloud. + * @memberof google + * @namespace + */ + var cloud = {}; + + cloud.apihub = (function() { + + /** + * Namespace apihub. + * @memberof google.cloud + * @namespace + */ + var apihub = {}; + + apihub.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.cloud.apihub + * @namespace + */ + var v1 = {}; + + v1.ApiHub = (function() { + + /** + * Constructs a new ApiHub service. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents an ApiHub + * @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 ApiHub(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (ApiHub.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = ApiHub; + + /** + * Creates new ApiHub service using the specified rpc implementation. + * @function create + * @memberof google.cloud.apihub.v1.ApiHub + * @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 {ApiHub} RPC service. Useful where requests and/or responses are streamed. + */ + ApiHub.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|createApi}. + * @memberof google.cloud.apihub.v1.ApiHub + * @typedef CreateApiCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apihub.v1.Api} [response] Api + */ + + /** + * Calls CreateApi. + * @function createApi + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.ICreateApiRequest} request CreateApiRequest message or plain object + * @param {google.cloud.apihub.v1.ApiHub.CreateApiCallback} callback Node-style callback called with the error, if any, and Api + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ApiHub.prototype.createApi = function createApi(request, callback) { + return this.rpcCall(createApi, $root.google.cloud.apihub.v1.CreateApiRequest, $root.google.cloud.apihub.v1.Api, request, callback); + }, "name", { value: "CreateApi" }); + + /** + * Calls CreateApi. + * @function createApi + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.ICreateApiRequest} request CreateApiRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|getApi}. + * @memberof google.cloud.apihub.v1.ApiHub + * @typedef GetApiCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apihub.v1.Api} [response] Api + */ + + /** + * Calls GetApi. + * @function getApi + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IGetApiRequest} request GetApiRequest message or plain object + * @param {google.cloud.apihub.v1.ApiHub.GetApiCallback} callback Node-style callback called with the error, if any, and Api + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ApiHub.prototype.getApi = function getApi(request, callback) { + return this.rpcCall(getApi, $root.google.cloud.apihub.v1.GetApiRequest, $root.google.cloud.apihub.v1.Api, request, callback); + }, "name", { value: "GetApi" }); + + /** + * Calls GetApi. + * @function getApi + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IGetApiRequest} request GetApiRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|listApis}. + * @memberof google.cloud.apihub.v1.ApiHub + * @typedef ListApisCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apihub.v1.ListApisResponse} [response] ListApisResponse + */ + + /** + * Calls ListApis. + * @function listApis + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IListApisRequest} request ListApisRequest message or plain object + * @param {google.cloud.apihub.v1.ApiHub.ListApisCallback} callback Node-style callback called with the error, if any, and ListApisResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ApiHub.prototype.listApis = function listApis(request, callback) { + return this.rpcCall(listApis, $root.google.cloud.apihub.v1.ListApisRequest, $root.google.cloud.apihub.v1.ListApisResponse, request, callback); + }, "name", { value: "ListApis" }); + + /** + * Calls ListApis. + * @function listApis + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IListApisRequest} request ListApisRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|updateApi}. + * @memberof google.cloud.apihub.v1.ApiHub + * @typedef UpdateApiCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apihub.v1.Api} [response] Api + */ + + /** + * Calls UpdateApi. + * @function updateApi + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IUpdateApiRequest} request UpdateApiRequest message or plain object + * @param {google.cloud.apihub.v1.ApiHub.UpdateApiCallback} callback Node-style callback called with the error, if any, and Api + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ApiHub.prototype.updateApi = function updateApi(request, callback) { + return this.rpcCall(updateApi, $root.google.cloud.apihub.v1.UpdateApiRequest, $root.google.cloud.apihub.v1.Api, request, callback); + }, "name", { value: "UpdateApi" }); + + /** + * Calls UpdateApi. + * @function updateApi + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IUpdateApiRequest} request UpdateApiRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|deleteApi}. + * @memberof google.cloud.apihub.v1.ApiHub + * @typedef DeleteApiCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteApi. + * @function deleteApi + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IDeleteApiRequest} request DeleteApiRequest message or plain object + * @param {google.cloud.apihub.v1.ApiHub.DeleteApiCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ApiHub.prototype.deleteApi = function deleteApi(request, callback) { + return this.rpcCall(deleteApi, $root.google.cloud.apihub.v1.DeleteApiRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteApi" }); + + /** + * Calls DeleteApi. + * @function deleteApi + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IDeleteApiRequest} request DeleteApiRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|createVersion}. + * @memberof google.cloud.apihub.v1.ApiHub + * @typedef CreateVersionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apihub.v1.Version} [response] Version + */ + + /** + * Calls CreateVersion. + * @function createVersion + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.ICreateVersionRequest} request CreateVersionRequest message or plain object + * @param {google.cloud.apihub.v1.ApiHub.CreateVersionCallback} callback Node-style callback called with the error, if any, and Version + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ApiHub.prototype.createVersion = function createVersion(request, callback) { + return this.rpcCall(createVersion, $root.google.cloud.apihub.v1.CreateVersionRequest, $root.google.cloud.apihub.v1.Version, request, callback); + }, "name", { value: "CreateVersion" }); + + /** + * Calls CreateVersion. + * @function createVersion + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.ICreateVersionRequest} request CreateVersionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|getVersion}. + * @memberof google.cloud.apihub.v1.ApiHub + * @typedef GetVersionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apihub.v1.Version} [response] Version + */ + + /** + * Calls GetVersion. + * @function getVersion + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IGetVersionRequest} request GetVersionRequest message or plain object + * @param {google.cloud.apihub.v1.ApiHub.GetVersionCallback} callback Node-style callback called with the error, if any, and Version + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ApiHub.prototype.getVersion = function getVersion(request, callback) { + return this.rpcCall(getVersion, $root.google.cloud.apihub.v1.GetVersionRequest, $root.google.cloud.apihub.v1.Version, request, callback); + }, "name", { value: "GetVersion" }); + + /** + * Calls GetVersion. + * @function getVersion + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IGetVersionRequest} request GetVersionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|listVersions}. + * @memberof google.cloud.apihub.v1.ApiHub + * @typedef ListVersionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apihub.v1.ListVersionsResponse} [response] ListVersionsResponse + */ + + /** + * Calls ListVersions. + * @function listVersions + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IListVersionsRequest} request ListVersionsRequest message or plain object + * @param {google.cloud.apihub.v1.ApiHub.ListVersionsCallback} callback Node-style callback called with the error, if any, and ListVersionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ApiHub.prototype.listVersions = function listVersions(request, callback) { + return this.rpcCall(listVersions, $root.google.cloud.apihub.v1.ListVersionsRequest, $root.google.cloud.apihub.v1.ListVersionsResponse, request, callback); + }, "name", { value: "ListVersions" }); + + /** + * Calls ListVersions. + * @function listVersions + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IListVersionsRequest} request ListVersionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|updateVersion}. + * @memberof google.cloud.apihub.v1.ApiHub + * @typedef UpdateVersionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apihub.v1.Version} [response] Version + */ + + /** + * Calls UpdateVersion. + * @function updateVersion + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IUpdateVersionRequest} request UpdateVersionRequest message or plain object + * @param {google.cloud.apihub.v1.ApiHub.UpdateVersionCallback} callback Node-style callback called with the error, if any, and Version + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ApiHub.prototype.updateVersion = function updateVersion(request, callback) { + return this.rpcCall(updateVersion, $root.google.cloud.apihub.v1.UpdateVersionRequest, $root.google.cloud.apihub.v1.Version, request, callback); + }, "name", { value: "UpdateVersion" }); + + /** + * Calls UpdateVersion. + * @function updateVersion + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IUpdateVersionRequest} request UpdateVersionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|deleteVersion}. + * @memberof google.cloud.apihub.v1.ApiHub + * @typedef DeleteVersionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteVersion. + * @function deleteVersion + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IDeleteVersionRequest} request DeleteVersionRequest message or plain object + * @param {google.cloud.apihub.v1.ApiHub.DeleteVersionCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ApiHub.prototype.deleteVersion = function deleteVersion(request, callback) { + return this.rpcCall(deleteVersion, $root.google.cloud.apihub.v1.DeleteVersionRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteVersion" }); + + /** + * Calls DeleteVersion. + * @function deleteVersion + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IDeleteVersionRequest} request DeleteVersionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|createSpec}. + * @memberof google.cloud.apihub.v1.ApiHub + * @typedef CreateSpecCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apihub.v1.Spec} [response] Spec + */ + + /** + * Calls CreateSpec. + * @function createSpec + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.ICreateSpecRequest} request CreateSpecRequest message or plain object + * @param {google.cloud.apihub.v1.ApiHub.CreateSpecCallback} callback Node-style callback called with the error, if any, and Spec + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ApiHub.prototype.createSpec = function createSpec(request, callback) { + return this.rpcCall(createSpec, $root.google.cloud.apihub.v1.CreateSpecRequest, $root.google.cloud.apihub.v1.Spec, request, callback); + }, "name", { value: "CreateSpec" }); + + /** + * Calls CreateSpec. + * @function createSpec + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.ICreateSpecRequest} request CreateSpecRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|getSpec}. + * @memberof google.cloud.apihub.v1.ApiHub + * @typedef GetSpecCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apihub.v1.Spec} [response] Spec + */ + + /** + * Calls GetSpec. + * @function getSpec + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IGetSpecRequest} request GetSpecRequest message or plain object + * @param {google.cloud.apihub.v1.ApiHub.GetSpecCallback} callback Node-style callback called with the error, if any, and Spec + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ApiHub.prototype.getSpec = function getSpec(request, callback) { + return this.rpcCall(getSpec, $root.google.cloud.apihub.v1.GetSpecRequest, $root.google.cloud.apihub.v1.Spec, request, callback); + }, "name", { value: "GetSpec" }); + + /** + * Calls GetSpec. + * @function getSpec + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IGetSpecRequest} request GetSpecRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|getSpecContents}. + * @memberof google.cloud.apihub.v1.ApiHub + * @typedef GetSpecContentsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apihub.v1.SpecContents} [response] SpecContents + */ + + /** + * Calls GetSpecContents. + * @function getSpecContents + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IGetSpecContentsRequest} request GetSpecContentsRequest message or plain object + * @param {google.cloud.apihub.v1.ApiHub.GetSpecContentsCallback} callback Node-style callback called with the error, if any, and SpecContents + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ApiHub.prototype.getSpecContents = function getSpecContents(request, callback) { + return this.rpcCall(getSpecContents, $root.google.cloud.apihub.v1.GetSpecContentsRequest, $root.google.cloud.apihub.v1.SpecContents, request, callback); + }, "name", { value: "GetSpecContents" }); + + /** + * Calls GetSpecContents. + * @function getSpecContents + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IGetSpecContentsRequest} request GetSpecContentsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|listSpecs}. + * @memberof google.cloud.apihub.v1.ApiHub + * @typedef ListSpecsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apihub.v1.ListSpecsResponse} [response] ListSpecsResponse + */ + + /** + * Calls ListSpecs. + * @function listSpecs + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IListSpecsRequest} request ListSpecsRequest message or plain object + * @param {google.cloud.apihub.v1.ApiHub.ListSpecsCallback} callback Node-style callback called with the error, if any, and ListSpecsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ApiHub.prototype.listSpecs = function listSpecs(request, callback) { + return this.rpcCall(listSpecs, $root.google.cloud.apihub.v1.ListSpecsRequest, $root.google.cloud.apihub.v1.ListSpecsResponse, request, callback); + }, "name", { value: "ListSpecs" }); + + /** + * Calls ListSpecs. + * @function listSpecs + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IListSpecsRequest} request ListSpecsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|updateSpec}. + * @memberof google.cloud.apihub.v1.ApiHub + * @typedef UpdateSpecCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apihub.v1.Spec} [response] Spec + */ + + /** + * Calls UpdateSpec. + * @function updateSpec + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IUpdateSpecRequest} request UpdateSpecRequest message or plain object + * @param {google.cloud.apihub.v1.ApiHub.UpdateSpecCallback} callback Node-style callback called with the error, if any, and Spec + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ApiHub.prototype.updateSpec = function updateSpec(request, callback) { + return this.rpcCall(updateSpec, $root.google.cloud.apihub.v1.UpdateSpecRequest, $root.google.cloud.apihub.v1.Spec, request, callback); + }, "name", { value: "UpdateSpec" }); + + /** + * Calls UpdateSpec. + * @function updateSpec + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IUpdateSpecRequest} request UpdateSpecRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|deleteSpec}. + * @memberof google.cloud.apihub.v1.ApiHub + * @typedef DeleteSpecCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteSpec. + * @function deleteSpec + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IDeleteSpecRequest} request DeleteSpecRequest message or plain object + * @param {google.cloud.apihub.v1.ApiHub.DeleteSpecCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ApiHub.prototype.deleteSpec = function deleteSpec(request, callback) { + return this.rpcCall(deleteSpec, $root.google.cloud.apihub.v1.DeleteSpecRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteSpec" }); + + /** + * Calls DeleteSpec. + * @function deleteSpec + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IDeleteSpecRequest} request DeleteSpecRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|getApiOperation}. + * @memberof google.cloud.apihub.v1.ApiHub + * @typedef GetApiOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apihub.v1.ApiOperation} [response] ApiOperation + */ + + /** + * Calls GetApiOperation. + * @function getApiOperation + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IGetApiOperationRequest} request GetApiOperationRequest message or plain object + * @param {google.cloud.apihub.v1.ApiHub.GetApiOperationCallback} callback Node-style callback called with the error, if any, and ApiOperation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ApiHub.prototype.getApiOperation = function getApiOperation(request, callback) { + return this.rpcCall(getApiOperation, $root.google.cloud.apihub.v1.GetApiOperationRequest, $root.google.cloud.apihub.v1.ApiOperation, request, callback); + }, "name", { value: "GetApiOperation" }); + + /** + * Calls GetApiOperation. + * @function getApiOperation + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IGetApiOperationRequest} request GetApiOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|listApiOperations}. + * @memberof google.cloud.apihub.v1.ApiHub + * @typedef ListApiOperationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apihub.v1.ListApiOperationsResponse} [response] ListApiOperationsResponse + */ + + /** + * Calls ListApiOperations. + * @function listApiOperations + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IListApiOperationsRequest} request ListApiOperationsRequest message or plain object + * @param {google.cloud.apihub.v1.ApiHub.ListApiOperationsCallback} callback Node-style callback called with the error, if any, and ListApiOperationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ApiHub.prototype.listApiOperations = function listApiOperations(request, callback) { + return this.rpcCall(listApiOperations, $root.google.cloud.apihub.v1.ListApiOperationsRequest, $root.google.cloud.apihub.v1.ListApiOperationsResponse, request, callback); + }, "name", { value: "ListApiOperations" }); + + /** + * Calls ListApiOperations. + * @function listApiOperations + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IListApiOperationsRequest} request ListApiOperationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|getDefinition}. + * @memberof google.cloud.apihub.v1.ApiHub + * @typedef GetDefinitionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apihub.v1.Definition} [response] Definition + */ + + /** + * Calls GetDefinition. + * @function getDefinition + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IGetDefinitionRequest} request GetDefinitionRequest message or plain object + * @param {google.cloud.apihub.v1.ApiHub.GetDefinitionCallback} callback Node-style callback called with the error, if any, and Definition + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ApiHub.prototype.getDefinition = function getDefinition(request, callback) { + return this.rpcCall(getDefinition, $root.google.cloud.apihub.v1.GetDefinitionRequest, $root.google.cloud.apihub.v1.Definition, request, callback); + }, "name", { value: "GetDefinition" }); + + /** + * Calls GetDefinition. + * @function getDefinition + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IGetDefinitionRequest} request GetDefinitionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|createDeployment}. + * @memberof google.cloud.apihub.v1.ApiHub + * @typedef CreateDeploymentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apihub.v1.Deployment} [response] Deployment + */ + + /** + * Calls CreateDeployment. + * @function createDeployment + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.ICreateDeploymentRequest} request CreateDeploymentRequest message or plain object + * @param {google.cloud.apihub.v1.ApiHub.CreateDeploymentCallback} callback Node-style callback called with the error, if any, and Deployment + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ApiHub.prototype.createDeployment = function createDeployment(request, callback) { + return this.rpcCall(createDeployment, $root.google.cloud.apihub.v1.CreateDeploymentRequest, $root.google.cloud.apihub.v1.Deployment, request, callback); + }, "name", { value: "CreateDeployment" }); + + /** + * Calls CreateDeployment. + * @function createDeployment + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.ICreateDeploymentRequest} request CreateDeploymentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|getDeployment}. + * @memberof google.cloud.apihub.v1.ApiHub + * @typedef GetDeploymentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apihub.v1.Deployment} [response] Deployment + */ + + /** + * Calls GetDeployment. + * @function getDeployment + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IGetDeploymentRequest} request GetDeploymentRequest message or plain object + * @param {google.cloud.apihub.v1.ApiHub.GetDeploymentCallback} callback Node-style callback called with the error, if any, and Deployment + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ApiHub.prototype.getDeployment = function getDeployment(request, callback) { + return this.rpcCall(getDeployment, $root.google.cloud.apihub.v1.GetDeploymentRequest, $root.google.cloud.apihub.v1.Deployment, request, callback); + }, "name", { value: "GetDeployment" }); + + /** + * Calls GetDeployment. + * @function getDeployment + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IGetDeploymentRequest} request GetDeploymentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|listDeployments}. + * @memberof google.cloud.apihub.v1.ApiHub + * @typedef ListDeploymentsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apihub.v1.ListDeploymentsResponse} [response] ListDeploymentsResponse + */ + + /** + * Calls ListDeployments. + * @function listDeployments + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IListDeploymentsRequest} request ListDeploymentsRequest message or plain object + * @param {google.cloud.apihub.v1.ApiHub.ListDeploymentsCallback} callback Node-style callback called with the error, if any, and ListDeploymentsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ApiHub.prototype.listDeployments = function listDeployments(request, callback) { + return this.rpcCall(listDeployments, $root.google.cloud.apihub.v1.ListDeploymentsRequest, $root.google.cloud.apihub.v1.ListDeploymentsResponse, request, callback); + }, "name", { value: "ListDeployments" }); + + /** + * Calls ListDeployments. + * @function listDeployments + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IListDeploymentsRequest} request ListDeploymentsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|updateDeployment}. + * @memberof google.cloud.apihub.v1.ApiHub + * @typedef UpdateDeploymentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apihub.v1.Deployment} [response] Deployment + */ + + /** + * Calls UpdateDeployment. + * @function updateDeployment + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IUpdateDeploymentRequest} request UpdateDeploymentRequest message or plain object + * @param {google.cloud.apihub.v1.ApiHub.UpdateDeploymentCallback} callback Node-style callback called with the error, if any, and Deployment + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ApiHub.prototype.updateDeployment = function updateDeployment(request, callback) { + return this.rpcCall(updateDeployment, $root.google.cloud.apihub.v1.UpdateDeploymentRequest, $root.google.cloud.apihub.v1.Deployment, request, callback); + }, "name", { value: "UpdateDeployment" }); + + /** + * Calls UpdateDeployment. + * @function updateDeployment + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IUpdateDeploymentRequest} request UpdateDeploymentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|deleteDeployment}. + * @memberof google.cloud.apihub.v1.ApiHub + * @typedef DeleteDeploymentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteDeployment. + * @function deleteDeployment + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IDeleteDeploymentRequest} request DeleteDeploymentRequest message or plain object + * @param {google.cloud.apihub.v1.ApiHub.DeleteDeploymentCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ApiHub.prototype.deleteDeployment = function deleteDeployment(request, callback) { + return this.rpcCall(deleteDeployment, $root.google.cloud.apihub.v1.DeleteDeploymentRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteDeployment" }); + + /** + * Calls DeleteDeployment. + * @function deleteDeployment + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IDeleteDeploymentRequest} request DeleteDeploymentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|createAttribute}. + * @memberof google.cloud.apihub.v1.ApiHub + * @typedef CreateAttributeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apihub.v1.Attribute} [response] Attribute + */ + + /** + * Calls CreateAttribute. + * @function createAttribute + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.ICreateAttributeRequest} request CreateAttributeRequest message or plain object + * @param {google.cloud.apihub.v1.ApiHub.CreateAttributeCallback} callback Node-style callback called with the error, if any, and Attribute + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ApiHub.prototype.createAttribute = function createAttribute(request, callback) { + return this.rpcCall(createAttribute, $root.google.cloud.apihub.v1.CreateAttributeRequest, $root.google.cloud.apihub.v1.Attribute, request, callback); + }, "name", { value: "CreateAttribute" }); + + /** + * Calls CreateAttribute. + * @function createAttribute + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.ICreateAttributeRequest} request CreateAttributeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|getAttribute}. + * @memberof google.cloud.apihub.v1.ApiHub + * @typedef GetAttributeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apihub.v1.Attribute} [response] Attribute + */ + + /** + * Calls GetAttribute. + * @function getAttribute + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IGetAttributeRequest} request GetAttributeRequest message or plain object + * @param {google.cloud.apihub.v1.ApiHub.GetAttributeCallback} callback Node-style callback called with the error, if any, and Attribute + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ApiHub.prototype.getAttribute = function getAttribute(request, callback) { + return this.rpcCall(getAttribute, $root.google.cloud.apihub.v1.GetAttributeRequest, $root.google.cloud.apihub.v1.Attribute, request, callback); + }, "name", { value: "GetAttribute" }); + + /** + * Calls GetAttribute. + * @function getAttribute + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IGetAttributeRequest} request GetAttributeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|updateAttribute}. + * @memberof google.cloud.apihub.v1.ApiHub + * @typedef UpdateAttributeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apihub.v1.Attribute} [response] Attribute + */ + + /** + * Calls UpdateAttribute. + * @function updateAttribute + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IUpdateAttributeRequest} request UpdateAttributeRequest message or plain object + * @param {google.cloud.apihub.v1.ApiHub.UpdateAttributeCallback} callback Node-style callback called with the error, if any, and Attribute + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ApiHub.prototype.updateAttribute = function updateAttribute(request, callback) { + return this.rpcCall(updateAttribute, $root.google.cloud.apihub.v1.UpdateAttributeRequest, $root.google.cloud.apihub.v1.Attribute, request, callback); + }, "name", { value: "UpdateAttribute" }); + + /** + * Calls UpdateAttribute. + * @function updateAttribute + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IUpdateAttributeRequest} request UpdateAttributeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|deleteAttribute}. + * @memberof google.cloud.apihub.v1.ApiHub + * @typedef DeleteAttributeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteAttribute. + * @function deleteAttribute + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IDeleteAttributeRequest} request DeleteAttributeRequest message or plain object + * @param {google.cloud.apihub.v1.ApiHub.DeleteAttributeCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ApiHub.prototype.deleteAttribute = function deleteAttribute(request, callback) { + return this.rpcCall(deleteAttribute, $root.google.cloud.apihub.v1.DeleteAttributeRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteAttribute" }); + + /** + * Calls DeleteAttribute. + * @function deleteAttribute + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IDeleteAttributeRequest} request DeleteAttributeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|listAttributes}. + * @memberof google.cloud.apihub.v1.ApiHub + * @typedef ListAttributesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apihub.v1.ListAttributesResponse} [response] ListAttributesResponse + */ + + /** + * Calls ListAttributes. + * @function listAttributes + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IListAttributesRequest} request ListAttributesRequest message or plain object + * @param {google.cloud.apihub.v1.ApiHub.ListAttributesCallback} callback Node-style callback called with the error, if any, and ListAttributesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ApiHub.prototype.listAttributes = function listAttributes(request, callback) { + return this.rpcCall(listAttributes, $root.google.cloud.apihub.v1.ListAttributesRequest, $root.google.cloud.apihub.v1.ListAttributesResponse, request, callback); + }, "name", { value: "ListAttributes" }); + + /** + * Calls ListAttributes. + * @function listAttributes + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IListAttributesRequest} request ListAttributesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|searchResources}. + * @memberof google.cloud.apihub.v1.ApiHub + * @typedef SearchResourcesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apihub.v1.SearchResourcesResponse} [response] SearchResourcesResponse + */ + + /** + * Calls SearchResources. + * @function searchResources + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.ISearchResourcesRequest} request SearchResourcesRequest message or plain object + * @param {google.cloud.apihub.v1.ApiHub.SearchResourcesCallback} callback Node-style callback called with the error, if any, and SearchResourcesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ApiHub.prototype.searchResources = function searchResources(request, callback) { + return this.rpcCall(searchResources, $root.google.cloud.apihub.v1.SearchResourcesRequest, $root.google.cloud.apihub.v1.SearchResourcesResponse, request, callback); + }, "name", { value: "SearchResources" }); + + /** + * Calls SearchResources. + * @function searchResources + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.ISearchResourcesRequest} request SearchResourcesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|createExternalApi}. + * @memberof google.cloud.apihub.v1.ApiHub + * @typedef CreateExternalApiCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apihub.v1.ExternalApi} [response] ExternalApi + */ + + /** + * Calls CreateExternalApi. + * @function createExternalApi + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.ICreateExternalApiRequest} request CreateExternalApiRequest message or plain object + * @param {google.cloud.apihub.v1.ApiHub.CreateExternalApiCallback} callback Node-style callback called with the error, if any, and ExternalApi + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ApiHub.prototype.createExternalApi = function createExternalApi(request, callback) { + return this.rpcCall(createExternalApi, $root.google.cloud.apihub.v1.CreateExternalApiRequest, $root.google.cloud.apihub.v1.ExternalApi, request, callback); + }, "name", { value: "CreateExternalApi" }); + + /** + * Calls CreateExternalApi. + * @function createExternalApi + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.ICreateExternalApiRequest} request CreateExternalApiRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|getExternalApi}. + * @memberof google.cloud.apihub.v1.ApiHub + * @typedef GetExternalApiCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apihub.v1.ExternalApi} [response] ExternalApi + */ + + /** + * Calls GetExternalApi. + * @function getExternalApi + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IGetExternalApiRequest} request GetExternalApiRequest message or plain object + * @param {google.cloud.apihub.v1.ApiHub.GetExternalApiCallback} callback Node-style callback called with the error, if any, and ExternalApi + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ApiHub.prototype.getExternalApi = function getExternalApi(request, callback) { + return this.rpcCall(getExternalApi, $root.google.cloud.apihub.v1.GetExternalApiRequest, $root.google.cloud.apihub.v1.ExternalApi, request, callback); + }, "name", { value: "GetExternalApi" }); + + /** + * Calls GetExternalApi. + * @function getExternalApi + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IGetExternalApiRequest} request GetExternalApiRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|updateExternalApi}. + * @memberof google.cloud.apihub.v1.ApiHub + * @typedef UpdateExternalApiCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apihub.v1.ExternalApi} [response] ExternalApi + */ + + /** + * Calls UpdateExternalApi. + * @function updateExternalApi + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IUpdateExternalApiRequest} request UpdateExternalApiRequest message or plain object + * @param {google.cloud.apihub.v1.ApiHub.UpdateExternalApiCallback} callback Node-style callback called with the error, if any, and ExternalApi + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ApiHub.prototype.updateExternalApi = function updateExternalApi(request, callback) { + return this.rpcCall(updateExternalApi, $root.google.cloud.apihub.v1.UpdateExternalApiRequest, $root.google.cloud.apihub.v1.ExternalApi, request, callback); + }, "name", { value: "UpdateExternalApi" }); + + /** + * Calls UpdateExternalApi. + * @function updateExternalApi + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IUpdateExternalApiRequest} request UpdateExternalApiRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|deleteExternalApi}. + * @memberof google.cloud.apihub.v1.ApiHub + * @typedef DeleteExternalApiCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteExternalApi. + * @function deleteExternalApi + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IDeleteExternalApiRequest} request DeleteExternalApiRequest message or plain object + * @param {google.cloud.apihub.v1.ApiHub.DeleteExternalApiCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ApiHub.prototype.deleteExternalApi = function deleteExternalApi(request, callback) { + return this.rpcCall(deleteExternalApi, $root.google.cloud.apihub.v1.DeleteExternalApiRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteExternalApi" }); + + /** + * Calls DeleteExternalApi. + * @function deleteExternalApi + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IDeleteExternalApiRequest} request DeleteExternalApiRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|listExternalApis}. + * @memberof google.cloud.apihub.v1.ApiHub + * @typedef ListExternalApisCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apihub.v1.ListExternalApisResponse} [response] ListExternalApisResponse + */ + + /** + * Calls ListExternalApis. + * @function listExternalApis + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IListExternalApisRequest} request ListExternalApisRequest message or plain object + * @param {google.cloud.apihub.v1.ApiHub.ListExternalApisCallback} callback Node-style callback called with the error, if any, and ListExternalApisResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ApiHub.prototype.listExternalApis = function listExternalApis(request, callback) { + return this.rpcCall(listExternalApis, $root.google.cloud.apihub.v1.ListExternalApisRequest, $root.google.cloud.apihub.v1.ListExternalApisResponse, request, callback); + }, "name", { value: "ListExternalApis" }); + + /** + * Calls ListExternalApis. + * @function listExternalApis + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IListExternalApisRequest} request ListExternalApisRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return ApiHub; + })(); + + v1.ApiHubDependencies = (function() { + + /** + * Constructs a new ApiHubDependencies service. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents an ApiHubDependencies + * @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 ApiHubDependencies(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (ApiHubDependencies.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = ApiHubDependencies; + + /** + * Creates new ApiHubDependencies service using the specified rpc implementation. + * @function create + * @memberof google.cloud.apihub.v1.ApiHubDependencies + * @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 {ApiHubDependencies} RPC service. Useful where requests and/or responses are streamed. + */ + ApiHubDependencies.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHubDependencies|createDependency}. + * @memberof google.cloud.apihub.v1.ApiHubDependencies + * @typedef CreateDependencyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apihub.v1.Dependency} [response] Dependency + */ + + /** + * Calls CreateDependency. + * @function createDependency + * @memberof google.cloud.apihub.v1.ApiHubDependencies + * @instance + * @param {google.cloud.apihub.v1.ICreateDependencyRequest} request CreateDependencyRequest message or plain object + * @param {google.cloud.apihub.v1.ApiHubDependencies.CreateDependencyCallback} callback Node-style callback called with the error, if any, and Dependency + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ApiHubDependencies.prototype.createDependency = function createDependency(request, callback) { + return this.rpcCall(createDependency, $root.google.cloud.apihub.v1.CreateDependencyRequest, $root.google.cloud.apihub.v1.Dependency, request, callback); + }, "name", { value: "CreateDependency" }); + + /** + * Calls CreateDependency. + * @function createDependency + * @memberof google.cloud.apihub.v1.ApiHubDependencies + * @instance + * @param {google.cloud.apihub.v1.ICreateDependencyRequest} request CreateDependencyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHubDependencies|getDependency}. + * @memberof google.cloud.apihub.v1.ApiHubDependencies + * @typedef GetDependencyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apihub.v1.Dependency} [response] Dependency + */ + + /** + * Calls GetDependency. + * @function getDependency + * @memberof google.cloud.apihub.v1.ApiHubDependencies + * @instance + * @param {google.cloud.apihub.v1.IGetDependencyRequest} request GetDependencyRequest message or plain object + * @param {google.cloud.apihub.v1.ApiHubDependencies.GetDependencyCallback} callback Node-style callback called with the error, if any, and Dependency + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ApiHubDependencies.prototype.getDependency = function getDependency(request, callback) { + return this.rpcCall(getDependency, $root.google.cloud.apihub.v1.GetDependencyRequest, $root.google.cloud.apihub.v1.Dependency, request, callback); + }, "name", { value: "GetDependency" }); + + /** + * Calls GetDependency. + * @function getDependency + * @memberof google.cloud.apihub.v1.ApiHubDependencies + * @instance + * @param {google.cloud.apihub.v1.IGetDependencyRequest} request GetDependencyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHubDependencies|updateDependency}. + * @memberof google.cloud.apihub.v1.ApiHubDependencies + * @typedef UpdateDependencyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apihub.v1.Dependency} [response] Dependency + */ + + /** + * Calls UpdateDependency. + * @function updateDependency + * @memberof google.cloud.apihub.v1.ApiHubDependencies + * @instance + * @param {google.cloud.apihub.v1.IUpdateDependencyRequest} request UpdateDependencyRequest message or plain object + * @param {google.cloud.apihub.v1.ApiHubDependencies.UpdateDependencyCallback} callback Node-style callback called with the error, if any, and Dependency + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ApiHubDependencies.prototype.updateDependency = function updateDependency(request, callback) { + return this.rpcCall(updateDependency, $root.google.cloud.apihub.v1.UpdateDependencyRequest, $root.google.cloud.apihub.v1.Dependency, request, callback); + }, "name", { value: "UpdateDependency" }); + + /** + * Calls UpdateDependency. + * @function updateDependency + * @memberof google.cloud.apihub.v1.ApiHubDependencies + * @instance + * @param {google.cloud.apihub.v1.IUpdateDependencyRequest} request UpdateDependencyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHubDependencies|deleteDependency}. + * @memberof google.cloud.apihub.v1.ApiHubDependencies + * @typedef DeleteDependencyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteDependency. + * @function deleteDependency + * @memberof google.cloud.apihub.v1.ApiHubDependencies + * @instance + * @param {google.cloud.apihub.v1.IDeleteDependencyRequest} request DeleteDependencyRequest message or plain object + * @param {google.cloud.apihub.v1.ApiHubDependencies.DeleteDependencyCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ApiHubDependencies.prototype.deleteDependency = function deleteDependency(request, callback) { + return this.rpcCall(deleteDependency, $root.google.cloud.apihub.v1.DeleteDependencyRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteDependency" }); + + /** + * Calls DeleteDependency. + * @function deleteDependency + * @memberof google.cloud.apihub.v1.ApiHubDependencies + * @instance + * @param {google.cloud.apihub.v1.IDeleteDependencyRequest} request DeleteDependencyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHubDependencies|listDependencies}. + * @memberof google.cloud.apihub.v1.ApiHubDependencies + * @typedef ListDependenciesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apihub.v1.ListDependenciesResponse} [response] ListDependenciesResponse + */ + + /** + * Calls ListDependencies. + * @function listDependencies + * @memberof google.cloud.apihub.v1.ApiHubDependencies + * @instance + * @param {google.cloud.apihub.v1.IListDependenciesRequest} request ListDependenciesRequest message or plain object + * @param {google.cloud.apihub.v1.ApiHubDependencies.ListDependenciesCallback} callback Node-style callback called with the error, if any, and ListDependenciesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ApiHubDependencies.prototype.listDependencies = function listDependencies(request, callback) { + return this.rpcCall(listDependencies, $root.google.cloud.apihub.v1.ListDependenciesRequest, $root.google.cloud.apihub.v1.ListDependenciesResponse, request, callback); + }, "name", { value: "ListDependencies" }); + + /** + * Calls ListDependencies. + * @function listDependencies + * @memberof google.cloud.apihub.v1.ApiHubDependencies + * @instance + * @param {google.cloud.apihub.v1.IListDependenciesRequest} request ListDependenciesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return ApiHubDependencies; + })(); + + v1.CreateApiRequest = (function() { + + /** + * Properties of a CreateApiRequest. + * @memberof google.cloud.apihub.v1 + * @interface ICreateApiRequest + * @property {string|null} [parent] CreateApiRequest parent + * @property {string|null} [apiId] CreateApiRequest apiId + * @property {google.cloud.apihub.v1.IApi|null} [api] CreateApiRequest api + */ + + /** + * Constructs a new CreateApiRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a CreateApiRequest. + * @implements ICreateApiRequest + * @constructor + * @param {google.cloud.apihub.v1.ICreateApiRequest=} [properties] Properties to set + */ + function CreateApiRequest(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]]; + } + + /** + * CreateApiRequest parent. + * @member {string} parent + * @memberof google.cloud.apihub.v1.CreateApiRequest + * @instance + */ + CreateApiRequest.prototype.parent = ""; + + /** + * CreateApiRequest apiId. + * @member {string} apiId + * @memberof google.cloud.apihub.v1.CreateApiRequest + * @instance + */ + CreateApiRequest.prototype.apiId = ""; + + /** + * CreateApiRequest api. + * @member {google.cloud.apihub.v1.IApi|null|undefined} api + * @memberof google.cloud.apihub.v1.CreateApiRequest + * @instance + */ + CreateApiRequest.prototype.api = null; + + /** + * Creates a new CreateApiRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.CreateApiRequest + * @static + * @param {google.cloud.apihub.v1.ICreateApiRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.CreateApiRequest} CreateApiRequest instance + */ + CreateApiRequest.create = function create(properties) { + return new CreateApiRequest(properties); + }; + + /** + * Encodes the specified CreateApiRequest message. Does not implicitly {@link google.cloud.apihub.v1.CreateApiRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.CreateApiRequest + * @static + * @param {google.cloud.apihub.v1.ICreateApiRequest} message CreateApiRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateApiRequest.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.apiId != null && Object.hasOwnProperty.call(message, "apiId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.apiId); + if (message.api != null && Object.hasOwnProperty.call(message, "api")) + $root.google.cloud.apihub.v1.Api.encode(message.api, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateApiRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.CreateApiRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.CreateApiRequest + * @static + * @param {google.cloud.apihub.v1.ICreateApiRequest} message CreateApiRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateApiRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateApiRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.CreateApiRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.CreateApiRequest} CreateApiRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateApiRequest.decode = function 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.apihub.v1.CreateApiRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.apiId = reader.string(); + break; + } + case 3: { + message.api = $root.google.cloud.apihub.v1.Api.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateApiRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.CreateApiRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.CreateApiRequest} CreateApiRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateApiRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateApiRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.CreateApiRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateApiRequest.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.apiId != null && message.hasOwnProperty("apiId")) + if (!$util.isString(message.apiId)) + return "apiId: string expected"; + if (message.api != null && message.hasOwnProperty("api")) { + var error = $root.google.cloud.apihub.v1.Api.verify(message.api); + if (error) + return "api." + error; + } + return null; + }; + + /** + * Creates a CreateApiRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.CreateApiRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.CreateApiRequest} CreateApiRequest + */ + CreateApiRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.CreateApiRequest) + return object; + var message = new $root.google.cloud.apihub.v1.CreateApiRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.apiId != null) + message.apiId = String(object.apiId); + if (object.api != null) { + if (typeof object.api !== "object") + throw TypeError(".google.cloud.apihub.v1.CreateApiRequest.api: object expected"); + message.api = $root.google.cloud.apihub.v1.Api.fromObject(object.api); + } + return message; + }; + + /** + * Creates a plain object from a CreateApiRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.CreateApiRequest + * @static + * @param {google.cloud.apihub.v1.CreateApiRequest} message CreateApiRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateApiRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.apiId = ""; + object.api = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.apiId != null && message.hasOwnProperty("apiId")) + object.apiId = message.apiId; + if (message.api != null && message.hasOwnProperty("api")) + object.api = $root.google.cloud.apihub.v1.Api.toObject(message.api, options); + return object; + }; + + /** + * Converts this CreateApiRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.CreateApiRequest + * @instance + * @returns {Object.} JSON object + */ + CreateApiRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateApiRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.CreateApiRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateApiRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.CreateApiRequest"; + }; + + return CreateApiRequest; + })(); + + v1.GetApiRequest = (function() { + + /** + * Properties of a GetApiRequest. + * @memberof google.cloud.apihub.v1 + * @interface IGetApiRequest + * @property {string|null} [name] GetApiRequest name + */ + + /** + * Constructs a new GetApiRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a GetApiRequest. + * @implements IGetApiRequest + * @constructor + * @param {google.cloud.apihub.v1.IGetApiRequest=} [properties] Properties to set + */ + function GetApiRequest(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]]; + } + + /** + * GetApiRequest name. + * @member {string} name + * @memberof google.cloud.apihub.v1.GetApiRequest + * @instance + */ + GetApiRequest.prototype.name = ""; + + /** + * Creates a new GetApiRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.GetApiRequest + * @static + * @param {google.cloud.apihub.v1.IGetApiRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.GetApiRequest} GetApiRequest instance + */ + GetApiRequest.create = function create(properties) { + return new GetApiRequest(properties); + }; + + /** + * Encodes the specified GetApiRequest message. Does not implicitly {@link google.cloud.apihub.v1.GetApiRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.GetApiRequest + * @static + * @param {google.cloud.apihub.v1.IGetApiRequest} message GetApiRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetApiRequest.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 GetApiRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.GetApiRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.GetApiRequest + * @static + * @param {google.cloud.apihub.v1.IGetApiRequest} message GetApiRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetApiRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetApiRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.GetApiRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.GetApiRequest} GetApiRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetApiRequest.decode = function 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.apihub.v1.GetApiRequest(); + 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 GetApiRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.GetApiRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.GetApiRequest} GetApiRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetApiRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetApiRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.GetApiRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetApiRequest.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 GetApiRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.GetApiRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.GetApiRequest} GetApiRequest + */ + GetApiRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.GetApiRequest) + return object; + var message = new $root.google.cloud.apihub.v1.GetApiRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetApiRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.GetApiRequest + * @static + * @param {google.cloud.apihub.v1.GetApiRequest} message GetApiRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetApiRequest.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 GetApiRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.GetApiRequest + * @instance + * @returns {Object.} JSON object + */ + GetApiRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetApiRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.GetApiRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetApiRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.GetApiRequest"; + }; + + return GetApiRequest; + })(); + + v1.UpdateApiRequest = (function() { + + /** + * Properties of an UpdateApiRequest. + * @memberof google.cloud.apihub.v1 + * @interface IUpdateApiRequest + * @property {google.cloud.apihub.v1.IApi|null} [api] UpdateApiRequest api + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateApiRequest updateMask + */ + + /** + * Constructs a new UpdateApiRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents an UpdateApiRequest. + * @implements IUpdateApiRequest + * @constructor + * @param {google.cloud.apihub.v1.IUpdateApiRequest=} [properties] Properties to set + */ + function UpdateApiRequest(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]]; + } + + /** + * UpdateApiRequest api. + * @member {google.cloud.apihub.v1.IApi|null|undefined} api + * @memberof google.cloud.apihub.v1.UpdateApiRequest + * @instance + */ + UpdateApiRequest.prototype.api = null; + + /** + * UpdateApiRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.apihub.v1.UpdateApiRequest + * @instance + */ + UpdateApiRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateApiRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.UpdateApiRequest + * @static + * @param {google.cloud.apihub.v1.IUpdateApiRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.UpdateApiRequest} UpdateApiRequest instance + */ + UpdateApiRequest.create = function create(properties) { + return new UpdateApiRequest(properties); + }; + + /** + * Encodes the specified UpdateApiRequest message. Does not implicitly {@link google.cloud.apihub.v1.UpdateApiRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.UpdateApiRequest + * @static + * @param {google.cloud.apihub.v1.IUpdateApiRequest} message UpdateApiRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateApiRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.api != null && Object.hasOwnProperty.call(message, "api")) + $root.google.cloud.apihub.v1.Api.encode(message.api, 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 UpdateApiRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.UpdateApiRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.UpdateApiRequest + * @static + * @param {google.cloud.apihub.v1.IUpdateApiRequest} message UpdateApiRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateApiRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateApiRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.UpdateApiRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.UpdateApiRequest} UpdateApiRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateApiRequest.decode = function 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.apihub.v1.UpdateApiRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.api = $root.google.cloud.apihub.v1.Api.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 UpdateApiRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.UpdateApiRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.UpdateApiRequest} UpdateApiRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateApiRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateApiRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.UpdateApiRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateApiRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.api != null && message.hasOwnProperty("api")) { + var error = $root.google.cloud.apihub.v1.Api.verify(message.api); + if (error) + return "api." + 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 UpdateApiRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.UpdateApiRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.UpdateApiRequest} UpdateApiRequest + */ + UpdateApiRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.UpdateApiRequest) + return object; + var message = new $root.google.cloud.apihub.v1.UpdateApiRequest(); + if (object.api != null) { + if (typeof object.api !== "object") + throw TypeError(".google.cloud.apihub.v1.UpdateApiRequest.api: object expected"); + message.api = $root.google.cloud.apihub.v1.Api.fromObject(object.api); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.apihub.v1.UpdateApiRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateApiRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.UpdateApiRequest + * @static + * @param {google.cloud.apihub.v1.UpdateApiRequest} message UpdateApiRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateApiRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.api = null; + object.updateMask = null; + } + if (message.api != null && message.hasOwnProperty("api")) + object.api = $root.google.cloud.apihub.v1.Api.toObject(message.api, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateApiRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.UpdateApiRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateApiRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateApiRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.UpdateApiRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateApiRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.UpdateApiRequest"; + }; + + return UpdateApiRequest; + })(); + + v1.DeleteApiRequest = (function() { + + /** + * Properties of a DeleteApiRequest. + * @memberof google.cloud.apihub.v1 + * @interface IDeleteApiRequest + * @property {string|null} [name] DeleteApiRequest name + * @property {boolean|null} [force] DeleteApiRequest force + */ + + /** + * Constructs a new DeleteApiRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a DeleteApiRequest. + * @implements IDeleteApiRequest + * @constructor + * @param {google.cloud.apihub.v1.IDeleteApiRequest=} [properties] Properties to set + */ + function DeleteApiRequest(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]]; + } + + /** + * DeleteApiRequest name. + * @member {string} name + * @memberof google.cloud.apihub.v1.DeleteApiRequest + * @instance + */ + DeleteApiRequest.prototype.name = ""; + + /** + * DeleteApiRequest force. + * @member {boolean} force + * @memberof google.cloud.apihub.v1.DeleteApiRequest + * @instance + */ + DeleteApiRequest.prototype.force = false; + + /** + * Creates a new DeleteApiRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.DeleteApiRequest + * @static + * @param {google.cloud.apihub.v1.IDeleteApiRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.DeleteApiRequest} DeleteApiRequest instance + */ + DeleteApiRequest.create = function create(properties) { + return new DeleteApiRequest(properties); + }; + + /** + * Encodes the specified DeleteApiRequest message. Does not implicitly {@link google.cloud.apihub.v1.DeleteApiRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.DeleteApiRequest + * @static + * @param {google.cloud.apihub.v1.IDeleteApiRequest} message DeleteApiRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteApiRequest.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.force != null && Object.hasOwnProperty.call(message, "force")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.force); + return writer; + }; + + /** + * Encodes the specified DeleteApiRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.DeleteApiRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.DeleteApiRequest + * @static + * @param {google.cloud.apihub.v1.IDeleteApiRequest} message DeleteApiRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteApiRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteApiRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.DeleteApiRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.DeleteApiRequest} DeleteApiRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteApiRequest.decode = function 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.apihub.v1.DeleteApiRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.force = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteApiRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.DeleteApiRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.DeleteApiRequest} DeleteApiRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteApiRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteApiRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.DeleteApiRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteApiRequest.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.force != null && message.hasOwnProperty("force")) + if (typeof message.force !== "boolean") + return "force: boolean expected"; + return null; + }; + + /** + * Creates a DeleteApiRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.DeleteApiRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.DeleteApiRequest} DeleteApiRequest + */ + DeleteApiRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.DeleteApiRequest) + return object; + var message = new $root.google.cloud.apihub.v1.DeleteApiRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.force != null) + message.force = Boolean(object.force); + return message; + }; + + /** + * Creates a plain object from a DeleteApiRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.DeleteApiRequest + * @static + * @param {google.cloud.apihub.v1.DeleteApiRequest} message DeleteApiRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteApiRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.force = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.force != null && message.hasOwnProperty("force")) + object.force = message.force; + return object; + }; + + /** + * Converts this DeleteApiRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.DeleteApiRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteApiRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteApiRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.DeleteApiRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteApiRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.DeleteApiRequest"; + }; + + return DeleteApiRequest; + })(); + + v1.ListApisRequest = (function() { + + /** + * Properties of a ListApisRequest. + * @memberof google.cloud.apihub.v1 + * @interface IListApisRequest + * @property {string|null} [parent] ListApisRequest parent + * @property {string|null} [filter] ListApisRequest filter + * @property {number|null} [pageSize] ListApisRequest pageSize + * @property {string|null} [pageToken] ListApisRequest pageToken + */ + + /** + * Constructs a new ListApisRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a ListApisRequest. + * @implements IListApisRequest + * @constructor + * @param {google.cloud.apihub.v1.IListApisRequest=} [properties] Properties to set + */ + function ListApisRequest(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]]; + } + + /** + * ListApisRequest parent. + * @member {string} parent + * @memberof google.cloud.apihub.v1.ListApisRequest + * @instance + */ + ListApisRequest.prototype.parent = ""; + + /** + * ListApisRequest filter. + * @member {string} filter + * @memberof google.cloud.apihub.v1.ListApisRequest + * @instance + */ + ListApisRequest.prototype.filter = ""; + + /** + * ListApisRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.apihub.v1.ListApisRequest + * @instance + */ + ListApisRequest.prototype.pageSize = 0; + + /** + * ListApisRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.apihub.v1.ListApisRequest + * @instance + */ + ListApisRequest.prototype.pageToken = ""; + + /** + * Creates a new ListApisRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.ListApisRequest + * @static + * @param {google.cloud.apihub.v1.IListApisRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.ListApisRequest} ListApisRequest instance + */ + ListApisRequest.create = function create(properties) { + return new ListApisRequest(properties); + }; + + /** + * Encodes the specified ListApisRequest message. Does not implicitly {@link google.cloud.apihub.v1.ListApisRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.ListApisRequest + * @static + * @param {google.cloud.apihub.v1.IListApisRequest} message ListApisRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListApisRequest.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.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListApisRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListApisRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.ListApisRequest + * @static + * @param {google.cloud.apihub.v1.IListApisRequest} message ListApisRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListApisRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListApisRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.ListApisRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.ListApisRequest} ListApisRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListApisRequest.decode = function 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.apihub.v1.ListApisRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.filter = reader.string(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + case 4: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListApisRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.ListApisRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.ListApisRequest} ListApisRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListApisRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListApisRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.ListApisRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListApisRequest.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.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 ListApisRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.ListApisRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.ListApisRequest} ListApisRequest + */ + ListApisRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.ListApisRequest) + return object; + var message = new $root.google.cloud.apihub.v1.ListApisRequest(); + if (object.parent != null) + message.parent = String(object.parent); + 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 ListApisRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.ListApisRequest + * @static + * @param {google.cloud.apihub.v1.ListApisRequest} message ListApisRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListApisRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + 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; + return object; + }; + + /** + * Converts this ListApisRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.ListApisRequest + * @instance + * @returns {Object.} JSON object + */ + ListApisRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListApisRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.ListApisRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListApisRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.ListApisRequest"; + }; + + return ListApisRequest; + })(); + + v1.ListApisResponse = (function() { + + /** + * Properties of a ListApisResponse. + * @memberof google.cloud.apihub.v1 + * @interface IListApisResponse + * @property {Array.|null} [apis] ListApisResponse apis + * @property {string|null} [nextPageToken] ListApisResponse nextPageToken + */ + + /** + * Constructs a new ListApisResponse. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a ListApisResponse. + * @implements IListApisResponse + * @constructor + * @param {google.cloud.apihub.v1.IListApisResponse=} [properties] Properties to set + */ + function ListApisResponse(properties) { + this.apis = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListApisResponse apis. + * @member {Array.} apis + * @memberof google.cloud.apihub.v1.ListApisResponse + * @instance + */ + ListApisResponse.prototype.apis = $util.emptyArray; + + /** + * ListApisResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.apihub.v1.ListApisResponse + * @instance + */ + ListApisResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListApisResponse instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.ListApisResponse + * @static + * @param {google.cloud.apihub.v1.IListApisResponse=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.ListApisResponse} ListApisResponse instance + */ + ListApisResponse.create = function create(properties) { + return new ListApisResponse(properties); + }; + + /** + * Encodes the specified ListApisResponse message. Does not implicitly {@link google.cloud.apihub.v1.ListApisResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.ListApisResponse + * @static + * @param {google.cloud.apihub.v1.IListApisResponse} message ListApisResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListApisResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.apis != null && message.apis.length) + for (var i = 0; i < message.apis.length; ++i) + $root.google.cloud.apihub.v1.Api.encode(message.apis[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 ListApisResponse message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListApisResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.ListApisResponse + * @static + * @param {google.cloud.apihub.v1.IListApisResponse} message ListApisResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListApisResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListApisResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.ListApisResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.ListApisResponse} ListApisResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListApisResponse.decode = function 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.apihub.v1.ListApisResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.apis && message.apis.length)) + message.apis = []; + message.apis.push($root.google.cloud.apihub.v1.Api.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListApisResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.ListApisResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.ListApisResponse} ListApisResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListApisResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListApisResponse message. + * @function verify + * @memberof google.cloud.apihub.v1.ListApisResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListApisResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.apis != null && message.hasOwnProperty("apis")) { + if (!Array.isArray(message.apis)) + return "apis: array expected"; + for (var i = 0; i < message.apis.length; ++i) { + var error = $root.google.cloud.apihub.v1.Api.verify(message.apis[i]); + if (error) + return "apis." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListApisResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.ListApisResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.ListApisResponse} ListApisResponse + */ + ListApisResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.ListApisResponse) + return object; + var message = new $root.google.cloud.apihub.v1.ListApisResponse(); + if (object.apis) { + if (!Array.isArray(object.apis)) + throw TypeError(".google.cloud.apihub.v1.ListApisResponse.apis: array expected"); + message.apis = []; + for (var i = 0; i < object.apis.length; ++i) { + if (typeof object.apis[i] !== "object") + throw TypeError(".google.cloud.apihub.v1.ListApisResponse.apis: object expected"); + message.apis[i] = $root.google.cloud.apihub.v1.Api.fromObject(object.apis[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListApisResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.ListApisResponse + * @static + * @param {google.cloud.apihub.v1.ListApisResponse} message ListApisResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListApisResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.apis = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.apis && message.apis.length) { + object.apis = []; + for (var j = 0; j < message.apis.length; ++j) + object.apis[j] = $root.google.cloud.apihub.v1.Api.toObject(message.apis[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListApisResponse to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.ListApisResponse + * @instance + * @returns {Object.} JSON object + */ + ListApisResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListApisResponse + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.ListApisResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListApisResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.ListApisResponse"; + }; + + return ListApisResponse; + })(); + + v1.CreateVersionRequest = (function() { + + /** + * Properties of a CreateVersionRequest. + * @memberof google.cloud.apihub.v1 + * @interface ICreateVersionRequest + * @property {string|null} [parent] CreateVersionRequest parent + * @property {string|null} [versionId] CreateVersionRequest versionId + * @property {google.cloud.apihub.v1.IVersion|null} [version] CreateVersionRequest version + */ + + /** + * Constructs a new CreateVersionRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a CreateVersionRequest. + * @implements ICreateVersionRequest + * @constructor + * @param {google.cloud.apihub.v1.ICreateVersionRequest=} [properties] Properties to set + */ + function CreateVersionRequest(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]]; + } + + /** + * CreateVersionRequest parent. + * @member {string} parent + * @memberof google.cloud.apihub.v1.CreateVersionRequest + * @instance + */ + CreateVersionRequest.prototype.parent = ""; + + /** + * CreateVersionRequest versionId. + * @member {string} versionId + * @memberof google.cloud.apihub.v1.CreateVersionRequest + * @instance + */ + CreateVersionRequest.prototype.versionId = ""; + + /** + * CreateVersionRequest version. + * @member {google.cloud.apihub.v1.IVersion|null|undefined} version + * @memberof google.cloud.apihub.v1.CreateVersionRequest + * @instance + */ + CreateVersionRequest.prototype.version = null; + + /** + * Creates a new CreateVersionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.CreateVersionRequest + * @static + * @param {google.cloud.apihub.v1.ICreateVersionRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.CreateVersionRequest} CreateVersionRequest instance + */ + CreateVersionRequest.create = function create(properties) { + return new CreateVersionRequest(properties); + }; + + /** + * Encodes the specified CreateVersionRequest message. Does not implicitly {@link google.cloud.apihub.v1.CreateVersionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.CreateVersionRequest + * @static + * @param {google.cloud.apihub.v1.ICreateVersionRequest} message CreateVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateVersionRequest.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.versionId != null && Object.hasOwnProperty.call(message, "versionId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.versionId); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + $root.google.cloud.apihub.v1.Version.encode(message.version, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateVersionRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.CreateVersionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.CreateVersionRequest + * @static + * @param {google.cloud.apihub.v1.ICreateVersionRequest} message CreateVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateVersionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.CreateVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.CreateVersionRequest} CreateVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateVersionRequest.decode = function 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.apihub.v1.CreateVersionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.versionId = reader.string(); + break; + } + case 3: { + message.version = $root.google.cloud.apihub.v1.Version.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateVersionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.CreateVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.CreateVersionRequest} CreateVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateVersionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateVersionRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.CreateVersionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateVersionRequest.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.versionId != null && message.hasOwnProperty("versionId")) + if (!$util.isString(message.versionId)) + return "versionId: string expected"; + if (message.version != null && message.hasOwnProperty("version")) { + var error = $root.google.cloud.apihub.v1.Version.verify(message.version); + if (error) + return "version." + error; + } + return null; + }; + + /** + * Creates a CreateVersionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.CreateVersionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.CreateVersionRequest} CreateVersionRequest + */ + CreateVersionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.CreateVersionRequest) + return object; + var message = new $root.google.cloud.apihub.v1.CreateVersionRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.versionId != null) + message.versionId = String(object.versionId); + if (object.version != null) { + if (typeof object.version !== "object") + throw TypeError(".google.cloud.apihub.v1.CreateVersionRequest.version: object expected"); + message.version = $root.google.cloud.apihub.v1.Version.fromObject(object.version); + } + return message; + }; + + /** + * Creates a plain object from a CreateVersionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.CreateVersionRequest + * @static + * @param {google.cloud.apihub.v1.CreateVersionRequest} message CreateVersionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateVersionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.versionId = ""; + object.version = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.versionId != null && message.hasOwnProperty("versionId")) + object.versionId = message.versionId; + if (message.version != null && message.hasOwnProperty("version")) + object.version = $root.google.cloud.apihub.v1.Version.toObject(message.version, options); + return object; + }; + + /** + * Converts this CreateVersionRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.CreateVersionRequest + * @instance + * @returns {Object.} JSON object + */ + CreateVersionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateVersionRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.CreateVersionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.CreateVersionRequest"; + }; + + return CreateVersionRequest; + })(); + + v1.GetVersionRequest = (function() { + + /** + * Properties of a GetVersionRequest. + * @memberof google.cloud.apihub.v1 + * @interface IGetVersionRequest + * @property {string|null} [name] GetVersionRequest name + */ + + /** + * Constructs a new GetVersionRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a GetVersionRequest. + * @implements IGetVersionRequest + * @constructor + * @param {google.cloud.apihub.v1.IGetVersionRequest=} [properties] Properties to set + */ + function GetVersionRequest(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]]; + } + + /** + * GetVersionRequest name. + * @member {string} name + * @memberof google.cloud.apihub.v1.GetVersionRequest + * @instance + */ + GetVersionRequest.prototype.name = ""; + + /** + * Creates a new GetVersionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.GetVersionRequest + * @static + * @param {google.cloud.apihub.v1.IGetVersionRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.GetVersionRequest} GetVersionRequest instance + */ + GetVersionRequest.create = function create(properties) { + return new GetVersionRequest(properties); + }; + + /** + * Encodes the specified GetVersionRequest message. Does not implicitly {@link google.cloud.apihub.v1.GetVersionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.GetVersionRequest + * @static + * @param {google.cloud.apihub.v1.IGetVersionRequest} message GetVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetVersionRequest.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 GetVersionRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.GetVersionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.GetVersionRequest + * @static + * @param {google.cloud.apihub.v1.IGetVersionRequest} message GetVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetVersionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.GetVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.GetVersionRequest} GetVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetVersionRequest.decode = function 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.apihub.v1.GetVersionRequest(); + 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 GetVersionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.GetVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.GetVersionRequest} GetVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetVersionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetVersionRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.GetVersionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetVersionRequest.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 GetVersionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.GetVersionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.GetVersionRequest} GetVersionRequest + */ + GetVersionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.GetVersionRequest) + return object; + var message = new $root.google.cloud.apihub.v1.GetVersionRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetVersionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.GetVersionRequest + * @static + * @param {google.cloud.apihub.v1.GetVersionRequest} message GetVersionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetVersionRequest.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 GetVersionRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.GetVersionRequest + * @instance + * @returns {Object.} JSON object + */ + GetVersionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetVersionRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.GetVersionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.GetVersionRequest"; + }; + + return GetVersionRequest; + })(); + + v1.UpdateVersionRequest = (function() { + + /** + * Properties of an UpdateVersionRequest. + * @memberof google.cloud.apihub.v1 + * @interface IUpdateVersionRequest + * @property {google.cloud.apihub.v1.IVersion|null} [version] UpdateVersionRequest version + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateVersionRequest updateMask + */ + + /** + * Constructs a new UpdateVersionRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents an UpdateVersionRequest. + * @implements IUpdateVersionRequest + * @constructor + * @param {google.cloud.apihub.v1.IUpdateVersionRequest=} [properties] Properties to set + */ + function UpdateVersionRequest(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]]; + } + + /** + * UpdateVersionRequest version. + * @member {google.cloud.apihub.v1.IVersion|null|undefined} version + * @memberof google.cloud.apihub.v1.UpdateVersionRequest + * @instance + */ + UpdateVersionRequest.prototype.version = null; + + /** + * UpdateVersionRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.apihub.v1.UpdateVersionRequest + * @instance + */ + UpdateVersionRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateVersionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.UpdateVersionRequest + * @static + * @param {google.cloud.apihub.v1.IUpdateVersionRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.UpdateVersionRequest} UpdateVersionRequest instance + */ + UpdateVersionRequest.create = function create(properties) { + return new UpdateVersionRequest(properties); + }; + + /** + * Encodes the specified UpdateVersionRequest message. Does not implicitly {@link google.cloud.apihub.v1.UpdateVersionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.UpdateVersionRequest + * @static + * @param {google.cloud.apihub.v1.IUpdateVersionRequest} message UpdateVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateVersionRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + $root.google.cloud.apihub.v1.Version.encode(message.version, 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 UpdateVersionRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.UpdateVersionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.UpdateVersionRequest + * @static + * @param {google.cloud.apihub.v1.IUpdateVersionRequest} message UpdateVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateVersionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.UpdateVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.UpdateVersionRequest} UpdateVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateVersionRequest.decode = function 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.apihub.v1.UpdateVersionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.version = $root.google.cloud.apihub.v1.Version.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 UpdateVersionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.UpdateVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.UpdateVersionRequest} UpdateVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateVersionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateVersionRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.UpdateVersionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateVersionRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.version != null && message.hasOwnProperty("version")) { + var error = $root.google.cloud.apihub.v1.Version.verify(message.version); + if (error) + return "version." + 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 UpdateVersionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.UpdateVersionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.UpdateVersionRequest} UpdateVersionRequest + */ + UpdateVersionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.UpdateVersionRequest) + return object; + var message = new $root.google.cloud.apihub.v1.UpdateVersionRequest(); + if (object.version != null) { + if (typeof object.version !== "object") + throw TypeError(".google.cloud.apihub.v1.UpdateVersionRequest.version: object expected"); + message.version = $root.google.cloud.apihub.v1.Version.fromObject(object.version); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.apihub.v1.UpdateVersionRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateVersionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.UpdateVersionRequest + * @static + * @param {google.cloud.apihub.v1.UpdateVersionRequest} message UpdateVersionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateVersionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.version = null; + object.updateMask = null; + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = $root.google.cloud.apihub.v1.Version.toObject(message.version, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateVersionRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.UpdateVersionRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateVersionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateVersionRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.UpdateVersionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.UpdateVersionRequest"; + }; + + return UpdateVersionRequest; + })(); + + v1.DeleteVersionRequest = (function() { + + /** + * Properties of a DeleteVersionRequest. + * @memberof google.cloud.apihub.v1 + * @interface IDeleteVersionRequest + * @property {string|null} [name] DeleteVersionRequest name + * @property {boolean|null} [force] DeleteVersionRequest force + */ + + /** + * Constructs a new DeleteVersionRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a DeleteVersionRequest. + * @implements IDeleteVersionRequest + * @constructor + * @param {google.cloud.apihub.v1.IDeleteVersionRequest=} [properties] Properties to set + */ + function DeleteVersionRequest(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]]; + } + + /** + * DeleteVersionRequest name. + * @member {string} name + * @memberof google.cloud.apihub.v1.DeleteVersionRequest + * @instance + */ + DeleteVersionRequest.prototype.name = ""; + + /** + * DeleteVersionRequest force. + * @member {boolean} force + * @memberof google.cloud.apihub.v1.DeleteVersionRequest + * @instance + */ + DeleteVersionRequest.prototype.force = false; + + /** + * Creates a new DeleteVersionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.DeleteVersionRequest + * @static + * @param {google.cloud.apihub.v1.IDeleteVersionRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.DeleteVersionRequest} DeleteVersionRequest instance + */ + DeleteVersionRequest.create = function create(properties) { + return new DeleteVersionRequest(properties); + }; + + /** + * Encodes the specified DeleteVersionRequest message. Does not implicitly {@link google.cloud.apihub.v1.DeleteVersionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.DeleteVersionRequest + * @static + * @param {google.cloud.apihub.v1.IDeleteVersionRequest} message DeleteVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteVersionRequest.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.force != null && Object.hasOwnProperty.call(message, "force")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.force); + return writer; + }; + + /** + * Encodes the specified DeleteVersionRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.DeleteVersionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.DeleteVersionRequest + * @static + * @param {google.cloud.apihub.v1.IDeleteVersionRequest} message DeleteVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteVersionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.DeleteVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.DeleteVersionRequest} DeleteVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteVersionRequest.decode = function 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.apihub.v1.DeleteVersionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.force = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteVersionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.DeleteVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.DeleteVersionRequest} DeleteVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteVersionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteVersionRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.DeleteVersionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteVersionRequest.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.force != null && message.hasOwnProperty("force")) + if (typeof message.force !== "boolean") + return "force: boolean expected"; + return null; + }; + + /** + * Creates a DeleteVersionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.DeleteVersionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.DeleteVersionRequest} DeleteVersionRequest + */ + DeleteVersionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.DeleteVersionRequest) + return object; + var message = new $root.google.cloud.apihub.v1.DeleteVersionRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.force != null) + message.force = Boolean(object.force); + return message; + }; + + /** + * Creates a plain object from a DeleteVersionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.DeleteVersionRequest + * @static + * @param {google.cloud.apihub.v1.DeleteVersionRequest} message DeleteVersionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteVersionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.force = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.force != null && message.hasOwnProperty("force")) + object.force = message.force; + return object; + }; + + /** + * Converts this DeleteVersionRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.DeleteVersionRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteVersionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteVersionRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.DeleteVersionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.DeleteVersionRequest"; + }; + + return DeleteVersionRequest; + })(); + + v1.ListVersionsRequest = (function() { + + /** + * Properties of a ListVersionsRequest. + * @memberof google.cloud.apihub.v1 + * @interface IListVersionsRequest + * @property {string|null} [parent] ListVersionsRequest parent + * @property {string|null} [filter] ListVersionsRequest filter + * @property {number|null} [pageSize] ListVersionsRequest pageSize + * @property {string|null} [pageToken] ListVersionsRequest pageToken + */ + + /** + * Constructs a new ListVersionsRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a ListVersionsRequest. + * @implements IListVersionsRequest + * @constructor + * @param {google.cloud.apihub.v1.IListVersionsRequest=} [properties] Properties to set + */ + function ListVersionsRequest(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]]; + } + + /** + * ListVersionsRequest parent. + * @member {string} parent + * @memberof google.cloud.apihub.v1.ListVersionsRequest + * @instance + */ + ListVersionsRequest.prototype.parent = ""; + + /** + * ListVersionsRequest filter. + * @member {string} filter + * @memberof google.cloud.apihub.v1.ListVersionsRequest + * @instance + */ + ListVersionsRequest.prototype.filter = ""; + + /** + * ListVersionsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.apihub.v1.ListVersionsRequest + * @instance + */ + ListVersionsRequest.prototype.pageSize = 0; + + /** + * ListVersionsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.apihub.v1.ListVersionsRequest + * @instance + */ + ListVersionsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListVersionsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.ListVersionsRequest + * @static + * @param {google.cloud.apihub.v1.IListVersionsRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.ListVersionsRequest} ListVersionsRequest instance + */ + ListVersionsRequest.create = function create(properties) { + return new ListVersionsRequest(properties); + }; + + /** + * Encodes the specified ListVersionsRequest message. Does not implicitly {@link google.cloud.apihub.v1.ListVersionsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.ListVersionsRequest + * @static + * @param {google.cloud.apihub.v1.IListVersionsRequest} message ListVersionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListVersionsRequest.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.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListVersionsRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListVersionsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.ListVersionsRequest + * @static + * @param {google.cloud.apihub.v1.IListVersionsRequest} message ListVersionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListVersionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListVersionsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.ListVersionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.ListVersionsRequest} ListVersionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListVersionsRequest.decode = function 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.apihub.v1.ListVersionsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.filter = reader.string(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + case 4: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListVersionsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.ListVersionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.ListVersionsRequest} ListVersionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListVersionsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListVersionsRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.ListVersionsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListVersionsRequest.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.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 ListVersionsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.ListVersionsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.ListVersionsRequest} ListVersionsRequest + */ + ListVersionsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.ListVersionsRequest) + return object; + var message = new $root.google.cloud.apihub.v1.ListVersionsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + 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 ListVersionsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.ListVersionsRequest + * @static + * @param {google.cloud.apihub.v1.ListVersionsRequest} message ListVersionsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListVersionsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + 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; + return object; + }; + + /** + * Converts this ListVersionsRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.ListVersionsRequest + * @instance + * @returns {Object.} JSON object + */ + ListVersionsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListVersionsRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.ListVersionsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListVersionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.ListVersionsRequest"; + }; + + return ListVersionsRequest; + })(); + + v1.ListVersionsResponse = (function() { + + /** + * Properties of a ListVersionsResponse. + * @memberof google.cloud.apihub.v1 + * @interface IListVersionsResponse + * @property {Array.|null} [versions] ListVersionsResponse versions + * @property {string|null} [nextPageToken] ListVersionsResponse nextPageToken + */ + + /** + * Constructs a new ListVersionsResponse. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a ListVersionsResponse. + * @implements IListVersionsResponse + * @constructor + * @param {google.cloud.apihub.v1.IListVersionsResponse=} [properties] Properties to set + */ + function ListVersionsResponse(properties) { + this.versions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListVersionsResponse versions. + * @member {Array.} versions + * @memberof google.cloud.apihub.v1.ListVersionsResponse + * @instance + */ + ListVersionsResponse.prototype.versions = $util.emptyArray; + + /** + * ListVersionsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.apihub.v1.ListVersionsResponse + * @instance + */ + ListVersionsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListVersionsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.ListVersionsResponse + * @static + * @param {google.cloud.apihub.v1.IListVersionsResponse=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.ListVersionsResponse} ListVersionsResponse instance + */ + ListVersionsResponse.create = function create(properties) { + return new ListVersionsResponse(properties); + }; + + /** + * Encodes the specified ListVersionsResponse message. Does not implicitly {@link google.cloud.apihub.v1.ListVersionsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.ListVersionsResponse + * @static + * @param {google.cloud.apihub.v1.IListVersionsResponse} message ListVersionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListVersionsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.versions != null && message.versions.length) + for (var i = 0; i < message.versions.length; ++i) + $root.google.cloud.apihub.v1.Version.encode(message.versions[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 ListVersionsResponse message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListVersionsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.ListVersionsResponse + * @static + * @param {google.cloud.apihub.v1.IListVersionsResponse} message ListVersionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListVersionsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListVersionsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.ListVersionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.ListVersionsResponse} ListVersionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListVersionsResponse.decode = function 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.apihub.v1.ListVersionsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.versions && message.versions.length)) + message.versions = []; + message.versions.push($root.google.cloud.apihub.v1.Version.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListVersionsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.ListVersionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.ListVersionsResponse} ListVersionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListVersionsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListVersionsResponse message. + * @function verify + * @memberof google.cloud.apihub.v1.ListVersionsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListVersionsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.versions != null && message.hasOwnProperty("versions")) { + if (!Array.isArray(message.versions)) + return "versions: array expected"; + for (var i = 0; i < message.versions.length; ++i) { + var error = $root.google.cloud.apihub.v1.Version.verify(message.versions[i]); + if (error) + return "versions." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListVersionsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.ListVersionsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.ListVersionsResponse} ListVersionsResponse + */ + ListVersionsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.ListVersionsResponse) + return object; + var message = new $root.google.cloud.apihub.v1.ListVersionsResponse(); + if (object.versions) { + if (!Array.isArray(object.versions)) + throw TypeError(".google.cloud.apihub.v1.ListVersionsResponse.versions: array expected"); + message.versions = []; + for (var i = 0; i < object.versions.length; ++i) { + if (typeof object.versions[i] !== "object") + throw TypeError(".google.cloud.apihub.v1.ListVersionsResponse.versions: object expected"); + message.versions[i] = $root.google.cloud.apihub.v1.Version.fromObject(object.versions[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListVersionsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.ListVersionsResponse + * @static + * @param {google.cloud.apihub.v1.ListVersionsResponse} message ListVersionsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListVersionsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.versions = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.versions && message.versions.length) { + object.versions = []; + for (var j = 0; j < message.versions.length; ++j) + object.versions[j] = $root.google.cloud.apihub.v1.Version.toObject(message.versions[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListVersionsResponse to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.ListVersionsResponse + * @instance + * @returns {Object.} JSON object + */ + ListVersionsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListVersionsResponse + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.ListVersionsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListVersionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.ListVersionsResponse"; + }; + + return ListVersionsResponse; + })(); + + v1.CreateSpecRequest = (function() { + + /** + * Properties of a CreateSpecRequest. + * @memberof google.cloud.apihub.v1 + * @interface ICreateSpecRequest + * @property {string|null} [parent] CreateSpecRequest parent + * @property {string|null} [specId] CreateSpecRequest specId + * @property {google.cloud.apihub.v1.ISpec|null} [spec] CreateSpecRequest spec + */ + + /** + * Constructs a new CreateSpecRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a CreateSpecRequest. + * @implements ICreateSpecRequest + * @constructor + * @param {google.cloud.apihub.v1.ICreateSpecRequest=} [properties] Properties to set + */ + function CreateSpecRequest(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]]; + } + + /** + * CreateSpecRequest parent. + * @member {string} parent + * @memberof google.cloud.apihub.v1.CreateSpecRequest + * @instance + */ + CreateSpecRequest.prototype.parent = ""; + + /** + * CreateSpecRequest specId. + * @member {string} specId + * @memberof google.cloud.apihub.v1.CreateSpecRequest + * @instance + */ + CreateSpecRequest.prototype.specId = ""; + + /** + * CreateSpecRequest spec. + * @member {google.cloud.apihub.v1.ISpec|null|undefined} spec + * @memberof google.cloud.apihub.v1.CreateSpecRequest + * @instance + */ + CreateSpecRequest.prototype.spec = null; + + /** + * Creates a new CreateSpecRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.CreateSpecRequest + * @static + * @param {google.cloud.apihub.v1.ICreateSpecRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.CreateSpecRequest} CreateSpecRequest instance + */ + CreateSpecRequest.create = function create(properties) { + return new CreateSpecRequest(properties); + }; + + /** + * Encodes the specified CreateSpecRequest message. Does not implicitly {@link google.cloud.apihub.v1.CreateSpecRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.CreateSpecRequest + * @static + * @param {google.cloud.apihub.v1.ICreateSpecRequest} message CreateSpecRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSpecRequest.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.specId != null && Object.hasOwnProperty.call(message, "specId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.specId); + if (message.spec != null && Object.hasOwnProperty.call(message, "spec")) + $root.google.cloud.apihub.v1.Spec.encode(message.spec, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateSpecRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.CreateSpecRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.CreateSpecRequest + * @static + * @param {google.cloud.apihub.v1.ICreateSpecRequest} message CreateSpecRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSpecRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateSpecRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.CreateSpecRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.CreateSpecRequest} CreateSpecRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSpecRequest.decode = function 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.apihub.v1.CreateSpecRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.specId = reader.string(); + break; + } + case 3: { + message.spec = $root.google.cloud.apihub.v1.Spec.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateSpecRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.CreateSpecRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.CreateSpecRequest} CreateSpecRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSpecRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateSpecRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.CreateSpecRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateSpecRequest.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.specId != null && message.hasOwnProperty("specId")) + if (!$util.isString(message.specId)) + return "specId: string expected"; + if (message.spec != null && message.hasOwnProperty("spec")) { + var error = $root.google.cloud.apihub.v1.Spec.verify(message.spec); + if (error) + return "spec." + error; + } + return null; + }; + + /** + * Creates a CreateSpecRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.CreateSpecRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.CreateSpecRequest} CreateSpecRequest + */ + CreateSpecRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.CreateSpecRequest) + return object; + var message = new $root.google.cloud.apihub.v1.CreateSpecRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.specId != null) + message.specId = String(object.specId); + if (object.spec != null) { + if (typeof object.spec !== "object") + throw TypeError(".google.cloud.apihub.v1.CreateSpecRequest.spec: object expected"); + message.spec = $root.google.cloud.apihub.v1.Spec.fromObject(object.spec); + } + return message; + }; + + /** + * Creates a plain object from a CreateSpecRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.CreateSpecRequest + * @static + * @param {google.cloud.apihub.v1.CreateSpecRequest} message CreateSpecRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateSpecRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.specId = ""; + object.spec = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.specId != null && message.hasOwnProperty("specId")) + object.specId = message.specId; + if (message.spec != null && message.hasOwnProperty("spec")) + object.spec = $root.google.cloud.apihub.v1.Spec.toObject(message.spec, options); + return object; + }; + + /** + * Converts this CreateSpecRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.CreateSpecRequest + * @instance + * @returns {Object.} JSON object + */ + CreateSpecRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateSpecRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.CreateSpecRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateSpecRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.CreateSpecRequest"; + }; + + return CreateSpecRequest; + })(); + + v1.GetSpecRequest = (function() { + + /** + * Properties of a GetSpecRequest. + * @memberof google.cloud.apihub.v1 + * @interface IGetSpecRequest + * @property {string|null} [name] GetSpecRequest name + */ + + /** + * Constructs a new GetSpecRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a GetSpecRequest. + * @implements IGetSpecRequest + * @constructor + * @param {google.cloud.apihub.v1.IGetSpecRequest=} [properties] Properties to set + */ + function GetSpecRequest(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]]; + } + + /** + * GetSpecRequest name. + * @member {string} name + * @memberof google.cloud.apihub.v1.GetSpecRequest + * @instance + */ + GetSpecRequest.prototype.name = ""; + + /** + * Creates a new GetSpecRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.GetSpecRequest + * @static + * @param {google.cloud.apihub.v1.IGetSpecRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.GetSpecRequest} GetSpecRequest instance + */ + GetSpecRequest.create = function create(properties) { + return new GetSpecRequest(properties); + }; + + /** + * Encodes the specified GetSpecRequest message. Does not implicitly {@link google.cloud.apihub.v1.GetSpecRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.GetSpecRequest + * @static + * @param {google.cloud.apihub.v1.IGetSpecRequest} message GetSpecRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSpecRequest.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 GetSpecRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.GetSpecRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.GetSpecRequest + * @static + * @param {google.cloud.apihub.v1.IGetSpecRequest} message GetSpecRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSpecRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetSpecRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.GetSpecRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.GetSpecRequest} GetSpecRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSpecRequest.decode = function 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.apihub.v1.GetSpecRequest(); + 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 GetSpecRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.GetSpecRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.GetSpecRequest} GetSpecRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSpecRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetSpecRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.GetSpecRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetSpecRequest.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 GetSpecRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.GetSpecRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.GetSpecRequest} GetSpecRequest + */ + GetSpecRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.GetSpecRequest) + return object; + var message = new $root.google.cloud.apihub.v1.GetSpecRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetSpecRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.GetSpecRequest + * @static + * @param {google.cloud.apihub.v1.GetSpecRequest} message GetSpecRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetSpecRequest.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 GetSpecRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.GetSpecRequest + * @instance + * @returns {Object.} JSON object + */ + GetSpecRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetSpecRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.GetSpecRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetSpecRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.GetSpecRequest"; + }; + + return GetSpecRequest; + })(); + + v1.UpdateSpecRequest = (function() { + + /** + * Properties of an UpdateSpecRequest. + * @memberof google.cloud.apihub.v1 + * @interface IUpdateSpecRequest + * @property {google.cloud.apihub.v1.ISpec|null} [spec] UpdateSpecRequest spec + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateSpecRequest updateMask + */ + + /** + * Constructs a new UpdateSpecRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents an UpdateSpecRequest. + * @implements IUpdateSpecRequest + * @constructor + * @param {google.cloud.apihub.v1.IUpdateSpecRequest=} [properties] Properties to set + */ + function UpdateSpecRequest(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]]; + } + + /** + * UpdateSpecRequest spec. + * @member {google.cloud.apihub.v1.ISpec|null|undefined} spec + * @memberof google.cloud.apihub.v1.UpdateSpecRequest + * @instance + */ + UpdateSpecRequest.prototype.spec = null; + + /** + * UpdateSpecRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.apihub.v1.UpdateSpecRequest + * @instance + */ + UpdateSpecRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateSpecRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.UpdateSpecRequest + * @static + * @param {google.cloud.apihub.v1.IUpdateSpecRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.UpdateSpecRequest} UpdateSpecRequest instance + */ + UpdateSpecRequest.create = function create(properties) { + return new UpdateSpecRequest(properties); + }; + + /** + * Encodes the specified UpdateSpecRequest message. Does not implicitly {@link google.cloud.apihub.v1.UpdateSpecRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.UpdateSpecRequest + * @static + * @param {google.cloud.apihub.v1.IUpdateSpecRequest} message UpdateSpecRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSpecRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.spec != null && Object.hasOwnProperty.call(message, "spec")) + $root.google.cloud.apihub.v1.Spec.encode(message.spec, 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 UpdateSpecRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.UpdateSpecRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.UpdateSpecRequest + * @static + * @param {google.cloud.apihub.v1.IUpdateSpecRequest} message UpdateSpecRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSpecRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateSpecRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.UpdateSpecRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.UpdateSpecRequest} UpdateSpecRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSpecRequest.decode = function 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.apihub.v1.UpdateSpecRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.spec = $root.google.cloud.apihub.v1.Spec.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 UpdateSpecRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.UpdateSpecRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.UpdateSpecRequest} UpdateSpecRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSpecRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateSpecRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.UpdateSpecRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateSpecRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.spec != null && message.hasOwnProperty("spec")) { + var error = $root.google.cloud.apihub.v1.Spec.verify(message.spec); + if (error) + return "spec." + 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 UpdateSpecRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.UpdateSpecRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.UpdateSpecRequest} UpdateSpecRequest + */ + UpdateSpecRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.UpdateSpecRequest) + return object; + var message = new $root.google.cloud.apihub.v1.UpdateSpecRequest(); + if (object.spec != null) { + if (typeof object.spec !== "object") + throw TypeError(".google.cloud.apihub.v1.UpdateSpecRequest.spec: object expected"); + message.spec = $root.google.cloud.apihub.v1.Spec.fromObject(object.spec); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.apihub.v1.UpdateSpecRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateSpecRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.UpdateSpecRequest + * @static + * @param {google.cloud.apihub.v1.UpdateSpecRequest} message UpdateSpecRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateSpecRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.spec = null; + object.updateMask = null; + } + if (message.spec != null && message.hasOwnProperty("spec")) + object.spec = $root.google.cloud.apihub.v1.Spec.toObject(message.spec, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateSpecRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.UpdateSpecRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateSpecRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateSpecRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.UpdateSpecRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateSpecRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.UpdateSpecRequest"; + }; + + return UpdateSpecRequest; + })(); + + v1.DeleteSpecRequest = (function() { + + /** + * Properties of a DeleteSpecRequest. + * @memberof google.cloud.apihub.v1 + * @interface IDeleteSpecRequest + * @property {string|null} [name] DeleteSpecRequest name + */ + + /** + * Constructs a new DeleteSpecRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a DeleteSpecRequest. + * @implements IDeleteSpecRequest + * @constructor + * @param {google.cloud.apihub.v1.IDeleteSpecRequest=} [properties] Properties to set + */ + function DeleteSpecRequest(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]]; + } + + /** + * DeleteSpecRequest name. + * @member {string} name + * @memberof google.cloud.apihub.v1.DeleteSpecRequest + * @instance + */ + DeleteSpecRequest.prototype.name = ""; + + /** + * Creates a new DeleteSpecRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.DeleteSpecRequest + * @static + * @param {google.cloud.apihub.v1.IDeleteSpecRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.DeleteSpecRequest} DeleteSpecRequest instance + */ + DeleteSpecRequest.create = function create(properties) { + return new DeleteSpecRequest(properties); + }; + + /** + * Encodes the specified DeleteSpecRequest message. Does not implicitly {@link google.cloud.apihub.v1.DeleteSpecRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.DeleteSpecRequest + * @static + * @param {google.cloud.apihub.v1.IDeleteSpecRequest} message DeleteSpecRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSpecRequest.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 DeleteSpecRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.DeleteSpecRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.DeleteSpecRequest + * @static + * @param {google.cloud.apihub.v1.IDeleteSpecRequest} message DeleteSpecRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSpecRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteSpecRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.DeleteSpecRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.DeleteSpecRequest} DeleteSpecRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSpecRequest.decode = function 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.apihub.v1.DeleteSpecRequest(); + 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 DeleteSpecRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.DeleteSpecRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.DeleteSpecRequest} DeleteSpecRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSpecRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteSpecRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.DeleteSpecRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteSpecRequest.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 DeleteSpecRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.DeleteSpecRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.DeleteSpecRequest} DeleteSpecRequest + */ + DeleteSpecRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.DeleteSpecRequest) + return object; + var message = new $root.google.cloud.apihub.v1.DeleteSpecRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteSpecRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.DeleteSpecRequest + * @static + * @param {google.cloud.apihub.v1.DeleteSpecRequest} message DeleteSpecRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteSpecRequest.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 DeleteSpecRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.DeleteSpecRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteSpecRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteSpecRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.DeleteSpecRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteSpecRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.DeleteSpecRequest"; + }; + + return DeleteSpecRequest; + })(); + + v1.ListSpecsRequest = (function() { + + /** + * Properties of a ListSpecsRequest. + * @memberof google.cloud.apihub.v1 + * @interface IListSpecsRequest + * @property {string|null} [parent] ListSpecsRequest parent + * @property {string|null} [filter] ListSpecsRequest filter + * @property {number|null} [pageSize] ListSpecsRequest pageSize + * @property {string|null} [pageToken] ListSpecsRequest pageToken + */ + + /** + * Constructs a new ListSpecsRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a ListSpecsRequest. + * @implements IListSpecsRequest + * @constructor + * @param {google.cloud.apihub.v1.IListSpecsRequest=} [properties] Properties to set + */ + function ListSpecsRequest(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]]; + } + + /** + * ListSpecsRequest parent. + * @member {string} parent + * @memberof google.cloud.apihub.v1.ListSpecsRequest + * @instance + */ + ListSpecsRequest.prototype.parent = ""; + + /** + * ListSpecsRequest filter. + * @member {string} filter + * @memberof google.cloud.apihub.v1.ListSpecsRequest + * @instance + */ + ListSpecsRequest.prototype.filter = ""; + + /** + * ListSpecsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.apihub.v1.ListSpecsRequest + * @instance + */ + ListSpecsRequest.prototype.pageSize = 0; + + /** + * ListSpecsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.apihub.v1.ListSpecsRequest + * @instance + */ + ListSpecsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListSpecsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.ListSpecsRequest + * @static + * @param {google.cloud.apihub.v1.IListSpecsRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.ListSpecsRequest} ListSpecsRequest instance + */ + ListSpecsRequest.create = function create(properties) { + return new ListSpecsRequest(properties); + }; + + /** + * Encodes the specified ListSpecsRequest message. Does not implicitly {@link google.cloud.apihub.v1.ListSpecsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.ListSpecsRequest + * @static + * @param {google.cloud.apihub.v1.IListSpecsRequest} message ListSpecsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSpecsRequest.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.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListSpecsRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListSpecsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.ListSpecsRequest + * @static + * @param {google.cloud.apihub.v1.IListSpecsRequest} message ListSpecsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSpecsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSpecsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.ListSpecsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.ListSpecsRequest} ListSpecsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSpecsRequest.decode = function 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.apihub.v1.ListSpecsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.filter = reader.string(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + case 4: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListSpecsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.ListSpecsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.ListSpecsRequest} ListSpecsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSpecsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSpecsRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.ListSpecsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSpecsRequest.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.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 ListSpecsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.ListSpecsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.ListSpecsRequest} ListSpecsRequest + */ + ListSpecsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.ListSpecsRequest) + return object; + var message = new $root.google.cloud.apihub.v1.ListSpecsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + 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 ListSpecsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.ListSpecsRequest + * @static + * @param {google.cloud.apihub.v1.ListSpecsRequest} message ListSpecsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSpecsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + 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; + return object; + }; + + /** + * Converts this ListSpecsRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.ListSpecsRequest + * @instance + * @returns {Object.} JSON object + */ + ListSpecsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSpecsRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.ListSpecsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSpecsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.ListSpecsRequest"; + }; + + return ListSpecsRequest; + })(); + + v1.ListSpecsResponse = (function() { + + /** + * Properties of a ListSpecsResponse. + * @memberof google.cloud.apihub.v1 + * @interface IListSpecsResponse + * @property {Array.|null} [specs] ListSpecsResponse specs + * @property {string|null} [nextPageToken] ListSpecsResponse nextPageToken + */ + + /** + * Constructs a new ListSpecsResponse. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a ListSpecsResponse. + * @implements IListSpecsResponse + * @constructor + * @param {google.cloud.apihub.v1.IListSpecsResponse=} [properties] Properties to set + */ + function ListSpecsResponse(properties) { + this.specs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListSpecsResponse specs. + * @member {Array.} specs + * @memberof google.cloud.apihub.v1.ListSpecsResponse + * @instance + */ + ListSpecsResponse.prototype.specs = $util.emptyArray; + + /** + * ListSpecsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.apihub.v1.ListSpecsResponse + * @instance + */ + ListSpecsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListSpecsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.ListSpecsResponse + * @static + * @param {google.cloud.apihub.v1.IListSpecsResponse=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.ListSpecsResponse} ListSpecsResponse instance + */ + ListSpecsResponse.create = function create(properties) { + return new ListSpecsResponse(properties); + }; + + /** + * Encodes the specified ListSpecsResponse message. Does not implicitly {@link google.cloud.apihub.v1.ListSpecsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.ListSpecsResponse + * @static + * @param {google.cloud.apihub.v1.IListSpecsResponse} message ListSpecsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSpecsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.specs != null && message.specs.length) + for (var i = 0; i < message.specs.length; ++i) + $root.google.cloud.apihub.v1.Spec.encode(message.specs[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 ListSpecsResponse message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListSpecsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.ListSpecsResponse + * @static + * @param {google.cloud.apihub.v1.IListSpecsResponse} message ListSpecsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSpecsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSpecsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.ListSpecsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.ListSpecsResponse} ListSpecsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSpecsResponse.decode = function 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.apihub.v1.ListSpecsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.specs && message.specs.length)) + message.specs = []; + message.specs.push($root.google.cloud.apihub.v1.Spec.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListSpecsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.ListSpecsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.ListSpecsResponse} ListSpecsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSpecsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSpecsResponse message. + * @function verify + * @memberof google.cloud.apihub.v1.ListSpecsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSpecsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.specs != null && message.hasOwnProperty("specs")) { + if (!Array.isArray(message.specs)) + return "specs: array expected"; + for (var i = 0; i < message.specs.length; ++i) { + var error = $root.google.cloud.apihub.v1.Spec.verify(message.specs[i]); + if (error) + return "specs." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListSpecsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.ListSpecsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.ListSpecsResponse} ListSpecsResponse + */ + ListSpecsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.ListSpecsResponse) + return object; + var message = new $root.google.cloud.apihub.v1.ListSpecsResponse(); + if (object.specs) { + if (!Array.isArray(object.specs)) + throw TypeError(".google.cloud.apihub.v1.ListSpecsResponse.specs: array expected"); + message.specs = []; + for (var i = 0; i < object.specs.length; ++i) { + if (typeof object.specs[i] !== "object") + throw TypeError(".google.cloud.apihub.v1.ListSpecsResponse.specs: object expected"); + message.specs[i] = $root.google.cloud.apihub.v1.Spec.fromObject(object.specs[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListSpecsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.ListSpecsResponse + * @static + * @param {google.cloud.apihub.v1.ListSpecsResponse} message ListSpecsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSpecsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.specs = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.specs && message.specs.length) { + object.specs = []; + for (var j = 0; j < message.specs.length; ++j) + object.specs[j] = $root.google.cloud.apihub.v1.Spec.toObject(message.specs[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListSpecsResponse to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.ListSpecsResponse + * @instance + * @returns {Object.} JSON object + */ + ListSpecsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSpecsResponse + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.ListSpecsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSpecsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.ListSpecsResponse"; + }; + + return ListSpecsResponse; + })(); + + v1.GetSpecContentsRequest = (function() { + + /** + * Properties of a GetSpecContentsRequest. + * @memberof google.cloud.apihub.v1 + * @interface IGetSpecContentsRequest + * @property {string|null} [name] GetSpecContentsRequest name + */ + + /** + * Constructs a new GetSpecContentsRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a GetSpecContentsRequest. + * @implements IGetSpecContentsRequest + * @constructor + * @param {google.cloud.apihub.v1.IGetSpecContentsRequest=} [properties] Properties to set + */ + function GetSpecContentsRequest(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]]; + } + + /** + * GetSpecContentsRequest name. + * @member {string} name + * @memberof google.cloud.apihub.v1.GetSpecContentsRequest + * @instance + */ + GetSpecContentsRequest.prototype.name = ""; + + /** + * Creates a new GetSpecContentsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.GetSpecContentsRequest + * @static + * @param {google.cloud.apihub.v1.IGetSpecContentsRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.GetSpecContentsRequest} GetSpecContentsRequest instance + */ + GetSpecContentsRequest.create = function create(properties) { + return new GetSpecContentsRequest(properties); + }; + + /** + * Encodes the specified GetSpecContentsRequest message. Does not implicitly {@link google.cloud.apihub.v1.GetSpecContentsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.GetSpecContentsRequest + * @static + * @param {google.cloud.apihub.v1.IGetSpecContentsRequest} message GetSpecContentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSpecContentsRequest.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 GetSpecContentsRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.GetSpecContentsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.GetSpecContentsRequest + * @static + * @param {google.cloud.apihub.v1.IGetSpecContentsRequest} message GetSpecContentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSpecContentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetSpecContentsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.GetSpecContentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.GetSpecContentsRequest} GetSpecContentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSpecContentsRequest.decode = function 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.apihub.v1.GetSpecContentsRequest(); + 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 GetSpecContentsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.GetSpecContentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.GetSpecContentsRequest} GetSpecContentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSpecContentsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetSpecContentsRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.GetSpecContentsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetSpecContentsRequest.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 GetSpecContentsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.GetSpecContentsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.GetSpecContentsRequest} GetSpecContentsRequest + */ + GetSpecContentsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.GetSpecContentsRequest) + return object; + var message = new $root.google.cloud.apihub.v1.GetSpecContentsRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetSpecContentsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.GetSpecContentsRequest + * @static + * @param {google.cloud.apihub.v1.GetSpecContentsRequest} message GetSpecContentsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetSpecContentsRequest.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 GetSpecContentsRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.GetSpecContentsRequest + * @instance + * @returns {Object.} JSON object + */ + GetSpecContentsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetSpecContentsRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.GetSpecContentsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetSpecContentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.GetSpecContentsRequest"; + }; + + return GetSpecContentsRequest; + })(); + + v1.GetApiOperationRequest = (function() { + + /** + * Properties of a GetApiOperationRequest. + * @memberof google.cloud.apihub.v1 + * @interface IGetApiOperationRequest + * @property {string|null} [name] GetApiOperationRequest name + */ + + /** + * Constructs a new GetApiOperationRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a GetApiOperationRequest. + * @implements IGetApiOperationRequest + * @constructor + * @param {google.cloud.apihub.v1.IGetApiOperationRequest=} [properties] Properties to set + */ + function GetApiOperationRequest(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]]; + } + + /** + * GetApiOperationRequest name. + * @member {string} name + * @memberof google.cloud.apihub.v1.GetApiOperationRequest + * @instance + */ + GetApiOperationRequest.prototype.name = ""; + + /** + * Creates a new GetApiOperationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.GetApiOperationRequest + * @static + * @param {google.cloud.apihub.v1.IGetApiOperationRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.GetApiOperationRequest} GetApiOperationRequest instance + */ + GetApiOperationRequest.create = function create(properties) { + return new GetApiOperationRequest(properties); + }; + + /** + * Encodes the specified GetApiOperationRequest message. Does not implicitly {@link google.cloud.apihub.v1.GetApiOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.GetApiOperationRequest + * @static + * @param {google.cloud.apihub.v1.IGetApiOperationRequest} message GetApiOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetApiOperationRequest.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 GetApiOperationRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.GetApiOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.GetApiOperationRequest + * @static + * @param {google.cloud.apihub.v1.IGetApiOperationRequest} message GetApiOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetApiOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetApiOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.GetApiOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.GetApiOperationRequest} GetApiOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetApiOperationRequest.decode = function 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.apihub.v1.GetApiOperationRequest(); + 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 GetApiOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.GetApiOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.GetApiOperationRequest} GetApiOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetApiOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetApiOperationRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.GetApiOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetApiOperationRequest.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 GetApiOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.GetApiOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.GetApiOperationRequest} GetApiOperationRequest + */ + GetApiOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.GetApiOperationRequest) + return object; + var message = new $root.google.cloud.apihub.v1.GetApiOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetApiOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.GetApiOperationRequest + * @static + * @param {google.cloud.apihub.v1.GetApiOperationRequest} message GetApiOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetApiOperationRequest.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 GetApiOperationRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.GetApiOperationRequest + * @instance + * @returns {Object.} JSON object + */ + GetApiOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetApiOperationRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.GetApiOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetApiOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.GetApiOperationRequest"; + }; + + return GetApiOperationRequest; + })(); + + v1.ListApiOperationsRequest = (function() { + + /** + * Properties of a ListApiOperationsRequest. + * @memberof google.cloud.apihub.v1 + * @interface IListApiOperationsRequest + * @property {string|null} [parent] ListApiOperationsRequest parent + * @property {string|null} [filter] ListApiOperationsRequest filter + * @property {number|null} [pageSize] ListApiOperationsRequest pageSize + * @property {string|null} [pageToken] ListApiOperationsRequest pageToken + */ + + /** + * Constructs a new ListApiOperationsRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a ListApiOperationsRequest. + * @implements IListApiOperationsRequest + * @constructor + * @param {google.cloud.apihub.v1.IListApiOperationsRequest=} [properties] Properties to set + */ + function ListApiOperationsRequest(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]]; + } + + /** + * ListApiOperationsRequest parent. + * @member {string} parent + * @memberof google.cloud.apihub.v1.ListApiOperationsRequest + * @instance + */ + ListApiOperationsRequest.prototype.parent = ""; + + /** + * ListApiOperationsRequest filter. + * @member {string} filter + * @memberof google.cloud.apihub.v1.ListApiOperationsRequest + * @instance + */ + ListApiOperationsRequest.prototype.filter = ""; + + /** + * ListApiOperationsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.apihub.v1.ListApiOperationsRequest + * @instance + */ + ListApiOperationsRequest.prototype.pageSize = 0; + + /** + * ListApiOperationsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.apihub.v1.ListApiOperationsRequest + * @instance + */ + ListApiOperationsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListApiOperationsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.ListApiOperationsRequest + * @static + * @param {google.cloud.apihub.v1.IListApiOperationsRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.ListApiOperationsRequest} ListApiOperationsRequest instance + */ + ListApiOperationsRequest.create = function create(properties) { + return new ListApiOperationsRequest(properties); + }; + + /** + * Encodes the specified ListApiOperationsRequest message. Does not implicitly {@link google.cloud.apihub.v1.ListApiOperationsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.ListApiOperationsRequest + * @static + * @param {google.cloud.apihub.v1.IListApiOperationsRequest} message ListApiOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListApiOperationsRequest.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.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListApiOperationsRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListApiOperationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.ListApiOperationsRequest + * @static + * @param {google.cloud.apihub.v1.IListApiOperationsRequest} message ListApiOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListApiOperationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListApiOperationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.ListApiOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.ListApiOperationsRequest} ListApiOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListApiOperationsRequest.decode = function 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.apihub.v1.ListApiOperationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.filter = reader.string(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + case 4: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListApiOperationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.ListApiOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.ListApiOperationsRequest} ListApiOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListApiOperationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListApiOperationsRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.ListApiOperationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListApiOperationsRequest.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.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 ListApiOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.ListApiOperationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.ListApiOperationsRequest} ListApiOperationsRequest + */ + ListApiOperationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.ListApiOperationsRequest) + return object; + var message = new $root.google.cloud.apihub.v1.ListApiOperationsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + 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 ListApiOperationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.ListApiOperationsRequest + * @static + * @param {google.cloud.apihub.v1.ListApiOperationsRequest} message ListApiOperationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListApiOperationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + 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; + return object; + }; + + /** + * Converts this ListApiOperationsRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.ListApiOperationsRequest + * @instance + * @returns {Object.} JSON object + */ + ListApiOperationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListApiOperationsRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.ListApiOperationsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListApiOperationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.ListApiOperationsRequest"; + }; + + return ListApiOperationsRequest; + })(); + + v1.ListApiOperationsResponse = (function() { + + /** + * Properties of a ListApiOperationsResponse. + * @memberof google.cloud.apihub.v1 + * @interface IListApiOperationsResponse + * @property {Array.|null} [apiOperations] ListApiOperationsResponse apiOperations + * @property {string|null} [nextPageToken] ListApiOperationsResponse nextPageToken + */ + + /** + * Constructs a new ListApiOperationsResponse. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a ListApiOperationsResponse. + * @implements IListApiOperationsResponse + * @constructor + * @param {google.cloud.apihub.v1.IListApiOperationsResponse=} [properties] Properties to set + */ + function ListApiOperationsResponse(properties) { + this.apiOperations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListApiOperationsResponse apiOperations. + * @member {Array.} apiOperations + * @memberof google.cloud.apihub.v1.ListApiOperationsResponse + * @instance + */ + ListApiOperationsResponse.prototype.apiOperations = $util.emptyArray; + + /** + * ListApiOperationsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.apihub.v1.ListApiOperationsResponse + * @instance + */ + ListApiOperationsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListApiOperationsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.ListApiOperationsResponse + * @static + * @param {google.cloud.apihub.v1.IListApiOperationsResponse=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.ListApiOperationsResponse} ListApiOperationsResponse instance + */ + ListApiOperationsResponse.create = function create(properties) { + return new ListApiOperationsResponse(properties); + }; + + /** + * Encodes the specified ListApiOperationsResponse message. Does not implicitly {@link google.cloud.apihub.v1.ListApiOperationsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.ListApiOperationsResponse + * @static + * @param {google.cloud.apihub.v1.IListApiOperationsResponse} message ListApiOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListApiOperationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.apiOperations != null && message.apiOperations.length) + for (var i = 0; i < message.apiOperations.length; ++i) + $root.google.cloud.apihub.v1.ApiOperation.encode(message.apiOperations[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 ListApiOperationsResponse message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListApiOperationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.ListApiOperationsResponse + * @static + * @param {google.cloud.apihub.v1.IListApiOperationsResponse} message ListApiOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListApiOperationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListApiOperationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.ListApiOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.ListApiOperationsResponse} ListApiOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListApiOperationsResponse.decode = function 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.apihub.v1.ListApiOperationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.apiOperations && message.apiOperations.length)) + message.apiOperations = []; + message.apiOperations.push($root.google.cloud.apihub.v1.ApiOperation.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListApiOperationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.ListApiOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.ListApiOperationsResponse} ListApiOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListApiOperationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListApiOperationsResponse message. + * @function verify + * @memberof google.cloud.apihub.v1.ListApiOperationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListApiOperationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.apiOperations != null && message.hasOwnProperty("apiOperations")) { + if (!Array.isArray(message.apiOperations)) + return "apiOperations: array expected"; + for (var i = 0; i < message.apiOperations.length; ++i) { + var error = $root.google.cloud.apihub.v1.ApiOperation.verify(message.apiOperations[i]); + if (error) + return "apiOperations." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListApiOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.ListApiOperationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.ListApiOperationsResponse} ListApiOperationsResponse + */ + ListApiOperationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.ListApiOperationsResponse) + return object; + var message = new $root.google.cloud.apihub.v1.ListApiOperationsResponse(); + if (object.apiOperations) { + if (!Array.isArray(object.apiOperations)) + throw TypeError(".google.cloud.apihub.v1.ListApiOperationsResponse.apiOperations: array expected"); + message.apiOperations = []; + for (var i = 0; i < object.apiOperations.length; ++i) { + if (typeof object.apiOperations[i] !== "object") + throw TypeError(".google.cloud.apihub.v1.ListApiOperationsResponse.apiOperations: object expected"); + message.apiOperations[i] = $root.google.cloud.apihub.v1.ApiOperation.fromObject(object.apiOperations[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListApiOperationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.ListApiOperationsResponse + * @static + * @param {google.cloud.apihub.v1.ListApiOperationsResponse} message ListApiOperationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListApiOperationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.apiOperations = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.apiOperations && message.apiOperations.length) { + object.apiOperations = []; + for (var j = 0; j < message.apiOperations.length; ++j) + object.apiOperations[j] = $root.google.cloud.apihub.v1.ApiOperation.toObject(message.apiOperations[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListApiOperationsResponse to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.ListApiOperationsResponse + * @instance + * @returns {Object.} JSON object + */ + ListApiOperationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListApiOperationsResponse + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.ListApiOperationsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListApiOperationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.ListApiOperationsResponse"; + }; + + return ListApiOperationsResponse; + })(); + + v1.GetDefinitionRequest = (function() { + + /** + * Properties of a GetDefinitionRequest. + * @memberof google.cloud.apihub.v1 + * @interface IGetDefinitionRequest + * @property {string|null} [name] GetDefinitionRequest name + */ + + /** + * Constructs a new GetDefinitionRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a GetDefinitionRequest. + * @implements IGetDefinitionRequest + * @constructor + * @param {google.cloud.apihub.v1.IGetDefinitionRequest=} [properties] Properties to set + */ + function GetDefinitionRequest(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]]; + } + + /** + * GetDefinitionRequest name. + * @member {string} name + * @memberof google.cloud.apihub.v1.GetDefinitionRequest + * @instance + */ + GetDefinitionRequest.prototype.name = ""; + + /** + * Creates a new GetDefinitionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.GetDefinitionRequest + * @static + * @param {google.cloud.apihub.v1.IGetDefinitionRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.GetDefinitionRequest} GetDefinitionRequest instance + */ + GetDefinitionRequest.create = function create(properties) { + return new GetDefinitionRequest(properties); + }; + + /** + * Encodes the specified GetDefinitionRequest message. Does not implicitly {@link google.cloud.apihub.v1.GetDefinitionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.GetDefinitionRequest + * @static + * @param {google.cloud.apihub.v1.IGetDefinitionRequest} message GetDefinitionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDefinitionRequest.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 GetDefinitionRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.GetDefinitionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.GetDefinitionRequest + * @static + * @param {google.cloud.apihub.v1.IGetDefinitionRequest} message GetDefinitionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDefinitionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDefinitionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.GetDefinitionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.GetDefinitionRequest} GetDefinitionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDefinitionRequest.decode = function 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.apihub.v1.GetDefinitionRequest(); + 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 GetDefinitionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.GetDefinitionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.GetDefinitionRequest} GetDefinitionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDefinitionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDefinitionRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.GetDefinitionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDefinitionRequest.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 GetDefinitionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.GetDefinitionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.GetDefinitionRequest} GetDefinitionRequest + */ + GetDefinitionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.GetDefinitionRequest) + return object; + var message = new $root.google.cloud.apihub.v1.GetDefinitionRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetDefinitionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.GetDefinitionRequest + * @static + * @param {google.cloud.apihub.v1.GetDefinitionRequest} message GetDefinitionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDefinitionRequest.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 GetDefinitionRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.GetDefinitionRequest + * @instance + * @returns {Object.} JSON object + */ + GetDefinitionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetDefinitionRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.GetDefinitionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetDefinitionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.GetDefinitionRequest"; + }; + + return GetDefinitionRequest; + })(); + + v1.CreateDeploymentRequest = (function() { + + /** + * Properties of a CreateDeploymentRequest. + * @memberof google.cloud.apihub.v1 + * @interface ICreateDeploymentRequest + * @property {string|null} [parent] CreateDeploymentRequest parent + * @property {string|null} [deploymentId] CreateDeploymentRequest deploymentId + * @property {google.cloud.apihub.v1.IDeployment|null} [deployment] CreateDeploymentRequest deployment + */ + + /** + * Constructs a new CreateDeploymentRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a CreateDeploymentRequest. + * @implements ICreateDeploymentRequest + * @constructor + * @param {google.cloud.apihub.v1.ICreateDeploymentRequest=} [properties] Properties to set + */ + function CreateDeploymentRequest(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]]; + } + + /** + * CreateDeploymentRequest parent. + * @member {string} parent + * @memberof google.cloud.apihub.v1.CreateDeploymentRequest + * @instance + */ + CreateDeploymentRequest.prototype.parent = ""; + + /** + * CreateDeploymentRequest deploymentId. + * @member {string} deploymentId + * @memberof google.cloud.apihub.v1.CreateDeploymentRequest + * @instance + */ + CreateDeploymentRequest.prototype.deploymentId = ""; + + /** + * CreateDeploymentRequest deployment. + * @member {google.cloud.apihub.v1.IDeployment|null|undefined} deployment + * @memberof google.cloud.apihub.v1.CreateDeploymentRequest + * @instance + */ + CreateDeploymentRequest.prototype.deployment = null; + + /** + * Creates a new CreateDeploymentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.CreateDeploymentRequest + * @static + * @param {google.cloud.apihub.v1.ICreateDeploymentRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.CreateDeploymentRequest} CreateDeploymentRequest instance + */ + CreateDeploymentRequest.create = function create(properties) { + return new CreateDeploymentRequest(properties); + }; + + /** + * Encodes the specified CreateDeploymentRequest message. Does not implicitly {@link google.cloud.apihub.v1.CreateDeploymentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.CreateDeploymentRequest + * @static + * @param {google.cloud.apihub.v1.ICreateDeploymentRequest} message CreateDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateDeploymentRequest.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.deploymentId != null && Object.hasOwnProperty.call(message, "deploymentId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.deploymentId); + if (message.deployment != null && Object.hasOwnProperty.call(message, "deployment")) + $root.google.cloud.apihub.v1.Deployment.encode(message.deployment, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.CreateDeploymentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.CreateDeploymentRequest + * @static + * @param {google.cloud.apihub.v1.ICreateDeploymentRequest} message CreateDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateDeploymentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateDeploymentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.CreateDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.CreateDeploymentRequest} CreateDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateDeploymentRequest.decode = function 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.apihub.v1.CreateDeploymentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.deploymentId = reader.string(); + break; + } + case 3: { + message.deployment = $root.google.cloud.apihub.v1.Deployment.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateDeploymentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.CreateDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.CreateDeploymentRequest} CreateDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateDeploymentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateDeploymentRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.CreateDeploymentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateDeploymentRequest.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.deploymentId != null && message.hasOwnProperty("deploymentId")) + if (!$util.isString(message.deploymentId)) + return "deploymentId: string expected"; + if (message.deployment != null && message.hasOwnProperty("deployment")) { + var error = $root.google.cloud.apihub.v1.Deployment.verify(message.deployment); + if (error) + return "deployment." + error; + } + return null; + }; + + /** + * Creates a CreateDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.CreateDeploymentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.CreateDeploymentRequest} CreateDeploymentRequest + */ + CreateDeploymentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.CreateDeploymentRequest) + return object; + var message = new $root.google.cloud.apihub.v1.CreateDeploymentRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.deploymentId != null) + message.deploymentId = String(object.deploymentId); + if (object.deployment != null) { + if (typeof object.deployment !== "object") + throw TypeError(".google.cloud.apihub.v1.CreateDeploymentRequest.deployment: object expected"); + message.deployment = $root.google.cloud.apihub.v1.Deployment.fromObject(object.deployment); + } + return message; + }; + + /** + * Creates a plain object from a CreateDeploymentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.CreateDeploymentRequest + * @static + * @param {google.cloud.apihub.v1.CreateDeploymentRequest} message CreateDeploymentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateDeploymentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.deploymentId = ""; + object.deployment = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.deploymentId != null && message.hasOwnProperty("deploymentId")) + object.deploymentId = message.deploymentId; + if (message.deployment != null && message.hasOwnProperty("deployment")) + object.deployment = $root.google.cloud.apihub.v1.Deployment.toObject(message.deployment, options); + return object; + }; + + /** + * Converts this CreateDeploymentRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.CreateDeploymentRequest + * @instance + * @returns {Object.} JSON object + */ + CreateDeploymentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateDeploymentRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.CreateDeploymentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateDeploymentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.CreateDeploymentRequest"; + }; + + return CreateDeploymentRequest; + })(); + + v1.GetDeploymentRequest = (function() { + + /** + * Properties of a GetDeploymentRequest. + * @memberof google.cloud.apihub.v1 + * @interface IGetDeploymentRequest + * @property {string|null} [name] GetDeploymentRequest name + */ + + /** + * Constructs a new GetDeploymentRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a GetDeploymentRequest. + * @implements IGetDeploymentRequest + * @constructor + * @param {google.cloud.apihub.v1.IGetDeploymentRequest=} [properties] Properties to set + */ + function GetDeploymentRequest(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]]; + } + + /** + * GetDeploymentRequest name. + * @member {string} name + * @memberof google.cloud.apihub.v1.GetDeploymentRequest + * @instance + */ + GetDeploymentRequest.prototype.name = ""; + + /** + * Creates a new GetDeploymentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.GetDeploymentRequest + * @static + * @param {google.cloud.apihub.v1.IGetDeploymentRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.GetDeploymentRequest} GetDeploymentRequest instance + */ + GetDeploymentRequest.create = function create(properties) { + return new GetDeploymentRequest(properties); + }; + + /** + * Encodes the specified GetDeploymentRequest message. Does not implicitly {@link google.cloud.apihub.v1.GetDeploymentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.GetDeploymentRequest + * @static + * @param {google.cloud.apihub.v1.IGetDeploymentRequest} message GetDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDeploymentRequest.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 GetDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.GetDeploymentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.GetDeploymentRequest + * @static + * @param {google.cloud.apihub.v1.IGetDeploymentRequest} message GetDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDeploymentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDeploymentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.GetDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.GetDeploymentRequest} GetDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDeploymentRequest.decode = function 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.apihub.v1.GetDeploymentRequest(); + 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 GetDeploymentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.GetDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.GetDeploymentRequest} GetDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDeploymentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDeploymentRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.GetDeploymentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDeploymentRequest.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 GetDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.GetDeploymentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.GetDeploymentRequest} GetDeploymentRequest + */ + GetDeploymentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.GetDeploymentRequest) + return object; + var message = new $root.google.cloud.apihub.v1.GetDeploymentRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetDeploymentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.GetDeploymentRequest + * @static + * @param {google.cloud.apihub.v1.GetDeploymentRequest} message GetDeploymentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDeploymentRequest.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 GetDeploymentRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.GetDeploymentRequest + * @instance + * @returns {Object.} JSON object + */ + GetDeploymentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetDeploymentRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.GetDeploymentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetDeploymentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.GetDeploymentRequest"; + }; + + return GetDeploymentRequest; + })(); + + v1.UpdateDeploymentRequest = (function() { + + /** + * Properties of an UpdateDeploymentRequest. + * @memberof google.cloud.apihub.v1 + * @interface IUpdateDeploymentRequest + * @property {google.cloud.apihub.v1.IDeployment|null} [deployment] UpdateDeploymentRequest deployment + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateDeploymentRequest updateMask + */ + + /** + * Constructs a new UpdateDeploymentRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents an UpdateDeploymentRequest. + * @implements IUpdateDeploymentRequest + * @constructor + * @param {google.cloud.apihub.v1.IUpdateDeploymentRequest=} [properties] Properties to set + */ + function UpdateDeploymentRequest(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]]; + } + + /** + * UpdateDeploymentRequest deployment. + * @member {google.cloud.apihub.v1.IDeployment|null|undefined} deployment + * @memberof google.cloud.apihub.v1.UpdateDeploymentRequest + * @instance + */ + UpdateDeploymentRequest.prototype.deployment = null; + + /** + * UpdateDeploymentRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.apihub.v1.UpdateDeploymentRequest + * @instance + */ + UpdateDeploymentRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateDeploymentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.UpdateDeploymentRequest + * @static + * @param {google.cloud.apihub.v1.IUpdateDeploymentRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.UpdateDeploymentRequest} UpdateDeploymentRequest instance + */ + UpdateDeploymentRequest.create = function create(properties) { + return new UpdateDeploymentRequest(properties); + }; + + /** + * Encodes the specified UpdateDeploymentRequest message. Does not implicitly {@link google.cloud.apihub.v1.UpdateDeploymentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.UpdateDeploymentRequest + * @static + * @param {google.cloud.apihub.v1.IUpdateDeploymentRequest} message UpdateDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDeploymentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deployment != null && Object.hasOwnProperty.call(message, "deployment")) + $root.google.cloud.apihub.v1.Deployment.encode(message.deployment, 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 UpdateDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.UpdateDeploymentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.UpdateDeploymentRequest + * @static + * @param {google.cloud.apihub.v1.IUpdateDeploymentRequest} message UpdateDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDeploymentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateDeploymentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.UpdateDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.UpdateDeploymentRequest} UpdateDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDeploymentRequest.decode = function 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.apihub.v1.UpdateDeploymentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.deployment = $root.google.cloud.apihub.v1.Deployment.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 UpdateDeploymentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.UpdateDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.UpdateDeploymentRequest} UpdateDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDeploymentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateDeploymentRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.UpdateDeploymentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateDeploymentRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deployment != null && message.hasOwnProperty("deployment")) { + var error = $root.google.cloud.apihub.v1.Deployment.verify(message.deployment); + if (error) + return "deployment." + 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 UpdateDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.UpdateDeploymentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.UpdateDeploymentRequest} UpdateDeploymentRequest + */ + UpdateDeploymentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.UpdateDeploymentRequest) + return object; + var message = new $root.google.cloud.apihub.v1.UpdateDeploymentRequest(); + if (object.deployment != null) { + if (typeof object.deployment !== "object") + throw TypeError(".google.cloud.apihub.v1.UpdateDeploymentRequest.deployment: object expected"); + message.deployment = $root.google.cloud.apihub.v1.Deployment.fromObject(object.deployment); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.apihub.v1.UpdateDeploymentRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateDeploymentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.UpdateDeploymentRequest + * @static + * @param {google.cloud.apihub.v1.UpdateDeploymentRequest} message UpdateDeploymentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateDeploymentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.deployment = null; + object.updateMask = null; + } + if (message.deployment != null && message.hasOwnProperty("deployment")) + object.deployment = $root.google.cloud.apihub.v1.Deployment.toObject(message.deployment, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateDeploymentRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.UpdateDeploymentRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateDeploymentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateDeploymentRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.UpdateDeploymentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateDeploymentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.UpdateDeploymentRequest"; + }; + + return UpdateDeploymentRequest; + })(); + + v1.DeleteDeploymentRequest = (function() { + + /** + * Properties of a DeleteDeploymentRequest. + * @memberof google.cloud.apihub.v1 + * @interface IDeleteDeploymentRequest + * @property {string|null} [name] DeleteDeploymentRequest name + */ + + /** + * Constructs a new DeleteDeploymentRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a DeleteDeploymentRequest. + * @implements IDeleteDeploymentRequest + * @constructor + * @param {google.cloud.apihub.v1.IDeleteDeploymentRequest=} [properties] Properties to set + */ + function DeleteDeploymentRequest(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]]; + } + + /** + * DeleteDeploymentRequest name. + * @member {string} name + * @memberof google.cloud.apihub.v1.DeleteDeploymentRequest + * @instance + */ + DeleteDeploymentRequest.prototype.name = ""; + + /** + * Creates a new DeleteDeploymentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.DeleteDeploymentRequest + * @static + * @param {google.cloud.apihub.v1.IDeleteDeploymentRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.DeleteDeploymentRequest} DeleteDeploymentRequest instance + */ + DeleteDeploymentRequest.create = function create(properties) { + return new DeleteDeploymentRequest(properties); + }; + + /** + * Encodes the specified DeleteDeploymentRequest message. Does not implicitly {@link google.cloud.apihub.v1.DeleteDeploymentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.DeleteDeploymentRequest + * @static + * @param {google.cloud.apihub.v1.IDeleteDeploymentRequest} message DeleteDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteDeploymentRequest.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 DeleteDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.DeleteDeploymentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.DeleteDeploymentRequest + * @static + * @param {google.cloud.apihub.v1.IDeleteDeploymentRequest} message DeleteDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteDeploymentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteDeploymentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.DeleteDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.DeleteDeploymentRequest} DeleteDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteDeploymentRequest.decode = function 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.apihub.v1.DeleteDeploymentRequest(); + 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 DeleteDeploymentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.DeleteDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.DeleteDeploymentRequest} DeleteDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteDeploymentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteDeploymentRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.DeleteDeploymentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteDeploymentRequest.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 DeleteDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.DeleteDeploymentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.DeleteDeploymentRequest} DeleteDeploymentRequest + */ + DeleteDeploymentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.DeleteDeploymentRequest) + return object; + var message = new $root.google.cloud.apihub.v1.DeleteDeploymentRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteDeploymentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.DeleteDeploymentRequest + * @static + * @param {google.cloud.apihub.v1.DeleteDeploymentRequest} message DeleteDeploymentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteDeploymentRequest.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 DeleteDeploymentRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.DeleteDeploymentRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteDeploymentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteDeploymentRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.DeleteDeploymentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteDeploymentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.DeleteDeploymentRequest"; + }; + + return DeleteDeploymentRequest; + })(); + + v1.ListDeploymentsRequest = (function() { + + /** + * Properties of a ListDeploymentsRequest. + * @memberof google.cloud.apihub.v1 + * @interface IListDeploymentsRequest + * @property {string|null} [parent] ListDeploymentsRequest parent + * @property {string|null} [filter] ListDeploymentsRequest filter + * @property {number|null} [pageSize] ListDeploymentsRequest pageSize + * @property {string|null} [pageToken] ListDeploymentsRequest pageToken + */ + + /** + * Constructs a new ListDeploymentsRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a ListDeploymentsRequest. + * @implements IListDeploymentsRequest + * @constructor + * @param {google.cloud.apihub.v1.IListDeploymentsRequest=} [properties] Properties to set + */ + function ListDeploymentsRequest(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]]; + } + + /** + * ListDeploymentsRequest parent. + * @member {string} parent + * @memberof google.cloud.apihub.v1.ListDeploymentsRequest + * @instance + */ + ListDeploymentsRequest.prototype.parent = ""; + + /** + * ListDeploymentsRequest filter. + * @member {string} filter + * @memberof google.cloud.apihub.v1.ListDeploymentsRequest + * @instance + */ + ListDeploymentsRequest.prototype.filter = ""; + + /** + * ListDeploymentsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.apihub.v1.ListDeploymentsRequest + * @instance + */ + ListDeploymentsRequest.prototype.pageSize = 0; + + /** + * ListDeploymentsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.apihub.v1.ListDeploymentsRequest + * @instance + */ + ListDeploymentsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListDeploymentsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.ListDeploymentsRequest + * @static + * @param {google.cloud.apihub.v1.IListDeploymentsRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.ListDeploymentsRequest} ListDeploymentsRequest instance + */ + ListDeploymentsRequest.create = function create(properties) { + return new ListDeploymentsRequest(properties); + }; + + /** + * Encodes the specified ListDeploymentsRequest message. Does not implicitly {@link google.cloud.apihub.v1.ListDeploymentsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.ListDeploymentsRequest + * @static + * @param {google.cloud.apihub.v1.IListDeploymentsRequest} message ListDeploymentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDeploymentsRequest.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.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListDeploymentsRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListDeploymentsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.ListDeploymentsRequest + * @static + * @param {google.cloud.apihub.v1.IListDeploymentsRequest} message ListDeploymentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDeploymentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDeploymentsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.ListDeploymentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.ListDeploymentsRequest} ListDeploymentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDeploymentsRequest.decode = function 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.apihub.v1.ListDeploymentsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.filter = reader.string(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + case 4: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListDeploymentsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.ListDeploymentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.ListDeploymentsRequest} ListDeploymentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDeploymentsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDeploymentsRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.ListDeploymentsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDeploymentsRequest.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.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 ListDeploymentsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.ListDeploymentsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.ListDeploymentsRequest} ListDeploymentsRequest + */ + ListDeploymentsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.ListDeploymentsRequest) + return object; + var message = new $root.google.cloud.apihub.v1.ListDeploymentsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + 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 ListDeploymentsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.ListDeploymentsRequest + * @static + * @param {google.cloud.apihub.v1.ListDeploymentsRequest} message ListDeploymentsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDeploymentsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + 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; + return object; + }; + + /** + * Converts this ListDeploymentsRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.ListDeploymentsRequest + * @instance + * @returns {Object.} JSON object + */ + ListDeploymentsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListDeploymentsRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.ListDeploymentsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListDeploymentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.ListDeploymentsRequest"; + }; + + return ListDeploymentsRequest; + })(); + + v1.ListDeploymentsResponse = (function() { + + /** + * Properties of a ListDeploymentsResponse. + * @memberof google.cloud.apihub.v1 + * @interface IListDeploymentsResponse + * @property {Array.|null} [deployments] ListDeploymentsResponse deployments + * @property {string|null} [nextPageToken] ListDeploymentsResponse nextPageToken + */ + + /** + * Constructs a new ListDeploymentsResponse. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a ListDeploymentsResponse. + * @implements IListDeploymentsResponse + * @constructor + * @param {google.cloud.apihub.v1.IListDeploymentsResponse=} [properties] Properties to set + */ + function ListDeploymentsResponse(properties) { + this.deployments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListDeploymentsResponse deployments. + * @member {Array.} deployments + * @memberof google.cloud.apihub.v1.ListDeploymentsResponse + * @instance + */ + ListDeploymentsResponse.prototype.deployments = $util.emptyArray; + + /** + * ListDeploymentsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.apihub.v1.ListDeploymentsResponse + * @instance + */ + ListDeploymentsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListDeploymentsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.ListDeploymentsResponse + * @static + * @param {google.cloud.apihub.v1.IListDeploymentsResponse=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.ListDeploymentsResponse} ListDeploymentsResponse instance + */ + ListDeploymentsResponse.create = function create(properties) { + return new ListDeploymentsResponse(properties); + }; + + /** + * Encodes the specified ListDeploymentsResponse message. Does not implicitly {@link google.cloud.apihub.v1.ListDeploymentsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.ListDeploymentsResponse + * @static + * @param {google.cloud.apihub.v1.IListDeploymentsResponse} message ListDeploymentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDeploymentsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deployments != null && message.deployments.length) + for (var i = 0; i < message.deployments.length; ++i) + $root.google.cloud.apihub.v1.Deployment.encode(message.deployments[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 ListDeploymentsResponse message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListDeploymentsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.ListDeploymentsResponse + * @static + * @param {google.cloud.apihub.v1.IListDeploymentsResponse} message ListDeploymentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDeploymentsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDeploymentsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.ListDeploymentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.ListDeploymentsResponse} ListDeploymentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDeploymentsResponse.decode = function 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.apihub.v1.ListDeploymentsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.deployments && message.deployments.length)) + message.deployments = []; + message.deployments.push($root.google.cloud.apihub.v1.Deployment.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListDeploymentsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.ListDeploymentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.ListDeploymentsResponse} ListDeploymentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDeploymentsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDeploymentsResponse message. + * @function verify + * @memberof google.cloud.apihub.v1.ListDeploymentsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDeploymentsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deployments != null && message.hasOwnProperty("deployments")) { + if (!Array.isArray(message.deployments)) + return "deployments: array expected"; + for (var i = 0; i < message.deployments.length; ++i) { + var error = $root.google.cloud.apihub.v1.Deployment.verify(message.deployments[i]); + if (error) + return "deployments." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListDeploymentsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.ListDeploymentsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.ListDeploymentsResponse} ListDeploymentsResponse + */ + ListDeploymentsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.ListDeploymentsResponse) + return object; + var message = new $root.google.cloud.apihub.v1.ListDeploymentsResponse(); + if (object.deployments) { + if (!Array.isArray(object.deployments)) + throw TypeError(".google.cloud.apihub.v1.ListDeploymentsResponse.deployments: array expected"); + message.deployments = []; + for (var i = 0; i < object.deployments.length; ++i) { + if (typeof object.deployments[i] !== "object") + throw TypeError(".google.cloud.apihub.v1.ListDeploymentsResponse.deployments: object expected"); + message.deployments[i] = $root.google.cloud.apihub.v1.Deployment.fromObject(object.deployments[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListDeploymentsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.ListDeploymentsResponse + * @static + * @param {google.cloud.apihub.v1.ListDeploymentsResponse} message ListDeploymentsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDeploymentsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.deployments = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.deployments && message.deployments.length) { + object.deployments = []; + for (var j = 0; j < message.deployments.length; ++j) + object.deployments[j] = $root.google.cloud.apihub.v1.Deployment.toObject(message.deployments[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListDeploymentsResponse to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.ListDeploymentsResponse + * @instance + * @returns {Object.} JSON object + */ + ListDeploymentsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListDeploymentsResponse + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.ListDeploymentsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListDeploymentsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.ListDeploymentsResponse"; + }; + + return ListDeploymentsResponse; + })(); + + v1.CreateAttributeRequest = (function() { + + /** + * Properties of a CreateAttributeRequest. + * @memberof google.cloud.apihub.v1 + * @interface ICreateAttributeRequest + * @property {string|null} [parent] CreateAttributeRequest parent + * @property {string|null} [attributeId] CreateAttributeRequest attributeId + * @property {google.cloud.apihub.v1.IAttribute|null} [attribute] CreateAttributeRequest attribute + */ + + /** + * Constructs a new CreateAttributeRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a CreateAttributeRequest. + * @implements ICreateAttributeRequest + * @constructor + * @param {google.cloud.apihub.v1.ICreateAttributeRequest=} [properties] Properties to set + */ + function CreateAttributeRequest(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]]; + } + + /** + * CreateAttributeRequest parent. + * @member {string} parent + * @memberof google.cloud.apihub.v1.CreateAttributeRequest + * @instance + */ + CreateAttributeRequest.prototype.parent = ""; + + /** + * CreateAttributeRequest attributeId. + * @member {string} attributeId + * @memberof google.cloud.apihub.v1.CreateAttributeRequest + * @instance + */ + CreateAttributeRequest.prototype.attributeId = ""; + + /** + * CreateAttributeRequest attribute. + * @member {google.cloud.apihub.v1.IAttribute|null|undefined} attribute + * @memberof google.cloud.apihub.v1.CreateAttributeRequest + * @instance + */ + CreateAttributeRequest.prototype.attribute = null; + + /** + * Creates a new CreateAttributeRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.CreateAttributeRequest + * @static + * @param {google.cloud.apihub.v1.ICreateAttributeRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.CreateAttributeRequest} CreateAttributeRequest instance + */ + CreateAttributeRequest.create = function create(properties) { + return new CreateAttributeRequest(properties); + }; + + /** + * Encodes the specified CreateAttributeRequest message. Does not implicitly {@link google.cloud.apihub.v1.CreateAttributeRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.CreateAttributeRequest + * @static + * @param {google.cloud.apihub.v1.ICreateAttributeRequest} message CreateAttributeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateAttributeRequest.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.attributeId != null && Object.hasOwnProperty.call(message, "attributeId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.attributeId); + if (message.attribute != null && Object.hasOwnProperty.call(message, "attribute")) + $root.google.cloud.apihub.v1.Attribute.encode(message.attribute, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateAttributeRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.CreateAttributeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.CreateAttributeRequest + * @static + * @param {google.cloud.apihub.v1.ICreateAttributeRequest} message CreateAttributeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateAttributeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateAttributeRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.CreateAttributeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.CreateAttributeRequest} CreateAttributeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateAttributeRequest.decode = function 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.apihub.v1.CreateAttributeRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.attributeId = reader.string(); + break; + } + case 3: { + message.attribute = $root.google.cloud.apihub.v1.Attribute.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateAttributeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.CreateAttributeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.CreateAttributeRequest} CreateAttributeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateAttributeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateAttributeRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.CreateAttributeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateAttributeRequest.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.attributeId != null && message.hasOwnProperty("attributeId")) + if (!$util.isString(message.attributeId)) + return "attributeId: string expected"; + if (message.attribute != null && message.hasOwnProperty("attribute")) { + var error = $root.google.cloud.apihub.v1.Attribute.verify(message.attribute); + if (error) + return "attribute." + error; + } + return null; + }; + + /** + * Creates a CreateAttributeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.CreateAttributeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.CreateAttributeRequest} CreateAttributeRequest + */ + CreateAttributeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.CreateAttributeRequest) + return object; + var message = new $root.google.cloud.apihub.v1.CreateAttributeRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.attributeId != null) + message.attributeId = String(object.attributeId); + if (object.attribute != null) { + if (typeof object.attribute !== "object") + throw TypeError(".google.cloud.apihub.v1.CreateAttributeRequest.attribute: object expected"); + message.attribute = $root.google.cloud.apihub.v1.Attribute.fromObject(object.attribute); + } + return message; + }; + + /** + * Creates a plain object from a CreateAttributeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.CreateAttributeRequest + * @static + * @param {google.cloud.apihub.v1.CreateAttributeRequest} message CreateAttributeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateAttributeRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.attributeId = ""; + object.attribute = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.attributeId != null && message.hasOwnProperty("attributeId")) + object.attributeId = message.attributeId; + if (message.attribute != null && message.hasOwnProperty("attribute")) + object.attribute = $root.google.cloud.apihub.v1.Attribute.toObject(message.attribute, options); + return object; + }; + + /** + * Converts this CreateAttributeRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.CreateAttributeRequest + * @instance + * @returns {Object.} JSON object + */ + CreateAttributeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateAttributeRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.CreateAttributeRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateAttributeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.CreateAttributeRequest"; + }; + + return CreateAttributeRequest; + })(); + + v1.GetAttributeRequest = (function() { + + /** + * Properties of a GetAttributeRequest. + * @memberof google.cloud.apihub.v1 + * @interface IGetAttributeRequest + * @property {string|null} [name] GetAttributeRequest name + */ + + /** + * Constructs a new GetAttributeRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a GetAttributeRequest. + * @implements IGetAttributeRequest + * @constructor + * @param {google.cloud.apihub.v1.IGetAttributeRequest=} [properties] Properties to set + */ + function GetAttributeRequest(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]]; + } + + /** + * GetAttributeRequest name. + * @member {string} name + * @memberof google.cloud.apihub.v1.GetAttributeRequest + * @instance + */ + GetAttributeRequest.prototype.name = ""; + + /** + * Creates a new GetAttributeRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.GetAttributeRequest + * @static + * @param {google.cloud.apihub.v1.IGetAttributeRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.GetAttributeRequest} GetAttributeRequest instance + */ + GetAttributeRequest.create = function create(properties) { + return new GetAttributeRequest(properties); + }; + + /** + * Encodes the specified GetAttributeRequest message. Does not implicitly {@link google.cloud.apihub.v1.GetAttributeRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.GetAttributeRequest + * @static + * @param {google.cloud.apihub.v1.IGetAttributeRequest} message GetAttributeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetAttributeRequest.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 GetAttributeRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.GetAttributeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.GetAttributeRequest + * @static + * @param {google.cloud.apihub.v1.IGetAttributeRequest} message GetAttributeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetAttributeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetAttributeRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.GetAttributeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.GetAttributeRequest} GetAttributeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetAttributeRequest.decode = function 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.apihub.v1.GetAttributeRequest(); + 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 GetAttributeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.GetAttributeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.GetAttributeRequest} GetAttributeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetAttributeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetAttributeRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.GetAttributeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetAttributeRequest.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 GetAttributeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.GetAttributeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.GetAttributeRequest} GetAttributeRequest + */ + GetAttributeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.GetAttributeRequest) + return object; + var message = new $root.google.cloud.apihub.v1.GetAttributeRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetAttributeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.GetAttributeRequest + * @static + * @param {google.cloud.apihub.v1.GetAttributeRequest} message GetAttributeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetAttributeRequest.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 GetAttributeRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.GetAttributeRequest + * @instance + * @returns {Object.} JSON object + */ + GetAttributeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetAttributeRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.GetAttributeRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetAttributeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.GetAttributeRequest"; + }; + + return GetAttributeRequest; + })(); + + v1.UpdateAttributeRequest = (function() { + + /** + * Properties of an UpdateAttributeRequest. + * @memberof google.cloud.apihub.v1 + * @interface IUpdateAttributeRequest + * @property {google.cloud.apihub.v1.IAttribute|null} [attribute] UpdateAttributeRequest attribute + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateAttributeRequest updateMask + */ + + /** + * Constructs a new UpdateAttributeRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents an UpdateAttributeRequest. + * @implements IUpdateAttributeRequest + * @constructor + * @param {google.cloud.apihub.v1.IUpdateAttributeRequest=} [properties] Properties to set + */ + function UpdateAttributeRequest(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]]; + } + + /** + * UpdateAttributeRequest attribute. + * @member {google.cloud.apihub.v1.IAttribute|null|undefined} attribute + * @memberof google.cloud.apihub.v1.UpdateAttributeRequest + * @instance + */ + UpdateAttributeRequest.prototype.attribute = null; + + /** + * UpdateAttributeRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.apihub.v1.UpdateAttributeRequest + * @instance + */ + UpdateAttributeRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateAttributeRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.UpdateAttributeRequest + * @static + * @param {google.cloud.apihub.v1.IUpdateAttributeRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.UpdateAttributeRequest} UpdateAttributeRequest instance + */ + UpdateAttributeRequest.create = function create(properties) { + return new UpdateAttributeRequest(properties); + }; + + /** + * Encodes the specified UpdateAttributeRequest message. Does not implicitly {@link google.cloud.apihub.v1.UpdateAttributeRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.UpdateAttributeRequest + * @static + * @param {google.cloud.apihub.v1.IUpdateAttributeRequest} message UpdateAttributeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateAttributeRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.attribute != null && Object.hasOwnProperty.call(message, "attribute")) + $root.google.cloud.apihub.v1.Attribute.encode(message.attribute, 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 UpdateAttributeRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.UpdateAttributeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.UpdateAttributeRequest + * @static + * @param {google.cloud.apihub.v1.IUpdateAttributeRequest} message UpdateAttributeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateAttributeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateAttributeRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.UpdateAttributeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.UpdateAttributeRequest} UpdateAttributeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateAttributeRequest.decode = function 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.apihub.v1.UpdateAttributeRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.attribute = $root.google.cloud.apihub.v1.Attribute.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 UpdateAttributeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.UpdateAttributeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.UpdateAttributeRequest} UpdateAttributeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateAttributeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateAttributeRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.UpdateAttributeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateAttributeRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.attribute != null && message.hasOwnProperty("attribute")) { + var error = $root.google.cloud.apihub.v1.Attribute.verify(message.attribute); + if (error) + return "attribute." + 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 UpdateAttributeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.UpdateAttributeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.UpdateAttributeRequest} UpdateAttributeRequest + */ + UpdateAttributeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.UpdateAttributeRequest) + return object; + var message = new $root.google.cloud.apihub.v1.UpdateAttributeRequest(); + if (object.attribute != null) { + if (typeof object.attribute !== "object") + throw TypeError(".google.cloud.apihub.v1.UpdateAttributeRequest.attribute: object expected"); + message.attribute = $root.google.cloud.apihub.v1.Attribute.fromObject(object.attribute); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.apihub.v1.UpdateAttributeRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateAttributeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.UpdateAttributeRequest + * @static + * @param {google.cloud.apihub.v1.UpdateAttributeRequest} message UpdateAttributeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateAttributeRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.attribute = null; + object.updateMask = null; + } + if (message.attribute != null && message.hasOwnProperty("attribute")) + object.attribute = $root.google.cloud.apihub.v1.Attribute.toObject(message.attribute, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateAttributeRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.UpdateAttributeRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateAttributeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateAttributeRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.UpdateAttributeRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateAttributeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.UpdateAttributeRequest"; + }; + + return UpdateAttributeRequest; + })(); + + v1.DeleteAttributeRequest = (function() { + + /** + * Properties of a DeleteAttributeRequest. + * @memberof google.cloud.apihub.v1 + * @interface IDeleteAttributeRequest + * @property {string|null} [name] DeleteAttributeRequest name + */ + + /** + * Constructs a new DeleteAttributeRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a DeleteAttributeRequest. + * @implements IDeleteAttributeRequest + * @constructor + * @param {google.cloud.apihub.v1.IDeleteAttributeRequest=} [properties] Properties to set + */ + function DeleteAttributeRequest(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]]; + } + + /** + * DeleteAttributeRequest name. + * @member {string} name + * @memberof google.cloud.apihub.v1.DeleteAttributeRequest + * @instance + */ + DeleteAttributeRequest.prototype.name = ""; + + /** + * Creates a new DeleteAttributeRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.DeleteAttributeRequest + * @static + * @param {google.cloud.apihub.v1.IDeleteAttributeRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.DeleteAttributeRequest} DeleteAttributeRequest instance + */ + DeleteAttributeRequest.create = function create(properties) { + return new DeleteAttributeRequest(properties); + }; + + /** + * Encodes the specified DeleteAttributeRequest message. Does not implicitly {@link google.cloud.apihub.v1.DeleteAttributeRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.DeleteAttributeRequest + * @static + * @param {google.cloud.apihub.v1.IDeleteAttributeRequest} message DeleteAttributeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteAttributeRequest.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 DeleteAttributeRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.DeleteAttributeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.DeleteAttributeRequest + * @static + * @param {google.cloud.apihub.v1.IDeleteAttributeRequest} message DeleteAttributeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteAttributeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteAttributeRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.DeleteAttributeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.DeleteAttributeRequest} DeleteAttributeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteAttributeRequest.decode = function 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.apihub.v1.DeleteAttributeRequest(); + 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 DeleteAttributeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.DeleteAttributeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.DeleteAttributeRequest} DeleteAttributeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteAttributeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteAttributeRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.DeleteAttributeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteAttributeRequest.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 DeleteAttributeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.DeleteAttributeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.DeleteAttributeRequest} DeleteAttributeRequest + */ + DeleteAttributeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.DeleteAttributeRequest) + return object; + var message = new $root.google.cloud.apihub.v1.DeleteAttributeRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteAttributeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.DeleteAttributeRequest + * @static + * @param {google.cloud.apihub.v1.DeleteAttributeRequest} message DeleteAttributeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteAttributeRequest.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 DeleteAttributeRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.DeleteAttributeRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteAttributeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteAttributeRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.DeleteAttributeRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteAttributeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.DeleteAttributeRequest"; + }; + + return DeleteAttributeRequest; + })(); + + v1.ListAttributesRequest = (function() { + + /** + * Properties of a ListAttributesRequest. + * @memberof google.cloud.apihub.v1 + * @interface IListAttributesRequest + * @property {string|null} [parent] ListAttributesRequest parent + * @property {string|null} [filter] ListAttributesRequest filter + * @property {number|null} [pageSize] ListAttributesRequest pageSize + * @property {string|null} [pageToken] ListAttributesRequest pageToken + */ + + /** + * Constructs a new ListAttributesRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a ListAttributesRequest. + * @implements IListAttributesRequest + * @constructor + * @param {google.cloud.apihub.v1.IListAttributesRequest=} [properties] Properties to set + */ + function ListAttributesRequest(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]]; + } + + /** + * ListAttributesRequest parent. + * @member {string} parent + * @memberof google.cloud.apihub.v1.ListAttributesRequest + * @instance + */ + ListAttributesRequest.prototype.parent = ""; + + /** + * ListAttributesRequest filter. + * @member {string} filter + * @memberof google.cloud.apihub.v1.ListAttributesRequest + * @instance + */ + ListAttributesRequest.prototype.filter = ""; + + /** + * ListAttributesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.apihub.v1.ListAttributesRequest + * @instance + */ + ListAttributesRequest.prototype.pageSize = 0; + + /** + * ListAttributesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.apihub.v1.ListAttributesRequest + * @instance + */ + ListAttributesRequest.prototype.pageToken = ""; + + /** + * Creates a new ListAttributesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.ListAttributesRequest + * @static + * @param {google.cloud.apihub.v1.IListAttributesRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.ListAttributesRequest} ListAttributesRequest instance + */ + ListAttributesRequest.create = function create(properties) { + return new ListAttributesRequest(properties); + }; + + /** + * Encodes the specified ListAttributesRequest message. Does not implicitly {@link google.cloud.apihub.v1.ListAttributesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.ListAttributesRequest + * @static + * @param {google.cloud.apihub.v1.IListAttributesRequest} message ListAttributesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAttributesRequest.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.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListAttributesRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListAttributesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.ListAttributesRequest + * @static + * @param {google.cloud.apihub.v1.IListAttributesRequest} message ListAttributesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAttributesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAttributesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.ListAttributesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.ListAttributesRequest} ListAttributesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAttributesRequest.decode = function 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.apihub.v1.ListAttributesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.filter = reader.string(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + case 4: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAttributesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.ListAttributesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.ListAttributesRequest} ListAttributesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAttributesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAttributesRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.ListAttributesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAttributesRequest.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.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 ListAttributesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.ListAttributesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.ListAttributesRequest} ListAttributesRequest + */ + ListAttributesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.ListAttributesRequest) + return object; + var message = new $root.google.cloud.apihub.v1.ListAttributesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + 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 ListAttributesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.ListAttributesRequest + * @static + * @param {google.cloud.apihub.v1.ListAttributesRequest} message ListAttributesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAttributesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + 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; + return object; + }; + + /** + * Converts this ListAttributesRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.ListAttributesRequest + * @instance + * @returns {Object.} JSON object + */ + ListAttributesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListAttributesRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.ListAttributesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAttributesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.ListAttributesRequest"; + }; + + return ListAttributesRequest; + })(); + + v1.ListAttributesResponse = (function() { + + /** + * Properties of a ListAttributesResponse. + * @memberof google.cloud.apihub.v1 + * @interface IListAttributesResponse + * @property {Array.|null} [attributes] ListAttributesResponse attributes + * @property {string|null} [nextPageToken] ListAttributesResponse nextPageToken + */ + + /** + * Constructs a new ListAttributesResponse. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a ListAttributesResponse. + * @implements IListAttributesResponse + * @constructor + * @param {google.cloud.apihub.v1.IListAttributesResponse=} [properties] Properties to set + */ + function ListAttributesResponse(properties) { + this.attributes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListAttributesResponse attributes. + * @member {Array.} attributes + * @memberof google.cloud.apihub.v1.ListAttributesResponse + * @instance + */ + ListAttributesResponse.prototype.attributes = $util.emptyArray; + + /** + * ListAttributesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.apihub.v1.ListAttributesResponse + * @instance + */ + ListAttributesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListAttributesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.ListAttributesResponse + * @static + * @param {google.cloud.apihub.v1.IListAttributesResponse=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.ListAttributesResponse} ListAttributesResponse instance + */ + ListAttributesResponse.create = function create(properties) { + return new ListAttributesResponse(properties); + }; + + /** + * Encodes the specified ListAttributesResponse message. Does not implicitly {@link google.cloud.apihub.v1.ListAttributesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.ListAttributesResponse + * @static + * @param {google.cloud.apihub.v1.IListAttributesResponse} message ListAttributesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAttributesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.attributes != null && message.attributes.length) + for (var i = 0; i < message.attributes.length; ++i) + $root.google.cloud.apihub.v1.Attribute.encode(message.attributes[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 ListAttributesResponse message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListAttributesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.ListAttributesResponse + * @static + * @param {google.cloud.apihub.v1.IListAttributesResponse} message ListAttributesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAttributesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAttributesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.ListAttributesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.ListAttributesResponse} ListAttributesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAttributesResponse.decode = function 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.apihub.v1.ListAttributesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.attributes && message.attributes.length)) + message.attributes = []; + message.attributes.push($root.google.cloud.apihub.v1.Attribute.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAttributesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.ListAttributesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.ListAttributesResponse} ListAttributesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAttributesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAttributesResponse message. + * @function verify + * @memberof google.cloud.apihub.v1.ListAttributesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAttributesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.attributes != null && message.hasOwnProperty("attributes")) { + if (!Array.isArray(message.attributes)) + return "attributes: array expected"; + for (var i = 0; i < message.attributes.length; ++i) { + var error = $root.google.cloud.apihub.v1.Attribute.verify(message.attributes[i]); + if (error) + return "attributes." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListAttributesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.ListAttributesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.ListAttributesResponse} ListAttributesResponse + */ + ListAttributesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.ListAttributesResponse) + return object; + var message = new $root.google.cloud.apihub.v1.ListAttributesResponse(); + if (object.attributes) { + if (!Array.isArray(object.attributes)) + throw TypeError(".google.cloud.apihub.v1.ListAttributesResponse.attributes: array expected"); + message.attributes = []; + for (var i = 0; i < object.attributes.length; ++i) { + if (typeof object.attributes[i] !== "object") + throw TypeError(".google.cloud.apihub.v1.ListAttributesResponse.attributes: object expected"); + message.attributes[i] = $root.google.cloud.apihub.v1.Attribute.fromObject(object.attributes[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListAttributesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.ListAttributesResponse + * @static + * @param {google.cloud.apihub.v1.ListAttributesResponse} message ListAttributesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAttributesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.attributes = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.attributes && message.attributes.length) { + object.attributes = []; + for (var j = 0; j < message.attributes.length; ++j) + object.attributes[j] = $root.google.cloud.apihub.v1.Attribute.toObject(message.attributes[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListAttributesResponse to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.ListAttributesResponse + * @instance + * @returns {Object.} JSON object + */ + ListAttributesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListAttributesResponse + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.ListAttributesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAttributesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.ListAttributesResponse"; + }; + + return ListAttributesResponse; + })(); + + v1.SearchResourcesRequest = (function() { + + /** + * Properties of a SearchResourcesRequest. + * @memberof google.cloud.apihub.v1 + * @interface ISearchResourcesRequest + * @property {string|null} [location] SearchResourcesRequest location + * @property {string|null} [query] SearchResourcesRequest query + * @property {string|null} [filter] SearchResourcesRequest filter + * @property {number|null} [pageSize] SearchResourcesRequest pageSize + * @property {string|null} [pageToken] SearchResourcesRequest pageToken + */ + + /** + * Constructs a new SearchResourcesRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a SearchResourcesRequest. + * @implements ISearchResourcesRequest + * @constructor + * @param {google.cloud.apihub.v1.ISearchResourcesRequest=} [properties] Properties to set + */ + function SearchResourcesRequest(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]]; + } + + /** + * SearchResourcesRequest location. + * @member {string} location + * @memberof google.cloud.apihub.v1.SearchResourcesRequest + * @instance + */ + SearchResourcesRequest.prototype.location = ""; + + /** + * SearchResourcesRequest query. + * @member {string} query + * @memberof google.cloud.apihub.v1.SearchResourcesRequest + * @instance + */ + SearchResourcesRequest.prototype.query = ""; + + /** + * SearchResourcesRequest filter. + * @member {string} filter + * @memberof google.cloud.apihub.v1.SearchResourcesRequest + * @instance + */ + SearchResourcesRequest.prototype.filter = ""; + + /** + * SearchResourcesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.apihub.v1.SearchResourcesRequest + * @instance + */ + SearchResourcesRequest.prototype.pageSize = 0; + + /** + * SearchResourcesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.apihub.v1.SearchResourcesRequest + * @instance + */ + SearchResourcesRequest.prototype.pageToken = ""; + + /** + * Creates a new SearchResourcesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.SearchResourcesRequest + * @static + * @param {google.cloud.apihub.v1.ISearchResourcesRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.SearchResourcesRequest} SearchResourcesRequest instance + */ + SearchResourcesRequest.create = function create(properties) { + return new SearchResourcesRequest(properties); + }; + + /** + * Encodes the specified SearchResourcesRequest message. Does not implicitly {@link google.cloud.apihub.v1.SearchResourcesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.SearchResourcesRequest + * @static + * @param {google.cloud.apihub.v1.ISearchResourcesRequest} message SearchResourcesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchResourcesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.location); + if (message.query != null && Object.hasOwnProperty.call(message, "query")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.query); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified SearchResourcesRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.SearchResourcesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.SearchResourcesRequest + * @static + * @param {google.cloud.apihub.v1.ISearchResourcesRequest} message SearchResourcesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchResourcesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SearchResourcesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.SearchResourcesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.SearchResourcesRequest} SearchResourcesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchResourcesRequest.decode = function 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.apihub.v1.SearchResourcesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.location = reader.string(); + break; + } + case 2: { + message.query = reader.string(); + break; + } + case 3: { + message.filter = reader.string(); + break; + } + case 4: { + message.pageSize = reader.int32(); + break; + } + case 5: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SearchResourcesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.SearchResourcesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.SearchResourcesRequest} SearchResourcesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchResourcesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SearchResourcesRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.SearchResourcesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SearchResourcesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + if (message.query != null && message.hasOwnProperty("query")) + if (!$util.isString(message.query)) + return "query: 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 SearchResourcesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.SearchResourcesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.SearchResourcesRequest} SearchResourcesRequest + */ + SearchResourcesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.SearchResourcesRequest) + return object; + var message = new $root.google.cloud.apihub.v1.SearchResourcesRequest(); + if (object.location != null) + message.location = String(object.location); + if (object.query != null) + message.query = String(object.query); + 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 SearchResourcesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.SearchResourcesRequest + * @static + * @param {google.cloud.apihub.v1.SearchResourcesRequest} message SearchResourcesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SearchResourcesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.location = ""; + object.query = ""; + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + if (message.query != null && message.hasOwnProperty("query")) + object.query = message.query; + 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; + return object; + }; + + /** + * Converts this SearchResourcesRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.SearchResourcesRequest + * @instance + * @returns {Object.} JSON object + */ + SearchResourcesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SearchResourcesRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.SearchResourcesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SearchResourcesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.SearchResourcesRequest"; + }; + + return SearchResourcesRequest; + })(); + + v1.ApiHubResource = (function() { + + /** + * Properties of an ApiHubResource. + * @memberof google.cloud.apihub.v1 + * @interface IApiHubResource + * @property {google.cloud.apihub.v1.IApi|null} [api] ApiHubResource api + * @property {google.cloud.apihub.v1.IApiOperation|null} [operation] ApiHubResource operation + * @property {google.cloud.apihub.v1.IDeployment|null} [deployment] ApiHubResource deployment + * @property {google.cloud.apihub.v1.ISpec|null} [spec] ApiHubResource spec + * @property {google.cloud.apihub.v1.IDefinition|null} [definition] ApiHubResource definition + * @property {google.cloud.apihub.v1.IVersion|null} [version] ApiHubResource version + */ + + /** + * Constructs a new ApiHubResource. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents an ApiHubResource. + * @implements IApiHubResource + * @constructor + * @param {google.cloud.apihub.v1.IApiHubResource=} [properties] Properties to set + */ + function ApiHubResource(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]]; + } + + /** + * ApiHubResource api. + * @member {google.cloud.apihub.v1.IApi|null|undefined} api + * @memberof google.cloud.apihub.v1.ApiHubResource + * @instance + */ + ApiHubResource.prototype.api = null; + + /** + * ApiHubResource operation. + * @member {google.cloud.apihub.v1.IApiOperation|null|undefined} operation + * @memberof google.cloud.apihub.v1.ApiHubResource + * @instance + */ + ApiHubResource.prototype.operation = null; + + /** + * ApiHubResource deployment. + * @member {google.cloud.apihub.v1.IDeployment|null|undefined} deployment + * @memberof google.cloud.apihub.v1.ApiHubResource + * @instance + */ + ApiHubResource.prototype.deployment = null; + + /** + * ApiHubResource spec. + * @member {google.cloud.apihub.v1.ISpec|null|undefined} spec + * @memberof google.cloud.apihub.v1.ApiHubResource + * @instance + */ + ApiHubResource.prototype.spec = null; + + /** + * ApiHubResource definition. + * @member {google.cloud.apihub.v1.IDefinition|null|undefined} definition + * @memberof google.cloud.apihub.v1.ApiHubResource + * @instance + */ + ApiHubResource.prototype.definition = null; + + /** + * ApiHubResource version. + * @member {google.cloud.apihub.v1.IVersion|null|undefined} version + * @memberof google.cloud.apihub.v1.ApiHubResource + * @instance + */ + ApiHubResource.prototype.version = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ApiHubResource resource. + * @member {"api"|"operation"|"deployment"|"spec"|"definition"|"version"|undefined} resource + * @memberof google.cloud.apihub.v1.ApiHubResource + * @instance + */ + Object.defineProperty(ApiHubResource.prototype, "resource", { + get: $util.oneOfGetter($oneOfFields = ["api", "operation", "deployment", "spec", "definition", "version"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ApiHubResource instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.ApiHubResource + * @static + * @param {google.cloud.apihub.v1.IApiHubResource=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.ApiHubResource} ApiHubResource instance + */ + ApiHubResource.create = function create(properties) { + return new ApiHubResource(properties); + }; + + /** + * Encodes the specified ApiHubResource message. Does not implicitly {@link google.cloud.apihub.v1.ApiHubResource.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.ApiHubResource + * @static + * @param {google.cloud.apihub.v1.IApiHubResource} message ApiHubResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApiHubResource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.api != null && Object.hasOwnProperty.call(message, "api")) + $root.google.cloud.apihub.v1.Api.encode(message.api, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.operation != null && Object.hasOwnProperty.call(message, "operation")) + $root.google.cloud.apihub.v1.ApiOperation.encode(message.operation, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.deployment != null && Object.hasOwnProperty.call(message, "deployment")) + $root.google.cloud.apihub.v1.Deployment.encode(message.deployment, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.spec != null && Object.hasOwnProperty.call(message, "spec")) + $root.google.cloud.apihub.v1.Spec.encode(message.spec, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.definition != null && Object.hasOwnProperty.call(message, "definition")) + $root.google.cloud.apihub.v1.Definition.encode(message.definition, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + $root.google.cloud.apihub.v1.Version.encode(message.version, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ApiHubResource message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ApiHubResource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.ApiHubResource + * @static + * @param {google.cloud.apihub.v1.IApiHubResource} message ApiHubResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApiHubResource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ApiHubResource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.ApiHubResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.ApiHubResource} ApiHubResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApiHubResource.decode = function 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.apihub.v1.ApiHubResource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.api = $root.google.cloud.apihub.v1.Api.decode(reader, reader.uint32()); + break; + } + case 2: { + message.operation = $root.google.cloud.apihub.v1.ApiOperation.decode(reader, reader.uint32()); + break; + } + case 3: { + message.deployment = $root.google.cloud.apihub.v1.Deployment.decode(reader, reader.uint32()); + break; + } + case 4: { + message.spec = $root.google.cloud.apihub.v1.Spec.decode(reader, reader.uint32()); + break; + } + case 5: { + message.definition = $root.google.cloud.apihub.v1.Definition.decode(reader, reader.uint32()); + break; + } + case 6: { + message.version = $root.google.cloud.apihub.v1.Version.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ApiHubResource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.ApiHubResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.ApiHubResource} ApiHubResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApiHubResource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ApiHubResource message. + * @function verify + * @memberof google.cloud.apihub.v1.ApiHubResource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ApiHubResource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.api != null && message.hasOwnProperty("api")) { + properties.resource = 1; + { + var error = $root.google.cloud.apihub.v1.Api.verify(message.api); + if (error) + return "api." + error; + } + } + if (message.operation != null && message.hasOwnProperty("operation")) { + if (properties.resource === 1) + return "resource: multiple values"; + properties.resource = 1; + { + var error = $root.google.cloud.apihub.v1.ApiOperation.verify(message.operation); + if (error) + return "operation." + error; + } + } + if (message.deployment != null && message.hasOwnProperty("deployment")) { + if (properties.resource === 1) + return "resource: multiple values"; + properties.resource = 1; + { + var error = $root.google.cloud.apihub.v1.Deployment.verify(message.deployment); + if (error) + return "deployment." + error; + } + } + if (message.spec != null && message.hasOwnProperty("spec")) { + if (properties.resource === 1) + return "resource: multiple values"; + properties.resource = 1; + { + var error = $root.google.cloud.apihub.v1.Spec.verify(message.spec); + if (error) + return "spec." + error; + } + } + if (message.definition != null && message.hasOwnProperty("definition")) { + if (properties.resource === 1) + return "resource: multiple values"; + properties.resource = 1; + { + var error = $root.google.cloud.apihub.v1.Definition.verify(message.definition); + if (error) + return "definition." + error; + } + } + if (message.version != null && message.hasOwnProperty("version")) { + if (properties.resource === 1) + return "resource: multiple values"; + properties.resource = 1; + { + var error = $root.google.cloud.apihub.v1.Version.verify(message.version); + if (error) + return "version." + error; + } + } + return null; + }; + + /** + * Creates an ApiHubResource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.ApiHubResource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.ApiHubResource} ApiHubResource + */ + ApiHubResource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.ApiHubResource) + return object; + var message = new $root.google.cloud.apihub.v1.ApiHubResource(); + if (object.api != null) { + if (typeof object.api !== "object") + throw TypeError(".google.cloud.apihub.v1.ApiHubResource.api: object expected"); + message.api = $root.google.cloud.apihub.v1.Api.fromObject(object.api); + } + if (object.operation != null) { + if (typeof object.operation !== "object") + throw TypeError(".google.cloud.apihub.v1.ApiHubResource.operation: object expected"); + message.operation = $root.google.cloud.apihub.v1.ApiOperation.fromObject(object.operation); + } + if (object.deployment != null) { + if (typeof object.deployment !== "object") + throw TypeError(".google.cloud.apihub.v1.ApiHubResource.deployment: object expected"); + message.deployment = $root.google.cloud.apihub.v1.Deployment.fromObject(object.deployment); + } + if (object.spec != null) { + if (typeof object.spec !== "object") + throw TypeError(".google.cloud.apihub.v1.ApiHubResource.spec: object expected"); + message.spec = $root.google.cloud.apihub.v1.Spec.fromObject(object.spec); + } + if (object.definition != null) { + if (typeof object.definition !== "object") + throw TypeError(".google.cloud.apihub.v1.ApiHubResource.definition: object expected"); + message.definition = $root.google.cloud.apihub.v1.Definition.fromObject(object.definition); + } + if (object.version != null) { + if (typeof object.version !== "object") + throw TypeError(".google.cloud.apihub.v1.ApiHubResource.version: object expected"); + message.version = $root.google.cloud.apihub.v1.Version.fromObject(object.version); + } + return message; + }; + + /** + * Creates a plain object from an ApiHubResource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.ApiHubResource + * @static + * @param {google.cloud.apihub.v1.ApiHubResource} message ApiHubResource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ApiHubResource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.api != null && message.hasOwnProperty("api")) { + object.api = $root.google.cloud.apihub.v1.Api.toObject(message.api, options); + if (options.oneofs) + object.resource = "api"; + } + if (message.operation != null && message.hasOwnProperty("operation")) { + object.operation = $root.google.cloud.apihub.v1.ApiOperation.toObject(message.operation, options); + if (options.oneofs) + object.resource = "operation"; + } + if (message.deployment != null && message.hasOwnProperty("deployment")) { + object.deployment = $root.google.cloud.apihub.v1.Deployment.toObject(message.deployment, options); + if (options.oneofs) + object.resource = "deployment"; + } + if (message.spec != null && message.hasOwnProperty("spec")) { + object.spec = $root.google.cloud.apihub.v1.Spec.toObject(message.spec, options); + if (options.oneofs) + object.resource = "spec"; + } + if (message.definition != null && message.hasOwnProperty("definition")) { + object.definition = $root.google.cloud.apihub.v1.Definition.toObject(message.definition, options); + if (options.oneofs) + object.resource = "definition"; + } + if (message.version != null && message.hasOwnProperty("version")) { + object.version = $root.google.cloud.apihub.v1.Version.toObject(message.version, options); + if (options.oneofs) + object.resource = "version"; + } + return object; + }; + + /** + * Converts this ApiHubResource to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.ApiHubResource + * @instance + * @returns {Object.} JSON object + */ + ApiHubResource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ApiHubResource + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.ApiHubResource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ApiHubResource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.ApiHubResource"; + }; + + return ApiHubResource; + })(); + + v1.SearchResult = (function() { + + /** + * Properties of a SearchResult. + * @memberof google.cloud.apihub.v1 + * @interface ISearchResult + * @property {google.cloud.apihub.v1.IApiHubResource|null} [resource] SearchResult resource + */ + + /** + * Constructs a new SearchResult. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a SearchResult. + * @implements ISearchResult + * @constructor + * @param {google.cloud.apihub.v1.ISearchResult=} [properties] Properties to set + */ + function SearchResult(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]]; + } + + /** + * SearchResult resource. + * @member {google.cloud.apihub.v1.IApiHubResource|null|undefined} resource + * @memberof google.cloud.apihub.v1.SearchResult + * @instance + */ + SearchResult.prototype.resource = null; + + /** + * Creates a new SearchResult instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.SearchResult + * @static + * @param {google.cloud.apihub.v1.ISearchResult=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.SearchResult} SearchResult instance + */ + SearchResult.create = function create(properties) { + return new SearchResult(properties); + }; + + /** + * Encodes the specified SearchResult message. Does not implicitly {@link google.cloud.apihub.v1.SearchResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.SearchResult + * @static + * @param {google.cloud.apihub.v1.ISearchResult} message SearchResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + $root.google.cloud.apihub.v1.ApiHubResource.encode(message.resource, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SearchResult message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.SearchResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.SearchResult + * @static + * @param {google.cloud.apihub.v1.ISearchResult} message SearchResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SearchResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.SearchResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.SearchResult} SearchResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchResult.decode = function 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.apihub.v1.SearchResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.resource = $root.google.cloud.apihub.v1.ApiHubResource.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SearchResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.SearchResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.SearchResult} SearchResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SearchResult message. + * @function verify + * @memberof google.cloud.apihub.v1.SearchResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SearchResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resource != null && message.hasOwnProperty("resource")) { + var error = $root.google.cloud.apihub.v1.ApiHubResource.verify(message.resource); + if (error) + return "resource." + error; + } + return null; + }; + + /** + * Creates a SearchResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.SearchResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.SearchResult} SearchResult + */ + SearchResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.SearchResult) + return object; + var message = new $root.google.cloud.apihub.v1.SearchResult(); + if (object.resource != null) { + if (typeof object.resource !== "object") + throw TypeError(".google.cloud.apihub.v1.SearchResult.resource: object expected"); + message.resource = $root.google.cloud.apihub.v1.ApiHubResource.fromObject(object.resource); + } + return message; + }; + + /** + * Creates a plain object from a SearchResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.SearchResult + * @static + * @param {google.cloud.apihub.v1.SearchResult} message SearchResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SearchResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.resource = null; + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = $root.google.cloud.apihub.v1.ApiHubResource.toObject(message.resource, options); + return object; + }; + + /** + * Converts this SearchResult to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.SearchResult + * @instance + * @returns {Object.} JSON object + */ + SearchResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SearchResult + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.SearchResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SearchResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.SearchResult"; + }; + + return SearchResult; + })(); + + v1.SearchResourcesResponse = (function() { + + /** + * Properties of a SearchResourcesResponse. + * @memberof google.cloud.apihub.v1 + * @interface ISearchResourcesResponse + * @property {Array.|null} [searchResults] SearchResourcesResponse searchResults + * @property {string|null} [nextPageToken] SearchResourcesResponse nextPageToken + */ + + /** + * Constructs a new SearchResourcesResponse. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a SearchResourcesResponse. + * @implements ISearchResourcesResponse + * @constructor + * @param {google.cloud.apihub.v1.ISearchResourcesResponse=} [properties] Properties to set + */ + function SearchResourcesResponse(properties) { + this.searchResults = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SearchResourcesResponse searchResults. + * @member {Array.} searchResults + * @memberof google.cloud.apihub.v1.SearchResourcesResponse + * @instance + */ + SearchResourcesResponse.prototype.searchResults = $util.emptyArray; + + /** + * SearchResourcesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.apihub.v1.SearchResourcesResponse + * @instance + */ + SearchResourcesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new SearchResourcesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.SearchResourcesResponse + * @static + * @param {google.cloud.apihub.v1.ISearchResourcesResponse=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.SearchResourcesResponse} SearchResourcesResponse instance + */ + SearchResourcesResponse.create = function create(properties) { + return new SearchResourcesResponse(properties); + }; + + /** + * Encodes the specified SearchResourcesResponse message. Does not implicitly {@link google.cloud.apihub.v1.SearchResourcesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.SearchResourcesResponse + * @static + * @param {google.cloud.apihub.v1.ISearchResourcesResponse} message SearchResourcesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchResourcesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.searchResults != null && message.searchResults.length) + for (var i = 0; i < message.searchResults.length; ++i) + $root.google.cloud.apihub.v1.SearchResult.encode(message.searchResults[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 SearchResourcesResponse message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.SearchResourcesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.SearchResourcesResponse + * @static + * @param {google.cloud.apihub.v1.ISearchResourcesResponse} message SearchResourcesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchResourcesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SearchResourcesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.SearchResourcesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.SearchResourcesResponse} SearchResourcesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchResourcesResponse.decode = function 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.apihub.v1.SearchResourcesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.searchResults && message.searchResults.length)) + message.searchResults = []; + message.searchResults.push($root.google.cloud.apihub.v1.SearchResult.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SearchResourcesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.SearchResourcesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.SearchResourcesResponse} SearchResourcesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchResourcesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SearchResourcesResponse message. + * @function verify + * @memberof google.cloud.apihub.v1.SearchResourcesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SearchResourcesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.searchResults != null && message.hasOwnProperty("searchResults")) { + if (!Array.isArray(message.searchResults)) + return "searchResults: array expected"; + for (var i = 0; i < message.searchResults.length; ++i) { + var error = $root.google.cloud.apihub.v1.SearchResult.verify(message.searchResults[i]); + if (error) + return "searchResults." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a SearchResourcesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.SearchResourcesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.SearchResourcesResponse} SearchResourcesResponse + */ + SearchResourcesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.SearchResourcesResponse) + return object; + var message = new $root.google.cloud.apihub.v1.SearchResourcesResponse(); + if (object.searchResults) { + if (!Array.isArray(object.searchResults)) + throw TypeError(".google.cloud.apihub.v1.SearchResourcesResponse.searchResults: array expected"); + message.searchResults = []; + for (var i = 0; i < object.searchResults.length; ++i) { + if (typeof object.searchResults[i] !== "object") + throw TypeError(".google.cloud.apihub.v1.SearchResourcesResponse.searchResults: object expected"); + message.searchResults[i] = $root.google.cloud.apihub.v1.SearchResult.fromObject(object.searchResults[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a SearchResourcesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.SearchResourcesResponse + * @static + * @param {google.cloud.apihub.v1.SearchResourcesResponse} message SearchResourcesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SearchResourcesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.searchResults = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.searchResults && message.searchResults.length) { + object.searchResults = []; + for (var j = 0; j < message.searchResults.length; ++j) + object.searchResults[j] = $root.google.cloud.apihub.v1.SearchResult.toObject(message.searchResults[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this SearchResourcesResponse to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.SearchResourcesResponse + * @instance + * @returns {Object.} JSON object + */ + SearchResourcesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SearchResourcesResponse + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.SearchResourcesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SearchResourcesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.SearchResourcesResponse"; + }; + + return SearchResourcesResponse; + })(); + + v1.CreateDependencyRequest = (function() { + + /** + * Properties of a CreateDependencyRequest. + * @memberof google.cloud.apihub.v1 + * @interface ICreateDependencyRequest + * @property {string|null} [parent] CreateDependencyRequest parent + * @property {string|null} [dependencyId] CreateDependencyRequest dependencyId + * @property {google.cloud.apihub.v1.IDependency|null} [dependency] CreateDependencyRequest dependency + */ + + /** + * Constructs a new CreateDependencyRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a CreateDependencyRequest. + * @implements ICreateDependencyRequest + * @constructor + * @param {google.cloud.apihub.v1.ICreateDependencyRequest=} [properties] Properties to set + */ + function CreateDependencyRequest(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]]; + } + + /** + * CreateDependencyRequest parent. + * @member {string} parent + * @memberof google.cloud.apihub.v1.CreateDependencyRequest + * @instance + */ + CreateDependencyRequest.prototype.parent = ""; + + /** + * CreateDependencyRequest dependencyId. + * @member {string} dependencyId + * @memberof google.cloud.apihub.v1.CreateDependencyRequest + * @instance + */ + CreateDependencyRequest.prototype.dependencyId = ""; + + /** + * CreateDependencyRequest dependency. + * @member {google.cloud.apihub.v1.IDependency|null|undefined} dependency + * @memberof google.cloud.apihub.v1.CreateDependencyRequest + * @instance + */ + CreateDependencyRequest.prototype.dependency = null; + + /** + * Creates a new CreateDependencyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.CreateDependencyRequest + * @static + * @param {google.cloud.apihub.v1.ICreateDependencyRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.CreateDependencyRequest} CreateDependencyRequest instance + */ + CreateDependencyRequest.create = function create(properties) { + return new CreateDependencyRequest(properties); + }; + + /** + * Encodes the specified CreateDependencyRequest message. Does not implicitly {@link google.cloud.apihub.v1.CreateDependencyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.CreateDependencyRequest + * @static + * @param {google.cloud.apihub.v1.ICreateDependencyRequest} message CreateDependencyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateDependencyRequest.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.dependencyId != null && Object.hasOwnProperty.call(message, "dependencyId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.dependencyId); + if (message.dependency != null && Object.hasOwnProperty.call(message, "dependency")) + $root.google.cloud.apihub.v1.Dependency.encode(message.dependency, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateDependencyRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.CreateDependencyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.CreateDependencyRequest + * @static + * @param {google.cloud.apihub.v1.ICreateDependencyRequest} message CreateDependencyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateDependencyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateDependencyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.CreateDependencyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.CreateDependencyRequest} CreateDependencyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateDependencyRequest.decode = function 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.apihub.v1.CreateDependencyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.dependencyId = reader.string(); + break; + } + case 3: { + message.dependency = $root.google.cloud.apihub.v1.Dependency.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateDependencyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.CreateDependencyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.CreateDependencyRequest} CreateDependencyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateDependencyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateDependencyRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.CreateDependencyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateDependencyRequest.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.dependencyId != null && message.hasOwnProperty("dependencyId")) + if (!$util.isString(message.dependencyId)) + return "dependencyId: string expected"; + if (message.dependency != null && message.hasOwnProperty("dependency")) { + var error = $root.google.cloud.apihub.v1.Dependency.verify(message.dependency); + if (error) + return "dependency." + error; + } + return null; + }; + + /** + * Creates a CreateDependencyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.CreateDependencyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.CreateDependencyRequest} CreateDependencyRequest + */ + CreateDependencyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.CreateDependencyRequest) + return object; + var message = new $root.google.cloud.apihub.v1.CreateDependencyRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.dependencyId != null) + message.dependencyId = String(object.dependencyId); + if (object.dependency != null) { + if (typeof object.dependency !== "object") + throw TypeError(".google.cloud.apihub.v1.CreateDependencyRequest.dependency: object expected"); + message.dependency = $root.google.cloud.apihub.v1.Dependency.fromObject(object.dependency); + } + return message; + }; + + /** + * Creates a plain object from a CreateDependencyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.CreateDependencyRequest + * @static + * @param {google.cloud.apihub.v1.CreateDependencyRequest} message CreateDependencyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateDependencyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.dependencyId = ""; + object.dependency = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.dependencyId != null && message.hasOwnProperty("dependencyId")) + object.dependencyId = message.dependencyId; + if (message.dependency != null && message.hasOwnProperty("dependency")) + object.dependency = $root.google.cloud.apihub.v1.Dependency.toObject(message.dependency, options); + return object; + }; + + /** + * Converts this CreateDependencyRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.CreateDependencyRequest + * @instance + * @returns {Object.} JSON object + */ + CreateDependencyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateDependencyRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.CreateDependencyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateDependencyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.CreateDependencyRequest"; + }; + + return CreateDependencyRequest; + })(); + + v1.GetDependencyRequest = (function() { + + /** + * Properties of a GetDependencyRequest. + * @memberof google.cloud.apihub.v1 + * @interface IGetDependencyRequest + * @property {string|null} [name] GetDependencyRequest name + */ + + /** + * Constructs a new GetDependencyRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a GetDependencyRequest. + * @implements IGetDependencyRequest + * @constructor + * @param {google.cloud.apihub.v1.IGetDependencyRequest=} [properties] Properties to set + */ + function GetDependencyRequest(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]]; + } + + /** + * GetDependencyRequest name. + * @member {string} name + * @memberof google.cloud.apihub.v1.GetDependencyRequest + * @instance + */ + GetDependencyRequest.prototype.name = ""; + + /** + * Creates a new GetDependencyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.GetDependencyRequest + * @static + * @param {google.cloud.apihub.v1.IGetDependencyRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.GetDependencyRequest} GetDependencyRequest instance + */ + GetDependencyRequest.create = function create(properties) { + return new GetDependencyRequest(properties); + }; + + /** + * Encodes the specified GetDependencyRequest message. Does not implicitly {@link google.cloud.apihub.v1.GetDependencyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.GetDependencyRequest + * @static + * @param {google.cloud.apihub.v1.IGetDependencyRequest} message GetDependencyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDependencyRequest.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 GetDependencyRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.GetDependencyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.GetDependencyRequest + * @static + * @param {google.cloud.apihub.v1.IGetDependencyRequest} message GetDependencyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDependencyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDependencyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.GetDependencyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.GetDependencyRequest} GetDependencyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDependencyRequest.decode = function 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.apihub.v1.GetDependencyRequest(); + 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 GetDependencyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.GetDependencyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.GetDependencyRequest} GetDependencyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDependencyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDependencyRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.GetDependencyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDependencyRequest.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 GetDependencyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.GetDependencyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.GetDependencyRequest} GetDependencyRequest + */ + GetDependencyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.GetDependencyRequest) + return object; + var message = new $root.google.cloud.apihub.v1.GetDependencyRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetDependencyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.GetDependencyRequest + * @static + * @param {google.cloud.apihub.v1.GetDependencyRequest} message GetDependencyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDependencyRequest.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 GetDependencyRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.GetDependencyRequest + * @instance + * @returns {Object.} JSON object + */ + GetDependencyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetDependencyRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.GetDependencyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetDependencyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.GetDependencyRequest"; + }; + + return GetDependencyRequest; + })(); + + v1.UpdateDependencyRequest = (function() { + + /** + * Properties of an UpdateDependencyRequest. + * @memberof google.cloud.apihub.v1 + * @interface IUpdateDependencyRequest + * @property {google.cloud.apihub.v1.IDependency|null} [dependency] UpdateDependencyRequest dependency + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateDependencyRequest updateMask + */ + + /** + * Constructs a new UpdateDependencyRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents an UpdateDependencyRequest. + * @implements IUpdateDependencyRequest + * @constructor + * @param {google.cloud.apihub.v1.IUpdateDependencyRequest=} [properties] Properties to set + */ + function UpdateDependencyRequest(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]]; + } + + /** + * UpdateDependencyRequest dependency. + * @member {google.cloud.apihub.v1.IDependency|null|undefined} dependency + * @memberof google.cloud.apihub.v1.UpdateDependencyRequest + * @instance + */ + UpdateDependencyRequest.prototype.dependency = null; + + /** + * UpdateDependencyRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.apihub.v1.UpdateDependencyRequest + * @instance + */ + UpdateDependencyRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateDependencyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.UpdateDependencyRequest + * @static + * @param {google.cloud.apihub.v1.IUpdateDependencyRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.UpdateDependencyRequest} UpdateDependencyRequest instance + */ + UpdateDependencyRequest.create = function create(properties) { + return new UpdateDependencyRequest(properties); + }; + + /** + * Encodes the specified UpdateDependencyRequest message. Does not implicitly {@link google.cloud.apihub.v1.UpdateDependencyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.UpdateDependencyRequest + * @static + * @param {google.cloud.apihub.v1.IUpdateDependencyRequest} message UpdateDependencyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDependencyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dependency != null && Object.hasOwnProperty.call(message, "dependency")) + $root.google.cloud.apihub.v1.Dependency.encode(message.dependency, 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 UpdateDependencyRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.UpdateDependencyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.UpdateDependencyRequest + * @static + * @param {google.cloud.apihub.v1.IUpdateDependencyRequest} message UpdateDependencyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDependencyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateDependencyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.UpdateDependencyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.UpdateDependencyRequest} UpdateDependencyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDependencyRequest.decode = function 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.apihub.v1.UpdateDependencyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.dependency = $root.google.cloud.apihub.v1.Dependency.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 UpdateDependencyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.UpdateDependencyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.UpdateDependencyRequest} UpdateDependencyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDependencyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateDependencyRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.UpdateDependencyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateDependencyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dependency != null && message.hasOwnProperty("dependency")) { + var error = $root.google.cloud.apihub.v1.Dependency.verify(message.dependency); + if (error) + return "dependency." + 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 UpdateDependencyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.UpdateDependencyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.UpdateDependencyRequest} UpdateDependencyRequest + */ + UpdateDependencyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.UpdateDependencyRequest) + return object; + var message = new $root.google.cloud.apihub.v1.UpdateDependencyRequest(); + if (object.dependency != null) { + if (typeof object.dependency !== "object") + throw TypeError(".google.cloud.apihub.v1.UpdateDependencyRequest.dependency: object expected"); + message.dependency = $root.google.cloud.apihub.v1.Dependency.fromObject(object.dependency); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.apihub.v1.UpdateDependencyRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateDependencyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.UpdateDependencyRequest + * @static + * @param {google.cloud.apihub.v1.UpdateDependencyRequest} message UpdateDependencyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateDependencyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.dependency = null; + object.updateMask = null; + } + if (message.dependency != null && message.hasOwnProperty("dependency")) + object.dependency = $root.google.cloud.apihub.v1.Dependency.toObject(message.dependency, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateDependencyRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.UpdateDependencyRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateDependencyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateDependencyRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.UpdateDependencyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateDependencyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.UpdateDependencyRequest"; + }; + + return UpdateDependencyRequest; + })(); + + v1.DeleteDependencyRequest = (function() { + + /** + * Properties of a DeleteDependencyRequest. + * @memberof google.cloud.apihub.v1 + * @interface IDeleteDependencyRequest + * @property {string|null} [name] DeleteDependencyRequest name + */ + + /** + * Constructs a new DeleteDependencyRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a DeleteDependencyRequest. + * @implements IDeleteDependencyRequest + * @constructor + * @param {google.cloud.apihub.v1.IDeleteDependencyRequest=} [properties] Properties to set + */ + function DeleteDependencyRequest(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]]; + } + + /** + * DeleteDependencyRequest name. + * @member {string} name + * @memberof google.cloud.apihub.v1.DeleteDependencyRequest + * @instance + */ + DeleteDependencyRequest.prototype.name = ""; + + /** + * Creates a new DeleteDependencyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.DeleteDependencyRequest + * @static + * @param {google.cloud.apihub.v1.IDeleteDependencyRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.DeleteDependencyRequest} DeleteDependencyRequest instance + */ + DeleteDependencyRequest.create = function create(properties) { + return new DeleteDependencyRequest(properties); + }; + + /** + * Encodes the specified DeleteDependencyRequest message. Does not implicitly {@link google.cloud.apihub.v1.DeleteDependencyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.DeleteDependencyRequest + * @static + * @param {google.cloud.apihub.v1.IDeleteDependencyRequest} message DeleteDependencyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteDependencyRequest.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 DeleteDependencyRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.DeleteDependencyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.DeleteDependencyRequest + * @static + * @param {google.cloud.apihub.v1.IDeleteDependencyRequest} message DeleteDependencyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteDependencyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteDependencyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.DeleteDependencyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.DeleteDependencyRequest} DeleteDependencyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteDependencyRequest.decode = function 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.apihub.v1.DeleteDependencyRequest(); + 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 DeleteDependencyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.DeleteDependencyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.DeleteDependencyRequest} DeleteDependencyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteDependencyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteDependencyRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.DeleteDependencyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteDependencyRequest.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 DeleteDependencyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.DeleteDependencyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.DeleteDependencyRequest} DeleteDependencyRequest + */ + DeleteDependencyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.DeleteDependencyRequest) + return object; + var message = new $root.google.cloud.apihub.v1.DeleteDependencyRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteDependencyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.DeleteDependencyRequest + * @static + * @param {google.cloud.apihub.v1.DeleteDependencyRequest} message DeleteDependencyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteDependencyRequest.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 DeleteDependencyRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.DeleteDependencyRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteDependencyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteDependencyRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.DeleteDependencyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteDependencyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.DeleteDependencyRequest"; + }; + + return DeleteDependencyRequest; + })(); + + v1.ListDependenciesRequest = (function() { + + /** + * Properties of a ListDependenciesRequest. + * @memberof google.cloud.apihub.v1 + * @interface IListDependenciesRequest + * @property {string|null} [parent] ListDependenciesRequest parent + * @property {string|null} [filter] ListDependenciesRequest filter + * @property {number|null} [pageSize] ListDependenciesRequest pageSize + * @property {string|null} [pageToken] ListDependenciesRequest pageToken + */ + + /** + * Constructs a new ListDependenciesRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a ListDependenciesRequest. + * @implements IListDependenciesRequest + * @constructor + * @param {google.cloud.apihub.v1.IListDependenciesRequest=} [properties] Properties to set + */ + function ListDependenciesRequest(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]]; + } + + /** + * ListDependenciesRequest parent. + * @member {string} parent + * @memberof google.cloud.apihub.v1.ListDependenciesRequest + * @instance + */ + ListDependenciesRequest.prototype.parent = ""; + + /** + * ListDependenciesRequest filter. + * @member {string} filter + * @memberof google.cloud.apihub.v1.ListDependenciesRequest + * @instance + */ + ListDependenciesRequest.prototype.filter = ""; + + /** + * ListDependenciesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.apihub.v1.ListDependenciesRequest + * @instance + */ + ListDependenciesRequest.prototype.pageSize = 0; + + /** + * ListDependenciesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.apihub.v1.ListDependenciesRequest + * @instance + */ + ListDependenciesRequest.prototype.pageToken = ""; + + /** + * Creates a new ListDependenciesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.ListDependenciesRequest + * @static + * @param {google.cloud.apihub.v1.IListDependenciesRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.ListDependenciesRequest} ListDependenciesRequest instance + */ + ListDependenciesRequest.create = function create(properties) { + return new ListDependenciesRequest(properties); + }; + + /** + * Encodes the specified ListDependenciesRequest message. Does not implicitly {@link google.cloud.apihub.v1.ListDependenciesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.ListDependenciesRequest + * @static + * @param {google.cloud.apihub.v1.IListDependenciesRequest} message ListDependenciesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDependenciesRequest.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.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListDependenciesRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListDependenciesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.ListDependenciesRequest + * @static + * @param {google.cloud.apihub.v1.IListDependenciesRequest} message ListDependenciesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDependenciesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDependenciesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.ListDependenciesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.ListDependenciesRequest} ListDependenciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDependenciesRequest.decode = function 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.apihub.v1.ListDependenciesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.filter = reader.string(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + case 4: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListDependenciesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.ListDependenciesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.ListDependenciesRequest} ListDependenciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDependenciesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDependenciesRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.ListDependenciesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDependenciesRequest.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.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 ListDependenciesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.ListDependenciesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.ListDependenciesRequest} ListDependenciesRequest + */ + ListDependenciesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.ListDependenciesRequest) + return object; + var message = new $root.google.cloud.apihub.v1.ListDependenciesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + 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 ListDependenciesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.ListDependenciesRequest + * @static + * @param {google.cloud.apihub.v1.ListDependenciesRequest} message ListDependenciesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDependenciesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + 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; + return object; + }; + + /** + * Converts this ListDependenciesRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.ListDependenciesRequest + * @instance + * @returns {Object.} JSON object + */ + ListDependenciesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListDependenciesRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.ListDependenciesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListDependenciesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.ListDependenciesRequest"; + }; + + return ListDependenciesRequest; + })(); + + v1.ListDependenciesResponse = (function() { + + /** + * Properties of a ListDependenciesResponse. + * @memberof google.cloud.apihub.v1 + * @interface IListDependenciesResponse + * @property {Array.|null} [dependencies] ListDependenciesResponse dependencies + * @property {string|null} [nextPageToken] ListDependenciesResponse nextPageToken + */ + + /** + * Constructs a new ListDependenciesResponse. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a ListDependenciesResponse. + * @implements IListDependenciesResponse + * @constructor + * @param {google.cloud.apihub.v1.IListDependenciesResponse=} [properties] Properties to set + */ + function ListDependenciesResponse(properties) { + this.dependencies = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListDependenciesResponse dependencies. + * @member {Array.} dependencies + * @memberof google.cloud.apihub.v1.ListDependenciesResponse + * @instance + */ + ListDependenciesResponse.prototype.dependencies = $util.emptyArray; + + /** + * ListDependenciesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.apihub.v1.ListDependenciesResponse + * @instance + */ + ListDependenciesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListDependenciesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.ListDependenciesResponse + * @static + * @param {google.cloud.apihub.v1.IListDependenciesResponse=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.ListDependenciesResponse} ListDependenciesResponse instance + */ + ListDependenciesResponse.create = function create(properties) { + return new ListDependenciesResponse(properties); + }; + + /** + * Encodes the specified ListDependenciesResponse message. Does not implicitly {@link google.cloud.apihub.v1.ListDependenciesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.ListDependenciesResponse + * @static + * @param {google.cloud.apihub.v1.IListDependenciesResponse} message ListDependenciesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDependenciesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dependencies != null && message.dependencies.length) + for (var i = 0; i < message.dependencies.length; ++i) + $root.google.cloud.apihub.v1.Dependency.encode(message.dependencies[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 ListDependenciesResponse message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListDependenciesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.ListDependenciesResponse + * @static + * @param {google.cloud.apihub.v1.IListDependenciesResponse} message ListDependenciesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDependenciesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDependenciesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.ListDependenciesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.ListDependenciesResponse} ListDependenciesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDependenciesResponse.decode = function 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.apihub.v1.ListDependenciesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.dependencies && message.dependencies.length)) + message.dependencies = []; + message.dependencies.push($root.google.cloud.apihub.v1.Dependency.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListDependenciesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.ListDependenciesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.ListDependenciesResponse} ListDependenciesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDependenciesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDependenciesResponse message. + * @function verify + * @memberof google.cloud.apihub.v1.ListDependenciesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDependenciesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dependencies != null && message.hasOwnProperty("dependencies")) { + if (!Array.isArray(message.dependencies)) + return "dependencies: array expected"; + for (var i = 0; i < message.dependencies.length; ++i) { + var error = $root.google.cloud.apihub.v1.Dependency.verify(message.dependencies[i]); + if (error) + return "dependencies." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListDependenciesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.ListDependenciesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.ListDependenciesResponse} ListDependenciesResponse + */ + ListDependenciesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.ListDependenciesResponse) + return object; + var message = new $root.google.cloud.apihub.v1.ListDependenciesResponse(); + if (object.dependencies) { + if (!Array.isArray(object.dependencies)) + throw TypeError(".google.cloud.apihub.v1.ListDependenciesResponse.dependencies: array expected"); + message.dependencies = []; + for (var i = 0; i < object.dependencies.length; ++i) { + if (typeof object.dependencies[i] !== "object") + throw TypeError(".google.cloud.apihub.v1.ListDependenciesResponse.dependencies: object expected"); + message.dependencies[i] = $root.google.cloud.apihub.v1.Dependency.fromObject(object.dependencies[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListDependenciesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.ListDependenciesResponse + * @static + * @param {google.cloud.apihub.v1.ListDependenciesResponse} message ListDependenciesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDependenciesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.dependencies = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.dependencies && message.dependencies.length) { + object.dependencies = []; + for (var j = 0; j < message.dependencies.length; ++j) + object.dependencies[j] = $root.google.cloud.apihub.v1.Dependency.toObject(message.dependencies[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListDependenciesResponse to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.ListDependenciesResponse + * @instance + * @returns {Object.} JSON object + */ + ListDependenciesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListDependenciesResponse + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.ListDependenciesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListDependenciesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.ListDependenciesResponse"; + }; + + return ListDependenciesResponse; + })(); + + v1.CreateExternalApiRequest = (function() { + + /** + * Properties of a CreateExternalApiRequest. + * @memberof google.cloud.apihub.v1 + * @interface ICreateExternalApiRequest + * @property {string|null} [parent] CreateExternalApiRequest parent + * @property {string|null} [externalApiId] CreateExternalApiRequest externalApiId + * @property {google.cloud.apihub.v1.IExternalApi|null} [externalApi] CreateExternalApiRequest externalApi + */ + + /** + * Constructs a new CreateExternalApiRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a CreateExternalApiRequest. + * @implements ICreateExternalApiRequest + * @constructor + * @param {google.cloud.apihub.v1.ICreateExternalApiRequest=} [properties] Properties to set + */ + function CreateExternalApiRequest(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]]; + } + + /** + * CreateExternalApiRequest parent. + * @member {string} parent + * @memberof google.cloud.apihub.v1.CreateExternalApiRequest + * @instance + */ + CreateExternalApiRequest.prototype.parent = ""; + + /** + * CreateExternalApiRequest externalApiId. + * @member {string} externalApiId + * @memberof google.cloud.apihub.v1.CreateExternalApiRequest + * @instance + */ + CreateExternalApiRequest.prototype.externalApiId = ""; + + /** + * CreateExternalApiRequest externalApi. + * @member {google.cloud.apihub.v1.IExternalApi|null|undefined} externalApi + * @memberof google.cloud.apihub.v1.CreateExternalApiRequest + * @instance + */ + CreateExternalApiRequest.prototype.externalApi = null; + + /** + * Creates a new CreateExternalApiRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.CreateExternalApiRequest + * @static + * @param {google.cloud.apihub.v1.ICreateExternalApiRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.CreateExternalApiRequest} CreateExternalApiRequest instance + */ + CreateExternalApiRequest.create = function create(properties) { + return new CreateExternalApiRequest(properties); + }; + + /** + * Encodes the specified CreateExternalApiRequest message. Does not implicitly {@link google.cloud.apihub.v1.CreateExternalApiRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.CreateExternalApiRequest + * @static + * @param {google.cloud.apihub.v1.ICreateExternalApiRequest} message CreateExternalApiRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateExternalApiRequest.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.externalApiId != null && Object.hasOwnProperty.call(message, "externalApiId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.externalApiId); + if (message.externalApi != null && Object.hasOwnProperty.call(message, "externalApi")) + $root.google.cloud.apihub.v1.ExternalApi.encode(message.externalApi, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateExternalApiRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.CreateExternalApiRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.CreateExternalApiRequest + * @static + * @param {google.cloud.apihub.v1.ICreateExternalApiRequest} message CreateExternalApiRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateExternalApiRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateExternalApiRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.CreateExternalApiRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.CreateExternalApiRequest} CreateExternalApiRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateExternalApiRequest.decode = function 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.apihub.v1.CreateExternalApiRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.externalApiId = reader.string(); + break; + } + case 3: { + message.externalApi = $root.google.cloud.apihub.v1.ExternalApi.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateExternalApiRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.CreateExternalApiRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.CreateExternalApiRequest} CreateExternalApiRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateExternalApiRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateExternalApiRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.CreateExternalApiRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateExternalApiRequest.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.externalApiId != null && message.hasOwnProperty("externalApiId")) + if (!$util.isString(message.externalApiId)) + return "externalApiId: string expected"; + if (message.externalApi != null && message.hasOwnProperty("externalApi")) { + var error = $root.google.cloud.apihub.v1.ExternalApi.verify(message.externalApi); + if (error) + return "externalApi." + error; + } + return null; + }; + + /** + * Creates a CreateExternalApiRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.CreateExternalApiRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.CreateExternalApiRequest} CreateExternalApiRequest + */ + CreateExternalApiRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.CreateExternalApiRequest) + return object; + var message = new $root.google.cloud.apihub.v1.CreateExternalApiRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.externalApiId != null) + message.externalApiId = String(object.externalApiId); + if (object.externalApi != null) { + if (typeof object.externalApi !== "object") + throw TypeError(".google.cloud.apihub.v1.CreateExternalApiRequest.externalApi: object expected"); + message.externalApi = $root.google.cloud.apihub.v1.ExternalApi.fromObject(object.externalApi); + } + return message; + }; + + /** + * Creates a plain object from a CreateExternalApiRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.CreateExternalApiRequest + * @static + * @param {google.cloud.apihub.v1.CreateExternalApiRequest} message CreateExternalApiRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateExternalApiRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.externalApiId = ""; + object.externalApi = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.externalApiId != null && message.hasOwnProperty("externalApiId")) + object.externalApiId = message.externalApiId; + if (message.externalApi != null && message.hasOwnProperty("externalApi")) + object.externalApi = $root.google.cloud.apihub.v1.ExternalApi.toObject(message.externalApi, options); + return object; + }; + + /** + * Converts this CreateExternalApiRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.CreateExternalApiRequest + * @instance + * @returns {Object.} JSON object + */ + CreateExternalApiRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateExternalApiRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.CreateExternalApiRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateExternalApiRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.CreateExternalApiRequest"; + }; + + return CreateExternalApiRequest; + })(); + + v1.GetExternalApiRequest = (function() { + + /** + * Properties of a GetExternalApiRequest. + * @memberof google.cloud.apihub.v1 + * @interface IGetExternalApiRequest + * @property {string|null} [name] GetExternalApiRequest name + */ + + /** + * Constructs a new GetExternalApiRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a GetExternalApiRequest. + * @implements IGetExternalApiRequest + * @constructor + * @param {google.cloud.apihub.v1.IGetExternalApiRequest=} [properties] Properties to set + */ + function GetExternalApiRequest(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]]; + } + + /** + * GetExternalApiRequest name. + * @member {string} name + * @memberof google.cloud.apihub.v1.GetExternalApiRequest + * @instance + */ + GetExternalApiRequest.prototype.name = ""; + + /** + * Creates a new GetExternalApiRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.GetExternalApiRequest + * @static + * @param {google.cloud.apihub.v1.IGetExternalApiRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.GetExternalApiRequest} GetExternalApiRequest instance + */ + GetExternalApiRequest.create = function create(properties) { + return new GetExternalApiRequest(properties); + }; + + /** + * Encodes the specified GetExternalApiRequest message. Does not implicitly {@link google.cloud.apihub.v1.GetExternalApiRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.GetExternalApiRequest + * @static + * @param {google.cloud.apihub.v1.IGetExternalApiRequest} message GetExternalApiRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetExternalApiRequest.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 GetExternalApiRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.GetExternalApiRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.GetExternalApiRequest + * @static + * @param {google.cloud.apihub.v1.IGetExternalApiRequest} message GetExternalApiRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetExternalApiRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetExternalApiRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.GetExternalApiRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.GetExternalApiRequest} GetExternalApiRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetExternalApiRequest.decode = function 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.apihub.v1.GetExternalApiRequest(); + 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 GetExternalApiRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.GetExternalApiRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.GetExternalApiRequest} GetExternalApiRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetExternalApiRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetExternalApiRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.GetExternalApiRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetExternalApiRequest.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 GetExternalApiRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.GetExternalApiRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.GetExternalApiRequest} GetExternalApiRequest + */ + GetExternalApiRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.GetExternalApiRequest) + return object; + var message = new $root.google.cloud.apihub.v1.GetExternalApiRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetExternalApiRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.GetExternalApiRequest + * @static + * @param {google.cloud.apihub.v1.GetExternalApiRequest} message GetExternalApiRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetExternalApiRequest.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 GetExternalApiRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.GetExternalApiRequest + * @instance + * @returns {Object.} JSON object + */ + GetExternalApiRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetExternalApiRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.GetExternalApiRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetExternalApiRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.GetExternalApiRequest"; + }; + + return GetExternalApiRequest; + })(); + + v1.UpdateExternalApiRequest = (function() { + + /** + * Properties of an UpdateExternalApiRequest. + * @memberof google.cloud.apihub.v1 + * @interface IUpdateExternalApiRequest + * @property {google.cloud.apihub.v1.IExternalApi|null} [externalApi] UpdateExternalApiRequest externalApi + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateExternalApiRequest updateMask + */ + + /** + * Constructs a new UpdateExternalApiRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents an UpdateExternalApiRequest. + * @implements IUpdateExternalApiRequest + * @constructor + * @param {google.cloud.apihub.v1.IUpdateExternalApiRequest=} [properties] Properties to set + */ + function UpdateExternalApiRequest(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]]; + } + + /** + * UpdateExternalApiRequest externalApi. + * @member {google.cloud.apihub.v1.IExternalApi|null|undefined} externalApi + * @memberof google.cloud.apihub.v1.UpdateExternalApiRequest + * @instance + */ + UpdateExternalApiRequest.prototype.externalApi = null; + + /** + * UpdateExternalApiRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.apihub.v1.UpdateExternalApiRequest + * @instance + */ + UpdateExternalApiRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateExternalApiRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.UpdateExternalApiRequest + * @static + * @param {google.cloud.apihub.v1.IUpdateExternalApiRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.UpdateExternalApiRequest} UpdateExternalApiRequest instance + */ + UpdateExternalApiRequest.create = function create(properties) { + return new UpdateExternalApiRequest(properties); + }; + + /** + * Encodes the specified UpdateExternalApiRequest message. Does not implicitly {@link google.cloud.apihub.v1.UpdateExternalApiRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.UpdateExternalApiRequest + * @static + * @param {google.cloud.apihub.v1.IUpdateExternalApiRequest} message UpdateExternalApiRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateExternalApiRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.externalApi != null && Object.hasOwnProperty.call(message, "externalApi")) + $root.google.cloud.apihub.v1.ExternalApi.encode(message.externalApi, 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 UpdateExternalApiRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.UpdateExternalApiRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.UpdateExternalApiRequest + * @static + * @param {google.cloud.apihub.v1.IUpdateExternalApiRequest} message UpdateExternalApiRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateExternalApiRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateExternalApiRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.UpdateExternalApiRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.UpdateExternalApiRequest} UpdateExternalApiRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateExternalApiRequest.decode = function 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.apihub.v1.UpdateExternalApiRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.externalApi = $root.google.cloud.apihub.v1.ExternalApi.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 UpdateExternalApiRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.UpdateExternalApiRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.UpdateExternalApiRequest} UpdateExternalApiRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateExternalApiRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateExternalApiRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.UpdateExternalApiRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateExternalApiRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.externalApi != null && message.hasOwnProperty("externalApi")) { + var error = $root.google.cloud.apihub.v1.ExternalApi.verify(message.externalApi); + if (error) + return "externalApi." + 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 UpdateExternalApiRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.UpdateExternalApiRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.UpdateExternalApiRequest} UpdateExternalApiRequest + */ + UpdateExternalApiRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.UpdateExternalApiRequest) + return object; + var message = new $root.google.cloud.apihub.v1.UpdateExternalApiRequest(); + if (object.externalApi != null) { + if (typeof object.externalApi !== "object") + throw TypeError(".google.cloud.apihub.v1.UpdateExternalApiRequest.externalApi: object expected"); + message.externalApi = $root.google.cloud.apihub.v1.ExternalApi.fromObject(object.externalApi); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.apihub.v1.UpdateExternalApiRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateExternalApiRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.UpdateExternalApiRequest + * @static + * @param {google.cloud.apihub.v1.UpdateExternalApiRequest} message UpdateExternalApiRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateExternalApiRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.externalApi = null; + object.updateMask = null; + } + if (message.externalApi != null && message.hasOwnProperty("externalApi")) + object.externalApi = $root.google.cloud.apihub.v1.ExternalApi.toObject(message.externalApi, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateExternalApiRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.UpdateExternalApiRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateExternalApiRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateExternalApiRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.UpdateExternalApiRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateExternalApiRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.UpdateExternalApiRequest"; + }; + + return UpdateExternalApiRequest; + })(); + + v1.DeleteExternalApiRequest = (function() { + + /** + * Properties of a DeleteExternalApiRequest. + * @memberof google.cloud.apihub.v1 + * @interface IDeleteExternalApiRequest + * @property {string|null} [name] DeleteExternalApiRequest name + */ + + /** + * Constructs a new DeleteExternalApiRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a DeleteExternalApiRequest. + * @implements IDeleteExternalApiRequest + * @constructor + * @param {google.cloud.apihub.v1.IDeleteExternalApiRequest=} [properties] Properties to set + */ + function DeleteExternalApiRequest(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]]; + } + + /** + * DeleteExternalApiRequest name. + * @member {string} name + * @memberof google.cloud.apihub.v1.DeleteExternalApiRequest + * @instance + */ + DeleteExternalApiRequest.prototype.name = ""; + + /** + * Creates a new DeleteExternalApiRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.DeleteExternalApiRequest + * @static + * @param {google.cloud.apihub.v1.IDeleteExternalApiRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.DeleteExternalApiRequest} DeleteExternalApiRequest instance + */ + DeleteExternalApiRequest.create = function create(properties) { + return new DeleteExternalApiRequest(properties); + }; + + /** + * Encodes the specified DeleteExternalApiRequest message. Does not implicitly {@link google.cloud.apihub.v1.DeleteExternalApiRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.DeleteExternalApiRequest + * @static + * @param {google.cloud.apihub.v1.IDeleteExternalApiRequest} message DeleteExternalApiRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteExternalApiRequest.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 DeleteExternalApiRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.DeleteExternalApiRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.DeleteExternalApiRequest + * @static + * @param {google.cloud.apihub.v1.IDeleteExternalApiRequest} message DeleteExternalApiRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteExternalApiRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteExternalApiRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.DeleteExternalApiRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.DeleteExternalApiRequest} DeleteExternalApiRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteExternalApiRequest.decode = function 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.apihub.v1.DeleteExternalApiRequest(); + 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 DeleteExternalApiRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.DeleteExternalApiRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.DeleteExternalApiRequest} DeleteExternalApiRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteExternalApiRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteExternalApiRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.DeleteExternalApiRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteExternalApiRequest.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 DeleteExternalApiRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.DeleteExternalApiRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.DeleteExternalApiRequest} DeleteExternalApiRequest + */ + DeleteExternalApiRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.DeleteExternalApiRequest) + return object; + var message = new $root.google.cloud.apihub.v1.DeleteExternalApiRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteExternalApiRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.DeleteExternalApiRequest + * @static + * @param {google.cloud.apihub.v1.DeleteExternalApiRequest} message DeleteExternalApiRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteExternalApiRequest.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 DeleteExternalApiRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.DeleteExternalApiRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteExternalApiRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteExternalApiRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.DeleteExternalApiRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteExternalApiRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.DeleteExternalApiRequest"; + }; + + return DeleteExternalApiRequest; + })(); + + v1.ListExternalApisRequest = (function() { + + /** + * Properties of a ListExternalApisRequest. + * @memberof google.cloud.apihub.v1 + * @interface IListExternalApisRequest + * @property {string|null} [parent] ListExternalApisRequest parent + * @property {number|null} [pageSize] ListExternalApisRequest pageSize + * @property {string|null} [pageToken] ListExternalApisRequest pageToken + */ + + /** + * Constructs a new ListExternalApisRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a ListExternalApisRequest. + * @implements IListExternalApisRequest + * @constructor + * @param {google.cloud.apihub.v1.IListExternalApisRequest=} [properties] Properties to set + */ + function ListExternalApisRequest(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]]; + } + + /** + * ListExternalApisRequest parent. + * @member {string} parent + * @memberof google.cloud.apihub.v1.ListExternalApisRequest + * @instance + */ + ListExternalApisRequest.prototype.parent = ""; + + /** + * ListExternalApisRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.apihub.v1.ListExternalApisRequest + * @instance + */ + ListExternalApisRequest.prototype.pageSize = 0; + + /** + * ListExternalApisRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.apihub.v1.ListExternalApisRequest + * @instance + */ + ListExternalApisRequest.prototype.pageToken = ""; + + /** + * Creates a new ListExternalApisRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.ListExternalApisRequest + * @static + * @param {google.cloud.apihub.v1.IListExternalApisRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.ListExternalApisRequest} ListExternalApisRequest instance + */ + ListExternalApisRequest.create = function create(properties) { + return new ListExternalApisRequest(properties); + }; + + /** + * Encodes the specified ListExternalApisRequest message. Does not implicitly {@link google.cloud.apihub.v1.ListExternalApisRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.ListExternalApisRequest + * @static + * @param {google.cloud.apihub.v1.IListExternalApisRequest} message ListExternalApisRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListExternalApisRequest.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 ListExternalApisRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListExternalApisRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.ListExternalApisRequest + * @static + * @param {google.cloud.apihub.v1.IListExternalApisRequest} message ListExternalApisRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListExternalApisRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListExternalApisRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.ListExternalApisRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.ListExternalApisRequest} ListExternalApisRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListExternalApisRequest.decode = function 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.apihub.v1.ListExternalApisRequest(); + 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 ListExternalApisRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.ListExternalApisRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.ListExternalApisRequest} ListExternalApisRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListExternalApisRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListExternalApisRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.ListExternalApisRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListExternalApisRequest.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 ListExternalApisRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.ListExternalApisRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.ListExternalApisRequest} ListExternalApisRequest + */ + ListExternalApisRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.ListExternalApisRequest) + return object; + var message = new $root.google.cloud.apihub.v1.ListExternalApisRequest(); + 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 ListExternalApisRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.ListExternalApisRequest + * @static + * @param {google.cloud.apihub.v1.ListExternalApisRequest} message ListExternalApisRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListExternalApisRequest.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 ListExternalApisRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.ListExternalApisRequest + * @instance + * @returns {Object.} JSON object + */ + ListExternalApisRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListExternalApisRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.ListExternalApisRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListExternalApisRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.ListExternalApisRequest"; + }; + + return ListExternalApisRequest; + })(); + + v1.ListExternalApisResponse = (function() { + + /** + * Properties of a ListExternalApisResponse. + * @memberof google.cloud.apihub.v1 + * @interface IListExternalApisResponse + * @property {Array.|null} [externalApis] ListExternalApisResponse externalApis + * @property {string|null} [nextPageToken] ListExternalApisResponse nextPageToken + */ + + /** + * Constructs a new ListExternalApisResponse. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a ListExternalApisResponse. + * @implements IListExternalApisResponse + * @constructor + * @param {google.cloud.apihub.v1.IListExternalApisResponse=} [properties] Properties to set + */ + function ListExternalApisResponse(properties) { + this.externalApis = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListExternalApisResponse externalApis. + * @member {Array.} externalApis + * @memberof google.cloud.apihub.v1.ListExternalApisResponse + * @instance + */ + ListExternalApisResponse.prototype.externalApis = $util.emptyArray; + + /** + * ListExternalApisResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.apihub.v1.ListExternalApisResponse + * @instance + */ + ListExternalApisResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListExternalApisResponse instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.ListExternalApisResponse + * @static + * @param {google.cloud.apihub.v1.IListExternalApisResponse=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.ListExternalApisResponse} ListExternalApisResponse instance + */ + ListExternalApisResponse.create = function create(properties) { + return new ListExternalApisResponse(properties); + }; + + /** + * Encodes the specified ListExternalApisResponse message. Does not implicitly {@link google.cloud.apihub.v1.ListExternalApisResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.ListExternalApisResponse + * @static + * @param {google.cloud.apihub.v1.IListExternalApisResponse} message ListExternalApisResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListExternalApisResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.externalApis != null && message.externalApis.length) + for (var i = 0; i < message.externalApis.length; ++i) + $root.google.cloud.apihub.v1.ExternalApi.encode(message.externalApis[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 ListExternalApisResponse message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListExternalApisResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.ListExternalApisResponse + * @static + * @param {google.cloud.apihub.v1.IListExternalApisResponse} message ListExternalApisResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListExternalApisResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListExternalApisResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.ListExternalApisResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.ListExternalApisResponse} ListExternalApisResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListExternalApisResponse.decode = function 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.apihub.v1.ListExternalApisResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.externalApis && message.externalApis.length)) + message.externalApis = []; + message.externalApis.push($root.google.cloud.apihub.v1.ExternalApi.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListExternalApisResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.ListExternalApisResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.ListExternalApisResponse} ListExternalApisResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListExternalApisResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListExternalApisResponse message. + * @function verify + * @memberof google.cloud.apihub.v1.ListExternalApisResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListExternalApisResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.externalApis != null && message.hasOwnProperty("externalApis")) { + if (!Array.isArray(message.externalApis)) + return "externalApis: array expected"; + for (var i = 0; i < message.externalApis.length; ++i) { + var error = $root.google.cloud.apihub.v1.ExternalApi.verify(message.externalApis[i]); + if (error) + return "externalApis." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListExternalApisResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.ListExternalApisResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.ListExternalApisResponse} ListExternalApisResponse + */ + ListExternalApisResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.ListExternalApisResponse) + return object; + var message = new $root.google.cloud.apihub.v1.ListExternalApisResponse(); + if (object.externalApis) { + if (!Array.isArray(object.externalApis)) + throw TypeError(".google.cloud.apihub.v1.ListExternalApisResponse.externalApis: array expected"); + message.externalApis = []; + for (var i = 0; i < object.externalApis.length; ++i) { + if (typeof object.externalApis[i] !== "object") + throw TypeError(".google.cloud.apihub.v1.ListExternalApisResponse.externalApis: object expected"); + message.externalApis[i] = $root.google.cloud.apihub.v1.ExternalApi.fromObject(object.externalApis[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListExternalApisResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.ListExternalApisResponse + * @static + * @param {google.cloud.apihub.v1.ListExternalApisResponse} message ListExternalApisResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListExternalApisResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.externalApis = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.externalApis && message.externalApis.length) { + object.externalApis = []; + for (var j = 0; j < message.externalApis.length; ++j) + object.externalApis[j] = $root.google.cloud.apihub.v1.ExternalApi.toObject(message.externalApis[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListExternalApisResponse to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.ListExternalApisResponse + * @instance + * @returns {Object.} JSON object + */ + ListExternalApisResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListExternalApisResponse + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.ListExternalApisResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListExternalApisResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.ListExternalApisResponse"; + }; + + return ListExternalApisResponse; + })(); + + /** + * LintState enum. + * @name google.cloud.apihub.v1.LintState + * @enum {number} + * @property {number} LINT_STATE_UNSPECIFIED=0 LINT_STATE_UNSPECIFIED value + * @property {number} LINT_STATE_SUCCESS=1 LINT_STATE_SUCCESS value + * @property {number} LINT_STATE_ERROR=2 LINT_STATE_ERROR value + */ + v1.LintState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LINT_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "LINT_STATE_SUCCESS"] = 1; + values[valuesById[2] = "LINT_STATE_ERROR"] = 2; + return values; + })(); + + /** + * Linter enum. + * @name google.cloud.apihub.v1.Linter + * @enum {number} + * @property {number} LINTER_UNSPECIFIED=0 LINTER_UNSPECIFIED value + * @property {number} SPECTRAL=1 SPECTRAL value + * @property {number} OTHER=2 OTHER value + */ + v1.Linter = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LINTER_UNSPECIFIED"] = 0; + values[valuesById[1] = "SPECTRAL"] = 1; + values[valuesById[2] = "OTHER"] = 2; + return values; + })(); + + /** + * Severity enum. + * @name google.cloud.apihub.v1.Severity + * @enum {number} + * @property {number} SEVERITY_UNSPECIFIED=0 SEVERITY_UNSPECIFIED value + * @property {number} SEVERITY_ERROR=1 SEVERITY_ERROR value + * @property {number} SEVERITY_WARNING=2 SEVERITY_WARNING value + * @property {number} SEVERITY_INFO=3 SEVERITY_INFO value + * @property {number} SEVERITY_HINT=4 SEVERITY_HINT value + */ + v1.Severity = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SEVERITY_UNSPECIFIED"] = 0; + values[valuesById[1] = "SEVERITY_ERROR"] = 1; + values[valuesById[2] = "SEVERITY_WARNING"] = 2; + values[valuesById[3] = "SEVERITY_INFO"] = 3; + values[valuesById[4] = "SEVERITY_HINT"] = 4; + return values; + })(); + + v1.Api = (function() { + + /** + * Properties of an Api. + * @memberof google.cloud.apihub.v1 + * @interface IApi + * @property {string|null} [name] Api name + * @property {string|null} [displayName] Api displayName + * @property {string|null} [description] Api description + * @property {google.cloud.apihub.v1.IDocumentation|null} [documentation] Api documentation + * @property {google.cloud.apihub.v1.IOwner|null} [owner] Api owner + * @property {Array.|null} [versions] Api versions + * @property {google.protobuf.ITimestamp|null} [createTime] Api createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Api updateTime + * @property {google.cloud.apihub.v1.IAttributeValues|null} [targetUser] Api targetUser + * @property {google.cloud.apihub.v1.IAttributeValues|null} [team] Api team + * @property {google.cloud.apihub.v1.IAttributeValues|null} [businessUnit] Api businessUnit + * @property {google.cloud.apihub.v1.IAttributeValues|null} [maturityLevel] Api maturityLevel + * @property {Object.|null} [attributes] Api attributes + * @property {google.cloud.apihub.v1.IAttributeValues|null} [apiStyle] Api apiStyle + * @property {string|null} [selectedVersion] Api selectedVersion + */ + + /** + * Constructs a new Api. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents an Api. + * @implements IApi + * @constructor + * @param {google.cloud.apihub.v1.IApi=} [properties] Properties to set + */ + function Api(properties) { + this.versions = []; + this.attributes = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Api name. + * @member {string} name + * @memberof google.cloud.apihub.v1.Api + * @instance + */ + Api.prototype.name = ""; + + /** + * Api displayName. + * @member {string} displayName + * @memberof google.cloud.apihub.v1.Api + * @instance + */ + Api.prototype.displayName = ""; + + /** + * Api description. + * @member {string} description + * @memberof google.cloud.apihub.v1.Api + * @instance + */ + Api.prototype.description = ""; + + /** + * Api documentation. + * @member {google.cloud.apihub.v1.IDocumentation|null|undefined} documentation + * @memberof google.cloud.apihub.v1.Api + * @instance + */ + Api.prototype.documentation = null; + + /** + * Api owner. + * @member {google.cloud.apihub.v1.IOwner|null|undefined} owner + * @memberof google.cloud.apihub.v1.Api + * @instance + */ + Api.prototype.owner = null; + + /** + * Api versions. + * @member {Array.} versions + * @memberof google.cloud.apihub.v1.Api + * @instance + */ + Api.prototype.versions = $util.emptyArray; + + /** + * Api createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.apihub.v1.Api + * @instance + */ + Api.prototype.createTime = null; + + /** + * Api updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.apihub.v1.Api + * @instance + */ + Api.prototype.updateTime = null; + + /** + * Api targetUser. + * @member {google.cloud.apihub.v1.IAttributeValues|null|undefined} targetUser + * @memberof google.cloud.apihub.v1.Api + * @instance + */ + Api.prototype.targetUser = null; + + /** + * Api team. + * @member {google.cloud.apihub.v1.IAttributeValues|null|undefined} team + * @memberof google.cloud.apihub.v1.Api + * @instance + */ + Api.prototype.team = null; + + /** + * Api businessUnit. + * @member {google.cloud.apihub.v1.IAttributeValues|null|undefined} businessUnit + * @memberof google.cloud.apihub.v1.Api + * @instance + */ + Api.prototype.businessUnit = null; + + /** + * Api maturityLevel. + * @member {google.cloud.apihub.v1.IAttributeValues|null|undefined} maturityLevel + * @memberof google.cloud.apihub.v1.Api + * @instance + */ + Api.prototype.maturityLevel = null; + + /** + * Api attributes. + * @member {Object.} attributes + * @memberof google.cloud.apihub.v1.Api + * @instance + */ + Api.prototype.attributes = $util.emptyObject; + + /** + * Api apiStyle. + * @member {google.cloud.apihub.v1.IAttributeValues|null|undefined} apiStyle + * @memberof google.cloud.apihub.v1.Api + * @instance + */ + Api.prototype.apiStyle = null; + + /** + * Api selectedVersion. + * @member {string} selectedVersion + * @memberof google.cloud.apihub.v1.Api + * @instance + */ + Api.prototype.selectedVersion = ""; + + /** + * Creates a new Api instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.Api + * @static + * @param {google.cloud.apihub.v1.IApi=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.Api} Api instance + */ + Api.create = function create(properties) { + return new Api(properties); + }; + + /** + * Encodes the specified Api message. Does not implicitly {@link google.cloud.apihub.v1.Api.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.Api + * @static + * @param {google.cloud.apihub.v1.IApi} message Api message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Api.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.documentation != null && Object.hasOwnProperty.call(message, "documentation")) + $root.google.cloud.apihub.v1.Documentation.encode(message.documentation, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.owner != null && Object.hasOwnProperty.call(message, "owner")) + $root.google.cloud.apihub.v1.Owner.encode(message.owner, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.versions != null && message.versions.length) + for (var i = 0; i < message.versions.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.versions[i]); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.targetUser != null && Object.hasOwnProperty.call(message, "targetUser")) + $root.google.cloud.apihub.v1.AttributeValues.encode(message.targetUser, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.team != null && Object.hasOwnProperty.call(message, "team")) + $root.google.cloud.apihub.v1.AttributeValues.encode(message.team, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.businessUnit != null && Object.hasOwnProperty.call(message, "businessUnit")) + $root.google.cloud.apihub.v1.AttributeValues.encode(message.businessUnit, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.maturityLevel != null && Object.hasOwnProperty.call(message, "maturityLevel")) + $root.google.cloud.apihub.v1.AttributeValues.encode(message.maturityLevel, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.attributes != null && Object.hasOwnProperty.call(message, "attributes")) + for (var keys = Object.keys(message.attributes), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 13, wireType 2 =*/106).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.apihub.v1.AttributeValues.encode(message.attributes[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.apiStyle != null && Object.hasOwnProperty.call(message, "apiStyle")) + $root.google.cloud.apihub.v1.AttributeValues.encode(message.apiStyle, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.selectedVersion != null && Object.hasOwnProperty.call(message, "selectedVersion")) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.selectedVersion); + return writer; + }; + + /** + * Encodes the specified Api message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.Api.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.Api + * @static + * @param {google.cloud.apihub.v1.IApi} message Api message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Api.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Api message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.Api + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.Api} Api + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Api.decode = function 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.apihub.v1.Api(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + message.documentation = $root.google.cloud.apihub.v1.Documentation.decode(reader, reader.uint32()); + break; + } + case 5: { + message.owner = $root.google.cloud.apihub.v1.Owner.decode(reader, reader.uint32()); + break; + } + case 6: { + if (!(message.versions && message.versions.length)) + message.versions = []; + message.versions.push(reader.string()); + break; + } + case 7: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 8: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 9: { + message.targetUser = $root.google.cloud.apihub.v1.AttributeValues.decode(reader, reader.uint32()); + break; + } + case 10: { + message.team = $root.google.cloud.apihub.v1.AttributeValues.decode(reader, reader.uint32()); + break; + } + case 11: { + message.businessUnit = $root.google.cloud.apihub.v1.AttributeValues.decode(reader, reader.uint32()); + break; + } + case 12: { + message.maturityLevel = $root.google.cloud.apihub.v1.AttributeValues.decode(reader, reader.uint32()); + break; + } + case 13: { + if (message.attributes === $util.emptyObject) + message.attributes = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.apihub.v1.AttributeValues.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.attributes[key] = value; + break; + } + case 14: { + message.apiStyle = $root.google.cloud.apihub.v1.AttributeValues.decode(reader, reader.uint32()); + break; + } + case 15: { + message.selectedVersion = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Api message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.Api + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.Api} Api + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Api.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Api message. + * @function verify + * @memberof google.cloud.apihub.v1.Api + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Api.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.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.documentation != null && message.hasOwnProperty("documentation")) { + var error = $root.google.cloud.apihub.v1.Documentation.verify(message.documentation); + if (error) + return "documentation." + error; + } + if (message.owner != null && message.hasOwnProperty("owner")) { + var error = $root.google.cloud.apihub.v1.Owner.verify(message.owner); + if (error) + return "owner." + error; + } + if (message.versions != null && message.hasOwnProperty("versions")) { + if (!Array.isArray(message.versions)) + return "versions: array expected"; + for (var i = 0; i < message.versions.length; ++i) + if (!$util.isString(message.versions[i])) + return "versions: 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.targetUser != null && message.hasOwnProperty("targetUser")) { + var error = $root.google.cloud.apihub.v1.AttributeValues.verify(message.targetUser); + if (error) + return "targetUser." + error; + } + if (message.team != null && message.hasOwnProperty("team")) { + var error = $root.google.cloud.apihub.v1.AttributeValues.verify(message.team); + if (error) + return "team." + error; + } + if (message.businessUnit != null && message.hasOwnProperty("businessUnit")) { + var error = $root.google.cloud.apihub.v1.AttributeValues.verify(message.businessUnit); + if (error) + return "businessUnit." + error; + } + if (message.maturityLevel != null && message.hasOwnProperty("maturityLevel")) { + var error = $root.google.cloud.apihub.v1.AttributeValues.verify(message.maturityLevel); + if (error) + return "maturityLevel." + error; + } + if (message.attributes != null && message.hasOwnProperty("attributes")) { + if (!$util.isObject(message.attributes)) + return "attributes: object expected"; + var key = Object.keys(message.attributes); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.apihub.v1.AttributeValues.verify(message.attributes[key[i]]); + if (error) + return "attributes." + error; + } + } + if (message.apiStyle != null && message.hasOwnProperty("apiStyle")) { + var error = $root.google.cloud.apihub.v1.AttributeValues.verify(message.apiStyle); + if (error) + return "apiStyle." + error; + } + if (message.selectedVersion != null && message.hasOwnProperty("selectedVersion")) + if (!$util.isString(message.selectedVersion)) + return "selectedVersion: string expected"; + return null; + }; + + /** + * Creates an Api message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.Api + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.Api} Api + */ + Api.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.Api) + return object; + var message = new $root.google.cloud.apihub.v1.Api(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.documentation != null) { + if (typeof object.documentation !== "object") + throw TypeError(".google.cloud.apihub.v1.Api.documentation: object expected"); + message.documentation = $root.google.cloud.apihub.v1.Documentation.fromObject(object.documentation); + } + if (object.owner != null) { + if (typeof object.owner !== "object") + throw TypeError(".google.cloud.apihub.v1.Api.owner: object expected"); + message.owner = $root.google.cloud.apihub.v1.Owner.fromObject(object.owner); + } + if (object.versions) { + if (!Array.isArray(object.versions)) + throw TypeError(".google.cloud.apihub.v1.Api.versions: array expected"); + message.versions = []; + for (var i = 0; i < object.versions.length; ++i) + message.versions[i] = String(object.versions[i]); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.apihub.v1.Api.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.apihub.v1.Api.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.targetUser != null) { + if (typeof object.targetUser !== "object") + throw TypeError(".google.cloud.apihub.v1.Api.targetUser: object expected"); + message.targetUser = $root.google.cloud.apihub.v1.AttributeValues.fromObject(object.targetUser); + } + if (object.team != null) { + if (typeof object.team !== "object") + throw TypeError(".google.cloud.apihub.v1.Api.team: object expected"); + message.team = $root.google.cloud.apihub.v1.AttributeValues.fromObject(object.team); + } + if (object.businessUnit != null) { + if (typeof object.businessUnit !== "object") + throw TypeError(".google.cloud.apihub.v1.Api.businessUnit: object expected"); + message.businessUnit = $root.google.cloud.apihub.v1.AttributeValues.fromObject(object.businessUnit); + } + if (object.maturityLevel != null) { + if (typeof object.maturityLevel !== "object") + throw TypeError(".google.cloud.apihub.v1.Api.maturityLevel: object expected"); + message.maturityLevel = $root.google.cloud.apihub.v1.AttributeValues.fromObject(object.maturityLevel); + } + if (object.attributes) { + if (typeof object.attributes !== "object") + throw TypeError(".google.cloud.apihub.v1.Api.attributes: object expected"); + message.attributes = {}; + for (var keys = Object.keys(object.attributes), i = 0; i < keys.length; ++i) { + if (typeof object.attributes[keys[i]] !== "object") + throw TypeError(".google.cloud.apihub.v1.Api.attributes: object expected"); + message.attributes[keys[i]] = $root.google.cloud.apihub.v1.AttributeValues.fromObject(object.attributes[keys[i]]); + } + } + if (object.apiStyle != null) { + if (typeof object.apiStyle !== "object") + throw TypeError(".google.cloud.apihub.v1.Api.apiStyle: object expected"); + message.apiStyle = $root.google.cloud.apihub.v1.AttributeValues.fromObject(object.apiStyle); + } + if (object.selectedVersion != null) + message.selectedVersion = String(object.selectedVersion); + return message; + }; + + /** + * Creates a plain object from an Api message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.Api + * @static + * @param {google.cloud.apihub.v1.Api} message Api + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Api.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.versions = []; + if (options.objects || options.defaults) + object.attributes = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.description = ""; + object.documentation = null; + object.owner = null; + object.createTime = null; + object.updateTime = null; + object.targetUser = null; + object.team = null; + object.businessUnit = null; + object.maturityLevel = null; + object.apiStyle = null; + object.selectedVersion = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.documentation != null && message.hasOwnProperty("documentation")) + object.documentation = $root.google.cloud.apihub.v1.Documentation.toObject(message.documentation, options); + if (message.owner != null && message.hasOwnProperty("owner")) + object.owner = $root.google.cloud.apihub.v1.Owner.toObject(message.owner, options); + if (message.versions && message.versions.length) { + object.versions = []; + for (var j = 0; j < message.versions.length; ++j) + object.versions[j] = message.versions[j]; + } + 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); + if (message.targetUser != null && message.hasOwnProperty("targetUser")) + object.targetUser = $root.google.cloud.apihub.v1.AttributeValues.toObject(message.targetUser, options); + if (message.team != null && message.hasOwnProperty("team")) + object.team = $root.google.cloud.apihub.v1.AttributeValues.toObject(message.team, options); + if (message.businessUnit != null && message.hasOwnProperty("businessUnit")) + object.businessUnit = $root.google.cloud.apihub.v1.AttributeValues.toObject(message.businessUnit, options); + if (message.maturityLevel != null && message.hasOwnProperty("maturityLevel")) + object.maturityLevel = $root.google.cloud.apihub.v1.AttributeValues.toObject(message.maturityLevel, options); + var keys2; + if (message.attributes && (keys2 = Object.keys(message.attributes)).length) { + object.attributes = {}; + for (var j = 0; j < keys2.length; ++j) + object.attributes[keys2[j]] = $root.google.cloud.apihub.v1.AttributeValues.toObject(message.attributes[keys2[j]], options); + } + if (message.apiStyle != null && message.hasOwnProperty("apiStyle")) + object.apiStyle = $root.google.cloud.apihub.v1.AttributeValues.toObject(message.apiStyle, options); + if (message.selectedVersion != null && message.hasOwnProperty("selectedVersion")) + object.selectedVersion = message.selectedVersion; + return object; + }; + + /** + * Converts this Api to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.Api + * @instance + * @returns {Object.} JSON object + */ + Api.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Api + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.Api + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Api.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.Api"; + }; + + return Api; + })(); + + v1.Version = (function() { + + /** + * Properties of a Version. + * @memberof google.cloud.apihub.v1 + * @interface IVersion + * @property {string|null} [name] Version name + * @property {string|null} [displayName] Version displayName + * @property {string|null} [description] Version description + * @property {google.cloud.apihub.v1.IDocumentation|null} [documentation] Version documentation + * @property {Array.|null} [specs] Version specs + * @property {Array.|null} [apiOperations] Version apiOperations + * @property {Array.|null} [definitions] Version definitions + * @property {Array.|null} [deployments] Version deployments + * @property {google.protobuf.ITimestamp|null} [createTime] Version createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Version updateTime + * @property {google.cloud.apihub.v1.IAttributeValues|null} [lifecycle] Version lifecycle + * @property {google.cloud.apihub.v1.IAttributeValues|null} [compliance] Version compliance + * @property {google.cloud.apihub.v1.IAttributeValues|null} [accreditation] Version accreditation + * @property {Object.|null} [attributes] Version attributes + * @property {string|null} [selectedDeployment] Version selectedDeployment + */ + + /** + * Constructs a new Version. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a Version. + * @implements IVersion + * @constructor + * @param {google.cloud.apihub.v1.IVersion=} [properties] Properties to set + */ + function Version(properties) { + this.specs = []; + this.apiOperations = []; + this.definitions = []; + this.deployments = []; + this.attributes = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Version name. + * @member {string} name + * @memberof google.cloud.apihub.v1.Version + * @instance + */ + Version.prototype.name = ""; + + /** + * Version displayName. + * @member {string} displayName + * @memberof google.cloud.apihub.v1.Version + * @instance + */ + Version.prototype.displayName = ""; + + /** + * Version description. + * @member {string} description + * @memberof google.cloud.apihub.v1.Version + * @instance + */ + Version.prototype.description = ""; + + /** + * Version documentation. + * @member {google.cloud.apihub.v1.IDocumentation|null|undefined} documentation + * @memberof google.cloud.apihub.v1.Version + * @instance + */ + Version.prototype.documentation = null; + + /** + * Version specs. + * @member {Array.} specs + * @memberof google.cloud.apihub.v1.Version + * @instance + */ + Version.prototype.specs = $util.emptyArray; + + /** + * Version apiOperations. + * @member {Array.} apiOperations + * @memberof google.cloud.apihub.v1.Version + * @instance + */ + Version.prototype.apiOperations = $util.emptyArray; + + /** + * Version definitions. + * @member {Array.} definitions + * @memberof google.cloud.apihub.v1.Version + * @instance + */ + Version.prototype.definitions = $util.emptyArray; + + /** + * Version deployments. + * @member {Array.} deployments + * @memberof google.cloud.apihub.v1.Version + * @instance + */ + Version.prototype.deployments = $util.emptyArray; + + /** + * Version createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.apihub.v1.Version + * @instance + */ + Version.prototype.createTime = null; + + /** + * Version updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.apihub.v1.Version + * @instance + */ + Version.prototype.updateTime = null; + + /** + * Version lifecycle. + * @member {google.cloud.apihub.v1.IAttributeValues|null|undefined} lifecycle + * @memberof google.cloud.apihub.v1.Version + * @instance + */ + Version.prototype.lifecycle = null; + + /** + * Version compliance. + * @member {google.cloud.apihub.v1.IAttributeValues|null|undefined} compliance + * @memberof google.cloud.apihub.v1.Version + * @instance + */ + Version.prototype.compliance = null; + + /** + * Version accreditation. + * @member {google.cloud.apihub.v1.IAttributeValues|null|undefined} accreditation + * @memberof google.cloud.apihub.v1.Version + * @instance + */ + Version.prototype.accreditation = null; + + /** + * Version attributes. + * @member {Object.} attributes + * @memberof google.cloud.apihub.v1.Version + * @instance + */ + Version.prototype.attributes = $util.emptyObject; + + /** + * Version selectedDeployment. + * @member {string} selectedDeployment + * @memberof google.cloud.apihub.v1.Version + * @instance + */ + Version.prototype.selectedDeployment = ""; + + /** + * Creates a new Version instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.Version + * @static + * @param {google.cloud.apihub.v1.IVersion=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.Version} Version instance + */ + Version.create = function create(properties) { + return new Version(properties); + }; + + /** + * Encodes the specified Version message. Does not implicitly {@link google.cloud.apihub.v1.Version.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.Version + * @static + * @param {google.cloud.apihub.v1.IVersion} message Version message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Version.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.documentation != null && Object.hasOwnProperty.call(message, "documentation")) + $root.google.cloud.apihub.v1.Documentation.encode(message.documentation, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.specs != null && message.specs.length) + for (var i = 0; i < message.specs.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.specs[i]); + if (message.apiOperations != null && message.apiOperations.length) + for (var i = 0; i < message.apiOperations.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.apiOperations[i]); + if (message.definitions != null && message.definitions.length) + for (var i = 0; i < message.definitions.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.definitions[i]); + if (message.deployments != null && message.deployments.length) + for (var i = 0; i < message.deployments.length; ++i) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.deployments[i]); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.lifecycle != null && Object.hasOwnProperty.call(message, "lifecycle")) + $root.google.cloud.apihub.v1.AttributeValues.encode(message.lifecycle, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.compliance != null && Object.hasOwnProperty.call(message, "compliance")) + $root.google.cloud.apihub.v1.AttributeValues.encode(message.compliance, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.accreditation != null && Object.hasOwnProperty.call(message, "accreditation")) + $root.google.cloud.apihub.v1.AttributeValues.encode(message.accreditation, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.attributes != null && Object.hasOwnProperty.call(message, "attributes")) + for (var keys = Object.keys(message.attributes), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 14, wireType 2 =*/114).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.apihub.v1.AttributeValues.encode(message.attributes[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.selectedDeployment != null && Object.hasOwnProperty.call(message, "selectedDeployment")) + writer.uint32(/* id 16, wireType 2 =*/130).string(message.selectedDeployment); + return writer; + }; + + /** + * Encodes the specified Version message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.Version.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.Version + * @static + * @param {google.cloud.apihub.v1.IVersion} message Version message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Version.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Version message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.Version + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.Version} Version + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Version.decode = function 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.apihub.v1.Version(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + message.documentation = $root.google.cloud.apihub.v1.Documentation.decode(reader, reader.uint32()); + break; + } + case 5: { + if (!(message.specs && message.specs.length)) + message.specs = []; + message.specs.push(reader.string()); + break; + } + case 6: { + if (!(message.apiOperations && message.apiOperations.length)) + message.apiOperations = []; + message.apiOperations.push(reader.string()); + break; + } + case 7: { + if (!(message.definitions && message.definitions.length)) + message.definitions = []; + message.definitions.push(reader.string()); + break; + } + case 8: { + if (!(message.deployments && message.deployments.length)) + message.deployments = []; + message.deployments.push(reader.string()); + break; + } + case 9: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 10: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 11: { + message.lifecycle = $root.google.cloud.apihub.v1.AttributeValues.decode(reader, reader.uint32()); + break; + } + case 12: { + message.compliance = $root.google.cloud.apihub.v1.AttributeValues.decode(reader, reader.uint32()); + break; + } + case 13: { + message.accreditation = $root.google.cloud.apihub.v1.AttributeValues.decode(reader, reader.uint32()); + break; + } + case 14: { + if (message.attributes === $util.emptyObject) + message.attributes = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.apihub.v1.AttributeValues.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.attributes[key] = value; + break; + } + case 16: { + message.selectedDeployment = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Version message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.Version + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.Version} Version + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Version.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Version message. + * @function verify + * @memberof google.cloud.apihub.v1.Version + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Version.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.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.documentation != null && message.hasOwnProperty("documentation")) { + var error = $root.google.cloud.apihub.v1.Documentation.verify(message.documentation); + if (error) + return "documentation." + error; + } + if (message.specs != null && message.hasOwnProperty("specs")) { + if (!Array.isArray(message.specs)) + return "specs: array expected"; + for (var i = 0; i < message.specs.length; ++i) + if (!$util.isString(message.specs[i])) + return "specs: string[] expected"; + } + if (message.apiOperations != null && message.hasOwnProperty("apiOperations")) { + if (!Array.isArray(message.apiOperations)) + return "apiOperations: array expected"; + for (var i = 0; i < message.apiOperations.length; ++i) + if (!$util.isString(message.apiOperations[i])) + return "apiOperations: string[] expected"; + } + if (message.definitions != null && message.hasOwnProperty("definitions")) { + if (!Array.isArray(message.definitions)) + return "definitions: array expected"; + for (var i = 0; i < message.definitions.length; ++i) + if (!$util.isString(message.definitions[i])) + return "definitions: string[] expected"; + } + if (message.deployments != null && message.hasOwnProperty("deployments")) { + if (!Array.isArray(message.deployments)) + return "deployments: array expected"; + for (var i = 0; i < message.deployments.length; ++i) + if (!$util.isString(message.deployments[i])) + return "deployments: 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.lifecycle != null && message.hasOwnProperty("lifecycle")) { + var error = $root.google.cloud.apihub.v1.AttributeValues.verify(message.lifecycle); + if (error) + return "lifecycle." + error; + } + if (message.compliance != null && message.hasOwnProperty("compliance")) { + var error = $root.google.cloud.apihub.v1.AttributeValues.verify(message.compliance); + if (error) + return "compliance." + error; + } + if (message.accreditation != null && message.hasOwnProperty("accreditation")) { + var error = $root.google.cloud.apihub.v1.AttributeValues.verify(message.accreditation); + if (error) + return "accreditation." + error; + } + if (message.attributes != null && message.hasOwnProperty("attributes")) { + if (!$util.isObject(message.attributes)) + return "attributes: object expected"; + var key = Object.keys(message.attributes); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.apihub.v1.AttributeValues.verify(message.attributes[key[i]]); + if (error) + return "attributes." + error; + } + } + if (message.selectedDeployment != null && message.hasOwnProperty("selectedDeployment")) + if (!$util.isString(message.selectedDeployment)) + return "selectedDeployment: string expected"; + return null; + }; + + /** + * Creates a Version message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.Version + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.Version} Version + */ + Version.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.Version) + return object; + var message = new $root.google.cloud.apihub.v1.Version(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.documentation != null) { + if (typeof object.documentation !== "object") + throw TypeError(".google.cloud.apihub.v1.Version.documentation: object expected"); + message.documentation = $root.google.cloud.apihub.v1.Documentation.fromObject(object.documentation); + } + if (object.specs) { + if (!Array.isArray(object.specs)) + throw TypeError(".google.cloud.apihub.v1.Version.specs: array expected"); + message.specs = []; + for (var i = 0; i < object.specs.length; ++i) + message.specs[i] = String(object.specs[i]); + } + if (object.apiOperations) { + if (!Array.isArray(object.apiOperations)) + throw TypeError(".google.cloud.apihub.v1.Version.apiOperations: array expected"); + message.apiOperations = []; + for (var i = 0; i < object.apiOperations.length; ++i) + message.apiOperations[i] = String(object.apiOperations[i]); + } + if (object.definitions) { + if (!Array.isArray(object.definitions)) + throw TypeError(".google.cloud.apihub.v1.Version.definitions: array expected"); + message.definitions = []; + for (var i = 0; i < object.definitions.length; ++i) + message.definitions[i] = String(object.definitions[i]); + } + if (object.deployments) { + if (!Array.isArray(object.deployments)) + throw TypeError(".google.cloud.apihub.v1.Version.deployments: array expected"); + message.deployments = []; + for (var i = 0; i < object.deployments.length; ++i) + message.deployments[i] = String(object.deployments[i]); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.apihub.v1.Version.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.apihub.v1.Version.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.lifecycle != null) { + if (typeof object.lifecycle !== "object") + throw TypeError(".google.cloud.apihub.v1.Version.lifecycle: object expected"); + message.lifecycle = $root.google.cloud.apihub.v1.AttributeValues.fromObject(object.lifecycle); + } + if (object.compliance != null) { + if (typeof object.compliance !== "object") + throw TypeError(".google.cloud.apihub.v1.Version.compliance: object expected"); + message.compliance = $root.google.cloud.apihub.v1.AttributeValues.fromObject(object.compliance); + } + if (object.accreditation != null) { + if (typeof object.accreditation !== "object") + throw TypeError(".google.cloud.apihub.v1.Version.accreditation: object expected"); + message.accreditation = $root.google.cloud.apihub.v1.AttributeValues.fromObject(object.accreditation); + } + if (object.attributes) { + if (typeof object.attributes !== "object") + throw TypeError(".google.cloud.apihub.v1.Version.attributes: object expected"); + message.attributes = {}; + for (var keys = Object.keys(object.attributes), i = 0; i < keys.length; ++i) { + if (typeof object.attributes[keys[i]] !== "object") + throw TypeError(".google.cloud.apihub.v1.Version.attributes: object expected"); + message.attributes[keys[i]] = $root.google.cloud.apihub.v1.AttributeValues.fromObject(object.attributes[keys[i]]); + } + } + if (object.selectedDeployment != null) + message.selectedDeployment = String(object.selectedDeployment); + return message; + }; + + /** + * Creates a plain object from a Version message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.Version + * @static + * @param {google.cloud.apihub.v1.Version} message Version + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Version.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.specs = []; + object.apiOperations = []; + object.definitions = []; + object.deployments = []; + } + if (options.objects || options.defaults) + object.attributes = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.description = ""; + object.documentation = null; + object.createTime = null; + object.updateTime = null; + object.lifecycle = null; + object.compliance = null; + object.accreditation = null; + object.selectedDeployment = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.documentation != null && message.hasOwnProperty("documentation")) + object.documentation = $root.google.cloud.apihub.v1.Documentation.toObject(message.documentation, options); + if (message.specs && message.specs.length) { + object.specs = []; + for (var j = 0; j < message.specs.length; ++j) + object.specs[j] = message.specs[j]; + } + if (message.apiOperations && message.apiOperations.length) { + object.apiOperations = []; + for (var j = 0; j < message.apiOperations.length; ++j) + object.apiOperations[j] = message.apiOperations[j]; + } + if (message.definitions && message.definitions.length) { + object.definitions = []; + for (var j = 0; j < message.definitions.length; ++j) + object.definitions[j] = message.definitions[j]; + } + if (message.deployments && message.deployments.length) { + object.deployments = []; + for (var j = 0; j < message.deployments.length; ++j) + object.deployments[j] = message.deployments[j]; + } + 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); + if (message.lifecycle != null && message.hasOwnProperty("lifecycle")) + object.lifecycle = $root.google.cloud.apihub.v1.AttributeValues.toObject(message.lifecycle, options); + if (message.compliance != null && message.hasOwnProperty("compliance")) + object.compliance = $root.google.cloud.apihub.v1.AttributeValues.toObject(message.compliance, options); + if (message.accreditation != null && message.hasOwnProperty("accreditation")) + object.accreditation = $root.google.cloud.apihub.v1.AttributeValues.toObject(message.accreditation, options); + var keys2; + if (message.attributes && (keys2 = Object.keys(message.attributes)).length) { + object.attributes = {}; + for (var j = 0; j < keys2.length; ++j) + object.attributes[keys2[j]] = $root.google.cloud.apihub.v1.AttributeValues.toObject(message.attributes[keys2[j]], options); + } + if (message.selectedDeployment != null && message.hasOwnProperty("selectedDeployment")) + object.selectedDeployment = message.selectedDeployment; + return object; + }; + + /** + * Converts this Version to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.Version + * @instance + * @returns {Object.} JSON object + */ + Version.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Version + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.Version + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Version.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.Version"; + }; + + return Version; + })(); + + v1.Spec = (function() { + + /** + * Properties of a Spec. + * @memberof google.cloud.apihub.v1 + * @interface ISpec + * @property {string|null} [name] Spec name + * @property {string|null} [displayName] Spec displayName + * @property {google.cloud.apihub.v1.IAttributeValues|null} [specType] Spec specType + * @property {google.cloud.apihub.v1.ISpecContents|null} [contents] Spec contents + * @property {google.cloud.apihub.v1.ISpecDetails|null} [details] Spec details + * @property {string|null} [sourceUri] Spec sourceUri + * @property {google.protobuf.ITimestamp|null} [createTime] Spec createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Spec updateTime + * @property {google.cloud.apihub.v1.ILintResponse|null} [lintResponse] Spec lintResponse + * @property {Object.|null} [attributes] Spec attributes + * @property {google.cloud.apihub.v1.IDocumentation|null} [documentation] Spec documentation + * @property {google.cloud.apihub.v1.Spec.ParsingMode|null} [parsingMode] Spec parsingMode + */ + + /** + * Constructs a new Spec. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a Spec. + * @implements ISpec + * @constructor + * @param {google.cloud.apihub.v1.ISpec=} [properties] Properties to set + */ + function Spec(properties) { + this.attributes = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Spec name. + * @member {string} name + * @memberof google.cloud.apihub.v1.Spec + * @instance + */ + Spec.prototype.name = ""; + + /** + * Spec displayName. + * @member {string} displayName + * @memberof google.cloud.apihub.v1.Spec + * @instance + */ + Spec.prototype.displayName = ""; + + /** + * Spec specType. + * @member {google.cloud.apihub.v1.IAttributeValues|null|undefined} specType + * @memberof google.cloud.apihub.v1.Spec + * @instance + */ + Spec.prototype.specType = null; + + /** + * Spec contents. + * @member {google.cloud.apihub.v1.ISpecContents|null|undefined} contents + * @memberof google.cloud.apihub.v1.Spec + * @instance + */ + Spec.prototype.contents = null; + + /** + * Spec details. + * @member {google.cloud.apihub.v1.ISpecDetails|null|undefined} details + * @memberof google.cloud.apihub.v1.Spec + * @instance + */ + Spec.prototype.details = null; + + /** + * Spec sourceUri. + * @member {string} sourceUri + * @memberof google.cloud.apihub.v1.Spec + * @instance + */ + Spec.prototype.sourceUri = ""; + + /** + * Spec createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.apihub.v1.Spec + * @instance + */ + Spec.prototype.createTime = null; + + /** + * Spec updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.apihub.v1.Spec + * @instance + */ + Spec.prototype.updateTime = null; + + /** + * Spec lintResponse. + * @member {google.cloud.apihub.v1.ILintResponse|null|undefined} lintResponse + * @memberof google.cloud.apihub.v1.Spec + * @instance + */ + Spec.prototype.lintResponse = null; + + /** + * Spec attributes. + * @member {Object.} attributes + * @memberof google.cloud.apihub.v1.Spec + * @instance + */ + Spec.prototype.attributes = $util.emptyObject; + + /** + * Spec documentation. + * @member {google.cloud.apihub.v1.IDocumentation|null|undefined} documentation + * @memberof google.cloud.apihub.v1.Spec + * @instance + */ + Spec.prototype.documentation = null; + + /** + * Spec parsingMode. + * @member {google.cloud.apihub.v1.Spec.ParsingMode} parsingMode + * @memberof google.cloud.apihub.v1.Spec + * @instance + */ + Spec.prototype.parsingMode = 0; + + /** + * Creates a new Spec instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.Spec + * @static + * @param {google.cloud.apihub.v1.ISpec=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.Spec} Spec instance + */ + Spec.create = function create(properties) { + return new Spec(properties); + }; + + /** + * Encodes the specified Spec message. Does not implicitly {@link google.cloud.apihub.v1.Spec.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.Spec + * @static + * @param {google.cloud.apihub.v1.ISpec} message Spec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Spec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.specType != null && Object.hasOwnProperty.call(message, "specType")) + $root.google.cloud.apihub.v1.AttributeValues.encode(message.specType, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.contents != null && Object.hasOwnProperty.call(message, "contents")) + $root.google.cloud.apihub.v1.SpecContents.encode(message.contents, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.details != null && Object.hasOwnProperty.call(message, "details")) + $root.google.cloud.apihub.v1.SpecDetails.encode(message.details, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.sourceUri != null && Object.hasOwnProperty.call(message, "sourceUri")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.sourceUri); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.lintResponse != null && Object.hasOwnProperty.call(message, "lintResponse")) + $root.google.cloud.apihub.v1.LintResponse.encode(message.lintResponse, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.attributes != null && Object.hasOwnProperty.call(message, "attributes")) + for (var keys = Object.keys(message.attributes), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 10, wireType 2 =*/82).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.apihub.v1.AttributeValues.encode(message.attributes[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.documentation != null && Object.hasOwnProperty.call(message, "documentation")) + $root.google.cloud.apihub.v1.Documentation.encode(message.documentation, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.parsingMode != null && Object.hasOwnProperty.call(message, "parsingMode")) + writer.uint32(/* id 12, wireType 0 =*/96).int32(message.parsingMode); + return writer; + }; + + /** + * Encodes the specified Spec message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.Spec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.Spec + * @static + * @param {google.cloud.apihub.v1.ISpec} message Spec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Spec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Spec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.Spec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.Spec} Spec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Spec.decode = function 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.apihub.v1.Spec(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.specType = $root.google.cloud.apihub.v1.AttributeValues.decode(reader, reader.uint32()); + break; + } + case 4: { + message.contents = $root.google.cloud.apihub.v1.SpecContents.decode(reader, reader.uint32()); + break; + } + case 5: { + message.details = $root.google.cloud.apihub.v1.SpecDetails.decode(reader, reader.uint32()); + break; + } + case 6: { + message.sourceUri = reader.string(); + break; + } + case 7: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 8: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 9: { + message.lintResponse = $root.google.cloud.apihub.v1.LintResponse.decode(reader, reader.uint32()); + break; + } + case 10: { + if (message.attributes === $util.emptyObject) + message.attributes = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.apihub.v1.AttributeValues.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.attributes[key] = value; + break; + } + case 11: { + message.documentation = $root.google.cloud.apihub.v1.Documentation.decode(reader, reader.uint32()); + break; + } + case 12: { + message.parsingMode = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Spec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.Spec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.Spec} Spec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Spec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Spec message. + * @function verify + * @memberof google.cloud.apihub.v1.Spec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Spec.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.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.specType != null && message.hasOwnProperty("specType")) { + var error = $root.google.cloud.apihub.v1.AttributeValues.verify(message.specType); + if (error) + return "specType." + error; + } + if (message.contents != null && message.hasOwnProperty("contents")) { + var error = $root.google.cloud.apihub.v1.SpecContents.verify(message.contents); + if (error) + return "contents." + error; + } + if (message.details != null && message.hasOwnProperty("details")) { + var error = $root.google.cloud.apihub.v1.SpecDetails.verify(message.details); + if (error) + return "details." + error; + } + if (message.sourceUri != null && message.hasOwnProperty("sourceUri")) + if (!$util.isString(message.sourceUri)) + return "sourceUri: 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.lintResponse != null && message.hasOwnProperty("lintResponse")) { + var error = $root.google.cloud.apihub.v1.LintResponse.verify(message.lintResponse); + if (error) + return "lintResponse." + error; + } + if (message.attributes != null && message.hasOwnProperty("attributes")) { + if (!$util.isObject(message.attributes)) + return "attributes: object expected"; + var key = Object.keys(message.attributes); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.apihub.v1.AttributeValues.verify(message.attributes[key[i]]); + if (error) + return "attributes." + error; + } + } + if (message.documentation != null && message.hasOwnProperty("documentation")) { + var error = $root.google.cloud.apihub.v1.Documentation.verify(message.documentation); + if (error) + return "documentation." + error; + } + if (message.parsingMode != null && message.hasOwnProperty("parsingMode")) + switch (message.parsingMode) { + default: + return "parsingMode: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a Spec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.Spec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.Spec} Spec + */ + Spec.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.Spec) + return object; + var message = new $root.google.cloud.apihub.v1.Spec(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.specType != null) { + if (typeof object.specType !== "object") + throw TypeError(".google.cloud.apihub.v1.Spec.specType: object expected"); + message.specType = $root.google.cloud.apihub.v1.AttributeValues.fromObject(object.specType); + } + if (object.contents != null) { + if (typeof object.contents !== "object") + throw TypeError(".google.cloud.apihub.v1.Spec.contents: object expected"); + message.contents = $root.google.cloud.apihub.v1.SpecContents.fromObject(object.contents); + } + if (object.details != null) { + if (typeof object.details !== "object") + throw TypeError(".google.cloud.apihub.v1.Spec.details: object expected"); + message.details = $root.google.cloud.apihub.v1.SpecDetails.fromObject(object.details); + } + if (object.sourceUri != null) + message.sourceUri = String(object.sourceUri); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.apihub.v1.Spec.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.apihub.v1.Spec.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.lintResponse != null) { + if (typeof object.lintResponse !== "object") + throw TypeError(".google.cloud.apihub.v1.Spec.lintResponse: object expected"); + message.lintResponse = $root.google.cloud.apihub.v1.LintResponse.fromObject(object.lintResponse); + } + if (object.attributes) { + if (typeof object.attributes !== "object") + throw TypeError(".google.cloud.apihub.v1.Spec.attributes: object expected"); + message.attributes = {}; + for (var keys = Object.keys(object.attributes), i = 0; i < keys.length; ++i) { + if (typeof object.attributes[keys[i]] !== "object") + throw TypeError(".google.cloud.apihub.v1.Spec.attributes: object expected"); + message.attributes[keys[i]] = $root.google.cloud.apihub.v1.AttributeValues.fromObject(object.attributes[keys[i]]); + } + } + if (object.documentation != null) { + if (typeof object.documentation !== "object") + throw TypeError(".google.cloud.apihub.v1.Spec.documentation: object expected"); + message.documentation = $root.google.cloud.apihub.v1.Documentation.fromObject(object.documentation); + } + switch (object.parsingMode) { + default: + if (typeof object.parsingMode === "number") { + message.parsingMode = object.parsingMode; + break; + } + break; + case "PARSING_MODE_UNSPECIFIED": + case 0: + message.parsingMode = 0; + break; + case "RELAXED": + case 1: + message.parsingMode = 1; + break; + case "STRICT": + case 2: + message.parsingMode = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a Spec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.Spec + * @static + * @param {google.cloud.apihub.v1.Spec} message Spec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Spec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.attributes = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.specType = null; + object.contents = null; + object.details = null; + object.sourceUri = ""; + object.createTime = null; + object.updateTime = null; + object.lintResponse = null; + object.documentation = null; + object.parsingMode = options.enums === String ? "PARSING_MODE_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.specType != null && message.hasOwnProperty("specType")) + object.specType = $root.google.cloud.apihub.v1.AttributeValues.toObject(message.specType, options); + if (message.contents != null && message.hasOwnProperty("contents")) + object.contents = $root.google.cloud.apihub.v1.SpecContents.toObject(message.contents, options); + if (message.details != null && message.hasOwnProperty("details")) + object.details = $root.google.cloud.apihub.v1.SpecDetails.toObject(message.details, options); + if (message.sourceUri != null && message.hasOwnProperty("sourceUri")) + object.sourceUri = message.sourceUri; + 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); + if (message.lintResponse != null && message.hasOwnProperty("lintResponse")) + object.lintResponse = $root.google.cloud.apihub.v1.LintResponse.toObject(message.lintResponse, options); + var keys2; + if (message.attributes && (keys2 = Object.keys(message.attributes)).length) { + object.attributes = {}; + for (var j = 0; j < keys2.length; ++j) + object.attributes[keys2[j]] = $root.google.cloud.apihub.v1.AttributeValues.toObject(message.attributes[keys2[j]], options); + } + if (message.documentation != null && message.hasOwnProperty("documentation")) + object.documentation = $root.google.cloud.apihub.v1.Documentation.toObject(message.documentation, options); + if (message.parsingMode != null && message.hasOwnProperty("parsingMode")) + object.parsingMode = options.enums === String ? $root.google.cloud.apihub.v1.Spec.ParsingMode[message.parsingMode] === undefined ? message.parsingMode : $root.google.cloud.apihub.v1.Spec.ParsingMode[message.parsingMode] : message.parsingMode; + return object; + }; + + /** + * Converts this Spec to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.Spec + * @instance + * @returns {Object.} JSON object + */ + Spec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Spec + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.Spec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Spec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.Spec"; + }; + + /** + * ParsingMode enum. + * @name google.cloud.apihub.v1.Spec.ParsingMode + * @enum {number} + * @property {number} PARSING_MODE_UNSPECIFIED=0 PARSING_MODE_UNSPECIFIED value + * @property {number} RELAXED=1 RELAXED value + * @property {number} STRICT=2 STRICT value + */ + Spec.ParsingMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PARSING_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "RELAXED"] = 1; + values[valuesById[2] = "STRICT"] = 2; + return values; + })(); + + return Spec; + })(); + + v1.Deployment = (function() { + + /** + * Properties of a Deployment. + * @memberof google.cloud.apihub.v1 + * @interface IDeployment + * @property {string|null} [name] Deployment name + * @property {string|null} [displayName] Deployment displayName + * @property {string|null} [description] Deployment description + * @property {google.cloud.apihub.v1.IDocumentation|null} [documentation] Deployment documentation + * @property {google.cloud.apihub.v1.IAttributeValues|null} [deploymentType] Deployment deploymentType + * @property {string|null} [resourceUri] Deployment resourceUri + * @property {Array.|null} [endpoints] Deployment endpoints + * @property {Array.|null} [apiVersions] Deployment apiVersions + * @property {google.protobuf.ITimestamp|null} [createTime] Deployment createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Deployment updateTime + * @property {google.cloud.apihub.v1.IAttributeValues|null} [slo] Deployment slo + * @property {google.cloud.apihub.v1.IAttributeValues|null} [environment] Deployment environment + * @property {Object.|null} [attributes] Deployment attributes + */ + + /** + * Constructs a new Deployment. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a Deployment. + * @implements IDeployment + * @constructor + * @param {google.cloud.apihub.v1.IDeployment=} [properties] Properties to set + */ + function Deployment(properties) { + this.endpoints = []; + this.apiVersions = []; + this.attributes = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Deployment name. + * @member {string} name + * @memberof google.cloud.apihub.v1.Deployment + * @instance + */ + Deployment.prototype.name = ""; + + /** + * Deployment displayName. + * @member {string} displayName + * @memberof google.cloud.apihub.v1.Deployment + * @instance + */ + Deployment.prototype.displayName = ""; + + /** + * Deployment description. + * @member {string} description + * @memberof google.cloud.apihub.v1.Deployment + * @instance + */ + Deployment.prototype.description = ""; + + /** + * Deployment documentation. + * @member {google.cloud.apihub.v1.IDocumentation|null|undefined} documentation + * @memberof google.cloud.apihub.v1.Deployment + * @instance + */ + Deployment.prototype.documentation = null; + + /** + * Deployment deploymentType. + * @member {google.cloud.apihub.v1.IAttributeValues|null|undefined} deploymentType + * @memberof google.cloud.apihub.v1.Deployment + * @instance + */ + Deployment.prototype.deploymentType = null; + + /** + * Deployment resourceUri. + * @member {string} resourceUri + * @memberof google.cloud.apihub.v1.Deployment + * @instance + */ + Deployment.prototype.resourceUri = ""; + + /** + * Deployment endpoints. + * @member {Array.} endpoints + * @memberof google.cloud.apihub.v1.Deployment + * @instance + */ + Deployment.prototype.endpoints = $util.emptyArray; + + /** + * Deployment apiVersions. + * @member {Array.} apiVersions + * @memberof google.cloud.apihub.v1.Deployment + * @instance + */ + Deployment.prototype.apiVersions = $util.emptyArray; + + /** + * Deployment createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.apihub.v1.Deployment + * @instance + */ + Deployment.prototype.createTime = null; + + /** + * Deployment updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.apihub.v1.Deployment + * @instance + */ + Deployment.prototype.updateTime = null; + + /** + * Deployment slo. + * @member {google.cloud.apihub.v1.IAttributeValues|null|undefined} slo + * @memberof google.cloud.apihub.v1.Deployment + * @instance + */ + Deployment.prototype.slo = null; + + /** + * Deployment environment. + * @member {google.cloud.apihub.v1.IAttributeValues|null|undefined} environment + * @memberof google.cloud.apihub.v1.Deployment + * @instance + */ + Deployment.prototype.environment = null; + + /** + * Deployment attributes. + * @member {Object.} attributes + * @memberof google.cloud.apihub.v1.Deployment + * @instance + */ + Deployment.prototype.attributes = $util.emptyObject; + + /** + * Creates a new Deployment instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.Deployment + * @static + * @param {google.cloud.apihub.v1.IDeployment=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.Deployment} Deployment instance + */ + Deployment.create = function create(properties) { + return new Deployment(properties); + }; + + /** + * Encodes the specified Deployment message. Does not implicitly {@link google.cloud.apihub.v1.Deployment.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.Deployment + * @static + * @param {google.cloud.apihub.v1.IDeployment} message Deployment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Deployment.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.documentation != null && Object.hasOwnProperty.call(message, "documentation")) + $root.google.cloud.apihub.v1.Documentation.encode(message.documentation, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.deploymentType != null && Object.hasOwnProperty.call(message, "deploymentType")) + $root.google.cloud.apihub.v1.AttributeValues.encode(message.deploymentType, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.resourceUri != null && Object.hasOwnProperty.call(message, "resourceUri")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.resourceUri); + if (message.endpoints != null && message.endpoints.length) + for (var i = 0; i < message.endpoints.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.endpoints[i]); + if (message.apiVersions != null && message.apiVersions.length) + for (var i = 0; i < message.apiVersions.length; ++i) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.apiVersions[i]); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.slo != null && Object.hasOwnProperty.call(message, "slo")) + $root.google.cloud.apihub.v1.AttributeValues.encode(message.slo, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.environment != null && Object.hasOwnProperty.call(message, "environment")) + $root.google.cloud.apihub.v1.AttributeValues.encode(message.environment, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.attributes != null && Object.hasOwnProperty.call(message, "attributes")) + for (var keys = Object.keys(message.attributes), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 13, wireType 2 =*/106).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.apihub.v1.AttributeValues.encode(message.attributes[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified Deployment message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.Deployment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.Deployment + * @static + * @param {google.cloud.apihub.v1.IDeployment} message Deployment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Deployment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Deployment message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.Deployment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.Deployment} Deployment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Deployment.decode = function 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.apihub.v1.Deployment(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + message.documentation = $root.google.cloud.apihub.v1.Documentation.decode(reader, reader.uint32()); + break; + } + case 5: { + message.deploymentType = $root.google.cloud.apihub.v1.AttributeValues.decode(reader, reader.uint32()); + break; + } + case 6: { + message.resourceUri = reader.string(); + break; + } + case 7: { + if (!(message.endpoints && message.endpoints.length)) + message.endpoints = []; + message.endpoints.push(reader.string()); + break; + } + case 8: { + if (!(message.apiVersions && message.apiVersions.length)) + message.apiVersions = []; + message.apiVersions.push(reader.string()); + break; + } + case 9: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 10: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 11: { + message.slo = $root.google.cloud.apihub.v1.AttributeValues.decode(reader, reader.uint32()); + break; + } + case 12: { + message.environment = $root.google.cloud.apihub.v1.AttributeValues.decode(reader, reader.uint32()); + break; + } + case 13: { + if (message.attributes === $util.emptyObject) + message.attributes = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.apihub.v1.AttributeValues.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.attributes[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Deployment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.Deployment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.Deployment} Deployment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Deployment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Deployment message. + * @function verify + * @memberof google.cloud.apihub.v1.Deployment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Deployment.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.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.documentation != null && message.hasOwnProperty("documentation")) { + var error = $root.google.cloud.apihub.v1.Documentation.verify(message.documentation); + if (error) + return "documentation." + error; + } + if (message.deploymentType != null && message.hasOwnProperty("deploymentType")) { + var error = $root.google.cloud.apihub.v1.AttributeValues.verify(message.deploymentType); + if (error) + return "deploymentType." + error; + } + if (message.resourceUri != null && message.hasOwnProperty("resourceUri")) + if (!$util.isString(message.resourceUri)) + return "resourceUri: string expected"; + if (message.endpoints != null && message.hasOwnProperty("endpoints")) { + if (!Array.isArray(message.endpoints)) + return "endpoints: array expected"; + for (var i = 0; i < message.endpoints.length; ++i) + if (!$util.isString(message.endpoints[i])) + return "endpoints: string[] expected"; + } + if (message.apiVersions != null && message.hasOwnProperty("apiVersions")) { + if (!Array.isArray(message.apiVersions)) + return "apiVersions: array expected"; + for (var i = 0; i < message.apiVersions.length; ++i) + if (!$util.isString(message.apiVersions[i])) + return "apiVersions: 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.slo != null && message.hasOwnProperty("slo")) { + var error = $root.google.cloud.apihub.v1.AttributeValues.verify(message.slo); + if (error) + return "slo." + error; + } + if (message.environment != null && message.hasOwnProperty("environment")) { + var error = $root.google.cloud.apihub.v1.AttributeValues.verify(message.environment); + if (error) + return "environment." + error; + } + if (message.attributes != null && message.hasOwnProperty("attributes")) { + if (!$util.isObject(message.attributes)) + return "attributes: object expected"; + var key = Object.keys(message.attributes); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.apihub.v1.AttributeValues.verify(message.attributes[key[i]]); + if (error) + return "attributes." + error; + } + } + return null; + }; + + /** + * Creates a Deployment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.Deployment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.Deployment} Deployment + */ + Deployment.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.Deployment) + return object; + var message = new $root.google.cloud.apihub.v1.Deployment(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.documentation != null) { + if (typeof object.documentation !== "object") + throw TypeError(".google.cloud.apihub.v1.Deployment.documentation: object expected"); + message.documentation = $root.google.cloud.apihub.v1.Documentation.fromObject(object.documentation); + } + if (object.deploymentType != null) { + if (typeof object.deploymentType !== "object") + throw TypeError(".google.cloud.apihub.v1.Deployment.deploymentType: object expected"); + message.deploymentType = $root.google.cloud.apihub.v1.AttributeValues.fromObject(object.deploymentType); + } + if (object.resourceUri != null) + message.resourceUri = String(object.resourceUri); + if (object.endpoints) { + if (!Array.isArray(object.endpoints)) + throw TypeError(".google.cloud.apihub.v1.Deployment.endpoints: array expected"); + message.endpoints = []; + for (var i = 0; i < object.endpoints.length; ++i) + message.endpoints[i] = String(object.endpoints[i]); + } + if (object.apiVersions) { + if (!Array.isArray(object.apiVersions)) + throw TypeError(".google.cloud.apihub.v1.Deployment.apiVersions: array expected"); + message.apiVersions = []; + for (var i = 0; i < object.apiVersions.length; ++i) + message.apiVersions[i] = String(object.apiVersions[i]); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.apihub.v1.Deployment.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.apihub.v1.Deployment.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.slo != null) { + if (typeof object.slo !== "object") + throw TypeError(".google.cloud.apihub.v1.Deployment.slo: object expected"); + message.slo = $root.google.cloud.apihub.v1.AttributeValues.fromObject(object.slo); + } + if (object.environment != null) { + if (typeof object.environment !== "object") + throw TypeError(".google.cloud.apihub.v1.Deployment.environment: object expected"); + message.environment = $root.google.cloud.apihub.v1.AttributeValues.fromObject(object.environment); + } + if (object.attributes) { + if (typeof object.attributes !== "object") + throw TypeError(".google.cloud.apihub.v1.Deployment.attributes: object expected"); + message.attributes = {}; + for (var keys = Object.keys(object.attributes), i = 0; i < keys.length; ++i) { + if (typeof object.attributes[keys[i]] !== "object") + throw TypeError(".google.cloud.apihub.v1.Deployment.attributes: object expected"); + message.attributes[keys[i]] = $root.google.cloud.apihub.v1.AttributeValues.fromObject(object.attributes[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a Deployment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.Deployment + * @static + * @param {google.cloud.apihub.v1.Deployment} message Deployment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Deployment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.endpoints = []; + object.apiVersions = []; + } + if (options.objects || options.defaults) + object.attributes = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.description = ""; + object.documentation = null; + object.deploymentType = null; + object.resourceUri = ""; + object.createTime = null; + object.updateTime = null; + object.slo = null; + object.environment = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.documentation != null && message.hasOwnProperty("documentation")) + object.documentation = $root.google.cloud.apihub.v1.Documentation.toObject(message.documentation, options); + if (message.deploymentType != null && message.hasOwnProperty("deploymentType")) + object.deploymentType = $root.google.cloud.apihub.v1.AttributeValues.toObject(message.deploymentType, options); + if (message.resourceUri != null && message.hasOwnProperty("resourceUri")) + object.resourceUri = message.resourceUri; + if (message.endpoints && message.endpoints.length) { + object.endpoints = []; + for (var j = 0; j < message.endpoints.length; ++j) + object.endpoints[j] = message.endpoints[j]; + } + if (message.apiVersions && message.apiVersions.length) { + object.apiVersions = []; + for (var j = 0; j < message.apiVersions.length; ++j) + object.apiVersions[j] = message.apiVersions[j]; + } + 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); + if (message.slo != null && message.hasOwnProperty("slo")) + object.slo = $root.google.cloud.apihub.v1.AttributeValues.toObject(message.slo, options); + if (message.environment != null && message.hasOwnProperty("environment")) + object.environment = $root.google.cloud.apihub.v1.AttributeValues.toObject(message.environment, options); + var keys2; + if (message.attributes && (keys2 = Object.keys(message.attributes)).length) { + object.attributes = {}; + for (var j = 0; j < keys2.length; ++j) + object.attributes[keys2[j]] = $root.google.cloud.apihub.v1.AttributeValues.toObject(message.attributes[keys2[j]], options); + } + return object; + }; + + /** + * Converts this Deployment to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.Deployment + * @instance + * @returns {Object.} JSON object + */ + Deployment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Deployment + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.Deployment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Deployment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.Deployment"; + }; + + return Deployment; + })(); + + v1.ApiOperation = (function() { + + /** + * Properties of an ApiOperation. + * @memberof google.cloud.apihub.v1 + * @interface IApiOperation + * @property {string|null} [name] ApiOperation name + * @property {string|null} [spec] ApiOperation spec + * @property {google.cloud.apihub.v1.IOperationDetails|null} [details] ApiOperation details + * @property {google.protobuf.ITimestamp|null} [createTime] ApiOperation createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] ApiOperation updateTime + * @property {Object.|null} [attributes] ApiOperation attributes + */ + + /** + * Constructs a new ApiOperation. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents an ApiOperation. + * @implements IApiOperation + * @constructor + * @param {google.cloud.apihub.v1.IApiOperation=} [properties] Properties to set + */ + function ApiOperation(properties) { + this.attributes = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ApiOperation name. + * @member {string} name + * @memberof google.cloud.apihub.v1.ApiOperation + * @instance + */ + ApiOperation.prototype.name = ""; + + /** + * ApiOperation spec. + * @member {string} spec + * @memberof google.cloud.apihub.v1.ApiOperation + * @instance + */ + ApiOperation.prototype.spec = ""; + + /** + * ApiOperation details. + * @member {google.cloud.apihub.v1.IOperationDetails|null|undefined} details + * @memberof google.cloud.apihub.v1.ApiOperation + * @instance + */ + ApiOperation.prototype.details = null; + + /** + * ApiOperation createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.apihub.v1.ApiOperation + * @instance + */ + ApiOperation.prototype.createTime = null; + + /** + * ApiOperation updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.apihub.v1.ApiOperation + * @instance + */ + ApiOperation.prototype.updateTime = null; + + /** + * ApiOperation attributes. + * @member {Object.} attributes + * @memberof google.cloud.apihub.v1.ApiOperation + * @instance + */ + ApiOperation.prototype.attributes = $util.emptyObject; + + /** + * Creates a new ApiOperation instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.ApiOperation + * @static + * @param {google.cloud.apihub.v1.IApiOperation=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.ApiOperation} ApiOperation instance + */ + ApiOperation.create = function create(properties) { + return new ApiOperation(properties); + }; + + /** + * Encodes the specified ApiOperation message. Does not implicitly {@link google.cloud.apihub.v1.ApiOperation.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.ApiOperation + * @static + * @param {google.cloud.apihub.v1.IApiOperation} message ApiOperation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApiOperation.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.spec != null && Object.hasOwnProperty.call(message, "spec")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.spec); + if (message.details != null && Object.hasOwnProperty.call(message, "details")) + $root.google.cloud.apihub.v1.OperationDetails.encode(message.details, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.attributes != null && Object.hasOwnProperty.call(message, "attributes")) + for (var keys = Object.keys(message.attributes), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.apihub.v1.AttributeValues.encode(message.attributes[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified ApiOperation message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ApiOperation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.ApiOperation + * @static + * @param {google.cloud.apihub.v1.IApiOperation} message ApiOperation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApiOperation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ApiOperation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.ApiOperation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.ApiOperation} ApiOperation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApiOperation.decode = function 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.apihub.v1.ApiOperation(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.spec = reader.string(); + break; + } + case 3: { + message.details = $root.google.cloud.apihub.v1.OperationDetails.decode(reader, reader.uint32()); + break; + } + case 4: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + if (message.attributes === $util.emptyObject) + message.attributes = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.apihub.v1.AttributeValues.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.attributes[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ApiOperation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.ApiOperation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.ApiOperation} ApiOperation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApiOperation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ApiOperation message. + * @function verify + * @memberof google.cloud.apihub.v1.ApiOperation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ApiOperation.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.spec != null && message.hasOwnProperty("spec")) + if (!$util.isString(message.spec)) + return "spec: string expected"; + if (message.details != null && message.hasOwnProperty("details")) { + var error = $root.google.cloud.apihub.v1.OperationDetails.verify(message.details); + if (error) + return "details." + error; + } + 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.attributes != null && message.hasOwnProperty("attributes")) { + if (!$util.isObject(message.attributes)) + return "attributes: object expected"; + var key = Object.keys(message.attributes); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.apihub.v1.AttributeValues.verify(message.attributes[key[i]]); + if (error) + return "attributes." + error; + } + } + return null; + }; + + /** + * Creates an ApiOperation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.ApiOperation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.ApiOperation} ApiOperation + */ + ApiOperation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.ApiOperation) + return object; + var message = new $root.google.cloud.apihub.v1.ApiOperation(); + if (object.name != null) + message.name = String(object.name); + if (object.spec != null) + message.spec = String(object.spec); + if (object.details != null) { + if (typeof object.details !== "object") + throw TypeError(".google.cloud.apihub.v1.ApiOperation.details: object expected"); + message.details = $root.google.cloud.apihub.v1.OperationDetails.fromObject(object.details); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.apihub.v1.ApiOperation.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.apihub.v1.ApiOperation.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.attributes) { + if (typeof object.attributes !== "object") + throw TypeError(".google.cloud.apihub.v1.ApiOperation.attributes: object expected"); + message.attributes = {}; + for (var keys = Object.keys(object.attributes), i = 0; i < keys.length; ++i) { + if (typeof object.attributes[keys[i]] !== "object") + throw TypeError(".google.cloud.apihub.v1.ApiOperation.attributes: object expected"); + message.attributes[keys[i]] = $root.google.cloud.apihub.v1.AttributeValues.fromObject(object.attributes[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from an ApiOperation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.ApiOperation + * @static + * @param {google.cloud.apihub.v1.ApiOperation} message ApiOperation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ApiOperation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.attributes = {}; + if (options.defaults) { + object.name = ""; + object.spec = ""; + object.details = null; + object.createTime = null; + object.updateTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.spec != null && message.hasOwnProperty("spec")) + object.spec = message.spec; + if (message.details != null && message.hasOwnProperty("details")) + object.details = $root.google.cloud.apihub.v1.OperationDetails.toObject(message.details, options); + 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.attributes && (keys2 = Object.keys(message.attributes)).length) { + object.attributes = {}; + for (var j = 0; j < keys2.length; ++j) + object.attributes[keys2[j]] = $root.google.cloud.apihub.v1.AttributeValues.toObject(message.attributes[keys2[j]], options); + } + return object; + }; + + /** + * Converts this ApiOperation to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.ApiOperation + * @instance + * @returns {Object.} JSON object + */ + ApiOperation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ApiOperation + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.ApiOperation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ApiOperation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.ApiOperation"; + }; + + return ApiOperation; + })(); + + v1.Definition = (function() { + + /** + * Properties of a Definition. + * @memberof google.cloud.apihub.v1 + * @interface IDefinition + * @property {google.cloud.apihub.v1.ISchema|null} [schema] Definition schema + * @property {string|null} [name] Definition name + * @property {string|null} [spec] Definition spec + * @property {google.cloud.apihub.v1.Definition.Type|null} [type] Definition type + * @property {google.protobuf.ITimestamp|null} [createTime] Definition createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Definition updateTime + * @property {Object.|null} [attributes] Definition attributes + */ + + /** + * Constructs a new Definition. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a Definition. + * @implements IDefinition + * @constructor + * @param {google.cloud.apihub.v1.IDefinition=} [properties] Properties to set + */ + function Definition(properties) { + this.attributes = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Definition schema. + * @member {google.cloud.apihub.v1.ISchema|null|undefined} schema + * @memberof google.cloud.apihub.v1.Definition + * @instance + */ + Definition.prototype.schema = null; + + /** + * Definition name. + * @member {string} name + * @memberof google.cloud.apihub.v1.Definition + * @instance + */ + Definition.prototype.name = ""; + + /** + * Definition spec. + * @member {string} spec + * @memberof google.cloud.apihub.v1.Definition + * @instance + */ + Definition.prototype.spec = ""; + + /** + * Definition type. + * @member {google.cloud.apihub.v1.Definition.Type} type + * @memberof google.cloud.apihub.v1.Definition + * @instance + */ + Definition.prototype.type = 0; + + /** + * Definition createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.apihub.v1.Definition + * @instance + */ + Definition.prototype.createTime = null; + + /** + * Definition updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.apihub.v1.Definition + * @instance + */ + Definition.prototype.updateTime = null; + + /** + * Definition attributes. + * @member {Object.} attributes + * @memberof google.cloud.apihub.v1.Definition + * @instance + */ + Definition.prototype.attributes = $util.emptyObject; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Definition value. + * @member {"schema"|undefined} value + * @memberof google.cloud.apihub.v1.Definition + * @instance + */ + Object.defineProperty(Definition.prototype, "value", { + get: $util.oneOfGetter($oneOfFields = ["schema"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Definition instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.Definition + * @static + * @param {google.cloud.apihub.v1.IDefinition=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.Definition} Definition instance + */ + Definition.create = function create(properties) { + return new Definition(properties); + }; + + /** + * Encodes the specified Definition message. Does not implicitly {@link google.cloud.apihub.v1.Definition.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.Definition + * @static + * @param {google.cloud.apihub.v1.IDefinition} message Definition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Definition.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.spec != null && Object.hasOwnProperty.call(message, "spec")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.spec); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.type); + if (message.schema != null && Object.hasOwnProperty.call(message, "schema")) + $root.google.cloud.apihub.v1.Schema.encode(message.schema, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.attributes != null && Object.hasOwnProperty.call(message, "attributes")) + for (var keys = Object.keys(message.attributes), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.apihub.v1.AttributeValues.encode(message.attributes[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified Definition message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.Definition.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.Definition + * @static + * @param {google.cloud.apihub.v1.IDefinition} message Definition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Definition.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Definition message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.Definition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.Definition} Definition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Definition.decode = function 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.apihub.v1.Definition(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: { + message.schema = $root.google.cloud.apihub.v1.Schema.decode(reader, reader.uint32()); + break; + } + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.spec = reader.string(); + break; + } + case 3: { + message.type = reader.int32(); + break; + } + case 5: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + if (message.attributes === $util.emptyObject) + message.attributes = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.apihub.v1.AttributeValues.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.attributes[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Definition message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.Definition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.Definition} Definition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Definition.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Definition message. + * @function verify + * @memberof google.cloud.apihub.v1.Definition + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Definition.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.schema != null && message.hasOwnProperty("schema")) { + properties.value = 1; + { + var error = $root.google.cloud.apihub.v1.Schema.verify(message.schema); + if (error) + return "schema." + error; + } + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.spec != null && message.hasOwnProperty("spec")) + if (!$util.isString(message.spec)) + return "spec: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + break; + } + 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.attributes != null && message.hasOwnProperty("attributes")) { + if (!$util.isObject(message.attributes)) + return "attributes: object expected"; + var key = Object.keys(message.attributes); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.apihub.v1.AttributeValues.verify(message.attributes[key[i]]); + if (error) + return "attributes." + error; + } + } + return null; + }; + + /** + * Creates a Definition message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.Definition + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.Definition} Definition + */ + Definition.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.Definition) + return object; + var message = new $root.google.cloud.apihub.v1.Definition(); + if (object.schema != null) { + if (typeof object.schema !== "object") + throw TypeError(".google.cloud.apihub.v1.Definition.schema: object expected"); + message.schema = $root.google.cloud.apihub.v1.Schema.fromObject(object.schema); + } + if (object.name != null) + message.name = String(object.name); + if (object.spec != null) + message.spec = String(object.spec); + 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 "SCHEMA": + case 1: + message.type = 1; + break; + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.apihub.v1.Definition.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.apihub.v1.Definition.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.attributes) { + if (typeof object.attributes !== "object") + throw TypeError(".google.cloud.apihub.v1.Definition.attributes: object expected"); + message.attributes = {}; + for (var keys = Object.keys(object.attributes), i = 0; i < keys.length; ++i) { + if (typeof object.attributes[keys[i]] !== "object") + throw TypeError(".google.cloud.apihub.v1.Definition.attributes: object expected"); + message.attributes[keys[i]] = $root.google.cloud.apihub.v1.AttributeValues.fromObject(object.attributes[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a Definition message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.Definition + * @static + * @param {google.cloud.apihub.v1.Definition} message Definition + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Definition.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.attributes = {}; + if (options.defaults) { + object.name = ""; + object.spec = ""; + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.createTime = null; + object.updateTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.spec != null && message.hasOwnProperty("spec")) + object.spec = message.spec; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.apihub.v1.Definition.Type[message.type] === undefined ? message.type : $root.google.cloud.apihub.v1.Definition.Type[message.type] : message.type; + if (message.schema != null && message.hasOwnProperty("schema")) { + object.schema = $root.google.cloud.apihub.v1.Schema.toObject(message.schema, options); + if (options.oneofs) + object.value = "schema"; + } + 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.attributes && (keys2 = Object.keys(message.attributes)).length) { + object.attributes = {}; + for (var j = 0; j < keys2.length; ++j) + object.attributes[keys2[j]] = $root.google.cloud.apihub.v1.AttributeValues.toObject(message.attributes[keys2[j]], options); + } + return object; + }; + + /** + * Converts this Definition to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.Definition + * @instance + * @returns {Object.} JSON object + */ + Definition.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Definition + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.Definition + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Definition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.Definition"; + }; + + /** + * Type enum. + * @name google.cloud.apihub.v1.Definition.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} SCHEMA=1 SCHEMA value + */ + Definition.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SCHEMA"] = 1; + return values; + })(); + + return Definition; + })(); + + v1.Attribute = (function() { + + /** + * Properties of an Attribute. + * @memberof google.cloud.apihub.v1 + * @interface IAttribute + * @property {string|null} [name] Attribute name + * @property {string|null} [displayName] Attribute displayName + * @property {string|null} [description] Attribute description + * @property {google.cloud.apihub.v1.Attribute.DefinitionType|null} [definitionType] Attribute definitionType + * @property {google.cloud.apihub.v1.Attribute.Scope|null} [scope] Attribute scope + * @property {google.cloud.apihub.v1.Attribute.DataType|null} [dataType] Attribute dataType + * @property {Array.|null} [allowedValues] Attribute allowedValues + * @property {number|null} [cardinality] Attribute cardinality + * @property {boolean|null} [mandatory] Attribute mandatory + * @property {google.protobuf.ITimestamp|null} [createTime] Attribute createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Attribute updateTime + */ + + /** + * Constructs a new Attribute. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents an Attribute. + * @implements IAttribute + * @constructor + * @param {google.cloud.apihub.v1.IAttribute=} [properties] Properties to set + */ + function Attribute(properties) { + this.allowedValues = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Attribute name. + * @member {string} name + * @memberof google.cloud.apihub.v1.Attribute + * @instance + */ + Attribute.prototype.name = ""; + + /** + * Attribute displayName. + * @member {string} displayName + * @memberof google.cloud.apihub.v1.Attribute + * @instance + */ + Attribute.prototype.displayName = ""; + + /** + * Attribute description. + * @member {string} description + * @memberof google.cloud.apihub.v1.Attribute + * @instance + */ + Attribute.prototype.description = ""; + + /** + * Attribute definitionType. + * @member {google.cloud.apihub.v1.Attribute.DefinitionType} definitionType + * @memberof google.cloud.apihub.v1.Attribute + * @instance + */ + Attribute.prototype.definitionType = 0; + + /** + * Attribute scope. + * @member {google.cloud.apihub.v1.Attribute.Scope} scope + * @memberof google.cloud.apihub.v1.Attribute + * @instance + */ + Attribute.prototype.scope = 0; + + /** + * Attribute dataType. + * @member {google.cloud.apihub.v1.Attribute.DataType} dataType + * @memberof google.cloud.apihub.v1.Attribute + * @instance + */ + Attribute.prototype.dataType = 0; + + /** + * Attribute allowedValues. + * @member {Array.} allowedValues + * @memberof google.cloud.apihub.v1.Attribute + * @instance + */ + Attribute.prototype.allowedValues = $util.emptyArray; + + /** + * Attribute cardinality. + * @member {number} cardinality + * @memberof google.cloud.apihub.v1.Attribute + * @instance + */ + Attribute.prototype.cardinality = 0; + + /** + * Attribute mandatory. + * @member {boolean} mandatory + * @memberof google.cloud.apihub.v1.Attribute + * @instance + */ + Attribute.prototype.mandatory = false; + + /** + * Attribute createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.apihub.v1.Attribute + * @instance + */ + Attribute.prototype.createTime = null; + + /** + * Attribute updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.apihub.v1.Attribute + * @instance + */ + Attribute.prototype.updateTime = null; + + /** + * Creates a new Attribute instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.Attribute + * @static + * @param {google.cloud.apihub.v1.IAttribute=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.Attribute} Attribute instance + */ + Attribute.create = function create(properties) { + return new Attribute(properties); + }; + + /** + * Encodes the specified Attribute message. Does not implicitly {@link google.cloud.apihub.v1.Attribute.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.Attribute + * @static + * @param {google.cloud.apihub.v1.IAttribute} message Attribute message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Attribute.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.definitionType != null && Object.hasOwnProperty.call(message, "definitionType")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.definitionType); + if (message.scope != null && Object.hasOwnProperty.call(message, "scope")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.scope); + if (message.dataType != null && Object.hasOwnProperty.call(message, "dataType")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.dataType); + if (message.allowedValues != null && message.allowedValues.length) + for (var i = 0; i < message.allowedValues.length; ++i) + $root.google.cloud.apihub.v1.Attribute.AllowedValue.encode(message.allowedValues[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.cardinality != null && Object.hasOwnProperty.call(message, "cardinality")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.cardinality); + if (message.mandatory != null && Object.hasOwnProperty.call(message, "mandatory")) + writer.uint32(/* id 9, wireType 0 =*/72).bool(message.mandatory); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Attribute message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.Attribute.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.Attribute + * @static + * @param {google.cloud.apihub.v1.IAttribute} message Attribute message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Attribute.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Attribute message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.Attribute + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.Attribute} Attribute + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Attribute.decode = function 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.apihub.v1.Attribute(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + message.definitionType = reader.int32(); + break; + } + case 5: { + message.scope = reader.int32(); + break; + } + case 6: { + message.dataType = reader.int32(); + break; + } + case 7: { + if (!(message.allowedValues && message.allowedValues.length)) + message.allowedValues = []; + message.allowedValues.push($root.google.cloud.apihub.v1.Attribute.AllowedValue.decode(reader, reader.uint32())); + break; + } + case 8: { + message.cardinality = reader.int32(); + break; + } + case 9: { + message.mandatory = reader.bool(); + break; + } + case 10: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 11: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Attribute message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.Attribute + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.Attribute} Attribute + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Attribute.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Attribute message. + * @function verify + * @memberof google.cloud.apihub.v1.Attribute + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Attribute.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.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.definitionType != null && message.hasOwnProperty("definitionType")) + switch (message.definitionType) { + default: + return "definitionType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.scope != null && message.hasOwnProperty("scope")) + switch (message.scope) { + default: + return "scope: 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.dataType != null && message.hasOwnProperty("dataType")) + switch (message.dataType) { + default: + return "dataType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.allowedValues != null && message.hasOwnProperty("allowedValues")) { + if (!Array.isArray(message.allowedValues)) + return "allowedValues: array expected"; + for (var i = 0; i < message.allowedValues.length; ++i) { + var error = $root.google.cloud.apihub.v1.Attribute.AllowedValue.verify(message.allowedValues[i]); + if (error) + return "allowedValues." + error; + } + } + if (message.cardinality != null && message.hasOwnProperty("cardinality")) + if (!$util.isInteger(message.cardinality)) + return "cardinality: integer expected"; + if (message.mandatory != null && message.hasOwnProperty("mandatory")) + if (typeof message.mandatory !== "boolean") + return "mandatory: boolean 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; + } + return null; + }; + + /** + * Creates an Attribute message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.Attribute + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.Attribute} Attribute + */ + Attribute.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.Attribute) + return object; + var message = new $root.google.cloud.apihub.v1.Attribute(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + switch (object.definitionType) { + default: + if (typeof object.definitionType === "number") { + message.definitionType = object.definitionType; + break; + } + break; + case "DEFINITION_TYPE_UNSPECIFIED": + case 0: + message.definitionType = 0; + break; + case "SYSTEM_DEFINED": + case 1: + message.definitionType = 1; + break; + case "USER_DEFINED": + case 2: + message.definitionType = 2; + break; + } + switch (object.scope) { + default: + if (typeof object.scope === "number") { + message.scope = object.scope; + break; + } + break; + case "SCOPE_UNSPECIFIED": + case 0: + message.scope = 0; + break; + case "API": + case 1: + message.scope = 1; + break; + case "VERSION": + case 2: + message.scope = 2; + break; + case "SPEC": + case 3: + message.scope = 3; + break; + case "API_OPERATION": + case 4: + message.scope = 4; + break; + case "DEPLOYMENT": + case 5: + message.scope = 5; + break; + case "DEPENDENCY": + case 6: + message.scope = 6; + break; + case "DEFINITION": + case 7: + message.scope = 7; + break; + case "EXTERNAL_API": + case 8: + message.scope = 8; + break; + case "PLUGIN": + case 9: + message.scope = 9; + break; + } + 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 "ENUM": + case 1: + message.dataType = 1; + break; + case "JSON": + case 2: + message.dataType = 2; + break; + case "STRING": + case 3: + message.dataType = 3; + break; + } + if (object.allowedValues) { + if (!Array.isArray(object.allowedValues)) + throw TypeError(".google.cloud.apihub.v1.Attribute.allowedValues: array expected"); + message.allowedValues = []; + for (var i = 0; i < object.allowedValues.length; ++i) { + if (typeof object.allowedValues[i] !== "object") + throw TypeError(".google.cloud.apihub.v1.Attribute.allowedValues: object expected"); + message.allowedValues[i] = $root.google.cloud.apihub.v1.Attribute.AllowedValue.fromObject(object.allowedValues[i]); + } + } + if (object.cardinality != null) + message.cardinality = object.cardinality | 0; + if (object.mandatory != null) + message.mandatory = Boolean(object.mandatory); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.apihub.v1.Attribute.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.apihub.v1.Attribute.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + return message; + }; + + /** + * Creates a plain object from an Attribute message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.Attribute + * @static + * @param {google.cloud.apihub.v1.Attribute} message Attribute + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Attribute.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.allowedValues = []; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.description = ""; + object.definitionType = options.enums === String ? "DEFINITION_TYPE_UNSPECIFIED" : 0; + object.scope = options.enums === String ? "SCOPE_UNSPECIFIED" : 0; + object.dataType = options.enums === String ? "DATA_TYPE_UNSPECIFIED" : 0; + object.cardinality = 0; + object.mandatory = false; + object.createTime = null; + object.updateTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.definitionType != null && message.hasOwnProperty("definitionType")) + object.definitionType = options.enums === String ? $root.google.cloud.apihub.v1.Attribute.DefinitionType[message.definitionType] === undefined ? message.definitionType : $root.google.cloud.apihub.v1.Attribute.DefinitionType[message.definitionType] : message.definitionType; + if (message.scope != null && message.hasOwnProperty("scope")) + object.scope = options.enums === String ? $root.google.cloud.apihub.v1.Attribute.Scope[message.scope] === undefined ? message.scope : $root.google.cloud.apihub.v1.Attribute.Scope[message.scope] : message.scope; + if (message.dataType != null && message.hasOwnProperty("dataType")) + object.dataType = options.enums === String ? $root.google.cloud.apihub.v1.Attribute.DataType[message.dataType] === undefined ? message.dataType : $root.google.cloud.apihub.v1.Attribute.DataType[message.dataType] : message.dataType; + if (message.allowedValues && message.allowedValues.length) { + object.allowedValues = []; + for (var j = 0; j < message.allowedValues.length; ++j) + object.allowedValues[j] = $root.google.cloud.apihub.v1.Attribute.AllowedValue.toObject(message.allowedValues[j], options); + } + if (message.cardinality != null && message.hasOwnProperty("cardinality")) + object.cardinality = message.cardinality; + if (message.mandatory != null && message.hasOwnProperty("mandatory")) + object.mandatory = message.mandatory; + 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); + return object; + }; + + /** + * Converts this Attribute to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.Attribute + * @instance + * @returns {Object.} JSON object + */ + Attribute.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Attribute + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.Attribute + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Attribute.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.Attribute"; + }; + + Attribute.AllowedValue = (function() { + + /** + * Properties of an AllowedValue. + * @memberof google.cloud.apihub.v1.Attribute + * @interface IAllowedValue + * @property {string|null} [id] AllowedValue id + * @property {string|null} [displayName] AllowedValue displayName + * @property {string|null} [description] AllowedValue description + * @property {boolean|null} [immutable] AllowedValue immutable + */ + + /** + * Constructs a new AllowedValue. + * @memberof google.cloud.apihub.v1.Attribute + * @classdesc Represents an AllowedValue. + * @implements IAllowedValue + * @constructor + * @param {google.cloud.apihub.v1.Attribute.IAllowedValue=} [properties] Properties to set + */ + function AllowedValue(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]]; + } + + /** + * AllowedValue id. + * @member {string} id + * @memberof google.cloud.apihub.v1.Attribute.AllowedValue + * @instance + */ + AllowedValue.prototype.id = ""; + + /** + * AllowedValue displayName. + * @member {string} displayName + * @memberof google.cloud.apihub.v1.Attribute.AllowedValue + * @instance + */ + AllowedValue.prototype.displayName = ""; + + /** + * AllowedValue description. + * @member {string} description + * @memberof google.cloud.apihub.v1.Attribute.AllowedValue + * @instance + */ + AllowedValue.prototype.description = ""; + + /** + * AllowedValue immutable. + * @member {boolean} immutable + * @memberof google.cloud.apihub.v1.Attribute.AllowedValue + * @instance + */ + AllowedValue.prototype.immutable = false; + + /** + * Creates a new AllowedValue instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.Attribute.AllowedValue + * @static + * @param {google.cloud.apihub.v1.Attribute.IAllowedValue=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.Attribute.AllowedValue} AllowedValue instance + */ + AllowedValue.create = function create(properties) { + return new AllowedValue(properties); + }; + + /** + * Encodes the specified AllowedValue message. Does not implicitly {@link google.cloud.apihub.v1.Attribute.AllowedValue.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.Attribute.AllowedValue + * @static + * @param {google.cloud.apihub.v1.Attribute.IAllowedValue} message AllowedValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AllowedValue.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); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.immutable != null && Object.hasOwnProperty.call(message, "immutable")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.immutable); + return writer; + }; + + /** + * Encodes the specified AllowedValue message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.Attribute.AllowedValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.Attribute.AllowedValue + * @static + * @param {google.cloud.apihub.v1.Attribute.IAllowedValue} message AllowedValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AllowedValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AllowedValue message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.Attribute.AllowedValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.Attribute.AllowedValue} AllowedValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AllowedValue.decode = function 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.apihub.v1.Attribute.AllowedValue(); + 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; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + message.immutable = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AllowedValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.Attribute.AllowedValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.Attribute.AllowedValue} AllowedValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AllowedValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AllowedValue message. + * @function verify + * @memberof google.cloud.apihub.v1.Attribute.AllowedValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AllowedValue.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"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.immutable != null && message.hasOwnProperty("immutable")) + if (typeof message.immutable !== "boolean") + return "immutable: boolean expected"; + return null; + }; + + /** + * Creates an AllowedValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.Attribute.AllowedValue + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.Attribute.AllowedValue} AllowedValue + */ + AllowedValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.Attribute.AllowedValue) + return object; + var message = new $root.google.cloud.apihub.v1.Attribute.AllowedValue(); + if (object.id != null) + message.id = String(object.id); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.immutable != null) + message.immutable = Boolean(object.immutable); + return message; + }; + + /** + * Creates a plain object from an AllowedValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.Attribute.AllowedValue + * @static + * @param {google.cloud.apihub.v1.Attribute.AllowedValue} message AllowedValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AllowedValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.id = ""; + object.displayName = ""; + object.description = ""; + object.immutable = false; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.immutable != null && message.hasOwnProperty("immutable")) + object.immutable = message.immutable; + return object; + }; + + /** + * Converts this AllowedValue to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.Attribute.AllowedValue + * @instance + * @returns {Object.} JSON object + */ + AllowedValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AllowedValue + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.Attribute.AllowedValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AllowedValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.Attribute.AllowedValue"; + }; + + return AllowedValue; + })(); + + /** + * DefinitionType enum. + * @name google.cloud.apihub.v1.Attribute.DefinitionType + * @enum {number} + * @property {number} DEFINITION_TYPE_UNSPECIFIED=0 DEFINITION_TYPE_UNSPECIFIED value + * @property {number} SYSTEM_DEFINED=1 SYSTEM_DEFINED value + * @property {number} USER_DEFINED=2 USER_DEFINED value + */ + Attribute.DefinitionType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DEFINITION_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SYSTEM_DEFINED"] = 1; + values[valuesById[2] = "USER_DEFINED"] = 2; + return values; + })(); + + /** + * Scope enum. + * @name google.cloud.apihub.v1.Attribute.Scope + * @enum {number} + * @property {number} SCOPE_UNSPECIFIED=0 SCOPE_UNSPECIFIED value + * @property {number} API=1 API value + * @property {number} VERSION=2 VERSION value + * @property {number} SPEC=3 SPEC value + * @property {number} API_OPERATION=4 API_OPERATION value + * @property {number} DEPLOYMENT=5 DEPLOYMENT value + * @property {number} DEPENDENCY=6 DEPENDENCY value + * @property {number} DEFINITION=7 DEFINITION value + * @property {number} EXTERNAL_API=8 EXTERNAL_API value + * @property {number} PLUGIN=9 PLUGIN value + */ + Attribute.Scope = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SCOPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "API"] = 1; + values[valuesById[2] = "VERSION"] = 2; + values[valuesById[3] = "SPEC"] = 3; + values[valuesById[4] = "API_OPERATION"] = 4; + values[valuesById[5] = "DEPLOYMENT"] = 5; + values[valuesById[6] = "DEPENDENCY"] = 6; + values[valuesById[7] = "DEFINITION"] = 7; + values[valuesById[8] = "EXTERNAL_API"] = 8; + values[valuesById[9] = "PLUGIN"] = 9; + return values; + })(); + + /** + * DataType enum. + * @name google.cloud.apihub.v1.Attribute.DataType + * @enum {number} + * @property {number} DATA_TYPE_UNSPECIFIED=0 DATA_TYPE_UNSPECIFIED value + * @property {number} ENUM=1 ENUM value + * @property {number} JSON=2 JSON value + * @property {number} STRING=3 STRING value + */ + Attribute.DataType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DATA_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ENUM"] = 1; + values[valuesById[2] = "JSON"] = 2; + values[valuesById[3] = "STRING"] = 3; + return values; + })(); + + return Attribute; + })(); + + v1.SpecContents = (function() { + + /** + * Properties of a SpecContents. + * @memberof google.cloud.apihub.v1 + * @interface ISpecContents + * @property {Uint8Array|null} [contents] SpecContents contents + * @property {string|null} [mimeType] SpecContents mimeType + */ + + /** + * Constructs a new SpecContents. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a SpecContents. + * @implements ISpecContents + * @constructor + * @param {google.cloud.apihub.v1.ISpecContents=} [properties] Properties to set + */ + function SpecContents(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]]; + } + + /** + * SpecContents contents. + * @member {Uint8Array} contents + * @memberof google.cloud.apihub.v1.SpecContents + * @instance + */ + SpecContents.prototype.contents = $util.newBuffer([]); + + /** + * SpecContents mimeType. + * @member {string} mimeType + * @memberof google.cloud.apihub.v1.SpecContents + * @instance + */ + SpecContents.prototype.mimeType = ""; + + /** + * Creates a new SpecContents instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.SpecContents + * @static + * @param {google.cloud.apihub.v1.ISpecContents=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.SpecContents} SpecContents instance + */ + SpecContents.create = function create(properties) { + return new SpecContents(properties); + }; + + /** + * Encodes the specified SpecContents message. Does not implicitly {@link google.cloud.apihub.v1.SpecContents.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.SpecContents + * @static + * @param {google.cloud.apihub.v1.ISpecContents} message SpecContents message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpecContents.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.contents != null && Object.hasOwnProperty.call(message, "contents")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.contents); + if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.mimeType); + return writer; + }; + + /** + * Encodes the specified SpecContents message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.SpecContents.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.SpecContents + * @static + * @param {google.cloud.apihub.v1.ISpecContents} message SpecContents message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpecContents.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SpecContents message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.SpecContents + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.SpecContents} SpecContents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpecContents.decode = function 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.apihub.v1.SpecContents(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.contents = reader.bytes(); + break; + } + case 2: { + message.mimeType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SpecContents message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.SpecContents + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.SpecContents} SpecContents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpecContents.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SpecContents message. + * @function verify + * @memberof google.cloud.apihub.v1.SpecContents + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SpecContents.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.contents != null && message.hasOwnProperty("contents")) + if (!(message.contents && typeof message.contents.length === "number" || $util.isString(message.contents))) + return "contents: buffer expected"; + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + if (!$util.isString(message.mimeType)) + return "mimeType: string expected"; + return null; + }; + + /** + * Creates a SpecContents message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.SpecContents + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.SpecContents} SpecContents + */ + SpecContents.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.SpecContents) + return object; + var message = new $root.google.cloud.apihub.v1.SpecContents(); + if (object.contents != null) + if (typeof object.contents === "string") + $util.base64.decode(object.contents, message.contents = $util.newBuffer($util.base64.length(object.contents)), 0); + else if (object.contents.length >= 0) + message.contents = object.contents; + if (object.mimeType != null) + message.mimeType = String(object.mimeType); + return message; + }; + + /** + * Creates a plain object from a SpecContents message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.SpecContents + * @static + * @param {google.cloud.apihub.v1.SpecContents} message SpecContents + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SpecContents.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.contents = ""; + else { + object.contents = []; + if (options.bytes !== Array) + object.contents = $util.newBuffer(object.contents); + } + object.mimeType = ""; + } + if (message.contents != null && message.hasOwnProperty("contents")) + object.contents = options.bytes === String ? $util.base64.encode(message.contents, 0, message.contents.length) : options.bytes === Array ? Array.prototype.slice.call(message.contents) : message.contents; + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + object.mimeType = message.mimeType; + return object; + }; + + /** + * Converts this SpecContents to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.SpecContents + * @instance + * @returns {Object.} JSON object + */ + SpecContents.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SpecContents + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.SpecContents + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SpecContents.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.SpecContents"; + }; + + return SpecContents; + })(); + + v1.SpecDetails = (function() { + + /** + * Properties of a SpecDetails. + * @memberof google.cloud.apihub.v1 + * @interface ISpecDetails + * @property {google.cloud.apihub.v1.IOpenApiSpecDetails|null} [openApiSpecDetails] SpecDetails openApiSpecDetails + * @property {string|null} [description] SpecDetails description + */ + + /** + * Constructs a new SpecDetails. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a SpecDetails. + * @implements ISpecDetails + * @constructor + * @param {google.cloud.apihub.v1.ISpecDetails=} [properties] Properties to set + */ + function SpecDetails(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]]; + } + + /** + * SpecDetails openApiSpecDetails. + * @member {google.cloud.apihub.v1.IOpenApiSpecDetails|null|undefined} openApiSpecDetails + * @memberof google.cloud.apihub.v1.SpecDetails + * @instance + */ + SpecDetails.prototype.openApiSpecDetails = null; + + /** + * SpecDetails description. + * @member {string} description + * @memberof google.cloud.apihub.v1.SpecDetails + * @instance + */ + SpecDetails.prototype.description = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SpecDetails details. + * @member {"openApiSpecDetails"|undefined} details + * @memberof google.cloud.apihub.v1.SpecDetails + * @instance + */ + Object.defineProperty(SpecDetails.prototype, "details", { + get: $util.oneOfGetter($oneOfFields = ["openApiSpecDetails"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SpecDetails instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.SpecDetails + * @static + * @param {google.cloud.apihub.v1.ISpecDetails=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.SpecDetails} SpecDetails instance + */ + SpecDetails.create = function create(properties) { + return new SpecDetails(properties); + }; + + /** + * Encodes the specified SpecDetails message. Does not implicitly {@link google.cloud.apihub.v1.SpecDetails.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.SpecDetails + * @static + * @param {google.cloud.apihub.v1.ISpecDetails} message SpecDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpecDetails.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.description); + if (message.openApiSpecDetails != null && Object.hasOwnProperty.call(message, "openApiSpecDetails")) + $root.google.cloud.apihub.v1.OpenApiSpecDetails.encode(message.openApiSpecDetails, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SpecDetails message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.SpecDetails.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.SpecDetails + * @static + * @param {google.cloud.apihub.v1.ISpecDetails} message SpecDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpecDetails.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SpecDetails message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.SpecDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.SpecDetails} SpecDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpecDetails.decode = function 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.apihub.v1.SpecDetails(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.openApiSpecDetails = $root.google.cloud.apihub.v1.OpenApiSpecDetails.decode(reader, reader.uint32()); + break; + } + case 1: { + message.description = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SpecDetails message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.SpecDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.SpecDetails} SpecDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpecDetails.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SpecDetails message. + * @function verify + * @memberof google.cloud.apihub.v1.SpecDetails + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SpecDetails.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.openApiSpecDetails != null && message.hasOwnProperty("openApiSpecDetails")) { + properties.details = 1; + { + var error = $root.google.cloud.apihub.v1.OpenApiSpecDetails.verify(message.openApiSpecDetails); + if (error) + return "openApiSpecDetails." + error; + } + } + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + return null; + }; + + /** + * Creates a SpecDetails message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.SpecDetails + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.SpecDetails} SpecDetails + */ + SpecDetails.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.SpecDetails) + return object; + var message = new $root.google.cloud.apihub.v1.SpecDetails(); + if (object.openApiSpecDetails != null) { + if (typeof object.openApiSpecDetails !== "object") + throw TypeError(".google.cloud.apihub.v1.SpecDetails.openApiSpecDetails: object expected"); + message.openApiSpecDetails = $root.google.cloud.apihub.v1.OpenApiSpecDetails.fromObject(object.openApiSpecDetails); + } + if (object.description != null) + message.description = String(object.description); + return message; + }; + + /** + * Creates a plain object from a SpecDetails message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.SpecDetails + * @static + * @param {google.cloud.apihub.v1.SpecDetails} message SpecDetails + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SpecDetails.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.description = ""; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.openApiSpecDetails != null && message.hasOwnProperty("openApiSpecDetails")) { + object.openApiSpecDetails = $root.google.cloud.apihub.v1.OpenApiSpecDetails.toObject(message.openApiSpecDetails, options); + if (options.oneofs) + object.details = "openApiSpecDetails"; + } + return object; + }; + + /** + * Converts this SpecDetails to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.SpecDetails + * @instance + * @returns {Object.} JSON object + */ + SpecDetails.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SpecDetails + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.SpecDetails + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SpecDetails.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.SpecDetails"; + }; + + return SpecDetails; + })(); + + v1.OpenApiSpecDetails = (function() { + + /** + * Properties of an OpenApiSpecDetails. + * @memberof google.cloud.apihub.v1 + * @interface IOpenApiSpecDetails + * @property {google.cloud.apihub.v1.OpenApiSpecDetails.Format|null} [format] OpenApiSpecDetails format + * @property {string|null} [version] OpenApiSpecDetails version + * @property {google.cloud.apihub.v1.IOwner|null} [owner] OpenApiSpecDetails owner + */ + + /** + * Constructs a new OpenApiSpecDetails. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents an OpenApiSpecDetails. + * @implements IOpenApiSpecDetails + * @constructor + * @param {google.cloud.apihub.v1.IOpenApiSpecDetails=} [properties] Properties to set + */ + function OpenApiSpecDetails(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]]; + } + + /** + * OpenApiSpecDetails format. + * @member {google.cloud.apihub.v1.OpenApiSpecDetails.Format} format + * @memberof google.cloud.apihub.v1.OpenApiSpecDetails + * @instance + */ + OpenApiSpecDetails.prototype.format = 0; + + /** + * OpenApiSpecDetails version. + * @member {string} version + * @memberof google.cloud.apihub.v1.OpenApiSpecDetails + * @instance + */ + OpenApiSpecDetails.prototype.version = ""; + + /** + * OpenApiSpecDetails owner. + * @member {google.cloud.apihub.v1.IOwner|null|undefined} owner + * @memberof google.cloud.apihub.v1.OpenApiSpecDetails + * @instance + */ + OpenApiSpecDetails.prototype.owner = null; + + /** + * Creates a new OpenApiSpecDetails instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.OpenApiSpecDetails + * @static + * @param {google.cloud.apihub.v1.IOpenApiSpecDetails=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.OpenApiSpecDetails} OpenApiSpecDetails instance + */ + OpenApiSpecDetails.create = function create(properties) { + return new OpenApiSpecDetails(properties); + }; + + /** + * Encodes the specified OpenApiSpecDetails message. Does not implicitly {@link google.cloud.apihub.v1.OpenApiSpecDetails.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.OpenApiSpecDetails + * @static + * @param {google.cloud.apihub.v1.IOpenApiSpecDetails} message OpenApiSpecDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OpenApiSpecDetails.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.format != null && Object.hasOwnProperty.call(message, "format")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.format); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.version); + if (message.owner != null && Object.hasOwnProperty.call(message, "owner")) + $root.google.cloud.apihub.v1.Owner.encode(message.owner, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OpenApiSpecDetails message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.OpenApiSpecDetails.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.OpenApiSpecDetails + * @static + * @param {google.cloud.apihub.v1.IOpenApiSpecDetails} message OpenApiSpecDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OpenApiSpecDetails.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OpenApiSpecDetails message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.OpenApiSpecDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.OpenApiSpecDetails} OpenApiSpecDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OpenApiSpecDetails.decode = function 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.apihub.v1.OpenApiSpecDetails(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.format = reader.int32(); + break; + } + case 2: { + message.version = reader.string(); + break; + } + case 3: { + message.owner = $root.google.cloud.apihub.v1.Owner.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OpenApiSpecDetails message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.OpenApiSpecDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.OpenApiSpecDetails} OpenApiSpecDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OpenApiSpecDetails.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OpenApiSpecDetails message. + * @function verify + * @memberof google.cloud.apihub.v1.OpenApiSpecDetails + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OpenApiSpecDetails.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.format != null && message.hasOwnProperty("format")) + switch (message.format) { + default: + return "format: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.owner != null && message.hasOwnProperty("owner")) { + var error = $root.google.cloud.apihub.v1.Owner.verify(message.owner); + if (error) + return "owner." + error; + } + return null; + }; + + /** + * Creates an OpenApiSpecDetails message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.OpenApiSpecDetails + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.OpenApiSpecDetails} OpenApiSpecDetails + */ + OpenApiSpecDetails.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.OpenApiSpecDetails) + return object; + var message = new $root.google.cloud.apihub.v1.OpenApiSpecDetails(); + switch (object.format) { + default: + if (typeof object.format === "number") { + message.format = object.format; + break; + } + break; + case "FORMAT_UNSPECIFIED": + case 0: + message.format = 0; + break; + case "OPEN_API_SPEC_2_0": + case 1: + message.format = 1; + break; + case "OPEN_API_SPEC_3_0": + case 2: + message.format = 2; + break; + case "OPEN_API_SPEC_3_1": + case 3: + message.format = 3; + break; + } + if (object.version != null) + message.version = String(object.version); + if (object.owner != null) { + if (typeof object.owner !== "object") + throw TypeError(".google.cloud.apihub.v1.OpenApiSpecDetails.owner: object expected"); + message.owner = $root.google.cloud.apihub.v1.Owner.fromObject(object.owner); + } + return message; + }; + + /** + * Creates a plain object from an OpenApiSpecDetails message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.OpenApiSpecDetails + * @static + * @param {google.cloud.apihub.v1.OpenApiSpecDetails} message OpenApiSpecDetails + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OpenApiSpecDetails.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.format = options.enums === String ? "FORMAT_UNSPECIFIED" : 0; + object.version = ""; + object.owner = null; + } + if (message.format != null && message.hasOwnProperty("format")) + object.format = options.enums === String ? $root.google.cloud.apihub.v1.OpenApiSpecDetails.Format[message.format] === undefined ? message.format : $root.google.cloud.apihub.v1.OpenApiSpecDetails.Format[message.format] : message.format; + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.owner != null && message.hasOwnProperty("owner")) + object.owner = $root.google.cloud.apihub.v1.Owner.toObject(message.owner, options); + return object; + }; + + /** + * Converts this OpenApiSpecDetails to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.OpenApiSpecDetails + * @instance + * @returns {Object.} JSON object + */ + OpenApiSpecDetails.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OpenApiSpecDetails + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.OpenApiSpecDetails + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OpenApiSpecDetails.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.OpenApiSpecDetails"; + }; + + /** + * Format enum. + * @name google.cloud.apihub.v1.OpenApiSpecDetails.Format + * @enum {number} + * @property {number} FORMAT_UNSPECIFIED=0 FORMAT_UNSPECIFIED value + * @property {number} OPEN_API_SPEC_2_0=1 OPEN_API_SPEC_2_0 value + * @property {number} OPEN_API_SPEC_3_0=2 OPEN_API_SPEC_3_0 value + * @property {number} OPEN_API_SPEC_3_1=3 OPEN_API_SPEC_3_1 value + */ + OpenApiSpecDetails.Format = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FORMAT_UNSPECIFIED"] = 0; + values[valuesById[1] = "OPEN_API_SPEC_2_0"] = 1; + values[valuesById[2] = "OPEN_API_SPEC_3_0"] = 2; + values[valuesById[3] = "OPEN_API_SPEC_3_1"] = 3; + return values; + })(); + + return OpenApiSpecDetails; + })(); + + v1.OperationDetails = (function() { + + /** + * Properties of an OperationDetails. + * @memberof google.cloud.apihub.v1 + * @interface IOperationDetails + * @property {google.cloud.apihub.v1.IHttpOperation|null} [httpOperation] OperationDetails httpOperation + * @property {string|null} [description] OperationDetails description + * @property {google.cloud.apihub.v1.IDocumentation|null} [documentation] OperationDetails documentation + * @property {boolean|null} [deprecated] OperationDetails deprecated + */ + + /** + * Constructs a new OperationDetails. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents an OperationDetails. + * @implements IOperationDetails + * @constructor + * @param {google.cloud.apihub.v1.IOperationDetails=} [properties] Properties to set + */ + function OperationDetails(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]]; + } + + /** + * OperationDetails httpOperation. + * @member {google.cloud.apihub.v1.IHttpOperation|null|undefined} httpOperation + * @memberof google.cloud.apihub.v1.OperationDetails + * @instance + */ + OperationDetails.prototype.httpOperation = null; + + /** + * OperationDetails description. + * @member {string} description + * @memberof google.cloud.apihub.v1.OperationDetails + * @instance + */ + OperationDetails.prototype.description = ""; + + /** + * OperationDetails documentation. + * @member {google.cloud.apihub.v1.IDocumentation|null|undefined} documentation + * @memberof google.cloud.apihub.v1.OperationDetails + * @instance + */ + OperationDetails.prototype.documentation = null; + + /** + * OperationDetails deprecated. + * @member {boolean} deprecated + * @memberof google.cloud.apihub.v1.OperationDetails + * @instance + */ + OperationDetails.prototype.deprecated = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * OperationDetails operation. + * @member {"httpOperation"|undefined} operation + * @memberof google.cloud.apihub.v1.OperationDetails + * @instance + */ + Object.defineProperty(OperationDetails.prototype, "operation", { + get: $util.oneOfGetter($oneOfFields = ["httpOperation"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new OperationDetails instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.OperationDetails + * @static + * @param {google.cloud.apihub.v1.IOperationDetails=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.OperationDetails} OperationDetails instance + */ + OperationDetails.create = function create(properties) { + return new OperationDetails(properties); + }; + + /** + * Encodes the specified OperationDetails message. Does not implicitly {@link google.cloud.apihub.v1.OperationDetails.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.OperationDetails + * @static + * @param {google.cloud.apihub.v1.IOperationDetails} message OperationDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationDetails.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.description); + if (message.documentation != null && Object.hasOwnProperty.call(message, "documentation")) + $root.google.cloud.apihub.v1.Documentation.encode(message.documentation, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.httpOperation != null && Object.hasOwnProperty.call(message, "httpOperation")) + $root.google.cloud.apihub.v1.HttpOperation.encode(message.httpOperation, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OperationDetails message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.OperationDetails.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.OperationDetails + * @static + * @param {google.cloud.apihub.v1.IOperationDetails} message OperationDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationDetails.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OperationDetails message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.OperationDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.OperationDetails} OperationDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationDetails.decode = function 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.apihub.v1.OperationDetails(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: { + message.httpOperation = $root.google.cloud.apihub.v1.HttpOperation.decode(reader, reader.uint32()); + break; + } + case 1: { + message.description = reader.string(); + break; + } + case 2: { + message.documentation = $root.google.cloud.apihub.v1.Documentation.decode(reader, reader.uint32()); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OperationDetails message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.OperationDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.OperationDetails} OperationDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationDetails.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OperationDetails message. + * @function verify + * @memberof google.cloud.apihub.v1.OperationDetails + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OperationDetails.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.httpOperation != null && message.hasOwnProperty("httpOperation")) { + properties.operation = 1; + { + var error = $root.google.cloud.apihub.v1.HttpOperation.verify(message.httpOperation); + if (error) + return "httpOperation." + error; + } + } + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.documentation != null && message.hasOwnProperty("documentation")) { + var error = $root.google.cloud.apihub.v1.Documentation.verify(message.documentation); + if (error) + return "documentation." + error; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + return null; + }; + + /** + * Creates an OperationDetails message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.OperationDetails + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.OperationDetails} OperationDetails + */ + OperationDetails.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.OperationDetails) + return object; + var message = new $root.google.cloud.apihub.v1.OperationDetails(); + if (object.httpOperation != null) { + if (typeof object.httpOperation !== "object") + throw TypeError(".google.cloud.apihub.v1.OperationDetails.httpOperation: object expected"); + message.httpOperation = $root.google.cloud.apihub.v1.HttpOperation.fromObject(object.httpOperation); + } + if (object.description != null) + message.description = String(object.description); + if (object.documentation != null) { + if (typeof object.documentation !== "object") + throw TypeError(".google.cloud.apihub.v1.OperationDetails.documentation: object expected"); + message.documentation = $root.google.cloud.apihub.v1.Documentation.fromObject(object.documentation); + } + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + return message; + }; + + /** + * Creates a plain object from an OperationDetails message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.OperationDetails + * @static + * @param {google.cloud.apihub.v1.OperationDetails} message OperationDetails + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationDetails.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.description = ""; + object.documentation = null; + object.deprecated = false; + } + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.documentation != null && message.hasOwnProperty("documentation")) + object.documentation = $root.google.cloud.apihub.v1.Documentation.toObject(message.documentation, options); + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.httpOperation != null && message.hasOwnProperty("httpOperation")) { + object.httpOperation = $root.google.cloud.apihub.v1.HttpOperation.toObject(message.httpOperation, options); + if (options.oneofs) + object.operation = "httpOperation"; + } + return object; + }; + + /** + * Converts this OperationDetails to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.OperationDetails + * @instance + * @returns {Object.} JSON object + */ + OperationDetails.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OperationDetails + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.OperationDetails + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OperationDetails.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.OperationDetails"; + }; + + return OperationDetails; + })(); + + v1.HttpOperation = (function() { + + /** + * Properties of a HttpOperation. + * @memberof google.cloud.apihub.v1 + * @interface IHttpOperation + * @property {google.cloud.apihub.v1.IPath|null} [path] HttpOperation path + * @property {google.cloud.apihub.v1.HttpOperation.Method|null} [method] HttpOperation method + */ + + /** + * Constructs a new HttpOperation. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a HttpOperation. + * @implements IHttpOperation + * @constructor + * @param {google.cloud.apihub.v1.IHttpOperation=} [properties] Properties to set + */ + function HttpOperation(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]]; + } + + /** + * HttpOperation path. + * @member {google.cloud.apihub.v1.IPath|null|undefined} path + * @memberof google.cloud.apihub.v1.HttpOperation + * @instance + */ + HttpOperation.prototype.path = null; + + /** + * HttpOperation method. + * @member {google.cloud.apihub.v1.HttpOperation.Method} method + * @memberof google.cloud.apihub.v1.HttpOperation + * @instance + */ + HttpOperation.prototype.method = 0; + + /** + * Creates a new HttpOperation instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.HttpOperation + * @static + * @param {google.cloud.apihub.v1.IHttpOperation=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.HttpOperation} HttpOperation instance + */ + HttpOperation.create = function create(properties) { + return new HttpOperation(properties); + }; + + /** + * Encodes the specified HttpOperation message. Does not implicitly {@link google.cloud.apihub.v1.HttpOperation.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.HttpOperation + * @static + * @param {google.cloud.apihub.v1.IHttpOperation} message HttpOperation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpOperation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + $root.google.cloud.apihub.v1.Path.encode(message.path, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.method != null && Object.hasOwnProperty.call(message, "method")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.method); + return writer; + }; + + /** + * Encodes the specified HttpOperation message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.HttpOperation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.HttpOperation + * @static + * @param {google.cloud.apihub.v1.IHttpOperation} message HttpOperation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpOperation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HttpOperation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.HttpOperation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.HttpOperation} HttpOperation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpOperation.decode = function 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.apihub.v1.HttpOperation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.path = $root.google.cloud.apihub.v1.Path.decode(reader, reader.uint32()); + break; + } + case 2: { + message.method = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HttpOperation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.HttpOperation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.HttpOperation} HttpOperation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpOperation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HttpOperation message. + * @function verify + * @memberof google.cloud.apihub.v1.HttpOperation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HttpOperation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + var error = $root.google.cloud.apihub.v1.Path.verify(message.path); + if (error) + return "path." + error; + } + if (message.method != null && message.hasOwnProperty("method")) + switch (message.method) { + default: + return "method: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + break; + } + return null; + }; + + /** + * Creates a HttpOperation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.HttpOperation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.HttpOperation} HttpOperation + */ + HttpOperation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.HttpOperation) + return object; + var message = new $root.google.cloud.apihub.v1.HttpOperation(); + if (object.path != null) { + if (typeof object.path !== "object") + throw TypeError(".google.cloud.apihub.v1.HttpOperation.path: object expected"); + message.path = $root.google.cloud.apihub.v1.Path.fromObject(object.path); + } + switch (object.method) { + default: + if (typeof object.method === "number") { + message.method = object.method; + break; + } + break; + case "METHOD_UNSPECIFIED": + case 0: + message.method = 0; + break; + case "GET": + case 1: + message.method = 1; + break; + case "PUT": + case 2: + message.method = 2; + break; + case "POST": + case 3: + message.method = 3; + break; + case "DELETE": + case 4: + message.method = 4; + break; + case "OPTIONS": + case 5: + message.method = 5; + break; + case "HEAD": + case 6: + message.method = 6; + break; + case "PATCH": + case 7: + message.method = 7; + break; + case "TRACE": + case 8: + message.method = 8; + break; + } + return message; + }; + + /** + * Creates a plain object from a HttpOperation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.HttpOperation + * @static + * @param {google.cloud.apihub.v1.HttpOperation} message HttpOperation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HttpOperation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.path = null; + object.method = options.enums === String ? "METHOD_UNSPECIFIED" : 0; + } + if (message.path != null && message.hasOwnProperty("path")) + object.path = $root.google.cloud.apihub.v1.Path.toObject(message.path, options); + if (message.method != null && message.hasOwnProperty("method")) + object.method = options.enums === String ? $root.google.cloud.apihub.v1.HttpOperation.Method[message.method] === undefined ? message.method : $root.google.cloud.apihub.v1.HttpOperation.Method[message.method] : message.method; + return object; + }; + + /** + * Converts this HttpOperation to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.HttpOperation + * @instance + * @returns {Object.} JSON object + */ + HttpOperation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HttpOperation + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.HttpOperation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HttpOperation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.HttpOperation"; + }; + + /** + * Method enum. + * @name google.cloud.apihub.v1.HttpOperation.Method + * @enum {number} + * @property {number} METHOD_UNSPECIFIED=0 METHOD_UNSPECIFIED value + * @property {number} GET=1 GET value + * @property {number} PUT=2 PUT value + * @property {number} POST=3 POST value + * @property {number} DELETE=4 DELETE value + * @property {number} OPTIONS=5 OPTIONS value + * @property {number} HEAD=6 HEAD value + * @property {number} PATCH=7 PATCH value + * @property {number} TRACE=8 TRACE value + */ + HttpOperation.Method = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "METHOD_UNSPECIFIED"] = 0; + values[valuesById[1] = "GET"] = 1; + values[valuesById[2] = "PUT"] = 2; + values[valuesById[3] = "POST"] = 3; + values[valuesById[4] = "DELETE"] = 4; + values[valuesById[5] = "OPTIONS"] = 5; + values[valuesById[6] = "HEAD"] = 6; + values[valuesById[7] = "PATCH"] = 7; + values[valuesById[8] = "TRACE"] = 8; + return values; + })(); + + return HttpOperation; + })(); + + v1.Path = (function() { + + /** + * Properties of a Path. + * @memberof google.cloud.apihub.v1 + * @interface IPath + * @property {string|null} [path] Path path + * @property {string|null} [description] Path description + */ + + /** + * Constructs a new Path. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a Path. + * @implements IPath + * @constructor + * @param {google.cloud.apihub.v1.IPath=} [properties] Properties to set + */ + function Path(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]]; + } + + /** + * Path path. + * @member {string} path + * @memberof google.cloud.apihub.v1.Path + * @instance + */ + Path.prototype.path = ""; + + /** + * Path description. + * @member {string} description + * @memberof google.cloud.apihub.v1.Path + * @instance + */ + Path.prototype.description = ""; + + /** + * Creates a new Path instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.Path + * @static + * @param {google.cloud.apihub.v1.IPath=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.Path} Path instance + */ + Path.create = function create(properties) { + return new Path(properties); + }; + + /** + * Encodes the specified Path message. Does not implicitly {@link google.cloud.apihub.v1.Path.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.Path + * @static + * @param {google.cloud.apihub.v1.IPath} message Path message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Path.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.path); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + return writer; + }; + + /** + * Encodes the specified Path message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.Path.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.Path + * @static + * @param {google.cloud.apihub.v1.IPath} message Path message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Path.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Path message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.Path + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.Path} Path + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Path.decode = function 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.apihub.v1.Path(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.path = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Path message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.Path + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.Path} Path + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Path.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Path message. + * @function verify + * @memberof google.cloud.apihub.v1.Path + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Path.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + return null; + }; + + /** + * Creates a Path message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.Path + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.Path} Path + */ + Path.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.Path) + return object; + var message = new $root.google.cloud.apihub.v1.Path(); + if (object.path != null) + message.path = String(object.path); + if (object.description != null) + message.description = String(object.description); + return message; + }; + + /** + * Creates a plain object from a Path message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.Path + * @static + * @param {google.cloud.apihub.v1.Path} message Path + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Path.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.path = ""; + object.description = ""; + } + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + return object; + }; + + /** + * Converts this Path to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.Path + * @instance + * @returns {Object.} JSON object + */ + Path.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Path + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.Path + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Path.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.Path"; + }; + + return Path; + })(); + + v1.Schema = (function() { + + /** + * Properties of a Schema. + * @memberof google.cloud.apihub.v1 + * @interface ISchema + * @property {string|null} [displayName] Schema displayName + * @property {Uint8Array|null} [rawValue] Schema rawValue + */ + + /** + * Constructs a new Schema. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a Schema. + * @implements ISchema + * @constructor + * @param {google.cloud.apihub.v1.ISchema=} [properties] Properties to set + */ + function Schema(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]]; + } + + /** + * Schema displayName. + * @member {string} displayName + * @memberof google.cloud.apihub.v1.Schema + * @instance + */ + Schema.prototype.displayName = ""; + + /** + * Schema rawValue. + * @member {Uint8Array} rawValue + * @memberof google.cloud.apihub.v1.Schema + * @instance + */ + Schema.prototype.rawValue = $util.newBuffer([]); + + /** + * Creates a new Schema instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.Schema + * @static + * @param {google.cloud.apihub.v1.ISchema=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.Schema} Schema instance + */ + Schema.create = function create(properties) { + return new Schema(properties); + }; + + /** + * Encodes the specified Schema message. Does not implicitly {@link google.cloud.apihub.v1.Schema.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.Schema + * @static + * @param {google.cloud.apihub.v1.ISchema} message Schema message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Schema.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.displayName); + if (message.rawValue != null && Object.hasOwnProperty.call(message, "rawValue")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.rawValue); + return writer; + }; + + /** + * Encodes the specified Schema message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.Schema.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.Schema + * @static + * @param {google.cloud.apihub.v1.ISchema} message Schema message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Schema.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Schema message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.Schema + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.Schema} Schema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Schema.decode = function 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.apihub.v1.Schema(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.displayName = reader.string(); + break; + } + case 2: { + message.rawValue = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Schema message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.Schema + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.Schema} Schema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Schema.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Schema message. + * @function verify + * @memberof google.cloud.apihub.v1.Schema + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Schema.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.rawValue != null && message.hasOwnProperty("rawValue")) + if (!(message.rawValue && typeof message.rawValue.length === "number" || $util.isString(message.rawValue))) + return "rawValue: buffer expected"; + return null; + }; + + /** + * Creates a Schema message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.Schema + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.Schema} Schema + */ + Schema.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.Schema) + return object; + var message = new $root.google.cloud.apihub.v1.Schema(); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.rawValue != null) + if (typeof object.rawValue === "string") + $util.base64.decode(object.rawValue, message.rawValue = $util.newBuffer($util.base64.length(object.rawValue)), 0); + else if (object.rawValue.length >= 0) + message.rawValue = object.rawValue; + return message; + }; + + /** + * Creates a plain object from a Schema message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.Schema + * @static + * @param {google.cloud.apihub.v1.Schema} message Schema + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Schema.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.displayName = ""; + if (options.bytes === String) + object.rawValue = ""; + else { + object.rawValue = []; + if (options.bytes !== Array) + object.rawValue = $util.newBuffer(object.rawValue); + } + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.rawValue != null && message.hasOwnProperty("rawValue")) + object.rawValue = options.bytes === String ? $util.base64.encode(message.rawValue, 0, message.rawValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.rawValue) : message.rawValue; + return object; + }; + + /** + * Converts this Schema to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.Schema + * @instance + * @returns {Object.} JSON object + */ + Schema.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Schema + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.Schema + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Schema.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.Schema"; + }; + + return Schema; + })(); + + v1.Owner = (function() { + + /** + * Properties of an Owner. + * @memberof google.cloud.apihub.v1 + * @interface IOwner + * @property {string|null} [displayName] Owner displayName + * @property {string|null} [email] Owner email + */ + + /** + * Constructs a new Owner. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents an Owner. + * @implements IOwner + * @constructor + * @param {google.cloud.apihub.v1.IOwner=} [properties] Properties to set + */ + function Owner(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]]; + } + + /** + * Owner displayName. + * @member {string} displayName + * @memberof google.cloud.apihub.v1.Owner + * @instance + */ + Owner.prototype.displayName = ""; + + /** + * Owner email. + * @member {string} email + * @memberof google.cloud.apihub.v1.Owner + * @instance + */ + Owner.prototype.email = ""; + + /** + * Creates a new Owner instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.Owner + * @static + * @param {google.cloud.apihub.v1.IOwner=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.Owner} Owner instance + */ + Owner.create = function create(properties) { + return new Owner(properties); + }; + + /** + * Encodes the specified Owner message. Does not implicitly {@link google.cloud.apihub.v1.Owner.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.Owner + * @static + * @param {google.cloud.apihub.v1.IOwner} message Owner message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Owner.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.displayName); + if (message.email != null && Object.hasOwnProperty.call(message, "email")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.email); + return writer; + }; + + /** + * Encodes the specified Owner message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.Owner.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.Owner + * @static + * @param {google.cloud.apihub.v1.IOwner} message Owner message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Owner.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Owner message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.Owner + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.Owner} Owner + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Owner.decode = function 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.apihub.v1.Owner(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.displayName = reader.string(); + break; + } + case 2: { + message.email = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Owner message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.Owner + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.Owner} Owner + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Owner.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Owner message. + * @function verify + * @memberof google.cloud.apihub.v1.Owner + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Owner.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.email != null && message.hasOwnProperty("email")) + if (!$util.isString(message.email)) + return "email: string expected"; + return null; + }; + + /** + * Creates an Owner message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.Owner + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.Owner} Owner + */ + Owner.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.Owner) + return object; + var message = new $root.google.cloud.apihub.v1.Owner(); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.email != null) + message.email = String(object.email); + return message; + }; + + /** + * Creates a plain object from an Owner message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.Owner + * @static + * @param {google.cloud.apihub.v1.Owner} message Owner + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Owner.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.displayName = ""; + object.email = ""; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.email != null && message.hasOwnProperty("email")) + object.email = message.email; + return object; + }; + + /** + * Converts this Owner to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.Owner + * @instance + * @returns {Object.} JSON object + */ + Owner.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Owner + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.Owner + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Owner.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.Owner"; + }; + + return Owner; + })(); + + v1.Documentation = (function() { + + /** + * Properties of a Documentation. + * @memberof google.cloud.apihub.v1 + * @interface IDocumentation + * @property {string|null} [externalUri] Documentation externalUri + */ + + /** + * Constructs a new Documentation. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a Documentation. + * @implements IDocumentation + * @constructor + * @param {google.cloud.apihub.v1.IDocumentation=} [properties] Properties to set + */ + function Documentation(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]]; + } + + /** + * Documentation externalUri. + * @member {string} externalUri + * @memberof google.cloud.apihub.v1.Documentation + * @instance + */ + Documentation.prototype.externalUri = ""; + + /** + * Creates a new Documentation instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.Documentation + * @static + * @param {google.cloud.apihub.v1.IDocumentation=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.Documentation} Documentation instance + */ + Documentation.create = function create(properties) { + return new Documentation(properties); + }; + + /** + * Encodes the specified Documentation message. Does not implicitly {@link google.cloud.apihub.v1.Documentation.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.Documentation + * @static + * @param {google.cloud.apihub.v1.IDocumentation} message Documentation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Documentation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.externalUri != null && Object.hasOwnProperty.call(message, "externalUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.externalUri); + return writer; + }; + + /** + * Encodes the specified Documentation message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.Documentation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.Documentation + * @static + * @param {google.cloud.apihub.v1.IDocumentation} message Documentation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Documentation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Documentation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.Documentation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.Documentation} Documentation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Documentation.decode = function 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.apihub.v1.Documentation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.externalUri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Documentation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.Documentation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.Documentation} Documentation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Documentation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Documentation message. + * @function verify + * @memberof google.cloud.apihub.v1.Documentation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Documentation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.externalUri != null && message.hasOwnProperty("externalUri")) + if (!$util.isString(message.externalUri)) + return "externalUri: string expected"; + return null; + }; + + /** + * Creates a Documentation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.Documentation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.Documentation} Documentation + */ + Documentation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.Documentation) + return object; + var message = new $root.google.cloud.apihub.v1.Documentation(); + if (object.externalUri != null) + message.externalUri = String(object.externalUri); + return message; + }; + + /** + * Creates a plain object from a Documentation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.Documentation + * @static + * @param {google.cloud.apihub.v1.Documentation} message Documentation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Documentation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.externalUri = ""; + if (message.externalUri != null && message.hasOwnProperty("externalUri")) + object.externalUri = message.externalUri; + return object; + }; + + /** + * Converts this Documentation to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.Documentation + * @instance + * @returns {Object.} JSON object + */ + Documentation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Documentation + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.Documentation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Documentation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.Documentation"; + }; + + return Documentation; + })(); + + v1.AttributeValues = (function() { + + /** + * Properties of an AttributeValues. + * @memberof google.cloud.apihub.v1 + * @interface IAttributeValues + * @property {google.cloud.apihub.v1.AttributeValues.IEnumAttributeValues|null} [enumValues] AttributeValues enumValues + * @property {google.cloud.apihub.v1.AttributeValues.IStringAttributeValues|null} [stringValues] AttributeValues stringValues + * @property {google.cloud.apihub.v1.AttributeValues.IStringAttributeValues|null} [jsonValues] AttributeValues jsonValues + * @property {string|null} [attribute] AttributeValues attribute + */ + + /** + * Constructs a new AttributeValues. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents an AttributeValues. + * @implements IAttributeValues + * @constructor + * @param {google.cloud.apihub.v1.IAttributeValues=} [properties] Properties to set + */ + function AttributeValues(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]]; + } + + /** + * AttributeValues enumValues. + * @member {google.cloud.apihub.v1.AttributeValues.IEnumAttributeValues|null|undefined} enumValues + * @memberof google.cloud.apihub.v1.AttributeValues + * @instance + */ + AttributeValues.prototype.enumValues = null; + + /** + * AttributeValues stringValues. + * @member {google.cloud.apihub.v1.AttributeValues.IStringAttributeValues|null|undefined} stringValues + * @memberof google.cloud.apihub.v1.AttributeValues + * @instance + */ + AttributeValues.prototype.stringValues = null; + + /** + * AttributeValues jsonValues. + * @member {google.cloud.apihub.v1.AttributeValues.IStringAttributeValues|null|undefined} jsonValues + * @memberof google.cloud.apihub.v1.AttributeValues + * @instance + */ + AttributeValues.prototype.jsonValues = null; + + /** + * AttributeValues attribute. + * @member {string} attribute + * @memberof google.cloud.apihub.v1.AttributeValues + * @instance + */ + AttributeValues.prototype.attribute = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AttributeValues Value. + * @member {"enumValues"|"stringValues"|"jsonValues"|undefined} Value + * @memberof google.cloud.apihub.v1.AttributeValues + * @instance + */ + Object.defineProperty(AttributeValues.prototype, "Value", { + get: $util.oneOfGetter($oneOfFields = ["enumValues", "stringValues", "jsonValues"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AttributeValues instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.AttributeValues + * @static + * @param {google.cloud.apihub.v1.IAttributeValues=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.AttributeValues} AttributeValues instance + */ + AttributeValues.create = function create(properties) { + return new AttributeValues(properties); + }; + + /** + * Encodes the specified AttributeValues message. Does not implicitly {@link google.cloud.apihub.v1.AttributeValues.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.AttributeValues + * @static + * @param {google.cloud.apihub.v1.IAttributeValues} message AttributeValues message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AttributeValues.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.attribute != null && Object.hasOwnProperty.call(message, "attribute")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.attribute); + if (message.enumValues != null && Object.hasOwnProperty.call(message, "enumValues")) + $root.google.cloud.apihub.v1.AttributeValues.EnumAttributeValues.encode(message.enumValues, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.stringValues != null && Object.hasOwnProperty.call(message, "stringValues")) + $root.google.cloud.apihub.v1.AttributeValues.StringAttributeValues.encode(message.stringValues, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.jsonValues != null && Object.hasOwnProperty.call(message, "jsonValues")) + $root.google.cloud.apihub.v1.AttributeValues.StringAttributeValues.encode(message.jsonValues, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AttributeValues message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.AttributeValues.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.AttributeValues + * @static + * @param {google.cloud.apihub.v1.IAttributeValues} message AttributeValues message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AttributeValues.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AttributeValues message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.AttributeValues + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.AttributeValues} AttributeValues + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AttributeValues.decode = function 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.apihub.v1.AttributeValues(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.enumValues = $root.google.cloud.apihub.v1.AttributeValues.EnumAttributeValues.decode(reader, reader.uint32()); + break; + } + case 3: { + message.stringValues = $root.google.cloud.apihub.v1.AttributeValues.StringAttributeValues.decode(reader, reader.uint32()); + break; + } + case 4: { + message.jsonValues = $root.google.cloud.apihub.v1.AttributeValues.StringAttributeValues.decode(reader, reader.uint32()); + break; + } + case 1: { + message.attribute = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AttributeValues message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.AttributeValues + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.AttributeValues} AttributeValues + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AttributeValues.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AttributeValues message. + * @function verify + * @memberof google.cloud.apihub.v1.AttributeValues + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AttributeValues.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.enumValues != null && message.hasOwnProperty("enumValues")) { + properties.Value = 1; + { + var error = $root.google.cloud.apihub.v1.AttributeValues.EnumAttributeValues.verify(message.enumValues); + if (error) + return "enumValues." + error; + } + } + if (message.stringValues != null && message.hasOwnProperty("stringValues")) { + if (properties.Value === 1) + return "Value: multiple values"; + properties.Value = 1; + { + var error = $root.google.cloud.apihub.v1.AttributeValues.StringAttributeValues.verify(message.stringValues); + if (error) + return "stringValues." + error; + } + } + if (message.jsonValues != null && message.hasOwnProperty("jsonValues")) { + if (properties.Value === 1) + return "Value: multiple values"; + properties.Value = 1; + { + var error = $root.google.cloud.apihub.v1.AttributeValues.StringAttributeValues.verify(message.jsonValues); + if (error) + return "jsonValues." + error; + } + } + if (message.attribute != null && message.hasOwnProperty("attribute")) + if (!$util.isString(message.attribute)) + return "attribute: string expected"; + return null; + }; + + /** + * Creates an AttributeValues message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.AttributeValues + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.AttributeValues} AttributeValues + */ + AttributeValues.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.AttributeValues) + return object; + var message = new $root.google.cloud.apihub.v1.AttributeValues(); + if (object.enumValues != null) { + if (typeof object.enumValues !== "object") + throw TypeError(".google.cloud.apihub.v1.AttributeValues.enumValues: object expected"); + message.enumValues = $root.google.cloud.apihub.v1.AttributeValues.EnumAttributeValues.fromObject(object.enumValues); + } + if (object.stringValues != null) { + if (typeof object.stringValues !== "object") + throw TypeError(".google.cloud.apihub.v1.AttributeValues.stringValues: object expected"); + message.stringValues = $root.google.cloud.apihub.v1.AttributeValues.StringAttributeValues.fromObject(object.stringValues); + } + if (object.jsonValues != null) { + if (typeof object.jsonValues !== "object") + throw TypeError(".google.cloud.apihub.v1.AttributeValues.jsonValues: object expected"); + message.jsonValues = $root.google.cloud.apihub.v1.AttributeValues.StringAttributeValues.fromObject(object.jsonValues); + } + if (object.attribute != null) + message.attribute = String(object.attribute); + return message; + }; + + /** + * Creates a plain object from an AttributeValues message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.AttributeValues + * @static + * @param {google.cloud.apihub.v1.AttributeValues} message AttributeValues + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AttributeValues.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.attribute = ""; + if (message.attribute != null && message.hasOwnProperty("attribute")) + object.attribute = message.attribute; + if (message.enumValues != null && message.hasOwnProperty("enumValues")) { + object.enumValues = $root.google.cloud.apihub.v1.AttributeValues.EnumAttributeValues.toObject(message.enumValues, options); + if (options.oneofs) + object.Value = "enumValues"; + } + if (message.stringValues != null && message.hasOwnProperty("stringValues")) { + object.stringValues = $root.google.cloud.apihub.v1.AttributeValues.StringAttributeValues.toObject(message.stringValues, options); + if (options.oneofs) + object.Value = "stringValues"; + } + if (message.jsonValues != null && message.hasOwnProperty("jsonValues")) { + object.jsonValues = $root.google.cloud.apihub.v1.AttributeValues.StringAttributeValues.toObject(message.jsonValues, options); + if (options.oneofs) + object.Value = "jsonValues"; + } + return object; + }; + + /** + * Converts this AttributeValues to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.AttributeValues + * @instance + * @returns {Object.} JSON object + */ + AttributeValues.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AttributeValues + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.AttributeValues + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AttributeValues.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.AttributeValues"; + }; + + AttributeValues.EnumAttributeValues = (function() { + + /** + * Properties of an EnumAttributeValues. + * @memberof google.cloud.apihub.v1.AttributeValues + * @interface IEnumAttributeValues + * @property {Array.|null} [values] EnumAttributeValues values + */ + + /** + * Constructs a new EnumAttributeValues. + * @memberof google.cloud.apihub.v1.AttributeValues + * @classdesc Represents an EnumAttributeValues. + * @implements IEnumAttributeValues + * @constructor + * @param {google.cloud.apihub.v1.AttributeValues.IEnumAttributeValues=} [properties] Properties to set + */ + function EnumAttributeValues(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]]; + } + + /** + * EnumAttributeValues values. + * @member {Array.} values + * @memberof google.cloud.apihub.v1.AttributeValues.EnumAttributeValues + * @instance + */ + EnumAttributeValues.prototype.values = $util.emptyArray; + + /** + * Creates a new EnumAttributeValues instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.AttributeValues.EnumAttributeValues + * @static + * @param {google.cloud.apihub.v1.AttributeValues.IEnumAttributeValues=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.AttributeValues.EnumAttributeValues} EnumAttributeValues instance + */ + EnumAttributeValues.create = function create(properties) { + return new EnumAttributeValues(properties); + }; + + /** + * Encodes the specified EnumAttributeValues message. Does not implicitly {@link google.cloud.apihub.v1.AttributeValues.EnumAttributeValues.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.AttributeValues.EnumAttributeValues + * @static + * @param {google.cloud.apihub.v1.AttributeValues.IEnumAttributeValues} message EnumAttributeValues message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumAttributeValues.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.cloud.apihub.v1.Attribute.AllowedValue.encode(message.values[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumAttributeValues message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.AttributeValues.EnumAttributeValues.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.AttributeValues.EnumAttributeValues + * @static + * @param {google.cloud.apihub.v1.AttributeValues.IEnumAttributeValues} message EnumAttributeValues message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumAttributeValues.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumAttributeValues message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.AttributeValues.EnumAttributeValues + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.AttributeValues.EnumAttributeValues} EnumAttributeValues + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumAttributeValues.decode = function 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.apihub.v1.AttributeValues.EnumAttributeValues(); + 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.cloud.apihub.v1.Attribute.AllowedValue.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumAttributeValues message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.AttributeValues.EnumAttributeValues + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.AttributeValues.EnumAttributeValues} EnumAttributeValues + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumAttributeValues.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumAttributeValues message. + * @function verify + * @memberof google.cloud.apihub.v1.AttributeValues.EnumAttributeValues + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumAttributeValues.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.cloud.apihub.v1.Attribute.AllowedValue.verify(message.values[i]); + if (error) + return "values." + error; + } + } + return null; + }; + + /** + * Creates an EnumAttributeValues message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.AttributeValues.EnumAttributeValues + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.AttributeValues.EnumAttributeValues} EnumAttributeValues + */ + EnumAttributeValues.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.AttributeValues.EnumAttributeValues) + return object; + var message = new $root.google.cloud.apihub.v1.AttributeValues.EnumAttributeValues(); + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.cloud.apihub.v1.AttributeValues.EnumAttributeValues.values: array expected"); + message.values = []; + for (var i = 0; i < object.values.length; ++i) { + if (typeof object.values[i] !== "object") + throw TypeError(".google.cloud.apihub.v1.AttributeValues.EnumAttributeValues.values: object expected"); + message.values[i] = $root.google.cloud.apihub.v1.Attribute.AllowedValue.fromObject(object.values[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumAttributeValues message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.AttributeValues.EnumAttributeValues + * @static + * @param {google.cloud.apihub.v1.AttributeValues.EnumAttributeValues} message EnumAttributeValues + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumAttributeValues.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.cloud.apihub.v1.Attribute.AllowedValue.toObject(message.values[j], options); + } + return object; + }; + + /** + * Converts this EnumAttributeValues to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.AttributeValues.EnumAttributeValues + * @instance + * @returns {Object.} JSON object + */ + EnumAttributeValues.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumAttributeValues + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.AttributeValues.EnumAttributeValues + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumAttributeValues.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.AttributeValues.EnumAttributeValues"; + }; + + return EnumAttributeValues; + })(); + + AttributeValues.StringAttributeValues = (function() { + + /** + * Properties of a StringAttributeValues. + * @memberof google.cloud.apihub.v1.AttributeValues + * @interface IStringAttributeValues + * @property {Array.|null} [values] StringAttributeValues values + */ + + /** + * Constructs a new StringAttributeValues. + * @memberof google.cloud.apihub.v1.AttributeValues + * @classdesc Represents a StringAttributeValues. + * @implements IStringAttributeValues + * @constructor + * @param {google.cloud.apihub.v1.AttributeValues.IStringAttributeValues=} [properties] Properties to set + */ + function StringAttributeValues(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]]; + } + + /** + * StringAttributeValues values. + * @member {Array.} values + * @memberof google.cloud.apihub.v1.AttributeValues.StringAttributeValues + * @instance + */ + StringAttributeValues.prototype.values = $util.emptyArray; + + /** + * Creates a new StringAttributeValues instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.AttributeValues.StringAttributeValues + * @static + * @param {google.cloud.apihub.v1.AttributeValues.IStringAttributeValues=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.AttributeValues.StringAttributeValues} StringAttributeValues instance + */ + StringAttributeValues.create = function create(properties) { + return new StringAttributeValues(properties); + }; + + /** + * Encodes the specified StringAttributeValues message. Does not implicitly {@link google.cloud.apihub.v1.AttributeValues.StringAttributeValues.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.AttributeValues.StringAttributeValues + * @static + * @param {google.cloud.apihub.v1.AttributeValues.IStringAttributeValues} message StringAttributeValues message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringAttributeValues.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) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.values[i]); + return writer; + }; + + /** + * Encodes the specified StringAttributeValues message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.AttributeValues.StringAttributeValues.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.AttributeValues.StringAttributeValues + * @static + * @param {google.cloud.apihub.v1.AttributeValues.IStringAttributeValues} message StringAttributeValues message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringAttributeValues.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StringAttributeValues message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.AttributeValues.StringAttributeValues + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.AttributeValues.StringAttributeValues} StringAttributeValues + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringAttributeValues.decode = function 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.apihub.v1.AttributeValues.StringAttributeValues(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.values && message.values.length)) + message.values = []; + message.values.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StringAttributeValues message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.AttributeValues.StringAttributeValues + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.AttributeValues.StringAttributeValues} StringAttributeValues + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringAttributeValues.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StringAttributeValues message. + * @function verify + * @memberof google.cloud.apihub.v1.AttributeValues.StringAttributeValues + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StringAttributeValues.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) + if (!$util.isString(message.values[i])) + return "values: string[] expected"; + } + return null; + }; + + /** + * Creates a StringAttributeValues message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.AttributeValues.StringAttributeValues + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.AttributeValues.StringAttributeValues} StringAttributeValues + */ + StringAttributeValues.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.AttributeValues.StringAttributeValues) + return object; + var message = new $root.google.cloud.apihub.v1.AttributeValues.StringAttributeValues(); + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.cloud.apihub.v1.AttributeValues.StringAttributeValues.values: array expected"); + message.values = []; + for (var i = 0; i < object.values.length; ++i) + message.values[i] = String(object.values[i]); + } + return message; + }; + + /** + * Creates a plain object from a StringAttributeValues message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.AttributeValues.StringAttributeValues + * @static + * @param {google.cloud.apihub.v1.AttributeValues.StringAttributeValues} message StringAttributeValues + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StringAttributeValues.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] = message.values[j]; + } + return object; + }; + + /** + * Converts this StringAttributeValues to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.AttributeValues.StringAttributeValues + * @instance + * @returns {Object.} JSON object + */ + StringAttributeValues.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StringAttributeValues + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.AttributeValues.StringAttributeValues + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StringAttributeValues.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.AttributeValues.StringAttributeValues"; + }; + + return StringAttributeValues; + })(); + + return AttributeValues; + })(); + + v1.Dependency = (function() { + + /** + * Properties of a Dependency. + * @memberof google.cloud.apihub.v1 + * @interface IDependency + * @property {string|null} [name] Dependency name + * @property {google.cloud.apihub.v1.IDependencyEntityReference|null} [consumer] Dependency consumer + * @property {google.cloud.apihub.v1.IDependencyEntityReference|null} [supplier] Dependency supplier + * @property {google.cloud.apihub.v1.Dependency.State|null} [state] Dependency state + * @property {string|null} [description] Dependency description + * @property {google.cloud.apihub.v1.Dependency.DiscoveryMode|null} [discoveryMode] Dependency discoveryMode + * @property {google.cloud.apihub.v1.IDependencyErrorDetail|null} [errorDetail] Dependency errorDetail + * @property {google.protobuf.ITimestamp|null} [createTime] Dependency createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Dependency updateTime + * @property {Object.|null} [attributes] Dependency attributes + */ + + /** + * Constructs a new Dependency. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a Dependency. + * @implements IDependency + * @constructor + * @param {google.cloud.apihub.v1.IDependency=} [properties] Properties to set + */ + function Dependency(properties) { + this.attributes = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Dependency name. + * @member {string} name + * @memberof google.cloud.apihub.v1.Dependency + * @instance + */ + Dependency.prototype.name = ""; + + /** + * Dependency consumer. + * @member {google.cloud.apihub.v1.IDependencyEntityReference|null|undefined} consumer + * @memberof google.cloud.apihub.v1.Dependency + * @instance + */ + Dependency.prototype.consumer = null; + + /** + * Dependency supplier. + * @member {google.cloud.apihub.v1.IDependencyEntityReference|null|undefined} supplier + * @memberof google.cloud.apihub.v1.Dependency + * @instance + */ + Dependency.prototype.supplier = null; + + /** + * Dependency state. + * @member {google.cloud.apihub.v1.Dependency.State} state + * @memberof google.cloud.apihub.v1.Dependency + * @instance + */ + Dependency.prototype.state = 0; + + /** + * Dependency description. + * @member {string} description + * @memberof google.cloud.apihub.v1.Dependency + * @instance + */ + Dependency.prototype.description = ""; + + /** + * Dependency discoveryMode. + * @member {google.cloud.apihub.v1.Dependency.DiscoveryMode} discoveryMode + * @memberof google.cloud.apihub.v1.Dependency + * @instance + */ + Dependency.prototype.discoveryMode = 0; + + /** + * Dependency errorDetail. + * @member {google.cloud.apihub.v1.IDependencyErrorDetail|null|undefined} errorDetail + * @memberof google.cloud.apihub.v1.Dependency + * @instance + */ + Dependency.prototype.errorDetail = null; + + /** + * Dependency createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.apihub.v1.Dependency + * @instance + */ + Dependency.prototype.createTime = null; + + /** + * Dependency updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.apihub.v1.Dependency + * @instance + */ + Dependency.prototype.updateTime = null; + + /** + * Dependency attributes. + * @member {Object.} attributes + * @memberof google.cloud.apihub.v1.Dependency + * @instance + */ + Dependency.prototype.attributes = $util.emptyObject; + + /** + * Creates a new Dependency instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.Dependency + * @static + * @param {google.cloud.apihub.v1.IDependency=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.Dependency} Dependency instance + */ + Dependency.create = function create(properties) { + return new Dependency(properties); + }; + + /** + * Encodes the specified Dependency message. Does not implicitly {@link google.cloud.apihub.v1.Dependency.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.Dependency + * @static + * @param {google.cloud.apihub.v1.IDependency} message Dependency message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Dependency.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.consumer != null && Object.hasOwnProperty.call(message, "consumer")) + $root.google.cloud.apihub.v1.DependencyEntityReference.encode(message.consumer, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.supplier != null && Object.hasOwnProperty.call(message, "supplier")) + $root.google.cloud.apihub.v1.DependencyEntityReference.encode(message.supplier, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.state); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.description); + if (message.discoveryMode != null && Object.hasOwnProperty.call(message, "discoveryMode")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.discoveryMode); + if (message.errorDetail != null && Object.hasOwnProperty.call(message, "errorDetail")) + $root.google.cloud.apihub.v1.DependencyErrorDetail.encode(message.errorDetail, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.attributes != null && Object.hasOwnProperty.call(message, "attributes")) + for (var keys = Object.keys(message.attributes), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 10, wireType 2 =*/82).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.apihub.v1.AttributeValues.encode(message.attributes[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified Dependency message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.Dependency.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.Dependency + * @static + * @param {google.cloud.apihub.v1.IDependency} message Dependency message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Dependency.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Dependency message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.Dependency + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.Dependency} Dependency + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Dependency.decode = function 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.apihub.v1.Dependency(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.consumer = $root.google.cloud.apihub.v1.DependencyEntityReference.decode(reader, reader.uint32()); + break; + } + case 3: { + message.supplier = $root.google.cloud.apihub.v1.DependencyEntityReference.decode(reader, reader.uint32()); + break; + } + case 4: { + message.state = reader.int32(); + break; + } + case 5: { + message.description = reader.string(); + break; + } + case 6: { + message.discoveryMode = reader.int32(); + break; + } + case 7: { + message.errorDetail = $root.google.cloud.apihub.v1.DependencyErrorDetail.decode(reader, reader.uint32()); + break; + } + case 8: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 9: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 10: { + if (message.attributes === $util.emptyObject) + message.attributes = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.apihub.v1.AttributeValues.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.attributes[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Dependency message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.Dependency + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.Dependency} Dependency + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Dependency.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Dependency message. + * @function verify + * @memberof google.cloud.apihub.v1.Dependency + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Dependency.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.consumer != null && message.hasOwnProperty("consumer")) { + var error = $root.google.cloud.apihub.v1.DependencyEntityReference.verify(message.consumer); + if (error) + return "consumer." + error; + } + if (message.supplier != null && message.hasOwnProperty("supplier")) { + var error = $root.google.cloud.apihub.v1.DependencyEntityReference.verify(message.supplier); + if (error) + return "supplier." + 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.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.discoveryMode != null && message.hasOwnProperty("discoveryMode")) + switch (message.discoveryMode) { + default: + return "discoveryMode: enum value expected"; + case 0: + case 1: + break; + } + if (message.errorDetail != null && message.hasOwnProperty("errorDetail")) { + var error = $root.google.cloud.apihub.v1.DependencyErrorDetail.verify(message.errorDetail); + if (error) + return "errorDetail." + error; + } + 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.attributes != null && message.hasOwnProperty("attributes")) { + if (!$util.isObject(message.attributes)) + return "attributes: object expected"; + var key = Object.keys(message.attributes); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.apihub.v1.AttributeValues.verify(message.attributes[key[i]]); + if (error) + return "attributes." + error; + } + } + return null; + }; + + /** + * Creates a Dependency message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.Dependency + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.Dependency} Dependency + */ + Dependency.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.Dependency) + return object; + var message = new $root.google.cloud.apihub.v1.Dependency(); + if (object.name != null) + message.name = String(object.name); + if (object.consumer != null) { + if (typeof object.consumer !== "object") + throw TypeError(".google.cloud.apihub.v1.Dependency.consumer: object expected"); + message.consumer = $root.google.cloud.apihub.v1.DependencyEntityReference.fromObject(object.consumer); + } + if (object.supplier != null) { + if (typeof object.supplier !== "object") + throw TypeError(".google.cloud.apihub.v1.Dependency.supplier: object expected"); + message.supplier = $root.google.cloud.apihub.v1.DependencyEntityReference.fromObject(object.supplier); + } + 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 "PROPOSED": + case 1: + message.state = 1; + break; + case "VALIDATED": + case 2: + message.state = 2; + break; + } + if (object.description != null) + message.description = String(object.description); + switch (object.discoveryMode) { + default: + if (typeof object.discoveryMode === "number") { + message.discoveryMode = object.discoveryMode; + break; + } + break; + case "DISCOVERY_MODE_UNSPECIFIED": + case 0: + message.discoveryMode = 0; + break; + case "MANUAL": + case 1: + message.discoveryMode = 1; + break; + } + if (object.errorDetail != null) { + if (typeof object.errorDetail !== "object") + throw TypeError(".google.cloud.apihub.v1.Dependency.errorDetail: object expected"); + message.errorDetail = $root.google.cloud.apihub.v1.DependencyErrorDetail.fromObject(object.errorDetail); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.apihub.v1.Dependency.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.apihub.v1.Dependency.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.attributes) { + if (typeof object.attributes !== "object") + throw TypeError(".google.cloud.apihub.v1.Dependency.attributes: object expected"); + message.attributes = {}; + for (var keys = Object.keys(object.attributes), i = 0; i < keys.length; ++i) { + if (typeof object.attributes[keys[i]] !== "object") + throw TypeError(".google.cloud.apihub.v1.Dependency.attributes: object expected"); + message.attributes[keys[i]] = $root.google.cloud.apihub.v1.AttributeValues.fromObject(object.attributes[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a Dependency message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.Dependency + * @static + * @param {google.cloud.apihub.v1.Dependency} message Dependency + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Dependency.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.attributes = {}; + if (options.defaults) { + object.name = ""; + object.consumer = null; + object.supplier = null; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.description = ""; + object.discoveryMode = options.enums === String ? "DISCOVERY_MODE_UNSPECIFIED" : 0; + object.errorDetail = null; + object.createTime = null; + object.updateTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.consumer != null && message.hasOwnProperty("consumer")) + object.consumer = $root.google.cloud.apihub.v1.DependencyEntityReference.toObject(message.consumer, options); + if (message.supplier != null && message.hasOwnProperty("supplier")) + object.supplier = $root.google.cloud.apihub.v1.DependencyEntityReference.toObject(message.supplier, options); + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.apihub.v1.Dependency.State[message.state] === undefined ? message.state : $root.google.cloud.apihub.v1.Dependency.State[message.state] : message.state; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.discoveryMode != null && message.hasOwnProperty("discoveryMode")) + object.discoveryMode = options.enums === String ? $root.google.cloud.apihub.v1.Dependency.DiscoveryMode[message.discoveryMode] === undefined ? message.discoveryMode : $root.google.cloud.apihub.v1.Dependency.DiscoveryMode[message.discoveryMode] : message.discoveryMode; + if (message.errorDetail != null && message.hasOwnProperty("errorDetail")) + object.errorDetail = $root.google.cloud.apihub.v1.DependencyErrorDetail.toObject(message.errorDetail, options); + 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.attributes && (keys2 = Object.keys(message.attributes)).length) { + object.attributes = {}; + for (var j = 0; j < keys2.length; ++j) + object.attributes[keys2[j]] = $root.google.cloud.apihub.v1.AttributeValues.toObject(message.attributes[keys2[j]], options); + } + return object; + }; + + /** + * Converts this Dependency to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.Dependency + * @instance + * @returns {Object.} JSON object + */ + Dependency.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Dependency + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.Dependency + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Dependency.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.Dependency"; + }; + + /** + * State enum. + * @name google.cloud.apihub.v1.Dependency.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} PROPOSED=1 PROPOSED value + * @property {number} VALIDATED=2 VALIDATED value + */ + Dependency.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PROPOSED"] = 1; + values[valuesById[2] = "VALIDATED"] = 2; + return values; + })(); + + /** + * DiscoveryMode enum. + * @name google.cloud.apihub.v1.Dependency.DiscoveryMode + * @enum {number} + * @property {number} DISCOVERY_MODE_UNSPECIFIED=0 DISCOVERY_MODE_UNSPECIFIED value + * @property {number} MANUAL=1 MANUAL value + */ + Dependency.DiscoveryMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DISCOVERY_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "MANUAL"] = 1; + return values; + })(); + + return Dependency; + })(); + + v1.DependencyEntityReference = (function() { + + /** + * Properties of a DependencyEntityReference. + * @memberof google.cloud.apihub.v1 + * @interface IDependencyEntityReference + * @property {string|null} [operationResourceName] DependencyEntityReference operationResourceName + * @property {string|null} [externalApiResourceName] DependencyEntityReference externalApiResourceName + * @property {string|null} [displayName] DependencyEntityReference displayName + */ + + /** + * Constructs a new DependencyEntityReference. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a DependencyEntityReference. + * @implements IDependencyEntityReference + * @constructor + * @param {google.cloud.apihub.v1.IDependencyEntityReference=} [properties] Properties to set + */ + function DependencyEntityReference(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]]; + } + + /** + * DependencyEntityReference operationResourceName. + * @member {string|null|undefined} operationResourceName + * @memberof google.cloud.apihub.v1.DependencyEntityReference + * @instance + */ + DependencyEntityReference.prototype.operationResourceName = null; + + /** + * DependencyEntityReference externalApiResourceName. + * @member {string|null|undefined} externalApiResourceName + * @memberof google.cloud.apihub.v1.DependencyEntityReference + * @instance + */ + DependencyEntityReference.prototype.externalApiResourceName = null; + + /** + * DependencyEntityReference displayName. + * @member {string} displayName + * @memberof google.cloud.apihub.v1.DependencyEntityReference + * @instance + */ + DependencyEntityReference.prototype.displayName = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DependencyEntityReference identifier. + * @member {"operationResourceName"|"externalApiResourceName"|undefined} identifier + * @memberof google.cloud.apihub.v1.DependencyEntityReference + * @instance + */ + Object.defineProperty(DependencyEntityReference.prototype, "identifier", { + get: $util.oneOfGetter($oneOfFields = ["operationResourceName", "externalApiResourceName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DependencyEntityReference instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.DependencyEntityReference + * @static + * @param {google.cloud.apihub.v1.IDependencyEntityReference=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.DependencyEntityReference} DependencyEntityReference instance + */ + DependencyEntityReference.create = function create(properties) { + return new DependencyEntityReference(properties); + }; + + /** + * Encodes the specified DependencyEntityReference message. Does not implicitly {@link google.cloud.apihub.v1.DependencyEntityReference.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.DependencyEntityReference + * @static + * @param {google.cloud.apihub.v1.IDependencyEntityReference} message DependencyEntityReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DependencyEntityReference.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.displayName); + if (message.operationResourceName != null && Object.hasOwnProperty.call(message, "operationResourceName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.operationResourceName); + if (message.externalApiResourceName != null && Object.hasOwnProperty.call(message, "externalApiResourceName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.externalApiResourceName); + return writer; + }; + + /** + * Encodes the specified DependencyEntityReference message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.DependencyEntityReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.DependencyEntityReference + * @static + * @param {google.cloud.apihub.v1.IDependencyEntityReference} message DependencyEntityReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DependencyEntityReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DependencyEntityReference message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.DependencyEntityReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.DependencyEntityReference} DependencyEntityReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DependencyEntityReference.decode = function 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.apihub.v1.DependencyEntityReference(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.operationResourceName = reader.string(); + break; + } + case 3: { + message.externalApiResourceName = reader.string(); + break; + } + case 1: { + message.displayName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DependencyEntityReference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.DependencyEntityReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.DependencyEntityReference} DependencyEntityReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DependencyEntityReference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DependencyEntityReference message. + * @function verify + * @memberof google.cloud.apihub.v1.DependencyEntityReference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DependencyEntityReference.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.operationResourceName != null && message.hasOwnProperty("operationResourceName")) { + properties.identifier = 1; + if (!$util.isString(message.operationResourceName)) + return "operationResourceName: string expected"; + } + if (message.externalApiResourceName != null && message.hasOwnProperty("externalApiResourceName")) { + if (properties.identifier === 1) + return "identifier: multiple values"; + properties.identifier = 1; + if (!$util.isString(message.externalApiResourceName)) + return "externalApiResourceName: string expected"; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + return null; + }; + + /** + * Creates a DependencyEntityReference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.DependencyEntityReference + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.DependencyEntityReference} DependencyEntityReference + */ + DependencyEntityReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.DependencyEntityReference) + return object; + var message = new $root.google.cloud.apihub.v1.DependencyEntityReference(); + if (object.operationResourceName != null) + message.operationResourceName = String(object.operationResourceName); + if (object.externalApiResourceName != null) + message.externalApiResourceName = String(object.externalApiResourceName); + if (object.displayName != null) + message.displayName = String(object.displayName); + return message; + }; + + /** + * Creates a plain object from a DependencyEntityReference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.DependencyEntityReference + * @static + * @param {google.cloud.apihub.v1.DependencyEntityReference} message DependencyEntityReference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DependencyEntityReference.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.displayName = ""; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.operationResourceName != null && message.hasOwnProperty("operationResourceName")) { + object.operationResourceName = message.operationResourceName; + if (options.oneofs) + object.identifier = "operationResourceName"; + } + if (message.externalApiResourceName != null && message.hasOwnProperty("externalApiResourceName")) { + object.externalApiResourceName = message.externalApiResourceName; + if (options.oneofs) + object.identifier = "externalApiResourceName"; + } + return object; + }; + + /** + * Converts this DependencyEntityReference to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.DependencyEntityReference + * @instance + * @returns {Object.} JSON object + */ + DependencyEntityReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DependencyEntityReference + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.DependencyEntityReference + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DependencyEntityReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.DependencyEntityReference"; + }; + + return DependencyEntityReference; + })(); + + v1.DependencyErrorDetail = (function() { + + /** + * Properties of a DependencyErrorDetail. + * @memberof google.cloud.apihub.v1 + * @interface IDependencyErrorDetail + * @property {google.cloud.apihub.v1.DependencyErrorDetail.Error|null} [error] DependencyErrorDetail error + * @property {google.protobuf.ITimestamp|null} [errorTime] DependencyErrorDetail errorTime + */ + + /** + * Constructs a new DependencyErrorDetail. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a DependencyErrorDetail. + * @implements IDependencyErrorDetail + * @constructor + * @param {google.cloud.apihub.v1.IDependencyErrorDetail=} [properties] Properties to set + */ + function DependencyErrorDetail(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]]; + } + + /** + * DependencyErrorDetail error. + * @member {google.cloud.apihub.v1.DependencyErrorDetail.Error} error + * @memberof google.cloud.apihub.v1.DependencyErrorDetail + * @instance + */ + DependencyErrorDetail.prototype.error = 0; + + /** + * DependencyErrorDetail errorTime. + * @member {google.protobuf.ITimestamp|null|undefined} errorTime + * @memberof google.cloud.apihub.v1.DependencyErrorDetail + * @instance + */ + DependencyErrorDetail.prototype.errorTime = null; + + /** + * Creates a new DependencyErrorDetail instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.DependencyErrorDetail + * @static + * @param {google.cloud.apihub.v1.IDependencyErrorDetail=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.DependencyErrorDetail} DependencyErrorDetail instance + */ + DependencyErrorDetail.create = function create(properties) { + return new DependencyErrorDetail(properties); + }; + + /** + * Encodes the specified DependencyErrorDetail message. Does not implicitly {@link google.cloud.apihub.v1.DependencyErrorDetail.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.DependencyErrorDetail + * @static + * @param {google.cloud.apihub.v1.IDependencyErrorDetail} message DependencyErrorDetail message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DependencyErrorDetail.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.error); + if (message.errorTime != null && Object.hasOwnProperty.call(message, "errorTime")) + $root.google.protobuf.Timestamp.encode(message.errorTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DependencyErrorDetail message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.DependencyErrorDetail.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.DependencyErrorDetail + * @static + * @param {google.cloud.apihub.v1.IDependencyErrorDetail} message DependencyErrorDetail message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DependencyErrorDetail.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DependencyErrorDetail message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.DependencyErrorDetail + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.DependencyErrorDetail} DependencyErrorDetail + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DependencyErrorDetail.decode = function 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.apihub.v1.DependencyErrorDetail(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.error = reader.int32(); + break; + } + case 2: { + message.errorTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DependencyErrorDetail message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.DependencyErrorDetail + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.DependencyErrorDetail} DependencyErrorDetail + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DependencyErrorDetail.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DependencyErrorDetail message. + * @function verify + * @memberof google.cloud.apihub.v1.DependencyErrorDetail + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DependencyErrorDetail.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.error != null && message.hasOwnProperty("error")) + switch (message.error) { + default: + return "error: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.errorTime != null && message.hasOwnProperty("errorTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.errorTime); + if (error) + return "errorTime." + error; + } + return null; + }; + + /** + * Creates a DependencyErrorDetail message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.DependencyErrorDetail + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.DependencyErrorDetail} DependencyErrorDetail + */ + DependencyErrorDetail.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.DependencyErrorDetail) + return object; + var message = new $root.google.cloud.apihub.v1.DependencyErrorDetail(); + switch (object.error) { + default: + if (typeof object.error === "number") { + message.error = object.error; + break; + } + break; + case "ERROR_UNSPECIFIED": + case 0: + message.error = 0; + break; + case "SUPPLIER_NOT_FOUND": + case 1: + message.error = 1; + break; + case "SUPPLIER_RECREATED": + case 2: + message.error = 2; + break; + } + if (object.errorTime != null) { + if (typeof object.errorTime !== "object") + throw TypeError(".google.cloud.apihub.v1.DependencyErrorDetail.errorTime: object expected"); + message.errorTime = $root.google.protobuf.Timestamp.fromObject(object.errorTime); + } + return message; + }; + + /** + * Creates a plain object from a DependencyErrorDetail message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.DependencyErrorDetail + * @static + * @param {google.cloud.apihub.v1.DependencyErrorDetail} message DependencyErrorDetail + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DependencyErrorDetail.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.error = options.enums === String ? "ERROR_UNSPECIFIED" : 0; + object.errorTime = null; + } + if (message.error != null && message.hasOwnProperty("error")) + object.error = options.enums === String ? $root.google.cloud.apihub.v1.DependencyErrorDetail.Error[message.error] === undefined ? message.error : $root.google.cloud.apihub.v1.DependencyErrorDetail.Error[message.error] : message.error; + if (message.errorTime != null && message.hasOwnProperty("errorTime")) + object.errorTime = $root.google.protobuf.Timestamp.toObject(message.errorTime, options); + return object; + }; + + /** + * Converts this DependencyErrorDetail to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.DependencyErrorDetail + * @instance + * @returns {Object.} JSON object + */ + DependencyErrorDetail.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DependencyErrorDetail + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.DependencyErrorDetail + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DependencyErrorDetail.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.DependencyErrorDetail"; + }; + + /** + * Error enum. + * @name google.cloud.apihub.v1.DependencyErrorDetail.Error + * @enum {number} + * @property {number} ERROR_UNSPECIFIED=0 ERROR_UNSPECIFIED value + * @property {number} SUPPLIER_NOT_FOUND=1 SUPPLIER_NOT_FOUND value + * @property {number} SUPPLIER_RECREATED=2 SUPPLIER_RECREATED value + */ + DependencyErrorDetail.Error = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ERROR_UNSPECIFIED"] = 0; + values[valuesById[1] = "SUPPLIER_NOT_FOUND"] = 1; + values[valuesById[2] = "SUPPLIER_RECREATED"] = 2; + return values; + })(); + + return DependencyErrorDetail; + })(); + + v1.LintResponse = (function() { + + /** + * Properties of a LintResponse. + * @memberof google.cloud.apihub.v1 + * @interface ILintResponse + * @property {Array.|null} [issues] LintResponse issues + * @property {Array.|null} [summary] LintResponse summary + * @property {google.cloud.apihub.v1.LintState|null} [state] LintResponse state + * @property {string|null} [source] LintResponse source + * @property {google.cloud.apihub.v1.Linter|null} [linter] LintResponse linter + * @property {google.protobuf.ITimestamp|null} [createTime] LintResponse createTime + */ + + /** + * Constructs a new LintResponse. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a LintResponse. + * @implements ILintResponse + * @constructor + * @param {google.cloud.apihub.v1.ILintResponse=} [properties] Properties to set + */ + function LintResponse(properties) { + this.issues = []; + this.summary = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LintResponse issues. + * @member {Array.} issues + * @memberof google.cloud.apihub.v1.LintResponse + * @instance + */ + LintResponse.prototype.issues = $util.emptyArray; + + /** + * LintResponse summary. + * @member {Array.} summary + * @memberof google.cloud.apihub.v1.LintResponse + * @instance + */ + LintResponse.prototype.summary = $util.emptyArray; + + /** + * LintResponse state. + * @member {google.cloud.apihub.v1.LintState} state + * @memberof google.cloud.apihub.v1.LintResponse + * @instance + */ + LintResponse.prototype.state = 0; + + /** + * LintResponse source. + * @member {string} source + * @memberof google.cloud.apihub.v1.LintResponse + * @instance + */ + LintResponse.prototype.source = ""; + + /** + * LintResponse linter. + * @member {google.cloud.apihub.v1.Linter} linter + * @memberof google.cloud.apihub.v1.LintResponse + * @instance + */ + LintResponse.prototype.linter = 0; + + /** + * LintResponse createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.apihub.v1.LintResponse + * @instance + */ + LintResponse.prototype.createTime = null; + + /** + * Creates a new LintResponse instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.LintResponse + * @static + * @param {google.cloud.apihub.v1.ILintResponse=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.LintResponse} LintResponse instance + */ + LintResponse.create = function create(properties) { + return new LintResponse(properties); + }; + + /** + * Encodes the specified LintResponse message. Does not implicitly {@link google.cloud.apihub.v1.LintResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.LintResponse + * @static + * @param {google.cloud.apihub.v1.ILintResponse} message LintResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LintResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.issues != null && message.issues.length) + for (var i = 0; i < message.issues.length; ++i) + $root.google.cloud.apihub.v1.Issue.encode(message.issues[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.summary != null && message.summary.length) + for (var i = 0; i < message.summary.length; ++i) + $root.google.cloud.apihub.v1.LintResponse.SummaryEntry.encode(message.summary[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.state); + if (message.source != null && Object.hasOwnProperty.call(message, "source")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.source); + if (message.linter != null && Object.hasOwnProperty.call(message, "linter")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.linter); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LintResponse message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.LintResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.LintResponse + * @static + * @param {google.cloud.apihub.v1.ILintResponse} message LintResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LintResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LintResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.LintResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.LintResponse} LintResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LintResponse.decode = function 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.apihub.v1.LintResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.issues && message.issues.length)) + message.issues = []; + message.issues.push($root.google.cloud.apihub.v1.Issue.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.summary && message.summary.length)) + message.summary = []; + message.summary.push($root.google.cloud.apihub.v1.LintResponse.SummaryEntry.decode(reader, reader.uint32())); + break; + } + case 3: { + message.state = reader.int32(); + break; + } + case 4: { + message.source = reader.string(); + break; + } + case 5: { + message.linter = reader.int32(); + break; + } + case 6: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LintResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.LintResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.LintResponse} LintResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LintResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LintResponse message. + * @function verify + * @memberof google.cloud.apihub.v1.LintResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LintResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.issues != null && message.hasOwnProperty("issues")) { + if (!Array.isArray(message.issues)) + return "issues: array expected"; + for (var i = 0; i < message.issues.length; ++i) { + var error = $root.google.cloud.apihub.v1.Issue.verify(message.issues[i]); + if (error) + return "issues." + error; + } + } + if (message.summary != null && message.hasOwnProperty("summary")) { + if (!Array.isArray(message.summary)) + return "summary: array expected"; + for (var i = 0; i < message.summary.length; ++i) { + var error = $root.google.cloud.apihub.v1.LintResponse.SummaryEntry.verify(message.summary[i]); + if (error) + return "summary." + 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.source != null && message.hasOwnProperty("source")) + if (!$util.isString(message.source)) + return "source: string expected"; + if (message.linter != null && message.hasOwnProperty("linter")) + switch (message.linter) { + default: + return "linter: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + return null; + }; + + /** + * Creates a LintResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.LintResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.LintResponse} LintResponse + */ + LintResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.LintResponse) + return object; + var message = new $root.google.cloud.apihub.v1.LintResponse(); + if (object.issues) { + if (!Array.isArray(object.issues)) + throw TypeError(".google.cloud.apihub.v1.LintResponse.issues: array expected"); + message.issues = []; + for (var i = 0; i < object.issues.length; ++i) { + if (typeof object.issues[i] !== "object") + throw TypeError(".google.cloud.apihub.v1.LintResponse.issues: object expected"); + message.issues[i] = $root.google.cloud.apihub.v1.Issue.fromObject(object.issues[i]); + } + } + if (object.summary) { + if (!Array.isArray(object.summary)) + throw TypeError(".google.cloud.apihub.v1.LintResponse.summary: array expected"); + message.summary = []; + for (var i = 0; i < object.summary.length; ++i) { + if (typeof object.summary[i] !== "object") + throw TypeError(".google.cloud.apihub.v1.LintResponse.summary: object expected"); + message.summary[i] = $root.google.cloud.apihub.v1.LintResponse.SummaryEntry.fromObject(object.summary[i]); + } + } + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "LINT_STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "LINT_STATE_SUCCESS": + case 1: + message.state = 1; + break; + case "LINT_STATE_ERROR": + case 2: + message.state = 2; + break; + } + if (object.source != null) + message.source = String(object.source); + switch (object.linter) { + default: + if (typeof object.linter === "number") { + message.linter = object.linter; + break; + } + break; + case "LINTER_UNSPECIFIED": + case 0: + message.linter = 0; + break; + case "SPECTRAL": + case 1: + message.linter = 1; + break; + case "OTHER": + case 2: + message.linter = 2; + break; + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.apihub.v1.LintResponse.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + return message; + }; + + /** + * Creates a plain object from a LintResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.LintResponse + * @static + * @param {google.cloud.apihub.v1.LintResponse} message LintResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LintResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.issues = []; + object.summary = []; + } + if (options.defaults) { + object.state = options.enums === String ? "LINT_STATE_UNSPECIFIED" : 0; + object.source = ""; + object.linter = options.enums === String ? "LINTER_UNSPECIFIED" : 0; + object.createTime = null; + } + if (message.issues && message.issues.length) { + object.issues = []; + for (var j = 0; j < message.issues.length; ++j) + object.issues[j] = $root.google.cloud.apihub.v1.Issue.toObject(message.issues[j], options); + } + if (message.summary && message.summary.length) { + object.summary = []; + for (var j = 0; j < message.summary.length; ++j) + object.summary[j] = $root.google.cloud.apihub.v1.LintResponse.SummaryEntry.toObject(message.summary[j], options); + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.apihub.v1.LintState[message.state] === undefined ? message.state : $root.google.cloud.apihub.v1.LintState[message.state] : message.state; + if (message.source != null && message.hasOwnProperty("source")) + object.source = message.source; + if (message.linter != null && message.hasOwnProperty("linter")) + object.linter = options.enums === String ? $root.google.cloud.apihub.v1.Linter[message.linter] === undefined ? message.linter : $root.google.cloud.apihub.v1.Linter[message.linter] : message.linter; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + return object; + }; + + /** + * Converts this LintResponse to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.LintResponse + * @instance + * @returns {Object.} JSON object + */ + LintResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LintResponse + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.LintResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LintResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.LintResponse"; + }; + + LintResponse.SummaryEntry = (function() { + + /** + * Properties of a SummaryEntry. + * @memberof google.cloud.apihub.v1.LintResponse + * @interface ISummaryEntry + * @property {google.cloud.apihub.v1.Severity|null} [severity] SummaryEntry severity + * @property {number|null} [count] SummaryEntry count + */ + + /** + * Constructs a new SummaryEntry. + * @memberof google.cloud.apihub.v1.LintResponse + * @classdesc Represents a SummaryEntry. + * @implements ISummaryEntry + * @constructor + * @param {google.cloud.apihub.v1.LintResponse.ISummaryEntry=} [properties] Properties to set + */ + function SummaryEntry(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]]; + } + + /** + * SummaryEntry severity. + * @member {google.cloud.apihub.v1.Severity} severity + * @memberof google.cloud.apihub.v1.LintResponse.SummaryEntry + * @instance + */ + SummaryEntry.prototype.severity = 0; + + /** + * SummaryEntry count. + * @member {number} count + * @memberof google.cloud.apihub.v1.LintResponse.SummaryEntry + * @instance + */ + SummaryEntry.prototype.count = 0; + + /** + * Creates a new SummaryEntry instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.LintResponse.SummaryEntry + * @static + * @param {google.cloud.apihub.v1.LintResponse.ISummaryEntry=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.LintResponse.SummaryEntry} SummaryEntry instance + */ + SummaryEntry.create = function create(properties) { + return new SummaryEntry(properties); + }; + + /** + * Encodes the specified SummaryEntry message. Does not implicitly {@link google.cloud.apihub.v1.LintResponse.SummaryEntry.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.LintResponse.SummaryEntry + * @static + * @param {google.cloud.apihub.v1.LintResponse.ISummaryEntry} message SummaryEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SummaryEntry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.severity != null && Object.hasOwnProperty.call(message, "severity")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.severity); + if (message.count != null && Object.hasOwnProperty.call(message, "count")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.count); + return writer; + }; + + /** + * Encodes the specified SummaryEntry message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.LintResponse.SummaryEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.LintResponse.SummaryEntry + * @static + * @param {google.cloud.apihub.v1.LintResponse.ISummaryEntry} message SummaryEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SummaryEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SummaryEntry message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.LintResponse.SummaryEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.LintResponse.SummaryEntry} SummaryEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SummaryEntry.decode = function 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.apihub.v1.LintResponse.SummaryEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.severity = reader.int32(); + break; + } + case 2: { + message.count = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SummaryEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.LintResponse.SummaryEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.LintResponse.SummaryEntry} SummaryEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SummaryEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SummaryEntry message. + * @function verify + * @memberof google.cloud.apihub.v1.LintResponse.SummaryEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SummaryEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.severity != null && message.hasOwnProperty("severity")) + switch (message.severity) { + default: + return "severity: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.count != null && message.hasOwnProperty("count")) + if (!$util.isInteger(message.count)) + return "count: integer expected"; + return null; + }; + + /** + * Creates a SummaryEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.LintResponse.SummaryEntry + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.LintResponse.SummaryEntry} SummaryEntry + */ + SummaryEntry.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.LintResponse.SummaryEntry) + return object; + var message = new $root.google.cloud.apihub.v1.LintResponse.SummaryEntry(); + switch (object.severity) { + default: + if (typeof object.severity === "number") { + message.severity = object.severity; + break; + } + break; + case "SEVERITY_UNSPECIFIED": + case 0: + message.severity = 0; + break; + case "SEVERITY_ERROR": + case 1: + message.severity = 1; + break; + case "SEVERITY_WARNING": + case 2: + message.severity = 2; + break; + case "SEVERITY_INFO": + case 3: + message.severity = 3; + break; + case "SEVERITY_HINT": + case 4: + message.severity = 4; + break; + } + if (object.count != null) + message.count = object.count | 0; + return message; + }; + + /** + * Creates a plain object from a SummaryEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.LintResponse.SummaryEntry + * @static + * @param {google.cloud.apihub.v1.LintResponse.SummaryEntry} message SummaryEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SummaryEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.severity = options.enums === String ? "SEVERITY_UNSPECIFIED" : 0; + object.count = 0; + } + if (message.severity != null && message.hasOwnProperty("severity")) + object.severity = options.enums === String ? $root.google.cloud.apihub.v1.Severity[message.severity] === undefined ? message.severity : $root.google.cloud.apihub.v1.Severity[message.severity] : message.severity; + if (message.count != null && message.hasOwnProperty("count")) + object.count = message.count; + return object; + }; + + /** + * Converts this SummaryEntry to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.LintResponse.SummaryEntry + * @instance + * @returns {Object.} JSON object + */ + SummaryEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SummaryEntry + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.LintResponse.SummaryEntry + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SummaryEntry.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.LintResponse.SummaryEntry"; + }; + + return SummaryEntry; + })(); + + return LintResponse; + })(); + + v1.Issue = (function() { + + /** + * Properties of an Issue. + * @memberof google.cloud.apihub.v1 + * @interface IIssue + * @property {string|null} [code] Issue code + * @property {Array.|null} [path] Issue path + * @property {string|null} [message] Issue message + * @property {google.cloud.apihub.v1.Severity|null} [severity] Issue severity + * @property {google.cloud.apihub.v1.IRange|null} [range] Issue range + */ + + /** + * Constructs a new Issue. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents an Issue. + * @implements IIssue + * @constructor + * @param {google.cloud.apihub.v1.IIssue=} [properties] Properties to set + */ + function Issue(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]]; + } + + /** + * Issue code. + * @member {string} code + * @memberof google.cloud.apihub.v1.Issue + * @instance + */ + Issue.prototype.code = ""; + + /** + * Issue path. + * @member {Array.} path + * @memberof google.cloud.apihub.v1.Issue + * @instance + */ + Issue.prototype.path = $util.emptyArray; + + /** + * Issue message. + * @member {string} message + * @memberof google.cloud.apihub.v1.Issue + * @instance + */ + Issue.prototype.message = ""; + + /** + * Issue severity. + * @member {google.cloud.apihub.v1.Severity} severity + * @memberof google.cloud.apihub.v1.Issue + * @instance + */ + Issue.prototype.severity = 0; + + /** + * Issue range. + * @member {google.cloud.apihub.v1.IRange|null|undefined} range + * @memberof google.cloud.apihub.v1.Issue + * @instance + */ + Issue.prototype.range = null; + + /** + * Creates a new Issue instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.Issue + * @static + * @param {google.cloud.apihub.v1.IIssue=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.Issue} Issue instance + */ + Issue.create = function create(properties) { + return new Issue(properties); + }; + + /** + * Encodes the specified Issue message. Does not implicitly {@link google.cloud.apihub.v1.Issue.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.Issue + * @static + * @param {google.cloud.apihub.v1.IIssue} message Issue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Issue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.code); + if (message.path != null && message.path.length) + for (var i = 0; i < message.path.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.path[i]); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.message); + if (message.severity != null && Object.hasOwnProperty.call(message, "severity")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.severity); + if (message.range != null && Object.hasOwnProperty.call(message, "range")) + $root.google.cloud.apihub.v1.Range.encode(message.range, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Issue message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.Issue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.Issue + * @static + * @param {google.cloud.apihub.v1.IIssue} message Issue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Issue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Issue message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.Issue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.Issue} Issue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Issue.decode = function 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.apihub.v1.Issue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.code = reader.string(); + break; + } + case 2: { + if (!(message.path && message.path.length)) + message.path = []; + message.path.push(reader.string()); + break; + } + case 3: { + message.message = reader.string(); + break; + } + case 4: { + message.severity = reader.int32(); + break; + } + case 5: { + message.range = $root.google.cloud.apihub.v1.Range.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Issue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.Issue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.Issue} Issue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Issue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Issue message. + * @function verify + * @memberof google.cloud.apihub.v1.Issue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Issue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + if (!$util.isString(message.code)) + return "code: string 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.isString(message.path[i])) + return "path: string[] expected"; + } + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.severity != null && message.hasOwnProperty("severity")) + switch (message.severity) { + default: + return "severity: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.range != null && message.hasOwnProperty("range")) { + var error = $root.google.cloud.apihub.v1.Range.verify(message.range); + if (error) + return "range." + error; + } + return null; + }; + + /** + * Creates an Issue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.Issue + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.Issue} Issue + */ + Issue.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.Issue) + return object; + var message = new $root.google.cloud.apihub.v1.Issue(); + if (object.code != null) + message.code = String(object.code); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.cloud.apihub.v1.Issue.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = String(object.path[i]); + } + if (object.message != null) + message.message = String(object.message); + switch (object.severity) { + default: + if (typeof object.severity === "number") { + message.severity = object.severity; + break; + } + break; + case "SEVERITY_UNSPECIFIED": + case 0: + message.severity = 0; + break; + case "SEVERITY_ERROR": + case 1: + message.severity = 1; + break; + case "SEVERITY_WARNING": + case 2: + message.severity = 2; + break; + case "SEVERITY_INFO": + case 3: + message.severity = 3; + break; + case "SEVERITY_HINT": + case 4: + message.severity = 4; + break; + } + if (object.range != null) { + if (typeof object.range !== "object") + throw TypeError(".google.cloud.apihub.v1.Issue.range: object expected"); + message.range = $root.google.cloud.apihub.v1.Range.fromObject(object.range); + } + return message; + }; + + /** + * Creates a plain object from an Issue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.Issue + * @static + * @param {google.cloud.apihub.v1.Issue} message Issue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Issue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.path = []; + if (options.defaults) { + object.code = ""; + object.message = ""; + object.severity = options.enums === String ? "SEVERITY_UNSPECIFIED" : 0; + object.range = null; + } + if (message.code != null && message.hasOwnProperty("code")) + object.code = message.code; + 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.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.severity != null && message.hasOwnProperty("severity")) + object.severity = options.enums === String ? $root.google.cloud.apihub.v1.Severity[message.severity] === undefined ? message.severity : $root.google.cloud.apihub.v1.Severity[message.severity] : message.severity; + if (message.range != null && message.hasOwnProperty("range")) + object.range = $root.google.cloud.apihub.v1.Range.toObject(message.range, options); + return object; + }; + + /** + * Converts this Issue to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.Issue + * @instance + * @returns {Object.} JSON object + */ + Issue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Issue + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.Issue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Issue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.Issue"; + }; + + return Issue; + })(); + + v1.Range = (function() { + + /** + * Properties of a Range. + * @memberof google.cloud.apihub.v1 + * @interface IRange + * @property {google.cloud.apihub.v1.IPoint|null} [start] Range start + * @property {google.cloud.apihub.v1.IPoint|null} [end] Range end + */ + + /** + * Constructs a new Range. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a Range. + * @implements IRange + * @constructor + * @param {google.cloud.apihub.v1.IRange=} [properties] Properties to set + */ + function Range(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]]; + } + + /** + * Range start. + * @member {google.cloud.apihub.v1.IPoint|null|undefined} start + * @memberof google.cloud.apihub.v1.Range + * @instance + */ + Range.prototype.start = null; + + /** + * Range end. + * @member {google.cloud.apihub.v1.IPoint|null|undefined} end + * @memberof google.cloud.apihub.v1.Range + * @instance + */ + Range.prototype.end = null; + + /** + * Creates a new Range instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.Range + * @static + * @param {google.cloud.apihub.v1.IRange=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.Range} Range instance + */ + Range.create = function create(properties) { + return new Range(properties); + }; + + /** + * Encodes the specified Range message. Does not implicitly {@link google.cloud.apihub.v1.Range.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.Range + * @static + * @param {google.cloud.apihub.v1.IRange} message Range message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Range.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + $root.google.cloud.apihub.v1.Point.encode(message.start, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + $root.google.cloud.apihub.v1.Point.encode(message.end, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Range message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.Range.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.Range + * @static + * @param {google.cloud.apihub.v1.IRange} message Range message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Range.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Range message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.Range + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.Range} Range + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Range.decode = function 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.apihub.v1.Range(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.start = $root.google.cloud.apihub.v1.Point.decode(reader, reader.uint32()); + break; + } + case 2: { + message.end = $root.google.cloud.apihub.v1.Point.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Range message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.Range + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.Range} Range + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Range.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Range message. + * @function verify + * @memberof google.cloud.apihub.v1.Range + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Range.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) { + var error = $root.google.cloud.apihub.v1.Point.verify(message.start); + if (error) + return "start." + error; + } + if (message.end != null && message.hasOwnProperty("end")) { + var error = $root.google.cloud.apihub.v1.Point.verify(message.end); + if (error) + return "end." + error; + } + return null; + }; + + /** + * Creates a Range message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.Range + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.Range} Range + */ + Range.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.Range) + return object; + var message = new $root.google.cloud.apihub.v1.Range(); + if (object.start != null) { + if (typeof object.start !== "object") + throw TypeError(".google.cloud.apihub.v1.Range.start: object expected"); + message.start = $root.google.cloud.apihub.v1.Point.fromObject(object.start); + } + if (object.end != null) { + if (typeof object.end !== "object") + throw TypeError(".google.cloud.apihub.v1.Range.end: object expected"); + message.end = $root.google.cloud.apihub.v1.Point.fromObject(object.end); + } + return message; + }; + + /** + * Creates a plain object from a Range message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.Range + * @static + * @param {google.cloud.apihub.v1.Range} message Range + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Range.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = null; + object.end = null; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = $root.google.cloud.apihub.v1.Point.toObject(message.start, options); + if (message.end != null && message.hasOwnProperty("end")) + object.end = $root.google.cloud.apihub.v1.Point.toObject(message.end, options); + return object; + }; + + /** + * Converts this Range to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.Range + * @instance + * @returns {Object.} JSON object + */ + Range.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Range + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.Range + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Range.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.Range"; + }; + + return Range; + })(); + + v1.Point = (function() { + + /** + * Properties of a Point. + * @memberof google.cloud.apihub.v1 + * @interface IPoint + * @property {number|null} [line] Point line + * @property {number|null} [character] Point character + */ + + /** + * Constructs a new Point. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a Point. + * @implements IPoint + * @constructor + * @param {google.cloud.apihub.v1.IPoint=} [properties] Properties to set + */ + function Point(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]]; + } + + /** + * Point line. + * @member {number} line + * @memberof google.cloud.apihub.v1.Point + * @instance + */ + Point.prototype.line = 0; + + /** + * Point character. + * @member {number} character + * @memberof google.cloud.apihub.v1.Point + * @instance + */ + Point.prototype.character = 0; + + /** + * Creates a new Point instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.Point + * @static + * @param {google.cloud.apihub.v1.IPoint=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.Point} Point instance + */ + Point.create = function create(properties) { + return new Point(properties); + }; + + /** + * Encodes the specified Point message. Does not implicitly {@link google.cloud.apihub.v1.Point.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.Point + * @static + * @param {google.cloud.apihub.v1.IPoint} message Point message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Point.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.line != null && Object.hasOwnProperty.call(message, "line")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.line); + if (message.character != null && Object.hasOwnProperty.call(message, "character")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.character); + return writer; + }; + + /** + * Encodes the specified Point message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.Point.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.Point + * @static + * @param {google.cloud.apihub.v1.IPoint} message Point message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Point.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Point message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.Point + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.Point} Point + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Point.decode = function 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.apihub.v1.Point(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.line = reader.int32(); + break; + } + case 2: { + message.character = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Point message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.Point + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.Point} Point + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Point.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Point message. + * @function verify + * @memberof google.cloud.apihub.v1.Point + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Point.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.line != null && message.hasOwnProperty("line")) + if (!$util.isInteger(message.line)) + return "line: integer expected"; + if (message.character != null && message.hasOwnProperty("character")) + if (!$util.isInteger(message.character)) + return "character: integer expected"; + return null; + }; + + /** + * Creates a Point message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.Point + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.Point} Point + */ + Point.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.Point) + return object; + var message = new $root.google.cloud.apihub.v1.Point(); + if (object.line != null) + message.line = object.line | 0; + if (object.character != null) + message.character = object.character | 0; + return message; + }; + + /** + * Creates a plain object from a Point message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.Point + * @static + * @param {google.cloud.apihub.v1.Point} message Point + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Point.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.line = 0; + object.character = 0; + } + if (message.line != null && message.hasOwnProperty("line")) + object.line = message.line; + if (message.character != null && message.hasOwnProperty("character")) + object.character = message.character; + return object; + }; + + /** + * Converts this Point to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.Point + * @instance + * @returns {Object.} JSON object + */ + Point.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Point + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.Point + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Point.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.Point"; + }; + + return Point; + })(); + + v1.OperationMetadata = (function() { + + /** + * Properties of an OperationMetadata. + * @memberof google.cloud.apihub.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.apihub.v1 + * @classdesc Represents an OperationMetadata. + * @implements IOperationMetadata + * @constructor + * @param {google.cloud.apihub.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.apihub.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.createTime = null; + + /** + * OperationMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.apihub.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.endTime = null; + + /** + * OperationMetadata target. + * @member {string} target + * @memberof google.cloud.apihub.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.target = ""; + + /** + * OperationMetadata verb. + * @member {string} verb + * @memberof google.cloud.apihub.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.verb = ""; + + /** + * OperationMetadata statusMessage. + * @member {string} statusMessage + * @memberof google.cloud.apihub.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.statusMessage = ""; + + /** + * OperationMetadata requestedCancellation. + * @member {boolean} requestedCancellation + * @memberof google.cloud.apihub.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.requestedCancellation = false; + + /** + * OperationMetadata apiVersion. + * @member {string} apiVersion + * @memberof google.cloud.apihub.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.apiVersion = ""; + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.OperationMetadata + * @static + * @param {google.cloud.apihub.v1.IOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.OperationMetadata} OperationMetadata instance + */ + OperationMetadata.create = function create(properties) { + return new OperationMetadata(properties); + }; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.apihub.v1.OperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.OperationMetadata + * @static + * @param {google.cloud.apihub.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.apihub.v1.OperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.OperationMetadata + * @static + * @param {google.cloud.apihub.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.apihub.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.apihub.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.apihub.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.apihub.v1.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.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.apihub.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.apihub.v1.OperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.OperationMetadata} OperationMetadata + */ + OperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.OperationMetadata) + return object; + var message = new $root.google.cloud.apihub.v1.OperationMetadata(); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.apihub.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.apihub.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.apihub.v1.OperationMetadata + * @static + * @param {google.cloud.apihub.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.apihub.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.apihub.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.apihub.v1.OperationMetadata"; + }; + + return OperationMetadata; + })(); + + v1.ApiHubInstance = (function() { + + /** + * Properties of an ApiHubInstance. + * @memberof google.cloud.apihub.v1 + * @interface IApiHubInstance + * @property {string|null} [name] ApiHubInstance name + * @property {google.protobuf.ITimestamp|null} [createTime] ApiHubInstance createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] ApiHubInstance updateTime + * @property {google.cloud.apihub.v1.ApiHubInstance.State|null} [state] ApiHubInstance state + * @property {string|null} [stateMessage] ApiHubInstance stateMessage + * @property {google.cloud.apihub.v1.ApiHubInstance.IConfig|null} [config] ApiHubInstance config + * @property {Object.|null} [labels] ApiHubInstance labels + * @property {string|null} [description] ApiHubInstance description + */ + + /** + * Constructs a new ApiHubInstance. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents an ApiHubInstance. + * @implements IApiHubInstance + * @constructor + * @param {google.cloud.apihub.v1.IApiHubInstance=} [properties] Properties to set + */ + function ApiHubInstance(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]]; + } + + /** + * ApiHubInstance name. + * @member {string} name + * @memberof google.cloud.apihub.v1.ApiHubInstance + * @instance + */ + ApiHubInstance.prototype.name = ""; + + /** + * ApiHubInstance createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.apihub.v1.ApiHubInstance + * @instance + */ + ApiHubInstance.prototype.createTime = null; + + /** + * ApiHubInstance updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.apihub.v1.ApiHubInstance + * @instance + */ + ApiHubInstance.prototype.updateTime = null; + + /** + * ApiHubInstance state. + * @member {google.cloud.apihub.v1.ApiHubInstance.State} state + * @memberof google.cloud.apihub.v1.ApiHubInstance + * @instance + */ + ApiHubInstance.prototype.state = 0; + + /** + * ApiHubInstance stateMessage. + * @member {string} stateMessage + * @memberof google.cloud.apihub.v1.ApiHubInstance + * @instance + */ + ApiHubInstance.prototype.stateMessage = ""; + + /** + * ApiHubInstance config. + * @member {google.cloud.apihub.v1.ApiHubInstance.IConfig|null|undefined} config + * @memberof google.cloud.apihub.v1.ApiHubInstance + * @instance + */ + ApiHubInstance.prototype.config = null; + + /** + * ApiHubInstance labels. + * @member {Object.} labels + * @memberof google.cloud.apihub.v1.ApiHubInstance + * @instance + */ + ApiHubInstance.prototype.labels = $util.emptyObject; + + /** + * ApiHubInstance description. + * @member {string} description + * @memberof google.cloud.apihub.v1.ApiHubInstance + * @instance + */ + ApiHubInstance.prototype.description = ""; + + /** + * Creates a new ApiHubInstance instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.ApiHubInstance + * @static + * @param {google.cloud.apihub.v1.IApiHubInstance=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.ApiHubInstance} ApiHubInstance instance + */ + ApiHubInstance.create = function create(properties) { + return new ApiHubInstance(properties); + }; + + /** + * Encodes the specified ApiHubInstance message. Does not implicitly {@link google.cloud.apihub.v1.ApiHubInstance.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.ApiHubInstance + * @static + * @param {google.cloud.apihub.v1.IApiHubInstance} message ApiHubInstance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApiHubInstance.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.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.state); + if (message.stateMessage != null && Object.hasOwnProperty.call(message, "stateMessage")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.stateMessage); + if (message.config != null && Object.hasOwnProperty.call(message, "config")) + $root.google.cloud.apihub.v1.ApiHubInstance.Config.encode(message.config, writer.uint32(/* id 6, wireType 2 =*/50).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 7, wireType 2 =*/58).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 8, wireType 2 =*/66).string(message.description); + return writer; + }; + + /** + * Encodes the specified ApiHubInstance message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ApiHubInstance.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.ApiHubInstance + * @static + * @param {google.cloud.apihub.v1.IApiHubInstance} message ApiHubInstance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApiHubInstance.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ApiHubInstance message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.ApiHubInstance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.ApiHubInstance} ApiHubInstance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApiHubInstance.decode = function 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.apihub.v1.ApiHubInstance(), 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: { + message.state = reader.int32(); + break; + } + case 5: { + message.stateMessage = reader.string(); + break; + } + case 6: { + message.config = $root.google.cloud.apihub.v1.ApiHubInstance.Config.decode(reader, reader.uint32()); + break; + } + case 7: { + 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 8: { + message.description = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ApiHubInstance message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.ApiHubInstance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.ApiHubInstance} ApiHubInstance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApiHubInstance.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ApiHubInstance message. + * @function verify + * @memberof google.cloud.apihub.v1.ApiHubInstance + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ApiHubInstance.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.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.stateMessage != null && message.hasOwnProperty("stateMessage")) + if (!$util.isString(message.stateMessage)) + return "stateMessage: string expected"; + if (message.config != null && message.hasOwnProperty("config")) { + var error = $root.google.cloud.apihub.v1.ApiHubInstance.Config.verify(message.config); + if (error) + return "config." + 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"; + return null; + }; + + /** + * Creates an ApiHubInstance message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.ApiHubInstance + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.ApiHubInstance} ApiHubInstance + */ + ApiHubInstance.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.ApiHubInstance) + return object; + var message = new $root.google.cloud.apihub.v1.ApiHubInstance(); + if (object.name != null) + message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.apihub.v1.ApiHubInstance.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.apihub.v1.ApiHubInstance.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + 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 "CREATING": + case 2: + message.state = 2; + break; + case "ACTIVE": + case 3: + message.state = 3; + break; + case "UPDATING": + case 4: + message.state = 4; + break; + case "DELETING": + case 5: + message.state = 5; + break; + case "FAILED": + case 6: + message.state = 6; + break; + } + if (object.stateMessage != null) + message.stateMessage = String(object.stateMessage); + if (object.config != null) { + if (typeof object.config !== "object") + throw TypeError(".google.cloud.apihub.v1.ApiHubInstance.config: object expected"); + message.config = $root.google.cloud.apihub.v1.ApiHubInstance.Config.fromObject(object.config); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.apihub.v1.ApiHubInstance.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); + return message; + }; + + /** + * Creates a plain object from an ApiHubInstance message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.ApiHubInstance + * @static + * @param {google.cloud.apihub.v1.ApiHubInstance} message ApiHubInstance + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ApiHubInstance.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.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.stateMessage = ""; + object.config = null; + object.description = ""; + } + 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); + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.apihub.v1.ApiHubInstance.State[message.state] === undefined ? message.state : $root.google.cloud.apihub.v1.ApiHubInstance.State[message.state] : message.state; + if (message.stateMessage != null && message.hasOwnProperty("stateMessage")) + object.stateMessage = message.stateMessage; + if (message.config != null && message.hasOwnProperty("config")) + object.config = $root.google.cloud.apihub.v1.ApiHubInstance.Config.toObject(message.config, 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; + return object; + }; + + /** + * Converts this ApiHubInstance to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.ApiHubInstance + * @instance + * @returns {Object.} JSON object + */ + ApiHubInstance.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ApiHubInstance + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.ApiHubInstance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ApiHubInstance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.ApiHubInstance"; + }; + + ApiHubInstance.Config = (function() { + + /** + * Properties of a Config. + * @memberof google.cloud.apihub.v1.ApiHubInstance + * @interface IConfig + * @property {string|null} [cmekKeyName] Config cmekKeyName + */ + + /** + * Constructs a new Config. + * @memberof google.cloud.apihub.v1.ApiHubInstance + * @classdesc Represents a Config. + * @implements IConfig + * @constructor + * @param {google.cloud.apihub.v1.ApiHubInstance.IConfig=} [properties] Properties to set + */ + function Config(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]]; + } + + /** + * Config cmekKeyName. + * @member {string} cmekKeyName + * @memberof google.cloud.apihub.v1.ApiHubInstance.Config + * @instance + */ + Config.prototype.cmekKeyName = ""; + + /** + * Creates a new Config instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.ApiHubInstance.Config + * @static + * @param {google.cloud.apihub.v1.ApiHubInstance.IConfig=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.ApiHubInstance.Config} Config instance + */ + Config.create = function create(properties) { + return new Config(properties); + }; + + /** + * Encodes the specified Config message. Does not implicitly {@link google.cloud.apihub.v1.ApiHubInstance.Config.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.ApiHubInstance.Config + * @static + * @param {google.cloud.apihub.v1.ApiHubInstance.IConfig} message Config message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Config.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cmekKeyName != null && Object.hasOwnProperty.call(message, "cmekKeyName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.cmekKeyName); + return writer; + }; + + /** + * Encodes the specified Config message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ApiHubInstance.Config.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.ApiHubInstance.Config + * @static + * @param {google.cloud.apihub.v1.ApiHubInstance.IConfig} message Config message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Config.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Config message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.ApiHubInstance.Config + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.ApiHubInstance.Config} Config + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Config.decode = function 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.apihub.v1.ApiHubInstance.Config(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.cmekKeyName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Config message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.ApiHubInstance.Config + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.ApiHubInstance.Config} Config + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Config.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Config message. + * @function verify + * @memberof google.cloud.apihub.v1.ApiHubInstance.Config + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Config.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cmekKeyName != null && message.hasOwnProperty("cmekKeyName")) + if (!$util.isString(message.cmekKeyName)) + return "cmekKeyName: string expected"; + return null; + }; + + /** + * Creates a Config message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.ApiHubInstance.Config + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.ApiHubInstance.Config} Config + */ + Config.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.ApiHubInstance.Config) + return object; + var message = new $root.google.cloud.apihub.v1.ApiHubInstance.Config(); + if (object.cmekKeyName != null) + message.cmekKeyName = String(object.cmekKeyName); + return message; + }; + + /** + * Creates a plain object from a Config message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.ApiHubInstance.Config + * @static + * @param {google.cloud.apihub.v1.ApiHubInstance.Config} message Config + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Config.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.cmekKeyName = ""; + if (message.cmekKeyName != null && message.hasOwnProperty("cmekKeyName")) + object.cmekKeyName = message.cmekKeyName; + return object; + }; + + /** + * Converts this Config to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.ApiHubInstance.Config + * @instance + * @returns {Object.} JSON object + */ + Config.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Config + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.ApiHubInstance.Config + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Config.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.ApiHubInstance.Config"; + }; + + return Config; + })(); + + /** + * State enum. + * @name google.cloud.apihub.v1.ApiHubInstance.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} INACTIVE=1 INACTIVE value + * @property {number} CREATING=2 CREATING value + * @property {number} ACTIVE=3 ACTIVE value + * @property {number} UPDATING=4 UPDATING value + * @property {number} DELETING=5 DELETING value + * @property {number} FAILED=6 FAILED value + */ + ApiHubInstance.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "INACTIVE"] = 1; + values[valuesById[2] = "CREATING"] = 2; + values[valuesById[3] = "ACTIVE"] = 3; + values[valuesById[4] = "UPDATING"] = 4; + values[valuesById[5] = "DELETING"] = 5; + values[valuesById[6] = "FAILED"] = 6; + return values; + })(); + + return ApiHubInstance; + })(); + + v1.ExternalApi = (function() { + + /** + * Properties of an ExternalApi. + * @memberof google.cloud.apihub.v1 + * @interface IExternalApi + * @property {string|null} [name] ExternalApi name + * @property {string|null} [displayName] ExternalApi displayName + * @property {string|null} [description] ExternalApi description + * @property {Array.|null} [endpoints] ExternalApi endpoints + * @property {Array.|null} [paths] ExternalApi paths + * @property {google.cloud.apihub.v1.IDocumentation|null} [documentation] ExternalApi documentation + * @property {Object.|null} [attributes] ExternalApi attributes + * @property {google.protobuf.ITimestamp|null} [createTime] ExternalApi createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] ExternalApi updateTime + */ + + /** + * Constructs a new ExternalApi. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents an ExternalApi. + * @implements IExternalApi + * @constructor + * @param {google.cloud.apihub.v1.IExternalApi=} [properties] Properties to set + */ + function ExternalApi(properties) { + this.endpoints = []; + this.paths = []; + this.attributes = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExternalApi name. + * @member {string} name + * @memberof google.cloud.apihub.v1.ExternalApi + * @instance + */ + ExternalApi.prototype.name = ""; + + /** + * ExternalApi displayName. + * @member {string} displayName + * @memberof google.cloud.apihub.v1.ExternalApi + * @instance + */ + ExternalApi.prototype.displayName = ""; + + /** + * ExternalApi description. + * @member {string} description + * @memberof google.cloud.apihub.v1.ExternalApi + * @instance + */ + ExternalApi.prototype.description = ""; + + /** + * ExternalApi endpoints. + * @member {Array.} endpoints + * @memberof google.cloud.apihub.v1.ExternalApi + * @instance + */ + ExternalApi.prototype.endpoints = $util.emptyArray; + + /** + * ExternalApi paths. + * @member {Array.} paths + * @memberof google.cloud.apihub.v1.ExternalApi + * @instance + */ + ExternalApi.prototype.paths = $util.emptyArray; + + /** + * ExternalApi documentation. + * @member {google.cloud.apihub.v1.IDocumentation|null|undefined} documentation + * @memberof google.cloud.apihub.v1.ExternalApi + * @instance + */ + ExternalApi.prototype.documentation = null; + + /** + * ExternalApi attributes. + * @member {Object.} attributes + * @memberof google.cloud.apihub.v1.ExternalApi + * @instance + */ + ExternalApi.prototype.attributes = $util.emptyObject; + + /** + * ExternalApi createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.apihub.v1.ExternalApi + * @instance + */ + ExternalApi.prototype.createTime = null; + + /** + * ExternalApi updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.apihub.v1.ExternalApi + * @instance + */ + ExternalApi.prototype.updateTime = null; + + /** + * Creates a new ExternalApi instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.ExternalApi + * @static + * @param {google.cloud.apihub.v1.IExternalApi=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.ExternalApi} ExternalApi instance + */ + ExternalApi.create = function create(properties) { + return new ExternalApi(properties); + }; + + /** + * Encodes the specified ExternalApi message. Does not implicitly {@link google.cloud.apihub.v1.ExternalApi.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.ExternalApi + * @static + * @param {google.cloud.apihub.v1.IExternalApi} message ExternalApi message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExternalApi.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.endpoints != null && message.endpoints.length) + for (var i = 0; i < message.endpoints.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.endpoints[i]); + if (message.paths != null && message.paths.length) + for (var i = 0; i < message.paths.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.paths[i]); + if (message.documentation != null && Object.hasOwnProperty.call(message, "documentation")) + $root.google.cloud.apihub.v1.Documentation.encode(message.documentation, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.attributes != null && Object.hasOwnProperty.call(message, "attributes")) + for (var keys = Object.keys(message.attributes), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.apihub.v1.AttributeValues.encode(message.attributes[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExternalApi message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ExternalApi.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.ExternalApi + * @static + * @param {google.cloud.apihub.v1.IExternalApi} message ExternalApi message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExternalApi.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExternalApi message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.ExternalApi + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.ExternalApi} ExternalApi + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExternalApi.decode = function 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.apihub.v1.ExternalApi(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + if (!(message.endpoints && message.endpoints.length)) + message.endpoints = []; + message.endpoints.push(reader.string()); + break; + } + case 5: { + if (!(message.paths && message.paths.length)) + message.paths = []; + message.paths.push(reader.string()); + break; + } + case 6: { + message.documentation = $root.google.cloud.apihub.v1.Documentation.decode(reader, reader.uint32()); + break; + } + case 7: { + if (message.attributes === $util.emptyObject) + message.attributes = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.apihub.v1.AttributeValues.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.attributes[key] = value; + break; + } + case 8: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 9: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExternalApi message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.ExternalApi + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.ExternalApi} ExternalApi + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExternalApi.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExternalApi message. + * @function verify + * @memberof google.cloud.apihub.v1.ExternalApi + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExternalApi.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.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.endpoints != null && message.hasOwnProperty("endpoints")) { + if (!Array.isArray(message.endpoints)) + return "endpoints: array expected"; + for (var i = 0; i < message.endpoints.length; ++i) + if (!$util.isString(message.endpoints[i])) + return "endpoints: string[] 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"; + } + if (message.documentation != null && message.hasOwnProperty("documentation")) { + var error = $root.google.cloud.apihub.v1.Documentation.verify(message.documentation); + if (error) + return "documentation." + error; + } + if (message.attributes != null && message.hasOwnProperty("attributes")) { + if (!$util.isObject(message.attributes)) + return "attributes: object expected"; + var key = Object.keys(message.attributes); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.apihub.v1.AttributeValues.verify(message.attributes[key[i]]); + if (error) + return "attributes." + error; + } + } + 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; + } + return null; + }; + + /** + * Creates an ExternalApi message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.ExternalApi + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.ExternalApi} ExternalApi + */ + ExternalApi.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.ExternalApi) + return object; + var message = new $root.google.cloud.apihub.v1.ExternalApi(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.endpoints) { + if (!Array.isArray(object.endpoints)) + throw TypeError(".google.cloud.apihub.v1.ExternalApi.endpoints: array expected"); + message.endpoints = []; + for (var i = 0; i < object.endpoints.length; ++i) + message.endpoints[i] = String(object.endpoints[i]); + } + if (object.paths) { + if (!Array.isArray(object.paths)) + throw TypeError(".google.cloud.apihub.v1.ExternalApi.paths: array expected"); + message.paths = []; + for (var i = 0; i < object.paths.length; ++i) + message.paths[i] = String(object.paths[i]); + } + if (object.documentation != null) { + if (typeof object.documentation !== "object") + throw TypeError(".google.cloud.apihub.v1.ExternalApi.documentation: object expected"); + message.documentation = $root.google.cloud.apihub.v1.Documentation.fromObject(object.documentation); + } + if (object.attributes) { + if (typeof object.attributes !== "object") + throw TypeError(".google.cloud.apihub.v1.ExternalApi.attributes: object expected"); + message.attributes = {}; + for (var keys = Object.keys(object.attributes), i = 0; i < keys.length; ++i) { + if (typeof object.attributes[keys[i]] !== "object") + throw TypeError(".google.cloud.apihub.v1.ExternalApi.attributes: object expected"); + message.attributes[keys[i]] = $root.google.cloud.apihub.v1.AttributeValues.fromObject(object.attributes[keys[i]]); + } + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.apihub.v1.ExternalApi.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.apihub.v1.ExternalApi.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + return message; + }; + + /** + * Creates a plain object from an ExternalApi message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.ExternalApi + * @static + * @param {google.cloud.apihub.v1.ExternalApi} message ExternalApi + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExternalApi.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.endpoints = []; + object.paths = []; + } + if (options.objects || options.defaults) + object.attributes = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.description = ""; + object.documentation = null; + object.createTime = null; + object.updateTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.endpoints && message.endpoints.length) { + object.endpoints = []; + for (var j = 0; j < message.endpoints.length; ++j) + object.endpoints[j] = message.endpoints[j]; + } + if (message.paths && message.paths.length) { + object.paths = []; + for (var j = 0; j < message.paths.length; ++j) + object.paths[j] = message.paths[j]; + } + if (message.documentation != null && message.hasOwnProperty("documentation")) + object.documentation = $root.google.cloud.apihub.v1.Documentation.toObject(message.documentation, options); + var keys2; + if (message.attributes && (keys2 = Object.keys(message.attributes)).length) { + object.attributes = {}; + for (var j = 0; j < keys2.length; ++j) + object.attributes[keys2[j]] = $root.google.cloud.apihub.v1.AttributeValues.toObject(message.attributes[keys2[j]], options); + } + 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); + return object; + }; + + /** + * Converts this ExternalApi to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.ExternalApi + * @instance + * @returns {Object.} JSON object + */ + ExternalApi.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExternalApi + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.ExternalApi + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExternalApi.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.ExternalApi"; + }; + + return ExternalApi; + })(); + + v1.HostProjectRegistrationService = (function() { + + /** + * Constructs a new HostProjectRegistrationService service. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a HostProjectRegistrationService + * @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 HostProjectRegistrationService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (HostProjectRegistrationService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = HostProjectRegistrationService; + + /** + * Creates new HostProjectRegistrationService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.apihub.v1.HostProjectRegistrationService + * @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 {HostProjectRegistrationService} RPC service. Useful where requests and/or responses are streamed. + */ + HostProjectRegistrationService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.apihub.v1.HostProjectRegistrationService|createHostProjectRegistration}. + * @memberof google.cloud.apihub.v1.HostProjectRegistrationService + * @typedef CreateHostProjectRegistrationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apihub.v1.HostProjectRegistration} [response] HostProjectRegistration + */ + + /** + * Calls CreateHostProjectRegistration. + * @function createHostProjectRegistration + * @memberof google.cloud.apihub.v1.HostProjectRegistrationService + * @instance + * @param {google.cloud.apihub.v1.ICreateHostProjectRegistrationRequest} request CreateHostProjectRegistrationRequest message or plain object + * @param {google.cloud.apihub.v1.HostProjectRegistrationService.CreateHostProjectRegistrationCallback} callback Node-style callback called with the error, if any, and HostProjectRegistration + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(HostProjectRegistrationService.prototype.createHostProjectRegistration = function createHostProjectRegistration(request, callback) { + return this.rpcCall(createHostProjectRegistration, $root.google.cloud.apihub.v1.CreateHostProjectRegistrationRequest, $root.google.cloud.apihub.v1.HostProjectRegistration, request, callback); + }, "name", { value: "CreateHostProjectRegistration" }); + + /** + * Calls CreateHostProjectRegistration. + * @function createHostProjectRegistration + * @memberof google.cloud.apihub.v1.HostProjectRegistrationService + * @instance + * @param {google.cloud.apihub.v1.ICreateHostProjectRegistrationRequest} request CreateHostProjectRegistrationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.HostProjectRegistrationService|getHostProjectRegistration}. + * @memberof google.cloud.apihub.v1.HostProjectRegistrationService + * @typedef GetHostProjectRegistrationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apihub.v1.HostProjectRegistration} [response] HostProjectRegistration + */ + + /** + * Calls GetHostProjectRegistration. + * @function getHostProjectRegistration + * @memberof google.cloud.apihub.v1.HostProjectRegistrationService + * @instance + * @param {google.cloud.apihub.v1.IGetHostProjectRegistrationRequest} request GetHostProjectRegistrationRequest message or plain object + * @param {google.cloud.apihub.v1.HostProjectRegistrationService.GetHostProjectRegistrationCallback} callback Node-style callback called with the error, if any, and HostProjectRegistration + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(HostProjectRegistrationService.prototype.getHostProjectRegistration = function getHostProjectRegistration(request, callback) { + return this.rpcCall(getHostProjectRegistration, $root.google.cloud.apihub.v1.GetHostProjectRegistrationRequest, $root.google.cloud.apihub.v1.HostProjectRegistration, request, callback); + }, "name", { value: "GetHostProjectRegistration" }); + + /** + * Calls GetHostProjectRegistration. + * @function getHostProjectRegistration + * @memberof google.cloud.apihub.v1.HostProjectRegistrationService + * @instance + * @param {google.cloud.apihub.v1.IGetHostProjectRegistrationRequest} request GetHostProjectRegistrationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.HostProjectRegistrationService|listHostProjectRegistrations}. + * @memberof google.cloud.apihub.v1.HostProjectRegistrationService + * @typedef ListHostProjectRegistrationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apihub.v1.ListHostProjectRegistrationsResponse} [response] ListHostProjectRegistrationsResponse + */ + + /** + * Calls ListHostProjectRegistrations. + * @function listHostProjectRegistrations + * @memberof google.cloud.apihub.v1.HostProjectRegistrationService + * @instance + * @param {google.cloud.apihub.v1.IListHostProjectRegistrationsRequest} request ListHostProjectRegistrationsRequest message or plain object + * @param {google.cloud.apihub.v1.HostProjectRegistrationService.ListHostProjectRegistrationsCallback} callback Node-style callback called with the error, if any, and ListHostProjectRegistrationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(HostProjectRegistrationService.prototype.listHostProjectRegistrations = function listHostProjectRegistrations(request, callback) { + return this.rpcCall(listHostProjectRegistrations, $root.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest, $root.google.cloud.apihub.v1.ListHostProjectRegistrationsResponse, request, callback); + }, "name", { value: "ListHostProjectRegistrations" }); + + /** + * Calls ListHostProjectRegistrations. + * @function listHostProjectRegistrations + * @memberof google.cloud.apihub.v1.HostProjectRegistrationService + * @instance + * @param {google.cloud.apihub.v1.IListHostProjectRegistrationsRequest} request ListHostProjectRegistrationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return HostProjectRegistrationService; + })(); + + v1.CreateHostProjectRegistrationRequest = (function() { + + /** + * Properties of a CreateHostProjectRegistrationRequest. + * @memberof google.cloud.apihub.v1 + * @interface ICreateHostProjectRegistrationRequest + * @property {string|null} [parent] CreateHostProjectRegistrationRequest parent + * @property {string|null} [hostProjectRegistrationId] CreateHostProjectRegistrationRequest hostProjectRegistrationId + * @property {google.cloud.apihub.v1.IHostProjectRegistration|null} [hostProjectRegistration] CreateHostProjectRegistrationRequest hostProjectRegistration + */ + + /** + * Constructs a new CreateHostProjectRegistrationRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a CreateHostProjectRegistrationRequest. + * @implements ICreateHostProjectRegistrationRequest + * @constructor + * @param {google.cloud.apihub.v1.ICreateHostProjectRegistrationRequest=} [properties] Properties to set + */ + function CreateHostProjectRegistrationRequest(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]]; + } + + /** + * CreateHostProjectRegistrationRequest parent. + * @member {string} parent + * @memberof google.cloud.apihub.v1.CreateHostProjectRegistrationRequest + * @instance + */ + CreateHostProjectRegistrationRequest.prototype.parent = ""; + + /** + * CreateHostProjectRegistrationRequest hostProjectRegistrationId. + * @member {string} hostProjectRegistrationId + * @memberof google.cloud.apihub.v1.CreateHostProjectRegistrationRequest + * @instance + */ + CreateHostProjectRegistrationRequest.prototype.hostProjectRegistrationId = ""; + + /** + * CreateHostProjectRegistrationRequest hostProjectRegistration. + * @member {google.cloud.apihub.v1.IHostProjectRegistration|null|undefined} hostProjectRegistration + * @memberof google.cloud.apihub.v1.CreateHostProjectRegistrationRequest + * @instance + */ + CreateHostProjectRegistrationRequest.prototype.hostProjectRegistration = null; + + /** + * Creates a new CreateHostProjectRegistrationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.CreateHostProjectRegistrationRequest + * @static + * @param {google.cloud.apihub.v1.ICreateHostProjectRegistrationRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.CreateHostProjectRegistrationRequest} CreateHostProjectRegistrationRequest instance + */ + CreateHostProjectRegistrationRequest.create = function create(properties) { + return new CreateHostProjectRegistrationRequest(properties); + }; + + /** + * Encodes the specified CreateHostProjectRegistrationRequest message. Does not implicitly {@link google.cloud.apihub.v1.CreateHostProjectRegistrationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.CreateHostProjectRegistrationRequest + * @static + * @param {google.cloud.apihub.v1.ICreateHostProjectRegistrationRequest} message CreateHostProjectRegistrationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateHostProjectRegistrationRequest.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.hostProjectRegistrationId != null && Object.hasOwnProperty.call(message, "hostProjectRegistrationId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.hostProjectRegistrationId); + if (message.hostProjectRegistration != null && Object.hasOwnProperty.call(message, "hostProjectRegistration")) + $root.google.cloud.apihub.v1.HostProjectRegistration.encode(message.hostProjectRegistration, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateHostProjectRegistrationRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.CreateHostProjectRegistrationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.CreateHostProjectRegistrationRequest + * @static + * @param {google.cloud.apihub.v1.ICreateHostProjectRegistrationRequest} message CreateHostProjectRegistrationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateHostProjectRegistrationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateHostProjectRegistrationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.CreateHostProjectRegistrationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.CreateHostProjectRegistrationRequest} CreateHostProjectRegistrationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateHostProjectRegistrationRequest.decode = function 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.apihub.v1.CreateHostProjectRegistrationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.hostProjectRegistrationId = reader.string(); + break; + } + case 3: { + message.hostProjectRegistration = $root.google.cloud.apihub.v1.HostProjectRegistration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateHostProjectRegistrationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.CreateHostProjectRegistrationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.CreateHostProjectRegistrationRequest} CreateHostProjectRegistrationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateHostProjectRegistrationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateHostProjectRegistrationRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.CreateHostProjectRegistrationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateHostProjectRegistrationRequest.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.hostProjectRegistrationId != null && message.hasOwnProperty("hostProjectRegistrationId")) + if (!$util.isString(message.hostProjectRegistrationId)) + return "hostProjectRegistrationId: string expected"; + if (message.hostProjectRegistration != null && message.hasOwnProperty("hostProjectRegistration")) { + var error = $root.google.cloud.apihub.v1.HostProjectRegistration.verify(message.hostProjectRegistration); + if (error) + return "hostProjectRegistration." + error; + } + return null; + }; + + /** + * Creates a CreateHostProjectRegistrationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.CreateHostProjectRegistrationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.CreateHostProjectRegistrationRequest} CreateHostProjectRegistrationRequest + */ + CreateHostProjectRegistrationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.CreateHostProjectRegistrationRequest) + return object; + var message = new $root.google.cloud.apihub.v1.CreateHostProjectRegistrationRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.hostProjectRegistrationId != null) + message.hostProjectRegistrationId = String(object.hostProjectRegistrationId); + if (object.hostProjectRegistration != null) { + if (typeof object.hostProjectRegistration !== "object") + throw TypeError(".google.cloud.apihub.v1.CreateHostProjectRegistrationRequest.hostProjectRegistration: object expected"); + message.hostProjectRegistration = $root.google.cloud.apihub.v1.HostProjectRegistration.fromObject(object.hostProjectRegistration); + } + return message; + }; + + /** + * Creates a plain object from a CreateHostProjectRegistrationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.CreateHostProjectRegistrationRequest + * @static + * @param {google.cloud.apihub.v1.CreateHostProjectRegistrationRequest} message CreateHostProjectRegistrationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateHostProjectRegistrationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.hostProjectRegistrationId = ""; + object.hostProjectRegistration = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.hostProjectRegistrationId != null && message.hasOwnProperty("hostProjectRegistrationId")) + object.hostProjectRegistrationId = message.hostProjectRegistrationId; + if (message.hostProjectRegistration != null && message.hasOwnProperty("hostProjectRegistration")) + object.hostProjectRegistration = $root.google.cloud.apihub.v1.HostProjectRegistration.toObject(message.hostProjectRegistration, options); + return object; + }; + + /** + * Converts this CreateHostProjectRegistrationRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.CreateHostProjectRegistrationRequest + * @instance + * @returns {Object.} JSON object + */ + CreateHostProjectRegistrationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateHostProjectRegistrationRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.CreateHostProjectRegistrationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateHostProjectRegistrationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.CreateHostProjectRegistrationRequest"; + }; + + return CreateHostProjectRegistrationRequest; + })(); + + v1.GetHostProjectRegistrationRequest = (function() { + + /** + * Properties of a GetHostProjectRegistrationRequest. + * @memberof google.cloud.apihub.v1 + * @interface IGetHostProjectRegistrationRequest + * @property {string|null} [name] GetHostProjectRegistrationRequest name + */ + + /** + * Constructs a new GetHostProjectRegistrationRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a GetHostProjectRegistrationRequest. + * @implements IGetHostProjectRegistrationRequest + * @constructor + * @param {google.cloud.apihub.v1.IGetHostProjectRegistrationRequest=} [properties] Properties to set + */ + function GetHostProjectRegistrationRequest(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]]; + } + + /** + * GetHostProjectRegistrationRequest name. + * @member {string} name + * @memberof google.cloud.apihub.v1.GetHostProjectRegistrationRequest + * @instance + */ + GetHostProjectRegistrationRequest.prototype.name = ""; + + /** + * Creates a new GetHostProjectRegistrationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.GetHostProjectRegistrationRequest + * @static + * @param {google.cloud.apihub.v1.IGetHostProjectRegistrationRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.GetHostProjectRegistrationRequest} GetHostProjectRegistrationRequest instance + */ + GetHostProjectRegistrationRequest.create = function create(properties) { + return new GetHostProjectRegistrationRequest(properties); + }; + + /** + * Encodes the specified GetHostProjectRegistrationRequest message. Does not implicitly {@link google.cloud.apihub.v1.GetHostProjectRegistrationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.GetHostProjectRegistrationRequest + * @static + * @param {google.cloud.apihub.v1.IGetHostProjectRegistrationRequest} message GetHostProjectRegistrationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetHostProjectRegistrationRequest.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 GetHostProjectRegistrationRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.GetHostProjectRegistrationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.GetHostProjectRegistrationRequest + * @static + * @param {google.cloud.apihub.v1.IGetHostProjectRegistrationRequest} message GetHostProjectRegistrationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetHostProjectRegistrationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetHostProjectRegistrationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.GetHostProjectRegistrationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.GetHostProjectRegistrationRequest} GetHostProjectRegistrationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetHostProjectRegistrationRequest.decode = function 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.apihub.v1.GetHostProjectRegistrationRequest(); + 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 GetHostProjectRegistrationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.GetHostProjectRegistrationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.GetHostProjectRegistrationRequest} GetHostProjectRegistrationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetHostProjectRegistrationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetHostProjectRegistrationRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.GetHostProjectRegistrationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetHostProjectRegistrationRequest.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 GetHostProjectRegistrationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.GetHostProjectRegistrationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.GetHostProjectRegistrationRequest} GetHostProjectRegistrationRequest + */ + GetHostProjectRegistrationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.GetHostProjectRegistrationRequest) + return object; + var message = new $root.google.cloud.apihub.v1.GetHostProjectRegistrationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetHostProjectRegistrationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.GetHostProjectRegistrationRequest + * @static + * @param {google.cloud.apihub.v1.GetHostProjectRegistrationRequest} message GetHostProjectRegistrationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetHostProjectRegistrationRequest.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 GetHostProjectRegistrationRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.GetHostProjectRegistrationRequest + * @instance + * @returns {Object.} JSON object + */ + GetHostProjectRegistrationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetHostProjectRegistrationRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.GetHostProjectRegistrationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetHostProjectRegistrationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.GetHostProjectRegistrationRequest"; + }; + + return GetHostProjectRegistrationRequest; + })(); + + v1.ListHostProjectRegistrationsRequest = (function() { + + /** + * Properties of a ListHostProjectRegistrationsRequest. + * @memberof google.cloud.apihub.v1 + * @interface IListHostProjectRegistrationsRequest + * @property {string|null} [parent] ListHostProjectRegistrationsRequest parent + * @property {number|null} [pageSize] ListHostProjectRegistrationsRequest pageSize + * @property {string|null} [pageToken] ListHostProjectRegistrationsRequest pageToken + * @property {string|null} [filter] ListHostProjectRegistrationsRequest filter + * @property {string|null} [orderBy] ListHostProjectRegistrationsRequest orderBy + */ + + /** + * Constructs a new ListHostProjectRegistrationsRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a ListHostProjectRegistrationsRequest. + * @implements IListHostProjectRegistrationsRequest + * @constructor + * @param {google.cloud.apihub.v1.IListHostProjectRegistrationsRequest=} [properties] Properties to set + */ + function ListHostProjectRegistrationsRequest(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]]; + } + + /** + * ListHostProjectRegistrationsRequest parent. + * @member {string} parent + * @memberof google.cloud.apihub.v1.ListHostProjectRegistrationsRequest + * @instance + */ + ListHostProjectRegistrationsRequest.prototype.parent = ""; + + /** + * ListHostProjectRegistrationsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.apihub.v1.ListHostProjectRegistrationsRequest + * @instance + */ + ListHostProjectRegistrationsRequest.prototype.pageSize = 0; + + /** + * ListHostProjectRegistrationsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.apihub.v1.ListHostProjectRegistrationsRequest + * @instance + */ + ListHostProjectRegistrationsRequest.prototype.pageToken = ""; + + /** + * ListHostProjectRegistrationsRequest filter. + * @member {string} filter + * @memberof google.cloud.apihub.v1.ListHostProjectRegistrationsRequest + * @instance + */ + ListHostProjectRegistrationsRequest.prototype.filter = ""; + + /** + * ListHostProjectRegistrationsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.apihub.v1.ListHostProjectRegistrationsRequest + * @instance + */ + ListHostProjectRegistrationsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListHostProjectRegistrationsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.ListHostProjectRegistrationsRequest + * @static + * @param {google.cloud.apihub.v1.IListHostProjectRegistrationsRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.ListHostProjectRegistrationsRequest} ListHostProjectRegistrationsRequest instance + */ + ListHostProjectRegistrationsRequest.create = function create(properties) { + return new ListHostProjectRegistrationsRequest(properties); + }; + + /** + * Encodes the specified ListHostProjectRegistrationsRequest message. Does not implicitly {@link google.cloud.apihub.v1.ListHostProjectRegistrationsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.ListHostProjectRegistrationsRequest + * @static + * @param {google.cloud.apihub.v1.IListHostProjectRegistrationsRequest} message ListHostProjectRegistrationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListHostProjectRegistrationsRequest.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); + return writer; + }; + + /** + * Encodes the specified ListHostProjectRegistrationsRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListHostProjectRegistrationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.ListHostProjectRegistrationsRequest + * @static + * @param {google.cloud.apihub.v1.IListHostProjectRegistrationsRequest} message ListHostProjectRegistrationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListHostProjectRegistrationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListHostProjectRegistrationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.ListHostProjectRegistrationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.ListHostProjectRegistrationsRequest} ListHostProjectRegistrationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListHostProjectRegistrationsRequest.decode = function 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.apihub.v1.ListHostProjectRegistrationsRequest(); + 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; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListHostProjectRegistrationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.ListHostProjectRegistrationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.ListHostProjectRegistrationsRequest} ListHostProjectRegistrationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListHostProjectRegistrationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListHostProjectRegistrationsRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.ListHostProjectRegistrationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListHostProjectRegistrationsRequest.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"; + return null; + }; + + /** + * Creates a ListHostProjectRegistrationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.ListHostProjectRegistrationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.ListHostProjectRegistrationsRequest} ListHostProjectRegistrationsRequest + */ + ListHostProjectRegistrationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest) + return object; + var message = new $root.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest(); + 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); + return message; + }; + + /** + * Creates a plain object from a ListHostProjectRegistrationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.ListHostProjectRegistrationsRequest + * @static + * @param {google.cloud.apihub.v1.ListHostProjectRegistrationsRequest} message ListHostProjectRegistrationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListHostProjectRegistrationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + 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; + return object; + }; + + /** + * Converts this ListHostProjectRegistrationsRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.ListHostProjectRegistrationsRequest + * @instance + * @returns {Object.} JSON object + */ + ListHostProjectRegistrationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListHostProjectRegistrationsRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.ListHostProjectRegistrationsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListHostProjectRegistrationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.ListHostProjectRegistrationsRequest"; + }; + + return ListHostProjectRegistrationsRequest; + })(); + + v1.ListHostProjectRegistrationsResponse = (function() { + + /** + * Properties of a ListHostProjectRegistrationsResponse. + * @memberof google.cloud.apihub.v1 + * @interface IListHostProjectRegistrationsResponse + * @property {Array.|null} [hostProjectRegistrations] ListHostProjectRegistrationsResponse hostProjectRegistrations + * @property {string|null} [nextPageToken] ListHostProjectRegistrationsResponse nextPageToken + */ + + /** + * Constructs a new ListHostProjectRegistrationsResponse. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a ListHostProjectRegistrationsResponse. + * @implements IListHostProjectRegistrationsResponse + * @constructor + * @param {google.cloud.apihub.v1.IListHostProjectRegistrationsResponse=} [properties] Properties to set + */ + function ListHostProjectRegistrationsResponse(properties) { + this.hostProjectRegistrations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListHostProjectRegistrationsResponse hostProjectRegistrations. + * @member {Array.} hostProjectRegistrations + * @memberof google.cloud.apihub.v1.ListHostProjectRegistrationsResponse + * @instance + */ + ListHostProjectRegistrationsResponse.prototype.hostProjectRegistrations = $util.emptyArray; + + /** + * ListHostProjectRegistrationsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.apihub.v1.ListHostProjectRegistrationsResponse + * @instance + */ + ListHostProjectRegistrationsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListHostProjectRegistrationsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.ListHostProjectRegistrationsResponse + * @static + * @param {google.cloud.apihub.v1.IListHostProjectRegistrationsResponse=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.ListHostProjectRegistrationsResponse} ListHostProjectRegistrationsResponse instance + */ + ListHostProjectRegistrationsResponse.create = function create(properties) { + return new ListHostProjectRegistrationsResponse(properties); + }; + + /** + * Encodes the specified ListHostProjectRegistrationsResponse message. Does not implicitly {@link google.cloud.apihub.v1.ListHostProjectRegistrationsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.ListHostProjectRegistrationsResponse + * @static + * @param {google.cloud.apihub.v1.IListHostProjectRegistrationsResponse} message ListHostProjectRegistrationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListHostProjectRegistrationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.hostProjectRegistrations != null && message.hostProjectRegistrations.length) + for (var i = 0; i < message.hostProjectRegistrations.length; ++i) + $root.google.cloud.apihub.v1.HostProjectRegistration.encode(message.hostProjectRegistrations[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 ListHostProjectRegistrationsResponse message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListHostProjectRegistrationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.ListHostProjectRegistrationsResponse + * @static + * @param {google.cloud.apihub.v1.IListHostProjectRegistrationsResponse} message ListHostProjectRegistrationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListHostProjectRegistrationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListHostProjectRegistrationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.ListHostProjectRegistrationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.ListHostProjectRegistrationsResponse} ListHostProjectRegistrationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListHostProjectRegistrationsResponse.decode = function 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.apihub.v1.ListHostProjectRegistrationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.hostProjectRegistrations && message.hostProjectRegistrations.length)) + message.hostProjectRegistrations = []; + message.hostProjectRegistrations.push($root.google.cloud.apihub.v1.HostProjectRegistration.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListHostProjectRegistrationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.ListHostProjectRegistrationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.ListHostProjectRegistrationsResponse} ListHostProjectRegistrationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListHostProjectRegistrationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListHostProjectRegistrationsResponse message. + * @function verify + * @memberof google.cloud.apihub.v1.ListHostProjectRegistrationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListHostProjectRegistrationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.hostProjectRegistrations != null && message.hasOwnProperty("hostProjectRegistrations")) { + if (!Array.isArray(message.hostProjectRegistrations)) + return "hostProjectRegistrations: array expected"; + for (var i = 0; i < message.hostProjectRegistrations.length; ++i) { + var error = $root.google.cloud.apihub.v1.HostProjectRegistration.verify(message.hostProjectRegistrations[i]); + if (error) + return "hostProjectRegistrations." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListHostProjectRegistrationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.ListHostProjectRegistrationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.ListHostProjectRegistrationsResponse} ListHostProjectRegistrationsResponse + */ + ListHostProjectRegistrationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.ListHostProjectRegistrationsResponse) + return object; + var message = new $root.google.cloud.apihub.v1.ListHostProjectRegistrationsResponse(); + if (object.hostProjectRegistrations) { + if (!Array.isArray(object.hostProjectRegistrations)) + throw TypeError(".google.cloud.apihub.v1.ListHostProjectRegistrationsResponse.hostProjectRegistrations: array expected"); + message.hostProjectRegistrations = []; + for (var i = 0; i < object.hostProjectRegistrations.length; ++i) { + if (typeof object.hostProjectRegistrations[i] !== "object") + throw TypeError(".google.cloud.apihub.v1.ListHostProjectRegistrationsResponse.hostProjectRegistrations: object expected"); + message.hostProjectRegistrations[i] = $root.google.cloud.apihub.v1.HostProjectRegistration.fromObject(object.hostProjectRegistrations[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListHostProjectRegistrationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.ListHostProjectRegistrationsResponse + * @static + * @param {google.cloud.apihub.v1.ListHostProjectRegistrationsResponse} message ListHostProjectRegistrationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListHostProjectRegistrationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.hostProjectRegistrations = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.hostProjectRegistrations && message.hostProjectRegistrations.length) { + object.hostProjectRegistrations = []; + for (var j = 0; j < message.hostProjectRegistrations.length; ++j) + object.hostProjectRegistrations[j] = $root.google.cloud.apihub.v1.HostProjectRegistration.toObject(message.hostProjectRegistrations[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListHostProjectRegistrationsResponse to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.ListHostProjectRegistrationsResponse + * @instance + * @returns {Object.} JSON object + */ + ListHostProjectRegistrationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListHostProjectRegistrationsResponse + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.ListHostProjectRegistrationsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListHostProjectRegistrationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.ListHostProjectRegistrationsResponse"; + }; + + return ListHostProjectRegistrationsResponse; + })(); + + v1.HostProjectRegistration = (function() { + + /** + * Properties of a HostProjectRegistration. + * @memberof google.cloud.apihub.v1 + * @interface IHostProjectRegistration + * @property {string|null} [name] HostProjectRegistration name + * @property {string|null} [gcpProject] HostProjectRegistration gcpProject + * @property {google.protobuf.ITimestamp|null} [createTime] HostProjectRegistration createTime + */ + + /** + * Constructs a new HostProjectRegistration. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a HostProjectRegistration. + * @implements IHostProjectRegistration + * @constructor + * @param {google.cloud.apihub.v1.IHostProjectRegistration=} [properties] Properties to set + */ + function HostProjectRegistration(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]]; + } + + /** + * HostProjectRegistration name. + * @member {string} name + * @memberof google.cloud.apihub.v1.HostProjectRegistration + * @instance + */ + HostProjectRegistration.prototype.name = ""; + + /** + * HostProjectRegistration gcpProject. + * @member {string} gcpProject + * @memberof google.cloud.apihub.v1.HostProjectRegistration + * @instance + */ + HostProjectRegistration.prototype.gcpProject = ""; + + /** + * HostProjectRegistration createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.apihub.v1.HostProjectRegistration + * @instance + */ + HostProjectRegistration.prototype.createTime = null; + + /** + * Creates a new HostProjectRegistration instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.HostProjectRegistration + * @static + * @param {google.cloud.apihub.v1.IHostProjectRegistration=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.HostProjectRegistration} HostProjectRegistration instance + */ + HostProjectRegistration.create = function create(properties) { + return new HostProjectRegistration(properties); + }; + + /** + * Encodes the specified HostProjectRegistration message. Does not implicitly {@link google.cloud.apihub.v1.HostProjectRegistration.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.HostProjectRegistration + * @static + * @param {google.cloud.apihub.v1.IHostProjectRegistration} message HostProjectRegistration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HostProjectRegistration.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.gcpProject != null && Object.hasOwnProperty.call(message, "gcpProject")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.gcpProject); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified HostProjectRegistration message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.HostProjectRegistration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.HostProjectRegistration + * @static + * @param {google.cloud.apihub.v1.IHostProjectRegistration} message HostProjectRegistration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HostProjectRegistration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HostProjectRegistration message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.HostProjectRegistration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.HostProjectRegistration} HostProjectRegistration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HostProjectRegistration.decode = function 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.apihub.v1.HostProjectRegistration(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.gcpProject = reader.string(); + break; + } + case 3: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HostProjectRegistration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.HostProjectRegistration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.HostProjectRegistration} HostProjectRegistration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HostProjectRegistration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HostProjectRegistration message. + * @function verify + * @memberof google.cloud.apihub.v1.HostProjectRegistration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HostProjectRegistration.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.gcpProject != null && message.hasOwnProperty("gcpProject")) + if (!$util.isString(message.gcpProject)) + return "gcpProject: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + return null; + }; + + /** + * Creates a HostProjectRegistration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.HostProjectRegistration + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.HostProjectRegistration} HostProjectRegistration + */ + HostProjectRegistration.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.HostProjectRegistration) + return object; + var message = new $root.google.cloud.apihub.v1.HostProjectRegistration(); + if (object.name != null) + message.name = String(object.name); + if (object.gcpProject != null) + message.gcpProject = String(object.gcpProject); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.apihub.v1.HostProjectRegistration.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + return message; + }; + + /** + * Creates a plain object from a HostProjectRegistration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.HostProjectRegistration + * @static + * @param {google.cloud.apihub.v1.HostProjectRegistration} message HostProjectRegistration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HostProjectRegistration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.gcpProject = ""; + object.createTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.gcpProject != null && message.hasOwnProperty("gcpProject")) + object.gcpProject = message.gcpProject; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + return object; + }; + + /** + * Converts this HostProjectRegistration to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.HostProjectRegistration + * @instance + * @returns {Object.} JSON object + */ + HostProjectRegistration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HostProjectRegistration + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.HostProjectRegistration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HostProjectRegistration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.HostProjectRegistration"; + }; + + return HostProjectRegistration; + })(); + + v1.LintingService = (function() { + + /** + * Constructs a new LintingService service. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a LintingService + * @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 LintingService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (LintingService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = LintingService; + + /** + * Creates new LintingService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.apihub.v1.LintingService + * @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 {LintingService} RPC service. Useful where requests and/or responses are streamed. + */ + LintingService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.apihub.v1.LintingService|getStyleGuide}. + * @memberof google.cloud.apihub.v1.LintingService + * @typedef GetStyleGuideCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apihub.v1.StyleGuide} [response] StyleGuide + */ + + /** + * Calls GetStyleGuide. + * @function getStyleGuide + * @memberof google.cloud.apihub.v1.LintingService + * @instance + * @param {google.cloud.apihub.v1.IGetStyleGuideRequest} request GetStyleGuideRequest message or plain object + * @param {google.cloud.apihub.v1.LintingService.GetStyleGuideCallback} callback Node-style callback called with the error, if any, and StyleGuide + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(LintingService.prototype.getStyleGuide = function getStyleGuide(request, callback) { + return this.rpcCall(getStyleGuide, $root.google.cloud.apihub.v1.GetStyleGuideRequest, $root.google.cloud.apihub.v1.StyleGuide, request, callback); + }, "name", { value: "GetStyleGuide" }); + + /** + * Calls GetStyleGuide. + * @function getStyleGuide + * @memberof google.cloud.apihub.v1.LintingService + * @instance + * @param {google.cloud.apihub.v1.IGetStyleGuideRequest} request GetStyleGuideRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.LintingService|updateStyleGuide}. + * @memberof google.cloud.apihub.v1.LintingService + * @typedef UpdateStyleGuideCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apihub.v1.StyleGuide} [response] StyleGuide + */ + + /** + * Calls UpdateStyleGuide. + * @function updateStyleGuide + * @memberof google.cloud.apihub.v1.LintingService + * @instance + * @param {google.cloud.apihub.v1.IUpdateStyleGuideRequest} request UpdateStyleGuideRequest message or plain object + * @param {google.cloud.apihub.v1.LintingService.UpdateStyleGuideCallback} callback Node-style callback called with the error, if any, and StyleGuide + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(LintingService.prototype.updateStyleGuide = function updateStyleGuide(request, callback) { + return this.rpcCall(updateStyleGuide, $root.google.cloud.apihub.v1.UpdateStyleGuideRequest, $root.google.cloud.apihub.v1.StyleGuide, request, callback); + }, "name", { value: "UpdateStyleGuide" }); + + /** + * Calls UpdateStyleGuide. + * @function updateStyleGuide + * @memberof google.cloud.apihub.v1.LintingService + * @instance + * @param {google.cloud.apihub.v1.IUpdateStyleGuideRequest} request UpdateStyleGuideRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.LintingService|getStyleGuideContents}. + * @memberof google.cloud.apihub.v1.LintingService + * @typedef GetStyleGuideContentsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apihub.v1.StyleGuideContents} [response] StyleGuideContents + */ + + /** + * Calls GetStyleGuideContents. + * @function getStyleGuideContents + * @memberof google.cloud.apihub.v1.LintingService + * @instance + * @param {google.cloud.apihub.v1.IGetStyleGuideContentsRequest} request GetStyleGuideContentsRequest message or plain object + * @param {google.cloud.apihub.v1.LintingService.GetStyleGuideContentsCallback} callback Node-style callback called with the error, if any, and StyleGuideContents + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(LintingService.prototype.getStyleGuideContents = function getStyleGuideContents(request, callback) { + return this.rpcCall(getStyleGuideContents, $root.google.cloud.apihub.v1.GetStyleGuideContentsRequest, $root.google.cloud.apihub.v1.StyleGuideContents, request, callback); + }, "name", { value: "GetStyleGuideContents" }); + + /** + * Calls GetStyleGuideContents. + * @function getStyleGuideContents + * @memberof google.cloud.apihub.v1.LintingService + * @instance + * @param {google.cloud.apihub.v1.IGetStyleGuideContentsRequest} request GetStyleGuideContentsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.LintingService|lintSpec}. + * @memberof google.cloud.apihub.v1.LintingService + * @typedef LintSpecCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls LintSpec. + * @function lintSpec + * @memberof google.cloud.apihub.v1.LintingService + * @instance + * @param {google.cloud.apihub.v1.ILintSpecRequest} request LintSpecRequest message or plain object + * @param {google.cloud.apihub.v1.LintingService.LintSpecCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(LintingService.prototype.lintSpec = function lintSpec(request, callback) { + return this.rpcCall(lintSpec, $root.google.cloud.apihub.v1.LintSpecRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "LintSpec" }); + + /** + * Calls LintSpec. + * @function lintSpec + * @memberof google.cloud.apihub.v1.LintingService + * @instance + * @param {google.cloud.apihub.v1.ILintSpecRequest} request LintSpecRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return LintingService; + })(); + + v1.GetStyleGuideRequest = (function() { + + /** + * Properties of a GetStyleGuideRequest. + * @memberof google.cloud.apihub.v1 + * @interface IGetStyleGuideRequest + * @property {string|null} [name] GetStyleGuideRequest name + */ + + /** + * Constructs a new GetStyleGuideRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a GetStyleGuideRequest. + * @implements IGetStyleGuideRequest + * @constructor + * @param {google.cloud.apihub.v1.IGetStyleGuideRequest=} [properties] Properties to set + */ + function GetStyleGuideRequest(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]]; + } + + /** + * GetStyleGuideRequest name. + * @member {string} name + * @memberof google.cloud.apihub.v1.GetStyleGuideRequest + * @instance + */ + GetStyleGuideRequest.prototype.name = ""; + + /** + * Creates a new GetStyleGuideRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.GetStyleGuideRequest + * @static + * @param {google.cloud.apihub.v1.IGetStyleGuideRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.GetStyleGuideRequest} GetStyleGuideRequest instance + */ + GetStyleGuideRequest.create = function create(properties) { + return new GetStyleGuideRequest(properties); + }; + + /** + * Encodes the specified GetStyleGuideRequest message. Does not implicitly {@link google.cloud.apihub.v1.GetStyleGuideRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.GetStyleGuideRequest + * @static + * @param {google.cloud.apihub.v1.IGetStyleGuideRequest} message GetStyleGuideRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetStyleGuideRequest.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 GetStyleGuideRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.GetStyleGuideRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.GetStyleGuideRequest + * @static + * @param {google.cloud.apihub.v1.IGetStyleGuideRequest} message GetStyleGuideRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetStyleGuideRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetStyleGuideRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.GetStyleGuideRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.GetStyleGuideRequest} GetStyleGuideRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetStyleGuideRequest.decode = function 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.apihub.v1.GetStyleGuideRequest(); + 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 GetStyleGuideRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.GetStyleGuideRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.GetStyleGuideRequest} GetStyleGuideRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetStyleGuideRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetStyleGuideRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.GetStyleGuideRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetStyleGuideRequest.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 GetStyleGuideRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.GetStyleGuideRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.GetStyleGuideRequest} GetStyleGuideRequest + */ + GetStyleGuideRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.GetStyleGuideRequest) + return object; + var message = new $root.google.cloud.apihub.v1.GetStyleGuideRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetStyleGuideRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.GetStyleGuideRequest + * @static + * @param {google.cloud.apihub.v1.GetStyleGuideRequest} message GetStyleGuideRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetStyleGuideRequest.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 GetStyleGuideRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.GetStyleGuideRequest + * @instance + * @returns {Object.} JSON object + */ + GetStyleGuideRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetStyleGuideRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.GetStyleGuideRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetStyleGuideRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.GetStyleGuideRequest"; + }; + + return GetStyleGuideRequest; + })(); + + v1.UpdateStyleGuideRequest = (function() { + + /** + * Properties of an UpdateStyleGuideRequest. + * @memberof google.cloud.apihub.v1 + * @interface IUpdateStyleGuideRequest + * @property {google.cloud.apihub.v1.IStyleGuide|null} [styleGuide] UpdateStyleGuideRequest styleGuide + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateStyleGuideRequest updateMask + */ + + /** + * Constructs a new UpdateStyleGuideRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents an UpdateStyleGuideRequest. + * @implements IUpdateStyleGuideRequest + * @constructor + * @param {google.cloud.apihub.v1.IUpdateStyleGuideRequest=} [properties] Properties to set + */ + function UpdateStyleGuideRequest(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]]; + } + + /** + * UpdateStyleGuideRequest styleGuide. + * @member {google.cloud.apihub.v1.IStyleGuide|null|undefined} styleGuide + * @memberof google.cloud.apihub.v1.UpdateStyleGuideRequest + * @instance + */ + UpdateStyleGuideRequest.prototype.styleGuide = null; + + /** + * UpdateStyleGuideRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.apihub.v1.UpdateStyleGuideRequest + * @instance + */ + UpdateStyleGuideRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateStyleGuideRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.UpdateStyleGuideRequest + * @static + * @param {google.cloud.apihub.v1.IUpdateStyleGuideRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.UpdateStyleGuideRequest} UpdateStyleGuideRequest instance + */ + UpdateStyleGuideRequest.create = function create(properties) { + return new UpdateStyleGuideRequest(properties); + }; + + /** + * Encodes the specified UpdateStyleGuideRequest message. Does not implicitly {@link google.cloud.apihub.v1.UpdateStyleGuideRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.UpdateStyleGuideRequest + * @static + * @param {google.cloud.apihub.v1.IUpdateStyleGuideRequest} message UpdateStyleGuideRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateStyleGuideRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.styleGuide != null && Object.hasOwnProperty.call(message, "styleGuide")) + $root.google.cloud.apihub.v1.StyleGuide.encode(message.styleGuide, 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 UpdateStyleGuideRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.UpdateStyleGuideRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.UpdateStyleGuideRequest + * @static + * @param {google.cloud.apihub.v1.IUpdateStyleGuideRequest} message UpdateStyleGuideRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateStyleGuideRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateStyleGuideRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.UpdateStyleGuideRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.UpdateStyleGuideRequest} UpdateStyleGuideRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateStyleGuideRequest.decode = function 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.apihub.v1.UpdateStyleGuideRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.styleGuide = $root.google.cloud.apihub.v1.StyleGuide.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 UpdateStyleGuideRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.UpdateStyleGuideRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.UpdateStyleGuideRequest} UpdateStyleGuideRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateStyleGuideRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateStyleGuideRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.UpdateStyleGuideRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateStyleGuideRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.styleGuide != null && message.hasOwnProperty("styleGuide")) { + var error = $root.google.cloud.apihub.v1.StyleGuide.verify(message.styleGuide); + if (error) + return "styleGuide." + 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 UpdateStyleGuideRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.UpdateStyleGuideRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.UpdateStyleGuideRequest} UpdateStyleGuideRequest + */ + UpdateStyleGuideRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.UpdateStyleGuideRequest) + return object; + var message = new $root.google.cloud.apihub.v1.UpdateStyleGuideRequest(); + if (object.styleGuide != null) { + if (typeof object.styleGuide !== "object") + throw TypeError(".google.cloud.apihub.v1.UpdateStyleGuideRequest.styleGuide: object expected"); + message.styleGuide = $root.google.cloud.apihub.v1.StyleGuide.fromObject(object.styleGuide); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.apihub.v1.UpdateStyleGuideRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateStyleGuideRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.UpdateStyleGuideRequest + * @static + * @param {google.cloud.apihub.v1.UpdateStyleGuideRequest} message UpdateStyleGuideRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateStyleGuideRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.styleGuide = null; + object.updateMask = null; + } + if (message.styleGuide != null && message.hasOwnProperty("styleGuide")) + object.styleGuide = $root.google.cloud.apihub.v1.StyleGuide.toObject(message.styleGuide, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateStyleGuideRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.UpdateStyleGuideRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateStyleGuideRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateStyleGuideRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.UpdateStyleGuideRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateStyleGuideRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.UpdateStyleGuideRequest"; + }; + + return UpdateStyleGuideRequest; + })(); + + v1.GetStyleGuideContentsRequest = (function() { + + /** + * Properties of a GetStyleGuideContentsRequest. + * @memberof google.cloud.apihub.v1 + * @interface IGetStyleGuideContentsRequest + * @property {string|null} [name] GetStyleGuideContentsRequest name + */ + + /** + * Constructs a new GetStyleGuideContentsRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a GetStyleGuideContentsRequest. + * @implements IGetStyleGuideContentsRequest + * @constructor + * @param {google.cloud.apihub.v1.IGetStyleGuideContentsRequest=} [properties] Properties to set + */ + function GetStyleGuideContentsRequest(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]]; + } + + /** + * GetStyleGuideContentsRequest name. + * @member {string} name + * @memberof google.cloud.apihub.v1.GetStyleGuideContentsRequest + * @instance + */ + GetStyleGuideContentsRequest.prototype.name = ""; + + /** + * Creates a new GetStyleGuideContentsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.GetStyleGuideContentsRequest + * @static + * @param {google.cloud.apihub.v1.IGetStyleGuideContentsRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.GetStyleGuideContentsRequest} GetStyleGuideContentsRequest instance + */ + GetStyleGuideContentsRequest.create = function create(properties) { + return new GetStyleGuideContentsRequest(properties); + }; + + /** + * Encodes the specified GetStyleGuideContentsRequest message. Does not implicitly {@link google.cloud.apihub.v1.GetStyleGuideContentsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.GetStyleGuideContentsRequest + * @static + * @param {google.cloud.apihub.v1.IGetStyleGuideContentsRequest} message GetStyleGuideContentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetStyleGuideContentsRequest.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 GetStyleGuideContentsRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.GetStyleGuideContentsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.GetStyleGuideContentsRequest + * @static + * @param {google.cloud.apihub.v1.IGetStyleGuideContentsRequest} message GetStyleGuideContentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetStyleGuideContentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetStyleGuideContentsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.GetStyleGuideContentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.GetStyleGuideContentsRequest} GetStyleGuideContentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetStyleGuideContentsRequest.decode = function 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.apihub.v1.GetStyleGuideContentsRequest(); + 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 GetStyleGuideContentsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.GetStyleGuideContentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.GetStyleGuideContentsRequest} GetStyleGuideContentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetStyleGuideContentsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetStyleGuideContentsRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.GetStyleGuideContentsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetStyleGuideContentsRequest.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 GetStyleGuideContentsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.GetStyleGuideContentsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.GetStyleGuideContentsRequest} GetStyleGuideContentsRequest + */ + GetStyleGuideContentsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.GetStyleGuideContentsRequest) + return object; + var message = new $root.google.cloud.apihub.v1.GetStyleGuideContentsRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetStyleGuideContentsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.GetStyleGuideContentsRequest + * @static + * @param {google.cloud.apihub.v1.GetStyleGuideContentsRequest} message GetStyleGuideContentsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetStyleGuideContentsRequest.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 GetStyleGuideContentsRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.GetStyleGuideContentsRequest + * @instance + * @returns {Object.} JSON object + */ + GetStyleGuideContentsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetStyleGuideContentsRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.GetStyleGuideContentsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetStyleGuideContentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.GetStyleGuideContentsRequest"; + }; + + return GetStyleGuideContentsRequest; + })(); + + v1.LintSpecRequest = (function() { + + /** + * Properties of a LintSpecRequest. + * @memberof google.cloud.apihub.v1 + * @interface ILintSpecRequest + * @property {string|null} [name] LintSpecRequest name + */ + + /** + * Constructs a new LintSpecRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a LintSpecRequest. + * @implements ILintSpecRequest + * @constructor + * @param {google.cloud.apihub.v1.ILintSpecRequest=} [properties] Properties to set + */ + function LintSpecRequest(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]]; + } + + /** + * LintSpecRequest name. + * @member {string} name + * @memberof google.cloud.apihub.v1.LintSpecRequest + * @instance + */ + LintSpecRequest.prototype.name = ""; + + /** + * Creates a new LintSpecRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.LintSpecRequest + * @static + * @param {google.cloud.apihub.v1.ILintSpecRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.LintSpecRequest} LintSpecRequest instance + */ + LintSpecRequest.create = function create(properties) { + return new LintSpecRequest(properties); + }; + + /** + * Encodes the specified LintSpecRequest message. Does not implicitly {@link google.cloud.apihub.v1.LintSpecRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.LintSpecRequest + * @static + * @param {google.cloud.apihub.v1.ILintSpecRequest} message LintSpecRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LintSpecRequest.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 LintSpecRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.LintSpecRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.LintSpecRequest + * @static + * @param {google.cloud.apihub.v1.ILintSpecRequest} message LintSpecRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LintSpecRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LintSpecRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.LintSpecRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.LintSpecRequest} LintSpecRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LintSpecRequest.decode = function 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.apihub.v1.LintSpecRequest(); + 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 LintSpecRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.LintSpecRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.LintSpecRequest} LintSpecRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LintSpecRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LintSpecRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.LintSpecRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LintSpecRequest.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 LintSpecRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.LintSpecRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.LintSpecRequest} LintSpecRequest + */ + LintSpecRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.LintSpecRequest) + return object; + var message = new $root.google.cloud.apihub.v1.LintSpecRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a LintSpecRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.LintSpecRequest + * @static + * @param {google.cloud.apihub.v1.LintSpecRequest} message LintSpecRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LintSpecRequest.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 LintSpecRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.LintSpecRequest + * @instance + * @returns {Object.} JSON object + */ + LintSpecRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LintSpecRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.LintSpecRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LintSpecRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.LintSpecRequest"; + }; + + return LintSpecRequest; + })(); + + v1.StyleGuideContents = (function() { + + /** + * Properties of a StyleGuideContents. + * @memberof google.cloud.apihub.v1 + * @interface IStyleGuideContents + * @property {Uint8Array|null} [contents] StyleGuideContents contents + * @property {string|null} [mimeType] StyleGuideContents mimeType + */ + + /** + * Constructs a new StyleGuideContents. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a StyleGuideContents. + * @implements IStyleGuideContents + * @constructor + * @param {google.cloud.apihub.v1.IStyleGuideContents=} [properties] Properties to set + */ + function StyleGuideContents(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]]; + } + + /** + * StyleGuideContents contents. + * @member {Uint8Array} contents + * @memberof google.cloud.apihub.v1.StyleGuideContents + * @instance + */ + StyleGuideContents.prototype.contents = $util.newBuffer([]); + + /** + * StyleGuideContents mimeType. + * @member {string} mimeType + * @memberof google.cloud.apihub.v1.StyleGuideContents + * @instance + */ + StyleGuideContents.prototype.mimeType = ""; + + /** + * Creates a new StyleGuideContents instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.StyleGuideContents + * @static + * @param {google.cloud.apihub.v1.IStyleGuideContents=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.StyleGuideContents} StyleGuideContents instance + */ + StyleGuideContents.create = function create(properties) { + return new StyleGuideContents(properties); + }; + + /** + * Encodes the specified StyleGuideContents message. Does not implicitly {@link google.cloud.apihub.v1.StyleGuideContents.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.StyleGuideContents + * @static + * @param {google.cloud.apihub.v1.IStyleGuideContents} message StyleGuideContents message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StyleGuideContents.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.contents != null && Object.hasOwnProperty.call(message, "contents")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.contents); + if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.mimeType); + return writer; + }; + + /** + * Encodes the specified StyleGuideContents message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.StyleGuideContents.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.StyleGuideContents + * @static + * @param {google.cloud.apihub.v1.IStyleGuideContents} message StyleGuideContents message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StyleGuideContents.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StyleGuideContents message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.StyleGuideContents + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.StyleGuideContents} StyleGuideContents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StyleGuideContents.decode = function 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.apihub.v1.StyleGuideContents(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.contents = reader.bytes(); + break; + } + case 2: { + message.mimeType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StyleGuideContents message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.StyleGuideContents + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.StyleGuideContents} StyleGuideContents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StyleGuideContents.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StyleGuideContents message. + * @function verify + * @memberof google.cloud.apihub.v1.StyleGuideContents + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StyleGuideContents.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.contents != null && message.hasOwnProperty("contents")) + if (!(message.contents && typeof message.contents.length === "number" || $util.isString(message.contents))) + return "contents: buffer expected"; + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + if (!$util.isString(message.mimeType)) + return "mimeType: string expected"; + return null; + }; + + /** + * Creates a StyleGuideContents message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.StyleGuideContents + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.StyleGuideContents} StyleGuideContents + */ + StyleGuideContents.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.StyleGuideContents) + return object; + var message = new $root.google.cloud.apihub.v1.StyleGuideContents(); + if (object.contents != null) + if (typeof object.contents === "string") + $util.base64.decode(object.contents, message.contents = $util.newBuffer($util.base64.length(object.contents)), 0); + else if (object.contents.length >= 0) + message.contents = object.contents; + if (object.mimeType != null) + message.mimeType = String(object.mimeType); + return message; + }; + + /** + * Creates a plain object from a StyleGuideContents message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.StyleGuideContents + * @static + * @param {google.cloud.apihub.v1.StyleGuideContents} message StyleGuideContents + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StyleGuideContents.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.contents = ""; + else { + object.contents = []; + if (options.bytes !== Array) + object.contents = $util.newBuffer(object.contents); + } + object.mimeType = ""; + } + if (message.contents != null && message.hasOwnProperty("contents")) + object.contents = options.bytes === String ? $util.base64.encode(message.contents, 0, message.contents.length) : options.bytes === Array ? Array.prototype.slice.call(message.contents) : message.contents; + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + object.mimeType = message.mimeType; + return object; + }; + + /** + * Converts this StyleGuideContents to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.StyleGuideContents + * @instance + * @returns {Object.} JSON object + */ + StyleGuideContents.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StyleGuideContents + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.StyleGuideContents + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StyleGuideContents.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.StyleGuideContents"; + }; + + return StyleGuideContents; + })(); + + v1.StyleGuide = (function() { + + /** + * Properties of a StyleGuide. + * @memberof google.cloud.apihub.v1 + * @interface IStyleGuide + * @property {string|null} [name] StyleGuide name + * @property {google.cloud.apihub.v1.Linter|null} [linter] StyleGuide linter + * @property {google.cloud.apihub.v1.IStyleGuideContents|null} [contents] StyleGuide contents + */ + + /** + * Constructs a new StyleGuide. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a StyleGuide. + * @implements IStyleGuide + * @constructor + * @param {google.cloud.apihub.v1.IStyleGuide=} [properties] Properties to set + */ + function StyleGuide(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]]; + } + + /** + * StyleGuide name. + * @member {string} name + * @memberof google.cloud.apihub.v1.StyleGuide + * @instance + */ + StyleGuide.prototype.name = ""; + + /** + * StyleGuide linter. + * @member {google.cloud.apihub.v1.Linter} linter + * @memberof google.cloud.apihub.v1.StyleGuide + * @instance + */ + StyleGuide.prototype.linter = 0; + + /** + * StyleGuide contents. + * @member {google.cloud.apihub.v1.IStyleGuideContents|null|undefined} contents + * @memberof google.cloud.apihub.v1.StyleGuide + * @instance + */ + StyleGuide.prototype.contents = null; + + /** + * Creates a new StyleGuide instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.StyleGuide + * @static + * @param {google.cloud.apihub.v1.IStyleGuide=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.StyleGuide} StyleGuide instance + */ + StyleGuide.create = function create(properties) { + return new StyleGuide(properties); + }; + + /** + * Encodes the specified StyleGuide message. Does not implicitly {@link google.cloud.apihub.v1.StyleGuide.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.StyleGuide + * @static + * @param {google.cloud.apihub.v1.IStyleGuide} message StyleGuide message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StyleGuide.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.linter != null && Object.hasOwnProperty.call(message, "linter")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.linter); + if (message.contents != null && Object.hasOwnProperty.call(message, "contents")) + $root.google.cloud.apihub.v1.StyleGuideContents.encode(message.contents, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified StyleGuide message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.StyleGuide.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.StyleGuide + * @static + * @param {google.cloud.apihub.v1.IStyleGuide} message StyleGuide message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StyleGuide.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StyleGuide message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.StyleGuide + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.StyleGuide} StyleGuide + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StyleGuide.decode = function 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.apihub.v1.StyleGuide(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.linter = reader.int32(); + break; + } + case 3: { + message.contents = $root.google.cloud.apihub.v1.StyleGuideContents.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StyleGuide message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.StyleGuide + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.StyleGuide} StyleGuide + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StyleGuide.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StyleGuide message. + * @function verify + * @memberof google.cloud.apihub.v1.StyleGuide + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StyleGuide.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.linter != null && message.hasOwnProperty("linter")) + switch (message.linter) { + default: + return "linter: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.contents != null && message.hasOwnProperty("contents")) { + var error = $root.google.cloud.apihub.v1.StyleGuideContents.verify(message.contents); + if (error) + return "contents." + error; + } + return null; + }; + + /** + * Creates a StyleGuide message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.StyleGuide + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.StyleGuide} StyleGuide + */ + StyleGuide.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.StyleGuide) + return object; + var message = new $root.google.cloud.apihub.v1.StyleGuide(); + if (object.name != null) + message.name = String(object.name); + switch (object.linter) { + default: + if (typeof object.linter === "number") { + message.linter = object.linter; + break; + } + break; + case "LINTER_UNSPECIFIED": + case 0: + message.linter = 0; + break; + case "SPECTRAL": + case 1: + message.linter = 1; + break; + case "OTHER": + case 2: + message.linter = 2; + break; + } + if (object.contents != null) { + if (typeof object.contents !== "object") + throw TypeError(".google.cloud.apihub.v1.StyleGuide.contents: object expected"); + message.contents = $root.google.cloud.apihub.v1.StyleGuideContents.fromObject(object.contents); + } + return message; + }; + + /** + * Creates a plain object from a StyleGuide message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.StyleGuide + * @static + * @param {google.cloud.apihub.v1.StyleGuide} message StyleGuide + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StyleGuide.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.linter = options.enums === String ? "LINTER_UNSPECIFIED" : 0; + object.contents = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.linter != null && message.hasOwnProperty("linter")) + object.linter = options.enums === String ? $root.google.cloud.apihub.v1.Linter[message.linter] === undefined ? message.linter : $root.google.cloud.apihub.v1.Linter[message.linter] : message.linter; + if (message.contents != null && message.hasOwnProperty("contents")) + object.contents = $root.google.cloud.apihub.v1.StyleGuideContents.toObject(message.contents, options); + return object; + }; + + /** + * Converts this StyleGuide to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.StyleGuide + * @instance + * @returns {Object.} JSON object + */ + StyleGuide.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StyleGuide + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.StyleGuide + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StyleGuide.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.StyleGuide"; + }; + + return StyleGuide; + })(); + + v1.ApiHubPlugin = (function() { + + /** + * Constructs a new ApiHubPlugin service. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents an ApiHubPlugin + * @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 ApiHubPlugin(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (ApiHubPlugin.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = ApiHubPlugin; + + /** + * Creates new ApiHubPlugin service using the specified rpc implementation. + * @function create + * @memberof google.cloud.apihub.v1.ApiHubPlugin + * @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 {ApiHubPlugin} RPC service. Useful where requests and/or responses are streamed. + */ + ApiHubPlugin.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHubPlugin|getPlugin}. + * @memberof google.cloud.apihub.v1.ApiHubPlugin + * @typedef GetPluginCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apihub.v1.Plugin} [response] Plugin + */ + + /** + * Calls GetPlugin. + * @function getPlugin + * @memberof google.cloud.apihub.v1.ApiHubPlugin + * @instance + * @param {google.cloud.apihub.v1.IGetPluginRequest} request GetPluginRequest message or plain object + * @param {google.cloud.apihub.v1.ApiHubPlugin.GetPluginCallback} callback Node-style callback called with the error, if any, and Plugin + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ApiHubPlugin.prototype.getPlugin = function getPlugin(request, callback) { + return this.rpcCall(getPlugin, $root.google.cloud.apihub.v1.GetPluginRequest, $root.google.cloud.apihub.v1.Plugin, request, callback); + }, "name", { value: "GetPlugin" }); + + /** + * Calls GetPlugin. + * @function getPlugin + * @memberof google.cloud.apihub.v1.ApiHubPlugin + * @instance + * @param {google.cloud.apihub.v1.IGetPluginRequest} request GetPluginRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHubPlugin|enablePlugin}. + * @memberof google.cloud.apihub.v1.ApiHubPlugin + * @typedef EnablePluginCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apihub.v1.Plugin} [response] Plugin + */ + + /** + * Calls EnablePlugin. + * @function enablePlugin + * @memberof google.cloud.apihub.v1.ApiHubPlugin + * @instance + * @param {google.cloud.apihub.v1.IEnablePluginRequest} request EnablePluginRequest message or plain object + * @param {google.cloud.apihub.v1.ApiHubPlugin.EnablePluginCallback} callback Node-style callback called with the error, if any, and Plugin + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ApiHubPlugin.prototype.enablePlugin = function enablePlugin(request, callback) { + return this.rpcCall(enablePlugin, $root.google.cloud.apihub.v1.EnablePluginRequest, $root.google.cloud.apihub.v1.Plugin, request, callback); + }, "name", { value: "EnablePlugin" }); + + /** + * Calls EnablePlugin. + * @function enablePlugin + * @memberof google.cloud.apihub.v1.ApiHubPlugin + * @instance + * @param {google.cloud.apihub.v1.IEnablePluginRequest} request EnablePluginRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHubPlugin|disablePlugin}. + * @memberof google.cloud.apihub.v1.ApiHubPlugin + * @typedef DisablePluginCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apihub.v1.Plugin} [response] Plugin + */ + + /** + * Calls DisablePlugin. + * @function disablePlugin + * @memberof google.cloud.apihub.v1.ApiHubPlugin + * @instance + * @param {google.cloud.apihub.v1.IDisablePluginRequest} request DisablePluginRequest message or plain object + * @param {google.cloud.apihub.v1.ApiHubPlugin.DisablePluginCallback} callback Node-style callback called with the error, if any, and Plugin + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ApiHubPlugin.prototype.disablePlugin = function disablePlugin(request, callback) { + return this.rpcCall(disablePlugin, $root.google.cloud.apihub.v1.DisablePluginRequest, $root.google.cloud.apihub.v1.Plugin, request, callback); + }, "name", { value: "DisablePlugin" }); + + /** + * Calls DisablePlugin. + * @function disablePlugin + * @memberof google.cloud.apihub.v1.ApiHubPlugin + * @instance + * @param {google.cloud.apihub.v1.IDisablePluginRequest} request DisablePluginRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return ApiHubPlugin; + })(); + + v1.Plugin = (function() { + + /** + * Properties of a Plugin. + * @memberof google.cloud.apihub.v1 + * @interface IPlugin + * @property {string|null} [name] Plugin name + * @property {string|null} [displayName] Plugin displayName + * @property {google.cloud.apihub.v1.IAttributeValues|null} [type] Plugin type + * @property {string|null} [description] Plugin description + * @property {google.cloud.apihub.v1.Plugin.State|null} [state] Plugin state + */ + + /** + * Constructs a new Plugin. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a Plugin. + * @implements IPlugin + * @constructor + * @param {google.cloud.apihub.v1.IPlugin=} [properties] Properties to set + */ + function Plugin(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]]; + } + + /** + * Plugin name. + * @member {string} name + * @memberof google.cloud.apihub.v1.Plugin + * @instance + */ + Plugin.prototype.name = ""; + + /** + * Plugin displayName. + * @member {string} displayName + * @memberof google.cloud.apihub.v1.Plugin + * @instance + */ + Plugin.prototype.displayName = ""; + + /** + * Plugin type. + * @member {google.cloud.apihub.v1.IAttributeValues|null|undefined} type + * @memberof google.cloud.apihub.v1.Plugin + * @instance + */ + Plugin.prototype.type = null; + + /** + * Plugin description. + * @member {string} description + * @memberof google.cloud.apihub.v1.Plugin + * @instance + */ + Plugin.prototype.description = ""; + + /** + * Plugin state. + * @member {google.cloud.apihub.v1.Plugin.State} state + * @memberof google.cloud.apihub.v1.Plugin + * @instance + */ + Plugin.prototype.state = 0; + + /** + * Creates a new Plugin instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.Plugin + * @static + * @param {google.cloud.apihub.v1.IPlugin=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.Plugin} Plugin instance + */ + Plugin.create = function create(properties) { + return new Plugin(properties); + }; + + /** + * Encodes the specified Plugin message. Does not implicitly {@link google.cloud.apihub.v1.Plugin.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.Plugin + * @static + * @param {google.cloud.apihub.v1.IPlugin} message Plugin message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Plugin.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + $root.google.cloud.apihub.v1.AttributeValues.encode(message.type, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.description); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.state); + return writer; + }; + + /** + * Encodes the specified Plugin message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.Plugin.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.Plugin + * @static + * @param {google.cloud.apihub.v1.IPlugin} message Plugin message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Plugin.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Plugin message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.Plugin + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.Plugin} Plugin + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Plugin.decode = function 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.apihub.v1.Plugin(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.type = $root.google.cloud.apihub.v1.AttributeValues.decode(reader, reader.uint32()); + break; + } + case 4: { + message.description = reader.string(); + break; + } + case 5: { + message.state = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Plugin message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.Plugin + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.Plugin} Plugin + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Plugin.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Plugin message. + * @function verify + * @memberof google.cloud.apihub.v1.Plugin + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Plugin.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.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.type != null && message.hasOwnProperty("type")) { + var error = $root.google.cloud.apihub.v1.AttributeValues.verify(message.type); + if (error) + return "type." + error; + } + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + 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 Plugin message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.Plugin + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.Plugin} Plugin + */ + Plugin.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.Plugin) + return object; + var message = new $root.google.cloud.apihub.v1.Plugin(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.type != null) { + if (typeof object.type !== "object") + throw TypeError(".google.cloud.apihub.v1.Plugin.type: object expected"); + message.type = $root.google.cloud.apihub.v1.AttributeValues.fromObject(object.type); + } + if (object.description != null) + message.description = String(object.description); + 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 "ENABLED": + case 1: + message.state = 1; + break; + case "DISABLED": + case 2: + message.state = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a Plugin message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.Plugin + * @static + * @param {google.cloud.apihub.v1.Plugin} message Plugin + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Plugin.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.type = null; + object.description = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.type != null && message.hasOwnProperty("type")) + object.type = $root.google.cloud.apihub.v1.AttributeValues.toObject(message.type, options); + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.apihub.v1.Plugin.State[message.state] === undefined ? message.state : $root.google.cloud.apihub.v1.Plugin.State[message.state] : message.state; + return object; + }; + + /** + * Converts this Plugin to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.Plugin + * @instance + * @returns {Object.} JSON object + */ + Plugin.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Plugin + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.Plugin + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Plugin.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.Plugin"; + }; + + /** + * State enum. + * @name google.cloud.apihub.v1.Plugin.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} ENABLED=1 ENABLED value + * @property {number} DISABLED=2 DISABLED value + */ + Plugin.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ENABLED"] = 1; + values[valuesById[2] = "DISABLED"] = 2; + return values; + })(); + + return Plugin; + })(); + + v1.GetPluginRequest = (function() { + + /** + * Properties of a GetPluginRequest. + * @memberof google.cloud.apihub.v1 + * @interface IGetPluginRequest + * @property {string|null} [name] GetPluginRequest name + */ + + /** + * Constructs a new GetPluginRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a GetPluginRequest. + * @implements IGetPluginRequest + * @constructor + * @param {google.cloud.apihub.v1.IGetPluginRequest=} [properties] Properties to set + */ + function GetPluginRequest(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]]; + } + + /** + * GetPluginRequest name. + * @member {string} name + * @memberof google.cloud.apihub.v1.GetPluginRequest + * @instance + */ + GetPluginRequest.prototype.name = ""; + + /** + * Creates a new GetPluginRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.GetPluginRequest + * @static + * @param {google.cloud.apihub.v1.IGetPluginRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.GetPluginRequest} GetPluginRequest instance + */ + GetPluginRequest.create = function create(properties) { + return new GetPluginRequest(properties); + }; + + /** + * Encodes the specified GetPluginRequest message. Does not implicitly {@link google.cloud.apihub.v1.GetPluginRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.GetPluginRequest + * @static + * @param {google.cloud.apihub.v1.IGetPluginRequest} message GetPluginRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPluginRequest.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 GetPluginRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.GetPluginRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.GetPluginRequest + * @static + * @param {google.cloud.apihub.v1.IGetPluginRequest} message GetPluginRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPluginRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetPluginRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.GetPluginRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.GetPluginRequest} GetPluginRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPluginRequest.decode = function 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.apihub.v1.GetPluginRequest(); + 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 GetPluginRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.GetPluginRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.GetPluginRequest} GetPluginRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPluginRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetPluginRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.GetPluginRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetPluginRequest.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 GetPluginRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.GetPluginRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.GetPluginRequest} GetPluginRequest + */ + GetPluginRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.GetPluginRequest) + return object; + var message = new $root.google.cloud.apihub.v1.GetPluginRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetPluginRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.GetPluginRequest + * @static + * @param {google.cloud.apihub.v1.GetPluginRequest} message GetPluginRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetPluginRequest.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 GetPluginRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.GetPluginRequest + * @instance + * @returns {Object.} JSON object + */ + GetPluginRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetPluginRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.GetPluginRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetPluginRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.GetPluginRequest"; + }; + + return GetPluginRequest; + })(); + + v1.EnablePluginRequest = (function() { + + /** + * Properties of an EnablePluginRequest. + * @memberof google.cloud.apihub.v1 + * @interface IEnablePluginRequest + * @property {string|null} [name] EnablePluginRequest name + */ + + /** + * Constructs a new EnablePluginRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents an EnablePluginRequest. + * @implements IEnablePluginRequest + * @constructor + * @param {google.cloud.apihub.v1.IEnablePluginRequest=} [properties] Properties to set + */ + function EnablePluginRequest(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]]; + } + + /** + * EnablePluginRequest name. + * @member {string} name + * @memberof google.cloud.apihub.v1.EnablePluginRequest + * @instance + */ + EnablePluginRequest.prototype.name = ""; + + /** + * Creates a new EnablePluginRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.EnablePluginRequest + * @static + * @param {google.cloud.apihub.v1.IEnablePluginRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.EnablePluginRequest} EnablePluginRequest instance + */ + EnablePluginRequest.create = function create(properties) { + return new EnablePluginRequest(properties); + }; + + /** + * Encodes the specified EnablePluginRequest message. Does not implicitly {@link google.cloud.apihub.v1.EnablePluginRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.EnablePluginRequest + * @static + * @param {google.cloud.apihub.v1.IEnablePluginRequest} message EnablePluginRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnablePluginRequest.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 EnablePluginRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.EnablePluginRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.EnablePluginRequest + * @static + * @param {google.cloud.apihub.v1.IEnablePluginRequest} message EnablePluginRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnablePluginRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnablePluginRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.EnablePluginRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.EnablePluginRequest} EnablePluginRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnablePluginRequest.decode = function 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.apihub.v1.EnablePluginRequest(); + 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 an EnablePluginRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.EnablePluginRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.EnablePluginRequest} EnablePluginRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnablePluginRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnablePluginRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.EnablePluginRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnablePluginRequest.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 an EnablePluginRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.EnablePluginRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.EnablePluginRequest} EnablePluginRequest + */ + EnablePluginRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.EnablePluginRequest) + return object; + var message = new $root.google.cloud.apihub.v1.EnablePluginRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from an EnablePluginRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.EnablePluginRequest + * @static + * @param {google.cloud.apihub.v1.EnablePluginRequest} message EnablePluginRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnablePluginRequest.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 EnablePluginRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.EnablePluginRequest + * @instance + * @returns {Object.} JSON object + */ + EnablePluginRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnablePluginRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.EnablePluginRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnablePluginRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.EnablePluginRequest"; + }; + + return EnablePluginRequest; + })(); + + v1.DisablePluginRequest = (function() { + + /** + * Properties of a DisablePluginRequest. + * @memberof google.cloud.apihub.v1 + * @interface IDisablePluginRequest + * @property {string|null} [name] DisablePluginRequest name + */ + + /** + * Constructs a new DisablePluginRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a DisablePluginRequest. + * @implements IDisablePluginRequest + * @constructor + * @param {google.cloud.apihub.v1.IDisablePluginRequest=} [properties] Properties to set + */ + function DisablePluginRequest(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]]; + } + + /** + * DisablePluginRequest name. + * @member {string} name + * @memberof google.cloud.apihub.v1.DisablePluginRequest + * @instance + */ + DisablePluginRequest.prototype.name = ""; + + /** + * Creates a new DisablePluginRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.DisablePluginRequest + * @static + * @param {google.cloud.apihub.v1.IDisablePluginRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.DisablePluginRequest} DisablePluginRequest instance + */ + DisablePluginRequest.create = function create(properties) { + return new DisablePluginRequest(properties); + }; + + /** + * Encodes the specified DisablePluginRequest message. Does not implicitly {@link google.cloud.apihub.v1.DisablePluginRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.DisablePluginRequest + * @static + * @param {google.cloud.apihub.v1.IDisablePluginRequest} message DisablePluginRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DisablePluginRequest.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 DisablePluginRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.DisablePluginRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.DisablePluginRequest + * @static + * @param {google.cloud.apihub.v1.IDisablePluginRequest} message DisablePluginRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DisablePluginRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DisablePluginRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.DisablePluginRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.DisablePluginRequest} DisablePluginRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DisablePluginRequest.decode = function 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.apihub.v1.DisablePluginRequest(); + 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 DisablePluginRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.DisablePluginRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.DisablePluginRequest} DisablePluginRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DisablePluginRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DisablePluginRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.DisablePluginRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DisablePluginRequest.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 DisablePluginRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.DisablePluginRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.DisablePluginRequest} DisablePluginRequest + */ + DisablePluginRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.DisablePluginRequest) + return object; + var message = new $root.google.cloud.apihub.v1.DisablePluginRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DisablePluginRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.DisablePluginRequest + * @static + * @param {google.cloud.apihub.v1.DisablePluginRequest} message DisablePluginRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DisablePluginRequest.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 DisablePluginRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.DisablePluginRequest + * @instance + * @returns {Object.} JSON object + */ + DisablePluginRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DisablePluginRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.DisablePluginRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DisablePluginRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.DisablePluginRequest"; + }; + + return DisablePluginRequest; + })(); + + v1.Provisioning = (function() { + + /** + * Constructs a new Provisioning service. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a Provisioning + * @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 Provisioning(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Provisioning.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Provisioning; + + /** + * Creates new Provisioning service using the specified rpc implementation. + * @function create + * @memberof google.cloud.apihub.v1.Provisioning + * @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 {Provisioning} RPC service. Useful where requests and/or responses are streamed. + */ + Provisioning.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.apihub.v1.Provisioning|createApiHubInstance}. + * @memberof google.cloud.apihub.v1.Provisioning + * @typedef CreateApiHubInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateApiHubInstance. + * @function createApiHubInstance + * @memberof google.cloud.apihub.v1.Provisioning + * @instance + * @param {google.cloud.apihub.v1.ICreateApiHubInstanceRequest} request CreateApiHubInstanceRequest message or plain object + * @param {google.cloud.apihub.v1.Provisioning.CreateApiHubInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Provisioning.prototype.createApiHubInstance = function createApiHubInstance(request, callback) { + return this.rpcCall(createApiHubInstance, $root.google.cloud.apihub.v1.CreateApiHubInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateApiHubInstance" }); + + /** + * Calls CreateApiHubInstance. + * @function createApiHubInstance + * @memberof google.cloud.apihub.v1.Provisioning + * @instance + * @param {google.cloud.apihub.v1.ICreateApiHubInstanceRequest} request CreateApiHubInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.Provisioning|getApiHubInstance}. + * @memberof google.cloud.apihub.v1.Provisioning + * @typedef GetApiHubInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apihub.v1.ApiHubInstance} [response] ApiHubInstance + */ + + /** + * Calls GetApiHubInstance. + * @function getApiHubInstance + * @memberof google.cloud.apihub.v1.Provisioning + * @instance + * @param {google.cloud.apihub.v1.IGetApiHubInstanceRequest} request GetApiHubInstanceRequest message or plain object + * @param {google.cloud.apihub.v1.Provisioning.GetApiHubInstanceCallback} callback Node-style callback called with the error, if any, and ApiHubInstance + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Provisioning.prototype.getApiHubInstance = function getApiHubInstance(request, callback) { + return this.rpcCall(getApiHubInstance, $root.google.cloud.apihub.v1.GetApiHubInstanceRequest, $root.google.cloud.apihub.v1.ApiHubInstance, request, callback); + }, "name", { value: "GetApiHubInstance" }); + + /** + * Calls GetApiHubInstance. + * @function getApiHubInstance + * @memberof google.cloud.apihub.v1.Provisioning + * @instance + * @param {google.cloud.apihub.v1.IGetApiHubInstanceRequest} request GetApiHubInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.Provisioning|lookupApiHubInstance}. + * @memberof google.cloud.apihub.v1.Provisioning + * @typedef LookupApiHubInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apihub.v1.LookupApiHubInstanceResponse} [response] LookupApiHubInstanceResponse + */ + + /** + * Calls LookupApiHubInstance. + * @function lookupApiHubInstance + * @memberof google.cloud.apihub.v1.Provisioning + * @instance + * @param {google.cloud.apihub.v1.ILookupApiHubInstanceRequest} request LookupApiHubInstanceRequest message or plain object + * @param {google.cloud.apihub.v1.Provisioning.LookupApiHubInstanceCallback} callback Node-style callback called with the error, if any, and LookupApiHubInstanceResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Provisioning.prototype.lookupApiHubInstance = function lookupApiHubInstance(request, callback) { + return this.rpcCall(lookupApiHubInstance, $root.google.cloud.apihub.v1.LookupApiHubInstanceRequest, $root.google.cloud.apihub.v1.LookupApiHubInstanceResponse, request, callback); + }, "name", { value: "LookupApiHubInstance" }); + + /** + * Calls LookupApiHubInstance. + * @function lookupApiHubInstance + * @memberof google.cloud.apihub.v1.Provisioning + * @instance + * @param {google.cloud.apihub.v1.ILookupApiHubInstanceRequest} request LookupApiHubInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Provisioning; + })(); + + v1.CreateApiHubInstanceRequest = (function() { + + /** + * Properties of a CreateApiHubInstanceRequest. + * @memberof google.cloud.apihub.v1 + * @interface ICreateApiHubInstanceRequest + * @property {string|null} [parent] CreateApiHubInstanceRequest parent + * @property {string|null} [apiHubInstanceId] CreateApiHubInstanceRequest apiHubInstanceId + * @property {google.cloud.apihub.v1.IApiHubInstance|null} [apiHubInstance] CreateApiHubInstanceRequest apiHubInstance + */ + + /** + * Constructs a new CreateApiHubInstanceRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a CreateApiHubInstanceRequest. + * @implements ICreateApiHubInstanceRequest + * @constructor + * @param {google.cloud.apihub.v1.ICreateApiHubInstanceRequest=} [properties] Properties to set + */ + function CreateApiHubInstanceRequest(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]]; + } + + /** + * CreateApiHubInstanceRequest parent. + * @member {string} parent + * @memberof google.cloud.apihub.v1.CreateApiHubInstanceRequest + * @instance + */ + CreateApiHubInstanceRequest.prototype.parent = ""; + + /** + * CreateApiHubInstanceRequest apiHubInstanceId. + * @member {string} apiHubInstanceId + * @memberof google.cloud.apihub.v1.CreateApiHubInstanceRequest + * @instance + */ + CreateApiHubInstanceRequest.prototype.apiHubInstanceId = ""; + + /** + * CreateApiHubInstanceRequest apiHubInstance. + * @member {google.cloud.apihub.v1.IApiHubInstance|null|undefined} apiHubInstance + * @memberof google.cloud.apihub.v1.CreateApiHubInstanceRequest + * @instance + */ + CreateApiHubInstanceRequest.prototype.apiHubInstance = null; + + /** + * Creates a new CreateApiHubInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.CreateApiHubInstanceRequest + * @static + * @param {google.cloud.apihub.v1.ICreateApiHubInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.CreateApiHubInstanceRequest} CreateApiHubInstanceRequest instance + */ + CreateApiHubInstanceRequest.create = function create(properties) { + return new CreateApiHubInstanceRequest(properties); + }; + + /** + * Encodes the specified CreateApiHubInstanceRequest message. Does not implicitly {@link google.cloud.apihub.v1.CreateApiHubInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.CreateApiHubInstanceRequest + * @static + * @param {google.cloud.apihub.v1.ICreateApiHubInstanceRequest} message CreateApiHubInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateApiHubInstanceRequest.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.apiHubInstanceId != null && Object.hasOwnProperty.call(message, "apiHubInstanceId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.apiHubInstanceId); + if (message.apiHubInstance != null && Object.hasOwnProperty.call(message, "apiHubInstance")) + $root.google.cloud.apihub.v1.ApiHubInstance.encode(message.apiHubInstance, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateApiHubInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.CreateApiHubInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.CreateApiHubInstanceRequest + * @static + * @param {google.cloud.apihub.v1.ICreateApiHubInstanceRequest} message CreateApiHubInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateApiHubInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateApiHubInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.CreateApiHubInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.CreateApiHubInstanceRequest} CreateApiHubInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateApiHubInstanceRequest.decode = function 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.apihub.v1.CreateApiHubInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.apiHubInstanceId = reader.string(); + break; + } + case 3: { + message.apiHubInstance = $root.google.cloud.apihub.v1.ApiHubInstance.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateApiHubInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.CreateApiHubInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.CreateApiHubInstanceRequest} CreateApiHubInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateApiHubInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateApiHubInstanceRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.CreateApiHubInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateApiHubInstanceRequest.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.apiHubInstanceId != null && message.hasOwnProperty("apiHubInstanceId")) + if (!$util.isString(message.apiHubInstanceId)) + return "apiHubInstanceId: string expected"; + if (message.apiHubInstance != null && message.hasOwnProperty("apiHubInstance")) { + var error = $root.google.cloud.apihub.v1.ApiHubInstance.verify(message.apiHubInstance); + if (error) + return "apiHubInstance." + error; + } + return null; + }; + + /** + * Creates a CreateApiHubInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.CreateApiHubInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.CreateApiHubInstanceRequest} CreateApiHubInstanceRequest + */ + CreateApiHubInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.CreateApiHubInstanceRequest) + return object; + var message = new $root.google.cloud.apihub.v1.CreateApiHubInstanceRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.apiHubInstanceId != null) + message.apiHubInstanceId = String(object.apiHubInstanceId); + if (object.apiHubInstance != null) { + if (typeof object.apiHubInstance !== "object") + throw TypeError(".google.cloud.apihub.v1.CreateApiHubInstanceRequest.apiHubInstance: object expected"); + message.apiHubInstance = $root.google.cloud.apihub.v1.ApiHubInstance.fromObject(object.apiHubInstance); + } + return message; + }; + + /** + * Creates a plain object from a CreateApiHubInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.CreateApiHubInstanceRequest + * @static + * @param {google.cloud.apihub.v1.CreateApiHubInstanceRequest} message CreateApiHubInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateApiHubInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.apiHubInstanceId = ""; + object.apiHubInstance = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.apiHubInstanceId != null && message.hasOwnProperty("apiHubInstanceId")) + object.apiHubInstanceId = message.apiHubInstanceId; + if (message.apiHubInstance != null && message.hasOwnProperty("apiHubInstance")) + object.apiHubInstance = $root.google.cloud.apihub.v1.ApiHubInstance.toObject(message.apiHubInstance, options); + return object; + }; + + /** + * Converts this CreateApiHubInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.CreateApiHubInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + CreateApiHubInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateApiHubInstanceRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.CreateApiHubInstanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateApiHubInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.CreateApiHubInstanceRequest"; + }; + + return CreateApiHubInstanceRequest; + })(); + + v1.GetApiHubInstanceRequest = (function() { + + /** + * Properties of a GetApiHubInstanceRequest. + * @memberof google.cloud.apihub.v1 + * @interface IGetApiHubInstanceRequest + * @property {string|null} [name] GetApiHubInstanceRequest name + */ + + /** + * Constructs a new GetApiHubInstanceRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a GetApiHubInstanceRequest. + * @implements IGetApiHubInstanceRequest + * @constructor + * @param {google.cloud.apihub.v1.IGetApiHubInstanceRequest=} [properties] Properties to set + */ + function GetApiHubInstanceRequest(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]]; + } + + /** + * GetApiHubInstanceRequest name. + * @member {string} name + * @memberof google.cloud.apihub.v1.GetApiHubInstanceRequest + * @instance + */ + GetApiHubInstanceRequest.prototype.name = ""; + + /** + * Creates a new GetApiHubInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.GetApiHubInstanceRequest + * @static + * @param {google.cloud.apihub.v1.IGetApiHubInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.GetApiHubInstanceRequest} GetApiHubInstanceRequest instance + */ + GetApiHubInstanceRequest.create = function create(properties) { + return new GetApiHubInstanceRequest(properties); + }; + + /** + * Encodes the specified GetApiHubInstanceRequest message. Does not implicitly {@link google.cloud.apihub.v1.GetApiHubInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.GetApiHubInstanceRequest + * @static + * @param {google.cloud.apihub.v1.IGetApiHubInstanceRequest} message GetApiHubInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetApiHubInstanceRequest.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 GetApiHubInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.GetApiHubInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.GetApiHubInstanceRequest + * @static + * @param {google.cloud.apihub.v1.IGetApiHubInstanceRequest} message GetApiHubInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetApiHubInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetApiHubInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.GetApiHubInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.GetApiHubInstanceRequest} GetApiHubInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetApiHubInstanceRequest.decode = function 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.apihub.v1.GetApiHubInstanceRequest(); + 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 GetApiHubInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.GetApiHubInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.GetApiHubInstanceRequest} GetApiHubInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetApiHubInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetApiHubInstanceRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.GetApiHubInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetApiHubInstanceRequest.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 GetApiHubInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.GetApiHubInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.GetApiHubInstanceRequest} GetApiHubInstanceRequest + */ + GetApiHubInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.GetApiHubInstanceRequest) + return object; + var message = new $root.google.cloud.apihub.v1.GetApiHubInstanceRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetApiHubInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.GetApiHubInstanceRequest + * @static + * @param {google.cloud.apihub.v1.GetApiHubInstanceRequest} message GetApiHubInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetApiHubInstanceRequest.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 GetApiHubInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.GetApiHubInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + GetApiHubInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetApiHubInstanceRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.GetApiHubInstanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetApiHubInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.GetApiHubInstanceRequest"; + }; + + return GetApiHubInstanceRequest; + })(); + + v1.LookupApiHubInstanceRequest = (function() { + + /** + * Properties of a LookupApiHubInstanceRequest. + * @memberof google.cloud.apihub.v1 + * @interface ILookupApiHubInstanceRequest + * @property {string|null} [parent] LookupApiHubInstanceRequest parent + */ + + /** + * Constructs a new LookupApiHubInstanceRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a LookupApiHubInstanceRequest. + * @implements ILookupApiHubInstanceRequest + * @constructor + * @param {google.cloud.apihub.v1.ILookupApiHubInstanceRequest=} [properties] Properties to set + */ + function LookupApiHubInstanceRequest(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]]; + } + + /** + * LookupApiHubInstanceRequest parent. + * @member {string} parent + * @memberof google.cloud.apihub.v1.LookupApiHubInstanceRequest + * @instance + */ + LookupApiHubInstanceRequest.prototype.parent = ""; + + /** + * Creates a new LookupApiHubInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.LookupApiHubInstanceRequest + * @static + * @param {google.cloud.apihub.v1.ILookupApiHubInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.LookupApiHubInstanceRequest} LookupApiHubInstanceRequest instance + */ + LookupApiHubInstanceRequest.create = function create(properties) { + return new LookupApiHubInstanceRequest(properties); + }; + + /** + * Encodes the specified LookupApiHubInstanceRequest message. Does not implicitly {@link google.cloud.apihub.v1.LookupApiHubInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.LookupApiHubInstanceRequest + * @static + * @param {google.cloud.apihub.v1.ILookupApiHubInstanceRequest} message LookupApiHubInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LookupApiHubInstanceRequest.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); + return writer; + }; + + /** + * Encodes the specified LookupApiHubInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.LookupApiHubInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.LookupApiHubInstanceRequest + * @static + * @param {google.cloud.apihub.v1.ILookupApiHubInstanceRequest} message LookupApiHubInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LookupApiHubInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LookupApiHubInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.LookupApiHubInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.LookupApiHubInstanceRequest} LookupApiHubInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LookupApiHubInstanceRequest.decode = function 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.apihub.v1.LookupApiHubInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LookupApiHubInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.LookupApiHubInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.LookupApiHubInstanceRequest} LookupApiHubInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LookupApiHubInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LookupApiHubInstanceRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.LookupApiHubInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LookupApiHubInstanceRequest.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"; + return null; + }; + + /** + * Creates a LookupApiHubInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.LookupApiHubInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.LookupApiHubInstanceRequest} LookupApiHubInstanceRequest + */ + LookupApiHubInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.LookupApiHubInstanceRequest) + return object; + var message = new $root.google.cloud.apihub.v1.LookupApiHubInstanceRequest(); + if (object.parent != null) + message.parent = String(object.parent); + return message; + }; + + /** + * Creates a plain object from a LookupApiHubInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.LookupApiHubInstanceRequest + * @static + * @param {google.cloud.apihub.v1.LookupApiHubInstanceRequest} message LookupApiHubInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LookupApiHubInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.parent = ""; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + return object; + }; + + /** + * Converts this LookupApiHubInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.LookupApiHubInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + LookupApiHubInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LookupApiHubInstanceRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.LookupApiHubInstanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LookupApiHubInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.LookupApiHubInstanceRequest"; + }; + + return LookupApiHubInstanceRequest; + })(); + + v1.LookupApiHubInstanceResponse = (function() { + + /** + * Properties of a LookupApiHubInstanceResponse. + * @memberof google.cloud.apihub.v1 + * @interface ILookupApiHubInstanceResponse + * @property {google.cloud.apihub.v1.IApiHubInstance|null} [apiHubInstance] LookupApiHubInstanceResponse apiHubInstance + */ + + /** + * Constructs a new LookupApiHubInstanceResponse. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a LookupApiHubInstanceResponse. + * @implements ILookupApiHubInstanceResponse + * @constructor + * @param {google.cloud.apihub.v1.ILookupApiHubInstanceResponse=} [properties] Properties to set + */ + function LookupApiHubInstanceResponse(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]]; + } + + /** + * LookupApiHubInstanceResponse apiHubInstance. + * @member {google.cloud.apihub.v1.IApiHubInstance|null|undefined} apiHubInstance + * @memberof google.cloud.apihub.v1.LookupApiHubInstanceResponse + * @instance + */ + LookupApiHubInstanceResponse.prototype.apiHubInstance = null; + + /** + * Creates a new LookupApiHubInstanceResponse instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.LookupApiHubInstanceResponse + * @static + * @param {google.cloud.apihub.v1.ILookupApiHubInstanceResponse=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.LookupApiHubInstanceResponse} LookupApiHubInstanceResponse instance + */ + LookupApiHubInstanceResponse.create = function create(properties) { + return new LookupApiHubInstanceResponse(properties); + }; + + /** + * Encodes the specified LookupApiHubInstanceResponse message. Does not implicitly {@link google.cloud.apihub.v1.LookupApiHubInstanceResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.LookupApiHubInstanceResponse + * @static + * @param {google.cloud.apihub.v1.ILookupApiHubInstanceResponse} message LookupApiHubInstanceResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LookupApiHubInstanceResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.apiHubInstance != null && Object.hasOwnProperty.call(message, "apiHubInstance")) + $root.google.cloud.apihub.v1.ApiHubInstance.encode(message.apiHubInstance, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LookupApiHubInstanceResponse message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.LookupApiHubInstanceResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.LookupApiHubInstanceResponse + * @static + * @param {google.cloud.apihub.v1.ILookupApiHubInstanceResponse} message LookupApiHubInstanceResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LookupApiHubInstanceResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LookupApiHubInstanceResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.LookupApiHubInstanceResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.LookupApiHubInstanceResponse} LookupApiHubInstanceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LookupApiHubInstanceResponse.decode = function 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.apihub.v1.LookupApiHubInstanceResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.apiHubInstance = $root.google.cloud.apihub.v1.ApiHubInstance.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LookupApiHubInstanceResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.LookupApiHubInstanceResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.LookupApiHubInstanceResponse} LookupApiHubInstanceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LookupApiHubInstanceResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LookupApiHubInstanceResponse message. + * @function verify + * @memberof google.cloud.apihub.v1.LookupApiHubInstanceResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LookupApiHubInstanceResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.apiHubInstance != null && message.hasOwnProperty("apiHubInstance")) { + var error = $root.google.cloud.apihub.v1.ApiHubInstance.verify(message.apiHubInstance); + if (error) + return "apiHubInstance." + error; + } + return null; + }; + + /** + * Creates a LookupApiHubInstanceResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.LookupApiHubInstanceResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.LookupApiHubInstanceResponse} LookupApiHubInstanceResponse + */ + LookupApiHubInstanceResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.LookupApiHubInstanceResponse) + return object; + var message = new $root.google.cloud.apihub.v1.LookupApiHubInstanceResponse(); + if (object.apiHubInstance != null) { + if (typeof object.apiHubInstance !== "object") + throw TypeError(".google.cloud.apihub.v1.LookupApiHubInstanceResponse.apiHubInstance: object expected"); + message.apiHubInstance = $root.google.cloud.apihub.v1.ApiHubInstance.fromObject(object.apiHubInstance); + } + return message; + }; + + /** + * Creates a plain object from a LookupApiHubInstanceResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.LookupApiHubInstanceResponse + * @static + * @param {google.cloud.apihub.v1.LookupApiHubInstanceResponse} message LookupApiHubInstanceResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LookupApiHubInstanceResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.apiHubInstance = null; + if (message.apiHubInstance != null && message.hasOwnProperty("apiHubInstance")) + object.apiHubInstance = $root.google.cloud.apihub.v1.ApiHubInstance.toObject(message.apiHubInstance, options); + return object; + }; + + /** + * Converts this LookupApiHubInstanceResponse to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.LookupApiHubInstanceResponse + * @instance + * @returns {Object.} JSON object + */ + LookupApiHubInstanceResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LookupApiHubInstanceResponse + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.LookupApiHubInstanceResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LookupApiHubInstanceResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.LookupApiHubInstanceResponse"; + }; + + return LookupApiHubInstanceResponse; + })(); + + v1.RuntimeProjectAttachmentService = (function() { + + /** + * Constructs a new RuntimeProjectAttachmentService service. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a RuntimeProjectAttachmentService + * @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 RuntimeProjectAttachmentService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (RuntimeProjectAttachmentService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = RuntimeProjectAttachmentService; + + /** + * Creates new RuntimeProjectAttachmentService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.apihub.v1.RuntimeProjectAttachmentService + * @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 {RuntimeProjectAttachmentService} RPC service. Useful where requests and/or responses are streamed. + */ + RuntimeProjectAttachmentService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.apihub.v1.RuntimeProjectAttachmentService|createRuntimeProjectAttachment}. + * @memberof google.cloud.apihub.v1.RuntimeProjectAttachmentService + * @typedef CreateRuntimeProjectAttachmentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apihub.v1.RuntimeProjectAttachment} [response] RuntimeProjectAttachment + */ + + /** + * Calls CreateRuntimeProjectAttachment. + * @function createRuntimeProjectAttachment + * @memberof google.cloud.apihub.v1.RuntimeProjectAttachmentService + * @instance + * @param {google.cloud.apihub.v1.ICreateRuntimeProjectAttachmentRequest} request CreateRuntimeProjectAttachmentRequest message or plain object + * @param {google.cloud.apihub.v1.RuntimeProjectAttachmentService.CreateRuntimeProjectAttachmentCallback} callback Node-style callback called with the error, if any, and RuntimeProjectAttachment + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RuntimeProjectAttachmentService.prototype.createRuntimeProjectAttachment = function createRuntimeProjectAttachment(request, callback) { + return this.rpcCall(createRuntimeProjectAttachment, $root.google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest, $root.google.cloud.apihub.v1.RuntimeProjectAttachment, request, callback); + }, "name", { value: "CreateRuntimeProjectAttachment" }); + + /** + * Calls CreateRuntimeProjectAttachment. + * @function createRuntimeProjectAttachment + * @memberof google.cloud.apihub.v1.RuntimeProjectAttachmentService + * @instance + * @param {google.cloud.apihub.v1.ICreateRuntimeProjectAttachmentRequest} request CreateRuntimeProjectAttachmentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.RuntimeProjectAttachmentService|getRuntimeProjectAttachment}. + * @memberof google.cloud.apihub.v1.RuntimeProjectAttachmentService + * @typedef GetRuntimeProjectAttachmentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apihub.v1.RuntimeProjectAttachment} [response] RuntimeProjectAttachment + */ + + /** + * Calls GetRuntimeProjectAttachment. + * @function getRuntimeProjectAttachment + * @memberof google.cloud.apihub.v1.RuntimeProjectAttachmentService + * @instance + * @param {google.cloud.apihub.v1.IGetRuntimeProjectAttachmentRequest} request GetRuntimeProjectAttachmentRequest message or plain object + * @param {google.cloud.apihub.v1.RuntimeProjectAttachmentService.GetRuntimeProjectAttachmentCallback} callback Node-style callback called with the error, if any, and RuntimeProjectAttachment + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RuntimeProjectAttachmentService.prototype.getRuntimeProjectAttachment = function getRuntimeProjectAttachment(request, callback) { + return this.rpcCall(getRuntimeProjectAttachment, $root.google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest, $root.google.cloud.apihub.v1.RuntimeProjectAttachment, request, callback); + }, "name", { value: "GetRuntimeProjectAttachment" }); + + /** + * Calls GetRuntimeProjectAttachment. + * @function getRuntimeProjectAttachment + * @memberof google.cloud.apihub.v1.RuntimeProjectAttachmentService + * @instance + * @param {google.cloud.apihub.v1.IGetRuntimeProjectAttachmentRequest} request GetRuntimeProjectAttachmentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.RuntimeProjectAttachmentService|listRuntimeProjectAttachments}. + * @memberof google.cloud.apihub.v1.RuntimeProjectAttachmentService + * @typedef ListRuntimeProjectAttachmentsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse} [response] ListRuntimeProjectAttachmentsResponse + */ + + /** + * Calls ListRuntimeProjectAttachments. + * @function listRuntimeProjectAttachments + * @memberof google.cloud.apihub.v1.RuntimeProjectAttachmentService + * @instance + * @param {google.cloud.apihub.v1.IListRuntimeProjectAttachmentsRequest} request ListRuntimeProjectAttachmentsRequest message or plain object + * @param {google.cloud.apihub.v1.RuntimeProjectAttachmentService.ListRuntimeProjectAttachmentsCallback} callback Node-style callback called with the error, if any, and ListRuntimeProjectAttachmentsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RuntimeProjectAttachmentService.prototype.listRuntimeProjectAttachments = function listRuntimeProjectAttachments(request, callback) { + return this.rpcCall(listRuntimeProjectAttachments, $root.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest, $root.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse, request, callback); + }, "name", { value: "ListRuntimeProjectAttachments" }); + + /** + * Calls ListRuntimeProjectAttachments. + * @function listRuntimeProjectAttachments + * @memberof google.cloud.apihub.v1.RuntimeProjectAttachmentService + * @instance + * @param {google.cloud.apihub.v1.IListRuntimeProjectAttachmentsRequest} request ListRuntimeProjectAttachmentsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.RuntimeProjectAttachmentService|deleteRuntimeProjectAttachment}. + * @memberof google.cloud.apihub.v1.RuntimeProjectAttachmentService + * @typedef DeleteRuntimeProjectAttachmentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteRuntimeProjectAttachment. + * @function deleteRuntimeProjectAttachment + * @memberof google.cloud.apihub.v1.RuntimeProjectAttachmentService + * @instance + * @param {google.cloud.apihub.v1.IDeleteRuntimeProjectAttachmentRequest} request DeleteRuntimeProjectAttachmentRequest message or plain object + * @param {google.cloud.apihub.v1.RuntimeProjectAttachmentService.DeleteRuntimeProjectAttachmentCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RuntimeProjectAttachmentService.prototype.deleteRuntimeProjectAttachment = function deleteRuntimeProjectAttachment(request, callback) { + return this.rpcCall(deleteRuntimeProjectAttachment, $root.google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteRuntimeProjectAttachment" }); + + /** + * Calls DeleteRuntimeProjectAttachment. + * @function deleteRuntimeProjectAttachment + * @memberof google.cloud.apihub.v1.RuntimeProjectAttachmentService + * @instance + * @param {google.cloud.apihub.v1.IDeleteRuntimeProjectAttachmentRequest} request DeleteRuntimeProjectAttachmentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.RuntimeProjectAttachmentService|lookupRuntimeProjectAttachment}. + * @memberof google.cloud.apihub.v1.RuntimeProjectAttachmentService + * @typedef LookupRuntimeProjectAttachmentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse} [response] LookupRuntimeProjectAttachmentResponse + */ + + /** + * Calls LookupRuntimeProjectAttachment. + * @function lookupRuntimeProjectAttachment + * @memberof google.cloud.apihub.v1.RuntimeProjectAttachmentService + * @instance + * @param {google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentRequest} request LookupRuntimeProjectAttachmentRequest message or plain object + * @param {google.cloud.apihub.v1.RuntimeProjectAttachmentService.LookupRuntimeProjectAttachmentCallback} callback Node-style callback called with the error, if any, and LookupRuntimeProjectAttachmentResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RuntimeProjectAttachmentService.prototype.lookupRuntimeProjectAttachment = function lookupRuntimeProjectAttachment(request, callback) { + return this.rpcCall(lookupRuntimeProjectAttachment, $root.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest, $root.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse, request, callback); + }, "name", { value: "LookupRuntimeProjectAttachment" }); + + /** + * Calls LookupRuntimeProjectAttachment. + * @function lookupRuntimeProjectAttachment + * @memberof google.cloud.apihub.v1.RuntimeProjectAttachmentService + * @instance + * @param {google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentRequest} request LookupRuntimeProjectAttachmentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return RuntimeProjectAttachmentService; + })(); + + v1.CreateRuntimeProjectAttachmentRequest = (function() { + + /** + * Properties of a CreateRuntimeProjectAttachmentRequest. + * @memberof google.cloud.apihub.v1 + * @interface ICreateRuntimeProjectAttachmentRequest + * @property {string|null} [parent] CreateRuntimeProjectAttachmentRequest parent + * @property {string|null} [runtimeProjectAttachmentId] CreateRuntimeProjectAttachmentRequest runtimeProjectAttachmentId + * @property {google.cloud.apihub.v1.IRuntimeProjectAttachment|null} [runtimeProjectAttachment] CreateRuntimeProjectAttachmentRequest runtimeProjectAttachment + */ + + /** + * Constructs a new CreateRuntimeProjectAttachmentRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a CreateRuntimeProjectAttachmentRequest. + * @implements ICreateRuntimeProjectAttachmentRequest + * @constructor + * @param {google.cloud.apihub.v1.ICreateRuntimeProjectAttachmentRequest=} [properties] Properties to set + */ + function CreateRuntimeProjectAttachmentRequest(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]]; + } + + /** + * CreateRuntimeProjectAttachmentRequest parent. + * @member {string} parent + * @memberof google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest + * @instance + */ + CreateRuntimeProjectAttachmentRequest.prototype.parent = ""; + + /** + * CreateRuntimeProjectAttachmentRequest runtimeProjectAttachmentId. + * @member {string} runtimeProjectAttachmentId + * @memberof google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest + * @instance + */ + CreateRuntimeProjectAttachmentRequest.prototype.runtimeProjectAttachmentId = ""; + + /** + * CreateRuntimeProjectAttachmentRequest runtimeProjectAttachment. + * @member {google.cloud.apihub.v1.IRuntimeProjectAttachment|null|undefined} runtimeProjectAttachment + * @memberof google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest + * @instance + */ + CreateRuntimeProjectAttachmentRequest.prototype.runtimeProjectAttachment = null; + + /** + * Creates a new CreateRuntimeProjectAttachmentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest + * @static + * @param {google.cloud.apihub.v1.ICreateRuntimeProjectAttachmentRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest} CreateRuntimeProjectAttachmentRequest instance + */ + CreateRuntimeProjectAttachmentRequest.create = function create(properties) { + return new CreateRuntimeProjectAttachmentRequest(properties); + }; + + /** + * Encodes the specified CreateRuntimeProjectAttachmentRequest message. Does not implicitly {@link google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest + * @static + * @param {google.cloud.apihub.v1.ICreateRuntimeProjectAttachmentRequest} message CreateRuntimeProjectAttachmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateRuntimeProjectAttachmentRequest.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.runtimeProjectAttachmentId != null && Object.hasOwnProperty.call(message, "runtimeProjectAttachmentId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.runtimeProjectAttachmentId); + if (message.runtimeProjectAttachment != null && Object.hasOwnProperty.call(message, "runtimeProjectAttachment")) + $root.google.cloud.apihub.v1.RuntimeProjectAttachment.encode(message.runtimeProjectAttachment, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateRuntimeProjectAttachmentRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest + * @static + * @param {google.cloud.apihub.v1.ICreateRuntimeProjectAttachmentRequest} message CreateRuntimeProjectAttachmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateRuntimeProjectAttachmentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateRuntimeProjectAttachmentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest} CreateRuntimeProjectAttachmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateRuntimeProjectAttachmentRequest.decode = function 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.apihub.v1.CreateRuntimeProjectAttachmentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.runtimeProjectAttachmentId = reader.string(); + break; + } + case 3: { + message.runtimeProjectAttachment = $root.google.cloud.apihub.v1.RuntimeProjectAttachment.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateRuntimeProjectAttachmentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest} CreateRuntimeProjectAttachmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateRuntimeProjectAttachmentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateRuntimeProjectAttachmentRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateRuntimeProjectAttachmentRequest.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.runtimeProjectAttachmentId != null && message.hasOwnProperty("runtimeProjectAttachmentId")) + if (!$util.isString(message.runtimeProjectAttachmentId)) + return "runtimeProjectAttachmentId: string expected"; + if (message.runtimeProjectAttachment != null && message.hasOwnProperty("runtimeProjectAttachment")) { + var error = $root.google.cloud.apihub.v1.RuntimeProjectAttachment.verify(message.runtimeProjectAttachment); + if (error) + return "runtimeProjectAttachment." + error; + } + return null; + }; + + /** + * Creates a CreateRuntimeProjectAttachmentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest} CreateRuntimeProjectAttachmentRequest + */ + CreateRuntimeProjectAttachmentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest) + return object; + var message = new $root.google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.runtimeProjectAttachmentId != null) + message.runtimeProjectAttachmentId = String(object.runtimeProjectAttachmentId); + if (object.runtimeProjectAttachment != null) { + if (typeof object.runtimeProjectAttachment !== "object") + throw TypeError(".google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest.runtimeProjectAttachment: object expected"); + message.runtimeProjectAttachment = $root.google.cloud.apihub.v1.RuntimeProjectAttachment.fromObject(object.runtimeProjectAttachment); + } + return message; + }; + + /** + * Creates a plain object from a CreateRuntimeProjectAttachmentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest + * @static + * @param {google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest} message CreateRuntimeProjectAttachmentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateRuntimeProjectAttachmentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.runtimeProjectAttachmentId = ""; + object.runtimeProjectAttachment = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.runtimeProjectAttachmentId != null && message.hasOwnProperty("runtimeProjectAttachmentId")) + object.runtimeProjectAttachmentId = message.runtimeProjectAttachmentId; + if (message.runtimeProjectAttachment != null && message.hasOwnProperty("runtimeProjectAttachment")) + object.runtimeProjectAttachment = $root.google.cloud.apihub.v1.RuntimeProjectAttachment.toObject(message.runtimeProjectAttachment, options); + return object; + }; + + /** + * Converts this CreateRuntimeProjectAttachmentRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest + * @instance + * @returns {Object.} JSON object + */ + CreateRuntimeProjectAttachmentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateRuntimeProjectAttachmentRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateRuntimeProjectAttachmentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest"; + }; + + return CreateRuntimeProjectAttachmentRequest; + })(); + + v1.GetRuntimeProjectAttachmentRequest = (function() { + + /** + * Properties of a GetRuntimeProjectAttachmentRequest. + * @memberof google.cloud.apihub.v1 + * @interface IGetRuntimeProjectAttachmentRequest + * @property {string|null} [name] GetRuntimeProjectAttachmentRequest name + */ + + /** + * Constructs a new GetRuntimeProjectAttachmentRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a GetRuntimeProjectAttachmentRequest. + * @implements IGetRuntimeProjectAttachmentRequest + * @constructor + * @param {google.cloud.apihub.v1.IGetRuntimeProjectAttachmentRequest=} [properties] Properties to set + */ + function GetRuntimeProjectAttachmentRequest(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]]; + } + + /** + * GetRuntimeProjectAttachmentRequest name. + * @member {string} name + * @memberof google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest + * @instance + */ + GetRuntimeProjectAttachmentRequest.prototype.name = ""; + + /** + * Creates a new GetRuntimeProjectAttachmentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest + * @static + * @param {google.cloud.apihub.v1.IGetRuntimeProjectAttachmentRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest} GetRuntimeProjectAttachmentRequest instance + */ + GetRuntimeProjectAttachmentRequest.create = function create(properties) { + return new GetRuntimeProjectAttachmentRequest(properties); + }; + + /** + * Encodes the specified GetRuntimeProjectAttachmentRequest message. Does not implicitly {@link google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest + * @static + * @param {google.cloud.apihub.v1.IGetRuntimeProjectAttachmentRequest} message GetRuntimeProjectAttachmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetRuntimeProjectAttachmentRequest.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 GetRuntimeProjectAttachmentRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest + * @static + * @param {google.cloud.apihub.v1.IGetRuntimeProjectAttachmentRequest} message GetRuntimeProjectAttachmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetRuntimeProjectAttachmentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetRuntimeProjectAttachmentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest} GetRuntimeProjectAttachmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetRuntimeProjectAttachmentRequest.decode = function 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.apihub.v1.GetRuntimeProjectAttachmentRequest(); + 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 GetRuntimeProjectAttachmentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest} GetRuntimeProjectAttachmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetRuntimeProjectAttachmentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetRuntimeProjectAttachmentRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetRuntimeProjectAttachmentRequest.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 GetRuntimeProjectAttachmentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest} GetRuntimeProjectAttachmentRequest + */ + GetRuntimeProjectAttachmentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest) + return object; + var message = new $root.google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetRuntimeProjectAttachmentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest + * @static + * @param {google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest} message GetRuntimeProjectAttachmentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetRuntimeProjectAttachmentRequest.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 GetRuntimeProjectAttachmentRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest + * @instance + * @returns {Object.} JSON object + */ + GetRuntimeProjectAttachmentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetRuntimeProjectAttachmentRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetRuntimeProjectAttachmentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest"; + }; + + return GetRuntimeProjectAttachmentRequest; + })(); + + v1.ListRuntimeProjectAttachmentsRequest = (function() { + + /** + * Properties of a ListRuntimeProjectAttachmentsRequest. + * @memberof google.cloud.apihub.v1 + * @interface IListRuntimeProjectAttachmentsRequest + * @property {string|null} [parent] ListRuntimeProjectAttachmentsRequest parent + * @property {number|null} [pageSize] ListRuntimeProjectAttachmentsRequest pageSize + * @property {string|null} [pageToken] ListRuntimeProjectAttachmentsRequest pageToken + * @property {string|null} [filter] ListRuntimeProjectAttachmentsRequest filter + * @property {string|null} [orderBy] ListRuntimeProjectAttachmentsRequest orderBy + */ + + /** + * Constructs a new ListRuntimeProjectAttachmentsRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a ListRuntimeProjectAttachmentsRequest. + * @implements IListRuntimeProjectAttachmentsRequest + * @constructor + * @param {google.cloud.apihub.v1.IListRuntimeProjectAttachmentsRequest=} [properties] Properties to set + */ + function ListRuntimeProjectAttachmentsRequest(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]]; + } + + /** + * ListRuntimeProjectAttachmentsRequest parent. + * @member {string} parent + * @memberof google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest + * @instance + */ + ListRuntimeProjectAttachmentsRequest.prototype.parent = ""; + + /** + * ListRuntimeProjectAttachmentsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest + * @instance + */ + ListRuntimeProjectAttachmentsRequest.prototype.pageSize = 0; + + /** + * ListRuntimeProjectAttachmentsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest + * @instance + */ + ListRuntimeProjectAttachmentsRequest.prototype.pageToken = ""; + + /** + * ListRuntimeProjectAttachmentsRequest filter. + * @member {string} filter + * @memberof google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest + * @instance + */ + ListRuntimeProjectAttachmentsRequest.prototype.filter = ""; + + /** + * ListRuntimeProjectAttachmentsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest + * @instance + */ + ListRuntimeProjectAttachmentsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListRuntimeProjectAttachmentsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest + * @static + * @param {google.cloud.apihub.v1.IListRuntimeProjectAttachmentsRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest} ListRuntimeProjectAttachmentsRequest instance + */ + ListRuntimeProjectAttachmentsRequest.create = function create(properties) { + return new ListRuntimeProjectAttachmentsRequest(properties); + }; + + /** + * Encodes the specified ListRuntimeProjectAttachmentsRequest message. Does not implicitly {@link google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest + * @static + * @param {google.cloud.apihub.v1.IListRuntimeProjectAttachmentsRequest} message ListRuntimeProjectAttachmentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRuntimeProjectAttachmentsRequest.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); + return writer; + }; + + /** + * Encodes the specified ListRuntimeProjectAttachmentsRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest + * @static + * @param {google.cloud.apihub.v1.IListRuntimeProjectAttachmentsRequest} message ListRuntimeProjectAttachmentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRuntimeProjectAttachmentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListRuntimeProjectAttachmentsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest} ListRuntimeProjectAttachmentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRuntimeProjectAttachmentsRequest.decode = function 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.apihub.v1.ListRuntimeProjectAttachmentsRequest(); + 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; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListRuntimeProjectAttachmentsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest} ListRuntimeProjectAttachmentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRuntimeProjectAttachmentsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListRuntimeProjectAttachmentsRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListRuntimeProjectAttachmentsRequest.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"; + return null; + }; + + /** + * Creates a ListRuntimeProjectAttachmentsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest} ListRuntimeProjectAttachmentsRequest + */ + ListRuntimeProjectAttachmentsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest) + return object; + var message = new $root.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest(); + 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); + return message; + }; + + /** + * Creates a plain object from a ListRuntimeProjectAttachmentsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest + * @static + * @param {google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest} message ListRuntimeProjectAttachmentsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListRuntimeProjectAttachmentsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + 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; + return object; + }; + + /** + * Converts this ListRuntimeProjectAttachmentsRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest + * @instance + * @returns {Object.} JSON object + */ + ListRuntimeProjectAttachmentsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListRuntimeProjectAttachmentsRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListRuntimeProjectAttachmentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest"; + }; + + return ListRuntimeProjectAttachmentsRequest; + })(); + + v1.ListRuntimeProjectAttachmentsResponse = (function() { + + /** + * Properties of a ListRuntimeProjectAttachmentsResponse. + * @memberof google.cloud.apihub.v1 + * @interface IListRuntimeProjectAttachmentsResponse + * @property {Array.|null} [runtimeProjectAttachments] ListRuntimeProjectAttachmentsResponse runtimeProjectAttachments + * @property {string|null} [nextPageToken] ListRuntimeProjectAttachmentsResponse nextPageToken + */ + + /** + * Constructs a new ListRuntimeProjectAttachmentsResponse. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a ListRuntimeProjectAttachmentsResponse. + * @implements IListRuntimeProjectAttachmentsResponse + * @constructor + * @param {google.cloud.apihub.v1.IListRuntimeProjectAttachmentsResponse=} [properties] Properties to set + */ + function ListRuntimeProjectAttachmentsResponse(properties) { + this.runtimeProjectAttachments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListRuntimeProjectAttachmentsResponse runtimeProjectAttachments. + * @member {Array.} runtimeProjectAttachments + * @memberof google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse + * @instance + */ + ListRuntimeProjectAttachmentsResponse.prototype.runtimeProjectAttachments = $util.emptyArray; + + /** + * ListRuntimeProjectAttachmentsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse + * @instance + */ + ListRuntimeProjectAttachmentsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListRuntimeProjectAttachmentsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse + * @static + * @param {google.cloud.apihub.v1.IListRuntimeProjectAttachmentsResponse=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse} ListRuntimeProjectAttachmentsResponse instance + */ + ListRuntimeProjectAttachmentsResponse.create = function create(properties) { + return new ListRuntimeProjectAttachmentsResponse(properties); + }; + + /** + * Encodes the specified ListRuntimeProjectAttachmentsResponse message. Does not implicitly {@link google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse + * @static + * @param {google.cloud.apihub.v1.IListRuntimeProjectAttachmentsResponse} message ListRuntimeProjectAttachmentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRuntimeProjectAttachmentsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.runtimeProjectAttachments != null && message.runtimeProjectAttachments.length) + for (var i = 0; i < message.runtimeProjectAttachments.length; ++i) + $root.google.cloud.apihub.v1.RuntimeProjectAttachment.encode(message.runtimeProjectAttachments[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 ListRuntimeProjectAttachmentsResponse message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse + * @static + * @param {google.cloud.apihub.v1.IListRuntimeProjectAttachmentsResponse} message ListRuntimeProjectAttachmentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRuntimeProjectAttachmentsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListRuntimeProjectAttachmentsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse} ListRuntimeProjectAttachmentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRuntimeProjectAttachmentsResponse.decode = function 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.apihub.v1.ListRuntimeProjectAttachmentsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.runtimeProjectAttachments && message.runtimeProjectAttachments.length)) + message.runtimeProjectAttachments = []; + message.runtimeProjectAttachments.push($root.google.cloud.apihub.v1.RuntimeProjectAttachment.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListRuntimeProjectAttachmentsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse} ListRuntimeProjectAttachmentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRuntimeProjectAttachmentsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListRuntimeProjectAttachmentsResponse message. + * @function verify + * @memberof google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListRuntimeProjectAttachmentsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.runtimeProjectAttachments != null && message.hasOwnProperty("runtimeProjectAttachments")) { + if (!Array.isArray(message.runtimeProjectAttachments)) + return "runtimeProjectAttachments: array expected"; + for (var i = 0; i < message.runtimeProjectAttachments.length; ++i) { + var error = $root.google.cloud.apihub.v1.RuntimeProjectAttachment.verify(message.runtimeProjectAttachments[i]); + if (error) + return "runtimeProjectAttachments." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListRuntimeProjectAttachmentsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse} ListRuntimeProjectAttachmentsResponse + */ + ListRuntimeProjectAttachmentsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse) + return object; + var message = new $root.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse(); + if (object.runtimeProjectAttachments) { + if (!Array.isArray(object.runtimeProjectAttachments)) + throw TypeError(".google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse.runtimeProjectAttachments: array expected"); + message.runtimeProjectAttachments = []; + for (var i = 0; i < object.runtimeProjectAttachments.length; ++i) { + if (typeof object.runtimeProjectAttachments[i] !== "object") + throw TypeError(".google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse.runtimeProjectAttachments: object expected"); + message.runtimeProjectAttachments[i] = $root.google.cloud.apihub.v1.RuntimeProjectAttachment.fromObject(object.runtimeProjectAttachments[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListRuntimeProjectAttachmentsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse + * @static + * @param {google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse} message ListRuntimeProjectAttachmentsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListRuntimeProjectAttachmentsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.runtimeProjectAttachments = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.runtimeProjectAttachments && message.runtimeProjectAttachments.length) { + object.runtimeProjectAttachments = []; + for (var j = 0; j < message.runtimeProjectAttachments.length; ++j) + object.runtimeProjectAttachments[j] = $root.google.cloud.apihub.v1.RuntimeProjectAttachment.toObject(message.runtimeProjectAttachments[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListRuntimeProjectAttachmentsResponse to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse + * @instance + * @returns {Object.} JSON object + */ + ListRuntimeProjectAttachmentsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListRuntimeProjectAttachmentsResponse + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListRuntimeProjectAttachmentsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse"; + }; + + return ListRuntimeProjectAttachmentsResponse; + })(); + + v1.DeleteRuntimeProjectAttachmentRequest = (function() { + + /** + * Properties of a DeleteRuntimeProjectAttachmentRequest. + * @memberof google.cloud.apihub.v1 + * @interface IDeleteRuntimeProjectAttachmentRequest + * @property {string|null} [name] DeleteRuntimeProjectAttachmentRequest name + */ + + /** + * Constructs a new DeleteRuntimeProjectAttachmentRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a DeleteRuntimeProjectAttachmentRequest. + * @implements IDeleteRuntimeProjectAttachmentRequest + * @constructor + * @param {google.cloud.apihub.v1.IDeleteRuntimeProjectAttachmentRequest=} [properties] Properties to set + */ + function DeleteRuntimeProjectAttachmentRequest(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]]; + } + + /** + * DeleteRuntimeProjectAttachmentRequest name. + * @member {string} name + * @memberof google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest + * @instance + */ + DeleteRuntimeProjectAttachmentRequest.prototype.name = ""; + + /** + * Creates a new DeleteRuntimeProjectAttachmentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest + * @static + * @param {google.cloud.apihub.v1.IDeleteRuntimeProjectAttachmentRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest} DeleteRuntimeProjectAttachmentRequest instance + */ + DeleteRuntimeProjectAttachmentRequest.create = function create(properties) { + return new DeleteRuntimeProjectAttachmentRequest(properties); + }; + + /** + * Encodes the specified DeleteRuntimeProjectAttachmentRequest message. Does not implicitly {@link google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest + * @static + * @param {google.cloud.apihub.v1.IDeleteRuntimeProjectAttachmentRequest} message DeleteRuntimeProjectAttachmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteRuntimeProjectAttachmentRequest.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 DeleteRuntimeProjectAttachmentRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest + * @static + * @param {google.cloud.apihub.v1.IDeleteRuntimeProjectAttachmentRequest} message DeleteRuntimeProjectAttachmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteRuntimeProjectAttachmentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteRuntimeProjectAttachmentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest} DeleteRuntimeProjectAttachmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteRuntimeProjectAttachmentRequest.decode = function 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.apihub.v1.DeleteRuntimeProjectAttachmentRequest(); + 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 DeleteRuntimeProjectAttachmentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest} DeleteRuntimeProjectAttachmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteRuntimeProjectAttachmentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteRuntimeProjectAttachmentRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteRuntimeProjectAttachmentRequest.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 DeleteRuntimeProjectAttachmentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest} DeleteRuntimeProjectAttachmentRequest + */ + DeleteRuntimeProjectAttachmentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest) + return object; + var message = new $root.google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteRuntimeProjectAttachmentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest + * @static + * @param {google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest} message DeleteRuntimeProjectAttachmentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteRuntimeProjectAttachmentRequest.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 DeleteRuntimeProjectAttachmentRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteRuntimeProjectAttachmentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteRuntimeProjectAttachmentRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteRuntimeProjectAttachmentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest"; + }; + + return DeleteRuntimeProjectAttachmentRequest; + })(); + + v1.LookupRuntimeProjectAttachmentRequest = (function() { + + /** + * Properties of a LookupRuntimeProjectAttachmentRequest. + * @memberof google.cloud.apihub.v1 + * @interface ILookupRuntimeProjectAttachmentRequest + * @property {string|null} [name] LookupRuntimeProjectAttachmentRequest name + */ + + /** + * Constructs a new LookupRuntimeProjectAttachmentRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a LookupRuntimeProjectAttachmentRequest. + * @implements ILookupRuntimeProjectAttachmentRequest + * @constructor + * @param {google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentRequest=} [properties] Properties to set + */ + function LookupRuntimeProjectAttachmentRequest(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]]; + } + + /** + * LookupRuntimeProjectAttachmentRequest name. + * @member {string} name + * @memberof google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest + * @instance + */ + LookupRuntimeProjectAttachmentRequest.prototype.name = ""; + + /** + * Creates a new LookupRuntimeProjectAttachmentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest + * @static + * @param {google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest} LookupRuntimeProjectAttachmentRequest instance + */ + LookupRuntimeProjectAttachmentRequest.create = function create(properties) { + return new LookupRuntimeProjectAttachmentRequest(properties); + }; + + /** + * Encodes the specified LookupRuntimeProjectAttachmentRequest message. Does not implicitly {@link google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest + * @static + * @param {google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentRequest} message LookupRuntimeProjectAttachmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LookupRuntimeProjectAttachmentRequest.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 LookupRuntimeProjectAttachmentRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest + * @static + * @param {google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentRequest} message LookupRuntimeProjectAttachmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LookupRuntimeProjectAttachmentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LookupRuntimeProjectAttachmentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest} LookupRuntimeProjectAttachmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LookupRuntimeProjectAttachmentRequest.decode = function 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.apihub.v1.LookupRuntimeProjectAttachmentRequest(); + 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 LookupRuntimeProjectAttachmentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest} LookupRuntimeProjectAttachmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LookupRuntimeProjectAttachmentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LookupRuntimeProjectAttachmentRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LookupRuntimeProjectAttachmentRequest.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 LookupRuntimeProjectAttachmentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest} LookupRuntimeProjectAttachmentRequest + */ + LookupRuntimeProjectAttachmentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest) + return object; + var message = new $root.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a LookupRuntimeProjectAttachmentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest + * @static + * @param {google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest} message LookupRuntimeProjectAttachmentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LookupRuntimeProjectAttachmentRequest.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 LookupRuntimeProjectAttachmentRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest + * @instance + * @returns {Object.} JSON object + */ + LookupRuntimeProjectAttachmentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LookupRuntimeProjectAttachmentRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LookupRuntimeProjectAttachmentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest"; + }; + + return LookupRuntimeProjectAttachmentRequest; + })(); + + v1.LookupRuntimeProjectAttachmentResponse = (function() { + + /** + * Properties of a LookupRuntimeProjectAttachmentResponse. + * @memberof google.cloud.apihub.v1 + * @interface ILookupRuntimeProjectAttachmentResponse + * @property {google.cloud.apihub.v1.IRuntimeProjectAttachment|null} [runtimeProjectAttachment] LookupRuntimeProjectAttachmentResponse runtimeProjectAttachment + */ + + /** + * Constructs a new LookupRuntimeProjectAttachmentResponse. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a LookupRuntimeProjectAttachmentResponse. + * @implements ILookupRuntimeProjectAttachmentResponse + * @constructor + * @param {google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentResponse=} [properties] Properties to set + */ + function LookupRuntimeProjectAttachmentResponse(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]]; + } + + /** + * LookupRuntimeProjectAttachmentResponse runtimeProjectAttachment. + * @member {google.cloud.apihub.v1.IRuntimeProjectAttachment|null|undefined} runtimeProjectAttachment + * @memberof google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse + * @instance + */ + LookupRuntimeProjectAttachmentResponse.prototype.runtimeProjectAttachment = null; + + /** + * Creates a new LookupRuntimeProjectAttachmentResponse instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse + * @static + * @param {google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentResponse=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse} LookupRuntimeProjectAttachmentResponse instance + */ + LookupRuntimeProjectAttachmentResponse.create = function create(properties) { + return new LookupRuntimeProjectAttachmentResponse(properties); + }; + + /** + * Encodes the specified LookupRuntimeProjectAttachmentResponse message. Does not implicitly {@link google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse + * @static + * @param {google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentResponse} message LookupRuntimeProjectAttachmentResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LookupRuntimeProjectAttachmentResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.runtimeProjectAttachment != null && Object.hasOwnProperty.call(message, "runtimeProjectAttachment")) + $root.google.cloud.apihub.v1.RuntimeProjectAttachment.encode(message.runtimeProjectAttachment, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LookupRuntimeProjectAttachmentResponse message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse + * @static + * @param {google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentResponse} message LookupRuntimeProjectAttachmentResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LookupRuntimeProjectAttachmentResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LookupRuntimeProjectAttachmentResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse} LookupRuntimeProjectAttachmentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LookupRuntimeProjectAttachmentResponse.decode = function 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.apihub.v1.LookupRuntimeProjectAttachmentResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.runtimeProjectAttachment = $root.google.cloud.apihub.v1.RuntimeProjectAttachment.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LookupRuntimeProjectAttachmentResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse} LookupRuntimeProjectAttachmentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LookupRuntimeProjectAttachmentResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LookupRuntimeProjectAttachmentResponse message. + * @function verify + * @memberof google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LookupRuntimeProjectAttachmentResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.runtimeProjectAttachment != null && message.hasOwnProperty("runtimeProjectAttachment")) { + var error = $root.google.cloud.apihub.v1.RuntimeProjectAttachment.verify(message.runtimeProjectAttachment); + if (error) + return "runtimeProjectAttachment." + error; + } + return null; + }; + + /** + * Creates a LookupRuntimeProjectAttachmentResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse} LookupRuntimeProjectAttachmentResponse + */ + LookupRuntimeProjectAttachmentResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse) + return object; + var message = new $root.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse(); + if (object.runtimeProjectAttachment != null) { + if (typeof object.runtimeProjectAttachment !== "object") + throw TypeError(".google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse.runtimeProjectAttachment: object expected"); + message.runtimeProjectAttachment = $root.google.cloud.apihub.v1.RuntimeProjectAttachment.fromObject(object.runtimeProjectAttachment); + } + return message; + }; + + /** + * Creates a plain object from a LookupRuntimeProjectAttachmentResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse + * @static + * @param {google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse} message LookupRuntimeProjectAttachmentResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LookupRuntimeProjectAttachmentResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.runtimeProjectAttachment = null; + if (message.runtimeProjectAttachment != null && message.hasOwnProperty("runtimeProjectAttachment")) + object.runtimeProjectAttachment = $root.google.cloud.apihub.v1.RuntimeProjectAttachment.toObject(message.runtimeProjectAttachment, options); + return object; + }; + + /** + * Converts this LookupRuntimeProjectAttachmentResponse to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse + * @instance + * @returns {Object.} JSON object + */ + LookupRuntimeProjectAttachmentResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LookupRuntimeProjectAttachmentResponse + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LookupRuntimeProjectAttachmentResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse"; + }; + + return LookupRuntimeProjectAttachmentResponse; + })(); + + v1.RuntimeProjectAttachment = (function() { + + /** + * Properties of a RuntimeProjectAttachment. + * @memberof google.cloud.apihub.v1 + * @interface IRuntimeProjectAttachment + * @property {string|null} [name] RuntimeProjectAttachment name + * @property {string|null} [runtimeProject] RuntimeProjectAttachment runtimeProject + * @property {google.protobuf.ITimestamp|null} [createTime] RuntimeProjectAttachment createTime + */ + + /** + * Constructs a new RuntimeProjectAttachment. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a RuntimeProjectAttachment. + * @implements IRuntimeProjectAttachment + * @constructor + * @param {google.cloud.apihub.v1.IRuntimeProjectAttachment=} [properties] Properties to set + */ + function RuntimeProjectAttachment(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]]; + } + + /** + * RuntimeProjectAttachment name. + * @member {string} name + * @memberof google.cloud.apihub.v1.RuntimeProjectAttachment + * @instance + */ + RuntimeProjectAttachment.prototype.name = ""; + + /** + * RuntimeProjectAttachment runtimeProject. + * @member {string} runtimeProject + * @memberof google.cloud.apihub.v1.RuntimeProjectAttachment + * @instance + */ + RuntimeProjectAttachment.prototype.runtimeProject = ""; + + /** + * RuntimeProjectAttachment createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.apihub.v1.RuntimeProjectAttachment + * @instance + */ + RuntimeProjectAttachment.prototype.createTime = null; + + /** + * Creates a new RuntimeProjectAttachment instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.RuntimeProjectAttachment + * @static + * @param {google.cloud.apihub.v1.IRuntimeProjectAttachment=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.RuntimeProjectAttachment} RuntimeProjectAttachment instance + */ + RuntimeProjectAttachment.create = function create(properties) { + return new RuntimeProjectAttachment(properties); + }; + + /** + * Encodes the specified RuntimeProjectAttachment message. Does not implicitly {@link google.cloud.apihub.v1.RuntimeProjectAttachment.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.RuntimeProjectAttachment + * @static + * @param {google.cloud.apihub.v1.IRuntimeProjectAttachment} message RuntimeProjectAttachment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RuntimeProjectAttachment.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.runtimeProject != null && Object.hasOwnProperty.call(message, "runtimeProject")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.runtimeProject); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RuntimeProjectAttachment message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.RuntimeProjectAttachment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.RuntimeProjectAttachment + * @static + * @param {google.cloud.apihub.v1.IRuntimeProjectAttachment} message RuntimeProjectAttachment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RuntimeProjectAttachment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RuntimeProjectAttachment message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.RuntimeProjectAttachment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.RuntimeProjectAttachment} RuntimeProjectAttachment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RuntimeProjectAttachment.decode = function 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.apihub.v1.RuntimeProjectAttachment(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.runtimeProject = reader.string(); + break; + } + case 3: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RuntimeProjectAttachment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.RuntimeProjectAttachment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.RuntimeProjectAttachment} RuntimeProjectAttachment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RuntimeProjectAttachment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RuntimeProjectAttachment message. + * @function verify + * @memberof google.cloud.apihub.v1.RuntimeProjectAttachment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RuntimeProjectAttachment.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.runtimeProject != null && message.hasOwnProperty("runtimeProject")) + if (!$util.isString(message.runtimeProject)) + return "runtimeProject: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + return null; + }; + + /** + * Creates a RuntimeProjectAttachment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.RuntimeProjectAttachment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.RuntimeProjectAttachment} RuntimeProjectAttachment + */ + RuntimeProjectAttachment.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.RuntimeProjectAttachment) + return object; + var message = new $root.google.cloud.apihub.v1.RuntimeProjectAttachment(); + if (object.name != null) + message.name = String(object.name); + if (object.runtimeProject != null) + message.runtimeProject = String(object.runtimeProject); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.apihub.v1.RuntimeProjectAttachment.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + return message; + }; + + /** + * Creates a plain object from a RuntimeProjectAttachment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.RuntimeProjectAttachment + * @static + * @param {google.cloud.apihub.v1.RuntimeProjectAttachment} message RuntimeProjectAttachment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RuntimeProjectAttachment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.runtimeProject = ""; + object.createTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.runtimeProject != null && message.hasOwnProperty("runtimeProject")) + object.runtimeProject = message.runtimeProject; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + return object; + }; + + /** + * Converts this RuntimeProjectAttachment to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.RuntimeProjectAttachment + * @instance + * @returns {Object.} JSON object + */ + RuntimeProjectAttachment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RuntimeProjectAttachment + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.RuntimeProjectAttachment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RuntimeProjectAttachment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.RuntimeProjectAttachment"; + }; + + return RuntimeProjectAttachment; + })(); + + return v1; + })(); + + return apihub; + })(); + + return cloud; + })(); + + google.api = (function() { + + /** + * Namespace api. + * @memberof google + * @namespace + */ + var api = {}; + + api.Http = (function() { + + /** + * Properties of a Http. + * @memberof google.api + * @interface IHttp + * @property {Array.|null} [rules] Http rules + * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion + */ + + /** + * Constructs a new Http. + * @memberof google.api + * @classdesc Represents a Http. + * @implements IHttp + * @constructor + * @param {google.api.IHttp=} [properties] Properties to set + */ + function Http(properties) { + this.rules = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Http rules. + * @member {Array.} rules + * @memberof google.api.Http + * @instance + */ + Http.prototype.rules = $util.emptyArray; + + /** + * Http fullyDecodeReservedExpansion. + * @member {boolean} fullyDecodeReservedExpansion + * @memberof google.api.Http + * @instance + */ + Http.prototype.fullyDecodeReservedExpansion = false; + + /** + * Creates a new Http instance using the specified properties. + * @function create + * @memberof google.api.Http + * @static + * @param {google.api.IHttp=} [properties] Properties to set + * @returns {google.api.Http} Http instance + */ + Http.create = function create(properties) { + return new Http(properties); + }; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encode + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rules != null && message.rules.length) + for (var i = 0; i < message.rules.length; ++i) + $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); + return writer; + }; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Http message from the specified reader or buffer. + * @function decode + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } + case 2: { + message.fullyDecodeReservedExpansion = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Http message. + * @function verify + * @memberof google.api.Http + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Http.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rules != null && message.hasOwnProperty("rules")) { + if (!Array.isArray(message.rules)) + return "rules: array expected"; + for (var i = 0; i < message.rules.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.rules[i]); + if (error) + return "rules." + error; + } + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + if (typeof message.fullyDecodeReservedExpansion !== "boolean") + return "fullyDecodeReservedExpansion: boolean expected"; + return null; + }; + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Http + * @static + * @param {Object.} object Plain object + * @returns {google.api.Http} Http + */ + Http.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Http) + return object; + var message = new $root.google.api.Http(); + if (object.rules) { + if (!Array.isArray(object.rules)) + throw TypeError(".google.api.Http.rules: array expected"); + message.rules = []; + for (var i = 0; i < object.rules.length; ++i) { + if (typeof object.rules[i] !== "object") + throw TypeError(".google.api.Http.rules: object expected"); + message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); + } + } + if (object.fullyDecodeReservedExpansion != null) + message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); + return message; + }; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Http + * @static + * @param {google.api.Http} message Http + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Http.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rules = []; + if (options.defaults) + object.fullyDecodeReservedExpansion = false; + if (message.rules && message.rules.length) { + object.rules = []; + for (var j = 0; j < message.rules.length; ++j) + object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; + return object; + }; + + /** + * Converts this Http to JSON. + * @function toJSON + * @memberof google.api.Http + * @instance + * @returns {Object.} JSON object + */ + Http.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * 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 + * @property {string|null} [protoReferenceDocumentationUri] Publishing protoReferenceDocumentationUri + * @property {string|null} [restReferenceDocumentationUri] Publishing restReferenceDocumentationUri + */ + + /** + * 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; + + /** + * Publishing protoReferenceDocumentationUri. + * @member {string} protoReferenceDocumentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.protoReferenceDocumentationUri = ""; + + /** + * Publishing restReferenceDocumentationUri. + * @member {string} restReferenceDocumentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.restReferenceDocumentationUri = ""; + + /** + * 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(); + if (message.protoReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "protoReferenceDocumentationUri")) + writer.uint32(/* id 110, wireType 2 =*/882).string(message.protoReferenceDocumentationUri); + if (message.restReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "restReferenceDocumentationUri")) + writer.uint32(/* id 111, wireType 2 =*/890).string(message.restReferenceDocumentationUri); + 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; + } + case 110: { + message.protoReferenceDocumentationUri = reader.string(); + break; + } + case 111: { + message.restReferenceDocumentationUri = reader.string(); + 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: + case 5: + case 6: + case 7: + 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; + } + } + if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) + if (!$util.isString(message.protoReferenceDocumentationUri)) + return "protoReferenceDocumentationUri: string expected"; + if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) + if (!$util.isString(message.restReferenceDocumentationUri)) + return "restReferenceDocumentationUri: string expected"; + 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; + case "SHOPPING": + case 5: + message.organization = 5; + break; + case "GEO": + case 6: + message.organization = 6; + break; + case "GENERATIVE_AI": + case 7: + message.organization = 7; + 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]); + } + } + if (object.protoReferenceDocumentationUri != null) + message.protoReferenceDocumentationUri = String(object.protoReferenceDocumentationUri); + if (object.restReferenceDocumentationUri != null) + message.restReferenceDocumentationUri = String(object.restReferenceDocumentationUri); + 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; + object.protoReferenceDocumentationUri = ""; + object.restReferenceDocumentationUri = ""; + } + 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); + } + if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) + object.protoReferenceDocumentationUri = message.protoReferenceDocumentationUri; + if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) + object.restReferenceDocumentationUri = message.restReferenceDocumentationUri; + 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 + * @property {Object.|null} [renamedServices] DotnetSettings renamedServices + * @property {Object.|null} [renamedResources] DotnetSettings renamedResources + * @property {Array.|null} [ignoredResources] DotnetSettings ignoredResources + * @property {Array.|null} [forcedNamespaceAliases] DotnetSettings forcedNamespaceAliases + * @property {Array.|null} [handwrittenSignatures] DotnetSettings handwrittenSignatures + */ + + /** + * 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) { + this.renamedServices = {}; + this.renamedResources = {}; + this.ignoredResources = []; + this.forcedNamespaceAliases = []; + this.handwrittenSignatures = []; + if (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; + + /** + * DotnetSettings renamedServices. + * @member {Object.} renamedServices + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.renamedServices = $util.emptyObject; + + /** + * DotnetSettings renamedResources. + * @member {Object.} renamedResources + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.renamedResources = $util.emptyObject; + + /** + * DotnetSettings ignoredResources. + * @member {Array.} ignoredResources + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.ignoredResources = $util.emptyArray; + + /** + * DotnetSettings forcedNamespaceAliases. + * @member {Array.} forcedNamespaceAliases + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.forcedNamespaceAliases = $util.emptyArray; + + /** + * DotnetSettings handwrittenSignatures. + * @member {Array.} handwrittenSignatures + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.handwrittenSignatures = $util.emptyArray; + + /** + * 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(); + if (message.renamedServices != null && Object.hasOwnProperty.call(message, "renamedServices")) + for (var keys = Object.keys(message.renamedServices), 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.renamedServices[keys[i]]).ldelim(); + if (message.renamedResources != null && Object.hasOwnProperty.call(message, "renamedResources")) + for (var keys = Object.keys(message.renamedResources), i = 0; i < keys.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedResources[keys[i]]).ldelim(); + if (message.ignoredResources != null && message.ignoredResources.length) + for (var i = 0; i < message.ignoredResources.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.ignoredResources[i]); + if (message.forcedNamespaceAliases != null && message.forcedNamespaceAliases.length) + for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.forcedNamespaceAliases[i]); + if (message.handwrittenSignatures != null && message.handwrittenSignatures.length) + for (var i = 0; i < message.handwrittenSignatures.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.handwrittenSignatures[i]); + 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(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + case 2: { + if (message.renamedServices === $util.emptyObject) + message.renamedServices = {}; + 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.renamedServices[key] = value; + break; + } + case 3: { + if (message.renamedResources === $util.emptyObject) + message.renamedResources = {}; + 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.renamedResources[key] = value; + break; + } + case 4: { + if (!(message.ignoredResources && message.ignoredResources.length)) + message.ignoredResources = []; + message.ignoredResources.push(reader.string()); + break; + } + case 5: { + if (!(message.forcedNamespaceAliases && message.forcedNamespaceAliases.length)) + message.forcedNamespaceAliases = []; + message.forcedNamespaceAliases.push(reader.string()); + break; + } + case 6: { + if (!(message.handwrittenSignatures && message.handwrittenSignatures.length)) + message.handwrittenSignatures = []; + message.handwrittenSignatures.push(reader.string()); + 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; + } + if (message.renamedServices != null && message.hasOwnProperty("renamedServices")) { + if (!$util.isObject(message.renamedServices)) + return "renamedServices: object expected"; + var key = Object.keys(message.renamedServices); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.renamedServices[key[i]])) + return "renamedServices: string{k:string} expected"; + } + if (message.renamedResources != null && message.hasOwnProperty("renamedResources")) { + if (!$util.isObject(message.renamedResources)) + return "renamedResources: object expected"; + var key = Object.keys(message.renamedResources); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.renamedResources[key[i]])) + return "renamedResources: string{k:string} expected"; + } + if (message.ignoredResources != null && message.hasOwnProperty("ignoredResources")) { + if (!Array.isArray(message.ignoredResources)) + return "ignoredResources: array expected"; + for (var i = 0; i < message.ignoredResources.length; ++i) + if (!$util.isString(message.ignoredResources[i])) + return "ignoredResources: string[] expected"; + } + if (message.forcedNamespaceAliases != null && message.hasOwnProperty("forcedNamespaceAliases")) { + if (!Array.isArray(message.forcedNamespaceAliases)) + return "forcedNamespaceAliases: array expected"; + for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) + if (!$util.isString(message.forcedNamespaceAliases[i])) + return "forcedNamespaceAliases: string[] expected"; + } + if (message.handwrittenSignatures != null && message.hasOwnProperty("handwrittenSignatures")) { + if (!Array.isArray(message.handwrittenSignatures)) + return "handwrittenSignatures: array expected"; + for (var i = 0; i < message.handwrittenSignatures.length; ++i) + if (!$util.isString(message.handwrittenSignatures[i])) + return "handwrittenSignatures: string[] expected"; + } + 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); + } + if (object.renamedServices) { + if (typeof object.renamedServices !== "object") + throw TypeError(".google.api.DotnetSettings.renamedServices: object expected"); + message.renamedServices = {}; + for (var keys = Object.keys(object.renamedServices), i = 0; i < keys.length; ++i) + message.renamedServices[keys[i]] = String(object.renamedServices[keys[i]]); + } + if (object.renamedResources) { + if (typeof object.renamedResources !== "object") + throw TypeError(".google.api.DotnetSettings.renamedResources: object expected"); + message.renamedResources = {}; + for (var keys = Object.keys(object.renamedResources), i = 0; i < keys.length; ++i) + message.renamedResources[keys[i]] = String(object.renamedResources[keys[i]]); + } + if (object.ignoredResources) { + if (!Array.isArray(object.ignoredResources)) + throw TypeError(".google.api.DotnetSettings.ignoredResources: array expected"); + message.ignoredResources = []; + for (var i = 0; i < object.ignoredResources.length; ++i) + message.ignoredResources[i] = String(object.ignoredResources[i]); + } + if (object.forcedNamespaceAliases) { + if (!Array.isArray(object.forcedNamespaceAliases)) + throw TypeError(".google.api.DotnetSettings.forcedNamespaceAliases: array expected"); + message.forcedNamespaceAliases = []; + for (var i = 0; i < object.forcedNamespaceAliases.length; ++i) + message.forcedNamespaceAliases[i] = String(object.forcedNamespaceAliases[i]); + } + if (object.handwrittenSignatures) { + if (!Array.isArray(object.handwrittenSignatures)) + throw TypeError(".google.api.DotnetSettings.handwrittenSignatures: array expected"); + message.handwrittenSignatures = []; + for (var i = 0; i < object.handwrittenSignatures.length; ++i) + message.handwrittenSignatures[i] = String(object.handwrittenSignatures[i]); + } + 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.arrays || options.defaults) { + object.ignoredResources = []; + object.forcedNamespaceAliases = []; + object.handwrittenSignatures = []; + } + if (options.objects || options.defaults) { + object.renamedServices = {}; + object.renamedResources = {}; + } + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + var keys2; + if (message.renamedServices && (keys2 = Object.keys(message.renamedServices)).length) { + object.renamedServices = {}; + for (var j = 0; j < keys2.length; ++j) + object.renamedServices[keys2[j]] = message.renamedServices[keys2[j]]; + } + if (message.renamedResources && (keys2 = Object.keys(message.renamedResources)).length) { + object.renamedResources = {}; + for (var j = 0; j < keys2.length; ++j) + object.renamedResources[keys2[j]] = message.renamedResources[keys2[j]]; + } + if (message.ignoredResources && message.ignoredResources.length) { + object.ignoredResources = []; + for (var j = 0; j < message.ignoredResources.length; ++j) + object.ignoredResources[j] = message.ignoredResources[j]; + } + if (message.forcedNamespaceAliases && message.forcedNamespaceAliases.length) { + object.forcedNamespaceAliases = []; + for (var j = 0; j < message.forcedNamespaceAliases.length; ++j) + object.forcedNamespaceAliases[j] = message.forcedNamespaceAliases[j]; + } + if (message.handwrittenSignatures && message.handwrittenSignatures.length) { + object.handwrittenSignatures = []; + for (var j = 0; j < message.handwrittenSignatures.length; ++j) + object.handwrittenSignatures[j] = message.handwrittenSignatures[j]; + } + 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 + * @property {Array.|null} [autoPopulatedFields] MethodSettings autoPopulatedFields + */ + + /** + * 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) { + this.autoPopulatedFields = []; + if (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; + + /** + * MethodSettings autoPopulatedFields. + * @member {Array.} autoPopulatedFields + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.autoPopulatedFields = $util.emptyArray; + + /** + * 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(); + if (message.autoPopulatedFields != null && message.autoPopulatedFields.length) + for (var i = 0; i < message.autoPopulatedFields.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.autoPopulatedFields[i]); + 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; + } + case 3: { + if (!(message.autoPopulatedFields && message.autoPopulatedFields.length)) + message.autoPopulatedFields = []; + message.autoPopulatedFields.push(reader.string()); + 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; + } + if (message.autoPopulatedFields != null && message.hasOwnProperty("autoPopulatedFields")) { + if (!Array.isArray(message.autoPopulatedFields)) + return "autoPopulatedFields: array expected"; + for (var i = 0; i < message.autoPopulatedFields.length; ++i) + if (!$util.isString(message.autoPopulatedFields[i])) + return "autoPopulatedFields: string[] expected"; + } + 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); + } + if (object.autoPopulatedFields) { + if (!Array.isArray(object.autoPopulatedFields)) + throw TypeError(".google.api.MethodSettings.autoPopulatedFields: array expected"); + message.autoPopulatedFields = []; + for (var i = 0; i < object.autoPopulatedFields.length; ++i) + message.autoPopulatedFields[i] = String(object.autoPopulatedFields[i]); + } + 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.arrays || options.defaults) + object.autoPopulatedFields = []; + 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); + if (message.autoPopulatedFields && message.autoPopulatedFields.length) { + object.autoPopulatedFields = []; + for (var j = 0; j < message.autoPopulatedFields.length; ++j) + object.autoPopulatedFields[j] = message.autoPopulatedFields[j]; + } + 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 + * @property {number} SHOPPING=5 SHOPPING value + * @property {number} GEO=6 GEO value + * @property {number} GENERATIVE_AI=7 GENERATIVE_AI 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; + values[valuesById[5] = "SHOPPING"] = 5; + values[valuesById[6] = "GEO"] = 6; + values[valuesById[7] = "GENERATIVE_AI"] = 7; + 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; + })(); + + /** + * 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 + * @property {number} IDENTIFIER=8 IDENTIFIER 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; + values[valuesById[8] = "IDENTIFIER"] = 8; + 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; + })(); + + 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; + })(); + + /** + * Edition enum. + * @name google.protobuf.Edition + * @enum {number} + * @property {number} EDITION_UNKNOWN=0 EDITION_UNKNOWN value + * @property {number} EDITION_PROTO2=998 EDITION_PROTO2 value + * @property {number} EDITION_PROTO3=999 EDITION_PROTO3 value + * @property {number} EDITION_2023=1000 EDITION_2023 value + * @property {number} EDITION_2024=1001 EDITION_2024 value + * @property {number} EDITION_1_TEST_ONLY=1 EDITION_1_TEST_ONLY value + * @property {number} EDITION_2_TEST_ONLY=2 EDITION_2_TEST_ONLY value + * @property {number} EDITION_99997_TEST_ONLY=99997 EDITION_99997_TEST_ONLY value + * @property {number} EDITION_99998_TEST_ONLY=99998 EDITION_99998_TEST_ONLY value + * @property {number} EDITION_99999_TEST_ONLY=99999 EDITION_99999_TEST_ONLY value + * @property {number} EDITION_MAX=2147483647 EDITION_MAX value + */ + protobuf.Edition = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EDITION_UNKNOWN"] = 0; + values[valuesById[998] = "EDITION_PROTO2"] = 998; + values[valuesById[999] = "EDITION_PROTO3"] = 999; + values[valuesById[1000] = "EDITION_2023"] = 1000; + values[valuesById[1001] = "EDITION_2024"] = 1001; + values[valuesById[1] = "EDITION_1_TEST_ONLY"] = 1; + values[valuesById[2] = "EDITION_2_TEST_ONLY"] = 2; + values[valuesById[99997] = "EDITION_99997_TEST_ONLY"] = 99997; + values[valuesById[99998] = "EDITION_99998_TEST_ONLY"] = 99998; + values[valuesById[99999] = "EDITION_99999_TEST_ONLY"] = 99999; + values[valuesById[2147483647] = "EDITION_MAX"] = 2147483647; + return values; + })(); + + 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 {google.protobuf.Edition|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 {google.protobuf.Edition} edition + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.edition = 0; + + /** + * 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 14, wireType 0 =*/112).int32(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 14: { + message.edition = reader.int32(); + 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")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + 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); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + 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 = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + 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 = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.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 + * @property {Array.|null} [declaration] ExtensionRangeOptions declaration + * @property {google.protobuf.IFeatureSet|null} [features] ExtensionRangeOptions features + * @property {google.protobuf.ExtensionRangeOptions.VerificationState|null} [verification] ExtensionRangeOptions verification + */ + + /** + * 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 = []; + this.declaration = []; + if (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; + + /** + * ExtensionRangeOptions declaration. + * @member {Array.} declaration + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.declaration = $util.emptyArray; + + /** + * ExtensionRangeOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.features = null; + + /** + * ExtensionRangeOptions verification. + * @member {google.protobuf.ExtensionRangeOptions.VerificationState} verification + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.verification = 1; + + /** + * 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.declaration != null && message.declaration.length) + for (var i = 0; i < message.declaration.length; ++i) + $root.google.protobuf.ExtensionRangeOptions.Declaration.encode(message.declaration[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.verification != null && Object.hasOwnProperty.call(message, "verification")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.verification); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); + 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; + } + case 2: { + if (!(message.declaration && message.declaration.length)) + message.declaration = []; + message.declaration.push($root.google.protobuf.ExtensionRangeOptions.Declaration.decode(reader, reader.uint32())); + break; + } + case 50: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 3: { + message.verification = reader.int32(); + 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; + } + } + if (message.declaration != null && message.hasOwnProperty("declaration")) { + if (!Array.isArray(message.declaration)) + return "declaration: array expected"; + for (var i = 0; i < message.declaration.length; ++i) { + var error = $root.google.protobuf.ExtensionRangeOptions.Declaration.verify(message.declaration[i]); + if (error) + return "declaration." + error; + } + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.verification != null && message.hasOwnProperty("verification")) + switch (message.verification) { + default: + return "verification: enum value expected"; + case 0: + case 1: + break; + } + 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]); + } + } + if (object.declaration) { + if (!Array.isArray(object.declaration)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: array expected"); + message.declaration = []; + for (var i = 0; i < object.declaration.length; ++i) { + if (typeof object.declaration[i] !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: object expected"); + message.declaration[i] = $root.google.protobuf.ExtensionRangeOptions.Declaration.fromObject(object.declaration[i]); + } + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + switch (object.verification) { + case "DECLARATION": + case 0: + message.verification = 0; + break; + default: + if (typeof object.verification === "number") { + message.verification = object.verification; + break; + } + break; + case "UNVERIFIED": + case 1: + message.verification = 1; + break; + } + 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.declaration = []; + object.uninterpretedOption = []; + } + if (options.defaults) { + object.verification = options.enums === String ? "UNVERIFIED" : 1; + object.features = null; + } + if (message.declaration && message.declaration.length) { + object.declaration = []; + for (var j = 0; j < message.declaration.length; ++j) + object.declaration[j] = $root.google.protobuf.ExtensionRangeOptions.Declaration.toObject(message.declaration[j], options); + } + if (message.verification != null && message.hasOwnProperty("verification")) + object.verification = options.enums === String ? $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] === undefined ? message.verification : $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] : message.verification; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + 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"; + }; + + ExtensionRangeOptions.Declaration = (function() { + + /** + * Properties of a Declaration. + * @memberof google.protobuf.ExtensionRangeOptions + * @interface IDeclaration + * @property {number|null} [number] Declaration number + * @property {string|null} [fullName] Declaration fullName + * @property {string|null} [type] Declaration type + * @property {boolean|null} [reserved] Declaration reserved + * @property {boolean|null} [repeated] Declaration repeated + */ + + /** + * Constructs a new Declaration. + * @memberof google.protobuf.ExtensionRangeOptions + * @classdesc Represents a Declaration. + * @implements IDeclaration + * @constructor + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set + */ + function Declaration(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]]; + } + + /** + * Declaration number. + * @member {number} number + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.number = 0; + + /** + * Declaration fullName. + * @member {string} fullName + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.fullName = ""; + + /** + * Declaration type. + * @member {string} type + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.type = ""; + + /** + * Declaration reserved. + * @member {boolean} reserved + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.reserved = false; + + /** + * Declaration repeated. + * @member {boolean} repeated + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.repeated = false; + + /** + * Creates a new Declaration instance using the specified properties. + * @function create + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration instance + */ + Declaration.create = function create(properties) { + return new Declaration(properties); + }; + + /** + * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Declaration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.number); + if (message.fullName != null && Object.hasOwnProperty.call(message, "fullName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.fullName); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.type); + if (message.reserved != null && Object.hasOwnProperty.call(message, "reserved")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.reserved); + if (message.repeated != null && Object.hasOwnProperty.call(message, "repeated")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.repeated); + return writer; + }; + + /** + * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Declaration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Declaration message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Declaration.decode = function 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.Declaration(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.number = reader.int32(); + break; + } + case 2: { + message.fullName = reader.string(); + break; + } + case 3: { + message.type = reader.string(); + break; + } + case 5: { + message.reserved = reader.bool(); + break; + } + case 6: { + message.repeated = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Declaration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Declaration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Declaration message. + * @function verify + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Declaration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.fullName != null && message.hasOwnProperty("fullName")) + if (!$util.isString(message.fullName)) + return "fullName: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.reserved != null && message.hasOwnProperty("reserved")) + if (typeof message.reserved !== "boolean") + return "reserved: boolean expected"; + if (message.repeated != null && message.hasOwnProperty("repeated")) + if (typeof message.repeated !== "boolean") + return "repeated: boolean expected"; + return null; + }; + + /** + * Creates a Declaration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + */ + Declaration.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions.Declaration) + return object; + var message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); + if (object.number != null) + message.number = object.number | 0; + if (object.fullName != null) + message.fullName = String(object.fullName); + if (object.type != null) + message.type = String(object.type); + if (object.reserved != null) + message.reserved = Boolean(object.reserved); + if (object.repeated != null) + message.repeated = Boolean(object.repeated); + return message; + }; + + /** + * Creates a plain object from a Declaration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.Declaration} message Declaration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Declaration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.number = 0; + object.fullName = ""; + object.type = ""; + object.reserved = false; + object.repeated = false; + } + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.fullName != null && message.hasOwnProperty("fullName")) + object.fullName = message.fullName; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.reserved != null && message.hasOwnProperty("reserved")) + object.reserved = message.reserved; + if (message.repeated != null && message.hasOwnProperty("repeated")) + object.repeated = message.repeated; + return object; + }; + + /** + * Converts this Declaration to JSON. + * @function toJSON + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + * @returns {Object.} JSON object + */ + Declaration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Declaration + * @function getTypeUrl + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Declaration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions.Declaration"; + }; + + return Declaration; + })(); + + /** + * VerificationState enum. + * @name google.protobuf.ExtensionRangeOptions.VerificationState + * @enum {number} + * @property {number} DECLARATION=0 DECLARATION value + * @property {number} UNVERIFIED=1 UNVERIFIED value + */ + ExtensionRangeOptions.VerificationState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DECLARATION"] = 0; + values[valuesById[1] = "UNVERIFIED"] = 1; + return values; + })(); + + 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 3: + case 2: + 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_REPEATED": + case 3: + message.label = 3; + break; + case "LABEL_REQUIRED": + case 2: + message.label = 2; + 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_REPEATED=3 LABEL_REPEATED value + * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value + */ + FieldDescriptorProto.Label = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "LABEL_OPTIONAL"] = 1; + values[valuesById[3] = "LABEL_REPEATED"] = 3; + values[valuesById[2] = "LABEL_REQUIRED"] = 2; + 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} [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 {google.protobuf.IFeatureSet|null} [features] FileOptions features + * @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 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 features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.features = null; + + /** + * 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.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.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); + 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 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 50: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + 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.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.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + 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.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.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FileOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + 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.phpMetadataNamespace = ""; + object.rubyPackage = ""; + object.features = null; + } + 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.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + object.phpMetadataNamespace = message.phpMetadataNamespace; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + object.rubyPackage = message.rubyPackage; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + 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 {google.protobuf.IFeatureSet|null} [features] MessageOptions features + * @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 features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.features = null; + + /** + * 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.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + 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 12: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + 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.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + 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.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.MessageOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + 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.features = null; + 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.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + 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 {Array.|null} [targets] FieldOptions targets + * @property {Array.|null} [editionDefaults] FieldOptions editionDefaults + * @property {google.protobuf.IFeatureSet|null} [features] FieldOptions features + * @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.targets = []; + this.editionDefaults = []; + 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 targets. + * @member {Array.} targets + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.targets = $util.emptyArray; + + /** + * FieldOptions editionDefaults. + * @member {Array.} editionDefaults + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.editionDefaults = $util.emptyArray; + + /** + * FieldOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.features = null; + + /** + * 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.targets != null && message.targets.length) + for (var i = 0; i < message.targets.length; ++i) + writer.uint32(/* id 19, wireType 0 =*/152).int32(message.targets[i]); + if (message.editionDefaults != null && message.editionDefaults.length) + for (var i = 0; i < message.editionDefaults.length; ++i) + $root.google.protobuf.FieldOptions.EditionDefault.encode(message.editionDefaults[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + 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) + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + writer.uint32(/* id 1052, wireType 0 =*/8416).int32(message[".google.api.fieldBehavior"][i]); + 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 19: { + if (!(message.targets && message.targets.length)) + message.targets = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.targets.push(reader.int32()); + } else + message.targets.push(reader.int32()); + break; + } + case 20: { + if (!(message.editionDefaults && message.editionDefaults.length)) + message.editionDefaults = []; + message.editionDefaults.push($root.google.protobuf.FieldOptions.EditionDefault.decode(reader, reader.uint32())); + break; + } + case 21: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + 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.targets != null && message.hasOwnProperty("targets")) { + if (!Array.isArray(message.targets)) + return "targets: array expected"; + for (var i = 0; i < message.targets.length; ++i) + switch (message.targets[i]) { + default: + return "targets: 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.editionDefaults != null && message.hasOwnProperty("editionDefaults")) { + if (!Array.isArray(message.editionDefaults)) + return "editionDefaults: array expected"; + for (var i = 0; i < message.editionDefaults.length; ++i) { + var error = $root.google.protobuf.FieldOptions.EditionDefault.verify(message.editionDefaults[i]); + if (error) + return "editionDefaults." + error; + } + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + 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: + case 8: + 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; + } + if (object.targets) { + if (!Array.isArray(object.targets)) + throw TypeError(".google.protobuf.FieldOptions.targets: array expected"); + message.targets = []; + for (var i = 0; i < object.targets.length; ++i) + switch (object.targets[i]) { + default: + if (typeof object.targets[i] === "number") { + message.targets[i] = object.targets[i]; + break; + } + case "TARGET_TYPE_UNKNOWN": + case 0: + message.targets[i] = 0; + break; + case "TARGET_TYPE_FILE": + case 1: + message.targets[i] = 1; + break; + case "TARGET_TYPE_EXTENSION_RANGE": + case 2: + message.targets[i] = 2; + break; + case "TARGET_TYPE_MESSAGE": + case 3: + message.targets[i] = 3; + break; + case "TARGET_TYPE_FIELD": + case 4: + message.targets[i] = 4; + break; + case "TARGET_TYPE_ONEOF": + case 5: + message.targets[i] = 5; + break; + case "TARGET_TYPE_ENUM": + case 6: + message.targets[i] = 6; + break; + case "TARGET_TYPE_ENUM_ENTRY": + case 7: + message.targets[i] = 7; + break; + case "TARGET_TYPE_SERVICE": + case 8: + message.targets[i] = 8; + break; + case "TARGET_TYPE_METHOD": + case 9: + message.targets[i] = 9; + break; + } + } + if (object.editionDefaults) { + if (!Array.isArray(object.editionDefaults)) + throw TypeError(".google.protobuf.FieldOptions.editionDefaults: array expected"); + message.editionDefaults = []; + for (var i = 0; i < object.editionDefaults.length; ++i) { + if (typeof object.editionDefaults[i] !== "object") + throw TypeError(".google.protobuf.FieldOptions.editionDefaults: object expected"); + message.editionDefaults[i] = $root.google.protobuf.FieldOptions.EditionDefault.fromObject(object.editionDefaults[i]); + } + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FieldOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + 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; + case "IDENTIFIER": + case 8: + message[".google.api.fieldBehavior"][i] = 8; + 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.targets = []; + object.editionDefaults = []; + 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.features = null; + 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.targets && message.targets.length) { + object.targets = []; + for (var j = 0; j < message.targets.length; ++j) + object.targets[j] = options.enums === String ? $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] === undefined ? message.targets[j] : $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] : message.targets[j]; + } + if (message.editionDefaults && message.editionDefaults.length) { + object.editionDefaults = []; + for (var j = 0; j < message.editionDefaults.length; ++j) + object.editionDefaults[j] = $root.google.protobuf.FieldOptions.EditionDefault.toObject(message.editionDefaults[j], options); + } + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + 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; + })(); + + FieldOptions.EditionDefault = (function() { + + /** + * Properties of an EditionDefault. + * @memberof google.protobuf.FieldOptions + * @interface IEditionDefault + * @property {google.protobuf.Edition|null} [edition] EditionDefault edition + * @property {string|null} [value] EditionDefault value + */ + + /** + * Constructs a new EditionDefault. + * @memberof google.protobuf.FieldOptions + * @classdesc Represents an EditionDefault. + * @implements IEditionDefault + * @constructor + * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set + */ + function EditionDefault(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]]; + } + + /** + * EditionDefault edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + */ + EditionDefault.prototype.edition = 0; + + /** + * EditionDefault value. + * @member {string} value + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + */ + EditionDefault.prototype.value = ""; + + /** + * Creates a new EditionDefault instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault instance + */ + EditionDefault.create = function create(properties) { + return new EditionDefault(properties); + }; + + /** + * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EditionDefault.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); + return writer; + }; + + /** + * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EditionDefault.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EditionDefault message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EditionDefault.decode = function 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.EditionDefault(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + message.edition = reader.int32(); + break; + } + case 2: { + message.value = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EditionDefault message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EditionDefault.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EditionDefault message. + * @function verify + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EditionDefault.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + return null; + }; + + /** + * Creates an EditionDefault message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + */ + EditionDefault.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions.EditionDefault) + return object; + var message = new $root.google.protobuf.FieldOptions.EditionDefault(); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.EditionDefault} message EditionDefault + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EditionDefault.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.value = ""; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this EditionDefault to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + * @returns {Object.} JSON object + */ + EditionDefault.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EditionDefault + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions.EditionDefault"; + }; + + return EditionDefault; + })(); + + return FieldOptions; + })(); + + protobuf.OneofOptions = (function() { + + /** + * Properties of an OneofOptions. + * @memberof google.protobuf + * @interface IOneofOptions + * @property {google.protobuf.IFeatureSet|null} [features] OneofOptions features + * @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 features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.features = null; + + /** + * 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.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + 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 1: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + 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.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + 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.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.OneofOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + 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 (options.defaults) + object.features = null; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + 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 {google.protobuf.IFeatureSet|null} [features] EnumOptions features + * @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 features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.features = null; + + /** + * 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.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + 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 7: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + 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.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + 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.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.EnumOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + 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; + object.features = null; + } + 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.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + 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 {google.protobuf.IFeatureSet|null} [features] EnumValueOptions features + * @property {boolean|null} [debugRedact] EnumValueOptions debugRedact + * @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 features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.features = null; + + /** + * EnumValueOptions debugRedact. + * @member {boolean} debugRedact + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.debugRedact = 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.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.debugRedact); + 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 2: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 3: { + message.debugRedact = 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.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + if (typeof message.debugRedact !== "boolean") + return "debugRedact: 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.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.debugRedact != null) + message.debugRedact = Boolean(object.debugRedact); + 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; + object.features = null; + object.debugRedact = false; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + object.debugRedact = message.debugRedact; + 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 {google.protobuf.IFeatureSet|null} [features] ServiceOptions features + * @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 + * @property {string|null} [".google.api.apiVersion"] ServiceOptions .google.api.apiVersion + */ + + /** + * 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 features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.features = null; + + /** + * 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"] = ""; + + /** + * ServiceOptions .google.api.apiVersion. + * @member {string} .google.api.apiVersion + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.apiVersion"] = ""; + + /** + * 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.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 34, wireType 2 =*/274).fork()).ldelim(); + 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"]); + if (message[".google.api.apiVersion"] != null && Object.hasOwnProperty.call(message, ".google.api.apiVersion")) + writer.uint32(/* id 525000001, wireType 2 =*/4200000010).string(message[".google.api.apiVersion"]); + 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 34: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 33: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1049: { + message[".google.api.defaultHost"] = reader.string(); + break; + } + case 1050: { + message[".google.api.oauthScopes"] = reader.string(); + break; + } + case 525000001: { + message[".google.api.apiVersion"] = 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.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + 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"; + if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) + if (!$util.isString(message[".google.api.apiVersion"])) + return ".google.api.apiVersion: 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.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.ServiceOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + 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"]); + if (object[".google.api.apiVersion"] != null) + message[".google.api.apiVersion"] = String(object[".google.api.apiVersion"]); + 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.features = null; + object[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; + object[".google.api.apiVersion"] = ""; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + 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"]; + if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) + object[".google.api.apiVersion"] = message[".google.api.apiVersion"]; + 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 {google.protobuf.IFeatureSet|null} [features] MethodOptions features + * @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 features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.features = null; + + /** + * 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.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 35, wireType 2 =*/282).fork()).ldelim(); + 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 35: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + 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.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + 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.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.MethodOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + 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.features = null; + 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.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + 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.FeatureSet = (function() { + + /** + * Properties of a FeatureSet. + * @memberof google.protobuf + * @interface IFeatureSet + * @property {google.protobuf.FeatureSet.FieldPresence|null} [fieldPresence] FeatureSet fieldPresence + * @property {google.protobuf.FeatureSet.EnumType|null} [enumType] FeatureSet enumType + * @property {google.protobuf.FeatureSet.RepeatedFieldEncoding|null} [repeatedFieldEncoding] FeatureSet repeatedFieldEncoding + * @property {google.protobuf.FeatureSet.Utf8Validation|null} [utf8Validation] FeatureSet utf8Validation + * @property {google.protobuf.FeatureSet.MessageEncoding|null} [messageEncoding] FeatureSet messageEncoding + * @property {google.protobuf.FeatureSet.JsonFormat|null} [jsonFormat] FeatureSet jsonFormat + */ + + /** + * Constructs a new FeatureSet. + * @memberof google.protobuf + * @classdesc Represents a FeatureSet. + * @implements IFeatureSet + * @constructor + * @param {google.protobuf.IFeatureSet=} [properties] Properties to set + */ + function FeatureSet(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]]; + } + + /** + * FeatureSet fieldPresence. + * @member {google.protobuf.FeatureSet.FieldPresence} fieldPresence + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.fieldPresence = 0; + + /** + * FeatureSet enumType. + * @member {google.protobuf.FeatureSet.EnumType} enumType + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.enumType = 0; + + /** + * FeatureSet repeatedFieldEncoding. + * @member {google.protobuf.FeatureSet.RepeatedFieldEncoding} repeatedFieldEncoding + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.repeatedFieldEncoding = 0; + + /** + * FeatureSet utf8Validation. + * @member {google.protobuf.FeatureSet.Utf8Validation} utf8Validation + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.utf8Validation = 0; + + /** + * FeatureSet messageEncoding. + * @member {google.protobuf.FeatureSet.MessageEncoding} messageEncoding + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.messageEncoding = 0; + + /** + * FeatureSet jsonFormat. + * @member {google.protobuf.FeatureSet.JsonFormat} jsonFormat + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.jsonFormat = 0; + + /** + * Creates a new FeatureSet instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet=} [properties] Properties to set + * @returns {google.protobuf.FeatureSet} FeatureSet instance + */ + FeatureSet.create = function create(properties) { + return new FeatureSet(properties); + }; + + /** + * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fieldPresence != null && Object.hasOwnProperty.call(message, "fieldPresence")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.fieldPresence); + if (message.enumType != null && Object.hasOwnProperty.call(message, "enumType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.enumType); + if (message.repeatedFieldEncoding != null && Object.hasOwnProperty.call(message, "repeatedFieldEncoding")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.repeatedFieldEncoding); + if (message.utf8Validation != null && Object.hasOwnProperty.call(message, "utf8Validation")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.utf8Validation); + if (message.messageEncoding != null && Object.hasOwnProperty.call(message, "messageEncoding")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.messageEncoding); + if (message.jsonFormat != null && Object.hasOwnProperty.call(message, "jsonFormat")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jsonFormat); + return writer; + }; + + /** + * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSet message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSet} FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSet.decode = function 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.FeatureSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.fieldPresence = reader.int32(); + break; + } + case 2: { + message.enumType = reader.int32(); + break; + } + case 3: { + message.repeatedFieldEncoding = reader.int32(); + break; + } + case 4: { + message.utf8Validation = reader.int32(); + break; + } + case 5: { + message.messageEncoding = reader.int32(); + break; + } + case 6: { + message.jsonFormat = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSet} FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSet message. + * @function verify + * @memberof google.protobuf.FeatureSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) + switch (message.fieldPresence) { + default: + return "fieldPresence: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.enumType != null && message.hasOwnProperty("enumType")) + switch (message.enumType) { + default: + return "enumType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) + switch (message.repeatedFieldEncoding) { + default: + return "repeatedFieldEncoding: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) + switch (message.utf8Validation) { + default: + return "utf8Validation: enum value expected"; + case 0: + case 2: + case 3: + break; + } + if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) + switch (message.messageEncoding) { + default: + return "messageEncoding: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) + switch (message.jsonFormat) { + default: + return "jsonFormat: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSet + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSet} FeatureSet + */ + FeatureSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSet) + return object; + var message = new $root.google.protobuf.FeatureSet(); + switch (object.fieldPresence) { + default: + if (typeof object.fieldPresence === "number") { + message.fieldPresence = object.fieldPresence; + break; + } + break; + case "FIELD_PRESENCE_UNKNOWN": + case 0: + message.fieldPresence = 0; + break; + case "EXPLICIT": + case 1: + message.fieldPresence = 1; + break; + case "IMPLICIT": + case 2: + message.fieldPresence = 2; + break; + case "LEGACY_REQUIRED": + case 3: + message.fieldPresence = 3; + break; + } + switch (object.enumType) { + default: + if (typeof object.enumType === "number") { + message.enumType = object.enumType; + break; + } + break; + case "ENUM_TYPE_UNKNOWN": + case 0: + message.enumType = 0; + break; + case "OPEN": + case 1: + message.enumType = 1; + break; + case "CLOSED": + case 2: + message.enumType = 2; + break; + } + switch (object.repeatedFieldEncoding) { + default: + if (typeof object.repeatedFieldEncoding === "number") { + message.repeatedFieldEncoding = object.repeatedFieldEncoding; + break; + } + break; + case "REPEATED_FIELD_ENCODING_UNKNOWN": + case 0: + message.repeatedFieldEncoding = 0; + break; + case "PACKED": + case 1: + message.repeatedFieldEncoding = 1; + break; + case "EXPANDED": + case 2: + message.repeatedFieldEncoding = 2; + break; + } + switch (object.utf8Validation) { + default: + if (typeof object.utf8Validation === "number") { + message.utf8Validation = object.utf8Validation; + break; + } + break; + case "UTF8_VALIDATION_UNKNOWN": + case 0: + message.utf8Validation = 0; + break; + case "VERIFY": + case 2: + message.utf8Validation = 2; + break; + case "NONE": + case 3: + message.utf8Validation = 3; + break; + } + switch (object.messageEncoding) { + default: + if (typeof object.messageEncoding === "number") { + message.messageEncoding = object.messageEncoding; + break; + } + break; + case "MESSAGE_ENCODING_UNKNOWN": + case 0: + message.messageEncoding = 0; + break; + case "LENGTH_PREFIXED": + case 1: + message.messageEncoding = 1; + break; + case "DELIMITED": + case 2: + message.messageEncoding = 2; + break; + } + switch (object.jsonFormat) { + default: + if (typeof object.jsonFormat === "number") { + message.jsonFormat = object.jsonFormat; + break; + } + break; + case "JSON_FORMAT_UNKNOWN": + case 0: + message.jsonFormat = 0; + break; + case "ALLOW": + case 1: + message.jsonFormat = 1; + break; + case "LEGACY_BEST_EFFORT": + case 2: + message.jsonFormat = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.FeatureSet} message FeatureSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.fieldPresence = options.enums === String ? "FIELD_PRESENCE_UNKNOWN" : 0; + object.enumType = options.enums === String ? "ENUM_TYPE_UNKNOWN" : 0; + object.repeatedFieldEncoding = options.enums === String ? "REPEATED_FIELD_ENCODING_UNKNOWN" : 0; + object.utf8Validation = options.enums === String ? "UTF8_VALIDATION_UNKNOWN" : 0; + object.messageEncoding = options.enums === String ? "MESSAGE_ENCODING_UNKNOWN" : 0; + object.jsonFormat = options.enums === String ? "JSON_FORMAT_UNKNOWN" : 0; + } + if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) + object.fieldPresence = options.enums === String ? $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] === undefined ? message.fieldPresence : $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] : message.fieldPresence; + if (message.enumType != null && message.hasOwnProperty("enumType")) + object.enumType = options.enums === String ? $root.google.protobuf.FeatureSet.EnumType[message.enumType] === undefined ? message.enumType : $root.google.protobuf.FeatureSet.EnumType[message.enumType] : message.enumType; + if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) + object.repeatedFieldEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] === undefined ? message.repeatedFieldEncoding : $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] : message.repeatedFieldEncoding; + if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) + object.utf8Validation = options.enums === String ? $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] === undefined ? message.utf8Validation : $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] : message.utf8Validation; + if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) + object.messageEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] === undefined ? message.messageEncoding : $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] : message.messageEncoding; + if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) + object.jsonFormat = options.enums === String ? $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] === undefined ? message.jsonFormat : $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] : message.jsonFormat; + return object; + }; + + /** + * Converts this FeatureSet to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSet + * @instance + * @returns {Object.} JSON object + */ + FeatureSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSet + * @function getTypeUrl + * @memberof google.protobuf.FeatureSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSet"; + }; + + /** + * FieldPresence enum. + * @name google.protobuf.FeatureSet.FieldPresence + * @enum {number} + * @property {number} FIELD_PRESENCE_UNKNOWN=0 FIELD_PRESENCE_UNKNOWN value + * @property {number} EXPLICIT=1 EXPLICIT value + * @property {number} IMPLICIT=2 IMPLICIT value + * @property {number} LEGACY_REQUIRED=3 LEGACY_REQUIRED value + */ + FeatureSet.FieldPresence = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FIELD_PRESENCE_UNKNOWN"] = 0; + values[valuesById[1] = "EXPLICIT"] = 1; + values[valuesById[2] = "IMPLICIT"] = 2; + values[valuesById[3] = "LEGACY_REQUIRED"] = 3; + return values; + })(); + + /** + * EnumType enum. + * @name google.protobuf.FeatureSet.EnumType + * @enum {number} + * @property {number} ENUM_TYPE_UNKNOWN=0 ENUM_TYPE_UNKNOWN value + * @property {number} OPEN=1 OPEN value + * @property {number} CLOSED=2 CLOSED value + */ + FeatureSet.EnumType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENUM_TYPE_UNKNOWN"] = 0; + values[valuesById[1] = "OPEN"] = 1; + values[valuesById[2] = "CLOSED"] = 2; + return values; + })(); + + /** + * RepeatedFieldEncoding enum. + * @name google.protobuf.FeatureSet.RepeatedFieldEncoding + * @enum {number} + * @property {number} REPEATED_FIELD_ENCODING_UNKNOWN=0 REPEATED_FIELD_ENCODING_UNKNOWN value + * @property {number} PACKED=1 PACKED value + * @property {number} EXPANDED=2 EXPANDED value + */ + FeatureSet.RepeatedFieldEncoding = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "REPEATED_FIELD_ENCODING_UNKNOWN"] = 0; + values[valuesById[1] = "PACKED"] = 1; + values[valuesById[2] = "EXPANDED"] = 2; + return values; + })(); + + /** + * Utf8Validation enum. + * @name google.protobuf.FeatureSet.Utf8Validation + * @enum {number} + * @property {number} UTF8_VALIDATION_UNKNOWN=0 UTF8_VALIDATION_UNKNOWN value + * @property {number} VERIFY=2 VERIFY value + * @property {number} NONE=3 NONE value + */ + FeatureSet.Utf8Validation = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UTF8_VALIDATION_UNKNOWN"] = 0; + values[valuesById[2] = "VERIFY"] = 2; + values[valuesById[3] = "NONE"] = 3; + return values; + })(); + + /** + * MessageEncoding enum. + * @name google.protobuf.FeatureSet.MessageEncoding + * @enum {number} + * @property {number} MESSAGE_ENCODING_UNKNOWN=0 MESSAGE_ENCODING_UNKNOWN value + * @property {number} LENGTH_PREFIXED=1 LENGTH_PREFIXED value + * @property {number} DELIMITED=2 DELIMITED value + */ + FeatureSet.MessageEncoding = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MESSAGE_ENCODING_UNKNOWN"] = 0; + values[valuesById[1] = "LENGTH_PREFIXED"] = 1; + values[valuesById[2] = "DELIMITED"] = 2; + return values; + })(); + + /** + * JsonFormat enum. + * @name google.protobuf.FeatureSet.JsonFormat + * @enum {number} + * @property {number} JSON_FORMAT_UNKNOWN=0 JSON_FORMAT_UNKNOWN value + * @property {number} ALLOW=1 ALLOW value + * @property {number} LEGACY_BEST_EFFORT=2 LEGACY_BEST_EFFORT value + */ + FeatureSet.JsonFormat = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JSON_FORMAT_UNKNOWN"] = 0; + values[valuesById[1] = "ALLOW"] = 1; + values[valuesById[2] = "LEGACY_BEST_EFFORT"] = 2; + return values; + })(); + + return FeatureSet; + })(); + + protobuf.FeatureSetDefaults = (function() { + + /** + * Properties of a FeatureSetDefaults. + * @memberof google.protobuf + * @interface IFeatureSetDefaults + * @property {Array.|null} [defaults] FeatureSetDefaults defaults + * @property {google.protobuf.Edition|null} [minimumEdition] FeatureSetDefaults minimumEdition + * @property {google.protobuf.Edition|null} [maximumEdition] FeatureSetDefaults maximumEdition + */ + + /** + * Constructs a new FeatureSetDefaults. + * @memberof google.protobuf + * @classdesc Represents a FeatureSetDefaults. + * @implements IFeatureSetDefaults + * @constructor + * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set + */ + function FeatureSetDefaults(properties) { + this.defaults = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSetDefaults defaults. + * @member {Array.} defaults + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.defaults = $util.emptyArray; + + /** + * FeatureSetDefaults minimumEdition. + * @member {google.protobuf.Edition} minimumEdition + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.minimumEdition = 0; + + /** + * FeatureSetDefaults maximumEdition. + * @member {google.protobuf.Edition} maximumEdition + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.maximumEdition = 0; + + /** + * Creates a new FeatureSetDefaults instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults instance + */ + FeatureSetDefaults.create = function create(properties) { + return new FeatureSetDefaults(properties); + }; + + /** + * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetDefaults.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.defaults != null && message.defaults.length) + for (var i = 0; i < message.defaults.length; ++i) + $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.encode(message.defaults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.minimumEdition != null && Object.hasOwnProperty.call(message, "minimumEdition")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.minimumEdition); + if (message.maximumEdition != null && Object.hasOwnProperty.call(message, "maximumEdition")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maximumEdition); + return writer; + }; + + /** + * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetDefaults.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetDefaults.decode = function 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.FeatureSetDefaults(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.defaults && message.defaults.length)) + message.defaults = []; + message.defaults.push($root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.decode(reader, reader.uint32())); + break; + } + case 4: { + message.minimumEdition = reader.int32(); + break; + } + case 5: { + message.maximumEdition = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetDefaults.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSetDefaults message. + * @function verify + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSetDefaults.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.defaults != null && message.hasOwnProperty("defaults")) { + if (!Array.isArray(message.defaults)) + return "defaults: array expected"; + for (var i = 0; i < message.defaults.length; ++i) { + var error = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify(message.defaults[i]); + if (error) + return "defaults." + error; + } + } + if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) + switch (message.minimumEdition) { + default: + return "minimumEdition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) + switch (message.maximumEdition) { + default: + return "maximumEdition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + return null; + }; + + /** + * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + */ + FeatureSetDefaults.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSetDefaults) + return object; + var message = new $root.google.protobuf.FeatureSetDefaults(); + if (object.defaults) { + if (!Array.isArray(object.defaults)) + throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: array expected"); + message.defaults = []; + for (var i = 0; i < object.defaults.length; ++i) { + if (typeof object.defaults[i] !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: object expected"); + message.defaults[i] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.fromObject(object.defaults[i]); + } + } + switch (object.minimumEdition) { + default: + if (typeof object.minimumEdition === "number") { + message.minimumEdition = object.minimumEdition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.minimumEdition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.minimumEdition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.minimumEdition = 999; + break; + case "EDITION_2023": + case 1000: + message.minimumEdition = 1000; + break; + case "EDITION_2024": + case 1001: + message.minimumEdition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.minimumEdition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.minimumEdition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.minimumEdition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.minimumEdition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.minimumEdition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.minimumEdition = 2147483647; + break; + } + switch (object.maximumEdition) { + default: + if (typeof object.maximumEdition === "number") { + message.maximumEdition = object.maximumEdition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.maximumEdition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.maximumEdition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.maximumEdition = 999; + break; + case "EDITION_2023": + case 1000: + message.maximumEdition = 1000; + break; + case "EDITION_2024": + case 1001: + message.maximumEdition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.maximumEdition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.maximumEdition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.maximumEdition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.maximumEdition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.maximumEdition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.maximumEdition = 2147483647; + break; + } + return message; + }; + + /** + * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.FeatureSetDefaults} message FeatureSetDefaults + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSetDefaults.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.defaults = []; + if (options.defaults) { + object.minimumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.maximumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.defaults && message.defaults.length) { + object.defaults = []; + for (var j = 0; j < message.defaults.length; ++j) + object.defaults[j] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.toObject(message.defaults[j], options); + } + if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) + object.minimumEdition = options.enums === String ? $root.google.protobuf.Edition[message.minimumEdition] === undefined ? message.minimumEdition : $root.google.protobuf.Edition[message.minimumEdition] : message.minimumEdition; + if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) + object.maximumEdition = options.enums === String ? $root.google.protobuf.Edition[message.maximumEdition] === undefined ? message.maximumEdition : $root.google.protobuf.Edition[message.maximumEdition] : message.maximumEdition; + return object; + }; + + /** + * Converts this FeatureSetDefaults to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSetDefaults + * @instance + * @returns {Object.} JSON object + */ + FeatureSetDefaults.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSetDefaults + * @function getTypeUrl + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSetDefaults.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults"; + }; + + FeatureSetDefaults.FeatureSetEditionDefault = (function() { + + /** + * Properties of a FeatureSetEditionDefault. + * @memberof google.protobuf.FeatureSetDefaults + * @interface IFeatureSetEditionDefault + * @property {google.protobuf.Edition|null} [edition] FeatureSetEditionDefault edition + * @property {google.protobuf.IFeatureSet|null} [features] FeatureSetEditionDefault features + */ + + /** + * Constructs a new FeatureSetEditionDefault. + * @memberof google.protobuf.FeatureSetDefaults + * @classdesc Represents a FeatureSetEditionDefault. + * @implements IFeatureSetEditionDefault + * @constructor + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set + */ + function FeatureSetEditionDefault(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]]; + } + + /** + * FeatureSetEditionDefault edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + */ + FeatureSetEditionDefault.prototype.edition = 0; + + /** + * FeatureSetEditionDefault features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + */ + FeatureSetEditionDefault.prototype.features = null; + + /** + * Creates a new FeatureSetEditionDefault instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault instance + */ + FeatureSetEditionDefault.create = function create(properties) { + return new FeatureSetEditionDefault(properties); + }; + + /** + * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetEditionDefault.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); + return writer; + }; + + /** + * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetEditionDefault.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetEditionDefault.decode = function 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.FeatureSetDefaults.FeatureSetEditionDefault(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + message.edition = reader.int32(); + break; + } + case 2: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetEditionDefault.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSetEditionDefault message. + * @function verify + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSetEditionDefault.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + return null; + }; + + /** + * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + */ + FeatureSetEditionDefault.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault) + return object; + var message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + return message; + }; + + /** + * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} message FeatureSetEditionDefault + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSetEditionDefault.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.features = null; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this FeatureSetEditionDefault to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + * @returns {Object.} JSON object + */ + FeatureSetEditionDefault.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSetEditionDefault + * @function getTypeUrl + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSetEditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault"; + }; + + return FeatureSetEditionDefault; + })(); + + return FeatureSetDefaults; + })(); + + 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.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.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.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; + })(); + + 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.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; + })(); + + 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/owl-bot-staging/google-cloud-apihub/v1/protos/protos.json b/owl-bot-staging/google-cloud-apihub/v1/protos/protos.json new file mode 100644 index 00000000000..eb17125dfb0 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/protos/protos.json @@ -0,0 +1,6321 @@ +{ + "nested": { + "google": { + "nested": { + "cloud": { + "nested": { + "apihub": { + "nested": { + "v1": { + "options": { + "csharp_namespace": "Google.Cloud.ApiHub.V1", + "go_package": "cloud.google.com/go/apihub/apiv1/apihubpb;apihubpb", + "java_multiple_files": true, + "java_outer_classname": "RuntimeProjectAttachmentServiceProto", + "java_package": "com.google.cloud.apihub.v1", + "php_namespace": "Google\\Cloud\\ApiHub\\V1", + "ruby_package": "Google::Cloud::ApiHub::V1", + "(google.api.resource_definition).type": "aiplatform.googleapis.com/Extension", + "(google.api.resource_definition).pattern": "projects/{project}/locations/{location}/extensions/{extension}" + }, + "nested": { + "ApiHub": { + "options": { + "(google.api.default_host)": "apihub.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "CreateApi": { + "requestType": "CreateApiRequest", + "responseType": "Api", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/apis", + "(google.api.http).body": "api", + "(google.api.method_signature)": "parent,api,api_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/apis", + "body": "api" + } + }, + { + "(google.api.method_signature)": "parent,api,api_id" + } + ] + }, + "GetApi": { + "requestType": "GetApiRequest", + "responseType": "Api", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/apis/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/apis/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListApis": { + "requestType": "ListApisRequest", + "responseType": "ListApisResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/apis", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/apis" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "UpdateApi": { + "requestType": "UpdateApiRequest", + "responseType": "Api", + "options": { + "(google.api.http).patch": "/v1/{api.name=projects/*/locations/*/apis/*}", + "(google.api.http).body": "api", + "(google.api.method_signature)": "api,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{api.name=projects/*/locations/*/apis/*}", + "body": "api" + } + }, + { + "(google.api.method_signature)": "api,update_mask" + } + ] + }, + "DeleteApi": { + "requestType": "DeleteApiRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/apis/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/apis/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateVersion": { + "requestType": "CreateVersionRequest", + "responseType": "Version", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*/apis/*}/versions", + "(google.api.http).body": "version", + "(google.api.method_signature)": "parent,version,version_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*/apis/*}/versions", + "body": "version" + } + }, + { + "(google.api.method_signature)": "parent,version,version_id" + } + ] + }, + "GetVersion": { + "requestType": "GetVersionRequest", + "responseType": "Version", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/apis/*/versions/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/apis/*/versions/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListVersions": { + "requestType": "ListVersionsRequest", + "responseType": "ListVersionsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/apis/*}/versions", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/apis/*}/versions" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "UpdateVersion": { + "requestType": "UpdateVersionRequest", + "responseType": "Version", + "options": { + "(google.api.http).patch": "/v1/{version.name=projects/*/locations/*/apis/*/versions/*}", + "(google.api.http).body": "version", + "(google.api.method_signature)": "version,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{version.name=projects/*/locations/*/apis/*/versions/*}", + "body": "version" + } + }, + { + "(google.api.method_signature)": "version,update_mask" + } + ] + }, + "DeleteVersion": { + "requestType": "DeleteVersionRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/apis/*/versions/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/apis/*/versions/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateSpec": { + "requestType": "CreateSpecRequest", + "responseType": "Spec", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*/apis/*/versions/*}/specs", + "(google.api.http).body": "spec", + "(google.api.method_signature)": "parent,spec,spec_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*/apis/*/versions/*}/specs", + "body": "spec" + } + }, + { + "(google.api.method_signature)": "parent,spec,spec_id" + } + ] + }, + "GetSpec": { + "requestType": "GetSpecRequest", + "responseType": "Spec", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "GetSpecContents": { + "requestType": "GetSpecContentsRequest", + "responseType": "SpecContents", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*}:contents", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*}:contents" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListSpecs": { + "requestType": "ListSpecsRequest", + "responseType": "ListSpecsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/apis/*/versions/*}/specs", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/apis/*/versions/*}/specs" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "UpdateSpec": { + "requestType": "UpdateSpecRequest", + "responseType": "Spec", + "options": { + "(google.api.http).patch": "/v1/{spec.name=projects/*/locations/*/apis/*/versions/*/specs/*}", + "(google.api.http).body": "spec", + "(google.api.method_signature)": "spec,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{spec.name=projects/*/locations/*/apis/*/versions/*/specs/*}", + "body": "spec" + } + }, + { + "(google.api.method_signature)": "spec,update_mask" + } + ] + }, + "DeleteSpec": { + "requestType": "DeleteSpecRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "GetApiOperation": { + "requestType": "GetApiOperationRequest", + "responseType": "ApiOperation", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/apis/*/versions/*/operations/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/apis/*/versions/*/operations/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListApiOperations": { + "requestType": "ListApiOperationsRequest", + "responseType": "ListApiOperationsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/apis/*/versions/*}/operations", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/apis/*/versions/*}/operations" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetDefinition": { + "requestType": "GetDefinitionRequest", + "responseType": "Definition", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/apis/*/versions/*/definitions/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/apis/*/versions/*/definitions/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateDeployment": { + "requestType": "CreateDeploymentRequest", + "responseType": "Deployment", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/deployments", + "(google.api.http).body": "deployment", + "(google.api.method_signature)": "parent,deployment,deployment_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/deployments", + "body": "deployment" + } + }, + { + "(google.api.method_signature)": "parent,deployment,deployment_id" + } + ] + }, + "GetDeployment": { + "requestType": "GetDeploymentRequest", + "responseType": "Deployment", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/deployments/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/deployments/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListDeployments": { + "requestType": "ListDeploymentsRequest", + "responseType": "ListDeploymentsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/deployments", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/deployments" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "UpdateDeployment": { + "requestType": "UpdateDeploymentRequest", + "responseType": "Deployment", + "options": { + "(google.api.http).patch": "/v1/{deployment.name=projects/*/locations/*/deployments/*}", + "(google.api.http).body": "deployment", + "(google.api.method_signature)": "deployment,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{deployment.name=projects/*/locations/*/deployments/*}", + "body": "deployment" + } + }, + { + "(google.api.method_signature)": "deployment,update_mask" + } + ] + }, + "DeleteDeployment": { + "requestType": "DeleteDeploymentRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/deployments/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/deployments/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateAttribute": { + "requestType": "CreateAttributeRequest", + "responseType": "Attribute", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/attributes", + "(google.api.http).body": "attribute", + "(google.api.method_signature)": "parent,attribute,attribute_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/attributes", + "body": "attribute" + } + }, + { + "(google.api.method_signature)": "parent,attribute,attribute_id" + } + ] + }, + "GetAttribute": { + "requestType": "GetAttributeRequest", + "responseType": "Attribute", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/attributes/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/attributes/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateAttribute": { + "requestType": "UpdateAttributeRequest", + "responseType": "Attribute", + "options": { + "(google.api.http).patch": "/v1/{attribute.name=projects/*/locations/*/attributes/*}", + "(google.api.http).body": "attribute", + "(google.api.method_signature)": "attribute,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{attribute.name=projects/*/locations/*/attributes/*}", + "body": "attribute" + } + }, + { + "(google.api.method_signature)": "attribute,update_mask" + } + ] + }, + "DeleteAttribute": { + "requestType": "DeleteAttributeRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/attributes/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/attributes/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListAttributes": { + "requestType": "ListAttributesRequest", + "responseType": "ListAttributesResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/attributes", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/attributes" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "SearchResources": { + "requestType": "SearchResourcesRequest", + "responseType": "SearchResourcesResponse", + "options": { + "(google.api.http).post": "/v1/{location=projects/*/locations/*}:searchResources", + "(google.api.http).body": "*", + "(google.api.method_signature)": "location,query" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{location=projects/*/locations/*}:searchResources", + "body": "*" + } + }, + { + "(google.api.method_signature)": "location,query" + } + ] + }, + "CreateExternalApi": { + "requestType": "CreateExternalApiRequest", + "responseType": "ExternalApi", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/externalApis", + "(google.api.http).body": "external_api", + "(google.api.method_signature)": "parent,external_api,external_api_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/externalApis", + "body": "external_api" + } + }, + { + "(google.api.method_signature)": "parent,external_api,external_api_id" + } + ] + }, + "GetExternalApi": { + "requestType": "GetExternalApiRequest", + "responseType": "ExternalApi", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/externalApis/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/externalApis/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateExternalApi": { + "requestType": "UpdateExternalApiRequest", + "responseType": "ExternalApi", + "options": { + "(google.api.http).patch": "/v1/{external_api.name=projects/*/locations/*/externalApis/*}", + "(google.api.http).body": "external_api", + "(google.api.method_signature)": "external_api,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{external_api.name=projects/*/locations/*/externalApis/*}", + "body": "external_api" + } + }, + { + "(google.api.method_signature)": "external_api,update_mask" + } + ] + }, + "DeleteExternalApi": { + "requestType": "DeleteExternalApiRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/externalApis/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/externalApis/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListExternalApis": { + "requestType": "ListExternalApisRequest", + "responseType": "ListExternalApisResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/externalApis", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/externalApis" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + } + } + }, + "ApiHubDependencies": { + "options": { + "(google.api.default_host)": "apihub.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "CreateDependency": { + "requestType": "CreateDependencyRequest", + "responseType": "Dependency", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/dependencies", + "(google.api.http).body": "dependency", + "(google.api.method_signature)": "parent,dependency,dependency_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/dependencies", + "body": "dependency" + } + }, + { + "(google.api.method_signature)": "parent,dependency,dependency_id" + } + ] + }, + "GetDependency": { + "requestType": "GetDependencyRequest", + "responseType": "Dependency", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/dependencies/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/dependencies/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateDependency": { + "requestType": "UpdateDependencyRequest", + "responseType": "Dependency", + "options": { + "(google.api.http).patch": "/v1/{dependency.name=projects/*/locations/*/dependencies/*}", + "(google.api.http).body": "dependency", + "(google.api.method_signature)": "dependency,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{dependency.name=projects/*/locations/*/dependencies/*}", + "body": "dependency" + } + }, + { + "(google.api.method_signature)": "dependency,update_mask" + } + ] + }, + "DeleteDependency": { + "requestType": "DeleteDependencyRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/dependencies/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/dependencies/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListDependencies": { + "requestType": "ListDependenciesRequest", + "responseType": "ListDependenciesResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/dependencies", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/dependencies" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + } + } + }, + "CreateApiRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "apihub.googleapis.com/Api" + } + }, + "apiId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "api": { + "type": "Api", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetApiRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apihub.googleapis.com/Api" + } + } + } + }, + "UpdateApiRequest": { + "fields": { + "api": { + "type": "Api", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteApiRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apihub.googleapis.com/Api" + } + }, + "force": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListApisRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "apihub.googleapis.com/Api" + } + }, + "filter": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageSize": { + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListApisResponse": { + "fields": { + "apis": { + "rule": "repeated", + "type": "Api", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CreateVersionRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apihub.googleapis.com/Api" + } + }, + "versionId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "version": { + "type": "Version", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetVersionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apihub.googleapis.com/Version" + } + } + } + }, + "UpdateVersionRequest": { + "fields": { + "version": { + "type": "Version", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteVersionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apihub.googleapis.com/Version" + } + }, + "force": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListVersionsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "apihub.googleapis.com/Version" + } + }, + "filter": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageSize": { + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListVersionsResponse": { + "fields": { + "versions": { + "rule": "repeated", + "type": "Version", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CreateSpecRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apihub.googleapis.com/Version" + } + }, + "specId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "spec": { + "type": "Spec", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetSpecRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apihub.googleapis.com/Spec" + } + } + } + }, + "UpdateSpecRequest": { + "fields": { + "spec": { + "type": "Spec", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteSpecRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apihub.googleapis.com/Spec" + } + } + } + }, + "ListSpecsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "apihub.googleapis.com/Spec" + } + }, + "filter": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageSize": { + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListSpecsResponse": { + "fields": { + "specs": { + "rule": "repeated", + "type": "Spec", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetSpecContentsRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apihub.googleapis.com/Spec" + } + } + } + }, + "GetApiOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apihub.googleapis.com/ApiOperation" + } + } + } + }, + "ListApiOperationsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "apihub.googleapis.com/ApiOperation" + } + }, + "filter": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageSize": { + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListApiOperationsResponse": { + "fields": { + "apiOperations": { + "rule": "repeated", + "type": "ApiOperation", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetDefinitionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apihub.googleapis.com/Definition" + } + } + } + }, + "CreateDeploymentRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "apihub.googleapis.com/Deployment" + } + }, + "deploymentId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "deployment": { + "type": "Deployment", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetDeploymentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apihub.googleapis.com/Deployment" + } + } + } + }, + "UpdateDeploymentRequest": { + "fields": { + "deployment": { + "type": "Deployment", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteDeploymentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apihub.googleapis.com/Deployment" + } + } + } + }, + "ListDeploymentsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "apihub.googleapis.com/Deployment" + } + }, + "filter": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageSize": { + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListDeploymentsResponse": { + "fields": { + "deployments": { + "rule": "repeated", + "type": "Deployment", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CreateAttributeRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "apihub.googleapis.com/Attribute" + } + }, + "attributeId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "attribute": { + "type": "Attribute", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetAttributeRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apihub.googleapis.com/Attribute" + } + } + } + }, + "UpdateAttributeRequest": { + "fields": { + "attribute": { + "type": "Attribute", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteAttributeRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apihub.googleapis.com/Attribute" + } + } + } + }, + "ListAttributesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "apihub.googleapis.com/Attribute" + } + }, + "filter": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageSize": { + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListAttributesResponse": { + "fields": { + "attributes": { + "rule": "repeated", + "type": "Attribute", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "SearchResourcesRequest": { + "fields": { + "location": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "query": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "filter": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageSize": { + "type": "int32", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ApiHubResource": { + "oneofs": { + "resource": { + "oneof": [ + "api", + "operation", + "deployment", + "spec", + "definition", + "version" + ] + } + }, + "fields": { + "api": { + "type": "Api", + "id": 1 + }, + "operation": { + "type": "ApiOperation", + "id": 2 + }, + "deployment": { + "type": "Deployment", + "id": 3 + }, + "spec": { + "type": "Spec", + "id": 4 + }, + "definition": { + "type": "Definition", + "id": 5 + }, + "version": { + "type": "Version", + "id": 6 + } + } + }, + "SearchResult": { + "fields": { + "resource": { + "type": "ApiHubResource", + "id": 1 + } + } + }, + "SearchResourcesResponse": { + "fields": { + "searchResults": { + "rule": "repeated", + "type": "SearchResult", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CreateDependencyRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "apihub.googleapis.com/Dependency" + } + }, + "dependencyId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "dependency": { + "type": "Dependency", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetDependencyRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apihub.googleapis.com/Dependency" + } + } + } + }, + "UpdateDependencyRequest": { + "fields": { + "dependency": { + "type": "Dependency", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteDependencyRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apihub.googleapis.com/Dependency" + } + } + } + }, + "ListDependenciesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "apihub.googleapis.com/Dependency" + } + }, + "filter": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageSize": { + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListDependenciesResponse": { + "fields": { + "dependencies": { + "rule": "repeated", + "type": "Dependency", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CreateExternalApiRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "apihub.googleapis.com/ExternalApi" + } + }, + "externalApiId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "externalApi": { + "type": "ExternalApi", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetExternalApiRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apihub.googleapis.com/ExternalApi" + } + } + } + }, + "UpdateExternalApiRequest": { + "fields": { + "externalApi": { + "type": "ExternalApi", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteExternalApiRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apihub.googleapis.com/ExternalApi" + } + } + } + }, + "ListExternalApisRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "apihub.googleapis.com/ExternalApi" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListExternalApisResponse": { + "fields": { + "externalApis": { + "rule": "repeated", + "type": "ExternalApi", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "LintState": { + "values": { + "LINT_STATE_UNSPECIFIED": 0, + "LINT_STATE_SUCCESS": 1, + "LINT_STATE_ERROR": 2 + } + }, + "Linter": { + "values": { + "LINTER_UNSPECIFIED": 0, + "SPECTRAL": 1, + "OTHER": 2 + } + }, + "Severity": { + "values": { + "SEVERITY_UNSPECIFIED": 0, + "SEVERITY_ERROR": 1, + "SEVERITY_WARNING": 2, + "SEVERITY_INFO": 3, + "SEVERITY_HINT": 4 + } + }, + "Api": { + "options": { + "(google.api.resource).type": "apihub.googleapis.com/Api", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/apis/{api}", + "(google.api.resource).plural": "apis", + "(google.api.resource).singular": "api" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "documentation": { + "type": "Documentation", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "owner": { + "type": "Owner", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "versions": { + "rule": "repeated", + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "apihub.googleapis.com/Version" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "targetUser": { + "type": "AttributeValues", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "team": { + "type": "AttributeValues", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "businessUnit": { + "type": "AttributeValues", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "maturityLevel": { + "type": "AttributeValues", + "id": 12, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "attributes": { + "keyType": "string", + "type": "AttributeValues", + "id": 13, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "apiStyle": { + "type": "AttributeValues", + "id": 14, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "selectedVersion": { + "type": "string", + "id": 15, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "apihub.googleapis.com/Version" + } + } + } + }, + "Version": { + "options": { + "(google.api.resource).type": "apihub.googleapis.com/Version", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/apis/{api}/versions/{version}", + "(google.api.resource).plural": "versions", + "(google.api.resource).singular": "version" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "documentation": { + "type": "Documentation", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "specs": { + "rule": "repeated", + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "apihub.googleapis.com/Spec" + } + }, + "apiOperations": { + "rule": "repeated", + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "apihub.googleapis.com/ApiOperation" + } + }, + "definitions": { + "rule": "repeated", + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "apihub.googleapis.com/Definition" + } + }, + "deployments": { + "rule": "repeated", + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "apihub.googleapis.com/Deployment" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "lifecycle": { + "type": "AttributeValues", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "compliance": { + "type": "AttributeValues", + "id": 12, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "accreditation": { + "type": "AttributeValues", + "id": 13, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "attributes": { + "keyType": "string", + "type": "AttributeValues", + "id": 14, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "selectedDeployment": { + "type": "string", + "id": 16, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "apihub.googleapis.com/Deployment" + } + } + } + }, + "Spec": { + "options": { + "(google.api.resource).type": "apihub.googleapis.com/Spec", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}", + "(google.api.resource).plural": "specs", + "(google.api.resource).singular": "spec" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "specType": { + "type": "AttributeValues", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "contents": { + "type": "SpecContents", + "id": 4, + "options": { + "(google.api.field_behavior)": "INPUT_ONLY" + } + }, + "details": { + "type": "SpecDetails", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "sourceUri": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "lintResponse": { + "type": "LintResponse", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "attributes": { + "keyType": "string", + "type": "AttributeValues", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "documentation": { + "type": "Documentation", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "parsingMode": { + "type": "ParsingMode", + "id": 12, + "options": { + "(google.api.field_behavior)": "INPUT_ONLY" + } + } + }, + "nested": { + "ParsingMode": { + "values": { + "PARSING_MODE_UNSPECIFIED": 0, + "RELAXED": 1, + "STRICT": 2 + } + } + } + }, + "Deployment": { + "options": { + "(google.api.resource).type": "apihub.googleapis.com/Deployment", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/deployments/{deployment}", + "(google.api.resource).plural": "deployments", + "(google.api.resource).singular": "deployment" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "documentation": { + "type": "Documentation", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "deploymentType": { + "type": "AttributeValues", + "id": 5, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "resourceUri": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "endpoints": { + "rule": "repeated", + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "apiVersions": { + "rule": "repeated", + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "slo": { + "type": "AttributeValues", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "environment": { + "type": "AttributeValues", + "id": 12, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "attributes": { + "keyType": "string", + "type": "AttributeValues", + "id": 13, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ApiOperation": { + "options": { + "(google.api.resource).type": "apihub.googleapis.com/ApiOperation", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}", + "(google.api.resource).plural": "apiOperations", + "(google.api.resource).singular": "apiOperation" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "spec": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "apihub.googleapis.com/Spec" + } + }, + "details": { + "type": "OperationDetails", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "attributes": { + "keyType": "string", + "type": "AttributeValues", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "Definition": { + "options": { + "(google.api.resource).type": "apihub.googleapis.com/Definition", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}", + "(google.api.resource).plural": "definitions", + "(google.api.resource).singular": "definition" + }, + "oneofs": { + "value": { + "oneof": [ + "schema" + ] + } + }, + "fields": { + "schema": { + "type": "Schema", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "spec": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "apihub.googleapis.com/Spec" + } + }, + "type": { + "type": "Type", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "attributes": { + "keyType": "string", + "type": "AttributeValues", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "SCHEMA": 1 + } + } + } + }, + "Attribute": { + "options": { + "(google.api.resource).type": "apihub.googleapis.com/Attribute", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/attributes/{attribute}", + "(google.api.resource).plural": "attributes", + "(google.api.resource).singular": "attribute" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "definitionType": { + "type": "DefinitionType", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "scope": { + "type": "Scope", + "id": 5, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "dataType": { + "type": "DataType", + "id": 6, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "allowedValues": { + "rule": "repeated", + "type": "AllowedValue", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "cardinality": { + "type": "int32", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "mandatory": { + "type": "bool", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "AllowedValue": { + "fields": { + "id": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "immutable": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DefinitionType": { + "values": { + "DEFINITION_TYPE_UNSPECIFIED": 0, + "SYSTEM_DEFINED": 1, + "USER_DEFINED": 2 + } + }, + "Scope": { + "values": { + "SCOPE_UNSPECIFIED": 0, + "API": 1, + "VERSION": 2, + "SPEC": 3, + "API_OPERATION": 4, + "DEPLOYMENT": 5, + "DEPENDENCY": 6, + "DEFINITION": 7, + "EXTERNAL_API": 8, + "PLUGIN": 9 + } + }, + "DataType": { + "values": { + "DATA_TYPE_UNSPECIFIED": 0, + "ENUM": 1, + "JSON": 2, + "STRING": 3 + } + } + } + }, + "SpecContents": { + "fields": { + "contents": { + "type": "bytes", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "mimeType": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "SpecDetails": { + "oneofs": { + "details": { + "oneof": [ + "openApiSpecDetails" + ] + } + }, + "fields": { + "openApiSpecDetails": { + "type": "OpenApiSpecDetails", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "description": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "OpenApiSpecDetails": { + "fields": { + "format": { + "type": "Format", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "version": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "owner": { + "type": "Owner", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "Format": { + "values": { + "FORMAT_UNSPECIFIED": 0, + "OPEN_API_SPEC_2_0": 1, + "OPEN_API_SPEC_3_0": 2, + "OPEN_API_SPEC_3_1": 3 + } + } + } + }, + "OperationDetails": { + "oneofs": { + "operation": { + "oneof": [ + "httpOperation" + ] + } + }, + "fields": { + "httpOperation": { + "type": "HttpOperation", + "id": 4 + }, + "description": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "documentation": { + "type": "Documentation", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "HttpOperation": { + "fields": { + "path": { + "type": "Path", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "method": { + "type": "Method", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "Method": { + "values": { + "METHOD_UNSPECIFIED": 0, + "GET": 1, + "PUT": 2, + "POST": 3, + "DELETE": 4, + "OPTIONS": 5, + "HEAD": 6, + "PATCH": 7, + "TRACE": 8 + } + } + } + }, + "Path": { + "fields": { + "path": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "description": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "Schema": { + "fields": { + "displayName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "rawValue": { + "type": "bytes", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "Owner": { + "fields": { + "displayName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "email": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "Documentation": { + "fields": { + "externalUri": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "AttributeValues": { + "oneofs": { + "Value": { + "oneof": [ + "enumValues", + "stringValues", + "jsonValues" + ] + } + }, + "fields": { + "enumValues": { + "type": "EnumAttributeValues", + "id": 2 + }, + "stringValues": { + "type": "StringAttributeValues", + "id": 3 + }, + "jsonValues": { + "type": "StringAttributeValues", + "id": 4 + }, + "attribute": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "apihub.googleapis.com/Attribute" + } + } + }, + "nested": { + "EnumAttributeValues": { + "fields": { + "values": { + "rule": "repeated", + "type": "Attribute.AllowedValue", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "StringAttributeValues": { + "fields": { + "values": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + } + } + }, + "Dependency": { + "options": { + "(google.api.resource).type": "apihub.googleapis.com/Dependency", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/dependencies/{dependency}", + "(google.api.resource).plural": "dependencies", + "(google.api.resource).singular": "dependency" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "consumer": { + "type": "DependencyEntityReference", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "supplier": { + "type": "DependencyEntityReference", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "state": { + "type": "State", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "description": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "discoveryMode": { + "type": "DiscoveryMode", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "errorDetail": { + "type": "DependencyErrorDetail", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "attributes": { + "keyType": "string", + "type": "AttributeValues", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "PROPOSED": 1, + "VALIDATED": 2 + } + }, + "DiscoveryMode": { + "values": { + "DISCOVERY_MODE_UNSPECIFIED": 0, + "MANUAL": 1 + } + } + } + }, + "DependencyEntityReference": { + "oneofs": { + "identifier": { + "oneof": [ + "operationResourceName", + "externalApiResourceName" + ] + } + }, + "fields": { + "operationResourceName": { + "type": "string", + "id": 2 + }, + "externalApiResourceName": { + "type": "string", + "id": 3 + }, + "displayName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "DependencyErrorDetail": { + "fields": { + "error": { + "type": "Error", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "errorTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "Error": { + "values": { + "ERROR_UNSPECIFIED": 0, + "SUPPLIER_NOT_FOUND": 1, + "SUPPLIER_RECREATED": 2 + } + } + } + }, + "LintResponse": { + "fields": { + "issues": { + "rule": "repeated", + "type": "Issue", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "summary": { + "rule": "repeated", + "type": "SummaryEntry", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "state": { + "type": "LintState", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "source": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "linter": { + "type": "Linter", + "id": 5, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "SummaryEntry": { + "fields": { + "severity": { + "type": "Severity", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "count": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + } + } + }, + "Issue": { + "fields": { + "code": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "path": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "message": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "severity": { + "type": "Severity", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "range": { + "type": "Range", + "id": 5, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "Range": { + "fields": { + "start": { + "type": "Point", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "end": { + "type": "Point", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "Point": { + "fields": { + "line": { + "type": "int32", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "character": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "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" + } + } + } + }, + "ApiHubInstance": { + "options": { + "(google.api.resource).type": "apihub.googleapis.com/ApiHubInstance", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/apiHubInstances/{api_hub_instance}", + "(google.api.resource).plural": "apiHubInstances", + "(google.api.resource).singular": "apiHubInstance" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "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" + } + }, + "state": { + "type": "State", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "stateMessage": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "config": { + "type": "Config", + "id": 6, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "description": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "Config": { + "fields": { + "cmekKeyName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "INACTIVE": 1, + "CREATING": 2, + "ACTIVE": 3, + "UPDATING": 4, + "DELETING": 5, + "FAILED": 6 + } + } + } + }, + "ExternalApi": { + "options": { + "(google.api.resource).type": "apihub.googleapis.com/ExternalApi", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/externalApis/{external_api}", + "(google.api.resource).plural": "externalApis", + "(google.api.resource).singular": "externalApi" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "endpoints": { + "rule": "repeated", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "paths": { + "rule": "repeated", + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "documentation": { + "type": "Documentation", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "attributes": { + "keyType": "string", + "type": "AttributeValues", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "HostProjectRegistrationService": { + "options": { + "(google.api.default_host)": "apihub.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "CreateHostProjectRegistration": { + "requestType": "CreateHostProjectRegistrationRequest", + "responseType": "HostProjectRegistration", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/hostProjectRegistrations", + "(google.api.http).body": "host_project_registration", + "(google.api.method_signature)": "parent,host_project_registration,host_project_registration_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/hostProjectRegistrations", + "body": "host_project_registration" + } + }, + { + "(google.api.method_signature)": "parent,host_project_registration,host_project_registration_id" + } + ] + }, + "GetHostProjectRegistration": { + "requestType": "GetHostProjectRegistrationRequest", + "responseType": "HostProjectRegistration", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/hostProjectRegistrations/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/hostProjectRegistrations/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListHostProjectRegistrations": { + "requestType": "ListHostProjectRegistrationsRequest", + "responseType": "ListHostProjectRegistrationsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/hostProjectRegistrations", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/hostProjectRegistrations" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + } + } + }, + "CreateHostProjectRegistrationRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "apihub.googleapis.com/HostProjectRegistration" + } + }, + "hostProjectRegistrationId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "hostProjectRegistration": { + "type": "HostProjectRegistration", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetHostProjectRegistrationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apihub.googleapis.com/HostProjectRegistration" + } + } + } + }, + "ListHostProjectRegistrationsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "apihub.googleapis.com/HostProjectRegistration" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "orderBy": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListHostProjectRegistrationsResponse": { + "fields": { + "hostProjectRegistrations": { + "rule": "repeated", + "type": "HostProjectRegistration", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "HostProjectRegistration": { + "options": { + "(google.api.resource).type": "apihub.googleapis.com/HostProjectRegistration", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/hostProjectRegistrations/{host_project_registration}", + "(google.api.resource).plural": "hostProjectRegistrations", + "(google.api.resource).singular": "hostProjectRegistration" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "gcpProject": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "IMMUTABLE", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "LintingService": { + "options": { + "(google.api.default_host)": "apihub.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "GetStyleGuide": { + "requestType": "GetStyleGuideRequest", + "responseType": "StyleGuide", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/plugins/*/styleGuide}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/plugins/*/styleGuide}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateStyleGuide": { + "requestType": "UpdateStyleGuideRequest", + "responseType": "StyleGuide", + "options": { + "(google.api.http).patch": "/v1/{style_guide.name=projects/*/locations/*/plugins/*/styleGuide}", + "(google.api.http).body": "style_guide", + "(google.api.method_signature)": "style_guide,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{style_guide.name=projects/*/locations/*/plugins/*/styleGuide}", + "body": "style_guide" + } + }, + { + "(google.api.method_signature)": "style_guide,update_mask" + } + ] + }, + "GetStyleGuideContents": { + "requestType": "GetStyleGuideContentsRequest", + "responseType": "StyleGuideContents", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/plugins/*/styleGuide}:contents", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/plugins/*/styleGuide}:contents" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "LintSpec": { + "requestType": "LintSpecRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*}:lint", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*}:lint", + "body": "*" + } + } + ] + } + } + }, + "GetStyleGuideRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apihub.googleapis.com/StyleGuide" + } + } + } + }, + "UpdateStyleGuideRequest": { + "fields": { + "styleGuide": { + "type": "StyleGuide", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "GetStyleGuideContentsRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apihub.googleapis.com/StyleGuide" + } + } + } + }, + "LintSpecRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apihub.googleapis.com/Spec" + } + } + } + }, + "StyleGuideContents": { + "fields": { + "contents": { + "type": "bytes", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "mimeType": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "StyleGuide": { + "options": { + "(google.api.resource).type": "apihub.googleapis.com/StyleGuide", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/plugins/{plugin}/styleGuide", + "(google.api.resource).plural": "styleGuides", + "(google.api.resource).singular": "styleGuide" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "linter": { + "type": "Linter", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "contents": { + "type": "StyleGuideContents", + "id": 3, + "options": { + "(google.api.field_behavior)": "INPUT_ONLY" + } + } + } + }, + "ApiHubPlugin": { + "options": { + "(google.api.default_host)": "apihub.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "GetPlugin": { + "requestType": "GetPluginRequest", + "responseType": "Plugin", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/plugins/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/plugins/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "EnablePlugin": { + "requestType": "EnablePluginRequest", + "responseType": "Plugin", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/plugins/*}:enable", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/plugins/*}:enable", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "DisablePlugin": { + "requestType": "DisablePluginRequest", + "responseType": "Plugin", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/plugins/*}:disable", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/plugins/*}:disable", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + } + } + }, + "Plugin": { + "options": { + "(google.api.resource).type": "apihub.googleapis.com/Plugin", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/plugins/{plugin}", + "(google.api.resource).plural": "plugins", + "(google.api.resource).singular": "plugin" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "type": { + "type": "AttributeValues", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "state": { + "type": "State", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "ENABLED": 1, + "DISABLED": 2 + } + } + } + }, + "GetPluginRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apihub.googleapis.com/Plugin" + } + } + } + }, + "EnablePluginRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apihub.googleapis.com/Plugin" + } + } + } + }, + "DisablePluginRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apihub.googleapis.com/Plugin" + } + } + } + }, + "Provisioning": { + "options": { + "(google.api.default_host)": "apihub.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "CreateApiHubInstance": { + "requestType": "CreateApiHubInstanceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/apiHubInstances", + "(google.api.http).body": "api_hub_instance", + "(google.api.method_signature)": "parent,api_hub_instance,api_hub_instance_id", + "(google.longrunning.operation_info).response_type": "ApiHubInstance", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/apiHubInstances", + "body": "api_hub_instance" + } + }, + { + "(google.api.method_signature)": "parent,api_hub_instance,api_hub_instance_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "ApiHubInstance", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "GetApiHubInstance": { + "requestType": "GetApiHubInstanceRequest", + "responseType": "ApiHubInstance", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/apiHubInstances/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/apiHubInstances/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "LookupApiHubInstance": { + "requestType": "LookupApiHubInstanceRequest", + "responseType": "LookupApiHubInstanceResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/apiHubInstances:lookup", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/apiHubInstances:lookup" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + } + } + }, + "CreateApiHubInstanceRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "apiHubInstanceId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "apiHubInstance": { + "type": "ApiHubInstance", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetApiHubInstanceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apihub.googleapis.com/ApiHubInstance" + } + } + } + }, + "LookupApiHubInstanceRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "apihub.googleapis.com/ApiHubInstance" + } + } + } + }, + "LookupApiHubInstanceResponse": { + "fields": { + "apiHubInstance": { + "type": "ApiHubInstance", + "id": 1 + } + } + }, + "RuntimeProjectAttachmentService": { + "options": { + "(google.api.default_host)": "apihub.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "CreateRuntimeProjectAttachment": { + "requestType": "CreateRuntimeProjectAttachmentRequest", + "responseType": "RuntimeProjectAttachment", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/runtimeProjectAttachments", + "(google.api.http).body": "runtime_project_attachment", + "(google.api.method_signature)": "parent,runtime_project_attachment,runtime_project_attachment_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/runtimeProjectAttachments", + "body": "runtime_project_attachment" + } + }, + { + "(google.api.method_signature)": "parent,runtime_project_attachment,runtime_project_attachment_id" + } + ] + }, + "GetRuntimeProjectAttachment": { + "requestType": "GetRuntimeProjectAttachmentRequest", + "responseType": "RuntimeProjectAttachment", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/runtimeProjectAttachments/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/runtimeProjectAttachments/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListRuntimeProjectAttachments": { + "requestType": "ListRuntimeProjectAttachmentsRequest", + "responseType": "ListRuntimeProjectAttachmentsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/runtimeProjectAttachments", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/runtimeProjectAttachments" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "DeleteRuntimeProjectAttachment": { + "requestType": "DeleteRuntimeProjectAttachmentRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/runtimeProjectAttachments/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/runtimeProjectAttachments/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "LookupRuntimeProjectAttachment": { + "requestType": "LookupRuntimeProjectAttachmentRequest", + "responseType": "LookupRuntimeProjectAttachmentResponse", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*}:lookupRuntimeProjectAttachment", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*}:lookupRuntimeProjectAttachment" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + } + } + }, + "CreateRuntimeProjectAttachmentRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "apihub.googleapis.com/RuntimeProjectAttachment" + } + }, + "runtimeProjectAttachmentId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "runtimeProjectAttachment": { + "type": "RuntimeProjectAttachment", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetRuntimeProjectAttachmentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apihub.googleapis.com/RuntimeProjectAttachment" + } + } + } + }, + "ListRuntimeProjectAttachmentsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "apihub.googleapis.com/RuntimeProjectAttachment" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "orderBy": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListRuntimeProjectAttachmentsResponse": { + "fields": { + "runtimeProjectAttachments": { + "rule": "repeated", + "type": "RuntimeProjectAttachment", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "DeleteRuntimeProjectAttachmentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apihub.googleapis.com/RuntimeProjectAttachment" + } + } + } + }, + "LookupRuntimeProjectAttachmentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + } + } + }, + "LookupRuntimeProjectAttachmentResponse": { + "fields": { + "runtimeProjectAttachment": { + "type": "RuntimeProjectAttachment", + "id": 1 + } + } + }, + "RuntimeProjectAttachment": { + "options": { + "(google.api.resource).type": "apihub.googleapis.com/RuntimeProjectAttachment", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}", + "(google.api.resource).plural": "runtimeProjectAttachments", + "(google.api.resource).singular": "runtimeProjectAttachment" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "runtimeProject": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "IMMUTABLE", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + } + } + } + } + } + } + }, + "api": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", + "java_multiple_files": true, + "java_outer_classname": "ResourceProto", + "java_package": "com.google.api", + "objc_class_prefix": "GAPI", + "cc_enable_arenas": true + }, + "nested": { + "http": { + "type": "HttpRule", + "id": 72295728, + "extend": "google.protobuf.MethodOptions" + }, + "Http": { + "fields": { + "rules": { + "rule": "repeated", + "type": "HttpRule", + "id": 1 + }, + "fullyDecodeReservedExpansion": { + "type": "bool", + "id": 2 + } + } + }, + "HttpRule": { + "oneofs": { + "pattern": { + "oneof": [ + "get", + "put", + "post", + "delete", + "patch", + "custom" + ] + } + }, + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "get": { + "type": "string", + "id": 2 + }, + "put": { + "type": "string", + "id": 3 + }, + "post": { + "type": "string", + "id": 4 + }, + "delete": { + "type": "string", + "id": 5 + }, + "patch": { + "type": "string", + "id": 6 + }, + "custom": { + "type": "CustomHttpPattern", + "id": 8 + }, + "body": { + "type": "string", + "id": 7 + }, + "responseBody": { + "type": "string", + "id": 12 + }, + "additionalBindings": { + "rule": "repeated", + "type": "HttpRule", + "id": 11 + } + } + }, + "CustomHttpPattern": { + "fields": { + "kind": { + "type": "string", + "id": 1 + }, + "path": { + "type": "string", + "id": 2 + } + } + }, + "methodSignature": { + "rule": "repeated", + "type": "string", + "id": 1051, + "extend": "google.protobuf.MethodOptions" + }, + "defaultHost": { + "type": "string", + "id": 1049, + "extend": "google.protobuf.ServiceOptions" + }, + "oauthScopes": { + "type": "string", + "id": 1050, + "extend": "google.protobuf.ServiceOptions" + }, + "apiVersion": { + "type": "string", + "id": 525000001, + "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 + }, + "protoReferenceDocumentationUri": { + "type": "string", + "id": 110 + }, + "restReferenceDocumentationUri": { + "type": "string", + "id": 111 + } + } + }, + "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 + }, + "renamedServices": { + "keyType": "string", + "type": "string", + "id": 2 + }, + "renamedResources": { + "keyType": "string", + "type": "string", + "id": 3 + }, + "ignoredResources": { + "rule": "repeated", + "type": "string", + "id": 4 + }, + "forcedNamespaceAliases": { + "rule": "repeated", + "type": "string", + "id": 5 + }, + "handwrittenSignatures": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + }, + "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 + }, + "autoPopulatedFields": { + "rule": "repeated", + "type": "string", + "id": 3 + } + }, + "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, + "SHOPPING": 5, + "GEO": 6, + "GENERATIVE_AI": 7 + } + }, + "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 + } + }, + "fieldBehavior": { + "rule": "repeated", + "type": "google.api.FieldBehavior", + "id": 1052, + "extend": "google.protobuf.FieldOptions", + "options": { + "packed": false + } + }, + "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, + "IDENTIFIER": 8 + } + }, + "resourceReference": { + "type": "google.api.ResourceReference", + "id": 1055, + "extend": "google.protobuf.FieldOptions" + }, + "resourceDefinition": { + "rule": "repeated", + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.FileOptions" + }, + "resource": { + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.MessageOptions" + }, + "ResourceDescriptor": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "pattern": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "nameField": { + "type": "string", + "id": 3 + }, + "history": { + "type": "History", + "id": 4 + }, + "plural": { + "type": "string", + "id": 5 + }, + "singular": { + "type": "string", + "id": 6 + }, + "style": { + "rule": "repeated", + "type": "Style", + "id": 10 + } + }, + "nested": { + "History": { + "values": { + "HISTORY_UNSPECIFIED": 0, + "ORIGINALLY_SINGLE_PATTERN": 1, + "FUTURE_MULTI_PATTERN": 2 + } + }, + "Style": { + "values": { + "STYLE_UNSPECIFIED": 0, + "DECLARATIVE_FRIENDLY": 1 + } + } + } + }, + "ResourceReference": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "childType": { + "type": "string", + "id": 2 + } + } + } + } + }, + "protobuf": { + "options": { + "go_package": "google.golang.org/protobuf/types/descriptorpb", + "java_package": "com.google.protobuf", + "java_outer_classname": "DescriptorProtos", + "csharp_namespace": "Google.Protobuf.Reflection", + "objc_class_prefix": "GPB", + "cc_enable_arenas": true, + "optimize_for": "SPEED" + }, + "nested": { + "FileDescriptorSet": { + "fields": { + "file": { + "rule": "repeated", + "type": "FileDescriptorProto", + "id": 1 + } + } + }, + "Edition": { + "values": { + "EDITION_UNKNOWN": 0, + "EDITION_PROTO2": 998, + "EDITION_PROTO3": 999, + "EDITION_2023": 1000, + "EDITION_2024": 1001, + "EDITION_1_TEST_ONLY": 1, + "EDITION_2_TEST_ONLY": 2, + "EDITION_99997_TEST_ONLY": 99997, + "EDITION_99998_TEST_ONLY": 99998, + "EDITION_99999_TEST_ONLY": 99999, + "EDITION_MAX": 2147483647 + } + }, + "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": "Edition", + "id": 14 + } + } + }, + "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 + }, + "declaration": { + "rule": "repeated", + "type": "Declaration", + "id": 2, + "options": { + "retention": "RETENTION_SOURCE" + } + }, + "features": { + "type": "FeatureSet", + "id": 50 + }, + "verification": { + "type": "VerificationState", + "id": 3, + "options": { + "default": "UNVERIFIED", + "retention": "RETENTION_SOURCE" + } + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "Declaration": { + "fields": { + "number": { + "type": "int32", + "id": 1 + }, + "fullName": { + "type": "string", + "id": 2 + }, + "type": { + "type": "string", + "id": 3 + }, + "reserved": { + "type": "bool", + "id": 5 + }, + "repeated": { + "type": "bool", + "id": 6 + } + }, + "reserved": [ + [ + 4, + 4 + ] + ] + }, + "VerificationState": { + "values": { + "DECLARATION": 0, + "UNVERIFIED": 1 + } + } + } + }, + "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_REPEATED": 3, + "LABEL_REQUIRED": 2 + } + } + } + }, + "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 + } + }, + "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 + }, + "features": { + "type": "FeatureSet", + "id": 50 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 42, + 42 + ], + [ + 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 + } + }, + "features": { + "type": "FeatureSet", + "id": 12 + }, + "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 + }, + "targets": { + "rule": "repeated", + "type": "OptionTargetType", + "id": 19, + "options": { + "packed": false + } + }, + "editionDefaults": { + "rule": "repeated", + "type": "EditionDefault", + "id": 20 + }, + "features": { + "type": "FeatureSet", + "id": 21 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ], + [ + 18, + 18 + ] + ], + "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 + } + }, + "EditionDefault": { + "fields": { + "edition": { + "type": "Edition", + "id": 3 + }, + "value": { + "type": "string", + "id": 2 + } + } + } + } + }, + "OneofOptions": { + "fields": { + "features": { + "type": "FeatureSet", + "id": 1 + }, + "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 + } + }, + "features": { + "type": "FeatureSet", + "id": 7 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 5, + 5 + ] + ] + }, + "EnumValueOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "features": { + "type": "FeatureSet", + "id": 2 + }, + "debugRedact": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "ServiceOptions": { + "fields": { + "features": { + "type": "FeatureSet", + "id": 34 + }, + "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" + } + }, + "features": { + "type": "FeatureSet", + "id": 35 + }, + "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 + } + } + } + } + }, + "FeatureSet": { + "fields": { + "fieldPresence": { + "type": "FieldPresence", + "id": 1, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_2023", + "edition_defaults.value": "EXPLICIT" + } + }, + "enumType": { + "type": "EnumType", + "id": 2, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "OPEN" + } + }, + "repeatedFieldEncoding": { + "type": "RepeatedFieldEncoding", + "id": 3, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "PACKED" + } + }, + "utf8Validation": { + "type": "Utf8Validation", + "id": 4, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "VERIFY" + } + }, + "messageEncoding": { + "type": "MessageEncoding", + "id": 5, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO2", + "edition_defaults.value": "LENGTH_PREFIXED" + } + }, + "jsonFormat": { + "type": "JsonFormat", + "id": 6, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "ALLOW" + } + } + }, + "extensions": [ + [ + 1000, + 1000 + ], + [ + 1001, + 1001 + ], + [ + 1002, + 1002 + ], + [ + 9990, + 9990 + ], + [ + 9995, + 9999 + ], + [ + 10000, + 10000 + ] + ], + "reserved": [ + [ + 999, + 999 + ] + ], + "nested": { + "FieldPresence": { + "values": { + "FIELD_PRESENCE_UNKNOWN": 0, + "EXPLICIT": 1, + "IMPLICIT": 2, + "LEGACY_REQUIRED": 3 + } + }, + "EnumType": { + "values": { + "ENUM_TYPE_UNKNOWN": 0, + "OPEN": 1, + "CLOSED": 2 + } + }, + "RepeatedFieldEncoding": { + "values": { + "REPEATED_FIELD_ENCODING_UNKNOWN": 0, + "PACKED": 1, + "EXPANDED": 2 + } + }, + "Utf8Validation": { + "values": { + "UTF8_VALIDATION_UNKNOWN": 0, + "VERIFY": 2, + "NONE": 3 + } + }, + "MessageEncoding": { + "values": { + "MESSAGE_ENCODING_UNKNOWN": 0, + "LENGTH_PREFIXED": 1, + "DELIMITED": 2 + } + }, + "JsonFormat": { + "values": { + "JSON_FORMAT_UNKNOWN": 0, + "ALLOW": 1, + "LEGACY_BEST_EFFORT": 2 + } + } + } + }, + "FeatureSetDefaults": { + "fields": { + "defaults": { + "rule": "repeated", + "type": "FeatureSetEditionDefault", + "id": 1 + }, + "minimumEdition": { + "type": "Edition", + "id": 4 + }, + "maximumEdition": { + "type": "Edition", + "id": 5 + } + }, + "nested": { + "FeatureSetEditionDefault": { + "fields": { + "edition": { + "type": "Edition", + "id": 3 + }, + "features": { + "type": "FeatureSet", + "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 + } + } + } + } + } + }, + "Duration": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Timestamp": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Empty": { + "fields": {} + }, + "FieldMask": { + "fields": { + "paths": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "Any": { + "fields": { + "type_url": { + "type": "string", + "id": 1 + }, + "value": { + "type": "bytes", + "id": 2 + } + } + } + } + }, + "longrunning": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.LongRunning", + "go_package": "cloud.google.com/go/longrunning/autogen/longrunningpb;longrunningpb", + "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/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.create_api.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.create_api.js new file mode 100644 index 00000000000..8d57347c734 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.create_api.js @@ -0,0 +1,77 @@ +// Copyright 2024 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, api) { + // [START apihub_v1_generated_ApiHub_CreateApi_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 parent resource for the API resource. + * Format: `projects/{project}/locations/{location}` + */ + // const parent = 'abc123' + /** + * Optional. The ID to use for the API resource, which will become the final + * component of the API's resource name. This field is optional. + * * If provided, the same will be used. The service will throw an error if + * the specified id is already used by another API resource in the API hub. + * * If not provided, a system generated id will be used. + * This value should be 4-500 characters, and valid characters + * are /[a-z][A-Z][0-9]-_/. + */ + // const apiId = 'abc123' + /** + * Required. The API resource to create. + */ + // const api = {} + + // Imports the Apihub library + const {ApiHubClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new ApiHubClient(); + + async function callCreateApi() { + // Construct request + const request = { + parent, + api, + }; + + // Run request + const response = await apihubClient.createApi(request); + console.log(response); + } + + callCreateApi(); + // [END apihub_v1_generated_ApiHub_CreateApi_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.create_attribute.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.create_attribute.js new file mode 100644 index 00000000000..63be01f4e72 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.create_attribute.js @@ -0,0 +1,78 @@ +// Copyright 2024 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, attribute) { + // [START apihub_v1_generated_ApiHub_CreateAttribute_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 parent resource for Attribute. + * Format: `projects/{project}/locations/{location}` + */ + // const parent = 'abc123' + /** + * Optional. The ID to use for the attribute, which will become the final + * component of the attribute's resource name. This field is optional. + * * If provided, the same will be used. The service will throw an error if + * the specified id is already used by another attribute resource in the API + * hub. + * * If not provided, a system generated id will be used. + * This value should be 4-500 characters, and valid characters + * are /[a-z][A-Z][0-9]-_/. + */ + // const attributeId = 'abc123' + /** + * Required. The attribute to create. + */ + // const attribute = {} + + // Imports the Apihub library + const {ApiHubClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new ApiHubClient(); + + async function callCreateAttribute() { + // Construct request + const request = { + parent, + attribute, + }; + + // Run request + const response = await apihubClient.createAttribute(request); + console.log(response); + } + + callCreateAttribute(); + // [END apihub_v1_generated_ApiHub_CreateAttribute_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.create_deployment.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.create_deployment.js new file mode 100644 index 00000000000..a9a8f0206fd --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.create_deployment.js @@ -0,0 +1,78 @@ +// Copyright 2024 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, deployment) { + // [START apihub_v1_generated_ApiHub_CreateDeployment_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 parent resource for the deployment resource. + * Format: `projects/{project}/locations/{location}` + */ + // const parent = 'abc123' + /** + * Optional. The ID to use for the deployment resource, which will become the + * final component of the deployment's resource name. This field is optional. + * * If provided, the same will be used. The service will throw an error if + * the specified id is already used by another deployment resource in the API + * hub. + * * If not provided, a system generated id will be used. + * This value should be 4-500 characters, and valid characters + * are /[a-z][A-Z][0-9]-_/. + */ + // const deploymentId = 'abc123' + /** + * Required. The deployment resource to create. + */ + // const deployment = {} + + // Imports the Apihub library + const {ApiHubClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new ApiHubClient(); + + async function callCreateDeployment() { + // Construct request + const request = { + parent, + deployment, + }; + + // Run request + const response = await apihubClient.createDeployment(request); + console.log(response); + } + + callCreateDeployment(); + // [END apihub_v1_generated_ApiHub_CreateDeployment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.create_external_api.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.create_external_api.js new file mode 100644 index 00000000000..5dc983996b8 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.create_external_api.js @@ -0,0 +1,79 @@ +// Copyright 2024 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, externalApi) { + // [START apihub_v1_generated_ApiHub_CreateExternalApi_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 parent resource for the External API resource. + * Format: `projects/{project}/locations/{location}` + */ + // const parent = 'abc123' + /** + * Optional. The ID to use for the External API resource, which will become + * the final component of the External API's resource name. This field is + * optional. + * * If provided, the same will be used. The service will throw an error if + * the specified id is already used by another External API resource in the + * API hub. + * * If not provided, a system generated id will be used. + * This value should be 4-500 characters, and valid characters + * are /[a-z][A-Z][0-9]-_/. + */ + // const externalApiId = 'abc123' + /** + * Required. The External API resource to create. + */ + // const externalApi = {} + + // Imports the Apihub library + const {ApiHubClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new ApiHubClient(); + + async function callCreateExternalApi() { + // Construct request + const request = { + parent, + externalApi, + }; + + // Run request + const response = await apihubClient.createExternalApi(request); + console.log(response); + } + + callCreateExternalApi(); + // [END apihub_v1_generated_ApiHub_CreateExternalApi_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.create_spec.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.create_spec.js new file mode 100644 index 00000000000..e4df15ade6e --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.create_spec.js @@ -0,0 +1,79 @@ +// Copyright 2024 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, spec) { + // [START apihub_v1_generated_ApiHub_CreateSpec_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 parent resource for Spec. + * Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}` + */ + // const parent = 'abc123' + /** + * Optional. The ID to use for the spec, which will become the final component + * of the spec's resource name. This field is optional. + * * If provided, the same will be used. The service will throw an error if + * the specified id is already used by another spec in the API + * resource. + * * If not provided, a system generated id will be used. + * This value should be 4-500 characters, and valid characters + * are /[a-z][A-Z][0-9]-_/. + */ + // const specId = 'abc123' + /** + * Required. The spec to create. + */ + // const spec = {} + + // Imports the Apihub library + const {ApiHubClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new ApiHubClient(); + + async function callCreateSpec() { + // Construct request + const request = { + parent, + spec, + }; + + // Run request + const response = await apihubClient.createSpec(request); + console.log(response); + } + + callCreateSpec(); + // [END apihub_v1_generated_ApiHub_CreateSpec_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.create_version.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.create_version.js new file mode 100644 index 00000000000..6fa6ebd5a01 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.create_version.js @@ -0,0 +1,77 @@ +// Copyright 2024 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, version) { + // [START apihub_v1_generated_ApiHub_CreateVersion_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 parent resource for API version. + * Format: `projects/{project}/locations/{location}/apis/{api}` + */ + // const parent = 'abc123' + /** + * Optional. The ID to use for the API version, which will become the final + * component of the version's resource name. This field is optional. + * * If provided, the same will be used. The service will throw an error if + * the specified id is already used by another version in the API resource. + * * If not provided, a system generated id will be used. + * This value should be 4-500 characters, and valid characters + * are /[a-z][A-Z][0-9]-_/. + */ + // const versionId = 'abc123' + /** + * Required. The version to create. + */ + // const version = {} + + // Imports the Apihub library + const {ApiHubClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new ApiHubClient(); + + async function callCreateVersion() { + // Construct request + const request = { + parent, + version, + }; + + // Run request + const response = await apihubClient.createVersion(request); + console.log(response); + } + + callCreateVersion(); + // [END apihub_v1_generated_ApiHub_CreateVersion_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.delete_api.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.delete_api.js new file mode 100644 index 00000000000..ac76db4aeb5 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.delete_api.js @@ -0,0 +1,67 @@ +// Copyright 2024 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 apihub_v1_generated_ApiHub_DeleteApi_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 name of the API resource to delete. + * Format: `projects/{project}/locations/{location}/apis/{api}` + */ + // const name = 'abc123' + /** + * Optional. If set to true, any versions from this API will also be deleted. + * Otherwise, the request will only work if the API has no versions. + */ + // const force = true + + // Imports the Apihub library + const {ApiHubClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new ApiHubClient(); + + async function callDeleteApi() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await apihubClient.deleteApi(request); + console.log(response); + } + + callDeleteApi(); + // [END apihub_v1_generated_ApiHub_DeleteApi_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.delete_attribute.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.delete_attribute.js new file mode 100644 index 00000000000..a5986ba91ef --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.delete_attribute.js @@ -0,0 +1,63 @@ +// Copyright 2024 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 apihub_v1_generated_ApiHub_DeleteAttribute_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 name of the attribute to delete. + * Format: + * `projects/{project}/locations/{location}/attributes/{attribute}` + */ + // const name = 'abc123' + + // Imports the Apihub library + const {ApiHubClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new ApiHubClient(); + + async function callDeleteAttribute() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await apihubClient.deleteAttribute(request); + console.log(response); + } + + callDeleteAttribute(); + // [END apihub_v1_generated_ApiHub_DeleteAttribute_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.delete_deployment.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.delete_deployment.js new file mode 100644 index 00000000000..43ef2d12495 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.delete_deployment.js @@ -0,0 +1,62 @@ +// Copyright 2024 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 apihub_v1_generated_ApiHub_DeleteDeployment_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 name of the deployment resource to delete. + * Format: `projects/{project}/locations/{location}/deployments/{deployment}` + */ + // const name = 'abc123' + + // Imports the Apihub library + const {ApiHubClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new ApiHubClient(); + + async function callDeleteDeployment() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await apihubClient.deleteDeployment(request); + console.log(response); + } + + callDeleteDeployment(); + // [END apihub_v1_generated_ApiHub_DeleteDeployment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.delete_external_api.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.delete_external_api.js new file mode 100644 index 00000000000..6951b8ea877 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.delete_external_api.js @@ -0,0 +1,63 @@ +// Copyright 2024 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 apihub_v1_generated_ApiHub_DeleteExternalApi_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 name of the External API resource to delete. + * Format: + * `projects/{project}/locations/{location}/externalApis/{externalApi}` + */ + // const name = 'abc123' + + // Imports the Apihub library + const {ApiHubClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new ApiHubClient(); + + async function callDeleteExternalApi() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await apihubClient.deleteExternalApi(request); + console.log(response); + } + + callDeleteExternalApi(); + // [END apihub_v1_generated_ApiHub_DeleteExternalApi_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.delete_spec.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.delete_spec.js new file mode 100644 index 00000000000..c3b4b211c32 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.delete_spec.js @@ -0,0 +1,63 @@ +// Copyright 2024 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 apihub_v1_generated_ApiHub_DeleteSpec_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 name of the spec to delete. + * Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}` + */ + // const name = 'abc123' + + // Imports the Apihub library + const {ApiHubClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new ApiHubClient(); + + async function callDeleteSpec() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await apihubClient.deleteSpec(request); + console.log(response); + } + + callDeleteSpec(); + // [END apihub_v1_generated_ApiHub_DeleteSpec_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.delete_version.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.delete_version.js new file mode 100644 index 00000000000..739fdc5f184 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.delete_version.js @@ -0,0 +1,68 @@ +// Copyright 2024 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 apihub_v1_generated_ApiHub_DeleteVersion_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 name of the version to delete. + * Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}` + */ + // const name = 'abc123' + /** + * Optional. If set to true, any specs from this version will also be deleted. + * Otherwise, the request will only work if the version has no specs. + */ + // const force = true + + // Imports the Apihub library + const {ApiHubClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new ApiHubClient(); + + async function callDeleteVersion() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await apihubClient.deleteVersion(request); + console.log(response); + } + + callDeleteVersion(); + // [END apihub_v1_generated_ApiHub_DeleteVersion_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_api.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_api.js new file mode 100644 index 00000000000..b081d9156d5 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_api.js @@ -0,0 +1,62 @@ +// Copyright 2024 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 apihub_v1_generated_ApiHub_GetApi_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 name of the API resource to retrieve. + * Format: `projects/{project}/locations/{location}/apis/{api}` + */ + // const name = 'abc123' + + // Imports the Apihub library + const {ApiHubClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new ApiHubClient(); + + async function callGetApi() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await apihubClient.getApi(request); + console.log(response); + } + + callGetApi(); + // [END apihub_v1_generated_ApiHub_GetApi_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_api_operation.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_api_operation.js new file mode 100644 index 00000000000..19ffe7726e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_api_operation.js @@ -0,0 +1,63 @@ +// Copyright 2024 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 apihub_v1_generated_ApiHub_GetApiOperation_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 name of the operation to retrieve. + * Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}` + */ + // const name = 'abc123' + + // Imports the Apihub library + const {ApiHubClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new ApiHubClient(); + + async function callGetApiOperation() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await apihubClient.getApiOperation(request); + console.log(response); + } + + callGetApiOperation(); + // [END apihub_v1_generated_ApiHub_GetApiOperation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_attribute.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_attribute.js new file mode 100644 index 00000000000..6bb116e01cf --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_attribute.js @@ -0,0 +1,63 @@ +// Copyright 2024 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 apihub_v1_generated_ApiHub_GetAttribute_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 name of the attribute to retrieve. + * Format: + * `projects/{project}/locations/{location}/attributes/{attribute}` + */ + // const name = 'abc123' + + // Imports the Apihub library + const {ApiHubClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new ApiHubClient(); + + async function callGetAttribute() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await apihubClient.getAttribute(request); + console.log(response); + } + + callGetAttribute(); + // [END apihub_v1_generated_ApiHub_GetAttribute_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_definition.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_definition.js new file mode 100644 index 00000000000..4ee68bb3bc8 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_definition.js @@ -0,0 +1,63 @@ +// Copyright 2024 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 apihub_v1_generated_ApiHub_GetDefinition_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 name of the definition to retrieve. + * Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}` + */ + // const name = 'abc123' + + // Imports the Apihub library + const {ApiHubClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new ApiHubClient(); + + async function callGetDefinition() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await apihubClient.getDefinition(request); + console.log(response); + } + + callGetDefinition(); + // [END apihub_v1_generated_ApiHub_GetDefinition_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_deployment.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_deployment.js new file mode 100644 index 00000000000..ce254e76c5b --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_deployment.js @@ -0,0 +1,62 @@ +// Copyright 2024 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 apihub_v1_generated_ApiHub_GetDeployment_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 name of the deployment resource to retrieve. + * Format: `projects/{project}/locations/{location}/deployments/{deployment}` + */ + // const name = 'abc123' + + // Imports the Apihub library + const {ApiHubClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new ApiHubClient(); + + async function callGetDeployment() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await apihubClient.getDeployment(request); + console.log(response); + } + + callGetDeployment(); + // [END apihub_v1_generated_ApiHub_GetDeployment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_external_api.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_external_api.js new file mode 100644 index 00000000000..7d23feb11a7 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_external_api.js @@ -0,0 +1,63 @@ +// Copyright 2024 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 apihub_v1_generated_ApiHub_GetExternalApi_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 name of the External API resource to retrieve. + * Format: + * `projects/{project}/locations/{location}/externalApis/{externalApi}` + */ + // const name = 'abc123' + + // Imports the Apihub library + const {ApiHubClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new ApiHubClient(); + + async function callGetExternalApi() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await apihubClient.getExternalApi(request); + console.log(response); + } + + callGetExternalApi(); + // [END apihub_v1_generated_ApiHub_GetExternalApi_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_spec.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_spec.js new file mode 100644 index 00000000000..03f4c0bb701 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_spec.js @@ -0,0 +1,63 @@ +// Copyright 2024 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 apihub_v1_generated_ApiHub_GetSpec_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 name of the spec to retrieve. + * Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}` + */ + // const name = 'abc123' + + // Imports the Apihub library + const {ApiHubClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new ApiHubClient(); + + async function callGetSpec() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await apihubClient.getSpec(request); + console.log(response); + } + + callGetSpec(); + // [END apihub_v1_generated_ApiHub_GetSpec_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_spec_contents.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_spec_contents.js new file mode 100644 index 00000000000..865e39c5a2c --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_spec_contents.js @@ -0,0 +1,63 @@ +// Copyright 2024 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 apihub_v1_generated_ApiHub_GetSpecContents_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 name of the spec whose contents need to be retrieved. + * Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}` + */ + // const name = 'abc123' + + // Imports the Apihub library + const {ApiHubClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new ApiHubClient(); + + async function callGetSpecContents() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await apihubClient.getSpecContents(request); + console.log(response); + } + + callGetSpecContents(); + // [END apihub_v1_generated_ApiHub_GetSpecContents_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_version.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_version.js new file mode 100644 index 00000000000..9bc61d725db --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_version.js @@ -0,0 +1,63 @@ +// Copyright 2024 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 apihub_v1_generated_ApiHub_GetVersion_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 name of the API version to retrieve. + * Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}` + */ + // const name = 'abc123' + + // Imports the Apihub library + const {ApiHubClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new ApiHubClient(); + + async function callGetVersion() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await apihubClient.getVersion(request); + console.log(response); + } + + callGetVersion(); + // [END apihub_v1_generated_ApiHub_GetVersion_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.list_api_operations.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.list_api_operations.js new file mode 100644 index 00000000000..2ec1dd7597a --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.list_api_operations.js @@ -0,0 +1,117 @@ +// Copyright 2024 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 apihub_v1_generated_ApiHub_ListApiOperations_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 parent which owns this collection of operations i.e., the API + * version. Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}` + */ + // const parent = 'abc123' + /** + * Optional. An expression that filters the list of ApiOperations. + * A filter expression consists of a field name, a comparison + * operator, and a value for filtering. The value must be a string or a + * boolean. The comparison operator must be one of: `<`, `>` or + * `=`. Filters are not case sensitive. + * The following fields in the `ApiOperation` are eligible for filtering: + * * `name` - The ApiOperation resource name. Allowed comparison + * operators: + * `=`. + * * `details.http_operation.path.path` - The http operation's complete path + * relative to server endpoint. Allowed comparison operators: `=`. + * * `details.http_operation.method` - The http operation method type. + * Allowed comparison operators: `=`. + * * `details.deprecated` - Indicates if the ApiOperation is deprecated. + * Allowed values are True / False indicating the deprycation status of the + * ApiOperation. Allowed comparison operators: `=`. + * * `create_time` - The time at which the ApiOperation was created. The + * value should be in the (RFC3339)https://tools.ietf.org/html/rfc3339 + * format. Allowed comparison operators: `>` and `<`. + * Expressions are combined with either `AND` logic operator or `OR` logical + * operator but not both of them together i.e. only one of the `AND` or `OR` + * operator can be used throughout the filter string and both the operators + * cannot be used together. No other logical operators are supported. At most + * three filter fields are allowed in the filter string and if provided + * more than that then `INVALID_ARGUMENT` error is returned by the API. + * Here are a few examples: + * * `details.deprecated = True` - The ApiOperation is deprecated. + * * `details.http_operation.method = GET AND create_time < + * \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - + * The method of the http operation of the ApiOperation is _GET_ and the + * spec was created before _2021-08-15 14:50:00 UTC_ and after _2021-08-10 + * 12:00:00 UTC_. + * * `details.http_operation.method = GET OR details.http_operation.method = + * POST`. - The http operation of the method of ApiOperation is _GET_ or + * _POST_. + */ + // const filter = 'abc123' + /** + * Optional. The maximum number of operations to return. The service may + * return fewer than this value. If unspecified, at most 50 operations will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + */ + // const pageSize = 1234 + /** + * Optional. A page token, received from a previous `ListApiOperations` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters (except page_size) provided to + * `ListApiOperations` must match the call that provided the page token. + */ + // const pageToken = 'abc123' + + // Imports the Apihub library + const {ApiHubClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new ApiHubClient(); + + async function callListApiOperations() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = apihubClient.listApiOperationsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListApiOperations(); + // [END apihub_v1_generated_ApiHub_ListApiOperations_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.list_apis.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.list_apis.js new file mode 100644 index 00000000000..30285b75116 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.list_apis.js @@ -0,0 +1,146 @@ +// Copyright 2024 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 apihub_v1_generated_ApiHub_ListApis_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 parent, which owns this collection of API resources. + * Format: `projects/{project}/locations/{location}` + */ + // const parent = 'abc123' + /** + * Optional. An expression that filters the list of ApiResources. + * A filter expression consists of a field name, a comparison + * operator, and a value for filtering. The value must be a string. The + * comparison operator must be one of: `<`, `>`, `:` or `=`. Filters are not + * case sensitive. + * The following fields in the `ApiResource` are eligible for filtering: + * * `owner.email` - The email of the team which owns the ApiResource. + * Allowed comparison operators: `=`. + * * `create_time` - The time at which the ApiResource was created. The + * value should be in the (RFC3339)https://tools.ietf.org/html/rfc3339 + * format. Allowed comparison operators: `>` and `<`. + * * `display_name` - The display name of the ApiResource. Allowed + * comparison operators: `=`. + * * `target_user.enum_values.values.id` - The allowed value id of the + * target users attribute associated with the ApiResource. Allowed + * comparison operator is `:`. + * * `target_user.enum_values.values.display_name` - The allowed value + * display name of the target users attribute associated with the + * ApiResource. Allowed comparison operator is `:`. + * * `team.enum_values.values.id` - The allowed value id of the team + * attribute associated with the ApiResource. Allowed comparison operator is + * `:`. + * * `team.enum_values.values.display_name` - The allowed value display name + * of the team attribute associated with the ApiResource. Allowed comparison + * operator is `:`. + * * `business_unit.enum_values.values.id` - The allowed value id of the + * business unit attribute associated with the ApiResource. Allowed + * comparison operator is `:`. + * * `business_unit.enum_values.values.display_name` - The allowed value + * display name of the business unit attribute associated with the + * ApiResource. Allowed comparison operator is `:`. + * * `maturity_level.enum_values.values.id` - The allowed value id of the + * maturity level attribute associated with the ApiResource. Allowed + * comparison operator is `:`. + * * `maturity_level.enum_values.values.display_name` - The allowed value + * display name of the maturity level attribute associated with the + * ApiResource. Allowed comparison operator is `:`. + * * `api_style.enum_values.values.id` - The allowed value id of the + * api style attribute associated with the ApiResource. Allowed + * comparison operator is `:`. + * * `api_style.enum_values.values.display_name` - The allowed value display + * name of the api style attribute associated with the ApiResource. Allowed + * comparison operator is `:`. + * Expressions are combined with either `AND` logic operator or `OR` logical + * operator but not both of them together i.e. only one of the `AND` or `OR` + * operator can be used throughout the filter string and both the operators + * cannot be used together. No other logical operators are supported. At most + * three filter fields are allowed in the filter string and if provided + * more than that then `INVALID_ARGUMENT` error is returned by the API. + * Here are a few examples: + * * `owner.email = \"apihub@google.com\"` - - The owner team email is + * _apihub@google.com_. + * * `owner.email = \"apihub@google.com\" AND create_time < + * \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - + * The owner team email is _apihub@google.com_ and the api was created + * before _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_. + * * `owner.email = \"apihub@google.com\" OR team.enum_values.values.id: + * apihub-team-id` - The filter string specifies the APIs where the owner + * team email is _apihub@google.com_ or the id of the allowed value + * associated with the team attribute is _apihub-team-id_. + * * `owner.email = \"apihub@google.com\" OR + * team.enum_values.values.display_name: ApiHub Team` - The filter string + * specifies the APIs where the owner team email is _apihub@google.com_ or + * the display name of the allowed value associated with the team attribute + * is `ApiHub Team`. + */ + // const filter = 'abc123' + /** + * Optional. The maximum number of API resources to return. The service may + * return fewer than this value. If unspecified, at most 50 Apis will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + */ + // const pageSize = 1234 + /** + * Optional. A page token, received from a previous `ListApis` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters (except page_size) provided to + * `ListApis` must match the call that provided the page token. + */ + // const pageToken = 'abc123' + + // Imports the Apihub library + const {ApiHubClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new ApiHubClient(); + + async function callListApis() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = apihubClient.listApisAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListApis(); + // [END apihub_v1_generated_ApiHub_ListApis_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.list_attributes.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.list_attributes.js new file mode 100644 index 00000000000..cb24939e9dd --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.list_attributes.js @@ -0,0 +1,118 @@ +// Copyright 2024 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 apihub_v1_generated_ApiHub_ListAttributes_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 parent resource for Attribute. + * Format: `projects/{project}/locations/{location}` + */ + // const parent = 'abc123' + /** + * Optional. An expression that filters the list of Attributes. + * A filter expression consists of a field name, a comparison + * operator, and a value for filtering. The value must be a string or a + * boolean. The comparison operator must be one of: `<`, `>` or + * `=`. Filters are not case sensitive. + * The following fields in the `Attribute` are eligible for filtering: + * * `display_name` - The display name of the Attribute. Allowed + * comparison operators: `=`. + * * `definition_type` - The definition type of the attribute. Allowed + * comparison operators: `=`. + * * `scope` - The scope of the attribute. Allowed comparison operators: + * `=`. + * * `data_type` - The type of the data of the attribute. Allowed + * comparison operators: `=`. + * * `mandatory` - Denotes whether the attribute is mandatory or not. + * Allowed comparison operators: `=`. + * * `create_time` - The time at which the Attribute was created. The + * value should be in the (RFC3339)https://tools.ietf.org/html/rfc3339 + * format. Allowed comparison operators: `>` and `<`. + * Expressions are combined with either `AND` logic operator or `OR` logical + * operator but not both of them together i.e. only one of the `AND` or `OR` + * operator can be used throughout the filter string and both the operators + * cannot be used together. No other logical operators are + * supported. At most three filter fields are allowed in the filter + * string and if provided more than that then `INVALID_ARGUMENT` error is + * returned by the API. + * Here are a few examples: + * * `display_name = production` - - The display name of the attribute is + * _production_. + * * `(display_name = production) AND (create_time < + * \"2021-08-15T14:50:00Z\") AND (create_time > \"2021-08-10T12:00:00Z\")` - + * The display name of the attribute is _production_ and the attribute was + * created before _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00 + * UTC_. + * * `display_name = production OR scope = api` - + * The attribute where the display name is _production_ or the scope is + * _api_. + */ + // const filter = 'abc123' + /** + * Optional. The maximum number of attribute resources to return. The service + * may return fewer than this value. If unspecified, at most 50 attributes + * will be returned. The maximum value is 1000; values above 1000 will be + * coerced to 1000. + */ + // const pageSize = 1234 + /** + * Optional. A page token, received from a previous `ListAttributes` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListAttributes` must + * match the call that provided the page token. + */ + // const pageToken = 'abc123' + + // Imports the Apihub library + const {ApiHubClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new ApiHubClient(); + + async function callListAttributes() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = apihubClient.listAttributesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListAttributes(); + // [END apihub_v1_generated_ApiHub_ListAttributes_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.list_deployments.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.list_deployments.js new file mode 100644 index 00000000000..ff07c1a2522 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.list_deployments.js @@ -0,0 +1,133 @@ +// Copyright 2024 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 apihub_v1_generated_ApiHub_ListDeployments_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 parent, which owns this collection of deployment resources. + * Format: `projects/{project}/locations/{location}` + */ + // const parent = 'abc123' + /** + * Optional. An expression that filters the list of Deployments. + * A filter expression consists of a field name, a comparison + * operator, and a value for filtering. The value must be a string. The + * comparison operator must be one of: `<`, `>` or + * `=`. Filters are not case sensitive. + * The following fields in the `Deployments` are eligible for filtering: + * * `display_name` - The display name of the Deployment. Allowed + * comparison operators: `=`. + * * `create_time` - The time at which the Deployment was created. The + * value should be in the (RFC3339)https://tools.ietf.org/html/rfc3339 + * format. Allowed comparison operators: `>` and `<`. + * * `resource_uri` - A URI to the deployment resource. Allowed + * comparison operators: `=`. + * * `api_versions` - The API versions linked to this deployment. Allowed + * comparison operators: `:`. + * * `deployment_type.enum_values.values.id` - The allowed value id of the + * deployment_type attribute associated with the Deployment. Allowed + * comparison operators: `:`. + * * `deployment_type.enum_values.values.display_name` - The allowed value + * display name of the deployment_type attribute associated with the + * Deployment. Allowed comparison operators: `:`. + * * `slo.string_values.values` -The allowed string value of the slo + * attribute associated with the deployment. Allowed comparison + * operators: `:`. + * * `environment.enum_values.values.id` - The allowed value id of the + * environment attribute associated with the deployment. Allowed + * comparison operators: `:`. + * * `environment.enum_values.values.display_name` - The allowed value + * display name of the environment attribute associated with the deployment. + * Allowed comparison operators: `:`. + * Expressions are combined with either `AND` logic operator or `OR` logical + * operator but not both of them together i.e. only one of the `AND` or `OR` + * operator can be used throughout the filter string and both the operators + * cannot be used together. No other logical operators are supported. At most + * three filter fields are allowed in the filter string and if provided + * more than that then `INVALID_ARGUMENT` error is returned by the API. + * Here are a few examples: + * * `environment.enum_values.values.id: staging-id` - The allowed value id + * of the environment attribute associated with the Deployment is + * _staging-id_. + * * `environment.enum_values.values.display_name: \"Staging Deployment\"` - + * The allowed value display name of the environment attribute associated + * with the Deployment is `Staging Deployment`. + * * `environment.enum_values.values.id: production-id AND create_time < + * \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - + * The allowed value id of the environment attribute associated with the + * Deployment is _production-id_ and Deployment was created before + * _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_. + * * `environment.enum_values.values.id: production-id OR + * slo.string_values.values: \"99.99%\"` + * - The allowed value id of the environment attribute Deployment is + * _production-id_ or string value of the slo attribute is _99.99%_. + */ + // const filter = 'abc123' + /** + * Optional. The maximum number of deployment resources to return. The service + * may return fewer than this value. If unspecified, at most 50 deployments + * will be returned. The maximum value is 1000; values above 1000 will be + * coerced to 1000. + */ + // const pageSize = 1234 + /** + * Optional. A page token, received from a previous `ListDeployments` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters (except page_size) provided to + * `ListDeployments` must match the call that provided the page token. + */ + // const pageToken = 'abc123' + + // Imports the Apihub library + const {ApiHubClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new ApiHubClient(); + + async function callListDeployments() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = apihubClient.listDeploymentsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListDeployments(); + // [END apihub_v1_generated_ApiHub_ListDeployments_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.list_external_apis.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.list_external_apis.js new file mode 100644 index 00000000000..1b74031251b --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.list_external_apis.js @@ -0,0 +1,78 @@ +// Copyright 2024 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 apihub_v1_generated_ApiHub_ListExternalApis_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 parent, which owns this collection of External API resources. + * Format: `projects/{project}/locations/{location}` + */ + // const parent = 'abc123' + /** + * Optional. The maximum number of External API resources to return. The + * service may return fewer than this value. If unspecified, at most 50 + * ExternalApis will be returned. The maximum value is 1000; values above 1000 + * will be coerced to 1000. + */ + // const pageSize = 1234 + /** + * Optional. A page token, received from a previous `ListExternalApis` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters (except page_size) provided to + * `ListExternalApis` must match the call that provided the page token. + */ + // const pageToken = 'abc123' + + // Imports the Apihub library + const {ApiHubClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new ApiHubClient(); + + async function callListExternalApis() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = apihubClient.listExternalApisAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListExternalApis(); + // [END apihub_v1_generated_ApiHub_ListExternalApis_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.list_specs.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.list_specs.js new file mode 100644 index 00000000000..4c61c8a0f80 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.list_specs.js @@ -0,0 +1,127 @@ +// Copyright 2024 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 apihub_v1_generated_ApiHub_ListSpecs_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 parent, which owns this collection of specs. + * Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}` + */ + // const parent = 'abc123' + /** + * Optional. An expression that filters the list of Specs. + * A filter expression consists of a field name, a comparison + * operator, and a value for filtering. The value must be a string. The + * comparison operator must be one of: `<`, `>`, `:` or `=`. Filters are not + * case sensitive. + * The following fields in the `Spec` are eligible for filtering: + * * `display_name` - The display name of the Spec. Allowed comparison + * operators: `=`. + * * `create_time` - The time at which the Spec was created. The + * value should be in the (RFC3339)https://tools.ietf.org/html/rfc3339 + * format. Allowed comparison operators: `>` and `<`. + * * `spec_type.enum_values.values.id` - The allowed value id of the + * spec_type attribute associated with the Spec. Allowed comparison + * operators: `:`. + * * `spec_type.enum_values.values.display_name` - The allowed value display + * name of the spec_type attribute associated with the Spec. Allowed + * comparison operators: `:`. + * * `lint_response.json_values.values` - The json value of the + * lint_response attribute associated with the Spec. Allowed comparison + * operators: `:`. + * * `mime_type` - The MIME type of the Spec. Allowed comparison + * operators: `=`. + * Expressions are combined with either `AND` logic operator or `OR` logical + * operator but not both of them together i.e. only one of the `AND` or `OR` + * operator can be used throughout the filter string and both the operators + * cannot be used together. No other logical operators are + * supported. At most three filter fields are allowed in the filter + * string and if provided more than that then `INVALID_ARGUMENT` error is + * returned by the API. + * Here are a few examples: + * * `spec_type.enum_values.values.id: rest-id` - The filter + * string specifies that the id of the allowed value associated with the + * spec_type attribute is _rest-id_. + * * `spec_type.enum_values.values.display_name: \"Rest Display Name\"` - + * The filter string specifies that the display name of the allowed value + * associated with the spec_type attribute is `Rest Display Name`. + * * `spec_type.enum_values.values.id: grpc-id AND create_time < + * \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - + * The id of the allowed value associated with the spec_type attribute is + * _grpc-id_ and the spec was created before _2021-08-15 14:50:00 UTC_ and + * after _2021-08-10 12:00:00 UTC_. + * * `spec_type.enum_values.values.id: rest-id OR + * spec_type.enum_values.values.id: grpc-id` + * - The id of the allowed value associated with the spec_type attribute is + * _rest-id_ or _grpc-id_. + */ + // const filter = 'abc123' + /** + * Optional. The maximum number of specs to return. The service may return + * fewer than this value. If unspecified, at most 50 specs will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + */ + // const pageSize = 1234 + /** + * Optional. A page token, received from a previous `ListSpecs` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListSpecs` must + * match the call that provided the page token. + */ + // const pageToken = 'abc123' + + // Imports the Apihub library + const {ApiHubClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new ApiHubClient(); + + async function callListSpecs() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = apihubClient.listSpecsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListSpecs(); + // [END apihub_v1_generated_ApiHub_ListSpecs_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.list_versions.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.list_versions.js new file mode 100644 index 00000000000..9c3a25c5038 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.list_versions.js @@ -0,0 +1,134 @@ +// Copyright 2024 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 apihub_v1_generated_ApiHub_ListVersions_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 parent which owns this collection of API versions i.e., the + * API resource Format: `projects/{project}/locations/{location}/apis/{api}` + */ + // const parent = 'abc123' + /** + * Optional. An expression that filters the list of Versions. + * A filter expression consists of a field name, a comparison + * operator, and a value for filtering. The value must be a string, a + * number, or a boolean. The comparison operator must be one of: `<`, `>` or + * `=`. Filters are not case sensitive. + * The following fields in the `Version` are eligible for filtering: + * * `display_name` - The display name of the Version. Allowed + * comparison operators: `=`. + * * `create_time` - The time at which the Version was created. The + * value should be in the (RFC3339)https://tools.ietf.org/html/rfc3339 + * format. Allowed comparison operators: `>` and `<`. + * * `lifecycle.enum_values.values.id` - The allowed value id of the + * lifecycle attribute associated with the Version. Allowed comparison + * operators: `:`. + * * `lifecycle.enum_values.values.display_name` - The allowed value display + * name of the lifecycle attribute associated with the Version. Allowed + * comparison operators: `:`. + * * `compliance.enum_values.values.id` - The allowed value id of the + * compliances attribute associated with the Version. Allowed comparison + * operators: `:`. + * * `compliance.enum_values.values.display_name` - The allowed value + * display name of the compliances attribute associated with the Version. + * Allowed comparison operators: `:`. + * * `accreditation.enum_values.values.id` - The allowed value id of the + * accreditations attribute associated with the Version. Allowed + * comparison operators: `:`. + * * `accreditation.enum_values.values.display_name` - The allowed value + * display name of the accreditations attribute associated with the Version. + * Allowed comparison operators: `:`. + * Expressions are combined with either `AND` logic operator or `OR` logical + * operator but not both of them together i.e. only one of the `AND` or `OR` + * operator can be used throughout the filter string and both the operators + * cannot be used together. No other logical operators are + * supported. At most three filter fields are allowed in the filter + * string and if provided more than that then `INVALID_ARGUMENT` error is + * returned by the API. + * Here are a few examples: + * * `lifecycle.enum_values.values.id: preview-id` - The filter string + * specifies that the id of the allowed value associated with the lifecycle + * attribute of the Version is _preview-id_. + * * `lifecycle.enum_values.values.display_name: \"Preview Display Name\"` - + * The filter string specifies that the display name of the allowed value + * associated with the lifecycle attribute of the Version is `Preview + * Display Name`. + * * `lifecycle.enum_values.values.id: preview-id AND create_time < + * \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - + * The id of the allowed value associated with the lifecycle attribute of + * the Version is _preview-id_ and it was created before _2021-08-15 + * 14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_. + * * `compliance.enum_values.values.id: gdpr-id OR + * compliance.enum_values.values.id: pci-dss-id` + * - The id of the allowed value associated with the compliance attribute is + * _gdpr-id_ or _pci-dss-id_. + */ + // const filter = 'abc123' + /** + * Optional. The maximum number of versions to return. The service may return + * fewer than this value. If unspecified, at most 50 versions will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + */ + // const pageSize = 1234 + /** + * Optional. A page token, received from a previous `ListVersions` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters (except page_size) provided to + * `ListVersions` must match the call that provided the page token. + */ + // const pageToken = 'abc123' + + // Imports the Apihub library + const {ApiHubClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new ApiHubClient(); + + async function callListVersions() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = apihubClient.listVersionsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListVersions(); + // [END apihub_v1_generated_ApiHub_ListVersions_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.search_resources.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.search_resources.js new file mode 100644 index 00000000000..620468d7230 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.search_resources.js @@ -0,0 +1,108 @@ +// Copyright 2024 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(location, query) { + // [START apihub_v1_generated_ApiHub_SearchResources_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 location which will be of the type + * `projects/{project_id}/locations/{location_id}`. This field is used to + * identify the instance of API-Hub in which resources should be searched. + */ + // const location = 'abc123' + /** + * Required. The free text search query. This query can contain keywords which + * could be related to any detail of the API-Hub resources such display names, + * descriptions, attributes etc. + */ + // const query = 'abc123' + /** + * Optional. An expression that filters the list of search results. + * A filter expression consists of a field name, a comparison operator, + * and a value for filtering. The value must be a string, a number, or a + * boolean. The comparison operator must be `=`. Filters are not case + * sensitive. + * The following field names are eligible for filtering: + * * `resource_type` - The type of resource in the search results. + * Must be one of the following: `Api`, `ApiOperation`, `Deployment`, + * `Definition`, `Spec` or `Version`. This field can only be specified once + * in the filter. + * Here are is an example: + * * `resource_type = Api` - The resource_type is _Api_. + */ + // const filter = 'abc123' + /** + * Optional. The maximum number of search results to return. The service may + * return fewer than this value. If unspecified at most 10 search results will + * be returned. If value is negative then `INVALID_ARGUMENT` error is + * returned. The maximum value is 25; values above 25 will be coerced to 25. + * While paginating, you can specify a new page size parameter for each page + * of search results to be listed. + */ + // const pageSize = 1234 + /** + * Optional. A page token, received from a previous + * SearchResources SearchResources + * call. Specify this parameter to retrieve the next page of transactions. + * When paginating, you must specify the `page_token` parameter and all the + * other parameters except + * page_size google.cloud.apihub.v1.SearchResourcesRequest.page_size + * should be specified with the same value which was used in the previous + * call. If the other fields are set with a different value than the previous + * call then `INVALID_ARGUMENT` error is returned. + */ + // const pageToken = 'abc123' + + // Imports the Apihub library + const {ApiHubClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new ApiHubClient(); + + async function callSearchResources() { + // Construct request + const request = { + location, + query, + }; + + // Run request + const iterable = apihubClient.searchResourcesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callSearchResources(); + // [END apihub_v1_generated_ApiHub_SearchResources_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.update_api.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.update_api.js new file mode 100644 index 00000000000..de22a319390 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.update_api.js @@ -0,0 +1,69 @@ +// Copyright 2024 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(api, updateMask) { + // [START apihub_v1_generated_ApiHub_UpdateApi_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 API resource to update. + * The API resource's `name` field is used to identify the API resource to + * update. + * Format: `projects/{project}/locations/{location}/apis/{api}` + */ + // const api = {} + /** + * Required. The list of fields to update. + */ + // const updateMask = {} + + // Imports the Apihub library + const {ApiHubClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new ApiHubClient(); + + async function callUpdateApi() { + // Construct request + const request = { + api, + updateMask, + }; + + // Run request + const response = await apihubClient.updateApi(request); + console.log(response); + } + + callUpdateApi(); + // [END apihub_v1_generated_ApiHub_UpdateApi_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.update_attribute.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.update_attribute.js new file mode 100644 index 00000000000..d9981224b6b --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.update_attribute.js @@ -0,0 +1,69 @@ +// Copyright 2024 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(attribute, updateMask) { + // [START apihub_v1_generated_ApiHub_UpdateAttribute_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 attribute to update. + * The attribute's `name` field is used to identify the attribute to update. + * Format: + * `projects/{project}/locations/{location}/attributes/{attribute}` + */ + // const attribute = {} + /** + * Required. The list of fields to update. + */ + // const updateMask = {} + + // Imports the Apihub library + const {ApiHubClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new ApiHubClient(); + + async function callUpdateAttribute() { + // Construct request + const request = { + attribute, + updateMask, + }; + + // Run request + const response = await apihubClient.updateAttribute(request); + console.log(response); + } + + callUpdateAttribute(); + // [END apihub_v1_generated_ApiHub_UpdateAttribute_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.update_deployment.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.update_deployment.js new file mode 100644 index 00000000000..451b90c3b7a --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.update_deployment.js @@ -0,0 +1,69 @@ +// Copyright 2024 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(deployment, updateMask) { + // [START apihub_v1_generated_ApiHub_UpdateDeployment_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 deployment resource to update. + * The deployment resource's `name` field is used to identify the deployment + * resource to update. + * Format: `projects/{project}/locations/{location}/deployments/{deployment}` + */ + // const deployment = {} + /** + * Required. The list of fields to update. + */ + // const updateMask = {} + + // Imports the Apihub library + const {ApiHubClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new ApiHubClient(); + + async function callUpdateDeployment() { + // Construct request + const request = { + deployment, + updateMask, + }; + + // Run request + const response = await apihubClient.updateDeployment(request); + console.log(response); + } + + callUpdateDeployment(); + // [END apihub_v1_generated_ApiHub_UpdateDeployment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.update_external_api.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.update_external_api.js new file mode 100644 index 00000000000..b5b266771e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.update_external_api.js @@ -0,0 +1,69 @@ +// Copyright 2024 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(externalApi, updateMask) { + // [START apihub_v1_generated_ApiHub_UpdateExternalApi_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 External API resource to update. + * The External API resource's `name` field is used to identify the External + * API resource to update. Format: + * `projects/{project}/locations/{location}/externalApis/{externalApi}` + */ + // const externalApi = {} + /** + * Required. The list of fields to update. + */ + // const updateMask = {} + + // Imports the Apihub library + const {ApiHubClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new ApiHubClient(); + + async function callUpdateExternalApi() { + // Construct request + const request = { + externalApi, + updateMask, + }; + + // Run request + const response = await apihubClient.updateExternalApi(request); + console.log(response); + } + + callUpdateExternalApi(); + // [END apihub_v1_generated_ApiHub_UpdateExternalApi_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.update_spec.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.update_spec.js new file mode 100644 index 00000000000..aa5452961ad --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.update_spec.js @@ -0,0 +1,69 @@ +// Copyright 2024 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(spec, updateMask) { + // [START apihub_v1_generated_ApiHub_UpdateSpec_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 spec to update. + * The spec's `name` field is used to identify the spec to + * update. Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}` + */ + // const spec = {} + /** + * Required. The list of fields to update. + */ + // const updateMask = {} + + // Imports the Apihub library + const {ApiHubClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new ApiHubClient(); + + async function callUpdateSpec() { + // Construct request + const request = { + spec, + updateMask, + }; + + // Run request + const response = await apihubClient.updateSpec(request); + console.log(response); + } + + callUpdateSpec(); + // [END apihub_v1_generated_ApiHub_UpdateSpec_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.update_version.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.update_version.js new file mode 100644 index 00000000000..6192934a974 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.update_version.js @@ -0,0 +1,69 @@ +// Copyright 2024 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(version, updateMask) { + // [START apihub_v1_generated_ApiHub_UpdateVersion_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 API version to update. + * The version's `name` field is used to identify the API version to update. + * Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}` + */ + // const version = {} + /** + * Required. The list of fields to update. + */ + // const updateMask = {} + + // Imports the Apihub library + const {ApiHubClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new ApiHubClient(); + + async function callUpdateVersion() { + // Construct request + const request = { + version, + updateMask, + }; + + // Run request + const response = await apihubClient.updateVersion(request); + console.log(response); + } + + callUpdateVersion(); + // [END apihub_v1_generated_ApiHub_UpdateVersion_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_dependencies.create_dependency.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_dependencies.create_dependency.js new file mode 100644 index 00000000000..44adc875150 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_dependencies.create_dependency.js @@ -0,0 +1,77 @@ +// Copyright 2024 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, dependency) { + // [START apihub_v1_generated_ApiHubDependencies_CreateDependency_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 parent resource for the dependency resource. + * Format: `projects/{project}/locations/{location}` + */ + // const parent = 'abc123' + /** + * Optional. The ID to use for the dependency resource, which will become the + * final component of the dependency's resource name. This field is optional. + * * If provided, the same will be used. The service will throw an error if + * duplicate id is provided by the client. + * * If not provided, a system generated id will be used. + * This value should be 4-500 characters, and valid characters + * are `[a-z][A-Z][0-9]-_`. + */ + // const dependencyId = 'abc123' + /** + * Required. The dependency resource to create. + */ + // const dependency = {} + + // Imports the Apihub library + const {ApiHubDependenciesClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new ApiHubDependenciesClient(); + + async function callCreateDependency() { + // Construct request + const request = { + parent, + dependency, + }; + + // Run request + const response = await apihubClient.createDependency(request); + console.log(response); + } + + callCreateDependency(); + // [END apihub_v1_generated_ApiHubDependencies_CreateDependency_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_dependencies.delete_dependency.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_dependencies.delete_dependency.js new file mode 100644 index 00000000000..560558e238a --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_dependencies.delete_dependency.js @@ -0,0 +1,62 @@ +// Copyright 2024 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 apihub_v1_generated_ApiHubDependencies_DeleteDependency_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 name of the dependency resource to delete. + * Format: `projects/{project}/locations/{location}/dependencies/{dependency}` + */ + // const name = 'abc123' + + // Imports the Apihub library + const {ApiHubDependenciesClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new ApiHubDependenciesClient(); + + async function callDeleteDependency() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await apihubClient.deleteDependency(request); + console.log(response); + } + + callDeleteDependency(); + // [END apihub_v1_generated_ApiHubDependencies_DeleteDependency_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_dependencies.get_dependency.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_dependencies.get_dependency.js new file mode 100644 index 00000000000..134880e3111 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_dependencies.get_dependency.js @@ -0,0 +1,62 @@ +// Copyright 2024 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 apihub_v1_generated_ApiHubDependencies_GetDependency_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 name of the dependency resource to retrieve. + * Format: `projects/{project}/locations/{location}/dependencies/{dependency}` + */ + // const name = 'abc123' + + // Imports the Apihub library + const {ApiHubDependenciesClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new ApiHubDependenciesClient(); + + async function callGetDependency() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await apihubClient.getDependency(request); + console.log(response); + } + + callGetDependency(); + // [END apihub_v1_generated_ApiHubDependencies_GetDependency_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_dependencies.list_dependencies.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_dependencies.list_dependencies.js new file mode 100644 index 00000000000..ed499d709cc --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_dependencies.list_dependencies.js @@ -0,0 +1,110 @@ +// Copyright 2024 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 apihub_v1_generated_ApiHubDependencies_ListDependencies_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 parent which owns this collection of dependency resources. + * Format: `projects/{project}/locations/{location}` + */ + // const parent = 'abc123' + /** + * Optional. An expression that filters the list of Dependencies. + * A filter expression consists of a field name, a comparison operator, and + * a value for filtering. The value must be a string. Allowed comparison + * operator is `=`. Filters are not case sensitive. + * The following fields in the `Dependency` are eligible for filtering: + * * `consumer.operation_resource_name` - The operation resource name for + * the consumer entity involved in a dependency. Allowed comparison + * operators: `=`. + * * `consumer.external_api_resource_name` - The external api resource name + * for the consumer entity involved in a dependency. Allowed comparison + * operators: `=`. + * * `supplier.operation_resource_name` - The operation resource name for + * the supplier entity involved in a dependency. Allowed comparison + * operators: `=`. + * * `supplier.external_api_resource_name` - The external api resource name + * for the supplier entity involved in a dependency. Allowed comparison + * operators: `=`. + * Expressions are combined with either `AND` logic operator or `OR` logical + * operator but not both of them together i.e. only one of the `AND` or `OR` + * operator can be used throughout the filter string and both the operators + * cannot be used together. No other logical operators are supported. At most + * three filter fields are allowed in the filter string and if provided + * more than that then `INVALID_ARGUMENT` error is returned by the API. + * For example, `consumer.operation_resource_name = + * \"projects/p1/locations/global/apis/a1/versions/v1/operations/o1\" OR + * supplier.operation_resource_name = + * \"projects/p1/locations/global/apis/a1/versions/v1/operations/o1\"` - The + * dependencies with either consumer or supplier operation resource name as + * _projects/p1/locations/global/apis/a1/versions/v1/operations/o1_. + */ + // const filter = 'abc123' + /** + * Optional. The maximum number of dependency resources to return. The service + * may return fewer than this value. If unspecified, at most 50 dependencies + * will be returned. The maximum value is 1000; values above 1000 will be + * coerced to 1000. + */ + // const pageSize = 1234 + /** + * Optional. A page token, received from a previous `ListDependencies` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListDependencies` must + * match the call that provided the page token. + */ + // const pageToken = 'abc123' + + // Imports the Apihub library + const {ApiHubDependenciesClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new ApiHubDependenciesClient(); + + async function callListDependencies() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = apihubClient.listDependenciesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListDependencies(); + // [END apihub_v1_generated_ApiHubDependencies_ListDependencies_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_dependencies.update_dependency.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_dependencies.update_dependency.js new file mode 100644 index 00000000000..c73bc482027 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_dependencies.update_dependency.js @@ -0,0 +1,68 @@ +// Copyright 2024 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(dependency, updateMask) { + // [START apihub_v1_generated_ApiHubDependencies_UpdateDependency_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 dependency resource to update. + * The dependency's `name` field is used to identify the dependency to update. + * Format: `projects/{project}/locations/{location}/dependencies/{dependency}` + */ + // const dependency = {} + /** + * Required. The list of fields to update. + */ + // const updateMask = {} + + // Imports the Apihub library + const {ApiHubDependenciesClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new ApiHubDependenciesClient(); + + async function callUpdateDependency() { + // Construct request + const request = { + dependency, + updateMask, + }; + + // Run request + const response = await apihubClient.updateDependency(request); + console.log(response); + } + + callUpdateDependency(); + // [END apihub_v1_generated_ApiHubDependencies_UpdateDependency_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_plugin.disable_plugin.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_plugin.disable_plugin.js new file mode 100644 index 00000000000..6ee7f42f8bf --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_plugin.disable_plugin.js @@ -0,0 +1,62 @@ +// Copyright 2024 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 apihub_v1_generated_ApiHubPlugin_DisablePlugin_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 name of the plugin to disable. + * Format: `projects/{project}/locations/{location}/plugins/{plugin}`. + */ + // const name = 'abc123' + + // Imports the Apihub library + const {ApiHubPluginClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new ApiHubPluginClient(); + + async function callDisablePlugin() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await apihubClient.disablePlugin(request); + console.log(response); + } + + callDisablePlugin(); + // [END apihub_v1_generated_ApiHubPlugin_DisablePlugin_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_plugin.enable_plugin.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_plugin.enable_plugin.js new file mode 100644 index 00000000000..54fa6296533 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_plugin.enable_plugin.js @@ -0,0 +1,62 @@ +// Copyright 2024 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 apihub_v1_generated_ApiHubPlugin_EnablePlugin_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 name of the plugin to enable. + * Format: `projects/{project}/locations/{location}/plugins/{plugin}`. + */ + // const name = 'abc123' + + // Imports the Apihub library + const {ApiHubPluginClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new ApiHubPluginClient(); + + async function callEnablePlugin() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await apihubClient.enablePlugin(request); + console.log(response); + } + + callEnablePlugin(); + // [END apihub_v1_generated_ApiHubPlugin_EnablePlugin_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_plugin.get_plugin.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_plugin.get_plugin.js new file mode 100644 index 00000000000..0cc7e786529 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_plugin.get_plugin.js @@ -0,0 +1,62 @@ +// Copyright 2024 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 apihub_v1_generated_ApiHubPlugin_GetPlugin_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 name of the plugin to retrieve. + * Format: `projects/{project}/locations/{location}/plugins/{plugin}`. + */ + // const name = 'abc123' + + // Imports the Apihub library + const {ApiHubPluginClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new ApiHubPluginClient(); + + async function callGetPlugin() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await apihubClient.getPlugin(request); + console.log(response); + } + + callGetPlugin(); + // [END apihub_v1_generated_ApiHubPlugin_GetPlugin_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/host_project_registration_service.create_host_project_registration.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/host_project_registration_service.create_host_project_registration.js new file mode 100644 index 00000000000..001d00a9ba7 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/host_project_registration_service.create_host_project_registration.js @@ -0,0 +1,75 @@ +// Copyright 2024 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, hostProjectRegistrationId, hostProjectRegistration) { + // [START apihub_v1_generated_HostProjectRegistrationService_CreateHostProjectRegistration_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 parent resource for the host project. + * Format: `projects/{project}/locations/{location}` + */ + // const parent = 'abc123' + /** + * Required. The ID to use for the Host Project Registration, which will + * become the final component of the host project registration's resource + * name. The ID must be the same as the Google cloud project specified in the + * host_project_registration.gcp_project field. + */ + // const hostProjectRegistrationId = 'abc123' + /** + * Required. The host project registration to register. + */ + // const hostProjectRegistration = {} + + // Imports the Apihub library + const {HostProjectRegistrationServiceClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new HostProjectRegistrationServiceClient(); + + async function callCreateHostProjectRegistration() { + // Construct request + const request = { + parent, + hostProjectRegistrationId, + hostProjectRegistration, + }; + + // Run request + const response = await apihubClient.createHostProjectRegistration(request); + console.log(response); + } + + callCreateHostProjectRegistration(); + // [END apihub_v1_generated_HostProjectRegistrationService_CreateHostProjectRegistration_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/host_project_registration_service.get_host_project_registration.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/host_project_registration_service.get_host_project_registration.js new file mode 100644 index 00000000000..d574c2fdfd9 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/host_project_registration_service.get_host_project_registration.js @@ -0,0 +1,62 @@ +// Copyright 2024 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 apihub_v1_generated_HostProjectRegistrationService_GetHostProjectRegistration_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. Host project registration resource name. + * projects/{project}/locations/{location}/hostProjectRegistrations/{host_project_registration_id} + */ + // const name = 'abc123' + + // Imports the Apihub library + const {HostProjectRegistrationServiceClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new HostProjectRegistrationServiceClient(); + + async function callGetHostProjectRegistration() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await apihubClient.getHostProjectRegistration(request); + console.log(response); + } + + callGetHostProjectRegistration(); + // [END apihub_v1_generated_HostProjectRegistrationService_GetHostProjectRegistration_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/host_project_registration_service.list_host_project_registrations.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/host_project_registration_service.list_host_project_registrations.js new file mode 100644 index 00000000000..8b31dd40890 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/host_project_registration_service.list_host_project_registrations.js @@ -0,0 +1,100 @@ +// Copyright 2024 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 apihub_v1_generated_HostProjectRegistrationService_ListHostProjectRegistrations_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 parent, which owns this collection of host projects. + * Format: `projects/* /locations/*` + */ + // const parent = 'abc123' + /** + * Optional. The maximum number of host project registrations to return. The + * service may return fewer than this value. If unspecified, at most 50 host + * project registrations will be returned. The maximum value is 1000; values + * above 1000 will be coerced to 1000. + */ + // const pageSize = 1234 + /** + * Optional. A page token, received from a previous + * `ListHostProjectRegistrations` call. Provide this to retrieve the + * subsequent page. + * When paginating, all other parameters (except page_size) provided to + * `ListHostProjectRegistrations` must match the call that provided the page + * token. + */ + // const pageToken = 'abc123' + /** + * Optional. An expression that filters the list of HostProjectRegistrations. + * A filter expression consists of a field name, a comparison + * operator, and a value for filtering. The value must be a string. All + * standard operators as documented at https://google.aip.dev/160 are + * supported. + * The following fields in the `HostProjectRegistration` are eligible for + * filtering: + * * `name` - The name of the HostProjectRegistration. + * * `create_time` - The time at which the HostProjectRegistration was + * created. The value should be in the + * (RFC3339)https://tools.ietf.org/html/rfc3339 format. + * * `gcp_project` - The Google cloud project associated with the + * HostProjectRegistration. + */ + // const filter = 'abc123' + /** + * Optional. Hint for how to order the results. + */ + // const orderBy = 'abc123' + + // Imports the Apihub library + const {HostProjectRegistrationServiceClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new HostProjectRegistrationServiceClient(); + + async function callListHostProjectRegistrations() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = apihubClient.listHostProjectRegistrationsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListHostProjectRegistrations(); + // [END apihub_v1_generated_HostProjectRegistrationService_ListHostProjectRegistrations_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/linting_service.get_style_guide.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/linting_service.get_style_guide.js new file mode 100644 index 00000000000..7d1f96bcc46 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/linting_service.get_style_guide.js @@ -0,0 +1,63 @@ +// Copyright 2024 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 apihub_v1_generated_LintingService_GetStyleGuide_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 name of the spec to retrieve. + * Format: + * `projects/{project}/locations/{location}/plugins/{plugin}/styleGuide`. + */ + // const name = 'abc123' + + // Imports the Apihub library + const {LintingServiceClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new LintingServiceClient(); + + async function callGetStyleGuide() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await apihubClient.getStyleGuide(request); + console.log(response); + } + + callGetStyleGuide(); + // [END apihub_v1_generated_LintingService_GetStyleGuide_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/linting_service.get_style_guide_contents.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/linting_service.get_style_guide_contents.js new file mode 100644 index 00000000000..43a14577418 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/linting_service.get_style_guide_contents.js @@ -0,0 +1,64 @@ +// Copyright 2024 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 apihub_v1_generated_LintingService_GetStyleGuideContents_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 name of the StyleGuide whose contents need to be retrieved. + * There is exactly one style guide resource per project per location. + * The expected format is + * `projects/{project}/locations/{location}/plugins/{plugin}/styleGuide`. + */ + // const name = 'abc123' + + // Imports the Apihub library + const {LintingServiceClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new LintingServiceClient(); + + async function callGetStyleGuideContents() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await apihubClient.getStyleGuideContents(request); + console.log(response); + } + + callGetStyleGuideContents(); + // [END apihub_v1_generated_LintingService_GetStyleGuideContents_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/linting_service.lint_spec.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/linting_service.lint_spec.js new file mode 100644 index 00000000000..d1327648d85 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/linting_service.lint_spec.js @@ -0,0 +1,63 @@ +// Copyright 2024 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 apihub_v1_generated_LintingService_LintSpec_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 name of the spec to be linted. + * Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}` + */ + // const name = 'abc123' + + // Imports the Apihub library + const {LintingServiceClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new LintingServiceClient(); + + async function callLintSpec() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await apihubClient.lintSpec(request); + console.log(response); + } + + callLintSpec(); + // [END apihub_v1_generated_LintingService_LintSpec_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/linting_service.update_style_guide.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/linting_service.update_style_guide.js new file mode 100644 index 00000000000..7232754ad9a --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/linting_service.update_style_guide.js @@ -0,0 +1,65 @@ +// Copyright 2024 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(styleGuide) { + // [START apihub_v1_generated_LintingService_UpdateStyleGuide_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 Style guide resource to update. + */ + // const styleGuide = {} + /** + * Optional. The list of fields to update. + */ + // const updateMask = {} + + // Imports the Apihub library + const {LintingServiceClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new LintingServiceClient(); + + async function callUpdateStyleGuide() { + // Construct request + const request = { + styleGuide, + }; + + // Run request + const response = await apihubClient.updateStyleGuide(request); + console.log(response); + } + + callUpdateStyleGuide(); + // [END apihub_v1_generated_LintingService_UpdateStyleGuide_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/provisioning.create_api_hub_instance.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/provisioning.create_api_hub_instance.js new file mode 100644 index 00000000000..2e55a19872d --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/provisioning.create_api_hub_instance.js @@ -0,0 +1,76 @@ +// Copyright 2024 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, apiHubInstance) { + // [START apihub_v1_generated_Provisioning_CreateApiHubInstance_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 parent resource for the Api Hub instance resource. + * Format: `projects/{project}/locations/{location}` + */ + // const parent = 'abc123' + /** + * Optional. Identifier to assign to the Api Hub instance. Must be unique + * within scope of the parent resource. If the field is not provided, system + * generated id will be used. + * This value should be 4-40 characters, and valid characters + * are `/[a-z][A-Z][0-9]-_/`. + */ + // const apiHubInstanceId = 'abc123' + /** + * Required. The ApiHub instance. + */ + // const apiHubInstance = {} + + // Imports the Apihub library + const {ProvisioningClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new ProvisioningClient(); + + async function callCreateApiHubInstance() { + // Construct request + const request = { + parent, + apiHubInstance, + }; + + // Run request + const [operation] = await apihubClient.createApiHubInstance(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateApiHubInstance(); + // [END apihub_v1_generated_Provisioning_CreateApiHubInstance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/provisioning.get_api_hub_instance.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/provisioning.get_api_hub_instance.js new file mode 100644 index 00000000000..a735a2af5a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/provisioning.get_api_hub_instance.js @@ -0,0 +1,63 @@ +// Copyright 2024 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 apihub_v1_generated_Provisioning_GetApiHubInstance_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 name of the Api Hub instance to retrieve. + * Format: + * `projects/{project}/locations/{location}/apiHubInstances/{apiHubInstance}`. + */ + // const name = 'abc123' + + // Imports the Apihub library + const {ProvisioningClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new ProvisioningClient(); + + async function callGetApiHubInstance() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await apihubClient.getApiHubInstance(request); + console.log(response); + } + + callGetApiHubInstance(); + // [END apihub_v1_generated_Provisioning_GetApiHubInstance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/provisioning.lookup_api_hub_instance.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/provisioning.lookup_api_hub_instance.js new file mode 100644 index 00000000000..c521c44746c --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/provisioning.lookup_api_hub_instance.js @@ -0,0 +1,64 @@ +// Copyright 2024 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 apihub_v1_generated_Provisioning_LookupApiHubInstance_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. There will always be only one Api Hub instance for a GCP project + * across all locations. + * The parent resource for the Api Hub instance resource. + * Format: `projects/{project}/locations/{location}` + */ + // const parent = 'abc123' + + // Imports the Apihub library + const {ProvisioningClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new ProvisioningClient(); + + async function callLookupApiHubInstance() { + // Construct request + const request = { + parent, + }; + + // Run request + const response = await apihubClient.lookupApiHubInstance(request); + console.log(response); + } + + callLookupApiHubInstance(); + // [END apihub_v1_generated_Provisioning_LookupApiHubInstance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/runtime_project_attachment_service.create_runtime_project_attachment.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/runtime_project_attachment_service.create_runtime_project_attachment.js new file mode 100644 index 00000000000..031f5a951a5 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/runtime_project_attachment_service.create_runtime_project_attachment.js @@ -0,0 +1,75 @@ +// Copyright 2024 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, runtimeProjectAttachmentId, runtimeProjectAttachment) { + // [START apihub_v1_generated_RuntimeProjectAttachmentService_CreateRuntimeProjectAttachment_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 parent resource for the Runtime Project Attachment. + * Format: `projects/{project}/locations/{location}` + */ + // const parent = 'abc123' + /** + * Required. The ID to use for the Runtime Project Attachment, which will + * become the final component of the Runtime Project Attachment's name. The ID + * must be the same as the project ID of the Google cloud project specified in + * the runtime_project_attachment.runtime_project field. + */ + // const runtimeProjectAttachmentId = 'abc123' + /** + * Required. The Runtime Project Attachment to create. + */ + // const runtimeProjectAttachment = {} + + // Imports the Apihub library + const {RuntimeProjectAttachmentServiceClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new RuntimeProjectAttachmentServiceClient(); + + async function callCreateRuntimeProjectAttachment() { + // Construct request + const request = { + parent, + runtimeProjectAttachmentId, + runtimeProjectAttachment, + }; + + // Run request + const response = await apihubClient.createRuntimeProjectAttachment(request); + console.log(response); + } + + callCreateRuntimeProjectAttachment(); + // [END apihub_v1_generated_RuntimeProjectAttachmentService_CreateRuntimeProjectAttachment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/runtime_project_attachment_service.delete_runtime_project_attachment.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/runtime_project_attachment_service.delete_runtime_project_attachment.js new file mode 100644 index 00000000000..5950ad165a2 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/runtime_project_attachment_service.delete_runtime_project_attachment.js @@ -0,0 +1,63 @@ +// Copyright 2024 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 apihub_v1_generated_RuntimeProjectAttachmentService_DeleteRuntimeProjectAttachment_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 name of the Runtime Project Attachment to delete. + * Format: + * `projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}` + */ + // const name = 'abc123' + + // Imports the Apihub library + const {RuntimeProjectAttachmentServiceClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new RuntimeProjectAttachmentServiceClient(); + + async function callDeleteRuntimeProjectAttachment() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await apihubClient.deleteRuntimeProjectAttachment(request); + console.log(response); + } + + callDeleteRuntimeProjectAttachment(); + // [END apihub_v1_generated_RuntimeProjectAttachmentService_DeleteRuntimeProjectAttachment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/runtime_project_attachment_service.get_runtime_project_attachment.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/runtime_project_attachment_service.get_runtime_project_attachment.js new file mode 100644 index 00000000000..1f4bacb7174 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/runtime_project_attachment_service.get_runtime_project_attachment.js @@ -0,0 +1,63 @@ +// Copyright 2024 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 apihub_v1_generated_RuntimeProjectAttachmentService_GetRuntimeProjectAttachment_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 name of the API resource to retrieve. + * Format: + * `projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}` + */ + // const name = 'abc123' + + // Imports the Apihub library + const {RuntimeProjectAttachmentServiceClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new RuntimeProjectAttachmentServiceClient(); + + async function callGetRuntimeProjectAttachment() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await apihubClient.getRuntimeProjectAttachment(request); + console.log(response); + } + + callGetRuntimeProjectAttachment(); + // [END apihub_v1_generated_RuntimeProjectAttachmentService_GetRuntimeProjectAttachment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/runtime_project_attachment_service.list_runtime_project_attachments.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/runtime_project_attachment_service.list_runtime_project_attachments.js new file mode 100644 index 00000000000..fc112de47b2 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/runtime_project_attachment_service.list_runtime_project_attachments.js @@ -0,0 +1,100 @@ +// Copyright 2024 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 apihub_v1_generated_RuntimeProjectAttachmentService_ListRuntimeProjectAttachments_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 parent, which owns this collection of runtime project + * attachments. Format: `projects/{project}/locations/{location}` + */ + // const parent = 'abc123' + /** + * Optional. The maximum number of runtime project attachments to return. The + * service may return fewer than this value. If unspecified, at most 50 + * runtime project attachments will be returned. The maximum value is 1000; + * values above 1000 will be coerced to 1000. + */ + // const pageSize = 1234 + /** + * Optional. A page token, received from a previous + * `ListRuntimeProjectAttachments` call. Provide this to retrieve the + * subsequent page. + * When paginating, all other parameters (except page_size) provided to + * `ListRuntimeProjectAttachments` must match the call that provided the page + * token. + */ + // const pageToken = 'abc123' + /** + * Optional. An expression that filters the list of RuntimeProjectAttachments. + * A filter expression consists of a field name, a comparison + * operator, and a value for filtering. The value must be a string. All + * standard operators as documented at https://google.aip.dev/160 are + * supported. + * The following fields in the `RuntimeProjectAttachment` are eligible for + * filtering: + * * `name` - The name of the RuntimeProjectAttachment. + * * `create_time` - The time at which the RuntimeProjectAttachment was + * created. The value should be in the + * (RFC3339)https://tools.ietf.org/html/rfc3339 format. + * * `runtime_project` - The Google cloud project associated with the + * RuntimeProjectAttachment. + */ + // const filter = 'abc123' + /** + * Optional. Hint for how to order the results. + */ + // const orderBy = 'abc123' + + // Imports the Apihub library + const {RuntimeProjectAttachmentServiceClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new RuntimeProjectAttachmentServiceClient(); + + async function callListRuntimeProjectAttachments() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = apihubClient.listRuntimeProjectAttachmentsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListRuntimeProjectAttachments(); + // [END apihub_v1_generated_RuntimeProjectAttachmentService_ListRuntimeProjectAttachments_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/runtime_project_attachment_service.lookup_runtime_project_attachment.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/runtime_project_attachment_service.lookup_runtime_project_attachment.js new file mode 100644 index 00000000000..0fb18901145 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/runtime_project_attachment_service.lookup_runtime_project_attachment.js @@ -0,0 +1,63 @@ +// Copyright 2024 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 apihub_v1_generated_RuntimeProjectAttachmentService_LookupRuntimeProjectAttachment_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. Runtime project ID to look up runtime project attachment for. + * Lookup happens across all regions. Expected format: + * `projects/{project}/locations/{location}`. + */ + // const name = 'abc123' + + // Imports the Apihub library + const {RuntimeProjectAttachmentServiceClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new RuntimeProjectAttachmentServiceClient(); + + async function callLookupRuntimeProjectAttachment() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await apihubClient.lookupRuntimeProjectAttachment(request); + console.log(response); + } + + callLookupRuntimeProjectAttachment(); + // [END apihub_v1_generated_RuntimeProjectAttachmentService_LookupRuntimeProjectAttachment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/snippet_metadata_google.cloud.apihub.v1.json b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/snippet_metadata_google.cloud.apihub.v1.json new file mode 100644 index 00000000000..9690b6949f7 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/snippet_metadata_google.cloud.apihub.v1.json @@ -0,0 +1,2595 @@ +{ + "clientLibrary": { + "name": "nodejs-apihub", + "version": "0.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.apihub.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "regionTag": "apihub_v1_generated_ApiHub_CreateApi_async", + "title": "ApiHub createApi Sample", + "origin": "API_DEFINITION", + "description": " Create an API resource in the API hub. Once an API resource is created, versions can be added to it.", + "canonical": true, + "file": "api_hub.create_api.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateApi", + "fullName": "google.cloud.apihub.v1.ApiHub.CreateApi", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "api_id", + "type": "TYPE_STRING" + }, + { + "name": "api", + "type": ".google.cloud.apihub.v1.Api" + } + ], + "resultType": ".google.cloud.apihub.v1.Api", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "CreateApi", + "fullName": "google.cloud.apihub.v1.ApiHub.CreateApi", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_GetApi_async", + "title": "ApiHub getApi Sample", + "origin": "API_DEFINITION", + "description": " Get API resource details including the API versions contained in it.", + "canonical": true, + "file": "api_hub.get_api.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetApi", + "fullName": "google.cloud.apihub.v1.ApiHub.GetApi", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apihub.v1.Api", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "GetApi", + "fullName": "google.cloud.apihub.v1.ApiHub.GetApi", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_ListApis_async", + "title": "ApiHub listApis Sample", + "origin": "API_DEFINITION", + "description": " List API resources in the API hub.", + "canonical": true, + "file": "api_hub.list_apis.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 138, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListApis", + "fullName": "google.cloud.apihub.v1.ApiHub.ListApis", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apihub.v1.ListApisResponse", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "ListApis", + "fullName": "google.cloud.apihub.v1.ApiHub.ListApis", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_UpdateApi_async", + "title": "ApiHub updateApi Sample", + "origin": "API_DEFINITION", + "description": " Update an API resource in the API hub. The following fields in the [API][] can be updated: * [display_name][google.cloud.apihub.v1.Api.display_name] * [description][google.cloud.apihub.v1.Api.description] * [owner][google.cloud.apihub.v1.Api.owner] * [documentation][google.cloud.apihub.v1.Api.documentation] * [target_user][google.cloud.apihub.v1.Api.target_user] * [team][google.cloud.apihub.v1.Api.team] * [business_unit][google.cloud.apihub.v1.Api.business_unit] * [maturity_level][google.cloud.apihub.v1.Api.maturity_level] * [attributes][google.cloud.apihub.v1.Api.attributes] The [update_mask][google.cloud.apihub.v1.UpdateApiRequest.update_mask] should be used to specify the fields being updated. Updating the owner field requires complete owner message and updates both owner and email fields.", + "canonical": true, + "file": "api_hub.update_api.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateApi", + "fullName": "google.cloud.apihub.v1.ApiHub.UpdateApi", + "async": true, + "parameters": [ + { + "name": "api", + "type": ".google.cloud.apihub.v1.Api" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.apihub.v1.Api", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "UpdateApi", + "fullName": "google.cloud.apihub.v1.ApiHub.UpdateApi", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_DeleteApi_async", + "title": "ApiHub deleteApi Sample", + "origin": "API_DEFINITION", + "description": " Delete an API resource in the API hub. API can only be deleted if all underlying versions are deleted.", + "canonical": true, + "file": "api_hub.delete_api.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteApi", + "fullName": "google.cloud.apihub.v1.ApiHub.DeleteApi", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "force", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "DeleteApi", + "fullName": "google.cloud.apihub.v1.ApiHub.DeleteApi", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_CreateVersion_async", + "title": "ApiHub createVersion Sample", + "origin": "API_DEFINITION", + "description": " Create an API version for an API resource in the API hub.", + "canonical": true, + "file": "api_hub.create_version.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateVersion", + "fullName": "google.cloud.apihub.v1.ApiHub.CreateVersion", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "version_id", + "type": "TYPE_STRING" + }, + { + "name": "version", + "type": ".google.cloud.apihub.v1.Version" + } + ], + "resultType": ".google.cloud.apihub.v1.Version", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "CreateVersion", + "fullName": "google.cloud.apihub.v1.ApiHub.CreateVersion", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_GetVersion_async", + "title": "ApiHub getVersion Sample", + "origin": "API_DEFINITION", + "description": " Get details about the API version of an API resource. This will include information about the specs and operations present in the API version as well as the deployments linked to it.", + "canonical": true, + "file": "api_hub.get_version.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetVersion", + "fullName": "google.cloud.apihub.v1.ApiHub.GetVersion", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apihub.v1.Version", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "GetVersion", + "fullName": "google.cloud.apihub.v1.ApiHub.GetVersion", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_ListVersions_async", + "title": "ApiHub listVersions Sample", + "origin": "API_DEFINITION", + "description": " List API versions of an API resource in the API hub.", + "canonical": true, + "file": "api_hub.list_versions.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 126, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListVersions", + "fullName": "google.cloud.apihub.v1.ApiHub.ListVersions", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apihub.v1.ListVersionsResponse", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "ListVersions", + "fullName": "google.cloud.apihub.v1.ApiHub.ListVersions", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_UpdateVersion_async", + "title": "ApiHub updateVersion Sample", + "origin": "API_DEFINITION", + "description": " Update API version. The following fields in the [version][google.cloud.apihub.v1.Version] can be updated currently: * [display_name][google.cloud.apihub.v1.Version.display_name] * [description][google.cloud.apihub.v1.Version.description] * [documentation][google.cloud.apihub.v1.Version.documentation] * [deployments][google.cloud.apihub.v1.Version.deployments] * [lifecycle][google.cloud.apihub.v1.Version.lifecycle] * [compliance][google.cloud.apihub.v1.Version.compliance] * [accreditation][google.cloud.apihub.v1.Version.accreditation] * [attributes][google.cloud.apihub.v1.Version.attributes] The [update_mask][google.cloud.apihub.v1.UpdateVersionRequest.update_mask] should be used to specify the fields being updated.", + "canonical": true, + "file": "api_hub.update_version.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateVersion", + "fullName": "google.cloud.apihub.v1.ApiHub.UpdateVersion", + "async": true, + "parameters": [ + { + "name": "version", + "type": ".google.cloud.apihub.v1.Version" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.apihub.v1.Version", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "UpdateVersion", + "fullName": "google.cloud.apihub.v1.ApiHub.UpdateVersion", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_DeleteVersion_async", + "title": "ApiHub deleteVersion Sample", + "origin": "API_DEFINITION", + "description": " Delete an API version. Version can only be deleted if all underlying specs, operations, definitions and linked deployments are deleted.", + "canonical": true, + "file": "api_hub.delete_version.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteVersion", + "fullName": "google.cloud.apihub.v1.ApiHub.DeleteVersion", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "force", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "DeleteVersion", + "fullName": "google.cloud.apihub.v1.ApiHub.DeleteVersion", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_CreateSpec_async", + "title": "ApiHub createSpec Sample", + "origin": "API_DEFINITION", + "description": " Add a spec to an API version in the API hub. Multiple specs can be added to an API version. Note, while adding a spec, at least one of `contents` or `source_uri` must be provided. If `contents` is provided, then `spec_type` must also be provided. On adding a spec with contents to the version, the operations present in it will be added to the version.Note that the file contents in the spec should be of the same type as defined in the `projects/{project}/locations/{location}/attributes/system-spec-type` attribute associated with spec resource. Note that specs of various types can be uploaded, however parsing of details is supported for OpenAPI spec currently. In order to access the information parsed from the spec, use the [GetSpec][google.cloud.apihub.v1.ApiHub.GetSpec] method. In order to access the raw contents for a particular spec, use the [GetSpecContents][google.cloud.apihub.v1.ApiHub.GetSpecContents] method. In order to access the operations parsed from the spec, use the [ListAPIOperations][google.cloud.apihub.v1.ApiHub.ListApiOperations] method.", + "canonical": true, + "file": "api_hub.create_spec.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 71, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateSpec", + "fullName": "google.cloud.apihub.v1.ApiHub.CreateSpec", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "spec_id", + "type": "TYPE_STRING" + }, + { + "name": "spec", + "type": ".google.cloud.apihub.v1.Spec" + } + ], + "resultType": ".google.cloud.apihub.v1.Spec", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "CreateSpec", + "fullName": "google.cloud.apihub.v1.ApiHub.CreateSpec", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_GetSpec_async", + "title": "ApiHub getSpec Sample", + "origin": "API_DEFINITION", + "description": " Get details about the information parsed from a spec. Note that this method does not return the raw spec contents. Use [GetSpecContents][google.cloud.apihub.v1.ApiHub.GetSpecContents] method to retrieve the same.", + "canonical": true, + "file": "api_hub.get_spec.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetSpec", + "fullName": "google.cloud.apihub.v1.ApiHub.GetSpec", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apihub.v1.Spec", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "GetSpec", + "fullName": "google.cloud.apihub.v1.ApiHub.GetSpec", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_GetSpecContents_async", + "title": "ApiHub getSpecContents Sample", + "origin": "API_DEFINITION", + "description": " Get spec contents.", + "canonical": true, + "file": "api_hub.get_spec_contents.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetSpecContents", + "fullName": "google.cloud.apihub.v1.ApiHub.GetSpecContents", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apihub.v1.SpecContents", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "GetSpecContents", + "fullName": "google.cloud.apihub.v1.ApiHub.GetSpecContents", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_ListSpecs_async", + "title": "ApiHub listSpecs Sample", + "origin": "API_DEFINITION", + "description": " List specs corresponding to a particular API resource.", + "canonical": true, + "file": "api_hub.list_specs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 119, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListSpecs", + "fullName": "google.cloud.apihub.v1.ApiHub.ListSpecs", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apihub.v1.ListSpecsResponse", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "ListSpecs", + "fullName": "google.cloud.apihub.v1.ApiHub.ListSpecs", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_UpdateSpec_async", + "title": "ApiHub updateSpec Sample", + "origin": "API_DEFINITION", + "description": " Update spec. The following fields in the [spec][google.cloud.apihub.v1.Spec] can be updated: * [display_name][google.cloud.apihub.v1.Spec.display_name] * [source_uri][google.cloud.apihub.v1.Spec.source_uri] * [lint_response][google.cloud.apihub.v1.Spec.lint_response] * [attributes][google.cloud.apihub.v1.Spec.attributes] * [contents][google.cloud.apihub.v1.Spec.contents] * [spec_type][google.cloud.apihub.v1.Spec.spec_type] In case of an OAS spec, updating spec contents can lead to: 1. Creation, deletion and update of operations. 2. Creation, deletion and update of definitions. 3. Update of other info parsed out from the new spec. In case of contents or source_uri being present in update mask, spec_type must also be present. Also, spec_type can not be present in update mask if contents or source_uri is not present. The [update_mask][google.cloud.apihub.v1.UpdateSpecRequest.update_mask] should be used to specify the fields being updated.", + "canonical": true, + "file": "api_hub.update_spec.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateSpec", + "fullName": "google.cloud.apihub.v1.ApiHub.UpdateSpec", + "async": true, + "parameters": [ + { + "name": "spec", + "type": ".google.cloud.apihub.v1.Spec" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.apihub.v1.Spec", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "UpdateSpec", + "fullName": "google.cloud.apihub.v1.ApiHub.UpdateSpec", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_DeleteSpec_async", + "title": "ApiHub deleteSpec Sample", + "origin": "API_DEFINITION", + "description": " Delete a spec. Deleting a spec will also delete the associated operations from the version.", + "canonical": true, + "file": "api_hub.delete_spec.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteSpec", + "fullName": "google.cloud.apihub.v1.ApiHub.DeleteSpec", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "DeleteSpec", + "fullName": "google.cloud.apihub.v1.ApiHub.DeleteSpec", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_GetApiOperation_async", + "title": "ApiHub getApiOperation Sample", + "origin": "API_DEFINITION", + "description": " Get details about a particular operation in API version.", + "canonical": true, + "file": "api_hub.get_api_operation.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetApiOperation", + "fullName": "google.cloud.apihub.v1.ApiHub.GetApiOperation", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apihub.v1.ApiOperation", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "GetApiOperation", + "fullName": "google.cloud.apihub.v1.ApiHub.GetApiOperation", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_ListApiOperations_async", + "title": "ApiHub listApiOperations Sample", + "origin": "API_DEFINITION", + "description": " List operations in an API version.", + "canonical": true, + "file": "api_hub.list_api_operations.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 109, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListApiOperations", + "fullName": "google.cloud.apihub.v1.ApiHub.ListApiOperations", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apihub.v1.ListApiOperationsResponse", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "ListApiOperations", + "fullName": "google.cloud.apihub.v1.ApiHub.ListApiOperations", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_GetDefinition_async", + "title": "ApiHub getDefinition Sample", + "origin": "API_DEFINITION", + "description": " Get details about a definition in an API version.", + "canonical": true, + "file": "api_hub.get_definition.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetDefinition", + "fullName": "google.cloud.apihub.v1.ApiHub.GetDefinition", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apihub.v1.Definition", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "GetDefinition", + "fullName": "google.cloud.apihub.v1.ApiHub.GetDefinition", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_CreateDeployment_async", + "title": "ApiHub createDeployment Sample", + "origin": "API_DEFINITION", + "description": " Create a deployment resource in the API hub. Once a deployment resource is created, it can be associated with API versions.", + "canonical": true, + "file": "api_hub.create_deployment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 70, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateDeployment", + "fullName": "google.cloud.apihub.v1.ApiHub.CreateDeployment", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "deployment_id", + "type": "TYPE_STRING" + }, + { + "name": "deployment", + "type": ".google.cloud.apihub.v1.Deployment" + } + ], + "resultType": ".google.cloud.apihub.v1.Deployment", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "CreateDeployment", + "fullName": "google.cloud.apihub.v1.ApiHub.CreateDeployment", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_GetDeployment_async", + "title": "ApiHub getDeployment Sample", + "origin": "API_DEFINITION", + "description": " Get details about a deployment and the API versions linked to it.", + "canonical": true, + "file": "api_hub.get_deployment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetDeployment", + "fullName": "google.cloud.apihub.v1.ApiHub.GetDeployment", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apihub.v1.Deployment", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "GetDeployment", + "fullName": "google.cloud.apihub.v1.ApiHub.GetDeployment", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_ListDeployments_async", + "title": "ApiHub listDeployments Sample", + "origin": "API_DEFINITION", + "description": " List deployment resources in the API hub.", + "canonical": true, + "file": "api_hub.list_deployments.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 125, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListDeployments", + "fullName": "google.cloud.apihub.v1.ApiHub.ListDeployments", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apihub.v1.ListDeploymentsResponse", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "ListDeployments", + "fullName": "google.cloud.apihub.v1.ApiHub.ListDeployments", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_UpdateDeployment_async", + "title": "ApiHub updateDeployment Sample", + "origin": "API_DEFINITION", + "description": " Update a deployment resource in the API hub. The following fields in the [deployment resource][google.cloud.apihub.v1.Deployment] can be updated: * [display_name][google.cloud.apihub.v1.Deployment.display_name] * [description][google.cloud.apihub.v1.Deployment.description] * [documentation][google.cloud.apihub.v1.Deployment.documentation] * [deployment_type][google.cloud.apihub.v1.Deployment.deployment_type] * [resource_uri][google.cloud.apihub.v1.Deployment.resource_uri] * [endpoints][google.cloud.apihub.v1.Deployment.endpoints] * [slo][google.cloud.apihub.v1.Deployment.slo] * [environment][google.cloud.apihub.v1.Deployment.environment] * [attributes][google.cloud.apihub.v1.Deployment.attributes] The [update_mask][google.cloud.apihub.v1.UpdateDeploymentRequest.update_mask] should be used to specify the fields being updated.", + "canonical": true, + "file": "api_hub.update_deployment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateDeployment", + "fullName": "google.cloud.apihub.v1.ApiHub.UpdateDeployment", + "async": true, + "parameters": [ + { + "name": "deployment", + "type": ".google.cloud.apihub.v1.Deployment" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.apihub.v1.Deployment", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "UpdateDeployment", + "fullName": "google.cloud.apihub.v1.ApiHub.UpdateDeployment", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_DeleteDeployment_async", + "title": "ApiHub deleteDeployment Sample", + "origin": "API_DEFINITION", + "description": " Delete a deployment resource in the API hub.", + "canonical": true, + "file": "api_hub.delete_deployment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteDeployment", + "fullName": "google.cloud.apihub.v1.ApiHub.DeleteDeployment", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "DeleteDeployment", + "fullName": "google.cloud.apihub.v1.ApiHub.DeleteDeployment", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_CreateAttribute_async", + "title": "ApiHub createAttribute Sample", + "origin": "API_DEFINITION", + "description": " Create a user defined attribute. Certain pre defined attributes are already created by the API hub. These attributes will have type as `SYSTEM_DEFINED` and can be listed via [ListAttributes][google.cloud.apihub.v1.ApiHub.ListAttributes] method. Allowed values for the same can be updated via [UpdateAttribute][google.cloud.apihub.v1.ApiHub.UpdateAttribute] method.", + "canonical": true, + "file": "api_hub.create_attribute.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 70, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateAttribute", + "fullName": "google.cloud.apihub.v1.ApiHub.CreateAttribute", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "attribute_id", + "type": "TYPE_STRING" + }, + { + "name": "attribute", + "type": ".google.cloud.apihub.v1.Attribute" + } + ], + "resultType": ".google.cloud.apihub.v1.Attribute", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "CreateAttribute", + "fullName": "google.cloud.apihub.v1.ApiHub.CreateAttribute", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_GetAttribute_async", + "title": "ApiHub getAttribute Sample", + "origin": "API_DEFINITION", + "description": " Get details about the attribute.", + "canonical": true, + "file": "api_hub.get_attribute.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetAttribute", + "fullName": "google.cloud.apihub.v1.ApiHub.GetAttribute", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apihub.v1.Attribute", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "GetAttribute", + "fullName": "google.cloud.apihub.v1.ApiHub.GetAttribute", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_UpdateAttribute_async", + "title": "ApiHub updateAttribute Sample", + "origin": "API_DEFINITION", + "description": " Update the attribute. The following fields in the [Attribute resource][google.cloud.apihub.v1.Attribute] can be updated: * [display_name][google.cloud.apihub.v1.Attribute.display_name] The display name can be updated for user defined attributes only. * [description][google.cloud.apihub.v1.Attribute.description] The description can be updated for user defined attributes only. * [allowed_values][google.cloud.apihub.v1.Attribute.allowed_values] To update the list of allowed values, clients need to use the fetched list of allowed values and add or remove values to or from the same list. The mutable allowed values can be updated for both user defined and System defined attributes. The immutable allowed values cannot be updated or deleted. The updated list of allowed values cannot be empty. If an allowed value that is already used by some resource's attribute is deleted, then the association between the resource and the attribute value will also be deleted. * [cardinality][google.cloud.apihub.v1.Attribute.cardinality] The cardinality can be updated for user defined attributes only. Cardinality can only be increased during an update. The [update_mask][google.cloud.apihub.v1.UpdateAttributeRequest.update_mask] should be used to specify the fields being updated.", + "canonical": true, + "file": "api_hub.update_attribute.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateAttribute", + "fullName": "google.cloud.apihub.v1.ApiHub.UpdateAttribute", + "async": true, + "parameters": [ + { + "name": "attribute", + "type": ".google.cloud.apihub.v1.Attribute" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.apihub.v1.Attribute", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "UpdateAttribute", + "fullName": "google.cloud.apihub.v1.ApiHub.UpdateAttribute", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_DeleteAttribute_async", + "title": "ApiHub deleteAttribute Sample", + "origin": "API_DEFINITION", + "description": " Delete an attribute. Note: System defined attributes cannot be deleted. All associations of the attribute being deleted with any API hub resource will also get deleted.", + "canonical": true, + "file": "api_hub.delete_attribute.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteAttribute", + "fullName": "google.cloud.apihub.v1.ApiHub.DeleteAttribute", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "DeleteAttribute", + "fullName": "google.cloud.apihub.v1.ApiHub.DeleteAttribute", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_ListAttributes_async", + "title": "ApiHub listAttributes Sample", + "origin": "API_DEFINITION", + "description": " List all attributes.", + "canonical": true, + "file": "api_hub.list_attributes.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 110, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListAttributes", + "fullName": "google.cloud.apihub.v1.ApiHub.ListAttributes", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apihub.v1.ListAttributesResponse", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "ListAttributes", + "fullName": "google.cloud.apihub.v1.ApiHub.ListAttributes", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_SearchResources_async", + "title": "ApiHub searchResources Sample", + "origin": "API_DEFINITION", + "description": " Search across API-Hub resources.", + "canonical": true, + "file": "api_hub.search_resources.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 100, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SearchResources", + "fullName": "google.cloud.apihub.v1.ApiHub.SearchResources", + "async": true, + "parameters": [ + { + "name": "location", + "type": "TYPE_STRING" + }, + { + "name": "query", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apihub.v1.SearchResourcesResponse", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "SearchResources", + "fullName": "google.cloud.apihub.v1.ApiHub.SearchResources", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_CreateExternalApi_async", + "title": "ApiHub createExternalApi Sample", + "origin": "API_DEFINITION", + "description": " Create an External API resource in the API hub.", + "canonical": true, + "file": "api_hub.create_external_api.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 71, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateExternalApi", + "fullName": "google.cloud.apihub.v1.ApiHub.CreateExternalApi", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "external_api_id", + "type": "TYPE_STRING" + }, + { + "name": "external_api", + "type": ".google.cloud.apihub.v1.ExternalApi" + } + ], + "resultType": ".google.cloud.apihub.v1.ExternalApi", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "CreateExternalApi", + "fullName": "google.cloud.apihub.v1.ApiHub.CreateExternalApi", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_GetExternalApi_async", + "title": "ApiHub getExternalApi Sample", + "origin": "API_DEFINITION", + "description": " Get details about an External API resource in the API hub.", + "canonical": true, + "file": "api_hub.get_external_api.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetExternalApi", + "fullName": "google.cloud.apihub.v1.ApiHub.GetExternalApi", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apihub.v1.ExternalApi", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "GetExternalApi", + "fullName": "google.cloud.apihub.v1.ApiHub.GetExternalApi", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_UpdateExternalApi_async", + "title": "ApiHub updateExternalApi Sample", + "origin": "API_DEFINITION", + "description": " Update an External API resource in the API hub. The following fields can be updated: * [display_name][google.cloud.apihub.v1.ExternalApi.display_name] * [description][google.cloud.apihub.v1.ExternalApi.description] * [documentation][google.cloud.apihub.v1.ExternalApi.documentation] * [endpoints][google.cloud.apihub.v1.ExternalApi.endpoints] * [paths][google.cloud.apihub.v1.ExternalApi.paths] The [update_mask][google.cloud.apihub.v1.UpdateExternalApiRequest.update_mask] should be used to specify the fields being updated.", + "canonical": true, + "file": "api_hub.update_external_api.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateExternalApi", + "fullName": "google.cloud.apihub.v1.ApiHub.UpdateExternalApi", + "async": true, + "parameters": [ + { + "name": "external_api", + "type": ".google.cloud.apihub.v1.ExternalApi" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.apihub.v1.ExternalApi", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "UpdateExternalApi", + "fullName": "google.cloud.apihub.v1.ApiHub.UpdateExternalApi", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_DeleteExternalApi_async", + "title": "ApiHub deleteExternalApi Sample", + "origin": "API_DEFINITION", + "description": " Delete an External API resource in the API hub.", + "canonical": true, + "file": "api_hub.delete_external_api.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteExternalApi", + "fullName": "google.cloud.apihub.v1.ApiHub.DeleteExternalApi", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "DeleteExternalApi", + "fullName": "google.cloud.apihub.v1.ApiHub.DeleteExternalApi", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_ListExternalApis_async", + "title": "ApiHub listExternalApis Sample", + "origin": "API_DEFINITION", + "description": " List External API resources in the API hub.", + "canonical": true, + "file": "api_hub.list_external_apis.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 70, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListExternalApis", + "fullName": "google.cloud.apihub.v1.ApiHub.ListExternalApis", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apihub.v1.ListExternalApisResponse", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "ListExternalApis", + "fullName": "google.cloud.apihub.v1.ApiHub.ListExternalApis", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHubDependencies_CreateDependency_async", + "title": "ApiHub createDependency Sample", + "origin": "API_DEFINITION", + "description": " Create a dependency between two entities in the API hub.", + "canonical": true, + "file": "api_hub_dependencies.create_dependency.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateDependency", + "fullName": "google.cloud.apihub.v1.ApiHubDependencies.CreateDependency", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "dependency_id", + "type": "TYPE_STRING" + }, + { + "name": "dependency", + "type": ".google.cloud.apihub.v1.Dependency" + } + ], + "resultType": ".google.cloud.apihub.v1.Dependency", + "client": { + "shortName": "ApiHubDependenciesClient", + "fullName": "google.cloud.apihub.v1.ApiHubDependenciesClient" + }, + "method": { + "shortName": "CreateDependency", + "fullName": "google.cloud.apihub.v1.ApiHubDependencies.CreateDependency", + "service": { + "shortName": "ApiHubDependencies", + "fullName": "google.cloud.apihub.v1.ApiHubDependencies" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHubDependencies_GetDependency_async", + "title": "ApiHub getDependency Sample", + "origin": "API_DEFINITION", + "description": " Get details about a dependency resource in the API hub.", + "canonical": true, + "file": "api_hub_dependencies.get_dependency.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetDependency", + "fullName": "google.cloud.apihub.v1.ApiHubDependencies.GetDependency", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apihub.v1.Dependency", + "client": { + "shortName": "ApiHubDependenciesClient", + "fullName": "google.cloud.apihub.v1.ApiHubDependenciesClient" + }, + "method": { + "shortName": "GetDependency", + "fullName": "google.cloud.apihub.v1.ApiHubDependencies.GetDependency", + "service": { + "shortName": "ApiHubDependencies", + "fullName": "google.cloud.apihub.v1.ApiHubDependencies" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHubDependencies_UpdateDependency_async", + "title": "ApiHub updateDependency Sample", + "origin": "API_DEFINITION", + "description": " Update a dependency based on the [update_mask][google.cloud.apihub.v1.UpdateDependencyRequest.update_mask] provided in the request. The following fields in the [dependency][google.cloud.apihub.v1.Dependency] can be updated: * [description][google.cloud.apihub.v1.Dependency.description]", + "canonical": true, + "file": "api_hub_dependencies.update_dependency.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateDependency", + "fullName": "google.cloud.apihub.v1.ApiHubDependencies.UpdateDependency", + "async": true, + "parameters": [ + { + "name": "dependency", + "type": ".google.cloud.apihub.v1.Dependency" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.apihub.v1.Dependency", + "client": { + "shortName": "ApiHubDependenciesClient", + "fullName": "google.cloud.apihub.v1.ApiHubDependenciesClient" + }, + "method": { + "shortName": "UpdateDependency", + "fullName": "google.cloud.apihub.v1.ApiHubDependencies.UpdateDependency", + "service": { + "shortName": "ApiHubDependencies", + "fullName": "google.cloud.apihub.v1.ApiHubDependencies" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHubDependencies_DeleteDependency_async", + "title": "ApiHub deleteDependency Sample", + "origin": "API_DEFINITION", + "description": " Delete the dependency resource.", + "canonical": true, + "file": "api_hub_dependencies.delete_dependency.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteDependency", + "fullName": "google.cloud.apihub.v1.ApiHubDependencies.DeleteDependency", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "ApiHubDependenciesClient", + "fullName": "google.cloud.apihub.v1.ApiHubDependenciesClient" + }, + "method": { + "shortName": "DeleteDependency", + "fullName": "google.cloud.apihub.v1.ApiHubDependencies.DeleteDependency", + "service": { + "shortName": "ApiHubDependencies", + "fullName": "google.cloud.apihub.v1.ApiHubDependencies" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHubDependencies_ListDependencies_async", + "title": "ApiHub listDependencies Sample", + "origin": "API_DEFINITION", + "description": " List dependencies based on the provided filter and pagination parameters.", + "canonical": true, + "file": "api_hub_dependencies.list_dependencies.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 102, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListDependencies", + "fullName": "google.cloud.apihub.v1.ApiHubDependencies.ListDependencies", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apihub.v1.ListDependenciesResponse", + "client": { + "shortName": "ApiHubDependenciesClient", + "fullName": "google.cloud.apihub.v1.ApiHubDependenciesClient" + }, + "method": { + "shortName": "ListDependencies", + "fullName": "google.cloud.apihub.v1.ApiHubDependencies.ListDependencies", + "service": { + "shortName": "ApiHubDependencies", + "fullName": "google.cloud.apihub.v1.ApiHubDependencies" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHubPlugin_GetPlugin_async", + "title": "ApiHub getPlugin Sample", + "origin": "API_DEFINITION", + "description": " Get details about an API Hub plugin.", + "canonical": true, + "file": "api_hub_plugin.get_plugin.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetPlugin", + "fullName": "google.cloud.apihub.v1.ApiHubPlugin.GetPlugin", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apihub.v1.Plugin", + "client": { + "shortName": "ApiHubPluginClient", + "fullName": "google.cloud.apihub.v1.ApiHubPluginClient" + }, + "method": { + "shortName": "GetPlugin", + "fullName": "google.cloud.apihub.v1.ApiHubPlugin.GetPlugin", + "service": { + "shortName": "ApiHubPlugin", + "fullName": "google.cloud.apihub.v1.ApiHubPlugin" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHubPlugin_EnablePlugin_async", + "title": "ApiHub enablePlugin Sample", + "origin": "API_DEFINITION", + "description": " Enables a plugin. The `state` of the plugin after enabling is `ENABLED`", + "canonical": true, + "file": "api_hub_plugin.enable_plugin.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "EnablePlugin", + "fullName": "google.cloud.apihub.v1.ApiHubPlugin.EnablePlugin", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apihub.v1.Plugin", + "client": { + "shortName": "ApiHubPluginClient", + "fullName": "google.cloud.apihub.v1.ApiHubPluginClient" + }, + "method": { + "shortName": "EnablePlugin", + "fullName": "google.cloud.apihub.v1.ApiHubPlugin.EnablePlugin", + "service": { + "shortName": "ApiHubPlugin", + "fullName": "google.cloud.apihub.v1.ApiHubPlugin" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHubPlugin_DisablePlugin_async", + "title": "ApiHub disablePlugin Sample", + "origin": "API_DEFINITION", + "description": " Disables a plugin. The `state` of the plugin after disabling is `DISABLED`", + "canonical": true, + "file": "api_hub_plugin.disable_plugin.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DisablePlugin", + "fullName": "google.cloud.apihub.v1.ApiHubPlugin.DisablePlugin", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apihub.v1.Plugin", + "client": { + "shortName": "ApiHubPluginClient", + "fullName": "google.cloud.apihub.v1.ApiHubPluginClient" + }, + "method": { + "shortName": "DisablePlugin", + "fullName": "google.cloud.apihub.v1.ApiHubPlugin.DisablePlugin", + "service": { + "shortName": "ApiHubPlugin", + "fullName": "google.cloud.apihub.v1.ApiHubPlugin" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_HostProjectRegistrationService_CreateHostProjectRegistration_async", + "title": "ApiHub createHostProjectRegistration Sample", + "origin": "API_DEFINITION", + "description": " Create a host project registration. A Google cloud project can be registered as a host project if it is not attached as a runtime project to another host project. A project can be registered as a host project only once. Subsequent register calls for the same project will fail.", + "canonical": true, + "file": "host_project_registration_service.create_host_project_registration.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateHostProjectRegistration", + "fullName": "google.cloud.apihub.v1.HostProjectRegistrationService.CreateHostProjectRegistration", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "host_project_registration_id", + "type": "TYPE_STRING" + }, + { + "name": "host_project_registration", + "type": ".google.cloud.apihub.v1.HostProjectRegistration" + } + ], + "resultType": ".google.cloud.apihub.v1.HostProjectRegistration", + "client": { + "shortName": "HostProjectRegistrationServiceClient", + "fullName": "google.cloud.apihub.v1.HostProjectRegistrationServiceClient" + }, + "method": { + "shortName": "CreateHostProjectRegistration", + "fullName": "google.cloud.apihub.v1.HostProjectRegistrationService.CreateHostProjectRegistration", + "service": { + "shortName": "HostProjectRegistrationService", + "fullName": "google.cloud.apihub.v1.HostProjectRegistrationService" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_HostProjectRegistrationService_GetHostProjectRegistration_async", + "title": "ApiHub getHostProjectRegistration Sample", + "origin": "API_DEFINITION", + "description": " Get a host project registration.", + "canonical": true, + "file": "host_project_registration_service.get_host_project_registration.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetHostProjectRegistration", + "fullName": "google.cloud.apihub.v1.HostProjectRegistrationService.GetHostProjectRegistration", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apihub.v1.HostProjectRegistration", + "client": { + "shortName": "HostProjectRegistrationServiceClient", + "fullName": "google.cloud.apihub.v1.HostProjectRegistrationServiceClient" + }, + "method": { + "shortName": "GetHostProjectRegistration", + "fullName": "google.cloud.apihub.v1.HostProjectRegistrationService.GetHostProjectRegistration", + "service": { + "shortName": "HostProjectRegistrationService", + "fullName": "google.cloud.apihub.v1.HostProjectRegistrationService" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_HostProjectRegistrationService_ListHostProjectRegistrations_async", + "title": "ApiHub listHostProjectRegistrations Sample", + "origin": "API_DEFINITION", + "description": " Lists host project registrations.", + "canonical": true, + "file": "host_project_registration_service.list_host_project_registrations.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 92, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListHostProjectRegistrations", + "fullName": "google.cloud.apihub.v1.HostProjectRegistrationService.ListHostProjectRegistrations", + "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" + } + ], + "resultType": ".google.cloud.apihub.v1.ListHostProjectRegistrationsResponse", + "client": { + "shortName": "HostProjectRegistrationServiceClient", + "fullName": "google.cloud.apihub.v1.HostProjectRegistrationServiceClient" + }, + "method": { + "shortName": "ListHostProjectRegistrations", + "fullName": "google.cloud.apihub.v1.HostProjectRegistrationService.ListHostProjectRegistrations", + "service": { + "shortName": "HostProjectRegistrationService", + "fullName": "google.cloud.apihub.v1.HostProjectRegistrationService" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_LintingService_GetStyleGuide_async", + "title": "ApiHub getStyleGuide Sample", + "origin": "API_DEFINITION", + "description": " Get the style guide being used for linting.", + "canonical": true, + "file": "linting_service.get_style_guide.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetStyleGuide", + "fullName": "google.cloud.apihub.v1.LintingService.GetStyleGuide", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apihub.v1.StyleGuide", + "client": { + "shortName": "LintingServiceClient", + "fullName": "google.cloud.apihub.v1.LintingServiceClient" + }, + "method": { + "shortName": "GetStyleGuide", + "fullName": "google.cloud.apihub.v1.LintingService.GetStyleGuide", + "service": { + "shortName": "LintingService", + "fullName": "google.cloud.apihub.v1.LintingService" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_LintingService_UpdateStyleGuide_async", + "title": "ApiHub updateStyleGuide Sample", + "origin": "API_DEFINITION", + "description": " Update the styleGuide to be used for liniting in by API hub.", + "canonical": true, + "file": "linting_service.update_style_guide.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateStyleGuide", + "fullName": "google.cloud.apihub.v1.LintingService.UpdateStyleGuide", + "async": true, + "parameters": [ + { + "name": "style_guide", + "type": ".google.cloud.apihub.v1.StyleGuide" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.apihub.v1.StyleGuide", + "client": { + "shortName": "LintingServiceClient", + "fullName": "google.cloud.apihub.v1.LintingServiceClient" + }, + "method": { + "shortName": "UpdateStyleGuide", + "fullName": "google.cloud.apihub.v1.LintingService.UpdateStyleGuide", + "service": { + "shortName": "LintingService", + "fullName": "google.cloud.apihub.v1.LintingService" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_LintingService_GetStyleGuideContents_async", + "title": "ApiHub getStyleGuideContents Sample", + "origin": "API_DEFINITION", + "description": " Get the contents of the style guide.", + "canonical": true, + "file": "linting_service.get_style_guide_contents.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetStyleGuideContents", + "fullName": "google.cloud.apihub.v1.LintingService.GetStyleGuideContents", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apihub.v1.StyleGuideContents", + "client": { + "shortName": "LintingServiceClient", + "fullName": "google.cloud.apihub.v1.LintingServiceClient" + }, + "method": { + "shortName": "GetStyleGuideContents", + "fullName": "google.cloud.apihub.v1.LintingService.GetStyleGuideContents", + "service": { + "shortName": "LintingService", + "fullName": "google.cloud.apihub.v1.LintingService" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_LintingService_LintSpec_async", + "title": "ApiHub lintSpec Sample", + "origin": "API_DEFINITION", + "description": " Lints the requested spec and updates the corresponding API Spec with the lint response. This lint response will be available in all subsequent Get and List Spec calls to Core service.", + "canonical": true, + "file": "linting_service.lint_spec.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "LintSpec", + "fullName": "google.cloud.apihub.v1.LintingService.LintSpec", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "LintingServiceClient", + "fullName": "google.cloud.apihub.v1.LintingServiceClient" + }, + "method": { + "shortName": "LintSpec", + "fullName": "google.cloud.apihub.v1.LintingService.LintSpec", + "service": { + "shortName": "LintingService", + "fullName": "google.cloud.apihub.v1.LintingService" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_Provisioning_CreateApiHubInstance_async", + "title": "ApiHub createApiHubInstance Sample", + "origin": "API_DEFINITION", + "description": " Provisions instance resources for the API Hub.", + "canonical": true, + "file": "provisioning.create_api_hub_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateApiHubInstance", + "fullName": "google.cloud.apihub.v1.Provisioning.CreateApiHubInstance", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "api_hub_instance_id", + "type": "TYPE_STRING" + }, + { + "name": "api_hub_instance", + "type": ".google.cloud.apihub.v1.ApiHubInstance" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "ProvisioningClient", + "fullName": "google.cloud.apihub.v1.ProvisioningClient" + }, + "method": { + "shortName": "CreateApiHubInstance", + "fullName": "google.cloud.apihub.v1.Provisioning.CreateApiHubInstance", + "service": { + "shortName": "Provisioning", + "fullName": "google.cloud.apihub.v1.Provisioning" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_Provisioning_GetApiHubInstance_async", + "title": "ApiHub getApiHubInstance Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single API Hub instance.", + "canonical": true, + "file": "provisioning.get_api_hub_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetApiHubInstance", + "fullName": "google.cloud.apihub.v1.Provisioning.GetApiHubInstance", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apihub.v1.ApiHubInstance", + "client": { + "shortName": "ProvisioningClient", + "fullName": "google.cloud.apihub.v1.ProvisioningClient" + }, + "method": { + "shortName": "GetApiHubInstance", + "fullName": "google.cloud.apihub.v1.Provisioning.GetApiHubInstance", + "service": { + "shortName": "Provisioning", + "fullName": "google.cloud.apihub.v1.Provisioning" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_Provisioning_LookupApiHubInstance_async", + "title": "ApiHub lookupApiHubInstance Sample", + "origin": "API_DEFINITION", + "description": " Looks up an Api Hub instance in a given GCP project. There will always be only one Api Hub instance for a GCP project across all locations.", + "canonical": true, + "file": "provisioning.lookup_api_hub_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "LookupApiHubInstance", + "fullName": "google.cloud.apihub.v1.Provisioning.LookupApiHubInstance", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apihub.v1.LookupApiHubInstanceResponse", + "client": { + "shortName": "ProvisioningClient", + "fullName": "google.cloud.apihub.v1.ProvisioningClient" + }, + "method": { + "shortName": "LookupApiHubInstance", + "fullName": "google.cloud.apihub.v1.Provisioning.LookupApiHubInstance", + "service": { + "shortName": "Provisioning", + "fullName": "google.cloud.apihub.v1.Provisioning" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_RuntimeProjectAttachmentService_CreateRuntimeProjectAttachment_async", + "title": "ApiHub createRuntimeProjectAttachment Sample", + "origin": "API_DEFINITION", + "description": " Attaches a runtime project to the host project.", + "canonical": true, + "file": "runtime_project_attachment_service.create_runtime_project_attachment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateRuntimeProjectAttachment", + "fullName": "google.cloud.apihub.v1.RuntimeProjectAttachmentService.CreateRuntimeProjectAttachment", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "runtime_project_attachment_id", + "type": "TYPE_STRING" + }, + { + "name": "runtime_project_attachment", + "type": ".google.cloud.apihub.v1.RuntimeProjectAttachment" + } + ], + "resultType": ".google.cloud.apihub.v1.RuntimeProjectAttachment", + "client": { + "shortName": "RuntimeProjectAttachmentServiceClient", + "fullName": "google.cloud.apihub.v1.RuntimeProjectAttachmentServiceClient" + }, + "method": { + "shortName": "CreateRuntimeProjectAttachment", + "fullName": "google.cloud.apihub.v1.RuntimeProjectAttachmentService.CreateRuntimeProjectAttachment", + "service": { + "shortName": "RuntimeProjectAttachmentService", + "fullName": "google.cloud.apihub.v1.RuntimeProjectAttachmentService" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_RuntimeProjectAttachmentService_GetRuntimeProjectAttachment_async", + "title": "ApiHub getRuntimeProjectAttachment Sample", + "origin": "API_DEFINITION", + "description": " Gets a runtime project attachment.", + "canonical": true, + "file": "runtime_project_attachment_service.get_runtime_project_attachment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetRuntimeProjectAttachment", + "fullName": "google.cloud.apihub.v1.RuntimeProjectAttachmentService.GetRuntimeProjectAttachment", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apihub.v1.RuntimeProjectAttachment", + "client": { + "shortName": "RuntimeProjectAttachmentServiceClient", + "fullName": "google.cloud.apihub.v1.RuntimeProjectAttachmentServiceClient" + }, + "method": { + "shortName": "GetRuntimeProjectAttachment", + "fullName": "google.cloud.apihub.v1.RuntimeProjectAttachmentService.GetRuntimeProjectAttachment", + "service": { + "shortName": "RuntimeProjectAttachmentService", + "fullName": "google.cloud.apihub.v1.RuntimeProjectAttachmentService" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_RuntimeProjectAttachmentService_ListRuntimeProjectAttachments_async", + "title": "ApiHub listRuntimeProjectAttachments Sample", + "origin": "API_DEFINITION", + "description": " List runtime projects attached to the host project.", + "canonical": true, + "file": "runtime_project_attachment_service.list_runtime_project_attachments.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 92, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListRuntimeProjectAttachments", + "fullName": "google.cloud.apihub.v1.RuntimeProjectAttachmentService.ListRuntimeProjectAttachments", + "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" + } + ], + "resultType": ".google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse", + "client": { + "shortName": "RuntimeProjectAttachmentServiceClient", + "fullName": "google.cloud.apihub.v1.RuntimeProjectAttachmentServiceClient" + }, + "method": { + "shortName": "ListRuntimeProjectAttachments", + "fullName": "google.cloud.apihub.v1.RuntimeProjectAttachmentService.ListRuntimeProjectAttachments", + "service": { + "shortName": "RuntimeProjectAttachmentService", + "fullName": "google.cloud.apihub.v1.RuntimeProjectAttachmentService" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_RuntimeProjectAttachmentService_DeleteRuntimeProjectAttachment_async", + "title": "ApiHub deleteRuntimeProjectAttachment Sample", + "origin": "API_DEFINITION", + "description": " Delete a runtime project attachment in the API Hub. This call will detach the runtime project from the host project.", + "canonical": true, + "file": "runtime_project_attachment_service.delete_runtime_project_attachment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteRuntimeProjectAttachment", + "fullName": "google.cloud.apihub.v1.RuntimeProjectAttachmentService.DeleteRuntimeProjectAttachment", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "RuntimeProjectAttachmentServiceClient", + "fullName": "google.cloud.apihub.v1.RuntimeProjectAttachmentServiceClient" + }, + "method": { + "shortName": "DeleteRuntimeProjectAttachment", + "fullName": "google.cloud.apihub.v1.RuntimeProjectAttachmentService.DeleteRuntimeProjectAttachment", + "service": { + "shortName": "RuntimeProjectAttachmentService", + "fullName": "google.cloud.apihub.v1.RuntimeProjectAttachmentService" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_RuntimeProjectAttachmentService_LookupRuntimeProjectAttachment_async", + "title": "ApiHub lookupRuntimeProjectAttachment Sample", + "origin": "API_DEFINITION", + "description": " Look up a runtime project attachment. This API can be called in the context of any project.", + "canonical": true, + "file": "runtime_project_attachment_service.lookup_runtime_project_attachment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "LookupRuntimeProjectAttachment", + "fullName": "google.cloud.apihub.v1.RuntimeProjectAttachmentService.LookupRuntimeProjectAttachment", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse", + "client": { + "shortName": "RuntimeProjectAttachmentServiceClient", + "fullName": "google.cloud.apihub.v1.RuntimeProjectAttachmentServiceClient" + }, + "method": { + "shortName": "LookupRuntimeProjectAttachment", + "fullName": "google.cloud.apihub.v1.RuntimeProjectAttachmentService.LookupRuntimeProjectAttachment", + "service": { + "shortName": "RuntimeProjectAttachmentService", + "fullName": "google.cloud.apihub.v1.RuntimeProjectAttachmentService" + } + } + } + } + ] +} diff --git a/owl-bot-staging/google-cloud-apihub/v1/src/index.ts b/owl-bot-staging/google-cloud-apihub/v1/src/index.ts new file mode 100644 index 00000000000..dbd2cb2b100 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/src/index.ts @@ -0,0 +1,37 @@ +// Copyright 2024 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 v1 from './v1'; +const ApiHubClient = v1.ApiHubClient; +type ApiHubClient = v1.ApiHubClient; +const ApiHubDependenciesClient = v1.ApiHubDependenciesClient; +type ApiHubDependenciesClient = v1.ApiHubDependenciesClient; +const ApiHubPluginClient = v1.ApiHubPluginClient; +type ApiHubPluginClient = v1.ApiHubPluginClient; +const HostProjectRegistrationServiceClient = v1.HostProjectRegistrationServiceClient; +type HostProjectRegistrationServiceClient = v1.HostProjectRegistrationServiceClient; +const LintingServiceClient = v1.LintingServiceClient; +type LintingServiceClient = v1.LintingServiceClient; +const ProvisioningClient = v1.ProvisioningClient; +type ProvisioningClient = v1.ProvisioningClient; +const RuntimeProjectAttachmentServiceClient = v1.RuntimeProjectAttachmentServiceClient; +type RuntimeProjectAttachmentServiceClient = v1.RuntimeProjectAttachmentServiceClient; +export {v1, ApiHubClient, ApiHubDependenciesClient, ApiHubPluginClient, HostProjectRegistrationServiceClient, LintingServiceClient, ProvisioningClient, RuntimeProjectAttachmentServiceClient}; +export default {v1, ApiHubClient, ApiHubDependenciesClient, ApiHubPluginClient, HostProjectRegistrationServiceClient, LintingServiceClient, ProvisioningClient, RuntimeProjectAttachmentServiceClient}; +import * as protos from '../protos/protos'; +export {protos} diff --git a/owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_client.ts b/owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_client.ts new file mode 100644 index 00000000000..b9accd2a212 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_client.ts @@ -0,0 +1,6151 @@ +// Copyright 2024 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, PaginationCallback, GaxCall, 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/api_hub_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './api_hub_client_config.json'; +const version = require('../../../package.json').version; + +/** + * This service provides all methods related to the API hub. + * @class + * @memberof v1 + */ +export class ApiHubClient { + 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}; + private _universeDomain: string; + private _servicePath: string; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + locationsClient: LocationsClient; + pathTemplates: {[name: string]: gax.PathTemplate}; + apiHubStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of ApiHubClient. + * + * @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 ApiHubClient({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 ApiHubClient; + if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { + throw new Error('Please set either universe_domain or universeDomain, but not both.'); + } + const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; + this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; + this._servicePath = 'apihub.' + this._universeDomain; + const servicePath = opts?.servicePath || opts?.apiEndpoint || this._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 !== this._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 = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + 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 === 'object' && '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 = { + apiPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}' + ), + apiHubInstancePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apiHubInstances/{api_hub_instance}' + ), + apiOperationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}' + ), + attributePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/attributes/{attribute}' + ), + definitionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}' + ), + dependencyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/dependencies/{dependency}' + ), + deploymentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/deployments/{deployment}' + ), + externalApiPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/externalApis/{external_api}' + ), + hostProjectRegistrationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/hostProjectRegistrations/{host_project_registration}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + pluginPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/plugins/{plugin}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + runtimeProjectAttachmentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}' + ), + specPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}' + ), + styleGuidePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/plugins/{plugin}/styleGuide' + ), + versionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}/versions/{version}' + ), + }; + + // 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 = { + listApis: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'apis'), + listVersions: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'versions'), + listSpecs: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'specs'), + listApiOperations: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'apiOperations'), + listDeployments: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'deployments'), + listAttributes: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'attributes'), + searchResources: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'searchResults'), + listExternalApis: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'externalApis') + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.apihub.v1.ApiHub', 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.apiHubStub) { + return this.apiHubStub; + } + + // Put together the "service stub" for + // google.cloud.apihub.v1.ApiHub. + this.apiHubStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.apihub.v1.ApiHub') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.apihub.v1.ApiHub, + 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 apiHubStubMethods = + ['createApi', 'getApi', 'listApis', 'updateApi', 'deleteApi', 'createVersion', 'getVersion', 'listVersions', 'updateVersion', 'deleteVersion', 'createSpec', 'getSpec', 'getSpecContents', 'listSpecs', 'updateSpec', 'deleteSpec', 'getApiOperation', 'listApiOperations', 'getDefinition', 'createDeployment', 'getDeployment', 'listDeployments', 'updateDeployment', 'deleteDeployment', 'createAttribute', 'getAttribute', 'updateAttribute', 'deleteAttribute', 'listAttributes', 'searchResources', 'createExternalApi', 'getExternalApi', 'updateExternalApi', 'deleteExternalApi', 'listExternalApis']; + for (const methodName of apiHubStubMethods) { + const callPromise = this.apiHubStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + this.descriptors.page[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.apiHubStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'apihub.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'apihub.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * 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 -- + // ------------------- +/** + * Create an API resource in the API hub. + * Once an API resource is created, versions can be added to it. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource for the API resource. + * Format: `projects/{project}/locations/{location}` + * @param {string} [request.apiId] + * Optional. The ID to use for the API resource, which will become the final + * component of the API's resource name. This field is optional. + * + * * If provided, the same will be used. The service will throw an error if + * the specified id is already used by another API resource in the API hub. + * * If not provided, a system generated id will be used. + * + * This value should be 4-500 characters, and valid characters + * are /{@link protos.A-Z|a-z}[0-9]-_/. + * @param {google.cloud.apihub.v1.Api} request.api + * Required. The API resource to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.apihub.v1.Api|Api}. + * 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/api_hub.create_api.js + * region_tag:apihub_v1_generated_ApiHub_CreateApi_async + */ + createApi( + request?: protos.google.cloud.apihub.v1.ICreateApiRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.apihub.v1.IApi, + protos.google.cloud.apihub.v1.ICreateApiRequest|undefined, {}|undefined + ]>; + createApi( + request: protos.google.cloud.apihub.v1.ICreateApiRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.IApi, + protos.google.cloud.apihub.v1.ICreateApiRequest|null|undefined, + {}|null|undefined>): void; + createApi( + request: protos.google.cloud.apihub.v1.ICreateApiRequest, + callback: Callback< + protos.google.cloud.apihub.v1.IApi, + protos.google.cloud.apihub.v1.ICreateApiRequest|null|undefined, + {}|null|undefined>): void; + createApi( + request?: protos.google.cloud.apihub.v1.ICreateApiRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.apihub.v1.IApi, + protos.google.cloud.apihub.v1.ICreateApiRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.apihub.v1.IApi, + protos.google.cloud.apihub.v1.ICreateApiRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.apihub.v1.IApi, + protos.google.cloud.apihub.v1.ICreateApiRequest|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.createApi(request, options, callback); + } +/** + * Get API resource details including the API versions contained in it. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the API resource to retrieve. + * Format: `projects/{project}/locations/{location}/apis/{api}` + * @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.apihub.v1.Api|Api}. + * 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/api_hub.get_api.js + * region_tag:apihub_v1_generated_ApiHub_GetApi_async + */ + getApi( + request?: protos.google.cloud.apihub.v1.IGetApiRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.apihub.v1.IApi, + protos.google.cloud.apihub.v1.IGetApiRequest|undefined, {}|undefined + ]>; + getApi( + request: protos.google.cloud.apihub.v1.IGetApiRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.IApi, + protos.google.cloud.apihub.v1.IGetApiRequest|null|undefined, + {}|null|undefined>): void; + getApi( + request: protos.google.cloud.apihub.v1.IGetApiRequest, + callback: Callback< + protos.google.cloud.apihub.v1.IApi, + protos.google.cloud.apihub.v1.IGetApiRequest|null|undefined, + {}|null|undefined>): void; + getApi( + request?: protos.google.cloud.apihub.v1.IGetApiRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.apihub.v1.IApi, + protos.google.cloud.apihub.v1.IGetApiRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.apihub.v1.IApi, + protos.google.cloud.apihub.v1.IGetApiRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.apihub.v1.IApi, + protos.google.cloud.apihub.v1.IGetApiRequest|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.getApi(request, options, callback); + } +/** + * Update an API resource in the API hub. The following fields in the + * {@link protos.|API} can be updated: + * + * * {@link protos.google.cloud.apihub.v1.Api.display_name|display_name} + * * {@link protos.google.cloud.apihub.v1.Api.description|description} + * * {@link protos.google.cloud.apihub.v1.Api.owner|owner} + * * {@link protos.google.cloud.apihub.v1.Api.documentation|documentation} + * * {@link protos.google.cloud.apihub.v1.Api.target_user|target_user} + * * {@link protos.google.cloud.apihub.v1.Api.team|team} + * * {@link protos.google.cloud.apihub.v1.Api.business_unit|business_unit} + * * {@link protos.google.cloud.apihub.v1.Api.maturity_level|maturity_level} + * * {@link protos.google.cloud.apihub.v1.Api.attributes|attributes} + * + * The + * {@link protos.google.cloud.apihub.v1.UpdateApiRequest.update_mask|update_mask} + * should be used to specify the fields being updated. + * + * Updating the owner field requires complete owner message + * and updates both owner and email fields. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.apihub.v1.Api} request.api + * Required. The API resource to update. + * + * The API resource's `name` field is used to identify the API resource to + * update. + * Format: `projects/{project}/locations/{location}/apis/{api}` + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The list of fields to update. + * @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.apihub.v1.Api|Api}. + * 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/api_hub.update_api.js + * region_tag:apihub_v1_generated_ApiHub_UpdateApi_async + */ + updateApi( + request?: protos.google.cloud.apihub.v1.IUpdateApiRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.apihub.v1.IApi, + protos.google.cloud.apihub.v1.IUpdateApiRequest|undefined, {}|undefined + ]>; + updateApi( + request: protos.google.cloud.apihub.v1.IUpdateApiRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.IApi, + protos.google.cloud.apihub.v1.IUpdateApiRequest|null|undefined, + {}|null|undefined>): void; + updateApi( + request: protos.google.cloud.apihub.v1.IUpdateApiRequest, + callback: Callback< + protos.google.cloud.apihub.v1.IApi, + protos.google.cloud.apihub.v1.IUpdateApiRequest|null|undefined, + {}|null|undefined>): void; + updateApi( + request?: protos.google.cloud.apihub.v1.IUpdateApiRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.apihub.v1.IApi, + protos.google.cloud.apihub.v1.IUpdateApiRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.apihub.v1.IApi, + protos.google.cloud.apihub.v1.IUpdateApiRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.apihub.v1.IApi, + protos.google.cloud.apihub.v1.IUpdateApiRequest|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({ + 'api.name': request.api!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateApi(request, options, callback); + } +/** + * Delete an API resource in the API hub. API can only be deleted if all + * underlying versions are deleted. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the API resource to delete. + * Format: `projects/{project}/locations/{location}/apis/{api}` + * @param {boolean} [request.force] + * Optional. If set to true, any versions from this API will also be deleted. + * Otherwise, the request will only work if the API has no versions. + * @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.protobuf.Empty|Empty}. + * 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/api_hub.delete_api.js + * region_tag:apihub_v1_generated_ApiHub_DeleteApi_async + */ + deleteApi( + request?: protos.google.cloud.apihub.v1.IDeleteApiRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteApiRequest|undefined, {}|undefined + ]>; + deleteApi( + request: protos.google.cloud.apihub.v1.IDeleteApiRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteApiRequest|null|undefined, + {}|null|undefined>): void; + deleteApi( + request: protos.google.cloud.apihub.v1.IDeleteApiRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteApiRequest|null|undefined, + {}|null|undefined>): void; + deleteApi( + request?: protos.google.cloud.apihub.v1.IDeleteApiRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteApiRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteApiRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteApiRequest|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.deleteApi(request, options, callback); + } +/** + * Create an API version for an API resource in the API hub. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource for API version. + * Format: `projects/{project}/locations/{location}/apis/{api}` + * @param {string} [request.versionId] + * Optional. The ID to use for the API version, which will become the final + * component of the version's resource name. This field is optional. + * + * * If provided, the same will be used. The service will throw an error if + * the specified id is already used by another version in the API resource. + * * If not provided, a system generated id will be used. + * + * This value should be 4-500 characters, and valid characters + * are /{@link protos.A-Z|a-z}[0-9]-_/. + * @param {google.cloud.apihub.v1.Version} request.version + * Required. The version to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.apihub.v1.Version|Version}. + * 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/api_hub.create_version.js + * region_tag:apihub_v1_generated_ApiHub_CreateVersion_async + */ + createVersion( + request?: protos.google.cloud.apihub.v1.ICreateVersionRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.apihub.v1.IVersion, + protos.google.cloud.apihub.v1.ICreateVersionRequest|undefined, {}|undefined + ]>; + createVersion( + request: protos.google.cloud.apihub.v1.ICreateVersionRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.IVersion, + protos.google.cloud.apihub.v1.ICreateVersionRequest|null|undefined, + {}|null|undefined>): void; + createVersion( + request: protos.google.cloud.apihub.v1.ICreateVersionRequest, + callback: Callback< + protos.google.cloud.apihub.v1.IVersion, + protos.google.cloud.apihub.v1.ICreateVersionRequest|null|undefined, + {}|null|undefined>): void; + createVersion( + request?: protos.google.cloud.apihub.v1.ICreateVersionRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.apihub.v1.IVersion, + protos.google.cloud.apihub.v1.ICreateVersionRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.apihub.v1.IVersion, + protos.google.cloud.apihub.v1.ICreateVersionRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.apihub.v1.IVersion, + protos.google.cloud.apihub.v1.ICreateVersionRequest|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.createVersion(request, options, callback); + } +/** + * Get details about the API version of an API resource. This will include + * information about the specs and operations present in the API + * version as well as the deployments linked to it. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the API version to retrieve. + * Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}` + * @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.apihub.v1.Version|Version}. + * 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/api_hub.get_version.js + * region_tag:apihub_v1_generated_ApiHub_GetVersion_async + */ + getVersion( + request?: protos.google.cloud.apihub.v1.IGetVersionRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.apihub.v1.IVersion, + protos.google.cloud.apihub.v1.IGetVersionRequest|undefined, {}|undefined + ]>; + getVersion( + request: protos.google.cloud.apihub.v1.IGetVersionRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.IVersion, + protos.google.cloud.apihub.v1.IGetVersionRequest|null|undefined, + {}|null|undefined>): void; + getVersion( + request: protos.google.cloud.apihub.v1.IGetVersionRequest, + callback: Callback< + protos.google.cloud.apihub.v1.IVersion, + protos.google.cloud.apihub.v1.IGetVersionRequest|null|undefined, + {}|null|undefined>): void; + getVersion( + request?: protos.google.cloud.apihub.v1.IGetVersionRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.apihub.v1.IVersion, + protos.google.cloud.apihub.v1.IGetVersionRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.apihub.v1.IVersion, + protos.google.cloud.apihub.v1.IGetVersionRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.apihub.v1.IVersion, + protos.google.cloud.apihub.v1.IGetVersionRequest|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.getVersion(request, options, callback); + } +/** + * Update API version. The following fields in the + * {@link protos.google.cloud.apihub.v1.Version|version} can be updated currently: + * + * * {@link protos.google.cloud.apihub.v1.Version.display_name|display_name} + * * {@link protos.google.cloud.apihub.v1.Version.description|description} + * * {@link protos.google.cloud.apihub.v1.Version.documentation|documentation} + * * {@link protos.google.cloud.apihub.v1.Version.deployments|deployments} + * * {@link protos.google.cloud.apihub.v1.Version.lifecycle|lifecycle} + * * {@link protos.google.cloud.apihub.v1.Version.compliance|compliance} + * * {@link protos.google.cloud.apihub.v1.Version.accreditation|accreditation} + * * {@link protos.google.cloud.apihub.v1.Version.attributes|attributes} + * + * The + * {@link protos.google.cloud.apihub.v1.UpdateVersionRequest.update_mask|update_mask} + * should be used to specify the fields being updated. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.apihub.v1.Version} request.version + * Required. The API version to update. + * + * The version's `name` field is used to identify the API version to update. + * Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}` + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The list of fields to update. + * @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.apihub.v1.Version|Version}. + * 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/api_hub.update_version.js + * region_tag:apihub_v1_generated_ApiHub_UpdateVersion_async + */ + updateVersion( + request?: protos.google.cloud.apihub.v1.IUpdateVersionRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.apihub.v1.IVersion, + protos.google.cloud.apihub.v1.IUpdateVersionRequest|undefined, {}|undefined + ]>; + updateVersion( + request: protos.google.cloud.apihub.v1.IUpdateVersionRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.IVersion, + protos.google.cloud.apihub.v1.IUpdateVersionRequest|null|undefined, + {}|null|undefined>): void; + updateVersion( + request: protos.google.cloud.apihub.v1.IUpdateVersionRequest, + callback: Callback< + protos.google.cloud.apihub.v1.IVersion, + protos.google.cloud.apihub.v1.IUpdateVersionRequest|null|undefined, + {}|null|undefined>): void; + updateVersion( + request?: protos.google.cloud.apihub.v1.IUpdateVersionRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.apihub.v1.IVersion, + protos.google.cloud.apihub.v1.IUpdateVersionRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.apihub.v1.IVersion, + protos.google.cloud.apihub.v1.IUpdateVersionRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.apihub.v1.IVersion, + protos.google.cloud.apihub.v1.IUpdateVersionRequest|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({ + 'version.name': request.version!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateVersion(request, options, callback); + } +/** + * Delete an API version. Version can only be deleted if all underlying specs, + * operations, definitions and linked deployments are deleted. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the version to delete. + * Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}` + * @param {boolean} [request.force] + * Optional. If set to true, any specs from this version will also be deleted. + * Otherwise, the request will only work if the version has no specs. + * @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.protobuf.Empty|Empty}. + * 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/api_hub.delete_version.js + * region_tag:apihub_v1_generated_ApiHub_DeleteVersion_async + */ + deleteVersion( + request?: protos.google.cloud.apihub.v1.IDeleteVersionRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteVersionRequest|undefined, {}|undefined + ]>; + deleteVersion( + request: protos.google.cloud.apihub.v1.IDeleteVersionRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteVersionRequest|null|undefined, + {}|null|undefined>): void; + deleteVersion( + request: protos.google.cloud.apihub.v1.IDeleteVersionRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteVersionRequest|null|undefined, + {}|null|undefined>): void; + deleteVersion( + request?: protos.google.cloud.apihub.v1.IDeleteVersionRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteVersionRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteVersionRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteVersionRequest|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.deleteVersion(request, options, callback); + } +/** + * Add a spec to an API version in the API hub. + * Multiple specs can be added to an API version. + * Note, while adding a spec, at least one of `contents` or `source_uri` must + * be provided. If `contents` is provided, then `spec_type` must also be + * provided. + * + * On adding a spec with contents to the version, the operations present in it + * will be added to the version.Note that the file contents in the spec should + * be of the same type as defined in the + * `projects/{project}/locations/{location}/attributes/system-spec-type` + * attribute associated with spec resource. Note that specs of various types + * can be uploaded, however parsing of details is supported for OpenAPI spec + * currently. + * + * In order to access the information parsed from the spec, use the + * {@link protos.google.cloud.apihub.v1.ApiHub.GetSpec|GetSpec} method. + * In order to access the raw contents for a particular spec, use the + * {@link protos.google.cloud.apihub.v1.ApiHub.GetSpecContents|GetSpecContents} method. + * In order to access the operations parsed from the spec, use the + * {@link protos.google.cloud.apihub.v1.ApiHub.ListApiOperations|ListAPIOperations} + * method. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource for Spec. + * Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}` + * @param {string} [request.specId] + * Optional. The ID to use for the spec, which will become the final component + * of the spec's resource name. This field is optional. + * + * * If provided, the same will be used. The service will throw an error if + * the specified id is already used by another spec in the API + * resource. + * * If not provided, a system generated id will be used. + * + * This value should be 4-500 characters, and valid characters + * are /{@link protos.A-Z|a-z}[0-9]-_/. + * @param {google.cloud.apihub.v1.Spec} request.spec + * Required. The spec to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.apihub.v1.Spec|Spec}. + * 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/api_hub.create_spec.js + * region_tag:apihub_v1_generated_ApiHub_CreateSpec_async + */ + createSpec( + request?: protos.google.cloud.apihub.v1.ICreateSpecRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.apihub.v1.ISpec, + protos.google.cloud.apihub.v1.ICreateSpecRequest|undefined, {}|undefined + ]>; + createSpec( + request: protos.google.cloud.apihub.v1.ICreateSpecRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.ISpec, + protos.google.cloud.apihub.v1.ICreateSpecRequest|null|undefined, + {}|null|undefined>): void; + createSpec( + request: protos.google.cloud.apihub.v1.ICreateSpecRequest, + callback: Callback< + protos.google.cloud.apihub.v1.ISpec, + protos.google.cloud.apihub.v1.ICreateSpecRequest|null|undefined, + {}|null|undefined>): void; + createSpec( + request?: protos.google.cloud.apihub.v1.ICreateSpecRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.apihub.v1.ISpec, + protos.google.cloud.apihub.v1.ICreateSpecRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.apihub.v1.ISpec, + protos.google.cloud.apihub.v1.ICreateSpecRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.apihub.v1.ISpec, + protos.google.cloud.apihub.v1.ICreateSpecRequest|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.createSpec(request, options, callback); + } +/** + * Get details about the information parsed from a spec. + * Note that this method does not return the raw spec contents. + * Use {@link protos.google.cloud.apihub.v1.ApiHub.GetSpecContents|GetSpecContents} method + * to retrieve the same. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the spec to retrieve. + * Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}` + * @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.apihub.v1.Spec|Spec}. + * 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/api_hub.get_spec.js + * region_tag:apihub_v1_generated_ApiHub_GetSpec_async + */ + getSpec( + request?: protos.google.cloud.apihub.v1.IGetSpecRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.apihub.v1.ISpec, + protos.google.cloud.apihub.v1.IGetSpecRequest|undefined, {}|undefined + ]>; + getSpec( + request: protos.google.cloud.apihub.v1.IGetSpecRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.ISpec, + protos.google.cloud.apihub.v1.IGetSpecRequest|null|undefined, + {}|null|undefined>): void; + getSpec( + request: protos.google.cloud.apihub.v1.IGetSpecRequest, + callback: Callback< + protos.google.cloud.apihub.v1.ISpec, + protos.google.cloud.apihub.v1.IGetSpecRequest|null|undefined, + {}|null|undefined>): void; + getSpec( + request?: protos.google.cloud.apihub.v1.IGetSpecRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.apihub.v1.ISpec, + protos.google.cloud.apihub.v1.IGetSpecRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.apihub.v1.ISpec, + protos.google.cloud.apihub.v1.IGetSpecRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.apihub.v1.ISpec, + protos.google.cloud.apihub.v1.IGetSpecRequest|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.getSpec(request, options, callback); + } +/** + * Get spec contents. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the spec whose contents need to be retrieved. + * Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}` + * @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.apihub.v1.SpecContents|SpecContents}. + * 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/api_hub.get_spec_contents.js + * region_tag:apihub_v1_generated_ApiHub_GetSpecContents_async + */ + getSpecContents( + request?: protos.google.cloud.apihub.v1.IGetSpecContentsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.apihub.v1.ISpecContents, + protos.google.cloud.apihub.v1.IGetSpecContentsRequest|undefined, {}|undefined + ]>; + getSpecContents( + request: protos.google.cloud.apihub.v1.IGetSpecContentsRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.ISpecContents, + protos.google.cloud.apihub.v1.IGetSpecContentsRequest|null|undefined, + {}|null|undefined>): void; + getSpecContents( + request: protos.google.cloud.apihub.v1.IGetSpecContentsRequest, + callback: Callback< + protos.google.cloud.apihub.v1.ISpecContents, + protos.google.cloud.apihub.v1.IGetSpecContentsRequest|null|undefined, + {}|null|undefined>): void; + getSpecContents( + request?: protos.google.cloud.apihub.v1.IGetSpecContentsRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.apihub.v1.ISpecContents, + protos.google.cloud.apihub.v1.IGetSpecContentsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.apihub.v1.ISpecContents, + protos.google.cloud.apihub.v1.IGetSpecContentsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.apihub.v1.ISpecContents, + protos.google.cloud.apihub.v1.IGetSpecContentsRequest|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.getSpecContents(request, options, callback); + } +/** + * Update spec. The following fields in the + * {@link protos.google.cloud.apihub.v1.Spec|spec} can be updated: + * + * * {@link protos.google.cloud.apihub.v1.Spec.display_name|display_name} + * * {@link protos.google.cloud.apihub.v1.Spec.source_uri|source_uri} + * * {@link protos.google.cloud.apihub.v1.Spec.lint_response|lint_response} + * * {@link protos.google.cloud.apihub.v1.Spec.attributes|attributes} + * * {@link protos.google.cloud.apihub.v1.Spec.contents|contents} + * * {@link protos.google.cloud.apihub.v1.Spec.spec_type|spec_type} + * + * In case of an OAS spec, updating spec contents can lead to: + * 1. Creation, deletion and update of operations. + * 2. Creation, deletion and update of definitions. + * 3. Update of other info parsed out from the new spec. + * + * In case of contents or source_uri being present in update mask, spec_type + * must also be present. Also, spec_type can not be present in update mask if + * contents or source_uri is not present. + * + * The + * {@link protos.google.cloud.apihub.v1.UpdateSpecRequest.update_mask|update_mask} + * should be used to specify the fields being updated. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.apihub.v1.Spec} request.spec + * Required. The spec to update. + * + * The spec's `name` field is used to identify the spec to + * update. Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}` + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The list of fields to update. + * @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.apihub.v1.Spec|Spec}. + * 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/api_hub.update_spec.js + * region_tag:apihub_v1_generated_ApiHub_UpdateSpec_async + */ + updateSpec( + request?: protos.google.cloud.apihub.v1.IUpdateSpecRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.apihub.v1.ISpec, + protos.google.cloud.apihub.v1.IUpdateSpecRequest|undefined, {}|undefined + ]>; + updateSpec( + request: protos.google.cloud.apihub.v1.IUpdateSpecRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.ISpec, + protos.google.cloud.apihub.v1.IUpdateSpecRequest|null|undefined, + {}|null|undefined>): void; + updateSpec( + request: protos.google.cloud.apihub.v1.IUpdateSpecRequest, + callback: Callback< + protos.google.cloud.apihub.v1.ISpec, + protos.google.cloud.apihub.v1.IUpdateSpecRequest|null|undefined, + {}|null|undefined>): void; + updateSpec( + request?: protos.google.cloud.apihub.v1.IUpdateSpecRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.apihub.v1.ISpec, + protos.google.cloud.apihub.v1.IUpdateSpecRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.apihub.v1.ISpec, + protos.google.cloud.apihub.v1.IUpdateSpecRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.apihub.v1.ISpec, + protos.google.cloud.apihub.v1.IUpdateSpecRequest|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({ + 'spec.name': request.spec!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateSpec(request, options, callback); + } +/** + * Delete a spec. + * Deleting a spec will also delete the associated operations from the + * version. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the spec to delete. + * Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}` + * @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.protobuf.Empty|Empty}. + * 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/api_hub.delete_spec.js + * region_tag:apihub_v1_generated_ApiHub_DeleteSpec_async + */ + deleteSpec( + request?: protos.google.cloud.apihub.v1.IDeleteSpecRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteSpecRequest|undefined, {}|undefined + ]>; + deleteSpec( + request: protos.google.cloud.apihub.v1.IDeleteSpecRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteSpecRequest|null|undefined, + {}|null|undefined>): void; + deleteSpec( + request: protos.google.cloud.apihub.v1.IDeleteSpecRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteSpecRequest|null|undefined, + {}|null|undefined>): void; + deleteSpec( + request?: protos.google.cloud.apihub.v1.IDeleteSpecRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteSpecRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteSpecRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteSpecRequest|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.deleteSpec(request, options, callback); + } +/** + * Get details about a particular operation in API version. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the operation to retrieve. + * Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}` + * @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.apihub.v1.ApiOperation|ApiOperation}. + * 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/api_hub.get_api_operation.js + * region_tag:apihub_v1_generated_ApiHub_GetApiOperation_async + */ + getApiOperation( + request?: protos.google.cloud.apihub.v1.IGetApiOperationRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.apihub.v1.IApiOperation, + protos.google.cloud.apihub.v1.IGetApiOperationRequest|undefined, {}|undefined + ]>; + getApiOperation( + request: protos.google.cloud.apihub.v1.IGetApiOperationRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.IApiOperation, + protos.google.cloud.apihub.v1.IGetApiOperationRequest|null|undefined, + {}|null|undefined>): void; + getApiOperation( + request: protos.google.cloud.apihub.v1.IGetApiOperationRequest, + callback: Callback< + protos.google.cloud.apihub.v1.IApiOperation, + protos.google.cloud.apihub.v1.IGetApiOperationRequest|null|undefined, + {}|null|undefined>): void; + getApiOperation( + request?: protos.google.cloud.apihub.v1.IGetApiOperationRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.apihub.v1.IApiOperation, + protos.google.cloud.apihub.v1.IGetApiOperationRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.apihub.v1.IApiOperation, + protos.google.cloud.apihub.v1.IGetApiOperationRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.apihub.v1.IApiOperation, + protos.google.cloud.apihub.v1.IGetApiOperationRequest|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.getApiOperation(request, options, callback); + } +/** + * Get details about a definition in an API version. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the definition to retrieve. + * Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}` + * @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.apihub.v1.Definition|Definition}. + * 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/api_hub.get_definition.js + * region_tag:apihub_v1_generated_ApiHub_GetDefinition_async + */ + getDefinition( + request?: protos.google.cloud.apihub.v1.IGetDefinitionRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.apihub.v1.IDefinition, + protos.google.cloud.apihub.v1.IGetDefinitionRequest|undefined, {}|undefined + ]>; + getDefinition( + request: protos.google.cloud.apihub.v1.IGetDefinitionRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.IDefinition, + protos.google.cloud.apihub.v1.IGetDefinitionRequest|null|undefined, + {}|null|undefined>): void; + getDefinition( + request: protos.google.cloud.apihub.v1.IGetDefinitionRequest, + callback: Callback< + protos.google.cloud.apihub.v1.IDefinition, + protos.google.cloud.apihub.v1.IGetDefinitionRequest|null|undefined, + {}|null|undefined>): void; + getDefinition( + request?: protos.google.cloud.apihub.v1.IGetDefinitionRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.apihub.v1.IDefinition, + protos.google.cloud.apihub.v1.IGetDefinitionRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.apihub.v1.IDefinition, + protos.google.cloud.apihub.v1.IGetDefinitionRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.apihub.v1.IDefinition, + protos.google.cloud.apihub.v1.IGetDefinitionRequest|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.getDefinition(request, options, callback); + } +/** + * Create a deployment resource in the API hub. + * Once a deployment resource is created, it can be associated with API + * versions. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource for the deployment resource. + * Format: `projects/{project}/locations/{location}` + * @param {string} [request.deploymentId] + * Optional. The ID to use for the deployment resource, which will become the + * final component of the deployment's resource name. This field is optional. + * + * * If provided, the same will be used. The service will throw an error if + * the specified id is already used by another deployment resource in the API + * hub. + * * If not provided, a system generated id will be used. + * + * This value should be 4-500 characters, and valid characters + * are /{@link protos.A-Z|a-z}[0-9]-_/. + * @param {google.cloud.apihub.v1.Deployment} request.deployment + * Required. The deployment resource to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.apihub.v1.Deployment|Deployment}. + * 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/api_hub.create_deployment.js + * region_tag:apihub_v1_generated_ApiHub_CreateDeployment_async + */ + createDeployment( + request?: protos.google.cloud.apihub.v1.ICreateDeploymentRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.apihub.v1.IDeployment, + protos.google.cloud.apihub.v1.ICreateDeploymentRequest|undefined, {}|undefined + ]>; + createDeployment( + request: protos.google.cloud.apihub.v1.ICreateDeploymentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.IDeployment, + protos.google.cloud.apihub.v1.ICreateDeploymentRequest|null|undefined, + {}|null|undefined>): void; + createDeployment( + request: protos.google.cloud.apihub.v1.ICreateDeploymentRequest, + callback: Callback< + protos.google.cloud.apihub.v1.IDeployment, + protos.google.cloud.apihub.v1.ICreateDeploymentRequest|null|undefined, + {}|null|undefined>): void; + createDeployment( + request?: protos.google.cloud.apihub.v1.ICreateDeploymentRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.apihub.v1.IDeployment, + protos.google.cloud.apihub.v1.ICreateDeploymentRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.apihub.v1.IDeployment, + protos.google.cloud.apihub.v1.ICreateDeploymentRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.apihub.v1.IDeployment, + protos.google.cloud.apihub.v1.ICreateDeploymentRequest|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.createDeployment(request, options, callback); + } +/** + * Get details about a deployment and the API versions linked to it. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the deployment resource to retrieve. + * Format: `projects/{project}/locations/{location}/deployments/{deployment}` + * @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.apihub.v1.Deployment|Deployment}. + * 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/api_hub.get_deployment.js + * region_tag:apihub_v1_generated_ApiHub_GetDeployment_async + */ + getDeployment( + request?: protos.google.cloud.apihub.v1.IGetDeploymentRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.apihub.v1.IDeployment, + protos.google.cloud.apihub.v1.IGetDeploymentRequest|undefined, {}|undefined + ]>; + getDeployment( + request: protos.google.cloud.apihub.v1.IGetDeploymentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.IDeployment, + protos.google.cloud.apihub.v1.IGetDeploymentRequest|null|undefined, + {}|null|undefined>): void; + getDeployment( + request: protos.google.cloud.apihub.v1.IGetDeploymentRequest, + callback: Callback< + protos.google.cloud.apihub.v1.IDeployment, + protos.google.cloud.apihub.v1.IGetDeploymentRequest|null|undefined, + {}|null|undefined>): void; + getDeployment( + request?: protos.google.cloud.apihub.v1.IGetDeploymentRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.apihub.v1.IDeployment, + protos.google.cloud.apihub.v1.IGetDeploymentRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.apihub.v1.IDeployment, + protos.google.cloud.apihub.v1.IGetDeploymentRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.apihub.v1.IDeployment, + protos.google.cloud.apihub.v1.IGetDeploymentRequest|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.getDeployment(request, options, callback); + } +/** + * Update a deployment resource in the API hub. The following fields in the + * {@link protos.google.cloud.apihub.v1.Deployment|deployment resource} can be + * updated: + * + * * {@link protos.google.cloud.apihub.v1.Deployment.display_name|display_name} + * * {@link protos.google.cloud.apihub.v1.Deployment.description|description} + * * {@link protos.google.cloud.apihub.v1.Deployment.documentation|documentation} + * * {@link protos.google.cloud.apihub.v1.Deployment.deployment_type|deployment_type} + * * {@link protos.google.cloud.apihub.v1.Deployment.resource_uri|resource_uri} + * * {@link protos.google.cloud.apihub.v1.Deployment.endpoints|endpoints} + * * {@link protos.google.cloud.apihub.v1.Deployment.slo|slo} + * * {@link protos.google.cloud.apihub.v1.Deployment.environment|environment} + * * {@link protos.google.cloud.apihub.v1.Deployment.attributes|attributes} + * + * The + * {@link protos.google.cloud.apihub.v1.UpdateDeploymentRequest.update_mask|update_mask} + * should be used to specify the fields being updated. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.apihub.v1.Deployment} request.deployment + * Required. The deployment resource to update. + * + * The deployment resource's `name` field is used to identify the deployment + * resource to update. + * Format: `projects/{project}/locations/{location}/deployments/{deployment}` + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The list of fields to update. + * @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.apihub.v1.Deployment|Deployment}. + * 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/api_hub.update_deployment.js + * region_tag:apihub_v1_generated_ApiHub_UpdateDeployment_async + */ + updateDeployment( + request?: protos.google.cloud.apihub.v1.IUpdateDeploymentRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.apihub.v1.IDeployment, + protos.google.cloud.apihub.v1.IUpdateDeploymentRequest|undefined, {}|undefined + ]>; + updateDeployment( + request: protos.google.cloud.apihub.v1.IUpdateDeploymentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.IDeployment, + protos.google.cloud.apihub.v1.IUpdateDeploymentRequest|null|undefined, + {}|null|undefined>): void; + updateDeployment( + request: protos.google.cloud.apihub.v1.IUpdateDeploymentRequest, + callback: Callback< + protos.google.cloud.apihub.v1.IDeployment, + protos.google.cloud.apihub.v1.IUpdateDeploymentRequest|null|undefined, + {}|null|undefined>): void; + updateDeployment( + request?: protos.google.cloud.apihub.v1.IUpdateDeploymentRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.apihub.v1.IDeployment, + protos.google.cloud.apihub.v1.IUpdateDeploymentRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.apihub.v1.IDeployment, + protos.google.cloud.apihub.v1.IUpdateDeploymentRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.apihub.v1.IDeployment, + protos.google.cloud.apihub.v1.IUpdateDeploymentRequest|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({ + 'deployment.name': request.deployment!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateDeployment(request, options, callback); + } +/** + * Delete a deployment resource in the API hub. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the deployment resource to delete. + * Format: `projects/{project}/locations/{location}/deployments/{deployment}` + * @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.protobuf.Empty|Empty}. + * 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/api_hub.delete_deployment.js + * region_tag:apihub_v1_generated_ApiHub_DeleteDeployment_async + */ + deleteDeployment( + request?: protos.google.cloud.apihub.v1.IDeleteDeploymentRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteDeploymentRequest|undefined, {}|undefined + ]>; + deleteDeployment( + request: protos.google.cloud.apihub.v1.IDeleteDeploymentRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteDeploymentRequest|null|undefined, + {}|null|undefined>): void; + deleteDeployment( + request: protos.google.cloud.apihub.v1.IDeleteDeploymentRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteDeploymentRequest|null|undefined, + {}|null|undefined>): void; + deleteDeployment( + request?: protos.google.cloud.apihub.v1.IDeleteDeploymentRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteDeploymentRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteDeploymentRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteDeploymentRequest|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.deleteDeployment(request, options, callback); + } +/** + * Create a user defined attribute. + * + * Certain pre defined attributes are already created by the API hub. These + * attributes will have type as `SYSTEM_DEFINED` and can be listed via + * {@link protos.google.cloud.apihub.v1.ApiHub.ListAttributes|ListAttributes} method. + * Allowed values for the same can be updated via + * {@link protos.google.cloud.apihub.v1.ApiHub.UpdateAttribute|UpdateAttribute} method. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource for Attribute. + * Format: `projects/{project}/locations/{location}` + * @param {string} [request.attributeId] + * Optional. The ID to use for the attribute, which will become the final + * component of the attribute's resource name. This field is optional. + * + * * If provided, the same will be used. The service will throw an error if + * the specified id is already used by another attribute resource in the API + * hub. + * * If not provided, a system generated id will be used. + * + * This value should be 4-500 characters, and valid characters + * are /{@link protos.A-Z|a-z}[0-9]-_/. + * @param {google.cloud.apihub.v1.Attribute} request.attribute + * Required. The attribute to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.apihub.v1.Attribute|Attribute}. + * 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/api_hub.create_attribute.js + * region_tag:apihub_v1_generated_ApiHub_CreateAttribute_async + */ + createAttribute( + request?: protos.google.cloud.apihub.v1.ICreateAttributeRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.apihub.v1.IAttribute, + protos.google.cloud.apihub.v1.ICreateAttributeRequest|undefined, {}|undefined + ]>; + createAttribute( + request: protos.google.cloud.apihub.v1.ICreateAttributeRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.IAttribute, + protos.google.cloud.apihub.v1.ICreateAttributeRequest|null|undefined, + {}|null|undefined>): void; + createAttribute( + request: protos.google.cloud.apihub.v1.ICreateAttributeRequest, + callback: Callback< + protos.google.cloud.apihub.v1.IAttribute, + protos.google.cloud.apihub.v1.ICreateAttributeRequest|null|undefined, + {}|null|undefined>): void; + createAttribute( + request?: protos.google.cloud.apihub.v1.ICreateAttributeRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.apihub.v1.IAttribute, + protos.google.cloud.apihub.v1.ICreateAttributeRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.apihub.v1.IAttribute, + protos.google.cloud.apihub.v1.ICreateAttributeRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.apihub.v1.IAttribute, + protos.google.cloud.apihub.v1.ICreateAttributeRequest|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.createAttribute(request, options, callback); + } +/** + * Get details about the attribute. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the attribute to retrieve. + * Format: + * `projects/{project}/locations/{location}/attributes/{attribute}` + * @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.apihub.v1.Attribute|Attribute}. + * 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/api_hub.get_attribute.js + * region_tag:apihub_v1_generated_ApiHub_GetAttribute_async + */ + getAttribute( + request?: protos.google.cloud.apihub.v1.IGetAttributeRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.apihub.v1.IAttribute, + protos.google.cloud.apihub.v1.IGetAttributeRequest|undefined, {}|undefined + ]>; + getAttribute( + request: protos.google.cloud.apihub.v1.IGetAttributeRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.IAttribute, + protos.google.cloud.apihub.v1.IGetAttributeRequest|null|undefined, + {}|null|undefined>): void; + getAttribute( + request: protos.google.cloud.apihub.v1.IGetAttributeRequest, + callback: Callback< + protos.google.cloud.apihub.v1.IAttribute, + protos.google.cloud.apihub.v1.IGetAttributeRequest|null|undefined, + {}|null|undefined>): void; + getAttribute( + request?: protos.google.cloud.apihub.v1.IGetAttributeRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.apihub.v1.IAttribute, + protos.google.cloud.apihub.v1.IGetAttributeRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.apihub.v1.IAttribute, + protos.google.cloud.apihub.v1.IGetAttributeRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.apihub.v1.IAttribute, + protos.google.cloud.apihub.v1.IGetAttributeRequest|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.getAttribute(request, options, callback); + } +/** + * Update the attribute. The following fields in the + * {@link protos.google.cloud.apihub.v1.Attribute|Attribute resource} can be updated: + * + * * {@link protos.google.cloud.apihub.v1.Attribute.display_name|display_name} + * The display name can be updated for user defined attributes only. + * * {@link protos.google.cloud.apihub.v1.Attribute.description|description} + * The description can be updated for user defined attributes only. + * * {@link protos.google.cloud.apihub.v1.Attribute.allowed_values|allowed_values} + * To update the list of allowed values, clients need to use the fetched list + * of allowed values and add or remove values to or from the same list. + * The mutable allowed values can be updated for both user defined and System + * defined attributes. The immutable allowed values cannot be updated or + * deleted. The updated list of allowed values cannot be empty. If an allowed + * value that is already used by some resource's attribute is deleted, then + * the association between the resource and the attribute value will also be + * deleted. + * * {@link protos.google.cloud.apihub.v1.Attribute.cardinality|cardinality} + * The cardinality can be updated for user defined attributes only. + * Cardinality can only be increased during an update. + * + * The + * {@link protos.google.cloud.apihub.v1.UpdateAttributeRequest.update_mask|update_mask} + * should be used to specify the fields being updated. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.apihub.v1.Attribute} request.attribute + * Required. The attribute to update. + * + * The attribute's `name` field is used to identify the attribute to update. + * Format: + * `projects/{project}/locations/{location}/attributes/{attribute}` + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The list of fields to update. + * @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.apihub.v1.Attribute|Attribute}. + * 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/api_hub.update_attribute.js + * region_tag:apihub_v1_generated_ApiHub_UpdateAttribute_async + */ + updateAttribute( + request?: protos.google.cloud.apihub.v1.IUpdateAttributeRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.apihub.v1.IAttribute, + protos.google.cloud.apihub.v1.IUpdateAttributeRequest|undefined, {}|undefined + ]>; + updateAttribute( + request: protos.google.cloud.apihub.v1.IUpdateAttributeRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.IAttribute, + protos.google.cloud.apihub.v1.IUpdateAttributeRequest|null|undefined, + {}|null|undefined>): void; + updateAttribute( + request: protos.google.cloud.apihub.v1.IUpdateAttributeRequest, + callback: Callback< + protos.google.cloud.apihub.v1.IAttribute, + protos.google.cloud.apihub.v1.IUpdateAttributeRequest|null|undefined, + {}|null|undefined>): void; + updateAttribute( + request?: protos.google.cloud.apihub.v1.IUpdateAttributeRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.apihub.v1.IAttribute, + protos.google.cloud.apihub.v1.IUpdateAttributeRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.apihub.v1.IAttribute, + protos.google.cloud.apihub.v1.IUpdateAttributeRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.apihub.v1.IAttribute, + protos.google.cloud.apihub.v1.IUpdateAttributeRequest|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({ + 'attribute.name': request.attribute!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateAttribute(request, options, callback); + } +/** + * Delete an attribute. + * + * Note: System defined attributes cannot be deleted. All + * associations of the attribute being deleted with any API hub resource will + * also get deleted. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the attribute to delete. + * Format: + * `projects/{project}/locations/{location}/attributes/{attribute}` + * @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.protobuf.Empty|Empty}. + * 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/api_hub.delete_attribute.js + * region_tag:apihub_v1_generated_ApiHub_DeleteAttribute_async + */ + deleteAttribute( + request?: protos.google.cloud.apihub.v1.IDeleteAttributeRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteAttributeRequest|undefined, {}|undefined + ]>; + deleteAttribute( + request: protos.google.cloud.apihub.v1.IDeleteAttributeRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteAttributeRequest|null|undefined, + {}|null|undefined>): void; + deleteAttribute( + request: protos.google.cloud.apihub.v1.IDeleteAttributeRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteAttributeRequest|null|undefined, + {}|null|undefined>): void; + deleteAttribute( + request?: protos.google.cloud.apihub.v1.IDeleteAttributeRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteAttributeRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteAttributeRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteAttributeRequest|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.deleteAttribute(request, options, callback); + } +/** + * Create an External API resource in the API hub. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource for the External API resource. + * Format: `projects/{project}/locations/{location}` + * @param {string} [request.externalApiId] + * Optional. The ID to use for the External API resource, which will become + * the final component of the External API's resource name. This field is + * optional. + * + * * If provided, the same will be used. The service will throw an error if + * the specified id is already used by another External API resource in the + * API hub. + * * If not provided, a system generated id will be used. + * + * This value should be 4-500 characters, and valid characters + * are /{@link protos.A-Z|a-z}[0-9]-_/. + * @param {google.cloud.apihub.v1.ExternalApi} request.externalApi + * Required. The External API resource to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.apihub.v1.ExternalApi|ExternalApi}. + * 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/api_hub.create_external_api.js + * region_tag:apihub_v1_generated_ApiHub_CreateExternalApi_async + */ + createExternalApi( + request?: protos.google.cloud.apihub.v1.ICreateExternalApiRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.apihub.v1.IExternalApi, + protos.google.cloud.apihub.v1.ICreateExternalApiRequest|undefined, {}|undefined + ]>; + createExternalApi( + request: protos.google.cloud.apihub.v1.ICreateExternalApiRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.IExternalApi, + protos.google.cloud.apihub.v1.ICreateExternalApiRequest|null|undefined, + {}|null|undefined>): void; + createExternalApi( + request: protos.google.cloud.apihub.v1.ICreateExternalApiRequest, + callback: Callback< + protos.google.cloud.apihub.v1.IExternalApi, + protos.google.cloud.apihub.v1.ICreateExternalApiRequest|null|undefined, + {}|null|undefined>): void; + createExternalApi( + request?: protos.google.cloud.apihub.v1.ICreateExternalApiRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.apihub.v1.IExternalApi, + protos.google.cloud.apihub.v1.ICreateExternalApiRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.apihub.v1.IExternalApi, + protos.google.cloud.apihub.v1.ICreateExternalApiRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.apihub.v1.IExternalApi, + protos.google.cloud.apihub.v1.ICreateExternalApiRequest|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.createExternalApi(request, options, callback); + } +/** + * Get details about an External API resource in the API hub. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the External API resource to retrieve. + * Format: + * `projects/{project}/locations/{location}/externalApis/{externalApi}` + * @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.apihub.v1.ExternalApi|ExternalApi}. + * 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/api_hub.get_external_api.js + * region_tag:apihub_v1_generated_ApiHub_GetExternalApi_async + */ + getExternalApi( + request?: protos.google.cloud.apihub.v1.IGetExternalApiRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.apihub.v1.IExternalApi, + protos.google.cloud.apihub.v1.IGetExternalApiRequest|undefined, {}|undefined + ]>; + getExternalApi( + request: protos.google.cloud.apihub.v1.IGetExternalApiRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.IExternalApi, + protos.google.cloud.apihub.v1.IGetExternalApiRequest|null|undefined, + {}|null|undefined>): void; + getExternalApi( + request: protos.google.cloud.apihub.v1.IGetExternalApiRequest, + callback: Callback< + protos.google.cloud.apihub.v1.IExternalApi, + protos.google.cloud.apihub.v1.IGetExternalApiRequest|null|undefined, + {}|null|undefined>): void; + getExternalApi( + request?: protos.google.cloud.apihub.v1.IGetExternalApiRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.apihub.v1.IExternalApi, + protos.google.cloud.apihub.v1.IGetExternalApiRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.apihub.v1.IExternalApi, + protos.google.cloud.apihub.v1.IGetExternalApiRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.apihub.v1.IExternalApi, + protos.google.cloud.apihub.v1.IGetExternalApiRequest|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.getExternalApi(request, options, callback); + } +/** + * Update an External API resource in the API hub. The following fields can be + * updated: + * + * * {@link protos.google.cloud.apihub.v1.ExternalApi.display_name|display_name} + * * {@link protos.google.cloud.apihub.v1.ExternalApi.description|description} + * * {@link protos.google.cloud.apihub.v1.ExternalApi.documentation|documentation} + * * {@link protos.google.cloud.apihub.v1.ExternalApi.endpoints|endpoints} + * * {@link protos.google.cloud.apihub.v1.ExternalApi.paths|paths} + * + * The + * {@link protos.google.cloud.apihub.v1.UpdateExternalApiRequest.update_mask|update_mask} + * should be used to specify the fields being updated. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.apihub.v1.ExternalApi} request.externalApi + * Required. The External API resource to update. + * + * The External API resource's `name` field is used to identify the External + * API resource to update. Format: + * `projects/{project}/locations/{location}/externalApis/{externalApi}` + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The list of fields to update. + * @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.apihub.v1.ExternalApi|ExternalApi}. + * 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/api_hub.update_external_api.js + * region_tag:apihub_v1_generated_ApiHub_UpdateExternalApi_async + */ + updateExternalApi( + request?: protos.google.cloud.apihub.v1.IUpdateExternalApiRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.apihub.v1.IExternalApi, + protos.google.cloud.apihub.v1.IUpdateExternalApiRequest|undefined, {}|undefined + ]>; + updateExternalApi( + request: protos.google.cloud.apihub.v1.IUpdateExternalApiRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.IExternalApi, + protos.google.cloud.apihub.v1.IUpdateExternalApiRequest|null|undefined, + {}|null|undefined>): void; + updateExternalApi( + request: protos.google.cloud.apihub.v1.IUpdateExternalApiRequest, + callback: Callback< + protos.google.cloud.apihub.v1.IExternalApi, + protos.google.cloud.apihub.v1.IUpdateExternalApiRequest|null|undefined, + {}|null|undefined>): void; + updateExternalApi( + request?: protos.google.cloud.apihub.v1.IUpdateExternalApiRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.apihub.v1.IExternalApi, + protos.google.cloud.apihub.v1.IUpdateExternalApiRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.apihub.v1.IExternalApi, + protos.google.cloud.apihub.v1.IUpdateExternalApiRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.apihub.v1.IExternalApi, + protos.google.cloud.apihub.v1.IUpdateExternalApiRequest|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({ + 'external_api.name': request.externalApi!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateExternalApi(request, options, callback); + } +/** + * Delete an External API resource in the API hub. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the External API resource to delete. + * Format: + * `projects/{project}/locations/{location}/externalApis/{externalApi}` + * @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.protobuf.Empty|Empty}. + * 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/api_hub.delete_external_api.js + * region_tag:apihub_v1_generated_ApiHub_DeleteExternalApi_async + */ + deleteExternalApi( + request?: protos.google.cloud.apihub.v1.IDeleteExternalApiRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteExternalApiRequest|undefined, {}|undefined + ]>; + deleteExternalApi( + request: protos.google.cloud.apihub.v1.IDeleteExternalApiRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteExternalApiRequest|null|undefined, + {}|null|undefined>): void; + deleteExternalApi( + request: protos.google.cloud.apihub.v1.IDeleteExternalApiRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteExternalApiRequest|null|undefined, + {}|null|undefined>): void; + deleteExternalApi( + request?: protos.google.cloud.apihub.v1.IDeleteExternalApiRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteExternalApiRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteExternalApiRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteExternalApiRequest|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.deleteExternalApi(request, options, callback); + } + + /** + * List API resources in the API hub. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of API resources. + * Format: `projects/{project}/locations/{location}` + * @param {string} [request.filter] + * Optional. An expression that filters the list of ApiResources. + * + * A filter expression consists of a field name, a comparison + * operator, and a value for filtering. The value must be a string. The + * comparison operator must be one of: `<`, `>`, `:` or `=`. Filters are not + * case sensitive. + * + * The following fields in the `ApiResource` are eligible for filtering: + * + * * `owner.email` - The email of the team which owns the ApiResource. + * Allowed comparison operators: `=`. + * * `create_time` - The time at which the ApiResource was created. The + * value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] + * format. Allowed comparison operators: `>` and `<`. + * * `display_name` - The display name of the ApiResource. Allowed + * comparison operators: `=`. + * * `target_user.enum_values.values.id` - The allowed value id of the + * target users attribute associated with the ApiResource. Allowed + * comparison operator is `:`. + * * `target_user.enum_values.values.display_name` - The allowed value + * display name of the target users attribute associated with the + * ApiResource. Allowed comparison operator is `:`. + * * `team.enum_values.values.id` - The allowed value id of the team + * attribute associated with the ApiResource. Allowed comparison operator is + * `:`. + * * `team.enum_values.values.display_name` - The allowed value display name + * of the team attribute associated with the ApiResource. Allowed comparison + * operator is `:`. + * * `business_unit.enum_values.values.id` - The allowed value id of the + * business unit attribute associated with the ApiResource. Allowed + * comparison operator is `:`. + * * `business_unit.enum_values.values.display_name` - The allowed value + * display name of the business unit attribute associated with the + * ApiResource. Allowed comparison operator is `:`. + * * `maturity_level.enum_values.values.id` - The allowed value id of the + * maturity level attribute associated with the ApiResource. Allowed + * comparison operator is `:`. + * * `maturity_level.enum_values.values.display_name` - The allowed value + * display name of the maturity level attribute associated with the + * ApiResource. Allowed comparison operator is `:`. + * * `api_style.enum_values.values.id` - The allowed value id of the + * api style attribute associated with the ApiResource. Allowed + * comparison operator is `:`. + * * `api_style.enum_values.values.display_name` - The allowed value display + * name of the api style attribute associated with the ApiResource. Allowed + * comparison operator is `:`. + * + * Expressions are combined with either `AND` logic operator or `OR` logical + * operator but not both of them together i.e. only one of the `AND` or `OR` + * operator can be used throughout the filter string and both the operators + * cannot be used together. No other logical operators are supported. At most + * three filter fields are allowed in the filter string and if provided + * more than that then `INVALID_ARGUMENT` error is returned by the API. + * + * Here are a few examples: + * + * * `owner.email = \"apihub@google.com\"` - - The owner team email is + * _apihub@google.com_. + * * `owner.email = \"apihub@google.com\" AND create_time < + * \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - + * The owner team email is _apihub@google.com_ and the api was created + * before _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_. + * * `owner.email = \"apihub@google.com\" OR team.enum_values.values.id: + * apihub-team-id` - The filter string specifies the APIs where the owner + * team email is _apihub@google.com_ or the id of the allowed value + * associated with the team attribute is _apihub-team-id_. + * * `owner.email = \"apihub@google.com\" OR + * team.enum_values.values.display_name: ApiHub Team` - The filter string + * specifies the APIs where the owner team email is _apihub@google.com_ or + * the display name of the allowed value associated with the team attribute + * is `ApiHub Team`. + * @param {number} [request.pageSize] + * Optional. The maximum number of API resources to return. The service may + * return fewer than this value. If unspecified, at most 50 Apis will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListApis` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters (except page_size) provided to + * `ListApis` must match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.apihub.v1.Api|Api}. + * 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 `listApisAsync()` + * 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. + */ + listApis( + request?: protos.google.cloud.apihub.v1.IListApisRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.apihub.v1.IApi[], + protos.google.cloud.apihub.v1.IListApisRequest|null, + protos.google.cloud.apihub.v1.IListApisResponse + ]>; + listApis( + request: protos.google.cloud.apihub.v1.IListApisRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.apihub.v1.IListApisRequest, + protos.google.cloud.apihub.v1.IListApisResponse|null|undefined, + protos.google.cloud.apihub.v1.IApi>): void; + listApis( + request: protos.google.cloud.apihub.v1.IListApisRequest, + callback: PaginationCallback< + protos.google.cloud.apihub.v1.IListApisRequest, + protos.google.cloud.apihub.v1.IListApisResponse|null|undefined, + protos.google.cloud.apihub.v1.IApi>): void; + listApis( + request?: protos.google.cloud.apihub.v1.IListApisRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.apihub.v1.IListApisRequest, + protos.google.cloud.apihub.v1.IListApisResponse|null|undefined, + protos.google.cloud.apihub.v1.IApi>, + callback?: PaginationCallback< + protos.google.cloud.apihub.v1.IListApisRequest, + protos.google.cloud.apihub.v1.IListApisResponse|null|undefined, + protos.google.cloud.apihub.v1.IApi>): + Promise<[ + protos.google.cloud.apihub.v1.IApi[], + protos.google.cloud.apihub.v1.IListApisRequest|null, + protos.google.cloud.apihub.v1.IListApisResponse + ]>|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.listApis(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of API resources. + * Format: `projects/{project}/locations/{location}` + * @param {string} [request.filter] + * Optional. An expression that filters the list of ApiResources. + * + * A filter expression consists of a field name, a comparison + * operator, and a value for filtering. The value must be a string. The + * comparison operator must be one of: `<`, `>`, `:` or `=`. Filters are not + * case sensitive. + * + * The following fields in the `ApiResource` are eligible for filtering: + * + * * `owner.email` - The email of the team which owns the ApiResource. + * Allowed comparison operators: `=`. + * * `create_time` - The time at which the ApiResource was created. The + * value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] + * format. Allowed comparison operators: `>` and `<`. + * * `display_name` - The display name of the ApiResource. Allowed + * comparison operators: `=`. + * * `target_user.enum_values.values.id` - The allowed value id of the + * target users attribute associated with the ApiResource. Allowed + * comparison operator is `:`. + * * `target_user.enum_values.values.display_name` - The allowed value + * display name of the target users attribute associated with the + * ApiResource. Allowed comparison operator is `:`. + * * `team.enum_values.values.id` - The allowed value id of the team + * attribute associated with the ApiResource. Allowed comparison operator is + * `:`. + * * `team.enum_values.values.display_name` - The allowed value display name + * of the team attribute associated with the ApiResource. Allowed comparison + * operator is `:`. + * * `business_unit.enum_values.values.id` - The allowed value id of the + * business unit attribute associated with the ApiResource. Allowed + * comparison operator is `:`. + * * `business_unit.enum_values.values.display_name` - The allowed value + * display name of the business unit attribute associated with the + * ApiResource. Allowed comparison operator is `:`. + * * `maturity_level.enum_values.values.id` - The allowed value id of the + * maturity level attribute associated with the ApiResource. Allowed + * comparison operator is `:`. + * * `maturity_level.enum_values.values.display_name` - The allowed value + * display name of the maturity level attribute associated with the + * ApiResource. Allowed comparison operator is `:`. + * * `api_style.enum_values.values.id` - The allowed value id of the + * api style attribute associated with the ApiResource. Allowed + * comparison operator is `:`. + * * `api_style.enum_values.values.display_name` - The allowed value display + * name of the api style attribute associated with the ApiResource. Allowed + * comparison operator is `:`. + * + * Expressions are combined with either `AND` logic operator or `OR` logical + * operator but not both of them together i.e. only one of the `AND` or `OR` + * operator can be used throughout the filter string and both the operators + * cannot be used together. No other logical operators are supported. At most + * three filter fields are allowed in the filter string and if provided + * more than that then `INVALID_ARGUMENT` error is returned by the API. + * + * Here are a few examples: + * + * * `owner.email = \"apihub@google.com\"` - - The owner team email is + * _apihub@google.com_. + * * `owner.email = \"apihub@google.com\" AND create_time < + * \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - + * The owner team email is _apihub@google.com_ and the api was created + * before _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_. + * * `owner.email = \"apihub@google.com\" OR team.enum_values.values.id: + * apihub-team-id` - The filter string specifies the APIs where the owner + * team email is _apihub@google.com_ or the id of the allowed value + * associated with the team attribute is _apihub-team-id_. + * * `owner.email = \"apihub@google.com\" OR + * team.enum_values.values.display_name: ApiHub Team` - The filter string + * specifies the APIs where the owner team email is _apihub@google.com_ or + * the display name of the allowed value associated with the team attribute + * is `ApiHub Team`. + * @param {number} [request.pageSize] + * Optional. The maximum number of API resources to return. The service may + * return fewer than this value. If unspecified, at most 50 Apis will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListApis` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters (except page_size) provided to + * `ListApis` must match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.apihub.v1.Api|Api} 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 `listApisAsync()` + * 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. + */ + listApisStream( + request?: protos.google.cloud.apihub.v1.IListApisRequest, + 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['listApis']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listApis.createStream( + this.innerApiCalls.listApis as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listApis`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of API resources. + * Format: `projects/{project}/locations/{location}` + * @param {string} [request.filter] + * Optional. An expression that filters the list of ApiResources. + * + * A filter expression consists of a field name, a comparison + * operator, and a value for filtering. The value must be a string. The + * comparison operator must be one of: `<`, `>`, `:` or `=`. Filters are not + * case sensitive. + * + * The following fields in the `ApiResource` are eligible for filtering: + * + * * `owner.email` - The email of the team which owns the ApiResource. + * Allowed comparison operators: `=`. + * * `create_time` - The time at which the ApiResource was created. The + * value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] + * format. Allowed comparison operators: `>` and `<`. + * * `display_name` - The display name of the ApiResource. Allowed + * comparison operators: `=`. + * * `target_user.enum_values.values.id` - The allowed value id of the + * target users attribute associated with the ApiResource. Allowed + * comparison operator is `:`. + * * `target_user.enum_values.values.display_name` - The allowed value + * display name of the target users attribute associated with the + * ApiResource. Allowed comparison operator is `:`. + * * `team.enum_values.values.id` - The allowed value id of the team + * attribute associated with the ApiResource. Allowed comparison operator is + * `:`. + * * `team.enum_values.values.display_name` - The allowed value display name + * of the team attribute associated with the ApiResource. Allowed comparison + * operator is `:`. + * * `business_unit.enum_values.values.id` - The allowed value id of the + * business unit attribute associated with the ApiResource. Allowed + * comparison operator is `:`. + * * `business_unit.enum_values.values.display_name` - The allowed value + * display name of the business unit attribute associated with the + * ApiResource. Allowed comparison operator is `:`. + * * `maturity_level.enum_values.values.id` - The allowed value id of the + * maturity level attribute associated with the ApiResource. Allowed + * comparison operator is `:`. + * * `maturity_level.enum_values.values.display_name` - The allowed value + * display name of the maturity level attribute associated with the + * ApiResource. Allowed comparison operator is `:`. + * * `api_style.enum_values.values.id` - The allowed value id of the + * api style attribute associated with the ApiResource. Allowed + * comparison operator is `:`. + * * `api_style.enum_values.values.display_name` - The allowed value display + * name of the api style attribute associated with the ApiResource. Allowed + * comparison operator is `:`. + * + * Expressions are combined with either `AND` logic operator or `OR` logical + * operator but not both of them together i.e. only one of the `AND` or `OR` + * operator can be used throughout the filter string and both the operators + * cannot be used together. No other logical operators are supported. At most + * three filter fields are allowed in the filter string and if provided + * more than that then `INVALID_ARGUMENT` error is returned by the API. + * + * Here are a few examples: + * + * * `owner.email = \"apihub@google.com\"` - - The owner team email is + * _apihub@google.com_. + * * `owner.email = \"apihub@google.com\" AND create_time < + * \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - + * The owner team email is _apihub@google.com_ and the api was created + * before _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_. + * * `owner.email = \"apihub@google.com\" OR team.enum_values.values.id: + * apihub-team-id` - The filter string specifies the APIs where the owner + * team email is _apihub@google.com_ or the id of the allowed value + * associated with the team attribute is _apihub-team-id_. + * * `owner.email = \"apihub@google.com\" OR + * team.enum_values.values.display_name: ApiHub Team` - The filter string + * specifies the APIs where the owner team email is _apihub@google.com_ or + * the display name of the allowed value associated with the team attribute + * is `ApiHub Team`. + * @param {number} [request.pageSize] + * Optional. The maximum number of API resources to return. The service may + * return fewer than this value. If unspecified, at most 50 Apis will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListApis` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters (except page_size) provided to + * `ListApis` must match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@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.apihub.v1.Api|Api}. 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/api_hub.list_apis.js + * region_tag:apihub_v1_generated_ApiHub_ListApis_async + */ + listApisAsync( + request?: protos.google.cloud.apihub.v1.IListApisRequest, + 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['listApis']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listApis.asyncIterate( + this.innerApiCalls['listApis'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * List API versions of an API resource in the API hub. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent which owns this collection of API versions i.e., the + * API resource Format: `projects/{project}/locations/{location}/apis/{api}` + * @param {string} [request.filter] + * Optional. An expression that filters the list of Versions. + * + * A filter expression consists of a field name, a comparison + * operator, and a value for filtering. The value must be a string, a + * number, or a boolean. The comparison operator must be one of: `<`, `>` or + * `=`. Filters are not case sensitive. + * + * The following fields in the `Version` are eligible for filtering: + * + * * `display_name` - The display name of the Version. Allowed + * comparison operators: `=`. + * * `create_time` - The time at which the Version was created. The + * value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] + * format. Allowed comparison operators: `>` and `<`. + * * `lifecycle.enum_values.values.id` - The allowed value id of the + * lifecycle attribute associated with the Version. Allowed comparison + * operators: `:`. + * * `lifecycle.enum_values.values.display_name` - The allowed value display + * name of the lifecycle attribute associated with the Version. Allowed + * comparison operators: `:`. + * * `compliance.enum_values.values.id` - The allowed value id of the + * compliances attribute associated with the Version. Allowed comparison + * operators: `:`. + * * `compliance.enum_values.values.display_name` - The allowed value + * display name of the compliances attribute associated with the Version. + * Allowed comparison operators: `:`. + * * `accreditation.enum_values.values.id` - The allowed value id of the + * accreditations attribute associated with the Version. Allowed + * comparison operators: `:`. + * * `accreditation.enum_values.values.display_name` - The allowed value + * display name of the accreditations attribute associated with the Version. + * Allowed comparison operators: `:`. + * + * Expressions are combined with either `AND` logic operator or `OR` logical + * operator but not both of them together i.e. only one of the `AND` or `OR` + * operator can be used throughout the filter string and both the operators + * cannot be used together. No other logical operators are + * supported. At most three filter fields are allowed in the filter + * string and if provided more than that then `INVALID_ARGUMENT` error is + * returned by the API. + * + * Here are a few examples: + * + * * `lifecycle.enum_values.values.id: preview-id` - The filter string + * specifies that the id of the allowed value associated with the lifecycle + * attribute of the Version is _preview-id_. + * * `lifecycle.enum_values.values.display_name: \"Preview Display Name\"` - + * The filter string specifies that the display name of the allowed value + * associated with the lifecycle attribute of the Version is `Preview + * Display Name`. + * * `lifecycle.enum_values.values.id: preview-id AND create_time < + * \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - + * The id of the allowed value associated with the lifecycle attribute of + * the Version is _preview-id_ and it was created before _2021-08-15 + * 14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_. + * * `compliance.enum_values.values.id: gdpr-id OR + * compliance.enum_values.values.id: pci-dss-id` + * - The id of the allowed value associated with the compliance attribute is + * _gdpr-id_ or _pci-dss-id_. + * @param {number} [request.pageSize] + * Optional. The maximum number of versions to return. The service may return + * fewer than this value. If unspecified, at most 50 versions will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListVersions` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters (except page_size) provided to + * `ListVersions` must match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.apihub.v1.Version|Version}. + * 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 `listVersionsAsync()` + * 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. + */ + listVersions( + request?: protos.google.cloud.apihub.v1.IListVersionsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.apihub.v1.IVersion[], + protos.google.cloud.apihub.v1.IListVersionsRequest|null, + protos.google.cloud.apihub.v1.IListVersionsResponse + ]>; + listVersions( + request: protos.google.cloud.apihub.v1.IListVersionsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.apihub.v1.IListVersionsRequest, + protos.google.cloud.apihub.v1.IListVersionsResponse|null|undefined, + protos.google.cloud.apihub.v1.IVersion>): void; + listVersions( + request: protos.google.cloud.apihub.v1.IListVersionsRequest, + callback: PaginationCallback< + protos.google.cloud.apihub.v1.IListVersionsRequest, + protos.google.cloud.apihub.v1.IListVersionsResponse|null|undefined, + protos.google.cloud.apihub.v1.IVersion>): void; + listVersions( + request?: protos.google.cloud.apihub.v1.IListVersionsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.apihub.v1.IListVersionsRequest, + protos.google.cloud.apihub.v1.IListVersionsResponse|null|undefined, + protos.google.cloud.apihub.v1.IVersion>, + callback?: PaginationCallback< + protos.google.cloud.apihub.v1.IListVersionsRequest, + protos.google.cloud.apihub.v1.IListVersionsResponse|null|undefined, + protos.google.cloud.apihub.v1.IVersion>): + Promise<[ + protos.google.cloud.apihub.v1.IVersion[], + protos.google.cloud.apihub.v1.IListVersionsRequest|null, + protos.google.cloud.apihub.v1.IListVersionsResponse + ]>|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.listVersions(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent which owns this collection of API versions i.e., the + * API resource Format: `projects/{project}/locations/{location}/apis/{api}` + * @param {string} [request.filter] + * Optional. An expression that filters the list of Versions. + * + * A filter expression consists of a field name, a comparison + * operator, and a value for filtering. The value must be a string, a + * number, or a boolean. The comparison operator must be one of: `<`, `>` or + * `=`. Filters are not case sensitive. + * + * The following fields in the `Version` are eligible for filtering: + * + * * `display_name` - The display name of the Version. Allowed + * comparison operators: `=`. + * * `create_time` - The time at which the Version was created. The + * value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] + * format. Allowed comparison operators: `>` and `<`. + * * `lifecycle.enum_values.values.id` - The allowed value id of the + * lifecycle attribute associated with the Version. Allowed comparison + * operators: `:`. + * * `lifecycle.enum_values.values.display_name` - The allowed value display + * name of the lifecycle attribute associated with the Version. Allowed + * comparison operators: `:`. + * * `compliance.enum_values.values.id` - The allowed value id of the + * compliances attribute associated with the Version. Allowed comparison + * operators: `:`. + * * `compliance.enum_values.values.display_name` - The allowed value + * display name of the compliances attribute associated with the Version. + * Allowed comparison operators: `:`. + * * `accreditation.enum_values.values.id` - The allowed value id of the + * accreditations attribute associated with the Version. Allowed + * comparison operators: `:`. + * * `accreditation.enum_values.values.display_name` - The allowed value + * display name of the accreditations attribute associated with the Version. + * Allowed comparison operators: `:`. + * + * Expressions are combined with either `AND` logic operator or `OR` logical + * operator but not both of them together i.e. only one of the `AND` or `OR` + * operator can be used throughout the filter string and both the operators + * cannot be used together. No other logical operators are + * supported. At most three filter fields are allowed in the filter + * string and if provided more than that then `INVALID_ARGUMENT` error is + * returned by the API. + * + * Here are a few examples: + * + * * `lifecycle.enum_values.values.id: preview-id` - The filter string + * specifies that the id of the allowed value associated with the lifecycle + * attribute of the Version is _preview-id_. + * * `lifecycle.enum_values.values.display_name: \"Preview Display Name\"` - + * The filter string specifies that the display name of the allowed value + * associated with the lifecycle attribute of the Version is `Preview + * Display Name`. + * * `lifecycle.enum_values.values.id: preview-id AND create_time < + * \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - + * The id of the allowed value associated with the lifecycle attribute of + * the Version is _preview-id_ and it was created before _2021-08-15 + * 14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_. + * * `compliance.enum_values.values.id: gdpr-id OR + * compliance.enum_values.values.id: pci-dss-id` + * - The id of the allowed value associated with the compliance attribute is + * _gdpr-id_ or _pci-dss-id_. + * @param {number} [request.pageSize] + * Optional. The maximum number of versions to return. The service may return + * fewer than this value. If unspecified, at most 50 versions will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListVersions` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters (except page_size) provided to + * `ListVersions` must match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.apihub.v1.Version|Version} 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 `listVersionsAsync()` + * 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. + */ + listVersionsStream( + request?: protos.google.cloud.apihub.v1.IListVersionsRequest, + 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['listVersions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listVersions.createStream( + this.innerApiCalls.listVersions as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listVersions`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent which owns this collection of API versions i.e., the + * API resource Format: `projects/{project}/locations/{location}/apis/{api}` + * @param {string} [request.filter] + * Optional. An expression that filters the list of Versions. + * + * A filter expression consists of a field name, a comparison + * operator, and a value for filtering. The value must be a string, a + * number, or a boolean. The comparison operator must be one of: `<`, `>` or + * `=`. Filters are not case sensitive. + * + * The following fields in the `Version` are eligible for filtering: + * + * * `display_name` - The display name of the Version. Allowed + * comparison operators: `=`. + * * `create_time` - The time at which the Version was created. The + * value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] + * format. Allowed comparison operators: `>` and `<`. + * * `lifecycle.enum_values.values.id` - The allowed value id of the + * lifecycle attribute associated with the Version. Allowed comparison + * operators: `:`. + * * `lifecycle.enum_values.values.display_name` - The allowed value display + * name of the lifecycle attribute associated with the Version. Allowed + * comparison operators: `:`. + * * `compliance.enum_values.values.id` - The allowed value id of the + * compliances attribute associated with the Version. Allowed comparison + * operators: `:`. + * * `compliance.enum_values.values.display_name` - The allowed value + * display name of the compliances attribute associated with the Version. + * Allowed comparison operators: `:`. + * * `accreditation.enum_values.values.id` - The allowed value id of the + * accreditations attribute associated with the Version. Allowed + * comparison operators: `:`. + * * `accreditation.enum_values.values.display_name` - The allowed value + * display name of the accreditations attribute associated with the Version. + * Allowed comparison operators: `:`. + * + * Expressions are combined with either `AND` logic operator or `OR` logical + * operator but not both of them together i.e. only one of the `AND` or `OR` + * operator can be used throughout the filter string and both the operators + * cannot be used together. No other logical operators are + * supported. At most three filter fields are allowed in the filter + * string and if provided more than that then `INVALID_ARGUMENT` error is + * returned by the API. + * + * Here are a few examples: + * + * * `lifecycle.enum_values.values.id: preview-id` - The filter string + * specifies that the id of the allowed value associated with the lifecycle + * attribute of the Version is _preview-id_. + * * `lifecycle.enum_values.values.display_name: \"Preview Display Name\"` - + * The filter string specifies that the display name of the allowed value + * associated with the lifecycle attribute of the Version is `Preview + * Display Name`. + * * `lifecycle.enum_values.values.id: preview-id AND create_time < + * \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - + * The id of the allowed value associated with the lifecycle attribute of + * the Version is _preview-id_ and it was created before _2021-08-15 + * 14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_. + * * `compliance.enum_values.values.id: gdpr-id OR + * compliance.enum_values.values.id: pci-dss-id` + * - The id of the allowed value associated with the compliance attribute is + * _gdpr-id_ or _pci-dss-id_. + * @param {number} [request.pageSize] + * Optional. The maximum number of versions to return. The service may return + * fewer than this value. If unspecified, at most 50 versions will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListVersions` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters (except page_size) provided to + * `ListVersions` must match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@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.apihub.v1.Version|Version}. 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/api_hub.list_versions.js + * region_tag:apihub_v1_generated_ApiHub_ListVersions_async + */ + listVersionsAsync( + request?: protos.google.cloud.apihub.v1.IListVersionsRequest, + 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['listVersions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listVersions.asyncIterate( + this.innerApiCalls['listVersions'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * List specs corresponding to a particular API resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of specs. + * Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}` + * @param {string} [request.filter] + * Optional. An expression that filters the list of Specs. + * + * A filter expression consists of a field name, a comparison + * operator, and a value for filtering. The value must be a string. The + * comparison operator must be one of: `<`, `>`, `:` or `=`. Filters are not + * case sensitive. + * + * The following fields in the `Spec` are eligible for filtering: + * + * * `display_name` - The display name of the Spec. Allowed comparison + * operators: `=`. + * * `create_time` - The time at which the Spec was created. The + * value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] + * format. Allowed comparison operators: `>` and `<`. + * * `spec_type.enum_values.values.id` - The allowed value id of the + * spec_type attribute associated with the Spec. Allowed comparison + * operators: `:`. + * * `spec_type.enum_values.values.display_name` - The allowed value display + * name of the spec_type attribute associated with the Spec. Allowed + * comparison operators: `:`. + * * `lint_response.json_values.values` - The json value of the + * lint_response attribute associated with the Spec. Allowed comparison + * operators: `:`. + * * `mime_type` - The MIME type of the Spec. Allowed comparison + * operators: `=`. + * + * Expressions are combined with either `AND` logic operator or `OR` logical + * operator but not both of them together i.e. only one of the `AND` or `OR` + * operator can be used throughout the filter string and both the operators + * cannot be used together. No other logical operators are + * supported. At most three filter fields are allowed in the filter + * string and if provided more than that then `INVALID_ARGUMENT` error is + * returned by the API. + * + * Here are a few examples: + * + * * `spec_type.enum_values.values.id: rest-id` - The filter + * string specifies that the id of the allowed value associated with the + * spec_type attribute is _rest-id_. + * * `spec_type.enum_values.values.display_name: \"Rest Display Name\"` - + * The filter string specifies that the display name of the allowed value + * associated with the spec_type attribute is `Rest Display Name`. + * * `spec_type.enum_values.values.id: grpc-id AND create_time < + * \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - + * The id of the allowed value associated with the spec_type attribute is + * _grpc-id_ and the spec was created before _2021-08-15 14:50:00 UTC_ and + * after _2021-08-10 12:00:00 UTC_. + * * `spec_type.enum_values.values.id: rest-id OR + * spec_type.enum_values.values.id: grpc-id` + * - The id of the allowed value associated with the spec_type attribute is + * _rest-id_ or _grpc-id_. + * @param {number} [request.pageSize] + * Optional. The maximum number of specs to return. The service may return + * fewer than this value. If unspecified, at most 50 specs will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListSpecs` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListSpecs` must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.apihub.v1.Spec|Spec}. + * 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 `listSpecsAsync()` + * 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. + */ + listSpecs( + request?: protos.google.cloud.apihub.v1.IListSpecsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.apihub.v1.ISpec[], + protos.google.cloud.apihub.v1.IListSpecsRequest|null, + protos.google.cloud.apihub.v1.IListSpecsResponse + ]>; + listSpecs( + request: protos.google.cloud.apihub.v1.IListSpecsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.apihub.v1.IListSpecsRequest, + protos.google.cloud.apihub.v1.IListSpecsResponse|null|undefined, + protos.google.cloud.apihub.v1.ISpec>): void; + listSpecs( + request: protos.google.cloud.apihub.v1.IListSpecsRequest, + callback: PaginationCallback< + protos.google.cloud.apihub.v1.IListSpecsRequest, + protos.google.cloud.apihub.v1.IListSpecsResponse|null|undefined, + protos.google.cloud.apihub.v1.ISpec>): void; + listSpecs( + request?: protos.google.cloud.apihub.v1.IListSpecsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.apihub.v1.IListSpecsRequest, + protos.google.cloud.apihub.v1.IListSpecsResponse|null|undefined, + protos.google.cloud.apihub.v1.ISpec>, + callback?: PaginationCallback< + protos.google.cloud.apihub.v1.IListSpecsRequest, + protos.google.cloud.apihub.v1.IListSpecsResponse|null|undefined, + protos.google.cloud.apihub.v1.ISpec>): + Promise<[ + protos.google.cloud.apihub.v1.ISpec[], + protos.google.cloud.apihub.v1.IListSpecsRequest|null, + protos.google.cloud.apihub.v1.IListSpecsResponse + ]>|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.listSpecs(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of specs. + * Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}` + * @param {string} [request.filter] + * Optional. An expression that filters the list of Specs. + * + * A filter expression consists of a field name, a comparison + * operator, and a value for filtering. The value must be a string. The + * comparison operator must be one of: `<`, `>`, `:` or `=`. Filters are not + * case sensitive. + * + * The following fields in the `Spec` are eligible for filtering: + * + * * `display_name` - The display name of the Spec. Allowed comparison + * operators: `=`. + * * `create_time` - The time at which the Spec was created. The + * value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] + * format. Allowed comparison operators: `>` and `<`. + * * `spec_type.enum_values.values.id` - The allowed value id of the + * spec_type attribute associated with the Spec. Allowed comparison + * operators: `:`. + * * `spec_type.enum_values.values.display_name` - The allowed value display + * name of the spec_type attribute associated with the Spec. Allowed + * comparison operators: `:`. + * * `lint_response.json_values.values` - The json value of the + * lint_response attribute associated with the Spec. Allowed comparison + * operators: `:`. + * * `mime_type` - The MIME type of the Spec. Allowed comparison + * operators: `=`. + * + * Expressions are combined with either `AND` logic operator or `OR` logical + * operator but not both of them together i.e. only one of the `AND` or `OR` + * operator can be used throughout the filter string and both the operators + * cannot be used together. No other logical operators are + * supported. At most three filter fields are allowed in the filter + * string and if provided more than that then `INVALID_ARGUMENT` error is + * returned by the API. + * + * Here are a few examples: + * + * * `spec_type.enum_values.values.id: rest-id` - The filter + * string specifies that the id of the allowed value associated with the + * spec_type attribute is _rest-id_. + * * `spec_type.enum_values.values.display_name: \"Rest Display Name\"` - + * The filter string specifies that the display name of the allowed value + * associated with the spec_type attribute is `Rest Display Name`. + * * `spec_type.enum_values.values.id: grpc-id AND create_time < + * \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - + * The id of the allowed value associated with the spec_type attribute is + * _grpc-id_ and the spec was created before _2021-08-15 14:50:00 UTC_ and + * after _2021-08-10 12:00:00 UTC_. + * * `spec_type.enum_values.values.id: rest-id OR + * spec_type.enum_values.values.id: grpc-id` + * - The id of the allowed value associated with the spec_type attribute is + * _rest-id_ or _grpc-id_. + * @param {number} [request.pageSize] + * Optional. The maximum number of specs to return. The service may return + * fewer than this value. If unspecified, at most 50 specs will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListSpecs` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListSpecs` must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.apihub.v1.Spec|Spec} 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 `listSpecsAsync()` + * 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. + */ + listSpecsStream( + request?: protos.google.cloud.apihub.v1.IListSpecsRequest, + 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['listSpecs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listSpecs.createStream( + this.innerApiCalls.listSpecs as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listSpecs`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of specs. + * Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}` + * @param {string} [request.filter] + * Optional. An expression that filters the list of Specs. + * + * A filter expression consists of a field name, a comparison + * operator, and a value for filtering. The value must be a string. The + * comparison operator must be one of: `<`, `>`, `:` or `=`. Filters are not + * case sensitive. + * + * The following fields in the `Spec` are eligible for filtering: + * + * * `display_name` - The display name of the Spec. Allowed comparison + * operators: `=`. + * * `create_time` - The time at which the Spec was created. The + * value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] + * format. Allowed comparison operators: `>` and `<`. + * * `spec_type.enum_values.values.id` - The allowed value id of the + * spec_type attribute associated with the Spec. Allowed comparison + * operators: `:`. + * * `spec_type.enum_values.values.display_name` - The allowed value display + * name of the spec_type attribute associated with the Spec. Allowed + * comparison operators: `:`. + * * `lint_response.json_values.values` - The json value of the + * lint_response attribute associated with the Spec. Allowed comparison + * operators: `:`. + * * `mime_type` - The MIME type of the Spec. Allowed comparison + * operators: `=`. + * + * Expressions are combined with either `AND` logic operator or `OR` logical + * operator but not both of them together i.e. only one of the `AND` or `OR` + * operator can be used throughout the filter string and both the operators + * cannot be used together. No other logical operators are + * supported. At most three filter fields are allowed in the filter + * string and if provided more than that then `INVALID_ARGUMENT` error is + * returned by the API. + * + * Here are a few examples: + * + * * `spec_type.enum_values.values.id: rest-id` - The filter + * string specifies that the id of the allowed value associated with the + * spec_type attribute is _rest-id_. + * * `spec_type.enum_values.values.display_name: \"Rest Display Name\"` - + * The filter string specifies that the display name of the allowed value + * associated with the spec_type attribute is `Rest Display Name`. + * * `spec_type.enum_values.values.id: grpc-id AND create_time < + * \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - + * The id of the allowed value associated with the spec_type attribute is + * _grpc-id_ and the spec was created before _2021-08-15 14:50:00 UTC_ and + * after _2021-08-10 12:00:00 UTC_. + * * `spec_type.enum_values.values.id: rest-id OR + * spec_type.enum_values.values.id: grpc-id` + * - The id of the allowed value associated with the spec_type attribute is + * _rest-id_ or _grpc-id_. + * @param {number} [request.pageSize] + * Optional. The maximum number of specs to return. The service may return + * fewer than this value. If unspecified, at most 50 specs will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListSpecs` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListSpecs` must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@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.apihub.v1.Spec|Spec}. 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/api_hub.list_specs.js + * region_tag:apihub_v1_generated_ApiHub_ListSpecs_async + */ + listSpecsAsync( + request?: protos.google.cloud.apihub.v1.IListSpecsRequest, + 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['listSpecs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listSpecs.asyncIterate( + this.innerApiCalls['listSpecs'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * List operations in an API version. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent which owns this collection of operations i.e., the API + * version. Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}` + * @param {string} [request.filter] + * Optional. An expression that filters the list of ApiOperations. + * + * A filter expression consists of a field name, a comparison + * operator, and a value for filtering. The value must be a string or a + * boolean. The comparison operator must be one of: `<`, `>` or + * `=`. Filters are not case sensitive. + * + * The following fields in the `ApiOperation` are eligible for filtering: + * * `name` - The ApiOperation resource name. Allowed comparison + * operators: + * `=`. + * * `details.http_operation.path.path` - The http operation's complete path + * relative to server endpoint. Allowed comparison operators: `=`. + * * `details.http_operation.method` - The http operation method type. + * Allowed comparison operators: `=`. + * * `details.deprecated` - Indicates if the ApiOperation is deprecated. + * Allowed values are True / False indicating the deprycation status of the + * ApiOperation. Allowed comparison operators: `=`. + * * `create_time` - The time at which the ApiOperation was created. The + * value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] + * format. Allowed comparison operators: `>` and `<`. + * + * Expressions are combined with either `AND` logic operator or `OR` logical + * operator but not both of them together i.e. only one of the `AND` or `OR` + * operator can be used throughout the filter string and both the operators + * cannot be used together. No other logical operators are supported. At most + * three filter fields are allowed in the filter string and if provided + * more than that then `INVALID_ARGUMENT` error is returned by the API. + * + * Here are a few examples: + * + * * `details.deprecated = True` - The ApiOperation is deprecated. + * * `details.http_operation.method = GET AND create_time < + * \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - + * The method of the http operation of the ApiOperation is _GET_ and the + * spec was created before _2021-08-15 14:50:00 UTC_ and after _2021-08-10 + * 12:00:00 UTC_. + * * `details.http_operation.method = GET OR details.http_operation.method = + * POST`. - The http operation of the method of ApiOperation is _GET_ or + * _POST_. + * @param {number} [request.pageSize] + * Optional. The maximum number of operations to return. The service may + * return fewer than this value. If unspecified, at most 50 operations will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListApiOperations` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters (except page_size) provided to + * `ListApiOperations` must match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.apihub.v1.ApiOperation|ApiOperation}. + * 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 `listApiOperationsAsync()` + * 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. + */ + listApiOperations( + request?: protos.google.cloud.apihub.v1.IListApiOperationsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.apihub.v1.IApiOperation[], + protos.google.cloud.apihub.v1.IListApiOperationsRequest|null, + protos.google.cloud.apihub.v1.IListApiOperationsResponse + ]>; + listApiOperations( + request: protos.google.cloud.apihub.v1.IListApiOperationsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.apihub.v1.IListApiOperationsRequest, + protos.google.cloud.apihub.v1.IListApiOperationsResponse|null|undefined, + protos.google.cloud.apihub.v1.IApiOperation>): void; + listApiOperations( + request: protos.google.cloud.apihub.v1.IListApiOperationsRequest, + callback: PaginationCallback< + protos.google.cloud.apihub.v1.IListApiOperationsRequest, + protos.google.cloud.apihub.v1.IListApiOperationsResponse|null|undefined, + protos.google.cloud.apihub.v1.IApiOperation>): void; + listApiOperations( + request?: protos.google.cloud.apihub.v1.IListApiOperationsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.apihub.v1.IListApiOperationsRequest, + protos.google.cloud.apihub.v1.IListApiOperationsResponse|null|undefined, + protos.google.cloud.apihub.v1.IApiOperation>, + callback?: PaginationCallback< + protos.google.cloud.apihub.v1.IListApiOperationsRequest, + protos.google.cloud.apihub.v1.IListApiOperationsResponse|null|undefined, + protos.google.cloud.apihub.v1.IApiOperation>): + Promise<[ + protos.google.cloud.apihub.v1.IApiOperation[], + protos.google.cloud.apihub.v1.IListApiOperationsRequest|null, + protos.google.cloud.apihub.v1.IListApiOperationsResponse + ]>|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.listApiOperations(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent which owns this collection of operations i.e., the API + * version. Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}` + * @param {string} [request.filter] + * Optional. An expression that filters the list of ApiOperations. + * + * A filter expression consists of a field name, a comparison + * operator, and a value for filtering. The value must be a string or a + * boolean. The comparison operator must be one of: `<`, `>` or + * `=`. Filters are not case sensitive. + * + * The following fields in the `ApiOperation` are eligible for filtering: + * * `name` - The ApiOperation resource name. Allowed comparison + * operators: + * `=`. + * * `details.http_operation.path.path` - The http operation's complete path + * relative to server endpoint. Allowed comparison operators: `=`. + * * `details.http_operation.method` - The http operation method type. + * Allowed comparison operators: `=`. + * * `details.deprecated` - Indicates if the ApiOperation is deprecated. + * Allowed values are True / False indicating the deprycation status of the + * ApiOperation. Allowed comparison operators: `=`. + * * `create_time` - The time at which the ApiOperation was created. The + * value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] + * format. Allowed comparison operators: `>` and `<`. + * + * Expressions are combined with either `AND` logic operator or `OR` logical + * operator but not both of them together i.e. only one of the `AND` or `OR` + * operator can be used throughout the filter string and both the operators + * cannot be used together. No other logical operators are supported. At most + * three filter fields are allowed in the filter string and if provided + * more than that then `INVALID_ARGUMENT` error is returned by the API. + * + * Here are a few examples: + * + * * `details.deprecated = True` - The ApiOperation is deprecated. + * * `details.http_operation.method = GET AND create_time < + * \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - + * The method of the http operation of the ApiOperation is _GET_ and the + * spec was created before _2021-08-15 14:50:00 UTC_ and after _2021-08-10 + * 12:00:00 UTC_. + * * `details.http_operation.method = GET OR details.http_operation.method = + * POST`. - The http operation of the method of ApiOperation is _GET_ or + * _POST_. + * @param {number} [request.pageSize] + * Optional. The maximum number of operations to return. The service may + * return fewer than this value. If unspecified, at most 50 operations will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListApiOperations` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters (except page_size) provided to + * `ListApiOperations` must match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.apihub.v1.ApiOperation|ApiOperation} 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 `listApiOperationsAsync()` + * 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. + */ + listApiOperationsStream( + request?: protos.google.cloud.apihub.v1.IListApiOperationsRequest, + 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['listApiOperations']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listApiOperations.createStream( + this.innerApiCalls.listApiOperations as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listApiOperations`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent which owns this collection of operations i.e., the API + * version. Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}` + * @param {string} [request.filter] + * Optional. An expression that filters the list of ApiOperations. + * + * A filter expression consists of a field name, a comparison + * operator, and a value for filtering. The value must be a string or a + * boolean. The comparison operator must be one of: `<`, `>` or + * `=`. Filters are not case sensitive. + * + * The following fields in the `ApiOperation` are eligible for filtering: + * * `name` - The ApiOperation resource name. Allowed comparison + * operators: + * `=`. + * * `details.http_operation.path.path` - The http operation's complete path + * relative to server endpoint. Allowed comparison operators: `=`. + * * `details.http_operation.method` - The http operation method type. + * Allowed comparison operators: `=`. + * * `details.deprecated` - Indicates if the ApiOperation is deprecated. + * Allowed values are True / False indicating the deprycation status of the + * ApiOperation. Allowed comparison operators: `=`. + * * `create_time` - The time at which the ApiOperation was created. The + * value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] + * format. Allowed comparison operators: `>` and `<`. + * + * Expressions are combined with either `AND` logic operator or `OR` logical + * operator but not both of them together i.e. only one of the `AND` or `OR` + * operator can be used throughout the filter string and both the operators + * cannot be used together. No other logical operators are supported. At most + * three filter fields are allowed in the filter string and if provided + * more than that then `INVALID_ARGUMENT` error is returned by the API. + * + * Here are a few examples: + * + * * `details.deprecated = True` - The ApiOperation is deprecated. + * * `details.http_operation.method = GET AND create_time < + * \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - + * The method of the http operation of the ApiOperation is _GET_ and the + * spec was created before _2021-08-15 14:50:00 UTC_ and after _2021-08-10 + * 12:00:00 UTC_. + * * `details.http_operation.method = GET OR details.http_operation.method = + * POST`. - The http operation of the method of ApiOperation is _GET_ or + * _POST_. + * @param {number} [request.pageSize] + * Optional. The maximum number of operations to return. The service may + * return fewer than this value. If unspecified, at most 50 operations will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListApiOperations` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters (except page_size) provided to + * `ListApiOperations` must match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@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.apihub.v1.ApiOperation|ApiOperation}. 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/api_hub.list_api_operations.js + * region_tag:apihub_v1_generated_ApiHub_ListApiOperations_async + */ + listApiOperationsAsync( + request?: protos.google.cloud.apihub.v1.IListApiOperationsRequest, + 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['listApiOperations']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listApiOperations.asyncIterate( + this.innerApiCalls['listApiOperations'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * List deployment resources in the API hub. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of deployment resources. + * Format: `projects/{project}/locations/{location}` + * @param {string} [request.filter] + * Optional. An expression that filters the list of Deployments. + * + * A filter expression consists of a field name, a comparison + * operator, and a value for filtering. The value must be a string. The + * comparison operator must be one of: `<`, `>` or + * `=`. Filters are not case sensitive. + * + * The following fields in the `Deployments` are eligible for filtering: + * + * * `display_name` - The display name of the Deployment. Allowed + * comparison operators: `=`. + * * `create_time` - The time at which the Deployment was created. The + * value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] + * format. Allowed comparison operators: `>` and `<`. + * * `resource_uri` - A URI to the deployment resource. Allowed + * comparison operators: `=`. + * * `api_versions` - The API versions linked to this deployment. Allowed + * comparison operators: `:`. + * * `deployment_type.enum_values.values.id` - The allowed value id of the + * deployment_type attribute associated with the Deployment. Allowed + * comparison operators: `:`. + * * `deployment_type.enum_values.values.display_name` - The allowed value + * display name of the deployment_type attribute associated with the + * Deployment. Allowed comparison operators: `:`. + * * `slo.string_values.values` -The allowed string value of the slo + * attribute associated with the deployment. Allowed comparison + * operators: `:`. + * * `environment.enum_values.values.id` - The allowed value id of the + * environment attribute associated with the deployment. Allowed + * comparison operators: `:`. + * * `environment.enum_values.values.display_name` - The allowed value + * display name of the environment attribute associated with the deployment. + * Allowed comparison operators: `:`. + * + * Expressions are combined with either `AND` logic operator or `OR` logical + * operator but not both of them together i.e. only one of the `AND` or `OR` + * operator can be used throughout the filter string and both the operators + * cannot be used together. No other logical operators are supported. At most + * three filter fields are allowed in the filter string and if provided + * more than that then `INVALID_ARGUMENT` error is returned by the API. + * + * Here are a few examples: + * + * * `environment.enum_values.values.id: staging-id` - The allowed value id + * of the environment attribute associated with the Deployment is + * _staging-id_. + * * `environment.enum_values.values.display_name: \"Staging Deployment\"` - + * The allowed value display name of the environment attribute associated + * with the Deployment is `Staging Deployment`. + * * `environment.enum_values.values.id: production-id AND create_time < + * \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - + * The allowed value id of the environment attribute associated with the + * Deployment is _production-id_ and Deployment was created before + * _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_. + * * `environment.enum_values.values.id: production-id OR + * slo.string_values.values: \"99.99%\"` + * - The allowed value id of the environment attribute Deployment is + * _production-id_ or string value of the slo attribute is _99.99%_. + * @param {number} [request.pageSize] + * Optional. The maximum number of deployment resources to return. The service + * may return fewer than this value. If unspecified, at most 50 deployments + * will be returned. The maximum value is 1000; values above 1000 will be + * coerced to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListDeployments` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters (except page_size) provided to + * `ListDeployments` must match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.apihub.v1.Deployment|Deployment}. + * 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 `listDeploymentsAsync()` + * 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. + */ + listDeployments( + request?: protos.google.cloud.apihub.v1.IListDeploymentsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.apihub.v1.IDeployment[], + protos.google.cloud.apihub.v1.IListDeploymentsRequest|null, + protos.google.cloud.apihub.v1.IListDeploymentsResponse + ]>; + listDeployments( + request: protos.google.cloud.apihub.v1.IListDeploymentsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.apihub.v1.IListDeploymentsRequest, + protos.google.cloud.apihub.v1.IListDeploymentsResponse|null|undefined, + protos.google.cloud.apihub.v1.IDeployment>): void; + listDeployments( + request: protos.google.cloud.apihub.v1.IListDeploymentsRequest, + callback: PaginationCallback< + protos.google.cloud.apihub.v1.IListDeploymentsRequest, + protos.google.cloud.apihub.v1.IListDeploymentsResponse|null|undefined, + protos.google.cloud.apihub.v1.IDeployment>): void; + listDeployments( + request?: protos.google.cloud.apihub.v1.IListDeploymentsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.apihub.v1.IListDeploymentsRequest, + protos.google.cloud.apihub.v1.IListDeploymentsResponse|null|undefined, + protos.google.cloud.apihub.v1.IDeployment>, + callback?: PaginationCallback< + protos.google.cloud.apihub.v1.IListDeploymentsRequest, + protos.google.cloud.apihub.v1.IListDeploymentsResponse|null|undefined, + protos.google.cloud.apihub.v1.IDeployment>): + Promise<[ + protos.google.cloud.apihub.v1.IDeployment[], + protos.google.cloud.apihub.v1.IListDeploymentsRequest|null, + protos.google.cloud.apihub.v1.IListDeploymentsResponse + ]>|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.listDeployments(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of deployment resources. + * Format: `projects/{project}/locations/{location}` + * @param {string} [request.filter] + * Optional. An expression that filters the list of Deployments. + * + * A filter expression consists of a field name, a comparison + * operator, and a value for filtering. The value must be a string. The + * comparison operator must be one of: `<`, `>` or + * `=`. Filters are not case sensitive. + * + * The following fields in the `Deployments` are eligible for filtering: + * + * * `display_name` - The display name of the Deployment. Allowed + * comparison operators: `=`. + * * `create_time` - The time at which the Deployment was created. The + * value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] + * format. Allowed comparison operators: `>` and `<`. + * * `resource_uri` - A URI to the deployment resource. Allowed + * comparison operators: `=`. + * * `api_versions` - The API versions linked to this deployment. Allowed + * comparison operators: `:`. + * * `deployment_type.enum_values.values.id` - The allowed value id of the + * deployment_type attribute associated with the Deployment. Allowed + * comparison operators: `:`. + * * `deployment_type.enum_values.values.display_name` - The allowed value + * display name of the deployment_type attribute associated with the + * Deployment. Allowed comparison operators: `:`. + * * `slo.string_values.values` -The allowed string value of the slo + * attribute associated with the deployment. Allowed comparison + * operators: `:`. + * * `environment.enum_values.values.id` - The allowed value id of the + * environment attribute associated with the deployment. Allowed + * comparison operators: `:`. + * * `environment.enum_values.values.display_name` - The allowed value + * display name of the environment attribute associated with the deployment. + * Allowed comparison operators: `:`. + * + * Expressions are combined with either `AND` logic operator or `OR` logical + * operator but not both of them together i.e. only one of the `AND` or `OR` + * operator can be used throughout the filter string and both the operators + * cannot be used together. No other logical operators are supported. At most + * three filter fields are allowed in the filter string and if provided + * more than that then `INVALID_ARGUMENT` error is returned by the API. + * + * Here are a few examples: + * + * * `environment.enum_values.values.id: staging-id` - The allowed value id + * of the environment attribute associated with the Deployment is + * _staging-id_. + * * `environment.enum_values.values.display_name: \"Staging Deployment\"` - + * The allowed value display name of the environment attribute associated + * with the Deployment is `Staging Deployment`. + * * `environment.enum_values.values.id: production-id AND create_time < + * \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - + * The allowed value id of the environment attribute associated with the + * Deployment is _production-id_ and Deployment was created before + * _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_. + * * `environment.enum_values.values.id: production-id OR + * slo.string_values.values: \"99.99%\"` + * - The allowed value id of the environment attribute Deployment is + * _production-id_ or string value of the slo attribute is _99.99%_. + * @param {number} [request.pageSize] + * Optional. The maximum number of deployment resources to return. The service + * may return fewer than this value. If unspecified, at most 50 deployments + * will be returned. The maximum value is 1000; values above 1000 will be + * coerced to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListDeployments` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters (except page_size) provided to + * `ListDeployments` must match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.apihub.v1.Deployment|Deployment} 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 `listDeploymentsAsync()` + * 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. + */ + listDeploymentsStream( + request?: protos.google.cloud.apihub.v1.IListDeploymentsRequest, + 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['listDeployments']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listDeployments.createStream( + this.innerApiCalls.listDeployments as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listDeployments`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of deployment resources. + * Format: `projects/{project}/locations/{location}` + * @param {string} [request.filter] + * Optional. An expression that filters the list of Deployments. + * + * A filter expression consists of a field name, a comparison + * operator, and a value for filtering. The value must be a string. The + * comparison operator must be one of: `<`, `>` or + * `=`. Filters are not case sensitive. + * + * The following fields in the `Deployments` are eligible for filtering: + * + * * `display_name` - The display name of the Deployment. Allowed + * comparison operators: `=`. + * * `create_time` - The time at which the Deployment was created. The + * value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] + * format. Allowed comparison operators: `>` and `<`. + * * `resource_uri` - A URI to the deployment resource. Allowed + * comparison operators: `=`. + * * `api_versions` - The API versions linked to this deployment. Allowed + * comparison operators: `:`. + * * `deployment_type.enum_values.values.id` - The allowed value id of the + * deployment_type attribute associated with the Deployment. Allowed + * comparison operators: `:`. + * * `deployment_type.enum_values.values.display_name` - The allowed value + * display name of the deployment_type attribute associated with the + * Deployment. Allowed comparison operators: `:`. + * * `slo.string_values.values` -The allowed string value of the slo + * attribute associated with the deployment. Allowed comparison + * operators: `:`. + * * `environment.enum_values.values.id` - The allowed value id of the + * environment attribute associated with the deployment. Allowed + * comparison operators: `:`. + * * `environment.enum_values.values.display_name` - The allowed value + * display name of the environment attribute associated with the deployment. + * Allowed comparison operators: `:`. + * + * Expressions are combined with either `AND` logic operator or `OR` logical + * operator but not both of them together i.e. only one of the `AND` or `OR` + * operator can be used throughout the filter string and both the operators + * cannot be used together. No other logical operators are supported. At most + * three filter fields are allowed in the filter string and if provided + * more than that then `INVALID_ARGUMENT` error is returned by the API. + * + * Here are a few examples: + * + * * `environment.enum_values.values.id: staging-id` - The allowed value id + * of the environment attribute associated with the Deployment is + * _staging-id_. + * * `environment.enum_values.values.display_name: \"Staging Deployment\"` - + * The allowed value display name of the environment attribute associated + * with the Deployment is `Staging Deployment`. + * * `environment.enum_values.values.id: production-id AND create_time < + * \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - + * The allowed value id of the environment attribute associated with the + * Deployment is _production-id_ and Deployment was created before + * _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_. + * * `environment.enum_values.values.id: production-id OR + * slo.string_values.values: \"99.99%\"` + * - The allowed value id of the environment attribute Deployment is + * _production-id_ or string value of the slo attribute is _99.99%_. + * @param {number} [request.pageSize] + * Optional. The maximum number of deployment resources to return. The service + * may return fewer than this value. If unspecified, at most 50 deployments + * will be returned. The maximum value is 1000; values above 1000 will be + * coerced to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListDeployments` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters (except page_size) provided to + * `ListDeployments` must match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@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.apihub.v1.Deployment|Deployment}. 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/api_hub.list_deployments.js + * region_tag:apihub_v1_generated_ApiHub_ListDeployments_async + */ + listDeploymentsAsync( + request?: protos.google.cloud.apihub.v1.IListDeploymentsRequest, + 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['listDeployments']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listDeployments.asyncIterate( + this.innerApiCalls['listDeployments'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * List all attributes. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource for Attribute. + * Format: `projects/{project}/locations/{location}` + * @param {string} [request.filter] + * Optional. An expression that filters the list of Attributes. + * + * A filter expression consists of a field name, a comparison + * operator, and a value for filtering. The value must be a string or a + * boolean. The comparison operator must be one of: `<`, `>` or + * `=`. Filters are not case sensitive. + * + * The following fields in the `Attribute` are eligible for filtering: + * + * * `display_name` - The display name of the Attribute. Allowed + * comparison operators: `=`. + * * `definition_type` - The definition type of the attribute. Allowed + * comparison operators: `=`. + * * `scope` - The scope of the attribute. Allowed comparison operators: + * `=`. + * * `data_type` - The type of the data of the attribute. Allowed + * comparison operators: `=`. + * * `mandatory` - Denotes whether the attribute is mandatory or not. + * Allowed comparison operators: `=`. + * * `create_time` - The time at which the Attribute was created. The + * value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] + * format. Allowed comparison operators: `>` and `<`. + * + * Expressions are combined with either `AND` logic operator or `OR` logical + * operator but not both of them together i.e. only one of the `AND` or `OR` + * operator can be used throughout the filter string and both the operators + * cannot be used together. No other logical operators are + * supported. At most three filter fields are allowed in the filter + * string and if provided more than that then `INVALID_ARGUMENT` error is + * returned by the API. + * + * Here are a few examples: + * + * * `display_name = production` - - The display name of the attribute is + * _production_. + * * `(display_name = production) AND (create_time < + * \"2021-08-15T14:50:00Z\") AND (create_time > \"2021-08-10T12:00:00Z\")` - + * The display name of the attribute is _production_ and the attribute was + * created before _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00 + * UTC_. + * * `display_name = production OR scope = api` - + * The attribute where the display name is _production_ or the scope is + * _api_. + * @param {number} [request.pageSize] + * Optional. The maximum number of attribute resources to return. The service + * may return fewer than this value. If unspecified, at most 50 attributes + * will be returned. The maximum value is 1000; values above 1000 will be + * coerced to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListAttributes` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListAttributes` must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.apihub.v1.Attribute|Attribute}. + * 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 `listAttributesAsync()` + * 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. + */ + listAttributes( + request?: protos.google.cloud.apihub.v1.IListAttributesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.apihub.v1.IAttribute[], + protos.google.cloud.apihub.v1.IListAttributesRequest|null, + protos.google.cloud.apihub.v1.IListAttributesResponse + ]>; + listAttributes( + request: protos.google.cloud.apihub.v1.IListAttributesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.apihub.v1.IListAttributesRequest, + protos.google.cloud.apihub.v1.IListAttributesResponse|null|undefined, + protos.google.cloud.apihub.v1.IAttribute>): void; + listAttributes( + request: protos.google.cloud.apihub.v1.IListAttributesRequest, + callback: PaginationCallback< + protos.google.cloud.apihub.v1.IListAttributesRequest, + protos.google.cloud.apihub.v1.IListAttributesResponse|null|undefined, + protos.google.cloud.apihub.v1.IAttribute>): void; + listAttributes( + request?: protos.google.cloud.apihub.v1.IListAttributesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.apihub.v1.IListAttributesRequest, + protos.google.cloud.apihub.v1.IListAttributesResponse|null|undefined, + protos.google.cloud.apihub.v1.IAttribute>, + callback?: PaginationCallback< + protos.google.cloud.apihub.v1.IListAttributesRequest, + protos.google.cloud.apihub.v1.IListAttributesResponse|null|undefined, + protos.google.cloud.apihub.v1.IAttribute>): + Promise<[ + protos.google.cloud.apihub.v1.IAttribute[], + protos.google.cloud.apihub.v1.IListAttributesRequest|null, + protos.google.cloud.apihub.v1.IListAttributesResponse + ]>|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.listAttributes(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource for Attribute. + * Format: `projects/{project}/locations/{location}` + * @param {string} [request.filter] + * Optional. An expression that filters the list of Attributes. + * + * A filter expression consists of a field name, a comparison + * operator, and a value for filtering. The value must be a string or a + * boolean. The comparison operator must be one of: `<`, `>` or + * `=`. Filters are not case sensitive. + * + * The following fields in the `Attribute` are eligible for filtering: + * + * * `display_name` - The display name of the Attribute. Allowed + * comparison operators: `=`. + * * `definition_type` - The definition type of the attribute. Allowed + * comparison operators: `=`. + * * `scope` - The scope of the attribute. Allowed comparison operators: + * `=`. + * * `data_type` - The type of the data of the attribute. Allowed + * comparison operators: `=`. + * * `mandatory` - Denotes whether the attribute is mandatory or not. + * Allowed comparison operators: `=`. + * * `create_time` - The time at which the Attribute was created. The + * value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] + * format. Allowed comparison operators: `>` and `<`. + * + * Expressions are combined with either `AND` logic operator or `OR` logical + * operator but not both of them together i.e. only one of the `AND` or `OR` + * operator can be used throughout the filter string and both the operators + * cannot be used together. No other logical operators are + * supported. At most three filter fields are allowed in the filter + * string and if provided more than that then `INVALID_ARGUMENT` error is + * returned by the API. + * + * Here are a few examples: + * + * * `display_name = production` - - The display name of the attribute is + * _production_. + * * `(display_name = production) AND (create_time < + * \"2021-08-15T14:50:00Z\") AND (create_time > \"2021-08-10T12:00:00Z\")` - + * The display name of the attribute is _production_ and the attribute was + * created before _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00 + * UTC_. + * * `display_name = production OR scope = api` - + * The attribute where the display name is _production_ or the scope is + * _api_. + * @param {number} [request.pageSize] + * Optional. The maximum number of attribute resources to return. The service + * may return fewer than this value. If unspecified, at most 50 attributes + * will be returned. The maximum value is 1000; values above 1000 will be + * coerced to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListAttributes` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListAttributes` must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.apihub.v1.Attribute|Attribute} 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 `listAttributesAsync()` + * 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. + */ + listAttributesStream( + request?: protos.google.cloud.apihub.v1.IListAttributesRequest, + 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['listAttributes']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listAttributes.createStream( + this.innerApiCalls.listAttributes as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listAttributes`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource for Attribute. + * Format: `projects/{project}/locations/{location}` + * @param {string} [request.filter] + * Optional. An expression that filters the list of Attributes. + * + * A filter expression consists of a field name, a comparison + * operator, and a value for filtering. The value must be a string or a + * boolean. The comparison operator must be one of: `<`, `>` or + * `=`. Filters are not case sensitive. + * + * The following fields in the `Attribute` are eligible for filtering: + * + * * `display_name` - The display name of the Attribute. Allowed + * comparison operators: `=`. + * * `definition_type` - The definition type of the attribute. Allowed + * comparison operators: `=`. + * * `scope` - The scope of the attribute. Allowed comparison operators: + * `=`. + * * `data_type` - The type of the data of the attribute. Allowed + * comparison operators: `=`. + * * `mandatory` - Denotes whether the attribute is mandatory or not. + * Allowed comparison operators: `=`. + * * `create_time` - The time at which the Attribute was created. The + * value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] + * format. Allowed comparison operators: `>` and `<`. + * + * Expressions are combined with either `AND` logic operator or `OR` logical + * operator but not both of them together i.e. only one of the `AND` or `OR` + * operator can be used throughout the filter string and both the operators + * cannot be used together. No other logical operators are + * supported. At most three filter fields are allowed in the filter + * string and if provided more than that then `INVALID_ARGUMENT` error is + * returned by the API. + * + * Here are a few examples: + * + * * `display_name = production` - - The display name of the attribute is + * _production_. + * * `(display_name = production) AND (create_time < + * \"2021-08-15T14:50:00Z\") AND (create_time > \"2021-08-10T12:00:00Z\")` - + * The display name of the attribute is _production_ and the attribute was + * created before _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00 + * UTC_. + * * `display_name = production OR scope = api` - + * The attribute where the display name is _production_ or the scope is + * _api_. + * @param {number} [request.pageSize] + * Optional. The maximum number of attribute resources to return. The service + * may return fewer than this value. If unspecified, at most 50 attributes + * will be returned. The maximum value is 1000; values above 1000 will be + * coerced to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListAttributes` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListAttributes` must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@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.apihub.v1.Attribute|Attribute}. 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/api_hub.list_attributes.js + * region_tag:apihub_v1_generated_ApiHub_ListAttributes_async + */ + listAttributesAsync( + request?: protos.google.cloud.apihub.v1.IListAttributesRequest, + 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['listAttributes']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listAttributes.asyncIterate( + this.innerApiCalls['listAttributes'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Search across API-Hub resources. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.location + * Required. The resource name of the location which will be of the type + * `projects/{project_id}/locations/{location_id}`. This field is used to + * identify the instance of API-Hub in which resources should be searched. + * @param {string} request.query + * Required. The free text search query. This query can contain keywords which + * could be related to any detail of the API-Hub resources such display names, + * descriptions, attributes etc. + * @param {string} [request.filter] + * Optional. An expression that filters the list of search results. + * + * A filter expression consists of a field name, a comparison operator, + * and a value for filtering. The value must be a string, a number, or a + * boolean. The comparison operator must be `=`. Filters are not case + * sensitive. + * + * The following field names are eligible for filtering: + * * `resource_type` - The type of resource in the search results. + * Must be one of the following: `Api`, `ApiOperation`, `Deployment`, + * `Definition`, `Spec` or `Version`. This field can only be specified once + * in the filter. + * + * Here are is an example: + * + * * `resource_type = Api` - The resource_type is _Api_. + * @param {number} [request.pageSize] + * Optional. The maximum number of search results to return. The service may + * return fewer than this value. If unspecified at most 10 search results will + * be returned. If value is negative then `INVALID_ARGUMENT` error is + * returned. The maximum value is 25; values above 25 will be coerced to 25. + * While paginating, you can specify a new page size parameter for each page + * of search results to be listed. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous + * {@link protos.SearchResources|SearchResources} + * call. Specify this parameter to retrieve the next page of transactions. + * + * When paginating, you must specify the `page_token` parameter and all the + * other parameters except + * {@link protos.google.cloud.apihub.v1.SearchResourcesRequest.page_size|page_size} + * should be specified with the same value which was used in the previous + * call. If the other fields are set with a different value than the previous + * call then `INVALID_ARGUMENT` error is returned. + * @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.apihub.v1.SearchResult|SearchResult}. + * 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 `searchResourcesAsync()` + * 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. + */ + searchResources( + request?: protos.google.cloud.apihub.v1.ISearchResourcesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.apihub.v1.ISearchResult[], + protos.google.cloud.apihub.v1.ISearchResourcesRequest|null, + protos.google.cloud.apihub.v1.ISearchResourcesResponse + ]>; + searchResources( + request: protos.google.cloud.apihub.v1.ISearchResourcesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.apihub.v1.ISearchResourcesRequest, + protos.google.cloud.apihub.v1.ISearchResourcesResponse|null|undefined, + protos.google.cloud.apihub.v1.ISearchResult>): void; + searchResources( + request: protos.google.cloud.apihub.v1.ISearchResourcesRequest, + callback: PaginationCallback< + protos.google.cloud.apihub.v1.ISearchResourcesRequest, + protos.google.cloud.apihub.v1.ISearchResourcesResponse|null|undefined, + protos.google.cloud.apihub.v1.ISearchResult>): void; + searchResources( + request?: protos.google.cloud.apihub.v1.ISearchResourcesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.apihub.v1.ISearchResourcesRequest, + protos.google.cloud.apihub.v1.ISearchResourcesResponse|null|undefined, + protos.google.cloud.apihub.v1.ISearchResult>, + callback?: PaginationCallback< + protos.google.cloud.apihub.v1.ISearchResourcesRequest, + protos.google.cloud.apihub.v1.ISearchResourcesResponse|null|undefined, + protos.google.cloud.apihub.v1.ISearchResult>): + Promise<[ + protos.google.cloud.apihub.v1.ISearchResult[], + protos.google.cloud.apihub.v1.ISearchResourcesRequest|null, + protos.google.cloud.apihub.v1.ISearchResourcesResponse + ]>|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({ + 'location': request.location ?? '', + }); + this.initialize(); + return this.innerApiCalls.searchResources(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.location + * Required. The resource name of the location which will be of the type + * `projects/{project_id}/locations/{location_id}`. This field is used to + * identify the instance of API-Hub in which resources should be searched. + * @param {string} request.query + * Required. The free text search query. This query can contain keywords which + * could be related to any detail of the API-Hub resources such display names, + * descriptions, attributes etc. + * @param {string} [request.filter] + * Optional. An expression that filters the list of search results. + * + * A filter expression consists of a field name, a comparison operator, + * and a value for filtering. The value must be a string, a number, or a + * boolean. The comparison operator must be `=`. Filters are not case + * sensitive. + * + * The following field names are eligible for filtering: + * * `resource_type` - The type of resource in the search results. + * Must be one of the following: `Api`, `ApiOperation`, `Deployment`, + * `Definition`, `Spec` or `Version`. This field can only be specified once + * in the filter. + * + * Here are is an example: + * + * * `resource_type = Api` - The resource_type is _Api_. + * @param {number} [request.pageSize] + * Optional. The maximum number of search results to return. The service may + * return fewer than this value. If unspecified at most 10 search results will + * be returned. If value is negative then `INVALID_ARGUMENT` error is + * returned. The maximum value is 25; values above 25 will be coerced to 25. + * While paginating, you can specify a new page size parameter for each page + * of search results to be listed. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous + * {@link protos.SearchResources|SearchResources} + * call. Specify this parameter to retrieve the next page of transactions. + * + * When paginating, you must specify the `page_token` parameter and all the + * other parameters except + * {@link protos.google.cloud.apihub.v1.SearchResourcesRequest.page_size|page_size} + * should be specified with the same value which was used in the previous + * call. If the other fields are set with a different value than the previous + * call then `INVALID_ARGUMENT` error is returned. + * @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.apihub.v1.SearchResult|SearchResult} 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 `searchResourcesAsync()` + * 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. + */ + searchResourcesStream( + request?: protos.google.cloud.apihub.v1.ISearchResourcesRequest, + 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({ + 'location': request.location ?? '', + }); + const defaultCallSettings = this._defaults['searchResources']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.searchResources.createStream( + this.innerApiCalls.searchResources as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `searchResources`, 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.location + * Required. The resource name of the location which will be of the type + * `projects/{project_id}/locations/{location_id}`. This field is used to + * identify the instance of API-Hub in which resources should be searched. + * @param {string} request.query + * Required. The free text search query. This query can contain keywords which + * could be related to any detail of the API-Hub resources such display names, + * descriptions, attributes etc. + * @param {string} [request.filter] + * Optional. An expression that filters the list of search results. + * + * A filter expression consists of a field name, a comparison operator, + * and a value for filtering. The value must be a string, a number, or a + * boolean. The comparison operator must be `=`. Filters are not case + * sensitive. + * + * The following field names are eligible for filtering: + * * `resource_type` - The type of resource in the search results. + * Must be one of the following: `Api`, `ApiOperation`, `Deployment`, + * `Definition`, `Spec` or `Version`. This field can only be specified once + * in the filter. + * + * Here are is an example: + * + * * `resource_type = Api` - The resource_type is _Api_. + * @param {number} [request.pageSize] + * Optional. The maximum number of search results to return. The service may + * return fewer than this value. If unspecified at most 10 search results will + * be returned. If value is negative then `INVALID_ARGUMENT` error is + * returned. The maximum value is 25; values above 25 will be coerced to 25. + * While paginating, you can specify a new page size parameter for each page + * of search results to be listed. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous + * {@link protos.SearchResources|SearchResources} + * call. Specify this parameter to retrieve the next page of transactions. + * + * When paginating, you must specify the `page_token` parameter and all the + * other parameters except + * {@link protos.google.cloud.apihub.v1.SearchResourcesRequest.page_size|page_size} + * should be specified with the same value which was used in the previous + * call. If the other fields are set with a different value than the previous + * call then `INVALID_ARGUMENT` error is returned. + * @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.apihub.v1.SearchResult|SearchResult}. 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/api_hub.search_resources.js + * region_tag:apihub_v1_generated_ApiHub_SearchResources_async + */ + searchResourcesAsync( + request?: protos.google.cloud.apihub.v1.ISearchResourcesRequest, + 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({ + 'location': request.location ?? '', + }); + const defaultCallSettings = this._defaults['searchResources']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.searchResources.asyncIterate( + this.innerApiCalls['searchResources'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * List External API resources in the API hub. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of External API resources. + * Format: `projects/{project}/locations/{location}` + * @param {number} [request.pageSize] + * Optional. The maximum number of External API resources to return. The + * service may return fewer than this value. If unspecified, at most 50 + * ExternalApis will be returned. The maximum value is 1000; values above 1000 + * will be coerced to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListExternalApis` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters (except page_size) provided to + * `ListExternalApis` must match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.apihub.v1.ExternalApi|ExternalApi}. + * 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 `listExternalApisAsync()` + * 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. + */ + listExternalApis( + request?: protos.google.cloud.apihub.v1.IListExternalApisRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.apihub.v1.IExternalApi[], + protos.google.cloud.apihub.v1.IListExternalApisRequest|null, + protos.google.cloud.apihub.v1.IListExternalApisResponse + ]>; + listExternalApis( + request: protos.google.cloud.apihub.v1.IListExternalApisRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.apihub.v1.IListExternalApisRequest, + protos.google.cloud.apihub.v1.IListExternalApisResponse|null|undefined, + protos.google.cloud.apihub.v1.IExternalApi>): void; + listExternalApis( + request: protos.google.cloud.apihub.v1.IListExternalApisRequest, + callback: PaginationCallback< + protos.google.cloud.apihub.v1.IListExternalApisRequest, + protos.google.cloud.apihub.v1.IListExternalApisResponse|null|undefined, + protos.google.cloud.apihub.v1.IExternalApi>): void; + listExternalApis( + request?: protos.google.cloud.apihub.v1.IListExternalApisRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.apihub.v1.IListExternalApisRequest, + protos.google.cloud.apihub.v1.IListExternalApisResponse|null|undefined, + protos.google.cloud.apihub.v1.IExternalApi>, + callback?: PaginationCallback< + protos.google.cloud.apihub.v1.IListExternalApisRequest, + protos.google.cloud.apihub.v1.IListExternalApisResponse|null|undefined, + protos.google.cloud.apihub.v1.IExternalApi>): + Promise<[ + protos.google.cloud.apihub.v1.IExternalApi[], + protos.google.cloud.apihub.v1.IListExternalApisRequest|null, + protos.google.cloud.apihub.v1.IListExternalApisResponse + ]>|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.listExternalApis(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of External API resources. + * Format: `projects/{project}/locations/{location}` + * @param {number} [request.pageSize] + * Optional. The maximum number of External API resources to return. The + * service may return fewer than this value. If unspecified, at most 50 + * ExternalApis will be returned. The maximum value is 1000; values above 1000 + * will be coerced to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListExternalApis` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters (except page_size) provided to + * `ListExternalApis` must match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.apihub.v1.ExternalApi|ExternalApi} 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 `listExternalApisAsync()` + * 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. + */ + listExternalApisStream( + request?: protos.google.cloud.apihub.v1.IListExternalApisRequest, + 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['listExternalApis']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listExternalApis.createStream( + this.innerApiCalls.listExternalApis as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listExternalApis`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of External API resources. + * Format: `projects/{project}/locations/{location}` + * @param {number} [request.pageSize] + * Optional. The maximum number of External API resources to return. The + * service may return fewer than this value. If unspecified, at most 50 + * ExternalApis will be returned. The maximum value is 1000; values above 1000 + * will be coerced to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListExternalApis` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters (except page_size) provided to + * `ListExternalApis` must match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@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.apihub.v1.ExternalApi|ExternalApi}. 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/api_hub.list_external_apis.js + * region_tag:apihub_v1_generated_ApiHub_ListExternalApis_async + */ + listExternalApisAsync( + request?: protos.google.cloud.apihub.v1.IListExternalApisRequest, + 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['listExternalApis']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listExternalApis.asyncIterate( + this.innerApiCalls['listExternalApis'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } +/** + * 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); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified api resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @returns {string} Resource name string. + */ + apiPath(project:string,location:string,api:string) { + return this.pathTemplates.apiPathTemplate.render({ + project: project, + location: location, + api: api, + }); + } + + /** + * Parse the project from Api resource. + * + * @param {string} apiName + * A fully-qualified path representing Api resource. + * @returns {string} A string representing the project. + */ + matchProjectFromApiName(apiName: string) { + return this.pathTemplates.apiPathTemplate.match(apiName).project; + } + + /** + * Parse the location from Api resource. + * + * @param {string} apiName + * A fully-qualified path representing Api resource. + * @returns {string} A string representing the location. + */ + matchLocationFromApiName(apiName: string) { + return this.pathTemplates.apiPathTemplate.match(apiName).location; + } + + /** + * Parse the api from Api resource. + * + * @param {string} apiName + * A fully-qualified path representing Api resource. + * @returns {string} A string representing the api. + */ + matchApiFromApiName(apiName: string) { + return this.pathTemplates.apiPathTemplate.match(apiName).api; + } + + /** + * Return a fully-qualified apiHubInstance resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api_hub_instance + * @returns {string} Resource name string. + */ + apiHubInstancePath(project:string,location:string,apiHubInstance:string) { + return this.pathTemplates.apiHubInstancePathTemplate.render({ + project: project, + location: location, + api_hub_instance: apiHubInstance, + }); + } + + /** + * Parse the project from ApiHubInstance resource. + * + * @param {string} apiHubInstanceName + * A fully-qualified path representing ApiHubInstance resource. + * @returns {string} A string representing the project. + */ + matchProjectFromApiHubInstanceName(apiHubInstanceName: string) { + return this.pathTemplates.apiHubInstancePathTemplate.match(apiHubInstanceName).project; + } + + /** + * Parse the location from ApiHubInstance resource. + * + * @param {string} apiHubInstanceName + * A fully-qualified path representing ApiHubInstance resource. + * @returns {string} A string representing the location. + */ + matchLocationFromApiHubInstanceName(apiHubInstanceName: string) { + return this.pathTemplates.apiHubInstancePathTemplate.match(apiHubInstanceName).location; + } + + /** + * Parse the api_hub_instance from ApiHubInstance resource. + * + * @param {string} apiHubInstanceName + * A fully-qualified path representing ApiHubInstance resource. + * @returns {string} A string representing the api_hub_instance. + */ + matchApiHubInstanceFromApiHubInstanceName(apiHubInstanceName: string) { + return this.pathTemplates.apiHubInstancePathTemplate.match(apiHubInstanceName).api_hub_instance; + } + + /** + * Return a fully-qualified apiOperation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @param {string} version + * @param {string} operation + * @returns {string} Resource name string. + */ + apiOperationPath(project:string,location:string,api:string,version:string,operation:string) { + return this.pathTemplates.apiOperationPathTemplate.render({ + project: project, + location: location, + api: api, + version: version, + operation: operation, + }); + } + + /** + * Parse the project from ApiOperation resource. + * + * @param {string} apiOperationName + * A fully-qualified path representing ApiOperation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromApiOperationName(apiOperationName: string) { + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).project; + } + + /** + * Parse the location from ApiOperation resource. + * + * @param {string} apiOperationName + * A fully-qualified path representing ApiOperation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromApiOperationName(apiOperationName: string) { + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).location; + } + + /** + * Parse the api from ApiOperation resource. + * + * @param {string} apiOperationName + * A fully-qualified path representing ApiOperation resource. + * @returns {string} A string representing the api. + */ + matchApiFromApiOperationName(apiOperationName: string) { + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).api; + } + + /** + * Parse the version from ApiOperation resource. + * + * @param {string} apiOperationName + * A fully-qualified path representing ApiOperation resource. + * @returns {string} A string representing the version. + */ + matchVersionFromApiOperationName(apiOperationName: string) { + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).version; + } + + /** + * Parse the operation from ApiOperation resource. + * + * @param {string} apiOperationName + * A fully-qualified path representing ApiOperation resource. + * @returns {string} A string representing the operation. + */ + matchOperationFromApiOperationName(apiOperationName: string) { + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).operation; + } + + /** + * Return a fully-qualified attribute resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} attribute + * @returns {string} Resource name string. + */ + attributePath(project:string,location:string,attribute:string) { + return this.pathTemplates.attributePathTemplate.render({ + project: project, + location: location, + attribute: attribute, + }); + } + + /** + * Parse the project from Attribute resource. + * + * @param {string} attributeName + * A fully-qualified path representing Attribute resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAttributeName(attributeName: string) { + return this.pathTemplates.attributePathTemplate.match(attributeName).project; + } + + /** + * Parse the location from Attribute resource. + * + * @param {string} attributeName + * A fully-qualified path representing Attribute resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAttributeName(attributeName: string) { + return this.pathTemplates.attributePathTemplate.match(attributeName).location; + } + + /** + * Parse the attribute from Attribute resource. + * + * @param {string} attributeName + * A fully-qualified path representing Attribute resource. + * @returns {string} A string representing the attribute. + */ + matchAttributeFromAttributeName(attributeName: string) { + return this.pathTemplates.attributePathTemplate.match(attributeName).attribute; + } + + /** + * Return a fully-qualified definition resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @param {string} version + * @param {string} definition + * @returns {string} Resource name string. + */ + definitionPath(project:string,location:string,api:string,version:string,definition:string) { + return this.pathTemplates.definitionPathTemplate.render({ + project: project, + location: location, + api: api, + version: version, + definition: definition, + }); + } + + /** + * Parse the project from Definition resource. + * + * @param {string} definitionName + * A fully-qualified path representing Definition resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDefinitionName(definitionName: string) { + return this.pathTemplates.definitionPathTemplate.match(definitionName).project; + } + + /** + * Parse the location from Definition resource. + * + * @param {string} definitionName + * A fully-qualified path representing Definition resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDefinitionName(definitionName: string) { + return this.pathTemplates.definitionPathTemplate.match(definitionName).location; + } + + /** + * Parse the api from Definition resource. + * + * @param {string} definitionName + * A fully-qualified path representing Definition resource. + * @returns {string} A string representing the api. + */ + matchApiFromDefinitionName(definitionName: string) { + return this.pathTemplates.definitionPathTemplate.match(definitionName).api; + } + + /** + * Parse the version from Definition resource. + * + * @param {string} definitionName + * A fully-qualified path representing Definition resource. + * @returns {string} A string representing the version. + */ + matchVersionFromDefinitionName(definitionName: string) { + return this.pathTemplates.definitionPathTemplate.match(definitionName).version; + } + + /** + * Parse the definition from Definition resource. + * + * @param {string} definitionName + * A fully-qualified path representing Definition resource. + * @returns {string} A string representing the definition. + */ + matchDefinitionFromDefinitionName(definitionName: string) { + return this.pathTemplates.definitionPathTemplate.match(definitionName).definition; + } + + /** + * Return a fully-qualified dependency resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dependency + * @returns {string} Resource name string. + */ + dependencyPath(project:string,location:string,dependency:string) { + return this.pathTemplates.dependencyPathTemplate.render({ + project: project, + location: location, + dependency: dependency, + }); + } + + /** + * Parse the project from Dependency resource. + * + * @param {string} dependencyName + * A fully-qualified path representing Dependency resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDependencyName(dependencyName: string) { + return this.pathTemplates.dependencyPathTemplate.match(dependencyName).project; + } + + /** + * Parse the location from Dependency resource. + * + * @param {string} dependencyName + * A fully-qualified path representing Dependency resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDependencyName(dependencyName: string) { + return this.pathTemplates.dependencyPathTemplate.match(dependencyName).location; + } + + /** + * Parse the dependency from Dependency resource. + * + * @param {string} dependencyName + * A fully-qualified path representing Dependency resource. + * @returns {string} A string representing the dependency. + */ + matchDependencyFromDependencyName(dependencyName: string) { + return this.pathTemplates.dependencyPathTemplate.match(dependencyName).dependency; + } + + /** + * Return a fully-qualified deployment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} deployment + * @returns {string} Resource name string. + */ + deploymentPath(project:string,location:string,deployment:string) { + return this.pathTemplates.deploymentPathTemplate.render({ + project: project, + location: location, + deployment: deployment, + }); + } + + /** + * Parse the project from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName).project; + } + + /** + * Parse the location from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName).location; + } + + /** + * Parse the deployment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the deployment. + */ + matchDeploymentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName).deployment; + } + + /** + * Return a fully-qualified externalApi resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} external_api + * @returns {string} Resource name string. + */ + externalApiPath(project:string,location:string,externalApi:string) { + return this.pathTemplates.externalApiPathTemplate.render({ + project: project, + location: location, + external_api: externalApi, + }); + } + + /** + * Parse the project from ExternalApi resource. + * + * @param {string} externalApiName + * A fully-qualified path representing ExternalApi resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExternalApiName(externalApiName: string) { + return this.pathTemplates.externalApiPathTemplate.match(externalApiName).project; + } + + /** + * Parse the location from ExternalApi resource. + * + * @param {string} externalApiName + * A fully-qualified path representing ExternalApi resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExternalApiName(externalApiName: string) { + return this.pathTemplates.externalApiPathTemplate.match(externalApiName).location; + } + + /** + * Parse the external_api from ExternalApi resource. + * + * @param {string} externalApiName + * A fully-qualified path representing ExternalApi resource. + * @returns {string} A string representing the external_api. + */ + matchExternalApiFromExternalApiName(externalApiName: string) { + return this.pathTemplates.externalApiPathTemplate.match(externalApiName).external_api; + } + + /** + * Return a fully-qualified hostProjectRegistration resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} host_project_registration + * @returns {string} Resource name string. + */ + hostProjectRegistrationPath(project:string,location:string,hostProjectRegistration:string) { + return this.pathTemplates.hostProjectRegistrationPathTemplate.render({ + project: project, + location: location, + host_project_registration: hostProjectRegistration, + }); + } + + /** + * Parse the project from HostProjectRegistration resource. + * + * @param {string} hostProjectRegistrationName + * A fully-qualified path representing HostProjectRegistration resource. + * @returns {string} A string representing the project. + */ + matchProjectFromHostProjectRegistrationName(hostProjectRegistrationName: string) { + return this.pathTemplates.hostProjectRegistrationPathTemplate.match(hostProjectRegistrationName).project; + } + + /** + * Parse the location from HostProjectRegistration resource. + * + * @param {string} hostProjectRegistrationName + * A fully-qualified path representing HostProjectRegistration resource. + * @returns {string} A string representing the location. + */ + matchLocationFromHostProjectRegistrationName(hostProjectRegistrationName: string) { + return this.pathTemplates.hostProjectRegistrationPathTemplate.match(hostProjectRegistrationName).location; + } + + /** + * Parse the host_project_registration from HostProjectRegistration resource. + * + * @param {string} hostProjectRegistrationName + * A fully-qualified path representing HostProjectRegistration resource. + * @returns {string} A string representing the host_project_registration. + */ + matchHostProjectRegistrationFromHostProjectRegistrationName(hostProjectRegistrationName: string) { + return this.pathTemplates.hostProjectRegistrationPathTemplate.match(hostProjectRegistrationName).host_project_registration; + } + + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project:string,location:string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + + /** + * Return a fully-qualified plugin resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} plugin + * @returns {string} Resource name string. + */ + pluginPath(project:string,location:string,plugin:string) { + return this.pathTemplates.pluginPathTemplate.render({ + project: project, + location: location, + plugin: plugin, + }); + } + + /** + * Parse the project from Plugin resource. + * + * @param {string} pluginName + * A fully-qualified path representing Plugin resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPluginName(pluginName: string) { + return this.pathTemplates.pluginPathTemplate.match(pluginName).project; + } + + /** + * Parse the location from Plugin resource. + * + * @param {string} pluginName + * A fully-qualified path representing Plugin resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPluginName(pluginName: string) { + return this.pathTemplates.pluginPathTemplate.match(pluginName).location; + } + + /** + * Parse the plugin from Plugin resource. + * + * @param {string} pluginName + * A fully-qualified path representing Plugin resource. + * @returns {string} A string representing the plugin. + */ + matchPluginFromPluginName(pluginName: string) { + return this.pathTemplates.pluginPathTemplate.match(pluginName).plugin; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project:string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified runtimeProjectAttachment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} runtime_project_attachment + * @returns {string} Resource name string. + */ + runtimeProjectAttachmentPath(project:string,location:string,runtimeProjectAttachment:string) { + return this.pathTemplates.runtimeProjectAttachmentPathTemplate.render({ + project: project, + location: location, + runtime_project_attachment: runtimeProjectAttachment, + }); + } + + /** + * Parse the project from RuntimeProjectAttachment resource. + * + * @param {string} runtimeProjectAttachmentName + * A fully-qualified path representing RuntimeProjectAttachment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRuntimeProjectAttachmentName(runtimeProjectAttachmentName: string) { + return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match(runtimeProjectAttachmentName).project; + } + + /** + * Parse the location from RuntimeProjectAttachment resource. + * + * @param {string} runtimeProjectAttachmentName + * A fully-qualified path representing RuntimeProjectAttachment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRuntimeProjectAttachmentName(runtimeProjectAttachmentName: string) { + return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match(runtimeProjectAttachmentName).location; + } + + /** + * Parse the runtime_project_attachment from RuntimeProjectAttachment resource. + * + * @param {string} runtimeProjectAttachmentName + * A fully-qualified path representing RuntimeProjectAttachment resource. + * @returns {string} A string representing the runtime_project_attachment. + */ + matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName(runtimeProjectAttachmentName: string) { + return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match(runtimeProjectAttachmentName).runtime_project_attachment; + } + + /** + * Return a fully-qualified spec resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @param {string} version + * @param {string} spec + * @returns {string} Resource name string. + */ + specPath(project:string,location:string,api:string,version:string,spec:string) { + return this.pathTemplates.specPathTemplate.render({ + project: project, + location: location, + api: api, + version: version, + spec: spec, + }); + } + + /** + * Parse the project from Spec resource. + * + * @param {string} specName + * A fully-qualified path representing Spec resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSpecName(specName: string) { + return this.pathTemplates.specPathTemplate.match(specName).project; + } + + /** + * Parse the location from Spec resource. + * + * @param {string} specName + * A fully-qualified path representing Spec resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSpecName(specName: string) { + return this.pathTemplates.specPathTemplate.match(specName).location; + } + + /** + * Parse the api from Spec resource. + * + * @param {string} specName + * A fully-qualified path representing Spec resource. + * @returns {string} A string representing the api. + */ + matchApiFromSpecName(specName: string) { + return this.pathTemplates.specPathTemplate.match(specName).api; + } + + /** + * Parse the version from Spec resource. + * + * @param {string} specName + * A fully-qualified path representing Spec resource. + * @returns {string} A string representing the version. + */ + matchVersionFromSpecName(specName: string) { + return this.pathTemplates.specPathTemplate.match(specName).version; + } + + /** + * Parse the spec from Spec resource. + * + * @param {string} specName + * A fully-qualified path representing Spec resource. + * @returns {string} A string representing the spec. + */ + matchSpecFromSpecName(specName: string) { + return this.pathTemplates.specPathTemplate.match(specName).spec; + } + + /** + * Return a fully-qualified styleGuide resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} plugin + * @returns {string} Resource name string. + */ + styleGuidePath(project:string,location:string,plugin:string) { + return this.pathTemplates.styleGuidePathTemplate.render({ + project: project, + location: location, + plugin: plugin, + }); + } + + /** + * Parse the project from StyleGuide resource. + * + * @param {string} styleGuideName + * A fully-qualified path representing StyleGuide resource. + * @returns {string} A string representing the project. + */ + matchProjectFromStyleGuideName(styleGuideName: string) { + return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName).project; + } + + /** + * Parse the location from StyleGuide resource. + * + * @param {string} styleGuideName + * A fully-qualified path representing StyleGuide resource. + * @returns {string} A string representing the location. + */ + matchLocationFromStyleGuideName(styleGuideName: string) { + return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName).location; + } + + /** + * Parse the plugin from StyleGuide resource. + * + * @param {string} styleGuideName + * A fully-qualified path representing StyleGuide resource. + * @returns {string} A string representing the plugin. + */ + matchPluginFromStyleGuideName(styleGuideName: string) { + return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName).plugin; + } + + /** + * Return a fully-qualified version resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @param {string} version + * @returns {string} Resource name string. + */ + versionPath(project:string,location:string,api:string,version:string) { + return this.pathTemplates.versionPathTemplate.render({ + project: project, + location: location, + api: api, + version: version, + }); + } + + /** + * Parse the project from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the project. + */ + matchProjectFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).project; + } + + /** + * Parse the location from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the location. + */ + matchLocationFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).location; + } + + /** + * Parse the api from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the api. + */ + matchApiFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).api; + } + + /** + * Parse the version from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the version. + */ + matchVersionFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).version; + } + + /** + * 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.apiHubStub && !this._terminated) { + return this.apiHubStub.then(stub => { + this._terminated = true; + stub.close(); + this.locationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_client_config.json b/owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_client_config.json new file mode 100644 index 00000000000..d279d06d0ba --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_client_config.json @@ -0,0 +1,213 @@ +{ + "interfaces": { + "google.cloud.apihub.v1.ApiHub": { + "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": { + "CreateApi": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetApi": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ListApis": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "UpdateApi": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteApi": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateVersion": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetVersion": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ListVersions": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "UpdateVersion": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteVersion": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateSpec": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetSpec": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetSpecContents": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ListSpecs": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "UpdateSpec": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteSpec": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetApiOperation": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ListApiOperations": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetDefinition": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "CreateDeployment": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetDeployment": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ListDeployments": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "UpdateDeployment": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteDeployment": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateAttribute": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetAttribute": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "UpdateAttribute": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteAttribute": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListAttributes": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "SearchResources": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "CreateExternalApi": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetExternalApi": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "UpdateExternalApi": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteExternalApi": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListExternalApis": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_dependencies_client.ts b/owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_dependencies_client.ts new file mode 100644 index 00000000000..01b79b2c0c7 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_dependencies_client.ts @@ -0,0 +1,1927 @@ +// Copyright 2024 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, PaginationCallback, GaxCall, 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/api_hub_dependencies_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './api_hub_dependencies_client_config.json'; +const version = require('../../../package.json').version; + +/** + * This service provides methods for various operations related to a + * {@link protos.google.cloud.apihub.v1.Dependency|Dependency} in the API hub. + * @class + * @memberof v1 + */ +export class ApiHubDependenciesClient { + 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}; + private _universeDomain: string; + private _servicePath: string; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + locationsClient: LocationsClient; + pathTemplates: {[name: string]: gax.PathTemplate}; + apiHubDependenciesStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of ApiHubDependenciesClient. + * + * @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 ApiHubDependenciesClient({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 ApiHubDependenciesClient; + if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { + throw new Error('Please set either universe_domain or universeDomain, but not both.'); + } + const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; + this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; + this._servicePath = 'apihub.' + this._universeDomain; + const servicePath = opts?.servicePath || opts?.apiEndpoint || this._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 !== this._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 = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + 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 === 'object' && '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 = { + apiPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}' + ), + apiHubInstancePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apiHubInstances/{api_hub_instance}' + ), + apiOperationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}' + ), + attributePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/attributes/{attribute}' + ), + definitionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}' + ), + dependencyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/dependencies/{dependency}' + ), + deploymentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/deployments/{deployment}' + ), + externalApiPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/externalApis/{external_api}' + ), + hostProjectRegistrationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/hostProjectRegistrations/{host_project_registration}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + pluginPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/plugins/{plugin}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + runtimeProjectAttachmentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}' + ), + specPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}' + ), + styleGuidePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/plugins/{plugin}/styleGuide' + ), + versionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}/versions/{version}' + ), + }; + + // 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 = { + listDependencies: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'dependencies') + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.apihub.v1.ApiHubDependencies', 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.apiHubDependenciesStub) { + return this.apiHubDependenciesStub; + } + + // Put together the "service stub" for + // google.cloud.apihub.v1.ApiHubDependencies. + this.apiHubDependenciesStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.apihub.v1.ApiHubDependencies') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.apihub.v1.ApiHubDependencies, + 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 apiHubDependenciesStubMethods = + ['createDependency', 'getDependency', 'updateDependency', 'deleteDependency', 'listDependencies']; + for (const methodName of apiHubDependenciesStubMethods) { + const callPromise = this.apiHubDependenciesStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + this.descriptors.page[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.apiHubDependenciesStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'apihub.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'apihub.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * 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 -- + // ------------------- +/** + * Create a dependency between two entities in the API hub. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource for the dependency resource. + * Format: `projects/{project}/locations/{location}` + * @param {string} [request.dependencyId] + * Optional. The ID to use for the dependency resource, which will become the + * final component of the dependency's resource name. This field is optional. + * * If provided, the same will be used. The service will throw an error if + * duplicate id is provided by the client. + * * If not provided, a system generated id will be used. + * + * This value should be 4-500 characters, and valid characters + * are `{@link protos.A-Z|a-z}[0-9]-_`. + * @param {google.cloud.apihub.v1.Dependency} request.dependency + * Required. The dependency resource to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.apihub.v1.Dependency|Dependency}. + * 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/api_hub_dependencies.create_dependency.js + * region_tag:apihub_v1_generated_ApiHubDependencies_CreateDependency_async + */ + createDependency( + request?: protos.google.cloud.apihub.v1.ICreateDependencyRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.apihub.v1.IDependency, + protos.google.cloud.apihub.v1.ICreateDependencyRequest|undefined, {}|undefined + ]>; + createDependency( + request: protos.google.cloud.apihub.v1.ICreateDependencyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.IDependency, + protos.google.cloud.apihub.v1.ICreateDependencyRequest|null|undefined, + {}|null|undefined>): void; + createDependency( + request: protos.google.cloud.apihub.v1.ICreateDependencyRequest, + callback: Callback< + protos.google.cloud.apihub.v1.IDependency, + protos.google.cloud.apihub.v1.ICreateDependencyRequest|null|undefined, + {}|null|undefined>): void; + createDependency( + request?: protos.google.cloud.apihub.v1.ICreateDependencyRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.apihub.v1.IDependency, + protos.google.cloud.apihub.v1.ICreateDependencyRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.apihub.v1.IDependency, + protos.google.cloud.apihub.v1.ICreateDependencyRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.apihub.v1.IDependency, + protos.google.cloud.apihub.v1.ICreateDependencyRequest|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.createDependency(request, options, callback); + } +/** + * Get details about a dependency resource in the API hub. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the dependency resource to retrieve. + * Format: `projects/{project}/locations/{location}/dependencies/{dependency}` + * @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.apihub.v1.Dependency|Dependency}. + * 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/api_hub_dependencies.get_dependency.js + * region_tag:apihub_v1_generated_ApiHubDependencies_GetDependency_async + */ + getDependency( + request?: protos.google.cloud.apihub.v1.IGetDependencyRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.apihub.v1.IDependency, + protos.google.cloud.apihub.v1.IGetDependencyRequest|undefined, {}|undefined + ]>; + getDependency( + request: protos.google.cloud.apihub.v1.IGetDependencyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.IDependency, + protos.google.cloud.apihub.v1.IGetDependencyRequest|null|undefined, + {}|null|undefined>): void; + getDependency( + request: protos.google.cloud.apihub.v1.IGetDependencyRequest, + callback: Callback< + protos.google.cloud.apihub.v1.IDependency, + protos.google.cloud.apihub.v1.IGetDependencyRequest|null|undefined, + {}|null|undefined>): void; + getDependency( + request?: protos.google.cloud.apihub.v1.IGetDependencyRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.apihub.v1.IDependency, + protos.google.cloud.apihub.v1.IGetDependencyRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.apihub.v1.IDependency, + protos.google.cloud.apihub.v1.IGetDependencyRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.apihub.v1.IDependency, + protos.google.cloud.apihub.v1.IGetDependencyRequest|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.getDependency(request, options, callback); + } +/** + * Update a dependency based on the + * {@link protos.google.cloud.apihub.v1.UpdateDependencyRequest.update_mask|update_mask} + * provided in the request. + * + * The following fields in the {@link protos.google.cloud.apihub.v1.Dependency|dependency} + * can be updated: + * * {@link protos.google.cloud.apihub.v1.Dependency.description|description} + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.apihub.v1.Dependency} request.dependency + * Required. The dependency resource to update. + * + * The dependency's `name` field is used to identify the dependency to update. + * Format: `projects/{project}/locations/{location}/dependencies/{dependency}` + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The list of fields to update. + * @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.apihub.v1.Dependency|Dependency}. + * 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/api_hub_dependencies.update_dependency.js + * region_tag:apihub_v1_generated_ApiHubDependencies_UpdateDependency_async + */ + updateDependency( + request?: protos.google.cloud.apihub.v1.IUpdateDependencyRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.apihub.v1.IDependency, + protos.google.cloud.apihub.v1.IUpdateDependencyRequest|undefined, {}|undefined + ]>; + updateDependency( + request: protos.google.cloud.apihub.v1.IUpdateDependencyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.IDependency, + protos.google.cloud.apihub.v1.IUpdateDependencyRequest|null|undefined, + {}|null|undefined>): void; + updateDependency( + request: protos.google.cloud.apihub.v1.IUpdateDependencyRequest, + callback: Callback< + protos.google.cloud.apihub.v1.IDependency, + protos.google.cloud.apihub.v1.IUpdateDependencyRequest|null|undefined, + {}|null|undefined>): void; + updateDependency( + request?: protos.google.cloud.apihub.v1.IUpdateDependencyRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.apihub.v1.IDependency, + protos.google.cloud.apihub.v1.IUpdateDependencyRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.apihub.v1.IDependency, + protos.google.cloud.apihub.v1.IUpdateDependencyRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.apihub.v1.IDependency, + protos.google.cloud.apihub.v1.IUpdateDependencyRequest|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({ + 'dependency.name': request.dependency!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateDependency(request, options, callback); + } +/** + * Delete the dependency resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the dependency resource to delete. + * Format: `projects/{project}/locations/{location}/dependencies/{dependency}` + * @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.protobuf.Empty|Empty}. + * 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/api_hub_dependencies.delete_dependency.js + * region_tag:apihub_v1_generated_ApiHubDependencies_DeleteDependency_async + */ + deleteDependency( + request?: protos.google.cloud.apihub.v1.IDeleteDependencyRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteDependencyRequest|undefined, {}|undefined + ]>; + deleteDependency( + request: protos.google.cloud.apihub.v1.IDeleteDependencyRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteDependencyRequest|null|undefined, + {}|null|undefined>): void; + deleteDependency( + request: protos.google.cloud.apihub.v1.IDeleteDependencyRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteDependencyRequest|null|undefined, + {}|null|undefined>): void; + deleteDependency( + request?: protos.google.cloud.apihub.v1.IDeleteDependencyRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteDependencyRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteDependencyRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteDependencyRequest|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.deleteDependency(request, options, callback); + } + + /** + * List dependencies based on the provided filter and pagination parameters. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent which owns this collection of dependency resources. + * Format: `projects/{project}/locations/{location}` + * @param {string} [request.filter] + * Optional. An expression that filters the list of Dependencies. + * + * A filter expression consists of a field name, a comparison operator, and + * a value for filtering. The value must be a string. Allowed comparison + * operator is `=`. Filters are not case sensitive. + * + * The following fields in the `Dependency` are eligible for filtering: + * + * * `consumer.operation_resource_name` - The operation resource name for + * the consumer entity involved in a dependency. Allowed comparison + * operators: `=`. + * * `consumer.external_api_resource_name` - The external api resource name + * for the consumer entity involved in a dependency. Allowed comparison + * operators: `=`. + * * `supplier.operation_resource_name` - The operation resource name for + * the supplier entity involved in a dependency. Allowed comparison + * operators: `=`. + * * `supplier.external_api_resource_name` - The external api resource name + * for the supplier entity involved in a dependency. Allowed comparison + * operators: `=`. + * + * Expressions are combined with either `AND` logic operator or `OR` logical + * operator but not both of them together i.e. only one of the `AND` or `OR` + * operator can be used throughout the filter string and both the operators + * cannot be used together. No other logical operators are supported. At most + * three filter fields are allowed in the filter string and if provided + * more than that then `INVALID_ARGUMENT` error is returned by the API. + * + * For example, `consumer.operation_resource_name = + * \"projects/p1/locations/global/apis/a1/versions/v1/operations/o1\" OR + * supplier.operation_resource_name = + * \"projects/p1/locations/global/apis/a1/versions/v1/operations/o1\"` - The + * dependencies with either consumer or supplier operation resource name as + * _projects/p1/locations/global/apis/a1/versions/v1/operations/o1_. + * @param {number} [request.pageSize] + * Optional. The maximum number of dependency resources to return. The service + * may return fewer than this value. If unspecified, at most 50 dependencies + * will be returned. The maximum value is 1000; values above 1000 will be + * coerced to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListDependencies` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListDependencies` must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.apihub.v1.Dependency|Dependency}. + * 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 `listDependenciesAsync()` + * 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. + */ + listDependencies( + request?: protos.google.cloud.apihub.v1.IListDependenciesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.apihub.v1.IDependency[], + protos.google.cloud.apihub.v1.IListDependenciesRequest|null, + protos.google.cloud.apihub.v1.IListDependenciesResponse + ]>; + listDependencies( + request: protos.google.cloud.apihub.v1.IListDependenciesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.apihub.v1.IListDependenciesRequest, + protos.google.cloud.apihub.v1.IListDependenciesResponse|null|undefined, + protos.google.cloud.apihub.v1.IDependency>): void; + listDependencies( + request: protos.google.cloud.apihub.v1.IListDependenciesRequest, + callback: PaginationCallback< + protos.google.cloud.apihub.v1.IListDependenciesRequest, + protos.google.cloud.apihub.v1.IListDependenciesResponse|null|undefined, + protos.google.cloud.apihub.v1.IDependency>): void; + listDependencies( + request?: protos.google.cloud.apihub.v1.IListDependenciesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.apihub.v1.IListDependenciesRequest, + protos.google.cloud.apihub.v1.IListDependenciesResponse|null|undefined, + protos.google.cloud.apihub.v1.IDependency>, + callback?: PaginationCallback< + protos.google.cloud.apihub.v1.IListDependenciesRequest, + protos.google.cloud.apihub.v1.IListDependenciesResponse|null|undefined, + protos.google.cloud.apihub.v1.IDependency>): + Promise<[ + protos.google.cloud.apihub.v1.IDependency[], + protos.google.cloud.apihub.v1.IListDependenciesRequest|null, + protos.google.cloud.apihub.v1.IListDependenciesResponse + ]>|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.listDependencies(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent which owns this collection of dependency resources. + * Format: `projects/{project}/locations/{location}` + * @param {string} [request.filter] + * Optional. An expression that filters the list of Dependencies. + * + * A filter expression consists of a field name, a comparison operator, and + * a value for filtering. The value must be a string. Allowed comparison + * operator is `=`. Filters are not case sensitive. + * + * The following fields in the `Dependency` are eligible for filtering: + * + * * `consumer.operation_resource_name` - The operation resource name for + * the consumer entity involved in a dependency. Allowed comparison + * operators: `=`. + * * `consumer.external_api_resource_name` - The external api resource name + * for the consumer entity involved in a dependency. Allowed comparison + * operators: `=`. + * * `supplier.operation_resource_name` - The operation resource name for + * the supplier entity involved in a dependency. Allowed comparison + * operators: `=`. + * * `supplier.external_api_resource_name` - The external api resource name + * for the supplier entity involved in a dependency. Allowed comparison + * operators: `=`. + * + * Expressions are combined with either `AND` logic operator or `OR` logical + * operator but not both of them together i.e. only one of the `AND` or `OR` + * operator can be used throughout the filter string and both the operators + * cannot be used together. No other logical operators are supported. At most + * three filter fields are allowed in the filter string and if provided + * more than that then `INVALID_ARGUMENT` error is returned by the API. + * + * For example, `consumer.operation_resource_name = + * \"projects/p1/locations/global/apis/a1/versions/v1/operations/o1\" OR + * supplier.operation_resource_name = + * \"projects/p1/locations/global/apis/a1/versions/v1/operations/o1\"` - The + * dependencies with either consumer or supplier operation resource name as + * _projects/p1/locations/global/apis/a1/versions/v1/operations/o1_. + * @param {number} [request.pageSize] + * Optional. The maximum number of dependency resources to return. The service + * may return fewer than this value. If unspecified, at most 50 dependencies + * will be returned. The maximum value is 1000; values above 1000 will be + * coerced to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListDependencies` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListDependencies` must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.apihub.v1.Dependency|Dependency} 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 `listDependenciesAsync()` + * 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. + */ + listDependenciesStream( + request?: protos.google.cloud.apihub.v1.IListDependenciesRequest, + 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['listDependencies']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listDependencies.createStream( + this.innerApiCalls.listDependencies as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listDependencies`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent which owns this collection of dependency resources. + * Format: `projects/{project}/locations/{location}` + * @param {string} [request.filter] + * Optional. An expression that filters the list of Dependencies. + * + * A filter expression consists of a field name, a comparison operator, and + * a value for filtering. The value must be a string. Allowed comparison + * operator is `=`. Filters are not case sensitive. + * + * The following fields in the `Dependency` are eligible for filtering: + * + * * `consumer.operation_resource_name` - The operation resource name for + * the consumer entity involved in a dependency. Allowed comparison + * operators: `=`. + * * `consumer.external_api_resource_name` - The external api resource name + * for the consumer entity involved in a dependency. Allowed comparison + * operators: `=`. + * * `supplier.operation_resource_name` - The operation resource name for + * the supplier entity involved in a dependency. Allowed comparison + * operators: `=`. + * * `supplier.external_api_resource_name` - The external api resource name + * for the supplier entity involved in a dependency. Allowed comparison + * operators: `=`. + * + * Expressions are combined with either `AND` logic operator or `OR` logical + * operator but not both of them together i.e. only one of the `AND` or `OR` + * operator can be used throughout the filter string and both the operators + * cannot be used together. No other logical operators are supported. At most + * three filter fields are allowed in the filter string and if provided + * more than that then `INVALID_ARGUMENT` error is returned by the API. + * + * For example, `consumer.operation_resource_name = + * \"projects/p1/locations/global/apis/a1/versions/v1/operations/o1\" OR + * supplier.operation_resource_name = + * \"projects/p1/locations/global/apis/a1/versions/v1/operations/o1\"` - The + * dependencies with either consumer or supplier operation resource name as + * _projects/p1/locations/global/apis/a1/versions/v1/operations/o1_. + * @param {number} [request.pageSize] + * Optional. The maximum number of dependency resources to return. The service + * may return fewer than this value. If unspecified, at most 50 dependencies + * will be returned. The maximum value is 1000; values above 1000 will be + * coerced to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListDependencies` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListDependencies` must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@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.apihub.v1.Dependency|Dependency}. 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/api_hub_dependencies.list_dependencies.js + * region_tag:apihub_v1_generated_ApiHubDependencies_ListDependencies_async + */ + listDependenciesAsync( + request?: protos.google.cloud.apihub.v1.IListDependenciesRequest, + 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['listDependencies']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listDependencies.asyncIterate( + this.innerApiCalls['listDependencies'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } +/** + * 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); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified api resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @returns {string} Resource name string. + */ + apiPath(project:string,location:string,api:string) { + return this.pathTemplates.apiPathTemplate.render({ + project: project, + location: location, + api: api, + }); + } + + /** + * Parse the project from Api resource. + * + * @param {string} apiName + * A fully-qualified path representing Api resource. + * @returns {string} A string representing the project. + */ + matchProjectFromApiName(apiName: string) { + return this.pathTemplates.apiPathTemplate.match(apiName).project; + } + + /** + * Parse the location from Api resource. + * + * @param {string} apiName + * A fully-qualified path representing Api resource. + * @returns {string} A string representing the location. + */ + matchLocationFromApiName(apiName: string) { + return this.pathTemplates.apiPathTemplate.match(apiName).location; + } + + /** + * Parse the api from Api resource. + * + * @param {string} apiName + * A fully-qualified path representing Api resource. + * @returns {string} A string representing the api. + */ + matchApiFromApiName(apiName: string) { + return this.pathTemplates.apiPathTemplate.match(apiName).api; + } + + /** + * Return a fully-qualified apiHubInstance resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api_hub_instance + * @returns {string} Resource name string. + */ + apiHubInstancePath(project:string,location:string,apiHubInstance:string) { + return this.pathTemplates.apiHubInstancePathTemplate.render({ + project: project, + location: location, + api_hub_instance: apiHubInstance, + }); + } + + /** + * Parse the project from ApiHubInstance resource. + * + * @param {string} apiHubInstanceName + * A fully-qualified path representing ApiHubInstance resource. + * @returns {string} A string representing the project. + */ + matchProjectFromApiHubInstanceName(apiHubInstanceName: string) { + return this.pathTemplates.apiHubInstancePathTemplate.match(apiHubInstanceName).project; + } + + /** + * Parse the location from ApiHubInstance resource. + * + * @param {string} apiHubInstanceName + * A fully-qualified path representing ApiHubInstance resource. + * @returns {string} A string representing the location. + */ + matchLocationFromApiHubInstanceName(apiHubInstanceName: string) { + return this.pathTemplates.apiHubInstancePathTemplate.match(apiHubInstanceName).location; + } + + /** + * Parse the api_hub_instance from ApiHubInstance resource. + * + * @param {string} apiHubInstanceName + * A fully-qualified path representing ApiHubInstance resource. + * @returns {string} A string representing the api_hub_instance. + */ + matchApiHubInstanceFromApiHubInstanceName(apiHubInstanceName: string) { + return this.pathTemplates.apiHubInstancePathTemplate.match(apiHubInstanceName).api_hub_instance; + } + + /** + * Return a fully-qualified apiOperation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @param {string} version + * @param {string} operation + * @returns {string} Resource name string. + */ + apiOperationPath(project:string,location:string,api:string,version:string,operation:string) { + return this.pathTemplates.apiOperationPathTemplate.render({ + project: project, + location: location, + api: api, + version: version, + operation: operation, + }); + } + + /** + * Parse the project from ApiOperation resource. + * + * @param {string} apiOperationName + * A fully-qualified path representing ApiOperation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromApiOperationName(apiOperationName: string) { + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).project; + } + + /** + * Parse the location from ApiOperation resource. + * + * @param {string} apiOperationName + * A fully-qualified path representing ApiOperation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromApiOperationName(apiOperationName: string) { + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).location; + } + + /** + * Parse the api from ApiOperation resource. + * + * @param {string} apiOperationName + * A fully-qualified path representing ApiOperation resource. + * @returns {string} A string representing the api. + */ + matchApiFromApiOperationName(apiOperationName: string) { + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).api; + } + + /** + * Parse the version from ApiOperation resource. + * + * @param {string} apiOperationName + * A fully-qualified path representing ApiOperation resource. + * @returns {string} A string representing the version. + */ + matchVersionFromApiOperationName(apiOperationName: string) { + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).version; + } + + /** + * Parse the operation from ApiOperation resource. + * + * @param {string} apiOperationName + * A fully-qualified path representing ApiOperation resource. + * @returns {string} A string representing the operation. + */ + matchOperationFromApiOperationName(apiOperationName: string) { + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).operation; + } + + /** + * Return a fully-qualified attribute resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} attribute + * @returns {string} Resource name string. + */ + attributePath(project:string,location:string,attribute:string) { + return this.pathTemplates.attributePathTemplate.render({ + project: project, + location: location, + attribute: attribute, + }); + } + + /** + * Parse the project from Attribute resource. + * + * @param {string} attributeName + * A fully-qualified path representing Attribute resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAttributeName(attributeName: string) { + return this.pathTemplates.attributePathTemplate.match(attributeName).project; + } + + /** + * Parse the location from Attribute resource. + * + * @param {string} attributeName + * A fully-qualified path representing Attribute resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAttributeName(attributeName: string) { + return this.pathTemplates.attributePathTemplate.match(attributeName).location; + } + + /** + * Parse the attribute from Attribute resource. + * + * @param {string} attributeName + * A fully-qualified path representing Attribute resource. + * @returns {string} A string representing the attribute. + */ + matchAttributeFromAttributeName(attributeName: string) { + return this.pathTemplates.attributePathTemplate.match(attributeName).attribute; + } + + /** + * Return a fully-qualified definition resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @param {string} version + * @param {string} definition + * @returns {string} Resource name string. + */ + definitionPath(project:string,location:string,api:string,version:string,definition:string) { + return this.pathTemplates.definitionPathTemplate.render({ + project: project, + location: location, + api: api, + version: version, + definition: definition, + }); + } + + /** + * Parse the project from Definition resource. + * + * @param {string} definitionName + * A fully-qualified path representing Definition resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDefinitionName(definitionName: string) { + return this.pathTemplates.definitionPathTemplate.match(definitionName).project; + } + + /** + * Parse the location from Definition resource. + * + * @param {string} definitionName + * A fully-qualified path representing Definition resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDefinitionName(definitionName: string) { + return this.pathTemplates.definitionPathTemplate.match(definitionName).location; + } + + /** + * Parse the api from Definition resource. + * + * @param {string} definitionName + * A fully-qualified path representing Definition resource. + * @returns {string} A string representing the api. + */ + matchApiFromDefinitionName(definitionName: string) { + return this.pathTemplates.definitionPathTemplate.match(definitionName).api; + } + + /** + * Parse the version from Definition resource. + * + * @param {string} definitionName + * A fully-qualified path representing Definition resource. + * @returns {string} A string representing the version. + */ + matchVersionFromDefinitionName(definitionName: string) { + return this.pathTemplates.definitionPathTemplate.match(definitionName).version; + } + + /** + * Parse the definition from Definition resource. + * + * @param {string} definitionName + * A fully-qualified path representing Definition resource. + * @returns {string} A string representing the definition. + */ + matchDefinitionFromDefinitionName(definitionName: string) { + return this.pathTemplates.definitionPathTemplate.match(definitionName).definition; + } + + /** + * Return a fully-qualified dependency resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dependency + * @returns {string} Resource name string. + */ + dependencyPath(project:string,location:string,dependency:string) { + return this.pathTemplates.dependencyPathTemplate.render({ + project: project, + location: location, + dependency: dependency, + }); + } + + /** + * Parse the project from Dependency resource. + * + * @param {string} dependencyName + * A fully-qualified path representing Dependency resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDependencyName(dependencyName: string) { + return this.pathTemplates.dependencyPathTemplate.match(dependencyName).project; + } + + /** + * Parse the location from Dependency resource. + * + * @param {string} dependencyName + * A fully-qualified path representing Dependency resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDependencyName(dependencyName: string) { + return this.pathTemplates.dependencyPathTemplate.match(dependencyName).location; + } + + /** + * Parse the dependency from Dependency resource. + * + * @param {string} dependencyName + * A fully-qualified path representing Dependency resource. + * @returns {string} A string representing the dependency. + */ + matchDependencyFromDependencyName(dependencyName: string) { + return this.pathTemplates.dependencyPathTemplate.match(dependencyName).dependency; + } + + /** + * Return a fully-qualified deployment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} deployment + * @returns {string} Resource name string. + */ + deploymentPath(project:string,location:string,deployment:string) { + return this.pathTemplates.deploymentPathTemplate.render({ + project: project, + location: location, + deployment: deployment, + }); + } + + /** + * Parse the project from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName).project; + } + + /** + * Parse the location from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName).location; + } + + /** + * Parse the deployment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the deployment. + */ + matchDeploymentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName).deployment; + } + + /** + * Return a fully-qualified externalApi resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} external_api + * @returns {string} Resource name string. + */ + externalApiPath(project:string,location:string,externalApi:string) { + return this.pathTemplates.externalApiPathTemplate.render({ + project: project, + location: location, + external_api: externalApi, + }); + } + + /** + * Parse the project from ExternalApi resource. + * + * @param {string} externalApiName + * A fully-qualified path representing ExternalApi resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExternalApiName(externalApiName: string) { + return this.pathTemplates.externalApiPathTemplate.match(externalApiName).project; + } + + /** + * Parse the location from ExternalApi resource. + * + * @param {string} externalApiName + * A fully-qualified path representing ExternalApi resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExternalApiName(externalApiName: string) { + return this.pathTemplates.externalApiPathTemplate.match(externalApiName).location; + } + + /** + * Parse the external_api from ExternalApi resource. + * + * @param {string} externalApiName + * A fully-qualified path representing ExternalApi resource. + * @returns {string} A string representing the external_api. + */ + matchExternalApiFromExternalApiName(externalApiName: string) { + return this.pathTemplates.externalApiPathTemplate.match(externalApiName).external_api; + } + + /** + * Return a fully-qualified hostProjectRegistration resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} host_project_registration + * @returns {string} Resource name string. + */ + hostProjectRegistrationPath(project:string,location:string,hostProjectRegistration:string) { + return this.pathTemplates.hostProjectRegistrationPathTemplate.render({ + project: project, + location: location, + host_project_registration: hostProjectRegistration, + }); + } + + /** + * Parse the project from HostProjectRegistration resource. + * + * @param {string} hostProjectRegistrationName + * A fully-qualified path representing HostProjectRegistration resource. + * @returns {string} A string representing the project. + */ + matchProjectFromHostProjectRegistrationName(hostProjectRegistrationName: string) { + return this.pathTemplates.hostProjectRegistrationPathTemplate.match(hostProjectRegistrationName).project; + } + + /** + * Parse the location from HostProjectRegistration resource. + * + * @param {string} hostProjectRegistrationName + * A fully-qualified path representing HostProjectRegistration resource. + * @returns {string} A string representing the location. + */ + matchLocationFromHostProjectRegistrationName(hostProjectRegistrationName: string) { + return this.pathTemplates.hostProjectRegistrationPathTemplate.match(hostProjectRegistrationName).location; + } + + /** + * Parse the host_project_registration from HostProjectRegistration resource. + * + * @param {string} hostProjectRegistrationName + * A fully-qualified path representing HostProjectRegistration resource. + * @returns {string} A string representing the host_project_registration. + */ + matchHostProjectRegistrationFromHostProjectRegistrationName(hostProjectRegistrationName: string) { + return this.pathTemplates.hostProjectRegistrationPathTemplate.match(hostProjectRegistrationName).host_project_registration; + } + + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project:string,location:string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + + /** + * Return a fully-qualified plugin resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} plugin + * @returns {string} Resource name string. + */ + pluginPath(project:string,location:string,plugin:string) { + return this.pathTemplates.pluginPathTemplate.render({ + project: project, + location: location, + plugin: plugin, + }); + } + + /** + * Parse the project from Plugin resource. + * + * @param {string} pluginName + * A fully-qualified path representing Plugin resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPluginName(pluginName: string) { + return this.pathTemplates.pluginPathTemplate.match(pluginName).project; + } + + /** + * Parse the location from Plugin resource. + * + * @param {string} pluginName + * A fully-qualified path representing Plugin resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPluginName(pluginName: string) { + return this.pathTemplates.pluginPathTemplate.match(pluginName).location; + } + + /** + * Parse the plugin from Plugin resource. + * + * @param {string} pluginName + * A fully-qualified path representing Plugin resource. + * @returns {string} A string representing the plugin. + */ + matchPluginFromPluginName(pluginName: string) { + return this.pathTemplates.pluginPathTemplate.match(pluginName).plugin; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project:string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified runtimeProjectAttachment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} runtime_project_attachment + * @returns {string} Resource name string. + */ + runtimeProjectAttachmentPath(project:string,location:string,runtimeProjectAttachment:string) { + return this.pathTemplates.runtimeProjectAttachmentPathTemplate.render({ + project: project, + location: location, + runtime_project_attachment: runtimeProjectAttachment, + }); + } + + /** + * Parse the project from RuntimeProjectAttachment resource. + * + * @param {string} runtimeProjectAttachmentName + * A fully-qualified path representing RuntimeProjectAttachment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRuntimeProjectAttachmentName(runtimeProjectAttachmentName: string) { + return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match(runtimeProjectAttachmentName).project; + } + + /** + * Parse the location from RuntimeProjectAttachment resource. + * + * @param {string} runtimeProjectAttachmentName + * A fully-qualified path representing RuntimeProjectAttachment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRuntimeProjectAttachmentName(runtimeProjectAttachmentName: string) { + return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match(runtimeProjectAttachmentName).location; + } + + /** + * Parse the runtime_project_attachment from RuntimeProjectAttachment resource. + * + * @param {string} runtimeProjectAttachmentName + * A fully-qualified path representing RuntimeProjectAttachment resource. + * @returns {string} A string representing the runtime_project_attachment. + */ + matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName(runtimeProjectAttachmentName: string) { + return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match(runtimeProjectAttachmentName).runtime_project_attachment; + } + + /** + * Return a fully-qualified spec resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @param {string} version + * @param {string} spec + * @returns {string} Resource name string. + */ + specPath(project:string,location:string,api:string,version:string,spec:string) { + return this.pathTemplates.specPathTemplate.render({ + project: project, + location: location, + api: api, + version: version, + spec: spec, + }); + } + + /** + * Parse the project from Spec resource. + * + * @param {string} specName + * A fully-qualified path representing Spec resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSpecName(specName: string) { + return this.pathTemplates.specPathTemplate.match(specName).project; + } + + /** + * Parse the location from Spec resource. + * + * @param {string} specName + * A fully-qualified path representing Spec resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSpecName(specName: string) { + return this.pathTemplates.specPathTemplate.match(specName).location; + } + + /** + * Parse the api from Spec resource. + * + * @param {string} specName + * A fully-qualified path representing Spec resource. + * @returns {string} A string representing the api. + */ + matchApiFromSpecName(specName: string) { + return this.pathTemplates.specPathTemplate.match(specName).api; + } + + /** + * Parse the version from Spec resource. + * + * @param {string} specName + * A fully-qualified path representing Spec resource. + * @returns {string} A string representing the version. + */ + matchVersionFromSpecName(specName: string) { + return this.pathTemplates.specPathTemplate.match(specName).version; + } + + /** + * Parse the spec from Spec resource. + * + * @param {string} specName + * A fully-qualified path representing Spec resource. + * @returns {string} A string representing the spec. + */ + matchSpecFromSpecName(specName: string) { + return this.pathTemplates.specPathTemplate.match(specName).spec; + } + + /** + * Return a fully-qualified styleGuide resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} plugin + * @returns {string} Resource name string. + */ + styleGuidePath(project:string,location:string,plugin:string) { + return this.pathTemplates.styleGuidePathTemplate.render({ + project: project, + location: location, + plugin: plugin, + }); + } + + /** + * Parse the project from StyleGuide resource. + * + * @param {string} styleGuideName + * A fully-qualified path representing StyleGuide resource. + * @returns {string} A string representing the project. + */ + matchProjectFromStyleGuideName(styleGuideName: string) { + return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName).project; + } + + /** + * Parse the location from StyleGuide resource. + * + * @param {string} styleGuideName + * A fully-qualified path representing StyleGuide resource. + * @returns {string} A string representing the location. + */ + matchLocationFromStyleGuideName(styleGuideName: string) { + return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName).location; + } + + /** + * Parse the plugin from StyleGuide resource. + * + * @param {string} styleGuideName + * A fully-qualified path representing StyleGuide resource. + * @returns {string} A string representing the plugin. + */ + matchPluginFromStyleGuideName(styleGuideName: string) { + return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName).plugin; + } + + /** + * Return a fully-qualified version resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @param {string} version + * @returns {string} Resource name string. + */ + versionPath(project:string,location:string,api:string,version:string) { + return this.pathTemplates.versionPathTemplate.render({ + project: project, + location: location, + api: api, + version: version, + }); + } + + /** + * Parse the project from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the project. + */ + matchProjectFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).project; + } + + /** + * Parse the location from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the location. + */ + matchLocationFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).location; + } + + /** + * Parse the api from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the api. + */ + matchApiFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).api; + } + + /** + * Parse the version from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the version. + */ + matchVersionFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).version; + } + + /** + * 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.apiHubDependenciesStub && !this._terminated) { + return this.apiHubDependenciesStub.then(stub => { + this._terminated = true; + stub.close(); + this.locationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_dependencies_client_config.json b/owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_dependencies_client_config.json new file mode 100644 index 00000000000..eade2c78f29 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_dependencies_client_config.json @@ -0,0 +1,63 @@ +{ + "interfaces": { + "google.cloud.apihub.v1.ApiHubDependencies": { + "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": { + "CreateDependency": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetDependency": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "UpdateDependency": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteDependency": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListDependencies": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_dependencies_proto_list.json b/owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_dependencies_proto_list.json new file mode 100644 index 00000000000..07e987f7fb3 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_dependencies_proto_list.json @@ -0,0 +1,9 @@ +[ + "../../protos/google/cloud/apihub/v1/apihub_service.proto", + "../../protos/google/cloud/apihub/v1/common_fields.proto", + "../../protos/google/cloud/apihub/v1/host_project_registration_service.proto", + "../../protos/google/cloud/apihub/v1/linting_service.proto", + "../../protos/google/cloud/apihub/v1/plugin_service.proto", + "../../protos/google/cloud/apihub/v1/provisioning_service.proto", + "../../protos/google/cloud/apihub/v1/runtime_project_attachment_service.proto" +] diff --git a/owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_plugin_client.ts b/owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_plugin_client.ts new file mode 100644 index 00000000000..68e24ef3c3a --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_plugin_client.ts @@ -0,0 +1,1463 @@ +// Copyright 2024 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, LocationsClient, LocationProtos} from 'google-gax'; + +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); + +/** + * Client JSON configuration object, loaded from + * `src/v1/api_hub_plugin_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './api_hub_plugin_client_config.json'; +const version = require('../../../package.json').version; + +/** + * This service is used for managing plugins inside the API Hub. + * @class + * @memberof v1 + */ +export class ApiHubPluginClient { + 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}; + private _universeDomain: string; + private _servicePath: string; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + locationsClient: LocationsClient; + pathTemplates: {[name: string]: gax.PathTemplate}; + apiHubPluginStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of ApiHubPluginClient. + * + * @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 ApiHubPluginClient({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 ApiHubPluginClient; + if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { + throw new Error('Please set either universe_domain or universeDomain, but not both.'); + } + const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; + this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; + this._servicePath = 'apihub.' + this._universeDomain; + const servicePath = opts?.servicePath || opts?.apiEndpoint || this._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 !== this._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 = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + 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 === 'object' && '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 = { + apiPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}' + ), + apiHubInstancePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apiHubInstances/{api_hub_instance}' + ), + apiOperationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}' + ), + attributePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/attributes/{attribute}' + ), + definitionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}' + ), + dependencyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/dependencies/{dependency}' + ), + deploymentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/deployments/{deployment}' + ), + externalApiPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/externalApis/{external_api}' + ), + hostProjectRegistrationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/hostProjectRegistrations/{host_project_registration}' + ), + pluginPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/plugins/{plugin}' + ), + runtimeProjectAttachmentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}' + ), + specPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}' + ), + styleGuidePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/plugins/{plugin}/styleGuide' + ), + versionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}/versions/{version}' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.apihub.v1.ApiHubPlugin', 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.apiHubPluginStub) { + return this.apiHubPluginStub; + } + + // Put together the "service stub" for + // google.cloud.apihub.v1.ApiHubPlugin. + this.apiHubPluginStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.apihub.v1.ApiHubPlugin') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.apihub.v1.ApiHubPlugin, + 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 apiHubPluginStubMethods = + ['getPlugin', 'enablePlugin', 'disablePlugin']; + for (const methodName of apiHubPluginStubMethods) { + const callPromise = this.apiHubPluginStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.apiHubPluginStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'apihub.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'apihub.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * 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 -- + // ------------------- +/** + * Get details about an API Hub plugin. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the plugin to retrieve. + * Format: `projects/{project}/locations/{location}/plugins/{plugin}`. + * @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.apihub.v1.Plugin|Plugin}. + * 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/api_hub_plugin.get_plugin.js + * region_tag:apihub_v1_generated_ApiHubPlugin_GetPlugin_async + */ + getPlugin( + request?: protos.google.cloud.apihub.v1.IGetPluginRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.apihub.v1.IPlugin, + protos.google.cloud.apihub.v1.IGetPluginRequest|undefined, {}|undefined + ]>; + getPlugin( + request: protos.google.cloud.apihub.v1.IGetPluginRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.IPlugin, + protos.google.cloud.apihub.v1.IGetPluginRequest|null|undefined, + {}|null|undefined>): void; + getPlugin( + request: protos.google.cloud.apihub.v1.IGetPluginRequest, + callback: Callback< + protos.google.cloud.apihub.v1.IPlugin, + protos.google.cloud.apihub.v1.IGetPluginRequest|null|undefined, + {}|null|undefined>): void; + getPlugin( + request?: protos.google.cloud.apihub.v1.IGetPluginRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.apihub.v1.IPlugin, + protos.google.cloud.apihub.v1.IGetPluginRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.apihub.v1.IPlugin, + protos.google.cloud.apihub.v1.IGetPluginRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.apihub.v1.IPlugin, + protos.google.cloud.apihub.v1.IGetPluginRequest|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.getPlugin(request, options, callback); + } +/** + * Enables a plugin. + * The `state` of the plugin after enabling is `ENABLED` + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the plugin to enable. + * Format: `projects/{project}/locations/{location}/plugins/{plugin}`. + * @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.apihub.v1.Plugin|Plugin}. + * 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/api_hub_plugin.enable_plugin.js + * region_tag:apihub_v1_generated_ApiHubPlugin_EnablePlugin_async + */ + enablePlugin( + request?: protos.google.cloud.apihub.v1.IEnablePluginRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.apihub.v1.IPlugin, + protos.google.cloud.apihub.v1.IEnablePluginRequest|undefined, {}|undefined + ]>; + enablePlugin( + request: protos.google.cloud.apihub.v1.IEnablePluginRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.IPlugin, + protos.google.cloud.apihub.v1.IEnablePluginRequest|null|undefined, + {}|null|undefined>): void; + enablePlugin( + request: protos.google.cloud.apihub.v1.IEnablePluginRequest, + callback: Callback< + protos.google.cloud.apihub.v1.IPlugin, + protos.google.cloud.apihub.v1.IEnablePluginRequest|null|undefined, + {}|null|undefined>): void; + enablePlugin( + request?: protos.google.cloud.apihub.v1.IEnablePluginRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.apihub.v1.IPlugin, + protos.google.cloud.apihub.v1.IEnablePluginRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.apihub.v1.IPlugin, + protos.google.cloud.apihub.v1.IEnablePluginRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.apihub.v1.IPlugin, + protos.google.cloud.apihub.v1.IEnablePluginRequest|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.enablePlugin(request, options, callback); + } +/** + * Disables a plugin. + * The `state` of the plugin after disabling is `DISABLED` + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the plugin to disable. + * Format: `projects/{project}/locations/{location}/plugins/{plugin}`. + * @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.apihub.v1.Plugin|Plugin}. + * 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/api_hub_plugin.disable_plugin.js + * region_tag:apihub_v1_generated_ApiHubPlugin_DisablePlugin_async + */ + disablePlugin( + request?: protos.google.cloud.apihub.v1.IDisablePluginRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.apihub.v1.IPlugin, + protos.google.cloud.apihub.v1.IDisablePluginRequest|undefined, {}|undefined + ]>; + disablePlugin( + request: protos.google.cloud.apihub.v1.IDisablePluginRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.IPlugin, + protos.google.cloud.apihub.v1.IDisablePluginRequest|null|undefined, + {}|null|undefined>): void; + disablePlugin( + request: protos.google.cloud.apihub.v1.IDisablePluginRequest, + callback: Callback< + protos.google.cloud.apihub.v1.IPlugin, + protos.google.cloud.apihub.v1.IDisablePluginRequest|null|undefined, + {}|null|undefined>): void; + disablePlugin( + request?: protos.google.cloud.apihub.v1.IDisablePluginRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.apihub.v1.IPlugin, + protos.google.cloud.apihub.v1.IDisablePluginRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.apihub.v1.IPlugin, + protos.google.cloud.apihub.v1.IDisablePluginRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.apihub.v1.IPlugin, + protos.google.cloud.apihub.v1.IDisablePluginRequest|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.disablePlugin(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); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified api resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @returns {string} Resource name string. + */ + apiPath(project:string,location:string,api:string) { + return this.pathTemplates.apiPathTemplate.render({ + project: project, + location: location, + api: api, + }); + } + + /** + * Parse the project from Api resource. + * + * @param {string} apiName + * A fully-qualified path representing Api resource. + * @returns {string} A string representing the project. + */ + matchProjectFromApiName(apiName: string) { + return this.pathTemplates.apiPathTemplate.match(apiName).project; + } + + /** + * Parse the location from Api resource. + * + * @param {string} apiName + * A fully-qualified path representing Api resource. + * @returns {string} A string representing the location. + */ + matchLocationFromApiName(apiName: string) { + return this.pathTemplates.apiPathTemplate.match(apiName).location; + } + + /** + * Parse the api from Api resource. + * + * @param {string} apiName + * A fully-qualified path representing Api resource. + * @returns {string} A string representing the api. + */ + matchApiFromApiName(apiName: string) { + return this.pathTemplates.apiPathTemplate.match(apiName).api; + } + + /** + * Return a fully-qualified apiHubInstance resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api_hub_instance + * @returns {string} Resource name string. + */ + apiHubInstancePath(project:string,location:string,apiHubInstance:string) { + return this.pathTemplates.apiHubInstancePathTemplate.render({ + project: project, + location: location, + api_hub_instance: apiHubInstance, + }); + } + + /** + * Parse the project from ApiHubInstance resource. + * + * @param {string} apiHubInstanceName + * A fully-qualified path representing ApiHubInstance resource. + * @returns {string} A string representing the project. + */ + matchProjectFromApiHubInstanceName(apiHubInstanceName: string) { + return this.pathTemplates.apiHubInstancePathTemplate.match(apiHubInstanceName).project; + } + + /** + * Parse the location from ApiHubInstance resource. + * + * @param {string} apiHubInstanceName + * A fully-qualified path representing ApiHubInstance resource. + * @returns {string} A string representing the location. + */ + matchLocationFromApiHubInstanceName(apiHubInstanceName: string) { + return this.pathTemplates.apiHubInstancePathTemplate.match(apiHubInstanceName).location; + } + + /** + * Parse the api_hub_instance from ApiHubInstance resource. + * + * @param {string} apiHubInstanceName + * A fully-qualified path representing ApiHubInstance resource. + * @returns {string} A string representing the api_hub_instance. + */ + matchApiHubInstanceFromApiHubInstanceName(apiHubInstanceName: string) { + return this.pathTemplates.apiHubInstancePathTemplate.match(apiHubInstanceName).api_hub_instance; + } + + /** + * Return a fully-qualified apiOperation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @param {string} version + * @param {string} operation + * @returns {string} Resource name string. + */ + apiOperationPath(project:string,location:string,api:string,version:string,operation:string) { + return this.pathTemplates.apiOperationPathTemplate.render({ + project: project, + location: location, + api: api, + version: version, + operation: operation, + }); + } + + /** + * Parse the project from ApiOperation resource. + * + * @param {string} apiOperationName + * A fully-qualified path representing ApiOperation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromApiOperationName(apiOperationName: string) { + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).project; + } + + /** + * Parse the location from ApiOperation resource. + * + * @param {string} apiOperationName + * A fully-qualified path representing ApiOperation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromApiOperationName(apiOperationName: string) { + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).location; + } + + /** + * Parse the api from ApiOperation resource. + * + * @param {string} apiOperationName + * A fully-qualified path representing ApiOperation resource. + * @returns {string} A string representing the api. + */ + matchApiFromApiOperationName(apiOperationName: string) { + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).api; + } + + /** + * Parse the version from ApiOperation resource. + * + * @param {string} apiOperationName + * A fully-qualified path representing ApiOperation resource. + * @returns {string} A string representing the version. + */ + matchVersionFromApiOperationName(apiOperationName: string) { + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).version; + } + + /** + * Parse the operation from ApiOperation resource. + * + * @param {string} apiOperationName + * A fully-qualified path representing ApiOperation resource. + * @returns {string} A string representing the operation. + */ + matchOperationFromApiOperationName(apiOperationName: string) { + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).operation; + } + + /** + * Return a fully-qualified attribute resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} attribute + * @returns {string} Resource name string. + */ + attributePath(project:string,location:string,attribute:string) { + return this.pathTemplates.attributePathTemplate.render({ + project: project, + location: location, + attribute: attribute, + }); + } + + /** + * Parse the project from Attribute resource. + * + * @param {string} attributeName + * A fully-qualified path representing Attribute resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAttributeName(attributeName: string) { + return this.pathTemplates.attributePathTemplate.match(attributeName).project; + } + + /** + * Parse the location from Attribute resource. + * + * @param {string} attributeName + * A fully-qualified path representing Attribute resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAttributeName(attributeName: string) { + return this.pathTemplates.attributePathTemplate.match(attributeName).location; + } + + /** + * Parse the attribute from Attribute resource. + * + * @param {string} attributeName + * A fully-qualified path representing Attribute resource. + * @returns {string} A string representing the attribute. + */ + matchAttributeFromAttributeName(attributeName: string) { + return this.pathTemplates.attributePathTemplate.match(attributeName).attribute; + } + + /** + * Return a fully-qualified definition resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @param {string} version + * @param {string} definition + * @returns {string} Resource name string. + */ + definitionPath(project:string,location:string,api:string,version:string,definition:string) { + return this.pathTemplates.definitionPathTemplate.render({ + project: project, + location: location, + api: api, + version: version, + definition: definition, + }); + } + + /** + * Parse the project from Definition resource. + * + * @param {string} definitionName + * A fully-qualified path representing Definition resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDefinitionName(definitionName: string) { + return this.pathTemplates.definitionPathTemplate.match(definitionName).project; + } + + /** + * Parse the location from Definition resource. + * + * @param {string} definitionName + * A fully-qualified path representing Definition resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDefinitionName(definitionName: string) { + return this.pathTemplates.definitionPathTemplate.match(definitionName).location; + } + + /** + * Parse the api from Definition resource. + * + * @param {string} definitionName + * A fully-qualified path representing Definition resource. + * @returns {string} A string representing the api. + */ + matchApiFromDefinitionName(definitionName: string) { + return this.pathTemplates.definitionPathTemplate.match(definitionName).api; + } + + /** + * Parse the version from Definition resource. + * + * @param {string} definitionName + * A fully-qualified path representing Definition resource. + * @returns {string} A string representing the version. + */ + matchVersionFromDefinitionName(definitionName: string) { + return this.pathTemplates.definitionPathTemplate.match(definitionName).version; + } + + /** + * Parse the definition from Definition resource. + * + * @param {string} definitionName + * A fully-qualified path representing Definition resource. + * @returns {string} A string representing the definition. + */ + matchDefinitionFromDefinitionName(definitionName: string) { + return this.pathTemplates.definitionPathTemplate.match(definitionName).definition; + } + + /** + * Return a fully-qualified dependency resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dependency + * @returns {string} Resource name string. + */ + dependencyPath(project:string,location:string,dependency:string) { + return this.pathTemplates.dependencyPathTemplate.render({ + project: project, + location: location, + dependency: dependency, + }); + } + + /** + * Parse the project from Dependency resource. + * + * @param {string} dependencyName + * A fully-qualified path representing Dependency resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDependencyName(dependencyName: string) { + return this.pathTemplates.dependencyPathTemplate.match(dependencyName).project; + } + + /** + * Parse the location from Dependency resource. + * + * @param {string} dependencyName + * A fully-qualified path representing Dependency resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDependencyName(dependencyName: string) { + return this.pathTemplates.dependencyPathTemplate.match(dependencyName).location; + } + + /** + * Parse the dependency from Dependency resource. + * + * @param {string} dependencyName + * A fully-qualified path representing Dependency resource. + * @returns {string} A string representing the dependency. + */ + matchDependencyFromDependencyName(dependencyName: string) { + return this.pathTemplates.dependencyPathTemplate.match(dependencyName).dependency; + } + + /** + * Return a fully-qualified deployment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} deployment + * @returns {string} Resource name string. + */ + deploymentPath(project:string,location:string,deployment:string) { + return this.pathTemplates.deploymentPathTemplate.render({ + project: project, + location: location, + deployment: deployment, + }); + } + + /** + * Parse the project from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName).project; + } + + /** + * Parse the location from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName).location; + } + + /** + * Parse the deployment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the deployment. + */ + matchDeploymentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName).deployment; + } + + /** + * Return a fully-qualified externalApi resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} external_api + * @returns {string} Resource name string. + */ + externalApiPath(project:string,location:string,externalApi:string) { + return this.pathTemplates.externalApiPathTemplate.render({ + project: project, + location: location, + external_api: externalApi, + }); + } + + /** + * Parse the project from ExternalApi resource. + * + * @param {string} externalApiName + * A fully-qualified path representing ExternalApi resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExternalApiName(externalApiName: string) { + return this.pathTemplates.externalApiPathTemplate.match(externalApiName).project; + } + + /** + * Parse the location from ExternalApi resource. + * + * @param {string} externalApiName + * A fully-qualified path representing ExternalApi resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExternalApiName(externalApiName: string) { + return this.pathTemplates.externalApiPathTemplate.match(externalApiName).location; + } + + /** + * Parse the external_api from ExternalApi resource. + * + * @param {string} externalApiName + * A fully-qualified path representing ExternalApi resource. + * @returns {string} A string representing the external_api. + */ + matchExternalApiFromExternalApiName(externalApiName: string) { + return this.pathTemplates.externalApiPathTemplate.match(externalApiName).external_api; + } + + /** + * Return a fully-qualified hostProjectRegistration resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} host_project_registration + * @returns {string} Resource name string. + */ + hostProjectRegistrationPath(project:string,location:string,hostProjectRegistration:string) { + return this.pathTemplates.hostProjectRegistrationPathTemplate.render({ + project: project, + location: location, + host_project_registration: hostProjectRegistration, + }); + } + + /** + * Parse the project from HostProjectRegistration resource. + * + * @param {string} hostProjectRegistrationName + * A fully-qualified path representing HostProjectRegistration resource. + * @returns {string} A string representing the project. + */ + matchProjectFromHostProjectRegistrationName(hostProjectRegistrationName: string) { + return this.pathTemplates.hostProjectRegistrationPathTemplate.match(hostProjectRegistrationName).project; + } + + /** + * Parse the location from HostProjectRegistration resource. + * + * @param {string} hostProjectRegistrationName + * A fully-qualified path representing HostProjectRegistration resource. + * @returns {string} A string representing the location. + */ + matchLocationFromHostProjectRegistrationName(hostProjectRegistrationName: string) { + return this.pathTemplates.hostProjectRegistrationPathTemplate.match(hostProjectRegistrationName).location; + } + + /** + * Parse the host_project_registration from HostProjectRegistration resource. + * + * @param {string} hostProjectRegistrationName + * A fully-qualified path representing HostProjectRegistration resource. + * @returns {string} A string representing the host_project_registration. + */ + matchHostProjectRegistrationFromHostProjectRegistrationName(hostProjectRegistrationName: string) { + return this.pathTemplates.hostProjectRegistrationPathTemplate.match(hostProjectRegistrationName).host_project_registration; + } + + /** + * Return a fully-qualified plugin resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} plugin + * @returns {string} Resource name string. + */ + pluginPath(project:string,location:string,plugin:string) { + return this.pathTemplates.pluginPathTemplate.render({ + project: project, + location: location, + plugin: plugin, + }); + } + + /** + * Parse the project from Plugin resource. + * + * @param {string} pluginName + * A fully-qualified path representing Plugin resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPluginName(pluginName: string) { + return this.pathTemplates.pluginPathTemplate.match(pluginName).project; + } + + /** + * Parse the location from Plugin resource. + * + * @param {string} pluginName + * A fully-qualified path representing Plugin resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPluginName(pluginName: string) { + return this.pathTemplates.pluginPathTemplate.match(pluginName).location; + } + + /** + * Parse the plugin from Plugin resource. + * + * @param {string} pluginName + * A fully-qualified path representing Plugin resource. + * @returns {string} A string representing the plugin. + */ + matchPluginFromPluginName(pluginName: string) { + return this.pathTemplates.pluginPathTemplate.match(pluginName).plugin; + } + + /** + * Return a fully-qualified runtimeProjectAttachment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} runtime_project_attachment + * @returns {string} Resource name string. + */ + runtimeProjectAttachmentPath(project:string,location:string,runtimeProjectAttachment:string) { + return this.pathTemplates.runtimeProjectAttachmentPathTemplate.render({ + project: project, + location: location, + runtime_project_attachment: runtimeProjectAttachment, + }); + } + + /** + * Parse the project from RuntimeProjectAttachment resource. + * + * @param {string} runtimeProjectAttachmentName + * A fully-qualified path representing RuntimeProjectAttachment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRuntimeProjectAttachmentName(runtimeProjectAttachmentName: string) { + return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match(runtimeProjectAttachmentName).project; + } + + /** + * Parse the location from RuntimeProjectAttachment resource. + * + * @param {string} runtimeProjectAttachmentName + * A fully-qualified path representing RuntimeProjectAttachment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRuntimeProjectAttachmentName(runtimeProjectAttachmentName: string) { + return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match(runtimeProjectAttachmentName).location; + } + + /** + * Parse the runtime_project_attachment from RuntimeProjectAttachment resource. + * + * @param {string} runtimeProjectAttachmentName + * A fully-qualified path representing RuntimeProjectAttachment resource. + * @returns {string} A string representing the runtime_project_attachment. + */ + matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName(runtimeProjectAttachmentName: string) { + return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match(runtimeProjectAttachmentName).runtime_project_attachment; + } + + /** + * Return a fully-qualified spec resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @param {string} version + * @param {string} spec + * @returns {string} Resource name string. + */ + specPath(project:string,location:string,api:string,version:string,spec:string) { + return this.pathTemplates.specPathTemplate.render({ + project: project, + location: location, + api: api, + version: version, + spec: spec, + }); + } + + /** + * Parse the project from Spec resource. + * + * @param {string} specName + * A fully-qualified path representing Spec resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSpecName(specName: string) { + return this.pathTemplates.specPathTemplate.match(specName).project; + } + + /** + * Parse the location from Spec resource. + * + * @param {string} specName + * A fully-qualified path representing Spec resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSpecName(specName: string) { + return this.pathTemplates.specPathTemplate.match(specName).location; + } + + /** + * Parse the api from Spec resource. + * + * @param {string} specName + * A fully-qualified path representing Spec resource. + * @returns {string} A string representing the api. + */ + matchApiFromSpecName(specName: string) { + return this.pathTemplates.specPathTemplate.match(specName).api; + } + + /** + * Parse the version from Spec resource. + * + * @param {string} specName + * A fully-qualified path representing Spec resource. + * @returns {string} A string representing the version. + */ + matchVersionFromSpecName(specName: string) { + return this.pathTemplates.specPathTemplate.match(specName).version; + } + + /** + * Parse the spec from Spec resource. + * + * @param {string} specName + * A fully-qualified path representing Spec resource. + * @returns {string} A string representing the spec. + */ + matchSpecFromSpecName(specName: string) { + return this.pathTemplates.specPathTemplate.match(specName).spec; + } + + /** + * Return a fully-qualified styleGuide resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} plugin + * @returns {string} Resource name string. + */ + styleGuidePath(project:string,location:string,plugin:string) { + return this.pathTemplates.styleGuidePathTemplate.render({ + project: project, + location: location, + plugin: plugin, + }); + } + + /** + * Parse the project from StyleGuide resource. + * + * @param {string} styleGuideName + * A fully-qualified path representing StyleGuide resource. + * @returns {string} A string representing the project. + */ + matchProjectFromStyleGuideName(styleGuideName: string) { + return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName).project; + } + + /** + * Parse the location from StyleGuide resource. + * + * @param {string} styleGuideName + * A fully-qualified path representing StyleGuide resource. + * @returns {string} A string representing the location. + */ + matchLocationFromStyleGuideName(styleGuideName: string) { + return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName).location; + } + + /** + * Parse the plugin from StyleGuide resource. + * + * @param {string} styleGuideName + * A fully-qualified path representing StyleGuide resource. + * @returns {string} A string representing the plugin. + */ + matchPluginFromStyleGuideName(styleGuideName: string) { + return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName).plugin; + } + + /** + * Return a fully-qualified version resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @param {string} version + * @returns {string} Resource name string. + */ + versionPath(project:string,location:string,api:string,version:string) { + return this.pathTemplates.versionPathTemplate.render({ + project: project, + location: location, + api: api, + version: version, + }); + } + + /** + * Parse the project from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the project. + */ + matchProjectFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).project; + } + + /** + * Parse the location from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the location. + */ + matchLocationFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).location; + } + + /** + * Parse the api from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the api. + */ + matchApiFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).api; + } + + /** + * Parse the version from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the version. + */ + matchVersionFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).version; + } + + /** + * 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.apiHubPluginStub && !this._terminated) { + return this.apiHubPluginStub.then(stub => { + this._terminated = true; + stub.close(); + this.locationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_plugin_client_config.json b/owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_plugin_client_config.json new file mode 100644 index 00000000000..1627eceb991 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_plugin_client_config.json @@ -0,0 +1,53 @@ +{ + "interfaces": { + "google.cloud.apihub.v1.ApiHubPlugin": { + "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": { + "GetPlugin": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "EnablePlugin": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DisablePlugin": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_plugin_proto_list.json b/owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_plugin_proto_list.json new file mode 100644 index 00000000000..07e987f7fb3 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_plugin_proto_list.json @@ -0,0 +1,9 @@ +[ + "../../protos/google/cloud/apihub/v1/apihub_service.proto", + "../../protos/google/cloud/apihub/v1/common_fields.proto", + "../../protos/google/cloud/apihub/v1/host_project_registration_service.proto", + "../../protos/google/cloud/apihub/v1/linting_service.proto", + "../../protos/google/cloud/apihub/v1/plugin_service.proto", + "../../protos/google/cloud/apihub/v1/provisioning_service.proto", + "../../protos/google/cloud/apihub/v1/runtime_project_attachment_service.proto" +] diff --git a/owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_proto_list.json b/owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_proto_list.json new file mode 100644 index 00000000000..07e987f7fb3 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_proto_list.json @@ -0,0 +1,9 @@ +[ + "../../protos/google/cloud/apihub/v1/apihub_service.proto", + "../../protos/google/cloud/apihub/v1/common_fields.proto", + "../../protos/google/cloud/apihub/v1/host_project_registration_service.proto", + "../../protos/google/cloud/apihub/v1/linting_service.proto", + "../../protos/google/cloud/apihub/v1/plugin_service.proto", + "../../protos/google/cloud/apihub/v1/provisioning_service.proto", + "../../protos/google/cloud/apihub/v1/runtime_project_attachment_service.proto" +] diff --git a/owl-bot-staging/google-cloud-apihub/v1/src/v1/gapic_metadata.json b/owl-bot-staging/google-cloud-apihub/v1/src/v1/gapic_metadata.json new file mode 100644 index 00000000000..54b63d3eaca --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/src/v1/gapic_metadata.json @@ -0,0 +1,731 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.apihub.v1", + "libraryPackage": "@google-cloud/apihub", + "services": { + "ApiHub": { + "clients": { + "grpc": { + "libraryClient": "ApiHubClient", + "rpcs": { + "CreateApi": { + "methods": [ + "createApi" + ] + }, + "GetApi": { + "methods": [ + "getApi" + ] + }, + "UpdateApi": { + "methods": [ + "updateApi" + ] + }, + "DeleteApi": { + "methods": [ + "deleteApi" + ] + }, + "CreateVersion": { + "methods": [ + "createVersion" + ] + }, + "GetVersion": { + "methods": [ + "getVersion" + ] + }, + "UpdateVersion": { + "methods": [ + "updateVersion" + ] + }, + "DeleteVersion": { + "methods": [ + "deleteVersion" + ] + }, + "CreateSpec": { + "methods": [ + "createSpec" + ] + }, + "GetSpec": { + "methods": [ + "getSpec" + ] + }, + "GetSpecContents": { + "methods": [ + "getSpecContents" + ] + }, + "UpdateSpec": { + "methods": [ + "updateSpec" + ] + }, + "DeleteSpec": { + "methods": [ + "deleteSpec" + ] + }, + "GetApiOperation": { + "methods": [ + "getApiOperation" + ] + }, + "GetDefinition": { + "methods": [ + "getDefinition" + ] + }, + "CreateDeployment": { + "methods": [ + "createDeployment" + ] + }, + "GetDeployment": { + "methods": [ + "getDeployment" + ] + }, + "UpdateDeployment": { + "methods": [ + "updateDeployment" + ] + }, + "DeleteDeployment": { + "methods": [ + "deleteDeployment" + ] + }, + "CreateAttribute": { + "methods": [ + "createAttribute" + ] + }, + "GetAttribute": { + "methods": [ + "getAttribute" + ] + }, + "UpdateAttribute": { + "methods": [ + "updateAttribute" + ] + }, + "DeleteAttribute": { + "methods": [ + "deleteAttribute" + ] + }, + "CreateExternalApi": { + "methods": [ + "createExternalApi" + ] + }, + "GetExternalApi": { + "methods": [ + "getExternalApi" + ] + }, + "UpdateExternalApi": { + "methods": [ + "updateExternalApi" + ] + }, + "DeleteExternalApi": { + "methods": [ + "deleteExternalApi" + ] + }, + "ListApis": { + "methods": [ + "listApis", + "listApisStream", + "listApisAsync" + ] + }, + "ListVersions": { + "methods": [ + "listVersions", + "listVersionsStream", + "listVersionsAsync" + ] + }, + "ListSpecs": { + "methods": [ + "listSpecs", + "listSpecsStream", + "listSpecsAsync" + ] + }, + "ListApiOperations": { + "methods": [ + "listApiOperations", + "listApiOperationsStream", + "listApiOperationsAsync" + ] + }, + "ListDeployments": { + "methods": [ + "listDeployments", + "listDeploymentsStream", + "listDeploymentsAsync" + ] + }, + "ListAttributes": { + "methods": [ + "listAttributes", + "listAttributesStream", + "listAttributesAsync" + ] + }, + "SearchResources": { + "methods": [ + "searchResources", + "searchResourcesStream", + "searchResourcesAsync" + ] + }, + "ListExternalApis": { + "methods": [ + "listExternalApis", + "listExternalApisStream", + "listExternalApisAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "ApiHubClient", + "rpcs": { + "CreateApi": { + "methods": [ + "createApi" + ] + }, + "GetApi": { + "methods": [ + "getApi" + ] + }, + "UpdateApi": { + "methods": [ + "updateApi" + ] + }, + "DeleteApi": { + "methods": [ + "deleteApi" + ] + }, + "CreateVersion": { + "methods": [ + "createVersion" + ] + }, + "GetVersion": { + "methods": [ + "getVersion" + ] + }, + "UpdateVersion": { + "methods": [ + "updateVersion" + ] + }, + "DeleteVersion": { + "methods": [ + "deleteVersion" + ] + }, + "CreateSpec": { + "methods": [ + "createSpec" + ] + }, + "GetSpec": { + "methods": [ + "getSpec" + ] + }, + "GetSpecContents": { + "methods": [ + "getSpecContents" + ] + }, + "UpdateSpec": { + "methods": [ + "updateSpec" + ] + }, + "DeleteSpec": { + "methods": [ + "deleteSpec" + ] + }, + "GetApiOperation": { + "methods": [ + "getApiOperation" + ] + }, + "GetDefinition": { + "methods": [ + "getDefinition" + ] + }, + "CreateDeployment": { + "methods": [ + "createDeployment" + ] + }, + "GetDeployment": { + "methods": [ + "getDeployment" + ] + }, + "UpdateDeployment": { + "methods": [ + "updateDeployment" + ] + }, + "DeleteDeployment": { + "methods": [ + "deleteDeployment" + ] + }, + "CreateAttribute": { + "methods": [ + "createAttribute" + ] + }, + "GetAttribute": { + "methods": [ + "getAttribute" + ] + }, + "UpdateAttribute": { + "methods": [ + "updateAttribute" + ] + }, + "DeleteAttribute": { + "methods": [ + "deleteAttribute" + ] + }, + "CreateExternalApi": { + "methods": [ + "createExternalApi" + ] + }, + "GetExternalApi": { + "methods": [ + "getExternalApi" + ] + }, + "UpdateExternalApi": { + "methods": [ + "updateExternalApi" + ] + }, + "DeleteExternalApi": { + "methods": [ + "deleteExternalApi" + ] + }, + "ListApis": { + "methods": [ + "listApis", + "listApisStream", + "listApisAsync" + ] + }, + "ListVersions": { + "methods": [ + "listVersions", + "listVersionsStream", + "listVersionsAsync" + ] + }, + "ListSpecs": { + "methods": [ + "listSpecs", + "listSpecsStream", + "listSpecsAsync" + ] + }, + "ListApiOperations": { + "methods": [ + "listApiOperations", + "listApiOperationsStream", + "listApiOperationsAsync" + ] + }, + "ListDeployments": { + "methods": [ + "listDeployments", + "listDeploymentsStream", + "listDeploymentsAsync" + ] + }, + "ListAttributes": { + "methods": [ + "listAttributes", + "listAttributesStream", + "listAttributesAsync" + ] + }, + "SearchResources": { + "methods": [ + "searchResources", + "searchResourcesStream", + "searchResourcesAsync" + ] + }, + "ListExternalApis": { + "methods": [ + "listExternalApis", + "listExternalApisStream", + "listExternalApisAsync" + ] + } + } + } + } + }, + "ApiHubDependencies": { + "clients": { + "grpc": { + "libraryClient": "ApiHubDependenciesClient", + "rpcs": { + "CreateDependency": { + "methods": [ + "createDependency" + ] + }, + "GetDependency": { + "methods": [ + "getDependency" + ] + }, + "UpdateDependency": { + "methods": [ + "updateDependency" + ] + }, + "DeleteDependency": { + "methods": [ + "deleteDependency" + ] + }, + "ListDependencies": { + "methods": [ + "listDependencies", + "listDependenciesStream", + "listDependenciesAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "ApiHubDependenciesClient", + "rpcs": { + "CreateDependency": { + "methods": [ + "createDependency" + ] + }, + "GetDependency": { + "methods": [ + "getDependency" + ] + }, + "UpdateDependency": { + "methods": [ + "updateDependency" + ] + }, + "DeleteDependency": { + "methods": [ + "deleteDependency" + ] + }, + "ListDependencies": { + "methods": [ + "listDependencies", + "listDependenciesStream", + "listDependenciesAsync" + ] + } + } + } + } + }, + "ApiHubPlugin": { + "clients": { + "grpc": { + "libraryClient": "ApiHubPluginClient", + "rpcs": { + "GetPlugin": { + "methods": [ + "getPlugin" + ] + }, + "EnablePlugin": { + "methods": [ + "enablePlugin" + ] + }, + "DisablePlugin": { + "methods": [ + "disablePlugin" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "ApiHubPluginClient", + "rpcs": { + "GetPlugin": { + "methods": [ + "getPlugin" + ] + }, + "EnablePlugin": { + "methods": [ + "enablePlugin" + ] + }, + "DisablePlugin": { + "methods": [ + "disablePlugin" + ] + } + } + } + } + }, + "HostProjectRegistrationService": { + "clients": { + "grpc": { + "libraryClient": "HostProjectRegistrationServiceClient", + "rpcs": { + "CreateHostProjectRegistration": { + "methods": [ + "createHostProjectRegistration" + ] + }, + "GetHostProjectRegistration": { + "methods": [ + "getHostProjectRegistration" + ] + }, + "ListHostProjectRegistrations": { + "methods": [ + "listHostProjectRegistrations", + "listHostProjectRegistrationsStream", + "listHostProjectRegistrationsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "HostProjectRegistrationServiceClient", + "rpcs": { + "CreateHostProjectRegistration": { + "methods": [ + "createHostProjectRegistration" + ] + }, + "GetHostProjectRegistration": { + "methods": [ + "getHostProjectRegistration" + ] + }, + "ListHostProjectRegistrations": { + "methods": [ + "listHostProjectRegistrations", + "listHostProjectRegistrationsStream", + "listHostProjectRegistrationsAsync" + ] + } + } + } + } + }, + "LintingService": { + "clients": { + "grpc": { + "libraryClient": "LintingServiceClient", + "rpcs": { + "GetStyleGuide": { + "methods": [ + "getStyleGuide" + ] + }, + "UpdateStyleGuide": { + "methods": [ + "updateStyleGuide" + ] + }, + "GetStyleGuideContents": { + "methods": [ + "getStyleGuideContents" + ] + }, + "LintSpec": { + "methods": [ + "lintSpec" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "LintingServiceClient", + "rpcs": { + "GetStyleGuide": { + "methods": [ + "getStyleGuide" + ] + }, + "UpdateStyleGuide": { + "methods": [ + "updateStyleGuide" + ] + }, + "GetStyleGuideContents": { + "methods": [ + "getStyleGuideContents" + ] + }, + "LintSpec": { + "methods": [ + "lintSpec" + ] + } + } + } + } + }, + "Provisioning": { + "clients": { + "grpc": { + "libraryClient": "ProvisioningClient", + "rpcs": { + "GetApiHubInstance": { + "methods": [ + "getApiHubInstance" + ] + }, + "LookupApiHubInstance": { + "methods": [ + "lookupApiHubInstance" + ] + }, + "CreateApiHubInstance": { + "methods": [ + "createApiHubInstance" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "ProvisioningClient", + "rpcs": { + "GetApiHubInstance": { + "methods": [ + "getApiHubInstance" + ] + }, + "LookupApiHubInstance": { + "methods": [ + "lookupApiHubInstance" + ] + }, + "CreateApiHubInstance": { + "methods": [ + "createApiHubInstance" + ] + } + } + } + } + }, + "RuntimeProjectAttachmentService": { + "clients": { + "grpc": { + "libraryClient": "RuntimeProjectAttachmentServiceClient", + "rpcs": { + "CreateRuntimeProjectAttachment": { + "methods": [ + "createRuntimeProjectAttachment" + ] + }, + "GetRuntimeProjectAttachment": { + "methods": [ + "getRuntimeProjectAttachment" + ] + }, + "DeleteRuntimeProjectAttachment": { + "methods": [ + "deleteRuntimeProjectAttachment" + ] + }, + "LookupRuntimeProjectAttachment": { + "methods": [ + "lookupRuntimeProjectAttachment" + ] + }, + "ListRuntimeProjectAttachments": { + "methods": [ + "listRuntimeProjectAttachments", + "listRuntimeProjectAttachmentsStream", + "listRuntimeProjectAttachmentsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "RuntimeProjectAttachmentServiceClient", + "rpcs": { + "CreateRuntimeProjectAttachment": { + "methods": [ + "createRuntimeProjectAttachment" + ] + }, + "GetRuntimeProjectAttachment": { + "methods": [ + "getRuntimeProjectAttachment" + ] + }, + "DeleteRuntimeProjectAttachment": { + "methods": [ + "deleteRuntimeProjectAttachment" + ] + }, + "LookupRuntimeProjectAttachment": { + "methods": [ + "lookupRuntimeProjectAttachment" + ] + }, + "ListRuntimeProjectAttachments": { + "methods": [ + "listRuntimeProjectAttachments", + "listRuntimeProjectAttachmentsStream", + "listRuntimeProjectAttachmentsAsync" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-apihub/v1/src/v1/host_project_registration_service_client.ts b/owl-bot-staging/google-cloud-apihub/v1/src/v1/host_project_registration_service_client.ts new file mode 100644 index 00000000000..5fe744da278 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/src/v1/host_project_registration_service_client.ts @@ -0,0 +1,1732 @@ +// Copyright 2024 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, PaginationCallback, GaxCall, 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/host_project_registration_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './host_project_registration_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * This service is used for managing the host project registrations. + * @class + * @memberof v1 + */ +export class HostProjectRegistrationServiceClient { + 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}; + private _universeDomain: string; + private _servicePath: string; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + locationsClient: LocationsClient; + pathTemplates: {[name: string]: gax.PathTemplate}; + hostProjectRegistrationServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of HostProjectRegistrationServiceClient. + * + * @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 HostProjectRegistrationServiceClient({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 HostProjectRegistrationServiceClient; + if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { + throw new Error('Please set either universe_domain or universeDomain, but not both.'); + } + const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; + this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; + this._servicePath = 'apihub.' + this._universeDomain; + const servicePath = opts?.servicePath || opts?.apiEndpoint || this._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 !== this._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 = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + 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 === 'object' && '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 = { + apiPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}' + ), + apiHubInstancePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apiHubInstances/{api_hub_instance}' + ), + apiOperationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}' + ), + attributePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/attributes/{attribute}' + ), + definitionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}' + ), + dependencyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/dependencies/{dependency}' + ), + deploymentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/deployments/{deployment}' + ), + externalApiPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/externalApis/{external_api}' + ), + hostProjectRegistrationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/hostProjectRegistrations/{host_project_registration}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + pluginPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/plugins/{plugin}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + runtimeProjectAttachmentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}' + ), + specPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}' + ), + styleGuidePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/plugins/{plugin}/styleGuide' + ), + versionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}/versions/{version}' + ), + }; + + // 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 = { + listHostProjectRegistrations: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'hostProjectRegistrations') + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.apihub.v1.HostProjectRegistrationService', 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.hostProjectRegistrationServiceStub) { + return this.hostProjectRegistrationServiceStub; + } + + // Put together the "service stub" for + // google.cloud.apihub.v1.HostProjectRegistrationService. + this.hostProjectRegistrationServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.apihub.v1.HostProjectRegistrationService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.apihub.v1.HostProjectRegistrationService, + 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 hostProjectRegistrationServiceStubMethods = + ['createHostProjectRegistration', 'getHostProjectRegistration', 'listHostProjectRegistrations']; + for (const methodName of hostProjectRegistrationServiceStubMethods) { + const callPromise = this.hostProjectRegistrationServiceStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + this.descriptors.page[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.hostProjectRegistrationServiceStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'apihub.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'apihub.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * 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 -- + // ------------------- +/** + * Create a host project registration. + * A Google cloud project can be registered as a host project if it is not + * attached as a runtime project to another host project. + * A project can be registered as a host project only once. Subsequent + * register calls for the same project will fail. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource for the host project. + * Format: `projects/{project}/locations/{location}` + * @param {string} request.hostProjectRegistrationId + * Required. The ID to use for the Host Project Registration, which will + * become the final component of the host project registration's resource + * name. The ID must be the same as the Google cloud project specified in the + * host_project_registration.gcp_project field. + * @param {google.cloud.apihub.v1.HostProjectRegistration} request.hostProjectRegistration + * Required. The host project registration to register. + * @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.apihub.v1.HostProjectRegistration|HostProjectRegistration}. + * 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/host_project_registration_service.create_host_project_registration.js + * region_tag:apihub_v1_generated_HostProjectRegistrationService_CreateHostProjectRegistration_async + */ + createHostProjectRegistration( + request?: protos.google.cloud.apihub.v1.ICreateHostProjectRegistrationRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.apihub.v1.IHostProjectRegistration, + protos.google.cloud.apihub.v1.ICreateHostProjectRegistrationRequest|undefined, {}|undefined + ]>; + createHostProjectRegistration( + request: protos.google.cloud.apihub.v1.ICreateHostProjectRegistrationRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.IHostProjectRegistration, + protos.google.cloud.apihub.v1.ICreateHostProjectRegistrationRequest|null|undefined, + {}|null|undefined>): void; + createHostProjectRegistration( + request: protos.google.cloud.apihub.v1.ICreateHostProjectRegistrationRequest, + callback: Callback< + protos.google.cloud.apihub.v1.IHostProjectRegistration, + protos.google.cloud.apihub.v1.ICreateHostProjectRegistrationRequest|null|undefined, + {}|null|undefined>): void; + createHostProjectRegistration( + request?: protos.google.cloud.apihub.v1.ICreateHostProjectRegistrationRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.apihub.v1.IHostProjectRegistration, + protos.google.cloud.apihub.v1.ICreateHostProjectRegistrationRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.apihub.v1.IHostProjectRegistration, + protos.google.cloud.apihub.v1.ICreateHostProjectRegistrationRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.apihub.v1.IHostProjectRegistration, + protos.google.cloud.apihub.v1.ICreateHostProjectRegistrationRequest|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.createHostProjectRegistration(request, options, callback); + } +/** + * Get a host project registration. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Host project registration resource name. + * projects/{project}/locations/{location}/hostProjectRegistrations/{host_project_registration_id} + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.apihub.v1.HostProjectRegistration|HostProjectRegistration}. + * 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/host_project_registration_service.get_host_project_registration.js + * region_tag:apihub_v1_generated_HostProjectRegistrationService_GetHostProjectRegistration_async + */ + getHostProjectRegistration( + request?: protos.google.cloud.apihub.v1.IGetHostProjectRegistrationRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.apihub.v1.IHostProjectRegistration, + protos.google.cloud.apihub.v1.IGetHostProjectRegistrationRequest|undefined, {}|undefined + ]>; + getHostProjectRegistration( + request: protos.google.cloud.apihub.v1.IGetHostProjectRegistrationRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.IHostProjectRegistration, + protos.google.cloud.apihub.v1.IGetHostProjectRegistrationRequest|null|undefined, + {}|null|undefined>): void; + getHostProjectRegistration( + request: protos.google.cloud.apihub.v1.IGetHostProjectRegistrationRequest, + callback: Callback< + protos.google.cloud.apihub.v1.IHostProjectRegistration, + protos.google.cloud.apihub.v1.IGetHostProjectRegistrationRequest|null|undefined, + {}|null|undefined>): void; + getHostProjectRegistration( + request?: protos.google.cloud.apihub.v1.IGetHostProjectRegistrationRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.apihub.v1.IHostProjectRegistration, + protos.google.cloud.apihub.v1.IGetHostProjectRegistrationRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.apihub.v1.IHostProjectRegistration, + protos.google.cloud.apihub.v1.IGetHostProjectRegistrationRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.apihub.v1.IHostProjectRegistration, + protos.google.cloud.apihub.v1.IGetHostProjectRegistrationRequest|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.getHostProjectRegistration(request, options, callback); + } + + /** + * Lists host project registrations. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of host projects. + * Format: `projects/* /locations/*` + * @param {number} [request.pageSize] + * Optional. The maximum number of host project registrations to return. The + * service may return fewer than this value. If unspecified, at most 50 host + * project registrations will be returned. The maximum value is 1000; values + * above 1000 will be coerced to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous + * `ListHostProjectRegistrations` call. Provide this to retrieve the + * subsequent page. + * + * When paginating, all other parameters (except page_size) provided to + * `ListHostProjectRegistrations` must match the call that provided the page + * token. + * @param {string} [request.filter] + * Optional. An expression that filters the list of HostProjectRegistrations. + * + * A filter expression consists of a field name, a comparison + * operator, and a value for filtering. The value must be a string. All + * standard operators as documented at https://google.aip.dev/160 are + * supported. + * + * The following fields in the `HostProjectRegistration` are eligible for + * filtering: + * + * * `name` - The name of the HostProjectRegistration. + * * `create_time` - The time at which the HostProjectRegistration was + * created. The value should be in the + * (RFC3339)[https://tools.ietf.org/html/rfc3339] format. + * * `gcp_project` - The Google cloud project associated with the + * HostProjectRegistration. + * @param {string} [request.orderBy] + * Optional. Hint for how to order the results. + * @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.apihub.v1.HostProjectRegistration|HostProjectRegistration}. + * 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 `listHostProjectRegistrationsAsync()` + * 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. + */ + listHostProjectRegistrations( + request?: protos.google.cloud.apihub.v1.IListHostProjectRegistrationsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.apihub.v1.IHostProjectRegistration[], + protos.google.cloud.apihub.v1.IListHostProjectRegistrationsRequest|null, + protos.google.cloud.apihub.v1.IListHostProjectRegistrationsResponse + ]>; + listHostProjectRegistrations( + request: protos.google.cloud.apihub.v1.IListHostProjectRegistrationsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.apihub.v1.IListHostProjectRegistrationsRequest, + protos.google.cloud.apihub.v1.IListHostProjectRegistrationsResponse|null|undefined, + protos.google.cloud.apihub.v1.IHostProjectRegistration>): void; + listHostProjectRegistrations( + request: protos.google.cloud.apihub.v1.IListHostProjectRegistrationsRequest, + callback: PaginationCallback< + protos.google.cloud.apihub.v1.IListHostProjectRegistrationsRequest, + protos.google.cloud.apihub.v1.IListHostProjectRegistrationsResponse|null|undefined, + protos.google.cloud.apihub.v1.IHostProjectRegistration>): void; + listHostProjectRegistrations( + request?: protos.google.cloud.apihub.v1.IListHostProjectRegistrationsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.apihub.v1.IListHostProjectRegistrationsRequest, + protos.google.cloud.apihub.v1.IListHostProjectRegistrationsResponse|null|undefined, + protos.google.cloud.apihub.v1.IHostProjectRegistration>, + callback?: PaginationCallback< + protos.google.cloud.apihub.v1.IListHostProjectRegistrationsRequest, + protos.google.cloud.apihub.v1.IListHostProjectRegistrationsResponse|null|undefined, + protos.google.cloud.apihub.v1.IHostProjectRegistration>): + Promise<[ + protos.google.cloud.apihub.v1.IHostProjectRegistration[], + protos.google.cloud.apihub.v1.IListHostProjectRegistrationsRequest|null, + protos.google.cloud.apihub.v1.IListHostProjectRegistrationsResponse + ]>|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.listHostProjectRegistrations(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of host projects. + * Format: `projects/* /locations/*` + * @param {number} [request.pageSize] + * Optional. The maximum number of host project registrations to return. The + * service may return fewer than this value. If unspecified, at most 50 host + * project registrations will be returned. The maximum value is 1000; values + * above 1000 will be coerced to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous + * `ListHostProjectRegistrations` call. Provide this to retrieve the + * subsequent page. + * + * When paginating, all other parameters (except page_size) provided to + * `ListHostProjectRegistrations` must match the call that provided the page + * token. + * @param {string} [request.filter] + * Optional. An expression that filters the list of HostProjectRegistrations. + * + * A filter expression consists of a field name, a comparison + * operator, and a value for filtering. The value must be a string. All + * standard operators as documented at https://google.aip.dev/160 are + * supported. + * + * The following fields in the `HostProjectRegistration` are eligible for + * filtering: + * + * * `name` - The name of the HostProjectRegistration. + * * `create_time` - The time at which the HostProjectRegistration was + * created. The value should be in the + * (RFC3339)[https://tools.ietf.org/html/rfc3339] format. + * * `gcp_project` - The Google cloud project associated with the + * HostProjectRegistration. + * @param {string} [request.orderBy] + * Optional. Hint for how to order the results. + * @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.apihub.v1.HostProjectRegistration|HostProjectRegistration} 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 `listHostProjectRegistrationsAsync()` + * 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. + */ + listHostProjectRegistrationsStream( + request?: protos.google.cloud.apihub.v1.IListHostProjectRegistrationsRequest, + 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['listHostProjectRegistrations']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listHostProjectRegistrations.createStream( + this.innerApiCalls.listHostProjectRegistrations as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listHostProjectRegistrations`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of host projects. + * Format: `projects/* /locations/*` + * @param {number} [request.pageSize] + * Optional. The maximum number of host project registrations to return. The + * service may return fewer than this value. If unspecified, at most 50 host + * project registrations will be returned. The maximum value is 1000; values + * above 1000 will be coerced to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous + * `ListHostProjectRegistrations` call. Provide this to retrieve the + * subsequent page. + * + * When paginating, all other parameters (except page_size) provided to + * `ListHostProjectRegistrations` must match the call that provided the page + * token. + * @param {string} [request.filter] + * Optional. An expression that filters the list of HostProjectRegistrations. + * + * A filter expression consists of a field name, a comparison + * operator, and a value for filtering. The value must be a string. All + * standard operators as documented at https://google.aip.dev/160 are + * supported. + * + * The following fields in the `HostProjectRegistration` are eligible for + * filtering: + * + * * `name` - The name of the HostProjectRegistration. + * * `create_time` - The time at which the HostProjectRegistration was + * created. The value should be in the + * (RFC3339)[https://tools.ietf.org/html/rfc3339] format. + * * `gcp_project` - The Google cloud project associated with the + * HostProjectRegistration. + * @param {string} [request.orderBy] + * Optional. Hint for how to order the results. + * @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.apihub.v1.HostProjectRegistration|HostProjectRegistration}. 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/host_project_registration_service.list_host_project_registrations.js + * region_tag:apihub_v1_generated_HostProjectRegistrationService_ListHostProjectRegistrations_async + */ + listHostProjectRegistrationsAsync( + request?: protos.google.cloud.apihub.v1.IListHostProjectRegistrationsRequest, + 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['listHostProjectRegistrations']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listHostProjectRegistrations.asyncIterate( + this.innerApiCalls['listHostProjectRegistrations'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } +/** + * 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); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified api resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @returns {string} Resource name string. + */ + apiPath(project:string,location:string,api:string) { + return this.pathTemplates.apiPathTemplate.render({ + project: project, + location: location, + api: api, + }); + } + + /** + * Parse the project from Api resource. + * + * @param {string} apiName + * A fully-qualified path representing Api resource. + * @returns {string} A string representing the project. + */ + matchProjectFromApiName(apiName: string) { + return this.pathTemplates.apiPathTemplate.match(apiName).project; + } + + /** + * Parse the location from Api resource. + * + * @param {string} apiName + * A fully-qualified path representing Api resource. + * @returns {string} A string representing the location. + */ + matchLocationFromApiName(apiName: string) { + return this.pathTemplates.apiPathTemplate.match(apiName).location; + } + + /** + * Parse the api from Api resource. + * + * @param {string} apiName + * A fully-qualified path representing Api resource. + * @returns {string} A string representing the api. + */ + matchApiFromApiName(apiName: string) { + return this.pathTemplates.apiPathTemplate.match(apiName).api; + } + + /** + * Return a fully-qualified apiHubInstance resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api_hub_instance + * @returns {string} Resource name string. + */ + apiHubInstancePath(project:string,location:string,apiHubInstance:string) { + return this.pathTemplates.apiHubInstancePathTemplate.render({ + project: project, + location: location, + api_hub_instance: apiHubInstance, + }); + } + + /** + * Parse the project from ApiHubInstance resource. + * + * @param {string} apiHubInstanceName + * A fully-qualified path representing ApiHubInstance resource. + * @returns {string} A string representing the project. + */ + matchProjectFromApiHubInstanceName(apiHubInstanceName: string) { + return this.pathTemplates.apiHubInstancePathTemplate.match(apiHubInstanceName).project; + } + + /** + * Parse the location from ApiHubInstance resource. + * + * @param {string} apiHubInstanceName + * A fully-qualified path representing ApiHubInstance resource. + * @returns {string} A string representing the location. + */ + matchLocationFromApiHubInstanceName(apiHubInstanceName: string) { + return this.pathTemplates.apiHubInstancePathTemplate.match(apiHubInstanceName).location; + } + + /** + * Parse the api_hub_instance from ApiHubInstance resource. + * + * @param {string} apiHubInstanceName + * A fully-qualified path representing ApiHubInstance resource. + * @returns {string} A string representing the api_hub_instance. + */ + matchApiHubInstanceFromApiHubInstanceName(apiHubInstanceName: string) { + return this.pathTemplates.apiHubInstancePathTemplate.match(apiHubInstanceName).api_hub_instance; + } + + /** + * Return a fully-qualified apiOperation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @param {string} version + * @param {string} operation + * @returns {string} Resource name string. + */ + apiOperationPath(project:string,location:string,api:string,version:string,operation:string) { + return this.pathTemplates.apiOperationPathTemplate.render({ + project: project, + location: location, + api: api, + version: version, + operation: operation, + }); + } + + /** + * Parse the project from ApiOperation resource. + * + * @param {string} apiOperationName + * A fully-qualified path representing ApiOperation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromApiOperationName(apiOperationName: string) { + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).project; + } + + /** + * Parse the location from ApiOperation resource. + * + * @param {string} apiOperationName + * A fully-qualified path representing ApiOperation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromApiOperationName(apiOperationName: string) { + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).location; + } + + /** + * Parse the api from ApiOperation resource. + * + * @param {string} apiOperationName + * A fully-qualified path representing ApiOperation resource. + * @returns {string} A string representing the api. + */ + matchApiFromApiOperationName(apiOperationName: string) { + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).api; + } + + /** + * Parse the version from ApiOperation resource. + * + * @param {string} apiOperationName + * A fully-qualified path representing ApiOperation resource. + * @returns {string} A string representing the version. + */ + matchVersionFromApiOperationName(apiOperationName: string) { + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).version; + } + + /** + * Parse the operation from ApiOperation resource. + * + * @param {string} apiOperationName + * A fully-qualified path representing ApiOperation resource. + * @returns {string} A string representing the operation. + */ + matchOperationFromApiOperationName(apiOperationName: string) { + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).operation; + } + + /** + * Return a fully-qualified attribute resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} attribute + * @returns {string} Resource name string. + */ + attributePath(project:string,location:string,attribute:string) { + return this.pathTemplates.attributePathTemplate.render({ + project: project, + location: location, + attribute: attribute, + }); + } + + /** + * Parse the project from Attribute resource. + * + * @param {string} attributeName + * A fully-qualified path representing Attribute resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAttributeName(attributeName: string) { + return this.pathTemplates.attributePathTemplate.match(attributeName).project; + } + + /** + * Parse the location from Attribute resource. + * + * @param {string} attributeName + * A fully-qualified path representing Attribute resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAttributeName(attributeName: string) { + return this.pathTemplates.attributePathTemplate.match(attributeName).location; + } + + /** + * Parse the attribute from Attribute resource. + * + * @param {string} attributeName + * A fully-qualified path representing Attribute resource. + * @returns {string} A string representing the attribute. + */ + matchAttributeFromAttributeName(attributeName: string) { + return this.pathTemplates.attributePathTemplate.match(attributeName).attribute; + } + + /** + * Return a fully-qualified definition resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @param {string} version + * @param {string} definition + * @returns {string} Resource name string. + */ + definitionPath(project:string,location:string,api:string,version:string,definition:string) { + return this.pathTemplates.definitionPathTemplate.render({ + project: project, + location: location, + api: api, + version: version, + definition: definition, + }); + } + + /** + * Parse the project from Definition resource. + * + * @param {string} definitionName + * A fully-qualified path representing Definition resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDefinitionName(definitionName: string) { + return this.pathTemplates.definitionPathTemplate.match(definitionName).project; + } + + /** + * Parse the location from Definition resource. + * + * @param {string} definitionName + * A fully-qualified path representing Definition resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDefinitionName(definitionName: string) { + return this.pathTemplates.definitionPathTemplate.match(definitionName).location; + } + + /** + * Parse the api from Definition resource. + * + * @param {string} definitionName + * A fully-qualified path representing Definition resource. + * @returns {string} A string representing the api. + */ + matchApiFromDefinitionName(definitionName: string) { + return this.pathTemplates.definitionPathTemplate.match(definitionName).api; + } + + /** + * Parse the version from Definition resource. + * + * @param {string} definitionName + * A fully-qualified path representing Definition resource. + * @returns {string} A string representing the version. + */ + matchVersionFromDefinitionName(definitionName: string) { + return this.pathTemplates.definitionPathTemplate.match(definitionName).version; + } + + /** + * Parse the definition from Definition resource. + * + * @param {string} definitionName + * A fully-qualified path representing Definition resource. + * @returns {string} A string representing the definition. + */ + matchDefinitionFromDefinitionName(definitionName: string) { + return this.pathTemplates.definitionPathTemplate.match(definitionName).definition; + } + + /** + * Return a fully-qualified dependency resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dependency + * @returns {string} Resource name string. + */ + dependencyPath(project:string,location:string,dependency:string) { + return this.pathTemplates.dependencyPathTemplate.render({ + project: project, + location: location, + dependency: dependency, + }); + } + + /** + * Parse the project from Dependency resource. + * + * @param {string} dependencyName + * A fully-qualified path representing Dependency resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDependencyName(dependencyName: string) { + return this.pathTemplates.dependencyPathTemplate.match(dependencyName).project; + } + + /** + * Parse the location from Dependency resource. + * + * @param {string} dependencyName + * A fully-qualified path representing Dependency resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDependencyName(dependencyName: string) { + return this.pathTemplates.dependencyPathTemplate.match(dependencyName).location; + } + + /** + * Parse the dependency from Dependency resource. + * + * @param {string} dependencyName + * A fully-qualified path representing Dependency resource. + * @returns {string} A string representing the dependency. + */ + matchDependencyFromDependencyName(dependencyName: string) { + return this.pathTemplates.dependencyPathTemplate.match(dependencyName).dependency; + } + + /** + * Return a fully-qualified deployment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} deployment + * @returns {string} Resource name string. + */ + deploymentPath(project:string,location:string,deployment:string) { + return this.pathTemplates.deploymentPathTemplate.render({ + project: project, + location: location, + deployment: deployment, + }); + } + + /** + * Parse the project from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName).project; + } + + /** + * Parse the location from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName).location; + } + + /** + * Parse the deployment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the deployment. + */ + matchDeploymentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName).deployment; + } + + /** + * Return a fully-qualified externalApi resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} external_api + * @returns {string} Resource name string. + */ + externalApiPath(project:string,location:string,externalApi:string) { + return this.pathTemplates.externalApiPathTemplate.render({ + project: project, + location: location, + external_api: externalApi, + }); + } + + /** + * Parse the project from ExternalApi resource. + * + * @param {string} externalApiName + * A fully-qualified path representing ExternalApi resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExternalApiName(externalApiName: string) { + return this.pathTemplates.externalApiPathTemplate.match(externalApiName).project; + } + + /** + * Parse the location from ExternalApi resource. + * + * @param {string} externalApiName + * A fully-qualified path representing ExternalApi resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExternalApiName(externalApiName: string) { + return this.pathTemplates.externalApiPathTemplate.match(externalApiName).location; + } + + /** + * Parse the external_api from ExternalApi resource. + * + * @param {string} externalApiName + * A fully-qualified path representing ExternalApi resource. + * @returns {string} A string representing the external_api. + */ + matchExternalApiFromExternalApiName(externalApiName: string) { + return this.pathTemplates.externalApiPathTemplate.match(externalApiName).external_api; + } + + /** + * Return a fully-qualified hostProjectRegistration resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} host_project_registration + * @returns {string} Resource name string. + */ + hostProjectRegistrationPath(project:string,location:string,hostProjectRegistration:string) { + return this.pathTemplates.hostProjectRegistrationPathTemplate.render({ + project: project, + location: location, + host_project_registration: hostProjectRegistration, + }); + } + + /** + * Parse the project from HostProjectRegistration resource. + * + * @param {string} hostProjectRegistrationName + * A fully-qualified path representing HostProjectRegistration resource. + * @returns {string} A string representing the project. + */ + matchProjectFromHostProjectRegistrationName(hostProjectRegistrationName: string) { + return this.pathTemplates.hostProjectRegistrationPathTemplate.match(hostProjectRegistrationName).project; + } + + /** + * Parse the location from HostProjectRegistration resource. + * + * @param {string} hostProjectRegistrationName + * A fully-qualified path representing HostProjectRegistration resource. + * @returns {string} A string representing the location. + */ + matchLocationFromHostProjectRegistrationName(hostProjectRegistrationName: string) { + return this.pathTemplates.hostProjectRegistrationPathTemplate.match(hostProjectRegistrationName).location; + } + + /** + * Parse the host_project_registration from HostProjectRegistration resource. + * + * @param {string} hostProjectRegistrationName + * A fully-qualified path representing HostProjectRegistration resource. + * @returns {string} A string representing the host_project_registration. + */ + matchHostProjectRegistrationFromHostProjectRegistrationName(hostProjectRegistrationName: string) { + return this.pathTemplates.hostProjectRegistrationPathTemplate.match(hostProjectRegistrationName).host_project_registration; + } + + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project:string,location:string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + + /** + * Return a fully-qualified plugin resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} plugin + * @returns {string} Resource name string. + */ + pluginPath(project:string,location:string,plugin:string) { + return this.pathTemplates.pluginPathTemplate.render({ + project: project, + location: location, + plugin: plugin, + }); + } + + /** + * Parse the project from Plugin resource. + * + * @param {string} pluginName + * A fully-qualified path representing Plugin resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPluginName(pluginName: string) { + return this.pathTemplates.pluginPathTemplate.match(pluginName).project; + } + + /** + * Parse the location from Plugin resource. + * + * @param {string} pluginName + * A fully-qualified path representing Plugin resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPluginName(pluginName: string) { + return this.pathTemplates.pluginPathTemplate.match(pluginName).location; + } + + /** + * Parse the plugin from Plugin resource. + * + * @param {string} pluginName + * A fully-qualified path representing Plugin resource. + * @returns {string} A string representing the plugin. + */ + matchPluginFromPluginName(pluginName: string) { + return this.pathTemplates.pluginPathTemplate.match(pluginName).plugin; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project:string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified runtimeProjectAttachment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} runtime_project_attachment + * @returns {string} Resource name string. + */ + runtimeProjectAttachmentPath(project:string,location:string,runtimeProjectAttachment:string) { + return this.pathTemplates.runtimeProjectAttachmentPathTemplate.render({ + project: project, + location: location, + runtime_project_attachment: runtimeProjectAttachment, + }); + } + + /** + * Parse the project from RuntimeProjectAttachment resource. + * + * @param {string} runtimeProjectAttachmentName + * A fully-qualified path representing RuntimeProjectAttachment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRuntimeProjectAttachmentName(runtimeProjectAttachmentName: string) { + return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match(runtimeProjectAttachmentName).project; + } + + /** + * Parse the location from RuntimeProjectAttachment resource. + * + * @param {string} runtimeProjectAttachmentName + * A fully-qualified path representing RuntimeProjectAttachment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRuntimeProjectAttachmentName(runtimeProjectAttachmentName: string) { + return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match(runtimeProjectAttachmentName).location; + } + + /** + * Parse the runtime_project_attachment from RuntimeProjectAttachment resource. + * + * @param {string} runtimeProjectAttachmentName + * A fully-qualified path representing RuntimeProjectAttachment resource. + * @returns {string} A string representing the runtime_project_attachment. + */ + matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName(runtimeProjectAttachmentName: string) { + return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match(runtimeProjectAttachmentName).runtime_project_attachment; + } + + /** + * Return a fully-qualified spec resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @param {string} version + * @param {string} spec + * @returns {string} Resource name string. + */ + specPath(project:string,location:string,api:string,version:string,spec:string) { + return this.pathTemplates.specPathTemplate.render({ + project: project, + location: location, + api: api, + version: version, + spec: spec, + }); + } + + /** + * Parse the project from Spec resource. + * + * @param {string} specName + * A fully-qualified path representing Spec resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSpecName(specName: string) { + return this.pathTemplates.specPathTemplate.match(specName).project; + } + + /** + * Parse the location from Spec resource. + * + * @param {string} specName + * A fully-qualified path representing Spec resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSpecName(specName: string) { + return this.pathTemplates.specPathTemplate.match(specName).location; + } + + /** + * Parse the api from Spec resource. + * + * @param {string} specName + * A fully-qualified path representing Spec resource. + * @returns {string} A string representing the api. + */ + matchApiFromSpecName(specName: string) { + return this.pathTemplates.specPathTemplate.match(specName).api; + } + + /** + * Parse the version from Spec resource. + * + * @param {string} specName + * A fully-qualified path representing Spec resource. + * @returns {string} A string representing the version. + */ + matchVersionFromSpecName(specName: string) { + return this.pathTemplates.specPathTemplate.match(specName).version; + } + + /** + * Parse the spec from Spec resource. + * + * @param {string} specName + * A fully-qualified path representing Spec resource. + * @returns {string} A string representing the spec. + */ + matchSpecFromSpecName(specName: string) { + return this.pathTemplates.specPathTemplate.match(specName).spec; + } + + /** + * Return a fully-qualified styleGuide resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} plugin + * @returns {string} Resource name string. + */ + styleGuidePath(project:string,location:string,plugin:string) { + return this.pathTemplates.styleGuidePathTemplate.render({ + project: project, + location: location, + plugin: plugin, + }); + } + + /** + * Parse the project from StyleGuide resource. + * + * @param {string} styleGuideName + * A fully-qualified path representing StyleGuide resource. + * @returns {string} A string representing the project. + */ + matchProjectFromStyleGuideName(styleGuideName: string) { + return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName).project; + } + + /** + * Parse the location from StyleGuide resource. + * + * @param {string} styleGuideName + * A fully-qualified path representing StyleGuide resource. + * @returns {string} A string representing the location. + */ + matchLocationFromStyleGuideName(styleGuideName: string) { + return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName).location; + } + + /** + * Parse the plugin from StyleGuide resource. + * + * @param {string} styleGuideName + * A fully-qualified path representing StyleGuide resource. + * @returns {string} A string representing the plugin. + */ + matchPluginFromStyleGuideName(styleGuideName: string) { + return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName).plugin; + } + + /** + * Return a fully-qualified version resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @param {string} version + * @returns {string} Resource name string. + */ + versionPath(project:string,location:string,api:string,version:string) { + return this.pathTemplates.versionPathTemplate.render({ + project: project, + location: location, + api: api, + version: version, + }); + } + + /** + * Parse the project from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the project. + */ + matchProjectFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).project; + } + + /** + * Parse the location from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the location. + */ + matchLocationFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).location; + } + + /** + * Parse the api from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the api. + */ + matchApiFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).api; + } + + /** + * Parse the version from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the version. + */ + matchVersionFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).version; + } + + /** + * 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.hostProjectRegistrationServiceStub && !this._terminated) { + return this.hostProjectRegistrationServiceStub.then(stub => { + this._terminated = true; + stub.close(); + this.locationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-cloud-apihub/v1/src/v1/host_project_registration_service_client_config.json b/owl-bot-staging/google-cloud-apihub/v1/src/v1/host_project_registration_service_client_config.json new file mode 100644 index 00000000000..8daddd428c6 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/src/v1/host_project_registration_service_client_config.json @@ -0,0 +1,53 @@ +{ + "interfaces": { + "google.cloud.apihub.v1.HostProjectRegistrationService": { + "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": { + "CreateHostProjectRegistration": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetHostProjectRegistration": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ListHostProjectRegistrations": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-apihub/v1/src/v1/host_project_registration_service_proto_list.json b/owl-bot-staging/google-cloud-apihub/v1/src/v1/host_project_registration_service_proto_list.json new file mode 100644 index 00000000000..07e987f7fb3 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/src/v1/host_project_registration_service_proto_list.json @@ -0,0 +1,9 @@ +[ + "../../protos/google/cloud/apihub/v1/apihub_service.proto", + "../../protos/google/cloud/apihub/v1/common_fields.proto", + "../../protos/google/cloud/apihub/v1/host_project_registration_service.proto", + "../../protos/google/cloud/apihub/v1/linting_service.proto", + "../../protos/google/cloud/apihub/v1/plugin_service.proto", + "../../protos/google/cloud/apihub/v1/provisioning_service.proto", + "../../protos/google/cloud/apihub/v1/runtime_project_attachment_service.proto" +] diff --git a/owl-bot-staging/google-cloud-apihub/v1/src/v1/index.ts b/owl-bot-staging/google-cloud-apihub/v1/src/v1/index.ts new file mode 100644 index 00000000000..ea67cfcd904 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/src/v1/index.ts @@ -0,0 +1,25 @@ +// Copyright 2024 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 {ApiHubClient} from './api_hub_client'; +export {ApiHubDependenciesClient} from './api_hub_dependencies_client'; +export {ApiHubPluginClient} from './api_hub_plugin_client'; +export {HostProjectRegistrationServiceClient} from './host_project_registration_service_client'; +export {LintingServiceClient} from './linting_service_client'; +export {ProvisioningClient} from './provisioning_client'; +export {RuntimeProjectAttachmentServiceClient} from './runtime_project_attachment_service_client'; diff --git a/owl-bot-staging/google-cloud-apihub/v1/src/v1/linting_service_client.ts b/owl-bot-staging/google-cloud-apihub/v1/src/v1/linting_service_client.ts new file mode 100644 index 00000000000..ec938777704 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/src/v1/linting_service_client.ts @@ -0,0 +1,1539 @@ +// Copyright 2024 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, LocationsClient, LocationProtos} from 'google-gax'; + +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); + +/** + * Client JSON configuration object, loaded from + * `src/v1/linting_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './linting_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * This service provides all methods related to the 1p Linter. + * @class + * @memberof v1 + */ +export class LintingServiceClient { + 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}; + private _universeDomain: string; + private _servicePath: string; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + locationsClient: LocationsClient; + pathTemplates: {[name: string]: gax.PathTemplate}; + lintingServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of LintingServiceClient. + * + * @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 LintingServiceClient({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 LintingServiceClient; + if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { + throw new Error('Please set either universe_domain or universeDomain, but not both.'); + } + const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; + this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; + this._servicePath = 'apihub.' + this._universeDomain; + const servicePath = opts?.servicePath || opts?.apiEndpoint || this._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 !== this._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 = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + 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 === 'object' && '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 = { + apiPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}' + ), + apiHubInstancePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apiHubInstances/{api_hub_instance}' + ), + apiOperationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}' + ), + attributePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/attributes/{attribute}' + ), + definitionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}' + ), + dependencyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/dependencies/{dependency}' + ), + deploymentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/deployments/{deployment}' + ), + externalApiPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/externalApis/{external_api}' + ), + hostProjectRegistrationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/hostProjectRegistrations/{host_project_registration}' + ), + pluginPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/plugins/{plugin}' + ), + runtimeProjectAttachmentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}' + ), + specPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}' + ), + styleGuidePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/plugins/{plugin}/styleGuide' + ), + versionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}/versions/{version}' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.apihub.v1.LintingService', 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.lintingServiceStub) { + return this.lintingServiceStub; + } + + // Put together the "service stub" for + // google.cloud.apihub.v1.LintingService. + this.lintingServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.apihub.v1.LintingService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.apihub.v1.LintingService, + 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 lintingServiceStubMethods = + ['getStyleGuide', 'updateStyleGuide', 'getStyleGuideContents', 'lintSpec']; + for (const methodName of lintingServiceStubMethods) { + const callPromise = this.lintingServiceStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.lintingServiceStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'apihub.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'apihub.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * 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 -- + // ------------------- +/** + * Get the style guide being used for linting. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the spec to retrieve. + * Format: + * `projects/{project}/locations/{location}/plugins/{plugin}/styleGuide`. + * @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.apihub.v1.StyleGuide|StyleGuide}. + * 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/linting_service.get_style_guide.js + * region_tag:apihub_v1_generated_LintingService_GetStyleGuide_async + */ + getStyleGuide( + request?: protos.google.cloud.apihub.v1.IGetStyleGuideRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.apihub.v1.IStyleGuide, + protos.google.cloud.apihub.v1.IGetStyleGuideRequest|undefined, {}|undefined + ]>; + getStyleGuide( + request: protos.google.cloud.apihub.v1.IGetStyleGuideRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.IStyleGuide, + protos.google.cloud.apihub.v1.IGetStyleGuideRequest|null|undefined, + {}|null|undefined>): void; + getStyleGuide( + request: protos.google.cloud.apihub.v1.IGetStyleGuideRequest, + callback: Callback< + protos.google.cloud.apihub.v1.IStyleGuide, + protos.google.cloud.apihub.v1.IGetStyleGuideRequest|null|undefined, + {}|null|undefined>): void; + getStyleGuide( + request?: protos.google.cloud.apihub.v1.IGetStyleGuideRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.apihub.v1.IStyleGuide, + protos.google.cloud.apihub.v1.IGetStyleGuideRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.apihub.v1.IStyleGuide, + protos.google.cloud.apihub.v1.IGetStyleGuideRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.apihub.v1.IStyleGuide, + protos.google.cloud.apihub.v1.IGetStyleGuideRequest|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.getStyleGuide(request, options, callback); + } +/** + * Update the styleGuide to be used for liniting in by API hub. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.apihub.v1.StyleGuide} request.styleGuide + * Required. The Style guide resource to update. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. The list of fields to update. + * @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.apihub.v1.StyleGuide|StyleGuide}. + * 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/linting_service.update_style_guide.js + * region_tag:apihub_v1_generated_LintingService_UpdateStyleGuide_async + */ + updateStyleGuide( + request?: protos.google.cloud.apihub.v1.IUpdateStyleGuideRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.apihub.v1.IStyleGuide, + protos.google.cloud.apihub.v1.IUpdateStyleGuideRequest|undefined, {}|undefined + ]>; + updateStyleGuide( + request: protos.google.cloud.apihub.v1.IUpdateStyleGuideRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.IStyleGuide, + protos.google.cloud.apihub.v1.IUpdateStyleGuideRequest|null|undefined, + {}|null|undefined>): void; + updateStyleGuide( + request: protos.google.cloud.apihub.v1.IUpdateStyleGuideRequest, + callback: Callback< + protos.google.cloud.apihub.v1.IStyleGuide, + protos.google.cloud.apihub.v1.IUpdateStyleGuideRequest|null|undefined, + {}|null|undefined>): void; + updateStyleGuide( + request?: protos.google.cloud.apihub.v1.IUpdateStyleGuideRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.apihub.v1.IStyleGuide, + protos.google.cloud.apihub.v1.IUpdateStyleGuideRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.apihub.v1.IStyleGuide, + protos.google.cloud.apihub.v1.IUpdateStyleGuideRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.apihub.v1.IStyleGuide, + protos.google.cloud.apihub.v1.IUpdateStyleGuideRequest|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({ + 'style_guide.name': request.styleGuide!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateStyleGuide(request, options, callback); + } +/** + * Get the contents of the style guide. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the StyleGuide whose contents need to be retrieved. + * There is exactly one style guide resource per project per location. + * The expected format is + * `projects/{project}/locations/{location}/plugins/{plugin}/styleGuide`. + * @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.apihub.v1.StyleGuideContents|StyleGuideContents}. + * 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/linting_service.get_style_guide_contents.js + * region_tag:apihub_v1_generated_LintingService_GetStyleGuideContents_async + */ + getStyleGuideContents( + request?: protos.google.cloud.apihub.v1.IGetStyleGuideContentsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.apihub.v1.IStyleGuideContents, + protos.google.cloud.apihub.v1.IGetStyleGuideContentsRequest|undefined, {}|undefined + ]>; + getStyleGuideContents( + request: protos.google.cloud.apihub.v1.IGetStyleGuideContentsRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.IStyleGuideContents, + protos.google.cloud.apihub.v1.IGetStyleGuideContentsRequest|null|undefined, + {}|null|undefined>): void; + getStyleGuideContents( + request: protos.google.cloud.apihub.v1.IGetStyleGuideContentsRequest, + callback: Callback< + protos.google.cloud.apihub.v1.IStyleGuideContents, + protos.google.cloud.apihub.v1.IGetStyleGuideContentsRequest|null|undefined, + {}|null|undefined>): void; + getStyleGuideContents( + request?: protos.google.cloud.apihub.v1.IGetStyleGuideContentsRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.apihub.v1.IStyleGuideContents, + protos.google.cloud.apihub.v1.IGetStyleGuideContentsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.apihub.v1.IStyleGuideContents, + protos.google.cloud.apihub.v1.IGetStyleGuideContentsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.apihub.v1.IStyleGuideContents, + protos.google.cloud.apihub.v1.IGetStyleGuideContentsRequest|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.getStyleGuideContents(request, options, callback); + } +/** + * Lints the requested spec and updates the corresponding API Spec with the + * lint response. This lint response will be available in all subsequent + * Get and List Spec calls to Core service. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the spec to be linted. + * Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}` + * @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.protobuf.Empty|Empty}. + * 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/linting_service.lint_spec.js + * region_tag:apihub_v1_generated_LintingService_LintSpec_async + */ + lintSpec( + request?: protos.google.cloud.apihub.v1.ILintSpecRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.ILintSpecRequest|undefined, {}|undefined + ]>; + lintSpec( + request: protos.google.cloud.apihub.v1.ILintSpecRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.ILintSpecRequest|null|undefined, + {}|null|undefined>): void; + lintSpec( + request: protos.google.cloud.apihub.v1.ILintSpecRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.ILintSpecRequest|null|undefined, + {}|null|undefined>): void; + lintSpec( + request?: protos.google.cloud.apihub.v1.ILintSpecRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.ILintSpecRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.ILintSpecRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.ILintSpecRequest|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.lintSpec(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); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified api resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @returns {string} Resource name string. + */ + apiPath(project:string,location:string,api:string) { + return this.pathTemplates.apiPathTemplate.render({ + project: project, + location: location, + api: api, + }); + } + + /** + * Parse the project from Api resource. + * + * @param {string} apiName + * A fully-qualified path representing Api resource. + * @returns {string} A string representing the project. + */ + matchProjectFromApiName(apiName: string) { + return this.pathTemplates.apiPathTemplate.match(apiName).project; + } + + /** + * Parse the location from Api resource. + * + * @param {string} apiName + * A fully-qualified path representing Api resource. + * @returns {string} A string representing the location. + */ + matchLocationFromApiName(apiName: string) { + return this.pathTemplates.apiPathTemplate.match(apiName).location; + } + + /** + * Parse the api from Api resource. + * + * @param {string} apiName + * A fully-qualified path representing Api resource. + * @returns {string} A string representing the api. + */ + matchApiFromApiName(apiName: string) { + return this.pathTemplates.apiPathTemplate.match(apiName).api; + } + + /** + * Return a fully-qualified apiHubInstance resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api_hub_instance + * @returns {string} Resource name string. + */ + apiHubInstancePath(project:string,location:string,apiHubInstance:string) { + return this.pathTemplates.apiHubInstancePathTemplate.render({ + project: project, + location: location, + api_hub_instance: apiHubInstance, + }); + } + + /** + * Parse the project from ApiHubInstance resource. + * + * @param {string} apiHubInstanceName + * A fully-qualified path representing ApiHubInstance resource. + * @returns {string} A string representing the project. + */ + matchProjectFromApiHubInstanceName(apiHubInstanceName: string) { + return this.pathTemplates.apiHubInstancePathTemplate.match(apiHubInstanceName).project; + } + + /** + * Parse the location from ApiHubInstance resource. + * + * @param {string} apiHubInstanceName + * A fully-qualified path representing ApiHubInstance resource. + * @returns {string} A string representing the location. + */ + matchLocationFromApiHubInstanceName(apiHubInstanceName: string) { + return this.pathTemplates.apiHubInstancePathTemplate.match(apiHubInstanceName).location; + } + + /** + * Parse the api_hub_instance from ApiHubInstance resource. + * + * @param {string} apiHubInstanceName + * A fully-qualified path representing ApiHubInstance resource. + * @returns {string} A string representing the api_hub_instance. + */ + matchApiHubInstanceFromApiHubInstanceName(apiHubInstanceName: string) { + return this.pathTemplates.apiHubInstancePathTemplate.match(apiHubInstanceName).api_hub_instance; + } + + /** + * Return a fully-qualified apiOperation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @param {string} version + * @param {string} operation + * @returns {string} Resource name string. + */ + apiOperationPath(project:string,location:string,api:string,version:string,operation:string) { + return this.pathTemplates.apiOperationPathTemplate.render({ + project: project, + location: location, + api: api, + version: version, + operation: operation, + }); + } + + /** + * Parse the project from ApiOperation resource. + * + * @param {string} apiOperationName + * A fully-qualified path representing ApiOperation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromApiOperationName(apiOperationName: string) { + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).project; + } + + /** + * Parse the location from ApiOperation resource. + * + * @param {string} apiOperationName + * A fully-qualified path representing ApiOperation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromApiOperationName(apiOperationName: string) { + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).location; + } + + /** + * Parse the api from ApiOperation resource. + * + * @param {string} apiOperationName + * A fully-qualified path representing ApiOperation resource. + * @returns {string} A string representing the api. + */ + matchApiFromApiOperationName(apiOperationName: string) { + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).api; + } + + /** + * Parse the version from ApiOperation resource. + * + * @param {string} apiOperationName + * A fully-qualified path representing ApiOperation resource. + * @returns {string} A string representing the version. + */ + matchVersionFromApiOperationName(apiOperationName: string) { + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).version; + } + + /** + * Parse the operation from ApiOperation resource. + * + * @param {string} apiOperationName + * A fully-qualified path representing ApiOperation resource. + * @returns {string} A string representing the operation. + */ + matchOperationFromApiOperationName(apiOperationName: string) { + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).operation; + } + + /** + * Return a fully-qualified attribute resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} attribute + * @returns {string} Resource name string. + */ + attributePath(project:string,location:string,attribute:string) { + return this.pathTemplates.attributePathTemplate.render({ + project: project, + location: location, + attribute: attribute, + }); + } + + /** + * Parse the project from Attribute resource. + * + * @param {string} attributeName + * A fully-qualified path representing Attribute resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAttributeName(attributeName: string) { + return this.pathTemplates.attributePathTemplate.match(attributeName).project; + } + + /** + * Parse the location from Attribute resource. + * + * @param {string} attributeName + * A fully-qualified path representing Attribute resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAttributeName(attributeName: string) { + return this.pathTemplates.attributePathTemplate.match(attributeName).location; + } + + /** + * Parse the attribute from Attribute resource. + * + * @param {string} attributeName + * A fully-qualified path representing Attribute resource. + * @returns {string} A string representing the attribute. + */ + matchAttributeFromAttributeName(attributeName: string) { + return this.pathTemplates.attributePathTemplate.match(attributeName).attribute; + } + + /** + * Return a fully-qualified definition resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @param {string} version + * @param {string} definition + * @returns {string} Resource name string. + */ + definitionPath(project:string,location:string,api:string,version:string,definition:string) { + return this.pathTemplates.definitionPathTemplate.render({ + project: project, + location: location, + api: api, + version: version, + definition: definition, + }); + } + + /** + * Parse the project from Definition resource. + * + * @param {string} definitionName + * A fully-qualified path representing Definition resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDefinitionName(definitionName: string) { + return this.pathTemplates.definitionPathTemplate.match(definitionName).project; + } + + /** + * Parse the location from Definition resource. + * + * @param {string} definitionName + * A fully-qualified path representing Definition resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDefinitionName(definitionName: string) { + return this.pathTemplates.definitionPathTemplate.match(definitionName).location; + } + + /** + * Parse the api from Definition resource. + * + * @param {string} definitionName + * A fully-qualified path representing Definition resource. + * @returns {string} A string representing the api. + */ + matchApiFromDefinitionName(definitionName: string) { + return this.pathTemplates.definitionPathTemplate.match(definitionName).api; + } + + /** + * Parse the version from Definition resource. + * + * @param {string} definitionName + * A fully-qualified path representing Definition resource. + * @returns {string} A string representing the version. + */ + matchVersionFromDefinitionName(definitionName: string) { + return this.pathTemplates.definitionPathTemplate.match(definitionName).version; + } + + /** + * Parse the definition from Definition resource. + * + * @param {string} definitionName + * A fully-qualified path representing Definition resource. + * @returns {string} A string representing the definition. + */ + matchDefinitionFromDefinitionName(definitionName: string) { + return this.pathTemplates.definitionPathTemplate.match(definitionName).definition; + } + + /** + * Return a fully-qualified dependency resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dependency + * @returns {string} Resource name string. + */ + dependencyPath(project:string,location:string,dependency:string) { + return this.pathTemplates.dependencyPathTemplate.render({ + project: project, + location: location, + dependency: dependency, + }); + } + + /** + * Parse the project from Dependency resource. + * + * @param {string} dependencyName + * A fully-qualified path representing Dependency resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDependencyName(dependencyName: string) { + return this.pathTemplates.dependencyPathTemplate.match(dependencyName).project; + } + + /** + * Parse the location from Dependency resource. + * + * @param {string} dependencyName + * A fully-qualified path representing Dependency resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDependencyName(dependencyName: string) { + return this.pathTemplates.dependencyPathTemplate.match(dependencyName).location; + } + + /** + * Parse the dependency from Dependency resource. + * + * @param {string} dependencyName + * A fully-qualified path representing Dependency resource. + * @returns {string} A string representing the dependency. + */ + matchDependencyFromDependencyName(dependencyName: string) { + return this.pathTemplates.dependencyPathTemplate.match(dependencyName).dependency; + } + + /** + * Return a fully-qualified deployment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} deployment + * @returns {string} Resource name string. + */ + deploymentPath(project:string,location:string,deployment:string) { + return this.pathTemplates.deploymentPathTemplate.render({ + project: project, + location: location, + deployment: deployment, + }); + } + + /** + * Parse the project from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName).project; + } + + /** + * Parse the location from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName).location; + } + + /** + * Parse the deployment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the deployment. + */ + matchDeploymentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName).deployment; + } + + /** + * Return a fully-qualified externalApi resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} external_api + * @returns {string} Resource name string. + */ + externalApiPath(project:string,location:string,externalApi:string) { + return this.pathTemplates.externalApiPathTemplate.render({ + project: project, + location: location, + external_api: externalApi, + }); + } + + /** + * Parse the project from ExternalApi resource. + * + * @param {string} externalApiName + * A fully-qualified path representing ExternalApi resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExternalApiName(externalApiName: string) { + return this.pathTemplates.externalApiPathTemplate.match(externalApiName).project; + } + + /** + * Parse the location from ExternalApi resource. + * + * @param {string} externalApiName + * A fully-qualified path representing ExternalApi resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExternalApiName(externalApiName: string) { + return this.pathTemplates.externalApiPathTemplate.match(externalApiName).location; + } + + /** + * Parse the external_api from ExternalApi resource. + * + * @param {string} externalApiName + * A fully-qualified path representing ExternalApi resource. + * @returns {string} A string representing the external_api. + */ + matchExternalApiFromExternalApiName(externalApiName: string) { + return this.pathTemplates.externalApiPathTemplate.match(externalApiName).external_api; + } + + /** + * Return a fully-qualified hostProjectRegistration resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} host_project_registration + * @returns {string} Resource name string. + */ + hostProjectRegistrationPath(project:string,location:string,hostProjectRegistration:string) { + return this.pathTemplates.hostProjectRegistrationPathTemplate.render({ + project: project, + location: location, + host_project_registration: hostProjectRegistration, + }); + } + + /** + * Parse the project from HostProjectRegistration resource. + * + * @param {string} hostProjectRegistrationName + * A fully-qualified path representing HostProjectRegistration resource. + * @returns {string} A string representing the project. + */ + matchProjectFromHostProjectRegistrationName(hostProjectRegistrationName: string) { + return this.pathTemplates.hostProjectRegistrationPathTemplate.match(hostProjectRegistrationName).project; + } + + /** + * Parse the location from HostProjectRegistration resource. + * + * @param {string} hostProjectRegistrationName + * A fully-qualified path representing HostProjectRegistration resource. + * @returns {string} A string representing the location. + */ + matchLocationFromHostProjectRegistrationName(hostProjectRegistrationName: string) { + return this.pathTemplates.hostProjectRegistrationPathTemplate.match(hostProjectRegistrationName).location; + } + + /** + * Parse the host_project_registration from HostProjectRegistration resource. + * + * @param {string} hostProjectRegistrationName + * A fully-qualified path representing HostProjectRegistration resource. + * @returns {string} A string representing the host_project_registration. + */ + matchHostProjectRegistrationFromHostProjectRegistrationName(hostProjectRegistrationName: string) { + return this.pathTemplates.hostProjectRegistrationPathTemplate.match(hostProjectRegistrationName).host_project_registration; + } + + /** + * Return a fully-qualified plugin resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} plugin + * @returns {string} Resource name string. + */ + pluginPath(project:string,location:string,plugin:string) { + return this.pathTemplates.pluginPathTemplate.render({ + project: project, + location: location, + plugin: plugin, + }); + } + + /** + * Parse the project from Plugin resource. + * + * @param {string} pluginName + * A fully-qualified path representing Plugin resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPluginName(pluginName: string) { + return this.pathTemplates.pluginPathTemplate.match(pluginName).project; + } + + /** + * Parse the location from Plugin resource. + * + * @param {string} pluginName + * A fully-qualified path representing Plugin resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPluginName(pluginName: string) { + return this.pathTemplates.pluginPathTemplate.match(pluginName).location; + } + + /** + * Parse the plugin from Plugin resource. + * + * @param {string} pluginName + * A fully-qualified path representing Plugin resource. + * @returns {string} A string representing the plugin. + */ + matchPluginFromPluginName(pluginName: string) { + return this.pathTemplates.pluginPathTemplate.match(pluginName).plugin; + } + + /** + * Return a fully-qualified runtimeProjectAttachment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} runtime_project_attachment + * @returns {string} Resource name string. + */ + runtimeProjectAttachmentPath(project:string,location:string,runtimeProjectAttachment:string) { + return this.pathTemplates.runtimeProjectAttachmentPathTemplate.render({ + project: project, + location: location, + runtime_project_attachment: runtimeProjectAttachment, + }); + } + + /** + * Parse the project from RuntimeProjectAttachment resource. + * + * @param {string} runtimeProjectAttachmentName + * A fully-qualified path representing RuntimeProjectAttachment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRuntimeProjectAttachmentName(runtimeProjectAttachmentName: string) { + return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match(runtimeProjectAttachmentName).project; + } + + /** + * Parse the location from RuntimeProjectAttachment resource. + * + * @param {string} runtimeProjectAttachmentName + * A fully-qualified path representing RuntimeProjectAttachment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRuntimeProjectAttachmentName(runtimeProjectAttachmentName: string) { + return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match(runtimeProjectAttachmentName).location; + } + + /** + * Parse the runtime_project_attachment from RuntimeProjectAttachment resource. + * + * @param {string} runtimeProjectAttachmentName + * A fully-qualified path representing RuntimeProjectAttachment resource. + * @returns {string} A string representing the runtime_project_attachment. + */ + matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName(runtimeProjectAttachmentName: string) { + return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match(runtimeProjectAttachmentName).runtime_project_attachment; + } + + /** + * Return a fully-qualified spec resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @param {string} version + * @param {string} spec + * @returns {string} Resource name string. + */ + specPath(project:string,location:string,api:string,version:string,spec:string) { + return this.pathTemplates.specPathTemplate.render({ + project: project, + location: location, + api: api, + version: version, + spec: spec, + }); + } + + /** + * Parse the project from Spec resource. + * + * @param {string} specName + * A fully-qualified path representing Spec resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSpecName(specName: string) { + return this.pathTemplates.specPathTemplate.match(specName).project; + } + + /** + * Parse the location from Spec resource. + * + * @param {string} specName + * A fully-qualified path representing Spec resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSpecName(specName: string) { + return this.pathTemplates.specPathTemplate.match(specName).location; + } + + /** + * Parse the api from Spec resource. + * + * @param {string} specName + * A fully-qualified path representing Spec resource. + * @returns {string} A string representing the api. + */ + matchApiFromSpecName(specName: string) { + return this.pathTemplates.specPathTemplate.match(specName).api; + } + + /** + * Parse the version from Spec resource. + * + * @param {string} specName + * A fully-qualified path representing Spec resource. + * @returns {string} A string representing the version. + */ + matchVersionFromSpecName(specName: string) { + return this.pathTemplates.specPathTemplate.match(specName).version; + } + + /** + * Parse the spec from Spec resource. + * + * @param {string} specName + * A fully-qualified path representing Spec resource. + * @returns {string} A string representing the spec. + */ + matchSpecFromSpecName(specName: string) { + return this.pathTemplates.specPathTemplate.match(specName).spec; + } + + /** + * Return a fully-qualified styleGuide resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} plugin + * @returns {string} Resource name string. + */ + styleGuidePath(project:string,location:string,plugin:string) { + return this.pathTemplates.styleGuidePathTemplate.render({ + project: project, + location: location, + plugin: plugin, + }); + } + + /** + * Parse the project from StyleGuide resource. + * + * @param {string} styleGuideName + * A fully-qualified path representing StyleGuide resource. + * @returns {string} A string representing the project. + */ + matchProjectFromStyleGuideName(styleGuideName: string) { + return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName).project; + } + + /** + * Parse the location from StyleGuide resource. + * + * @param {string} styleGuideName + * A fully-qualified path representing StyleGuide resource. + * @returns {string} A string representing the location. + */ + matchLocationFromStyleGuideName(styleGuideName: string) { + return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName).location; + } + + /** + * Parse the plugin from StyleGuide resource. + * + * @param {string} styleGuideName + * A fully-qualified path representing StyleGuide resource. + * @returns {string} A string representing the plugin. + */ + matchPluginFromStyleGuideName(styleGuideName: string) { + return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName).plugin; + } + + /** + * Return a fully-qualified version resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @param {string} version + * @returns {string} Resource name string. + */ + versionPath(project:string,location:string,api:string,version:string) { + return this.pathTemplates.versionPathTemplate.render({ + project: project, + location: location, + api: api, + version: version, + }); + } + + /** + * Parse the project from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the project. + */ + matchProjectFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).project; + } + + /** + * Parse the location from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the location. + */ + matchLocationFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).location; + } + + /** + * Parse the api from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the api. + */ + matchApiFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).api; + } + + /** + * Parse the version from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the version. + */ + matchVersionFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).version; + } + + /** + * 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.lintingServiceStub && !this._terminated) { + return this.lintingServiceStub.then(stub => { + this._terminated = true; + stub.close(); + this.locationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-cloud-apihub/v1/src/v1/linting_service_client_config.json b/owl-bot-staging/google-cloud-apihub/v1/src/v1/linting_service_client_config.json new file mode 100644 index 00000000000..83c20bac98a --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/src/v1/linting_service_client_config.json @@ -0,0 +1,58 @@ +{ + "interfaces": { + "google.cloud.apihub.v1.LintingService": { + "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": { + "GetStyleGuide": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "UpdateStyleGuide": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetStyleGuideContents": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "LintSpec": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-apihub/v1/src/v1/linting_service_proto_list.json b/owl-bot-staging/google-cloud-apihub/v1/src/v1/linting_service_proto_list.json new file mode 100644 index 00000000000..07e987f7fb3 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/src/v1/linting_service_proto_list.json @@ -0,0 +1,9 @@ +[ + "../../protos/google/cloud/apihub/v1/apihub_service.proto", + "../../protos/google/cloud/apihub/v1/common_fields.proto", + "../../protos/google/cloud/apihub/v1/host_project_registration_service.proto", + "../../protos/google/cloud/apihub/v1/linting_service.proto", + "../../protos/google/cloud/apihub/v1/plugin_service.proto", + "../../protos/google/cloud/apihub/v1/provisioning_service.proto", + "../../protos/google/cloud/apihub/v1/runtime_project_attachment_service.proto" +] diff --git a/owl-bot-staging/google-cloud-apihub/v1/src/v1/provisioning_client.ts b/owl-bot-staging/google-cloud-apihub/v1/src/v1/provisioning_client.ts new file mode 100644 index 00000000000..70fb4cf145f --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/src/v1/provisioning_client.ts @@ -0,0 +1,1761 @@ +// Copyright 2024 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, LocationsClient, LocationProtos} from 'google-gax'; + +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); + +/** + * Client JSON configuration object, loaded from + * `src/v1/provisioning_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './provisioning_client_config.json'; +const version = require('../../../package.json').version; + +/** + * This service is used for managing the data plane provisioning of the API hub. + * @class + * @memberof v1 + */ +export class ProvisioningClient { + 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}; + private _universeDomain: string; + private _servicePath: string; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + locationsClient: LocationsClient; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + provisioningStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of ProvisioningClient. + * + * @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 ProvisioningClient({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 ProvisioningClient; + if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { + throw new Error('Please set either universe_domain or universeDomain, but not both.'); + } + const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; + this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; + this._servicePath = 'apihub.' + this._universeDomain; + const servicePath = opts?.servicePath || opts?.apiEndpoint || this._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 !== this._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 = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + 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 === 'object' && '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 = { + apiPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}' + ), + apiHubInstancePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apiHubInstances/{api_hub_instance}' + ), + apiOperationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}' + ), + attributePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/attributes/{attribute}' + ), + definitionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}' + ), + dependencyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/dependencies/{dependency}' + ), + deploymentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/deployments/{deployment}' + ), + externalApiPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/externalApis/{external_api}' + ), + hostProjectRegistrationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/hostProjectRegistrations/{host_project_registration}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + pluginPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/plugins/{plugin}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + runtimeProjectAttachmentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}' + ), + specPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}' + ), + styleGuidePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/plugins/{plugin}/styleGuide' + ), + versionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}/versions/{version}' + ), + }; + + 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.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 createApiHubInstanceResponse = protoFilesRoot.lookup( + '.google.cloud.apihub.v1.ApiHubInstance') as gax.protobuf.Type; + const createApiHubInstanceMetadata = protoFilesRoot.lookup( + '.google.cloud.apihub.v1.OperationMetadata') as gax.protobuf.Type; + + this.descriptors.longrunning = { + createApiHubInstance: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createApiHubInstanceResponse.decode.bind(createApiHubInstanceResponse), + createApiHubInstanceMetadata.decode.bind(createApiHubInstanceMetadata)) + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.apihub.v1.Provisioning', 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.provisioningStub) { + return this.provisioningStub; + } + + // Put together the "service stub" for + // google.cloud.apihub.v1.Provisioning. + this.provisioningStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.apihub.v1.Provisioning') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.apihub.v1.Provisioning, + 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 provisioningStubMethods = + ['createApiHubInstance', 'getApiHubInstance', 'lookupApiHubInstance']; + for (const methodName of provisioningStubMethods) { + const callPromise = this.provisioningStub.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.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.provisioningStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'apihub.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'apihub.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * 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 API Hub instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the Api Hub instance to retrieve. + * Format: + * `projects/{project}/locations/{location}/apiHubInstances/{apiHubInstance}`. + * @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.apihub.v1.ApiHubInstance|ApiHubInstance}. + * 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/provisioning.get_api_hub_instance.js + * region_tag:apihub_v1_generated_Provisioning_GetApiHubInstance_async + */ + getApiHubInstance( + request?: protos.google.cloud.apihub.v1.IGetApiHubInstanceRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.apihub.v1.IApiHubInstance, + protos.google.cloud.apihub.v1.IGetApiHubInstanceRequest|undefined, {}|undefined + ]>; + getApiHubInstance( + request: protos.google.cloud.apihub.v1.IGetApiHubInstanceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.IApiHubInstance, + protos.google.cloud.apihub.v1.IGetApiHubInstanceRequest|null|undefined, + {}|null|undefined>): void; + getApiHubInstance( + request: protos.google.cloud.apihub.v1.IGetApiHubInstanceRequest, + callback: Callback< + protos.google.cloud.apihub.v1.IApiHubInstance, + protos.google.cloud.apihub.v1.IGetApiHubInstanceRequest|null|undefined, + {}|null|undefined>): void; + getApiHubInstance( + request?: protos.google.cloud.apihub.v1.IGetApiHubInstanceRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.apihub.v1.IApiHubInstance, + protos.google.cloud.apihub.v1.IGetApiHubInstanceRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.apihub.v1.IApiHubInstance, + protos.google.cloud.apihub.v1.IGetApiHubInstanceRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.apihub.v1.IApiHubInstance, + protos.google.cloud.apihub.v1.IGetApiHubInstanceRequest|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.getApiHubInstance(request, options, callback); + } +/** + * Looks up an Api Hub instance in a given GCP project. There will always be + * only one Api Hub instance for a GCP project across all locations. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. There will always be only one Api Hub instance for a GCP project + * across all locations. + * The parent resource for the Api Hub instance resource. + * Format: `projects/{project}/locations/{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 protos.google.cloud.apihub.v1.LookupApiHubInstanceResponse|LookupApiHubInstanceResponse}. + * 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/provisioning.lookup_api_hub_instance.js + * region_tag:apihub_v1_generated_Provisioning_LookupApiHubInstance_async + */ + lookupApiHubInstance( + request?: protos.google.cloud.apihub.v1.ILookupApiHubInstanceRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.apihub.v1.ILookupApiHubInstanceResponse, + protos.google.cloud.apihub.v1.ILookupApiHubInstanceRequest|undefined, {}|undefined + ]>; + lookupApiHubInstance( + request: protos.google.cloud.apihub.v1.ILookupApiHubInstanceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.ILookupApiHubInstanceResponse, + protos.google.cloud.apihub.v1.ILookupApiHubInstanceRequest|null|undefined, + {}|null|undefined>): void; + lookupApiHubInstance( + request: protos.google.cloud.apihub.v1.ILookupApiHubInstanceRequest, + callback: Callback< + protos.google.cloud.apihub.v1.ILookupApiHubInstanceResponse, + protos.google.cloud.apihub.v1.ILookupApiHubInstanceRequest|null|undefined, + {}|null|undefined>): void; + lookupApiHubInstance( + request?: protos.google.cloud.apihub.v1.ILookupApiHubInstanceRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.apihub.v1.ILookupApiHubInstanceResponse, + protos.google.cloud.apihub.v1.ILookupApiHubInstanceRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.apihub.v1.ILookupApiHubInstanceResponse, + protos.google.cloud.apihub.v1.ILookupApiHubInstanceRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.apihub.v1.ILookupApiHubInstanceResponse, + protos.google.cloud.apihub.v1.ILookupApiHubInstanceRequest|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.lookupApiHubInstance(request, options, callback); + } + +/** + * Provisions instance resources for the API Hub. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource for the Api Hub instance resource. + * Format: `projects/{project}/locations/{location}` + * @param {string} [request.apiHubInstanceId] + * Optional. Identifier to assign to the Api Hub instance. Must be unique + * within scope of the parent resource. If the field is not provided, system + * generated id will be used. + * + * This value should be 4-40 characters, and valid characters + * are `/{@link protos.A-Z|a-z}[0-9]-_/`. + * @param {google.cloud.apihub.v1.ApiHubInstance} request.apiHubInstance + * Required. The ApiHub instance. + * @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/provisioning.create_api_hub_instance.js + * region_tag:apihub_v1_generated_Provisioning_CreateApiHubInstance_async + */ + createApiHubInstance( + request?: protos.google.cloud.apihub.v1.ICreateApiHubInstanceRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + createApiHubInstance( + request: protos.google.cloud.apihub.v1.ICreateApiHubInstanceRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createApiHubInstance( + request: protos.google.cloud.apihub.v1.ICreateApiHubInstanceRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createApiHubInstance( + request?: protos.google.cloud.apihub.v1.ICreateApiHubInstanceRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + 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.createApiHubInstance(request, options, callback); + } +/** + * Check the status of the long running operation returned by `createApiHubInstance()`. + * @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/provisioning.create_api_hub_instance.js + * region_tag:apihub_v1_generated_Provisioning_CreateApiHubInstance_async + */ + async checkCreateApiHubInstanceProgress(name: string): Promise>{ + 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.createApiHubInstance, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * 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 api resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @returns {string} Resource name string. + */ + apiPath(project:string,location:string,api:string) { + return this.pathTemplates.apiPathTemplate.render({ + project: project, + location: location, + api: api, + }); + } + + /** + * Parse the project from Api resource. + * + * @param {string} apiName + * A fully-qualified path representing Api resource. + * @returns {string} A string representing the project. + */ + matchProjectFromApiName(apiName: string) { + return this.pathTemplates.apiPathTemplate.match(apiName).project; + } + + /** + * Parse the location from Api resource. + * + * @param {string} apiName + * A fully-qualified path representing Api resource. + * @returns {string} A string representing the location. + */ + matchLocationFromApiName(apiName: string) { + return this.pathTemplates.apiPathTemplate.match(apiName).location; + } + + /** + * Parse the api from Api resource. + * + * @param {string} apiName + * A fully-qualified path representing Api resource. + * @returns {string} A string representing the api. + */ + matchApiFromApiName(apiName: string) { + return this.pathTemplates.apiPathTemplate.match(apiName).api; + } + + /** + * Return a fully-qualified apiHubInstance resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api_hub_instance + * @returns {string} Resource name string. + */ + apiHubInstancePath(project:string,location:string,apiHubInstance:string) { + return this.pathTemplates.apiHubInstancePathTemplate.render({ + project: project, + location: location, + api_hub_instance: apiHubInstance, + }); + } + + /** + * Parse the project from ApiHubInstance resource. + * + * @param {string} apiHubInstanceName + * A fully-qualified path representing ApiHubInstance resource. + * @returns {string} A string representing the project. + */ + matchProjectFromApiHubInstanceName(apiHubInstanceName: string) { + return this.pathTemplates.apiHubInstancePathTemplate.match(apiHubInstanceName).project; + } + + /** + * Parse the location from ApiHubInstance resource. + * + * @param {string} apiHubInstanceName + * A fully-qualified path representing ApiHubInstance resource. + * @returns {string} A string representing the location. + */ + matchLocationFromApiHubInstanceName(apiHubInstanceName: string) { + return this.pathTemplates.apiHubInstancePathTemplate.match(apiHubInstanceName).location; + } + + /** + * Parse the api_hub_instance from ApiHubInstance resource. + * + * @param {string} apiHubInstanceName + * A fully-qualified path representing ApiHubInstance resource. + * @returns {string} A string representing the api_hub_instance. + */ + matchApiHubInstanceFromApiHubInstanceName(apiHubInstanceName: string) { + return this.pathTemplates.apiHubInstancePathTemplate.match(apiHubInstanceName).api_hub_instance; + } + + /** + * Return a fully-qualified apiOperation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @param {string} version + * @param {string} operation + * @returns {string} Resource name string. + */ + apiOperationPath(project:string,location:string,api:string,version:string,operation:string) { + return this.pathTemplates.apiOperationPathTemplate.render({ + project: project, + location: location, + api: api, + version: version, + operation: operation, + }); + } + + /** + * Parse the project from ApiOperation resource. + * + * @param {string} apiOperationName + * A fully-qualified path representing ApiOperation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromApiOperationName(apiOperationName: string) { + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).project; + } + + /** + * Parse the location from ApiOperation resource. + * + * @param {string} apiOperationName + * A fully-qualified path representing ApiOperation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromApiOperationName(apiOperationName: string) { + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).location; + } + + /** + * Parse the api from ApiOperation resource. + * + * @param {string} apiOperationName + * A fully-qualified path representing ApiOperation resource. + * @returns {string} A string representing the api. + */ + matchApiFromApiOperationName(apiOperationName: string) { + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).api; + } + + /** + * Parse the version from ApiOperation resource. + * + * @param {string} apiOperationName + * A fully-qualified path representing ApiOperation resource. + * @returns {string} A string representing the version. + */ + matchVersionFromApiOperationName(apiOperationName: string) { + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).version; + } + + /** + * Parse the operation from ApiOperation resource. + * + * @param {string} apiOperationName + * A fully-qualified path representing ApiOperation resource. + * @returns {string} A string representing the operation. + */ + matchOperationFromApiOperationName(apiOperationName: string) { + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).operation; + } + + /** + * Return a fully-qualified attribute resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} attribute + * @returns {string} Resource name string. + */ + attributePath(project:string,location:string,attribute:string) { + return this.pathTemplates.attributePathTemplate.render({ + project: project, + location: location, + attribute: attribute, + }); + } + + /** + * Parse the project from Attribute resource. + * + * @param {string} attributeName + * A fully-qualified path representing Attribute resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAttributeName(attributeName: string) { + return this.pathTemplates.attributePathTemplate.match(attributeName).project; + } + + /** + * Parse the location from Attribute resource. + * + * @param {string} attributeName + * A fully-qualified path representing Attribute resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAttributeName(attributeName: string) { + return this.pathTemplates.attributePathTemplate.match(attributeName).location; + } + + /** + * Parse the attribute from Attribute resource. + * + * @param {string} attributeName + * A fully-qualified path representing Attribute resource. + * @returns {string} A string representing the attribute. + */ + matchAttributeFromAttributeName(attributeName: string) { + return this.pathTemplates.attributePathTemplate.match(attributeName).attribute; + } + + /** + * Return a fully-qualified definition resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @param {string} version + * @param {string} definition + * @returns {string} Resource name string. + */ + definitionPath(project:string,location:string,api:string,version:string,definition:string) { + return this.pathTemplates.definitionPathTemplate.render({ + project: project, + location: location, + api: api, + version: version, + definition: definition, + }); + } + + /** + * Parse the project from Definition resource. + * + * @param {string} definitionName + * A fully-qualified path representing Definition resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDefinitionName(definitionName: string) { + return this.pathTemplates.definitionPathTemplate.match(definitionName).project; + } + + /** + * Parse the location from Definition resource. + * + * @param {string} definitionName + * A fully-qualified path representing Definition resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDefinitionName(definitionName: string) { + return this.pathTemplates.definitionPathTemplate.match(definitionName).location; + } + + /** + * Parse the api from Definition resource. + * + * @param {string} definitionName + * A fully-qualified path representing Definition resource. + * @returns {string} A string representing the api. + */ + matchApiFromDefinitionName(definitionName: string) { + return this.pathTemplates.definitionPathTemplate.match(definitionName).api; + } + + /** + * Parse the version from Definition resource. + * + * @param {string} definitionName + * A fully-qualified path representing Definition resource. + * @returns {string} A string representing the version. + */ + matchVersionFromDefinitionName(definitionName: string) { + return this.pathTemplates.definitionPathTemplate.match(definitionName).version; + } + + /** + * Parse the definition from Definition resource. + * + * @param {string} definitionName + * A fully-qualified path representing Definition resource. + * @returns {string} A string representing the definition. + */ + matchDefinitionFromDefinitionName(definitionName: string) { + return this.pathTemplates.definitionPathTemplate.match(definitionName).definition; + } + + /** + * Return a fully-qualified dependency resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dependency + * @returns {string} Resource name string. + */ + dependencyPath(project:string,location:string,dependency:string) { + return this.pathTemplates.dependencyPathTemplate.render({ + project: project, + location: location, + dependency: dependency, + }); + } + + /** + * Parse the project from Dependency resource. + * + * @param {string} dependencyName + * A fully-qualified path representing Dependency resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDependencyName(dependencyName: string) { + return this.pathTemplates.dependencyPathTemplate.match(dependencyName).project; + } + + /** + * Parse the location from Dependency resource. + * + * @param {string} dependencyName + * A fully-qualified path representing Dependency resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDependencyName(dependencyName: string) { + return this.pathTemplates.dependencyPathTemplate.match(dependencyName).location; + } + + /** + * Parse the dependency from Dependency resource. + * + * @param {string} dependencyName + * A fully-qualified path representing Dependency resource. + * @returns {string} A string representing the dependency. + */ + matchDependencyFromDependencyName(dependencyName: string) { + return this.pathTemplates.dependencyPathTemplate.match(dependencyName).dependency; + } + + /** + * Return a fully-qualified deployment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} deployment + * @returns {string} Resource name string. + */ + deploymentPath(project:string,location:string,deployment:string) { + return this.pathTemplates.deploymentPathTemplate.render({ + project: project, + location: location, + deployment: deployment, + }); + } + + /** + * Parse the project from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName).project; + } + + /** + * Parse the location from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName).location; + } + + /** + * Parse the deployment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the deployment. + */ + matchDeploymentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName).deployment; + } + + /** + * Return a fully-qualified externalApi resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} external_api + * @returns {string} Resource name string. + */ + externalApiPath(project:string,location:string,externalApi:string) { + return this.pathTemplates.externalApiPathTemplate.render({ + project: project, + location: location, + external_api: externalApi, + }); + } + + /** + * Parse the project from ExternalApi resource. + * + * @param {string} externalApiName + * A fully-qualified path representing ExternalApi resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExternalApiName(externalApiName: string) { + return this.pathTemplates.externalApiPathTemplate.match(externalApiName).project; + } + + /** + * Parse the location from ExternalApi resource. + * + * @param {string} externalApiName + * A fully-qualified path representing ExternalApi resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExternalApiName(externalApiName: string) { + return this.pathTemplates.externalApiPathTemplate.match(externalApiName).location; + } + + /** + * Parse the external_api from ExternalApi resource. + * + * @param {string} externalApiName + * A fully-qualified path representing ExternalApi resource. + * @returns {string} A string representing the external_api. + */ + matchExternalApiFromExternalApiName(externalApiName: string) { + return this.pathTemplates.externalApiPathTemplate.match(externalApiName).external_api; + } + + /** + * Return a fully-qualified hostProjectRegistration resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} host_project_registration + * @returns {string} Resource name string. + */ + hostProjectRegistrationPath(project:string,location:string,hostProjectRegistration:string) { + return this.pathTemplates.hostProjectRegistrationPathTemplate.render({ + project: project, + location: location, + host_project_registration: hostProjectRegistration, + }); + } + + /** + * Parse the project from HostProjectRegistration resource. + * + * @param {string} hostProjectRegistrationName + * A fully-qualified path representing HostProjectRegistration resource. + * @returns {string} A string representing the project. + */ + matchProjectFromHostProjectRegistrationName(hostProjectRegistrationName: string) { + return this.pathTemplates.hostProjectRegistrationPathTemplate.match(hostProjectRegistrationName).project; + } + + /** + * Parse the location from HostProjectRegistration resource. + * + * @param {string} hostProjectRegistrationName + * A fully-qualified path representing HostProjectRegistration resource. + * @returns {string} A string representing the location. + */ + matchLocationFromHostProjectRegistrationName(hostProjectRegistrationName: string) { + return this.pathTemplates.hostProjectRegistrationPathTemplate.match(hostProjectRegistrationName).location; + } + + /** + * Parse the host_project_registration from HostProjectRegistration resource. + * + * @param {string} hostProjectRegistrationName + * A fully-qualified path representing HostProjectRegistration resource. + * @returns {string} A string representing the host_project_registration. + */ + matchHostProjectRegistrationFromHostProjectRegistrationName(hostProjectRegistrationName: string) { + return this.pathTemplates.hostProjectRegistrationPathTemplate.match(hostProjectRegistrationName).host_project_registration; + } + + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project:string,location:string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + + /** + * Return a fully-qualified plugin resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} plugin + * @returns {string} Resource name string. + */ + pluginPath(project:string,location:string,plugin:string) { + return this.pathTemplates.pluginPathTemplate.render({ + project: project, + location: location, + plugin: plugin, + }); + } + + /** + * Parse the project from Plugin resource. + * + * @param {string} pluginName + * A fully-qualified path representing Plugin resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPluginName(pluginName: string) { + return this.pathTemplates.pluginPathTemplate.match(pluginName).project; + } + + /** + * Parse the location from Plugin resource. + * + * @param {string} pluginName + * A fully-qualified path representing Plugin resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPluginName(pluginName: string) { + return this.pathTemplates.pluginPathTemplate.match(pluginName).location; + } + + /** + * Parse the plugin from Plugin resource. + * + * @param {string} pluginName + * A fully-qualified path representing Plugin resource. + * @returns {string} A string representing the plugin. + */ + matchPluginFromPluginName(pluginName: string) { + return this.pathTemplates.pluginPathTemplate.match(pluginName).plugin; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project:string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified runtimeProjectAttachment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} runtime_project_attachment + * @returns {string} Resource name string. + */ + runtimeProjectAttachmentPath(project:string,location:string,runtimeProjectAttachment:string) { + return this.pathTemplates.runtimeProjectAttachmentPathTemplate.render({ + project: project, + location: location, + runtime_project_attachment: runtimeProjectAttachment, + }); + } + + /** + * Parse the project from RuntimeProjectAttachment resource. + * + * @param {string} runtimeProjectAttachmentName + * A fully-qualified path representing RuntimeProjectAttachment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRuntimeProjectAttachmentName(runtimeProjectAttachmentName: string) { + return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match(runtimeProjectAttachmentName).project; + } + + /** + * Parse the location from RuntimeProjectAttachment resource. + * + * @param {string} runtimeProjectAttachmentName + * A fully-qualified path representing RuntimeProjectAttachment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRuntimeProjectAttachmentName(runtimeProjectAttachmentName: string) { + return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match(runtimeProjectAttachmentName).location; + } + + /** + * Parse the runtime_project_attachment from RuntimeProjectAttachment resource. + * + * @param {string} runtimeProjectAttachmentName + * A fully-qualified path representing RuntimeProjectAttachment resource. + * @returns {string} A string representing the runtime_project_attachment. + */ + matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName(runtimeProjectAttachmentName: string) { + return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match(runtimeProjectAttachmentName).runtime_project_attachment; + } + + /** + * Return a fully-qualified spec resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @param {string} version + * @param {string} spec + * @returns {string} Resource name string. + */ + specPath(project:string,location:string,api:string,version:string,spec:string) { + return this.pathTemplates.specPathTemplate.render({ + project: project, + location: location, + api: api, + version: version, + spec: spec, + }); + } + + /** + * Parse the project from Spec resource. + * + * @param {string} specName + * A fully-qualified path representing Spec resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSpecName(specName: string) { + return this.pathTemplates.specPathTemplate.match(specName).project; + } + + /** + * Parse the location from Spec resource. + * + * @param {string} specName + * A fully-qualified path representing Spec resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSpecName(specName: string) { + return this.pathTemplates.specPathTemplate.match(specName).location; + } + + /** + * Parse the api from Spec resource. + * + * @param {string} specName + * A fully-qualified path representing Spec resource. + * @returns {string} A string representing the api. + */ + matchApiFromSpecName(specName: string) { + return this.pathTemplates.specPathTemplate.match(specName).api; + } + + /** + * Parse the version from Spec resource. + * + * @param {string} specName + * A fully-qualified path representing Spec resource. + * @returns {string} A string representing the version. + */ + matchVersionFromSpecName(specName: string) { + return this.pathTemplates.specPathTemplate.match(specName).version; + } + + /** + * Parse the spec from Spec resource. + * + * @param {string} specName + * A fully-qualified path representing Spec resource. + * @returns {string} A string representing the spec. + */ + matchSpecFromSpecName(specName: string) { + return this.pathTemplates.specPathTemplate.match(specName).spec; + } + + /** + * Return a fully-qualified styleGuide resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} plugin + * @returns {string} Resource name string. + */ + styleGuidePath(project:string,location:string,plugin:string) { + return this.pathTemplates.styleGuidePathTemplate.render({ + project: project, + location: location, + plugin: plugin, + }); + } + + /** + * Parse the project from StyleGuide resource. + * + * @param {string} styleGuideName + * A fully-qualified path representing StyleGuide resource. + * @returns {string} A string representing the project. + */ + matchProjectFromStyleGuideName(styleGuideName: string) { + return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName).project; + } + + /** + * Parse the location from StyleGuide resource. + * + * @param {string} styleGuideName + * A fully-qualified path representing StyleGuide resource. + * @returns {string} A string representing the location. + */ + matchLocationFromStyleGuideName(styleGuideName: string) { + return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName).location; + } + + /** + * Parse the plugin from StyleGuide resource. + * + * @param {string} styleGuideName + * A fully-qualified path representing StyleGuide resource. + * @returns {string} A string representing the plugin. + */ + matchPluginFromStyleGuideName(styleGuideName: string) { + return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName).plugin; + } + + /** + * Return a fully-qualified version resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @param {string} version + * @returns {string} Resource name string. + */ + versionPath(project:string,location:string,api:string,version:string) { + return this.pathTemplates.versionPathTemplate.render({ + project: project, + location: location, + api: api, + version: version, + }); + } + + /** + * Parse the project from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the project. + */ + matchProjectFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).project; + } + + /** + * Parse the location from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the location. + */ + matchLocationFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).location; + } + + /** + * Parse the api from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the api. + */ + matchApiFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).api; + } + + /** + * Parse the version from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the version. + */ + matchVersionFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).version; + } + + /** + * 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.provisioningStub && !this._terminated) { + return this.provisioningStub.then(stub => { + this._terminated = true; + stub.close(); + this.locationsClient.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-cloud-apihub/v1/src/v1/provisioning_client_config.json b/owl-bot-staging/google-cloud-apihub/v1/src/v1/provisioning_client_config.json new file mode 100644 index 00000000000..828739a1214 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/src/v1/provisioning_client_config.json @@ -0,0 +1,53 @@ +{ + "interfaces": { + "google.cloud.apihub.v1.Provisioning": { + "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": { + "CreateApiHubInstance": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetApiHubInstance": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "LookupApiHubInstance": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-apihub/v1/src/v1/provisioning_proto_list.json b/owl-bot-staging/google-cloud-apihub/v1/src/v1/provisioning_proto_list.json new file mode 100644 index 00000000000..07e987f7fb3 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/src/v1/provisioning_proto_list.json @@ -0,0 +1,9 @@ +[ + "../../protos/google/cloud/apihub/v1/apihub_service.proto", + "../../protos/google/cloud/apihub/v1/common_fields.proto", + "../../protos/google/cloud/apihub/v1/host_project_registration_service.proto", + "../../protos/google/cloud/apihub/v1/linting_service.proto", + "../../protos/google/cloud/apihub/v1/plugin_service.proto", + "../../protos/google/cloud/apihub/v1/provisioning_service.proto", + "../../protos/google/cloud/apihub/v1/runtime_project_attachment_service.proto" +] diff --git a/owl-bot-staging/google-cloud-apihub/v1/src/v1/runtime_project_attachment_service_client.ts b/owl-bot-staging/google-cloud-apihub/v1/src/v1/runtime_project_attachment_service_client.ts new file mode 100644 index 00000000000..7e322743733 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/src/v1/runtime_project_attachment_service_client.ts @@ -0,0 +1,1875 @@ +// Copyright 2024 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, PaginationCallback, GaxCall, 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/runtime_project_attachment_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './runtime_project_attachment_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * This service is used for managing the runtime project attachments. + * @class + * @memberof v1 + */ +export class RuntimeProjectAttachmentServiceClient { + 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}; + private _universeDomain: string; + private _servicePath: string; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + locationsClient: LocationsClient; + pathTemplates: {[name: string]: gax.PathTemplate}; + runtimeProjectAttachmentServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of RuntimeProjectAttachmentServiceClient. + * + * @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 RuntimeProjectAttachmentServiceClient({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 RuntimeProjectAttachmentServiceClient; + if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { + throw new Error('Please set either universe_domain or universeDomain, but not both.'); + } + const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; + this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; + this._servicePath = 'apihub.' + this._universeDomain; + const servicePath = opts?.servicePath || opts?.apiEndpoint || this._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 !== this._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 = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + 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 === 'object' && '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 = { + apiPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}' + ), + apiHubInstancePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apiHubInstances/{api_hub_instance}' + ), + apiOperationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}' + ), + attributePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/attributes/{attribute}' + ), + definitionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}' + ), + dependencyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/dependencies/{dependency}' + ), + deploymentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/deployments/{deployment}' + ), + externalApiPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/externalApis/{external_api}' + ), + hostProjectRegistrationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/hostProjectRegistrations/{host_project_registration}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + pluginPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/plugins/{plugin}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + runtimeProjectAttachmentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}' + ), + specPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}' + ), + styleGuidePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/plugins/{plugin}/styleGuide' + ), + versionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}/versions/{version}' + ), + }; + + // 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 = { + listRuntimeProjectAttachments: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'runtimeProjectAttachments') + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.apihub.v1.RuntimeProjectAttachmentService', 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.runtimeProjectAttachmentServiceStub) { + return this.runtimeProjectAttachmentServiceStub; + } + + // Put together the "service stub" for + // google.cloud.apihub.v1.RuntimeProjectAttachmentService. + this.runtimeProjectAttachmentServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.apihub.v1.RuntimeProjectAttachmentService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.apihub.v1.RuntimeProjectAttachmentService, + 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 runtimeProjectAttachmentServiceStubMethods = + ['createRuntimeProjectAttachment', 'getRuntimeProjectAttachment', 'listRuntimeProjectAttachments', 'deleteRuntimeProjectAttachment', 'lookupRuntimeProjectAttachment']; + for (const methodName of runtimeProjectAttachmentServiceStubMethods) { + const callPromise = this.runtimeProjectAttachmentServiceStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + this.descriptors.page[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.runtimeProjectAttachmentServiceStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'apihub.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'apihub.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * 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 -- + // ------------------- +/** + * Attaches a runtime project to the host project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource for the Runtime Project Attachment. + * Format: `projects/{project}/locations/{location}` + * @param {string} request.runtimeProjectAttachmentId + * Required. The ID to use for the Runtime Project Attachment, which will + * become the final component of the Runtime Project Attachment's name. The ID + * must be the same as the project ID of the Google cloud project specified in + * the runtime_project_attachment.runtime_project field. + * @param {google.cloud.apihub.v1.RuntimeProjectAttachment} request.runtimeProjectAttachment + * Required. The Runtime Project Attachment to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.apihub.v1.RuntimeProjectAttachment|RuntimeProjectAttachment}. + * 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/runtime_project_attachment_service.create_runtime_project_attachment.js + * region_tag:apihub_v1_generated_RuntimeProjectAttachmentService_CreateRuntimeProjectAttachment_async + */ + createRuntimeProjectAttachment( + request?: protos.google.cloud.apihub.v1.ICreateRuntimeProjectAttachmentRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.apihub.v1.IRuntimeProjectAttachment, + protos.google.cloud.apihub.v1.ICreateRuntimeProjectAttachmentRequest|undefined, {}|undefined + ]>; + createRuntimeProjectAttachment( + request: protos.google.cloud.apihub.v1.ICreateRuntimeProjectAttachmentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.IRuntimeProjectAttachment, + protos.google.cloud.apihub.v1.ICreateRuntimeProjectAttachmentRequest|null|undefined, + {}|null|undefined>): void; + createRuntimeProjectAttachment( + request: protos.google.cloud.apihub.v1.ICreateRuntimeProjectAttachmentRequest, + callback: Callback< + protos.google.cloud.apihub.v1.IRuntimeProjectAttachment, + protos.google.cloud.apihub.v1.ICreateRuntimeProjectAttachmentRequest|null|undefined, + {}|null|undefined>): void; + createRuntimeProjectAttachment( + request?: protos.google.cloud.apihub.v1.ICreateRuntimeProjectAttachmentRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.apihub.v1.IRuntimeProjectAttachment, + protos.google.cloud.apihub.v1.ICreateRuntimeProjectAttachmentRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.apihub.v1.IRuntimeProjectAttachment, + protos.google.cloud.apihub.v1.ICreateRuntimeProjectAttachmentRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.apihub.v1.IRuntimeProjectAttachment, + protos.google.cloud.apihub.v1.ICreateRuntimeProjectAttachmentRequest|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.createRuntimeProjectAttachment(request, options, callback); + } +/** + * Gets a runtime project attachment. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the API resource to retrieve. + * Format: + * `projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}` + * @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.apihub.v1.RuntimeProjectAttachment|RuntimeProjectAttachment}. + * 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/runtime_project_attachment_service.get_runtime_project_attachment.js + * region_tag:apihub_v1_generated_RuntimeProjectAttachmentService_GetRuntimeProjectAttachment_async + */ + getRuntimeProjectAttachment( + request?: protos.google.cloud.apihub.v1.IGetRuntimeProjectAttachmentRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.apihub.v1.IRuntimeProjectAttachment, + protos.google.cloud.apihub.v1.IGetRuntimeProjectAttachmentRequest|undefined, {}|undefined + ]>; + getRuntimeProjectAttachment( + request: protos.google.cloud.apihub.v1.IGetRuntimeProjectAttachmentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.IRuntimeProjectAttachment, + protos.google.cloud.apihub.v1.IGetRuntimeProjectAttachmentRequest|null|undefined, + {}|null|undefined>): void; + getRuntimeProjectAttachment( + request: protos.google.cloud.apihub.v1.IGetRuntimeProjectAttachmentRequest, + callback: Callback< + protos.google.cloud.apihub.v1.IRuntimeProjectAttachment, + protos.google.cloud.apihub.v1.IGetRuntimeProjectAttachmentRequest|null|undefined, + {}|null|undefined>): void; + getRuntimeProjectAttachment( + request?: protos.google.cloud.apihub.v1.IGetRuntimeProjectAttachmentRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.apihub.v1.IRuntimeProjectAttachment, + protos.google.cloud.apihub.v1.IGetRuntimeProjectAttachmentRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.apihub.v1.IRuntimeProjectAttachment, + protos.google.cloud.apihub.v1.IGetRuntimeProjectAttachmentRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.apihub.v1.IRuntimeProjectAttachment, + protos.google.cloud.apihub.v1.IGetRuntimeProjectAttachmentRequest|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.getRuntimeProjectAttachment(request, options, callback); + } +/** + * Delete a runtime project attachment in the API Hub. This call will detach + * the runtime project from the host project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the Runtime Project Attachment to delete. + * Format: + * `projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}` + * @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.protobuf.Empty|Empty}. + * 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/runtime_project_attachment_service.delete_runtime_project_attachment.js + * region_tag:apihub_v1_generated_RuntimeProjectAttachmentService_DeleteRuntimeProjectAttachment_async + */ + deleteRuntimeProjectAttachment( + request?: protos.google.cloud.apihub.v1.IDeleteRuntimeProjectAttachmentRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteRuntimeProjectAttachmentRequest|undefined, {}|undefined + ]>; + deleteRuntimeProjectAttachment( + request: protos.google.cloud.apihub.v1.IDeleteRuntimeProjectAttachmentRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteRuntimeProjectAttachmentRequest|null|undefined, + {}|null|undefined>): void; + deleteRuntimeProjectAttachment( + request: protos.google.cloud.apihub.v1.IDeleteRuntimeProjectAttachmentRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteRuntimeProjectAttachmentRequest|null|undefined, + {}|null|undefined>): void; + deleteRuntimeProjectAttachment( + request?: protos.google.cloud.apihub.v1.IDeleteRuntimeProjectAttachmentRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteRuntimeProjectAttachmentRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteRuntimeProjectAttachmentRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteRuntimeProjectAttachmentRequest|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.deleteRuntimeProjectAttachment(request, options, callback); + } +/** + * Look up a runtime project attachment. This API can be called in the context + * of any project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Runtime project ID to look up runtime project attachment for. + * Lookup happens across all regions. Expected format: + * `projects/{project}/locations/{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 protos.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse|LookupRuntimeProjectAttachmentResponse}. + * 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/runtime_project_attachment_service.lookup_runtime_project_attachment.js + * region_tag:apihub_v1_generated_RuntimeProjectAttachmentService_LookupRuntimeProjectAttachment_async + */ + lookupRuntimeProjectAttachment( + request?: protos.google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentResponse, + protos.google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentRequest|undefined, {}|undefined + ]>; + lookupRuntimeProjectAttachment( + request: protos.google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentResponse, + protos.google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentRequest|null|undefined, + {}|null|undefined>): void; + lookupRuntimeProjectAttachment( + request: protos.google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentRequest, + callback: Callback< + protos.google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentResponse, + protos.google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentRequest|null|undefined, + {}|null|undefined>): void; + lookupRuntimeProjectAttachment( + request?: protos.google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentResponse, + protos.google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentResponse, + protos.google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentResponse, + protos.google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentRequest|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.lookupRuntimeProjectAttachment(request, options, callback); + } + + /** + * List runtime projects attached to the host project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of runtime project + * attachments. Format: `projects/{project}/locations/{location}` + * @param {number} [request.pageSize] + * Optional. The maximum number of runtime project attachments to return. The + * service may return fewer than this value. If unspecified, at most 50 + * runtime project attachments will be returned. The maximum value is 1000; + * values above 1000 will be coerced to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous + * `ListRuntimeProjectAttachments` call. Provide this to retrieve the + * subsequent page. + * + * When paginating, all other parameters (except page_size) provided to + * `ListRuntimeProjectAttachments` must match the call that provided the page + * token. + * @param {string} [request.filter] + * Optional. An expression that filters the list of RuntimeProjectAttachments. + * + * A filter expression consists of a field name, a comparison + * operator, and a value for filtering. The value must be a string. All + * standard operators as documented at https://google.aip.dev/160 are + * supported. + * + * The following fields in the `RuntimeProjectAttachment` are eligible for + * filtering: + * + * * `name` - The name of the RuntimeProjectAttachment. + * * `create_time` - The time at which the RuntimeProjectAttachment was + * created. The value should be in the + * (RFC3339)[https://tools.ietf.org/html/rfc3339] format. + * * `runtime_project` - The Google cloud project associated with the + * RuntimeProjectAttachment. + * @param {string} [request.orderBy] + * Optional. Hint for how to order the results. + * @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.apihub.v1.RuntimeProjectAttachment|RuntimeProjectAttachment}. + * 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 `listRuntimeProjectAttachmentsAsync()` + * 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. + */ + listRuntimeProjectAttachments( + request?: protos.google.cloud.apihub.v1.IListRuntimeProjectAttachmentsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.apihub.v1.IRuntimeProjectAttachment[], + protos.google.cloud.apihub.v1.IListRuntimeProjectAttachmentsRequest|null, + protos.google.cloud.apihub.v1.IListRuntimeProjectAttachmentsResponse + ]>; + listRuntimeProjectAttachments( + request: protos.google.cloud.apihub.v1.IListRuntimeProjectAttachmentsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.apihub.v1.IListRuntimeProjectAttachmentsRequest, + protos.google.cloud.apihub.v1.IListRuntimeProjectAttachmentsResponse|null|undefined, + protos.google.cloud.apihub.v1.IRuntimeProjectAttachment>): void; + listRuntimeProjectAttachments( + request: protos.google.cloud.apihub.v1.IListRuntimeProjectAttachmentsRequest, + callback: PaginationCallback< + protos.google.cloud.apihub.v1.IListRuntimeProjectAttachmentsRequest, + protos.google.cloud.apihub.v1.IListRuntimeProjectAttachmentsResponse|null|undefined, + protos.google.cloud.apihub.v1.IRuntimeProjectAttachment>): void; + listRuntimeProjectAttachments( + request?: protos.google.cloud.apihub.v1.IListRuntimeProjectAttachmentsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.apihub.v1.IListRuntimeProjectAttachmentsRequest, + protos.google.cloud.apihub.v1.IListRuntimeProjectAttachmentsResponse|null|undefined, + protos.google.cloud.apihub.v1.IRuntimeProjectAttachment>, + callback?: PaginationCallback< + protos.google.cloud.apihub.v1.IListRuntimeProjectAttachmentsRequest, + protos.google.cloud.apihub.v1.IListRuntimeProjectAttachmentsResponse|null|undefined, + protos.google.cloud.apihub.v1.IRuntimeProjectAttachment>): + Promise<[ + protos.google.cloud.apihub.v1.IRuntimeProjectAttachment[], + protos.google.cloud.apihub.v1.IListRuntimeProjectAttachmentsRequest|null, + protos.google.cloud.apihub.v1.IListRuntimeProjectAttachmentsResponse + ]>|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.listRuntimeProjectAttachments(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of runtime project + * attachments. Format: `projects/{project}/locations/{location}` + * @param {number} [request.pageSize] + * Optional. The maximum number of runtime project attachments to return. The + * service may return fewer than this value. If unspecified, at most 50 + * runtime project attachments will be returned. The maximum value is 1000; + * values above 1000 will be coerced to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous + * `ListRuntimeProjectAttachments` call. Provide this to retrieve the + * subsequent page. + * + * When paginating, all other parameters (except page_size) provided to + * `ListRuntimeProjectAttachments` must match the call that provided the page + * token. + * @param {string} [request.filter] + * Optional. An expression that filters the list of RuntimeProjectAttachments. + * + * A filter expression consists of a field name, a comparison + * operator, and a value for filtering. The value must be a string. All + * standard operators as documented at https://google.aip.dev/160 are + * supported. + * + * The following fields in the `RuntimeProjectAttachment` are eligible for + * filtering: + * + * * `name` - The name of the RuntimeProjectAttachment. + * * `create_time` - The time at which the RuntimeProjectAttachment was + * created. The value should be in the + * (RFC3339)[https://tools.ietf.org/html/rfc3339] format. + * * `runtime_project` - The Google cloud project associated with the + * RuntimeProjectAttachment. + * @param {string} [request.orderBy] + * Optional. Hint for how to order the results. + * @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.apihub.v1.RuntimeProjectAttachment|RuntimeProjectAttachment} 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 `listRuntimeProjectAttachmentsAsync()` + * 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. + */ + listRuntimeProjectAttachmentsStream( + request?: protos.google.cloud.apihub.v1.IListRuntimeProjectAttachmentsRequest, + 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['listRuntimeProjectAttachments']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listRuntimeProjectAttachments.createStream( + this.innerApiCalls.listRuntimeProjectAttachments as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listRuntimeProjectAttachments`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of runtime project + * attachments. Format: `projects/{project}/locations/{location}` + * @param {number} [request.pageSize] + * Optional. The maximum number of runtime project attachments to return. The + * service may return fewer than this value. If unspecified, at most 50 + * runtime project attachments will be returned. The maximum value is 1000; + * values above 1000 will be coerced to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous + * `ListRuntimeProjectAttachments` call. Provide this to retrieve the + * subsequent page. + * + * When paginating, all other parameters (except page_size) provided to + * `ListRuntimeProjectAttachments` must match the call that provided the page + * token. + * @param {string} [request.filter] + * Optional. An expression that filters the list of RuntimeProjectAttachments. + * + * A filter expression consists of a field name, a comparison + * operator, and a value for filtering. The value must be a string. All + * standard operators as documented at https://google.aip.dev/160 are + * supported. + * + * The following fields in the `RuntimeProjectAttachment` are eligible for + * filtering: + * + * * `name` - The name of the RuntimeProjectAttachment. + * * `create_time` - The time at which the RuntimeProjectAttachment was + * created. The value should be in the + * (RFC3339)[https://tools.ietf.org/html/rfc3339] format. + * * `runtime_project` - The Google cloud project associated with the + * RuntimeProjectAttachment. + * @param {string} [request.orderBy] + * Optional. Hint for how to order the results. + * @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.apihub.v1.RuntimeProjectAttachment|RuntimeProjectAttachment}. 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/runtime_project_attachment_service.list_runtime_project_attachments.js + * region_tag:apihub_v1_generated_RuntimeProjectAttachmentService_ListRuntimeProjectAttachments_async + */ + listRuntimeProjectAttachmentsAsync( + request?: protos.google.cloud.apihub.v1.IListRuntimeProjectAttachmentsRequest, + 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['listRuntimeProjectAttachments']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listRuntimeProjectAttachments.asyncIterate( + this.innerApiCalls['listRuntimeProjectAttachments'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } +/** + * 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); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified api resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @returns {string} Resource name string. + */ + apiPath(project:string,location:string,api:string) { + return this.pathTemplates.apiPathTemplate.render({ + project: project, + location: location, + api: api, + }); + } + + /** + * Parse the project from Api resource. + * + * @param {string} apiName + * A fully-qualified path representing Api resource. + * @returns {string} A string representing the project. + */ + matchProjectFromApiName(apiName: string) { + return this.pathTemplates.apiPathTemplate.match(apiName).project; + } + + /** + * Parse the location from Api resource. + * + * @param {string} apiName + * A fully-qualified path representing Api resource. + * @returns {string} A string representing the location. + */ + matchLocationFromApiName(apiName: string) { + return this.pathTemplates.apiPathTemplate.match(apiName).location; + } + + /** + * Parse the api from Api resource. + * + * @param {string} apiName + * A fully-qualified path representing Api resource. + * @returns {string} A string representing the api. + */ + matchApiFromApiName(apiName: string) { + return this.pathTemplates.apiPathTemplate.match(apiName).api; + } + + /** + * Return a fully-qualified apiHubInstance resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api_hub_instance + * @returns {string} Resource name string. + */ + apiHubInstancePath(project:string,location:string,apiHubInstance:string) { + return this.pathTemplates.apiHubInstancePathTemplate.render({ + project: project, + location: location, + api_hub_instance: apiHubInstance, + }); + } + + /** + * Parse the project from ApiHubInstance resource. + * + * @param {string} apiHubInstanceName + * A fully-qualified path representing ApiHubInstance resource. + * @returns {string} A string representing the project. + */ + matchProjectFromApiHubInstanceName(apiHubInstanceName: string) { + return this.pathTemplates.apiHubInstancePathTemplate.match(apiHubInstanceName).project; + } + + /** + * Parse the location from ApiHubInstance resource. + * + * @param {string} apiHubInstanceName + * A fully-qualified path representing ApiHubInstance resource. + * @returns {string} A string representing the location. + */ + matchLocationFromApiHubInstanceName(apiHubInstanceName: string) { + return this.pathTemplates.apiHubInstancePathTemplate.match(apiHubInstanceName).location; + } + + /** + * Parse the api_hub_instance from ApiHubInstance resource. + * + * @param {string} apiHubInstanceName + * A fully-qualified path representing ApiHubInstance resource. + * @returns {string} A string representing the api_hub_instance. + */ + matchApiHubInstanceFromApiHubInstanceName(apiHubInstanceName: string) { + return this.pathTemplates.apiHubInstancePathTemplate.match(apiHubInstanceName).api_hub_instance; + } + + /** + * Return a fully-qualified apiOperation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @param {string} version + * @param {string} operation + * @returns {string} Resource name string. + */ + apiOperationPath(project:string,location:string,api:string,version:string,operation:string) { + return this.pathTemplates.apiOperationPathTemplate.render({ + project: project, + location: location, + api: api, + version: version, + operation: operation, + }); + } + + /** + * Parse the project from ApiOperation resource. + * + * @param {string} apiOperationName + * A fully-qualified path representing ApiOperation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromApiOperationName(apiOperationName: string) { + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).project; + } + + /** + * Parse the location from ApiOperation resource. + * + * @param {string} apiOperationName + * A fully-qualified path representing ApiOperation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromApiOperationName(apiOperationName: string) { + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).location; + } + + /** + * Parse the api from ApiOperation resource. + * + * @param {string} apiOperationName + * A fully-qualified path representing ApiOperation resource. + * @returns {string} A string representing the api. + */ + matchApiFromApiOperationName(apiOperationName: string) { + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).api; + } + + /** + * Parse the version from ApiOperation resource. + * + * @param {string} apiOperationName + * A fully-qualified path representing ApiOperation resource. + * @returns {string} A string representing the version. + */ + matchVersionFromApiOperationName(apiOperationName: string) { + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).version; + } + + /** + * Parse the operation from ApiOperation resource. + * + * @param {string} apiOperationName + * A fully-qualified path representing ApiOperation resource. + * @returns {string} A string representing the operation. + */ + matchOperationFromApiOperationName(apiOperationName: string) { + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).operation; + } + + /** + * Return a fully-qualified attribute resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} attribute + * @returns {string} Resource name string. + */ + attributePath(project:string,location:string,attribute:string) { + return this.pathTemplates.attributePathTemplate.render({ + project: project, + location: location, + attribute: attribute, + }); + } + + /** + * Parse the project from Attribute resource. + * + * @param {string} attributeName + * A fully-qualified path representing Attribute resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAttributeName(attributeName: string) { + return this.pathTemplates.attributePathTemplate.match(attributeName).project; + } + + /** + * Parse the location from Attribute resource. + * + * @param {string} attributeName + * A fully-qualified path representing Attribute resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAttributeName(attributeName: string) { + return this.pathTemplates.attributePathTemplate.match(attributeName).location; + } + + /** + * Parse the attribute from Attribute resource. + * + * @param {string} attributeName + * A fully-qualified path representing Attribute resource. + * @returns {string} A string representing the attribute. + */ + matchAttributeFromAttributeName(attributeName: string) { + return this.pathTemplates.attributePathTemplate.match(attributeName).attribute; + } + + /** + * Return a fully-qualified definition resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @param {string} version + * @param {string} definition + * @returns {string} Resource name string. + */ + definitionPath(project:string,location:string,api:string,version:string,definition:string) { + return this.pathTemplates.definitionPathTemplate.render({ + project: project, + location: location, + api: api, + version: version, + definition: definition, + }); + } + + /** + * Parse the project from Definition resource. + * + * @param {string} definitionName + * A fully-qualified path representing Definition resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDefinitionName(definitionName: string) { + return this.pathTemplates.definitionPathTemplate.match(definitionName).project; + } + + /** + * Parse the location from Definition resource. + * + * @param {string} definitionName + * A fully-qualified path representing Definition resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDefinitionName(definitionName: string) { + return this.pathTemplates.definitionPathTemplate.match(definitionName).location; + } + + /** + * Parse the api from Definition resource. + * + * @param {string} definitionName + * A fully-qualified path representing Definition resource. + * @returns {string} A string representing the api. + */ + matchApiFromDefinitionName(definitionName: string) { + return this.pathTemplates.definitionPathTemplate.match(definitionName).api; + } + + /** + * Parse the version from Definition resource. + * + * @param {string} definitionName + * A fully-qualified path representing Definition resource. + * @returns {string} A string representing the version. + */ + matchVersionFromDefinitionName(definitionName: string) { + return this.pathTemplates.definitionPathTemplate.match(definitionName).version; + } + + /** + * Parse the definition from Definition resource. + * + * @param {string} definitionName + * A fully-qualified path representing Definition resource. + * @returns {string} A string representing the definition. + */ + matchDefinitionFromDefinitionName(definitionName: string) { + return this.pathTemplates.definitionPathTemplate.match(definitionName).definition; + } + + /** + * Return a fully-qualified dependency resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dependency + * @returns {string} Resource name string. + */ + dependencyPath(project:string,location:string,dependency:string) { + return this.pathTemplates.dependencyPathTemplate.render({ + project: project, + location: location, + dependency: dependency, + }); + } + + /** + * Parse the project from Dependency resource. + * + * @param {string} dependencyName + * A fully-qualified path representing Dependency resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDependencyName(dependencyName: string) { + return this.pathTemplates.dependencyPathTemplate.match(dependencyName).project; + } + + /** + * Parse the location from Dependency resource. + * + * @param {string} dependencyName + * A fully-qualified path representing Dependency resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDependencyName(dependencyName: string) { + return this.pathTemplates.dependencyPathTemplate.match(dependencyName).location; + } + + /** + * Parse the dependency from Dependency resource. + * + * @param {string} dependencyName + * A fully-qualified path representing Dependency resource. + * @returns {string} A string representing the dependency. + */ + matchDependencyFromDependencyName(dependencyName: string) { + return this.pathTemplates.dependencyPathTemplate.match(dependencyName).dependency; + } + + /** + * Return a fully-qualified deployment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} deployment + * @returns {string} Resource name string. + */ + deploymentPath(project:string,location:string,deployment:string) { + return this.pathTemplates.deploymentPathTemplate.render({ + project: project, + location: location, + deployment: deployment, + }); + } + + /** + * Parse the project from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName).project; + } + + /** + * Parse the location from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName).location; + } + + /** + * Parse the deployment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the deployment. + */ + matchDeploymentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName).deployment; + } + + /** + * Return a fully-qualified externalApi resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} external_api + * @returns {string} Resource name string. + */ + externalApiPath(project:string,location:string,externalApi:string) { + return this.pathTemplates.externalApiPathTemplate.render({ + project: project, + location: location, + external_api: externalApi, + }); + } + + /** + * Parse the project from ExternalApi resource. + * + * @param {string} externalApiName + * A fully-qualified path representing ExternalApi resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExternalApiName(externalApiName: string) { + return this.pathTemplates.externalApiPathTemplate.match(externalApiName).project; + } + + /** + * Parse the location from ExternalApi resource. + * + * @param {string} externalApiName + * A fully-qualified path representing ExternalApi resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExternalApiName(externalApiName: string) { + return this.pathTemplates.externalApiPathTemplate.match(externalApiName).location; + } + + /** + * Parse the external_api from ExternalApi resource. + * + * @param {string} externalApiName + * A fully-qualified path representing ExternalApi resource. + * @returns {string} A string representing the external_api. + */ + matchExternalApiFromExternalApiName(externalApiName: string) { + return this.pathTemplates.externalApiPathTemplate.match(externalApiName).external_api; + } + + /** + * Return a fully-qualified hostProjectRegistration resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} host_project_registration + * @returns {string} Resource name string. + */ + hostProjectRegistrationPath(project:string,location:string,hostProjectRegistration:string) { + return this.pathTemplates.hostProjectRegistrationPathTemplate.render({ + project: project, + location: location, + host_project_registration: hostProjectRegistration, + }); + } + + /** + * Parse the project from HostProjectRegistration resource. + * + * @param {string} hostProjectRegistrationName + * A fully-qualified path representing HostProjectRegistration resource. + * @returns {string} A string representing the project. + */ + matchProjectFromHostProjectRegistrationName(hostProjectRegistrationName: string) { + return this.pathTemplates.hostProjectRegistrationPathTemplate.match(hostProjectRegistrationName).project; + } + + /** + * Parse the location from HostProjectRegistration resource. + * + * @param {string} hostProjectRegistrationName + * A fully-qualified path representing HostProjectRegistration resource. + * @returns {string} A string representing the location. + */ + matchLocationFromHostProjectRegistrationName(hostProjectRegistrationName: string) { + return this.pathTemplates.hostProjectRegistrationPathTemplate.match(hostProjectRegistrationName).location; + } + + /** + * Parse the host_project_registration from HostProjectRegistration resource. + * + * @param {string} hostProjectRegistrationName + * A fully-qualified path representing HostProjectRegistration resource. + * @returns {string} A string representing the host_project_registration. + */ + matchHostProjectRegistrationFromHostProjectRegistrationName(hostProjectRegistrationName: string) { + return this.pathTemplates.hostProjectRegistrationPathTemplate.match(hostProjectRegistrationName).host_project_registration; + } + + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project:string,location:string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + + /** + * Return a fully-qualified plugin resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} plugin + * @returns {string} Resource name string. + */ + pluginPath(project:string,location:string,plugin:string) { + return this.pathTemplates.pluginPathTemplate.render({ + project: project, + location: location, + plugin: plugin, + }); + } + + /** + * Parse the project from Plugin resource. + * + * @param {string} pluginName + * A fully-qualified path representing Plugin resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPluginName(pluginName: string) { + return this.pathTemplates.pluginPathTemplate.match(pluginName).project; + } + + /** + * Parse the location from Plugin resource. + * + * @param {string} pluginName + * A fully-qualified path representing Plugin resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPluginName(pluginName: string) { + return this.pathTemplates.pluginPathTemplate.match(pluginName).location; + } + + /** + * Parse the plugin from Plugin resource. + * + * @param {string} pluginName + * A fully-qualified path representing Plugin resource. + * @returns {string} A string representing the plugin. + */ + matchPluginFromPluginName(pluginName: string) { + return this.pathTemplates.pluginPathTemplate.match(pluginName).plugin; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project:string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified runtimeProjectAttachment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} runtime_project_attachment + * @returns {string} Resource name string. + */ + runtimeProjectAttachmentPath(project:string,location:string,runtimeProjectAttachment:string) { + return this.pathTemplates.runtimeProjectAttachmentPathTemplate.render({ + project: project, + location: location, + runtime_project_attachment: runtimeProjectAttachment, + }); + } + + /** + * Parse the project from RuntimeProjectAttachment resource. + * + * @param {string} runtimeProjectAttachmentName + * A fully-qualified path representing RuntimeProjectAttachment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRuntimeProjectAttachmentName(runtimeProjectAttachmentName: string) { + return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match(runtimeProjectAttachmentName).project; + } + + /** + * Parse the location from RuntimeProjectAttachment resource. + * + * @param {string} runtimeProjectAttachmentName + * A fully-qualified path representing RuntimeProjectAttachment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRuntimeProjectAttachmentName(runtimeProjectAttachmentName: string) { + return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match(runtimeProjectAttachmentName).location; + } + + /** + * Parse the runtime_project_attachment from RuntimeProjectAttachment resource. + * + * @param {string} runtimeProjectAttachmentName + * A fully-qualified path representing RuntimeProjectAttachment resource. + * @returns {string} A string representing the runtime_project_attachment. + */ + matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName(runtimeProjectAttachmentName: string) { + return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match(runtimeProjectAttachmentName).runtime_project_attachment; + } + + /** + * Return a fully-qualified spec resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @param {string} version + * @param {string} spec + * @returns {string} Resource name string. + */ + specPath(project:string,location:string,api:string,version:string,spec:string) { + return this.pathTemplates.specPathTemplate.render({ + project: project, + location: location, + api: api, + version: version, + spec: spec, + }); + } + + /** + * Parse the project from Spec resource. + * + * @param {string} specName + * A fully-qualified path representing Spec resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSpecName(specName: string) { + return this.pathTemplates.specPathTemplate.match(specName).project; + } + + /** + * Parse the location from Spec resource. + * + * @param {string} specName + * A fully-qualified path representing Spec resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSpecName(specName: string) { + return this.pathTemplates.specPathTemplate.match(specName).location; + } + + /** + * Parse the api from Spec resource. + * + * @param {string} specName + * A fully-qualified path representing Spec resource. + * @returns {string} A string representing the api. + */ + matchApiFromSpecName(specName: string) { + return this.pathTemplates.specPathTemplate.match(specName).api; + } + + /** + * Parse the version from Spec resource. + * + * @param {string} specName + * A fully-qualified path representing Spec resource. + * @returns {string} A string representing the version. + */ + matchVersionFromSpecName(specName: string) { + return this.pathTemplates.specPathTemplate.match(specName).version; + } + + /** + * Parse the spec from Spec resource. + * + * @param {string} specName + * A fully-qualified path representing Spec resource. + * @returns {string} A string representing the spec. + */ + matchSpecFromSpecName(specName: string) { + return this.pathTemplates.specPathTemplate.match(specName).spec; + } + + /** + * Return a fully-qualified styleGuide resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} plugin + * @returns {string} Resource name string. + */ + styleGuidePath(project:string,location:string,plugin:string) { + return this.pathTemplates.styleGuidePathTemplate.render({ + project: project, + location: location, + plugin: plugin, + }); + } + + /** + * Parse the project from StyleGuide resource. + * + * @param {string} styleGuideName + * A fully-qualified path representing StyleGuide resource. + * @returns {string} A string representing the project. + */ + matchProjectFromStyleGuideName(styleGuideName: string) { + return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName).project; + } + + /** + * Parse the location from StyleGuide resource. + * + * @param {string} styleGuideName + * A fully-qualified path representing StyleGuide resource. + * @returns {string} A string representing the location. + */ + matchLocationFromStyleGuideName(styleGuideName: string) { + return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName).location; + } + + /** + * Parse the plugin from StyleGuide resource. + * + * @param {string} styleGuideName + * A fully-qualified path representing StyleGuide resource. + * @returns {string} A string representing the plugin. + */ + matchPluginFromStyleGuideName(styleGuideName: string) { + return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName).plugin; + } + + /** + * Return a fully-qualified version resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @param {string} version + * @returns {string} Resource name string. + */ + versionPath(project:string,location:string,api:string,version:string) { + return this.pathTemplates.versionPathTemplate.render({ + project: project, + location: location, + api: api, + version: version, + }); + } + + /** + * Parse the project from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the project. + */ + matchProjectFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).project; + } + + /** + * Parse the location from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the location. + */ + matchLocationFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).location; + } + + /** + * Parse the api from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the api. + */ + matchApiFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).api; + } + + /** + * Parse the version from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the version. + */ + matchVersionFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).version; + } + + /** + * 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.runtimeProjectAttachmentServiceStub && !this._terminated) { + return this.runtimeProjectAttachmentServiceStub.then(stub => { + this._terminated = true; + stub.close(); + this.locationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-cloud-apihub/v1/src/v1/runtime_project_attachment_service_client_config.json b/owl-bot-staging/google-cloud-apihub/v1/src/v1/runtime_project_attachment_service_client_config.json new file mode 100644 index 00000000000..fd774c04498 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/src/v1/runtime_project_attachment_service_client_config.json @@ -0,0 +1,63 @@ +{ + "interfaces": { + "google.cloud.apihub.v1.RuntimeProjectAttachmentService": { + "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": { + "CreateRuntimeProjectAttachment": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetRuntimeProjectAttachment": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ListRuntimeProjectAttachments": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "DeleteRuntimeProjectAttachment": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "LookupRuntimeProjectAttachment": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-apihub/v1/src/v1/runtime_project_attachment_service_proto_list.json b/owl-bot-staging/google-cloud-apihub/v1/src/v1/runtime_project_attachment_service_proto_list.json new file mode 100644 index 00000000000..07e987f7fb3 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/src/v1/runtime_project_attachment_service_proto_list.json @@ -0,0 +1,9 @@ +[ + "../../protos/google/cloud/apihub/v1/apihub_service.proto", + "../../protos/google/cloud/apihub/v1/common_fields.proto", + "../../protos/google/cloud/apihub/v1/host_project_registration_service.proto", + "../../protos/google/cloud/apihub/v1/linting_service.proto", + "../../protos/google/cloud/apihub/v1/plugin_service.proto", + "../../protos/google/cloud/apihub/v1/provisioning_service.proto", + "../../protos/google/cloud/apihub/v1/runtime_project_attachment_service.proto" +] diff --git a/owl-bot-staging/google-cloud-apihub/v1/system-test/fixtures/sample/src/index.js b/owl-bot-staging/google-cloud-apihub/v1/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000000..f0e98e48ab9 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/system-test/fixtures/sample/src/index.js @@ -0,0 +1,33 @@ +// Copyright 2024 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 apihub = require('@google-cloud/apihub'); + +function main() { + const apiHubClient = new apihub.ApiHubClient(); + const apiHubDependenciesClient = new apihub.ApiHubDependenciesClient(); + const apiHubPluginClient = new apihub.ApiHubPluginClient(); + const hostProjectRegistrationServiceClient = new apihub.HostProjectRegistrationServiceClient(); + const lintingServiceClient = new apihub.LintingServiceClient(); + const provisioningClient = new apihub.ProvisioningClient(); + const runtimeProjectAttachmentServiceClient = new apihub.RuntimeProjectAttachmentServiceClient(); +} + +main(); diff --git a/owl-bot-staging/google-cloud-apihub/v1/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/google-cloud-apihub/v1/system-test/fixtures/sample/src/index.ts new file mode 100644 index 00000000000..15cbcb831c6 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,68 @@ +// Copyright 2024 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 {ApiHubClient, ApiHubDependenciesClient, ApiHubPluginClient, HostProjectRegistrationServiceClient, LintingServiceClient, ProvisioningClient, RuntimeProjectAttachmentServiceClient} from '@google-cloud/apihub'; + +// check that the client class type name can be used +function doStuffWithApiHubClient(client: ApiHubClient) { + client.close(); +} +function doStuffWithApiHubDependenciesClient(client: ApiHubDependenciesClient) { + client.close(); +} +function doStuffWithApiHubPluginClient(client: ApiHubPluginClient) { + client.close(); +} +function doStuffWithHostProjectRegistrationServiceClient(client: HostProjectRegistrationServiceClient) { + client.close(); +} +function doStuffWithLintingServiceClient(client: LintingServiceClient) { + client.close(); +} +function doStuffWithProvisioningClient(client: ProvisioningClient) { + client.close(); +} +function doStuffWithRuntimeProjectAttachmentServiceClient(client: RuntimeProjectAttachmentServiceClient) { + client.close(); +} + +function main() { + // check that the client instance can be created + const apiHubClient = new ApiHubClient(); + doStuffWithApiHubClient(apiHubClient); + // check that the client instance can be created + const apiHubDependenciesClient = new ApiHubDependenciesClient(); + doStuffWithApiHubDependenciesClient(apiHubDependenciesClient); + // check that the client instance can be created + const apiHubPluginClient = new ApiHubPluginClient(); + doStuffWithApiHubPluginClient(apiHubPluginClient); + // check that the client instance can be created + const hostProjectRegistrationServiceClient = new HostProjectRegistrationServiceClient(); + doStuffWithHostProjectRegistrationServiceClient(hostProjectRegistrationServiceClient); + // check that the client instance can be created + const lintingServiceClient = new LintingServiceClient(); + doStuffWithLintingServiceClient(lintingServiceClient); + // check that the client instance can be created + const provisioningClient = new ProvisioningClient(); + doStuffWithProvisioningClient(provisioningClient); + // check that the client instance can be created + const runtimeProjectAttachmentServiceClient = new RuntimeProjectAttachmentServiceClient(); + doStuffWithRuntimeProjectAttachmentServiceClient(runtimeProjectAttachmentServiceClient); +} + +main(); diff --git a/owl-bot-staging/google-cloud-apihub/v1/system-test/install.ts b/owl-bot-staging/google-cloud-apihub/v1/system-test/install.ts new file mode 100644 index 00000000000..fd5bfdc71d5 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/system-test/install.ts @@ -0,0 +1,49 @@ +// Copyright 2024 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/owl-bot-staging/google-cloud-apihub/v1/test/gapic_api_hub_dependencies_v1.ts b/owl-bot-staging/google-cloud-apihub/v1/test/gapic_api_hub_dependencies_v1.ts new file mode 100644 index 00000000000..41539ec55ca --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/test/gapic_api_hub_dependencies_v1.ts @@ -0,0 +1,1879 @@ +// Copyright 2024 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 apihubdependenciesModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, 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 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.ApiHubDependenciesClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'apihub.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, "googleapis.com"); + }); + + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = apihubdependenciesModule.v1.ApiHubDependenciesClient.servicePath; + assert.strictEqual(servicePath, 'apihub.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = apihubdependenciesModule.v1.ApiHubDependenciesClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'apihub.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'apihub.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'apihub.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'apihub.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'apihub.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { new apihubdependenciesModule.v1.ApiHubDependenciesClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = apihubdependenciesModule.v1.ApiHubDependenciesClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.apiHubDependenciesStub, undefined); + await client.initialize(); + assert(client.apiHubDependenciesStub); + }); + + it('has close method for the initialized client', done => { + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.apiHubDependenciesStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.apiHubDependenciesStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + 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 apihubdependenciesModule.v1.ApiHubDependenciesClient({ + 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('createDependency', () => { + it('invokes createDependency without error', async () => { + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateDependencyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.CreateDependencyRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Dependency() + ); + client.innerApiCalls.createDependency = stubSimpleCall(expectedResponse); + const [response] = await client.createDependency(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createDependency as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createDependency as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createDependency without error using callback', async () => { + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateDependencyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.CreateDependencyRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Dependency() + ); + client.innerApiCalls.createDependency = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createDependency( + request, + (err?: Error|null, result?: protos.google.cloud.apihub.v1.IDependency|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createDependency as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createDependency as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createDependency with error', async () => { + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateDependencyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.CreateDependencyRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createDependency = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createDependency(request), expectedError); + const actualRequest = (client.innerApiCalls.createDependency as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createDependency as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createDependency with closed client', async () => { + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateDependencyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.CreateDependencyRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createDependency(request), expectedError); + }); + }); + + describe('getDependency', () => { + it('invokes getDependency without error', async () => { + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetDependencyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetDependencyRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Dependency() + ); + client.innerApiCalls.getDependency = stubSimpleCall(expectedResponse); + const [response] = await client.getDependency(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getDependency as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getDependency as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDependency without error using callback', async () => { + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetDependencyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetDependencyRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Dependency() + ); + client.innerApiCalls.getDependency = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getDependency( + request, + (err?: Error|null, result?: protos.google.cloud.apihub.v1.IDependency|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getDependency as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getDependency as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDependency with error', async () => { + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetDependencyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetDependencyRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getDependency = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getDependency(request), expectedError); + const actualRequest = (client.innerApiCalls.getDependency as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getDependency as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDependency with closed client', async () => { + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetDependencyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetDependencyRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getDependency(request), expectedError); + }); + }); + + describe('updateDependency', () => { + it('invokes updateDependency without error', async () => { + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.UpdateDependencyRequest() + ); + request.dependency ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.UpdateDependencyRequest', ['dependency', 'name']); + request.dependency.name = defaultValue1; + const expectedHeaderRequestParams = `dependency.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Dependency() + ); + client.innerApiCalls.updateDependency = stubSimpleCall(expectedResponse); + const [response] = await client.updateDependency(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateDependency as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateDependency as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDependency without error using callback', async () => { + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.UpdateDependencyRequest() + ); + request.dependency ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.UpdateDependencyRequest', ['dependency', 'name']); + request.dependency.name = defaultValue1; + const expectedHeaderRequestParams = `dependency.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Dependency() + ); + client.innerApiCalls.updateDependency = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateDependency( + request, + (err?: Error|null, result?: protos.google.cloud.apihub.v1.IDependency|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateDependency as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateDependency as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDependency with error', async () => { + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.UpdateDependencyRequest() + ); + request.dependency ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.UpdateDependencyRequest', ['dependency', 'name']); + request.dependency.name = defaultValue1; + const expectedHeaderRequestParams = `dependency.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateDependency = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateDependency(request), expectedError); + const actualRequest = (client.innerApiCalls.updateDependency as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateDependency as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDependency with closed client', async () => { + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.UpdateDependencyRequest() + ); + request.dependency ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.UpdateDependencyRequest', ['dependency', 'name']); + request.dependency.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateDependency(request), expectedError); + }); + }); + + describe('deleteDependency', () => { + it('invokes deleteDependency without error', async () => { + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DeleteDependencyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.DeleteDependencyRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteDependency = stubSimpleCall(expectedResponse); + const [response] = await client.deleteDependency(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteDependency as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteDependency as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteDependency without error using callback', async () => { + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DeleteDependencyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.DeleteDependencyRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteDependency = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteDependency( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteDependency as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteDependency as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteDependency with error', async () => { + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DeleteDependencyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.DeleteDependencyRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteDependency = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteDependency(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteDependency as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteDependency as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteDependency with closed client', async () => { + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DeleteDependencyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.DeleteDependencyRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteDependency(request), expectedError); + }); + }); + + describe('listDependencies', () => { + it('invokes listDependencies without error', async () => { + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListDependenciesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListDependenciesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.Dependency()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Dependency()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Dependency()), + ]; + client.innerApiCalls.listDependencies = stubSimpleCall(expectedResponse); + const [response] = await client.listDependencies(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listDependencies as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listDependencies as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDependencies without error using callback', async () => { + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListDependenciesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListDependenciesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.Dependency()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Dependency()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Dependency()), + ]; + client.innerApiCalls.listDependencies = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listDependencies( + request, + (err?: Error|null, result?: protos.google.cloud.apihub.v1.IDependency[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listDependencies as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listDependencies as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDependencies with error', async () => { + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListDependenciesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListDependenciesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listDependencies = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listDependencies(request), expectedError); + const actualRequest = (client.innerApiCalls.listDependencies as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listDependencies as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDependenciesStream without error', async () => { + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListDependenciesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListDependenciesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.Dependency()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Dependency()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Dependency()), + ]; + client.descriptors.page.listDependencies.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listDependenciesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.apihub.v1.Dependency[] = []; + stream.on('data', (response: protos.google.cloud.apihub.v1.Dependency) => { + 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.listDependencies.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listDependencies, request)); + assert( + (client.descriptors.page.listDependencies.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listDependenciesStream with error', async () => { + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListDependenciesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListDependenciesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listDependencies.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listDependenciesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.apihub.v1.Dependency[] = []; + stream.on('data', (response: protos.google.cloud.apihub.v1.Dependency) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listDependencies.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listDependencies, request)); + assert( + (client.descriptors.page.listDependencies.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listDependencies without error', async () => { + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListDependenciesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListDependenciesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.Dependency()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Dependency()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Dependency()), + ]; + client.descriptors.page.listDependencies.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.apihub.v1.IDependency[] = []; + const iterable = client.listDependenciesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listDependencies.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listDependencies.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listDependencies with error', async () => { + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListDependenciesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListDependenciesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listDependencies.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listDependenciesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.apihub.v1.IDependency[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listDependencies.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listDependencies.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + 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 apihubdependenciesModule.v1.ApiHubDependenciesClient({ + 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 apihubdependenciesModule.v1.ApiHubDependenciesClient({ + 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 apihubdependenciesModule.v1.ApiHubDependenciesClient({ + 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 apihubdependenciesModule.v1.ApiHubDependenciesClient({ + 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('Path templates', () => { + + describe('api', () => { + const fakePath = "/rendered/path/api"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + api: "apiValue", + }; + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.apiPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.apiPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('apiPath', () => { + const result = client.apiPath("projectValue", "locationValue", "apiValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.apiPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromApiName', () => { + const result = client.matchProjectFromApiName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.apiPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromApiName', () => { + const result = client.matchLocationFromApiName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.apiPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchApiFromApiName', () => { + const result = client.matchApiFromApiName(fakePath); + assert.strictEqual(result, "apiValue"); + assert((client.pathTemplates.apiPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('apiHubInstance', () => { + const fakePath = "/rendered/path/apiHubInstance"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + api_hub_instance: "apiHubInstanceValue", + }; + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.apiHubInstancePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.apiHubInstancePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('apiHubInstancePath', () => { + const result = client.apiHubInstancePath("projectValue", "locationValue", "apiHubInstanceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.apiHubInstancePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromApiHubInstanceName', () => { + const result = client.matchProjectFromApiHubInstanceName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromApiHubInstanceName', () => { + const result = client.matchLocationFromApiHubInstanceName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchApiHubInstanceFromApiHubInstanceName', () => { + const result = client.matchApiHubInstanceFromApiHubInstanceName(fakePath); + assert.strictEqual(result, "apiHubInstanceValue"); + assert((client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('apiOperation', () => { + const fakePath = "/rendered/path/apiOperation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + api: "apiValue", + version: "versionValue", + operation: "operationValue", + }; + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.apiOperationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.apiOperationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('apiOperationPath', () => { + const result = client.apiOperationPath("projectValue", "locationValue", "apiValue", "versionValue", "operationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.apiOperationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromApiOperationName', () => { + const result = client.matchProjectFromApiOperationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromApiOperationName', () => { + const result = client.matchLocationFromApiOperationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchApiFromApiOperationName', () => { + const result = client.matchApiFromApiOperationName(fakePath); + assert.strictEqual(result, "apiValue"); + assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchVersionFromApiOperationName', () => { + const result = client.matchVersionFromApiOperationName(fakePath); + assert.strictEqual(result, "versionValue"); + assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchOperationFromApiOperationName', () => { + const result = client.matchOperationFromApiOperationName(fakePath); + assert.strictEqual(result, "operationValue"); + assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('attribute', () => { + const fakePath = "/rendered/path/attribute"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + attribute: "attributeValue", + }; + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.attributePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.attributePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('attributePath', () => { + const result = client.attributePath("projectValue", "locationValue", "attributeValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.attributePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAttributeName', () => { + const result = client.matchProjectFromAttributeName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.attributePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAttributeName', () => { + const result = client.matchLocationFromAttributeName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.attributePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAttributeFromAttributeName', () => { + const result = client.matchAttributeFromAttributeName(fakePath); + assert.strictEqual(result, "attributeValue"); + assert((client.pathTemplates.attributePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('definition', () => { + const fakePath = "/rendered/path/definition"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + api: "apiValue", + version: "versionValue", + definition: "definitionValue", + }; + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.definitionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.definitionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('definitionPath', () => { + const result = client.definitionPath("projectValue", "locationValue", "apiValue", "versionValue", "definitionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.definitionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDefinitionName', () => { + const result = client.matchProjectFromDefinitionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDefinitionName', () => { + const result = client.matchLocationFromDefinitionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchApiFromDefinitionName', () => { + const result = client.matchApiFromDefinitionName(fakePath); + assert.strictEqual(result, "apiValue"); + assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchVersionFromDefinitionName', () => { + const result = client.matchVersionFromDefinitionName(fakePath); + assert.strictEqual(result, "versionValue"); + assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDefinitionFromDefinitionName', () => { + const result = client.matchDefinitionFromDefinitionName(fakePath); + assert.strictEqual(result, "definitionValue"); + assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dependency', () => { + const fakePath = "/rendered/path/dependency"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dependency: "dependencyValue", + }; + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dependencyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.dependencyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('dependencyPath', () => { + const result = client.dependencyPath("projectValue", "locationValue", "dependencyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.dependencyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDependencyName', () => { + const result = client.matchProjectFromDependencyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.dependencyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDependencyName', () => { + const result = client.matchLocationFromDependencyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.dependencyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDependencyFromDependencyName', () => { + const result = client.matchDependencyFromDependencyName(fakePath); + assert.strictEqual(result, "dependencyValue"); + assert((client.pathTemplates.dependencyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('deployment', () => { + const fakePath = "/rendered/path/deployment"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + deployment: "deploymentValue", + }; + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.deploymentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.deploymentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('deploymentPath', () => { + const result = client.deploymentPath("projectValue", "locationValue", "deploymentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.deploymentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDeploymentName', () => { + const result = client.matchProjectFromDeploymentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDeploymentName', () => { + const result = client.matchLocationFromDeploymentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDeploymentFromDeploymentName', () => { + const result = client.matchDeploymentFromDeploymentName(fakePath); + assert.strictEqual(result, "deploymentValue"); + assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('externalApi', () => { + const fakePath = "/rendered/path/externalApi"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + external_api: "externalApiValue", + }; + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.externalApiPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.externalApiPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('externalApiPath', () => { + const result = client.externalApiPath("projectValue", "locationValue", "externalApiValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.externalApiPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromExternalApiName', () => { + const result = client.matchProjectFromExternalApiName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.externalApiPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromExternalApiName', () => { + const result = client.matchLocationFromExternalApiName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.externalApiPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExternalApiFromExternalApiName', () => { + const result = client.matchExternalApiFromExternalApiName(fakePath); + assert.strictEqual(result, "externalApiValue"); + assert((client.pathTemplates.externalApiPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('hostProjectRegistration', () => { + const fakePath = "/rendered/path/hostProjectRegistration"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + host_project_registration: "hostProjectRegistrationValue", + }; + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.hostProjectRegistrationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.hostProjectRegistrationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('hostProjectRegistrationPath', () => { + const result = client.hostProjectRegistrationPath("projectValue", "locationValue", "hostProjectRegistrationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.hostProjectRegistrationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromHostProjectRegistrationName', () => { + const result = client.matchProjectFromHostProjectRegistrationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.hostProjectRegistrationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromHostProjectRegistrationName', () => { + const result = client.matchLocationFromHostProjectRegistrationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.hostProjectRegistrationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchHostProjectRegistrationFromHostProjectRegistrationName', () => { + const result = client.matchHostProjectRegistrationFromHostProjectRegistrationName(fakePath); + assert.strictEqual(result, "hostProjectRegistrationValue"); + assert((client.pathTemplates.hostProjectRegistrationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('location', () => { + const fakePath = "/rendered/path/location"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + }; + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.locationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.locationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath("projectValue", "locationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('plugin', () => { + const fakePath = "/rendered/path/plugin"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + plugin: "pluginValue", + }; + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.pluginPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.pluginPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('pluginPath', () => { + const result = client.pluginPath("projectValue", "locationValue", "pluginValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.pluginPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromPluginName', () => { + const result = client.matchProjectFromPluginName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.pluginPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromPluginName', () => { + const result = client.matchLocationFromPluginName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.pluginPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPluginFromPluginName', () => { + const result = client.matchPluginFromPluginName(fakePath); + assert.strictEqual(result, "pluginValue"); + assert((client.pathTemplates.pluginPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('project', () => { + const fakePath = "/rendered/path/project"; + const expectedParameters = { + project: "projectValue", + }; + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath("projectValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('runtimeProjectAttachment', () => { + const fakePath = "/rendered/path/runtimeProjectAttachment"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + runtime_project_attachment: "runtimeProjectAttachmentValue", + }; + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.runtimeProjectAttachmentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.runtimeProjectAttachmentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('runtimeProjectAttachmentPath', () => { + const result = client.runtimeProjectAttachmentPath("projectValue", "locationValue", "runtimeProjectAttachmentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromRuntimeProjectAttachmentName', () => { + const result = client.matchProjectFromRuntimeProjectAttachmentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromRuntimeProjectAttachmentName', () => { + const result = client.matchLocationFromRuntimeProjectAttachmentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName', () => { + const result = client.matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName(fakePath); + assert.strictEqual(result, "runtimeProjectAttachmentValue"); + assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('spec', () => { + const fakePath = "/rendered/path/spec"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + api: "apiValue", + version: "versionValue", + spec: "specValue", + }; + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.specPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.specPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('specPath', () => { + const result = client.specPath("projectValue", "locationValue", "apiValue", "versionValue", "specValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.specPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSpecName', () => { + const result = client.matchProjectFromSpecName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSpecName', () => { + const result = client.matchLocationFromSpecName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchApiFromSpecName', () => { + const result = client.matchApiFromSpecName(fakePath); + assert.strictEqual(result, "apiValue"); + assert((client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchVersionFromSpecName', () => { + const result = client.matchVersionFromSpecName(fakePath); + assert.strictEqual(result, "versionValue"); + assert((client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSpecFromSpecName', () => { + const result = client.matchSpecFromSpecName(fakePath); + assert.strictEqual(result, "specValue"); + assert((client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('styleGuide', () => { + const fakePath = "/rendered/path/styleGuide"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + plugin: "pluginValue", + }; + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.styleGuidePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.styleGuidePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('styleGuidePath', () => { + const result = client.styleGuidePath("projectValue", "locationValue", "pluginValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.styleGuidePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromStyleGuideName', () => { + const result = client.matchProjectFromStyleGuideName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.styleGuidePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromStyleGuideName', () => { + const result = client.matchLocationFromStyleGuideName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.styleGuidePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPluginFromStyleGuideName', () => { + const result = client.matchPluginFromStyleGuideName(fakePath); + assert.strictEqual(result, "pluginValue"); + assert((client.pathTemplates.styleGuidePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('version', () => { + const fakePath = "/rendered/path/version"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + api: "apiValue", + version: "versionValue", + }; + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.versionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.versionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('versionPath', () => { + const result = client.versionPath("projectValue", "locationValue", "apiValue", "versionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.versionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromVersionName', () => { + const result = client.matchProjectFromVersionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromVersionName', () => { + const result = client.matchLocationFromVersionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchApiFromVersionName', () => { + const result = client.matchApiFromVersionName(fakePath); + assert.strictEqual(result, "apiValue"); + assert((client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchVersionFromVersionName', () => { + const result = client.matchVersionFromVersionName(fakePath); + assert.strictEqual(result, "versionValue"); + assert((client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-apihub/v1/test/gapic_api_hub_plugin_v1.ts b/owl-bot-staging/google-cloud-apihub/v1/test/gapic_api_hub_plugin_v1.ts new file mode 100644 index 00000000000..5321fb6dc11 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/test/gapic_api_hub_plugin_v1.ts @@ -0,0 +1,1427 @@ +// Copyright 2024 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 apihubpluginModule from '../src'; + +import {protobuf, 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 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.ApiHubPluginClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new apihubpluginModule.v1.ApiHubPluginClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'apihub.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new apihubpluginModule.v1.ApiHubPluginClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, "googleapis.com"); + }); + + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = apihubpluginModule.v1.ApiHubPluginClient.servicePath; + assert.strictEqual(servicePath, 'apihub.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = apihubpluginModule.v1.ApiHubPluginClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'apihub.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new apihubpluginModule.v1.ApiHubPluginClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'apihub.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new apihubpluginModule.v1.ApiHubPluginClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'apihub.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new apihubpluginModule.v1.ApiHubPluginClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'apihub.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new apihubpluginModule.v1.ApiHubPluginClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'apihub.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { new apihubpluginModule.v1.ApiHubPluginClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = apihubpluginModule.v1.ApiHubPluginClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new apihubpluginModule.v1.ApiHubPluginClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new apihubpluginModule.v1.ApiHubPluginClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new apihubpluginModule.v1.ApiHubPluginClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.apiHubPluginStub, undefined); + await client.initialize(); + assert(client.apiHubPluginStub); + }); + + it('has close method for the initialized client', done => { + const client = new apihubpluginModule.v1.ApiHubPluginClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.apiHubPluginStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new apihubpluginModule.v1.ApiHubPluginClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.apiHubPluginStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new apihubpluginModule.v1.ApiHubPluginClient({ + 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 apihubpluginModule.v1.ApiHubPluginClient({ + 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('getPlugin', () => { + it('invokes getPlugin without error', async () => { + const client = new apihubpluginModule.v1.ApiHubPluginClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetPluginRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetPluginRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Plugin() + ); + client.innerApiCalls.getPlugin = stubSimpleCall(expectedResponse); + const [response] = await client.getPlugin(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getPlugin as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getPlugin as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getPlugin without error using callback', async () => { + const client = new apihubpluginModule.v1.ApiHubPluginClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetPluginRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetPluginRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Plugin() + ); + client.innerApiCalls.getPlugin = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getPlugin( + request, + (err?: Error|null, result?: protos.google.cloud.apihub.v1.IPlugin|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getPlugin as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getPlugin as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getPlugin with error', async () => { + const client = new apihubpluginModule.v1.ApiHubPluginClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetPluginRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetPluginRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getPlugin = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getPlugin(request), expectedError); + const actualRequest = (client.innerApiCalls.getPlugin as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getPlugin as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getPlugin with closed client', async () => { + const client = new apihubpluginModule.v1.ApiHubPluginClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetPluginRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetPluginRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getPlugin(request), expectedError); + }); + }); + + describe('enablePlugin', () => { + it('invokes enablePlugin without error', async () => { + const client = new apihubpluginModule.v1.ApiHubPluginClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.EnablePluginRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.EnablePluginRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Plugin() + ); + client.innerApiCalls.enablePlugin = stubSimpleCall(expectedResponse); + const [response] = await client.enablePlugin(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.enablePlugin as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.enablePlugin as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes enablePlugin without error using callback', async () => { + const client = new apihubpluginModule.v1.ApiHubPluginClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.EnablePluginRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.EnablePluginRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Plugin() + ); + client.innerApiCalls.enablePlugin = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.enablePlugin( + request, + (err?: Error|null, result?: protos.google.cloud.apihub.v1.IPlugin|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.enablePlugin as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.enablePlugin as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes enablePlugin with error', async () => { + const client = new apihubpluginModule.v1.ApiHubPluginClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.EnablePluginRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.EnablePluginRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.enablePlugin = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.enablePlugin(request), expectedError); + const actualRequest = (client.innerApiCalls.enablePlugin as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.enablePlugin as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes enablePlugin with closed client', async () => { + const client = new apihubpluginModule.v1.ApiHubPluginClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.EnablePluginRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.EnablePluginRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.enablePlugin(request), expectedError); + }); + }); + + describe('disablePlugin', () => { + it('invokes disablePlugin without error', async () => { + const client = new apihubpluginModule.v1.ApiHubPluginClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DisablePluginRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.DisablePluginRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Plugin() + ); + client.innerApiCalls.disablePlugin = stubSimpleCall(expectedResponse); + const [response] = await client.disablePlugin(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.disablePlugin as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.disablePlugin as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes disablePlugin without error using callback', async () => { + const client = new apihubpluginModule.v1.ApiHubPluginClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DisablePluginRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.DisablePluginRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Plugin() + ); + client.innerApiCalls.disablePlugin = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.disablePlugin( + request, + (err?: Error|null, result?: protos.google.cloud.apihub.v1.IPlugin|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.disablePlugin as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.disablePlugin as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes disablePlugin with error', async () => { + const client = new apihubpluginModule.v1.ApiHubPluginClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DisablePluginRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.DisablePluginRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.disablePlugin = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.disablePlugin(request), expectedError); + const actualRequest = (client.innerApiCalls.disablePlugin as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.disablePlugin as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes disablePlugin with closed client', async () => { + const client = new apihubpluginModule.v1.ApiHubPluginClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DisablePluginRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.DisablePluginRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.disablePlugin(request), expectedError); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new apihubpluginModule.v1.ApiHubPluginClient({ + 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 apihubpluginModule.v1.ApiHubPluginClient({ + 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 apihubpluginModule.v1.ApiHubPluginClient({ + 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 apihubpluginModule.v1.ApiHubPluginClient({ + 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 apihubpluginModule.v1.ApiHubPluginClient({ + 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('Path templates', () => { + + describe('api', () => { + const fakePath = "/rendered/path/api"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + api: "apiValue", + }; + const client = new apihubpluginModule.v1.ApiHubPluginClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.apiPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.apiPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('apiPath', () => { + const result = client.apiPath("projectValue", "locationValue", "apiValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.apiPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromApiName', () => { + const result = client.matchProjectFromApiName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.apiPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromApiName', () => { + const result = client.matchLocationFromApiName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.apiPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchApiFromApiName', () => { + const result = client.matchApiFromApiName(fakePath); + assert.strictEqual(result, "apiValue"); + assert((client.pathTemplates.apiPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('apiHubInstance', () => { + const fakePath = "/rendered/path/apiHubInstance"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + api_hub_instance: "apiHubInstanceValue", + }; + const client = new apihubpluginModule.v1.ApiHubPluginClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.apiHubInstancePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.apiHubInstancePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('apiHubInstancePath', () => { + const result = client.apiHubInstancePath("projectValue", "locationValue", "apiHubInstanceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.apiHubInstancePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromApiHubInstanceName', () => { + const result = client.matchProjectFromApiHubInstanceName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromApiHubInstanceName', () => { + const result = client.matchLocationFromApiHubInstanceName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchApiHubInstanceFromApiHubInstanceName', () => { + const result = client.matchApiHubInstanceFromApiHubInstanceName(fakePath); + assert.strictEqual(result, "apiHubInstanceValue"); + assert((client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('apiOperation', () => { + const fakePath = "/rendered/path/apiOperation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + api: "apiValue", + version: "versionValue", + operation: "operationValue", + }; + const client = new apihubpluginModule.v1.ApiHubPluginClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.apiOperationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.apiOperationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('apiOperationPath', () => { + const result = client.apiOperationPath("projectValue", "locationValue", "apiValue", "versionValue", "operationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.apiOperationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromApiOperationName', () => { + const result = client.matchProjectFromApiOperationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromApiOperationName', () => { + const result = client.matchLocationFromApiOperationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchApiFromApiOperationName', () => { + const result = client.matchApiFromApiOperationName(fakePath); + assert.strictEqual(result, "apiValue"); + assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchVersionFromApiOperationName', () => { + const result = client.matchVersionFromApiOperationName(fakePath); + assert.strictEqual(result, "versionValue"); + assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchOperationFromApiOperationName', () => { + const result = client.matchOperationFromApiOperationName(fakePath); + assert.strictEqual(result, "operationValue"); + assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('attribute', () => { + const fakePath = "/rendered/path/attribute"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + attribute: "attributeValue", + }; + const client = new apihubpluginModule.v1.ApiHubPluginClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.attributePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.attributePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('attributePath', () => { + const result = client.attributePath("projectValue", "locationValue", "attributeValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.attributePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAttributeName', () => { + const result = client.matchProjectFromAttributeName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.attributePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAttributeName', () => { + const result = client.matchLocationFromAttributeName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.attributePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAttributeFromAttributeName', () => { + const result = client.matchAttributeFromAttributeName(fakePath); + assert.strictEqual(result, "attributeValue"); + assert((client.pathTemplates.attributePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('definition', () => { + const fakePath = "/rendered/path/definition"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + api: "apiValue", + version: "versionValue", + definition: "definitionValue", + }; + const client = new apihubpluginModule.v1.ApiHubPluginClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.definitionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.definitionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('definitionPath', () => { + const result = client.definitionPath("projectValue", "locationValue", "apiValue", "versionValue", "definitionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.definitionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDefinitionName', () => { + const result = client.matchProjectFromDefinitionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDefinitionName', () => { + const result = client.matchLocationFromDefinitionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchApiFromDefinitionName', () => { + const result = client.matchApiFromDefinitionName(fakePath); + assert.strictEqual(result, "apiValue"); + assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchVersionFromDefinitionName', () => { + const result = client.matchVersionFromDefinitionName(fakePath); + assert.strictEqual(result, "versionValue"); + assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDefinitionFromDefinitionName', () => { + const result = client.matchDefinitionFromDefinitionName(fakePath); + assert.strictEqual(result, "definitionValue"); + assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dependency', () => { + const fakePath = "/rendered/path/dependency"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dependency: "dependencyValue", + }; + const client = new apihubpluginModule.v1.ApiHubPluginClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dependencyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.dependencyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('dependencyPath', () => { + const result = client.dependencyPath("projectValue", "locationValue", "dependencyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.dependencyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDependencyName', () => { + const result = client.matchProjectFromDependencyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.dependencyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDependencyName', () => { + const result = client.matchLocationFromDependencyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.dependencyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDependencyFromDependencyName', () => { + const result = client.matchDependencyFromDependencyName(fakePath); + assert.strictEqual(result, "dependencyValue"); + assert((client.pathTemplates.dependencyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('deployment', () => { + const fakePath = "/rendered/path/deployment"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + deployment: "deploymentValue", + }; + const client = new apihubpluginModule.v1.ApiHubPluginClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.deploymentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.deploymentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('deploymentPath', () => { + const result = client.deploymentPath("projectValue", "locationValue", "deploymentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.deploymentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDeploymentName', () => { + const result = client.matchProjectFromDeploymentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDeploymentName', () => { + const result = client.matchLocationFromDeploymentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDeploymentFromDeploymentName', () => { + const result = client.matchDeploymentFromDeploymentName(fakePath); + assert.strictEqual(result, "deploymentValue"); + assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('externalApi', () => { + const fakePath = "/rendered/path/externalApi"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + external_api: "externalApiValue", + }; + const client = new apihubpluginModule.v1.ApiHubPluginClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.externalApiPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.externalApiPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('externalApiPath', () => { + const result = client.externalApiPath("projectValue", "locationValue", "externalApiValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.externalApiPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromExternalApiName', () => { + const result = client.matchProjectFromExternalApiName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.externalApiPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromExternalApiName', () => { + const result = client.matchLocationFromExternalApiName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.externalApiPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExternalApiFromExternalApiName', () => { + const result = client.matchExternalApiFromExternalApiName(fakePath); + assert.strictEqual(result, "externalApiValue"); + assert((client.pathTemplates.externalApiPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('hostProjectRegistration', () => { + const fakePath = "/rendered/path/hostProjectRegistration"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + host_project_registration: "hostProjectRegistrationValue", + }; + const client = new apihubpluginModule.v1.ApiHubPluginClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.hostProjectRegistrationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.hostProjectRegistrationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('hostProjectRegistrationPath', () => { + const result = client.hostProjectRegistrationPath("projectValue", "locationValue", "hostProjectRegistrationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.hostProjectRegistrationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromHostProjectRegistrationName', () => { + const result = client.matchProjectFromHostProjectRegistrationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.hostProjectRegistrationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromHostProjectRegistrationName', () => { + const result = client.matchLocationFromHostProjectRegistrationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.hostProjectRegistrationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchHostProjectRegistrationFromHostProjectRegistrationName', () => { + const result = client.matchHostProjectRegistrationFromHostProjectRegistrationName(fakePath); + assert.strictEqual(result, "hostProjectRegistrationValue"); + assert((client.pathTemplates.hostProjectRegistrationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('plugin', () => { + const fakePath = "/rendered/path/plugin"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + plugin: "pluginValue", + }; + const client = new apihubpluginModule.v1.ApiHubPluginClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.pluginPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.pluginPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('pluginPath', () => { + const result = client.pluginPath("projectValue", "locationValue", "pluginValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.pluginPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromPluginName', () => { + const result = client.matchProjectFromPluginName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.pluginPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromPluginName', () => { + const result = client.matchLocationFromPluginName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.pluginPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPluginFromPluginName', () => { + const result = client.matchPluginFromPluginName(fakePath); + assert.strictEqual(result, "pluginValue"); + assert((client.pathTemplates.pluginPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('runtimeProjectAttachment', () => { + const fakePath = "/rendered/path/runtimeProjectAttachment"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + runtime_project_attachment: "runtimeProjectAttachmentValue", + }; + const client = new apihubpluginModule.v1.ApiHubPluginClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.runtimeProjectAttachmentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.runtimeProjectAttachmentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('runtimeProjectAttachmentPath', () => { + const result = client.runtimeProjectAttachmentPath("projectValue", "locationValue", "runtimeProjectAttachmentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromRuntimeProjectAttachmentName', () => { + const result = client.matchProjectFromRuntimeProjectAttachmentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromRuntimeProjectAttachmentName', () => { + const result = client.matchLocationFromRuntimeProjectAttachmentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName', () => { + const result = client.matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName(fakePath); + assert.strictEqual(result, "runtimeProjectAttachmentValue"); + assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('spec', () => { + const fakePath = "/rendered/path/spec"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + api: "apiValue", + version: "versionValue", + spec: "specValue", + }; + const client = new apihubpluginModule.v1.ApiHubPluginClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.specPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.specPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('specPath', () => { + const result = client.specPath("projectValue", "locationValue", "apiValue", "versionValue", "specValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.specPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSpecName', () => { + const result = client.matchProjectFromSpecName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSpecName', () => { + const result = client.matchLocationFromSpecName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchApiFromSpecName', () => { + const result = client.matchApiFromSpecName(fakePath); + assert.strictEqual(result, "apiValue"); + assert((client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchVersionFromSpecName', () => { + const result = client.matchVersionFromSpecName(fakePath); + assert.strictEqual(result, "versionValue"); + assert((client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSpecFromSpecName', () => { + const result = client.matchSpecFromSpecName(fakePath); + assert.strictEqual(result, "specValue"); + assert((client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('styleGuide', () => { + const fakePath = "/rendered/path/styleGuide"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + plugin: "pluginValue", + }; + const client = new apihubpluginModule.v1.ApiHubPluginClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.styleGuidePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.styleGuidePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('styleGuidePath', () => { + const result = client.styleGuidePath("projectValue", "locationValue", "pluginValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.styleGuidePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromStyleGuideName', () => { + const result = client.matchProjectFromStyleGuideName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.styleGuidePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromStyleGuideName', () => { + const result = client.matchLocationFromStyleGuideName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.styleGuidePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPluginFromStyleGuideName', () => { + const result = client.matchPluginFromStyleGuideName(fakePath); + assert.strictEqual(result, "pluginValue"); + assert((client.pathTemplates.styleGuidePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('version', () => { + const fakePath = "/rendered/path/version"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + api: "apiValue", + version: "versionValue", + }; + const client = new apihubpluginModule.v1.ApiHubPluginClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.versionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.versionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('versionPath', () => { + const result = client.versionPath("projectValue", "locationValue", "apiValue", "versionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.versionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromVersionName', () => { + const result = client.matchProjectFromVersionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromVersionName', () => { + const result = client.matchLocationFromVersionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchApiFromVersionName', () => { + const result = client.matchApiFromVersionName(fakePath); + assert.strictEqual(result, "apiValue"); + assert((client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchVersionFromVersionName', () => { + const result = client.matchVersionFromVersionName(fakePath); + assert.strictEqual(result, "versionValue"); + assert((client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-apihub/v1/test/gapic_api_hub_v1.ts b/owl-bot-staging/google-cloud-apihub/v1/test/gapic_api_hub_v1.ts new file mode 100644 index 00000000000..6be08b8e121 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/test/gapic_api_hub_v1.ts @@ -0,0 +1,6098 @@ +// Copyright 2024 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 apihubModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, 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 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.ApiHubClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new apihubModule.v1.ApiHubClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'apihub.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new apihubModule.v1.ApiHubClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, "googleapis.com"); + }); + + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = apihubModule.v1.ApiHubClient.servicePath; + assert.strictEqual(servicePath, 'apihub.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = apihubModule.v1.ApiHubClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'apihub.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new apihubModule.v1.ApiHubClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'apihub.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new apihubModule.v1.ApiHubClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'apihub.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new apihubModule.v1.ApiHubClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'apihub.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new apihubModule.v1.ApiHubClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'apihub.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { new apihubModule.v1.ApiHubClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = apihubModule.v1.ApiHubClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new apihubModule.v1.ApiHubClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new apihubModule.v1.ApiHubClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.apiHubStub, undefined); + await client.initialize(); + assert(client.apiHubStub); + }); + + it('has close method for the initialized client', done => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.apiHubStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.apiHubStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new apihubModule.v1.ApiHubClient({ + 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 apihubModule.v1.ApiHubClient({ + 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('createApi', () => { + it('invokes createApi without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateApiRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.CreateApiRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Api() + ); + client.innerApiCalls.createApi = stubSimpleCall(expectedResponse); + const [response] = await client.createApi(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createApi as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createApi as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createApi without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateApiRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.CreateApiRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Api() + ); + client.innerApiCalls.createApi = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createApi( + request, + (err?: Error|null, result?: protos.google.cloud.apihub.v1.IApi|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createApi as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createApi as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createApi with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateApiRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.CreateApiRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createApi = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createApi(request), expectedError); + const actualRequest = (client.innerApiCalls.createApi as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createApi as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createApi with closed client', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateApiRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.CreateApiRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createApi(request), expectedError); + }); + }); + + describe('getApi', () => { + it('invokes getApi without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetApiRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetApiRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Api() + ); + client.innerApiCalls.getApi = stubSimpleCall(expectedResponse); + const [response] = await client.getApi(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getApi as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getApi as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getApi without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetApiRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetApiRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Api() + ); + client.innerApiCalls.getApi = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getApi( + request, + (err?: Error|null, result?: protos.google.cloud.apihub.v1.IApi|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getApi as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getApi as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getApi with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetApiRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetApiRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getApi = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getApi(request), expectedError); + const actualRequest = (client.innerApiCalls.getApi as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getApi as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getApi with closed client', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetApiRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetApiRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getApi(request), expectedError); + }); + }); + + describe('updateApi', () => { + it('invokes updateApi without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.UpdateApiRequest() + ); + request.api ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.UpdateApiRequest', ['api', 'name']); + request.api.name = defaultValue1; + const expectedHeaderRequestParams = `api.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Api() + ); + client.innerApiCalls.updateApi = stubSimpleCall(expectedResponse); + const [response] = await client.updateApi(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateApi as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateApi as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateApi without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.UpdateApiRequest() + ); + request.api ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.UpdateApiRequest', ['api', 'name']); + request.api.name = defaultValue1; + const expectedHeaderRequestParams = `api.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Api() + ); + client.innerApiCalls.updateApi = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateApi( + request, + (err?: Error|null, result?: protos.google.cloud.apihub.v1.IApi|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateApi as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateApi as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateApi with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.UpdateApiRequest() + ); + request.api ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.UpdateApiRequest', ['api', 'name']); + request.api.name = defaultValue1; + const expectedHeaderRequestParams = `api.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateApi = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateApi(request), expectedError); + const actualRequest = (client.innerApiCalls.updateApi as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateApi as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateApi with closed client', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.UpdateApiRequest() + ); + request.api ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.UpdateApiRequest', ['api', 'name']); + request.api.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateApi(request), expectedError); + }); + }); + + describe('deleteApi', () => { + it('invokes deleteApi without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DeleteApiRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.DeleteApiRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteApi = stubSimpleCall(expectedResponse); + const [response] = await client.deleteApi(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteApi as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteApi as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteApi without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DeleteApiRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.DeleteApiRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteApi = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteApi( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteApi as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteApi as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteApi with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DeleteApiRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.DeleteApiRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteApi = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteApi(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteApi as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteApi as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteApi with closed client', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DeleteApiRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.DeleteApiRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteApi(request), expectedError); + }); + }); + + describe('createVersion', () => { + it('invokes createVersion without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.CreateVersionRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Version() + ); + client.innerApiCalls.createVersion = stubSimpleCall(expectedResponse); + const [response] = await client.createVersion(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createVersion without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.CreateVersionRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Version() + ); + client.innerApiCalls.createVersion = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createVersion( + request, + (err?: Error|null, result?: protos.google.cloud.apihub.v1.IVersion|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createVersion with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.CreateVersionRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createVersion = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createVersion(request), expectedError); + const actualRequest = (client.innerApiCalls.createVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createVersion with closed client', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.CreateVersionRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createVersion(request), expectedError); + }); + }); + + describe('getVersion', () => { + it('invokes getVersion without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetVersionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Version() + ); + client.innerApiCalls.getVersion = stubSimpleCall(expectedResponse); + const [response] = await client.getVersion(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getVersion without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetVersionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Version() + ); + client.innerApiCalls.getVersion = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getVersion( + request, + (err?: Error|null, result?: protos.google.cloud.apihub.v1.IVersion|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getVersion with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetVersionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getVersion = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getVersion(request), expectedError); + const actualRequest = (client.innerApiCalls.getVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getVersion with closed client', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetVersionRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getVersion(request), expectedError); + }); + }); + + describe('updateVersion', () => { + it('invokes updateVersion without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.UpdateVersionRequest() + ); + request.version ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.UpdateVersionRequest', ['version', 'name']); + request.version.name = defaultValue1; + const expectedHeaderRequestParams = `version.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Version() + ); + client.innerApiCalls.updateVersion = stubSimpleCall(expectedResponse); + const [response] = await client.updateVersion(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateVersion without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.UpdateVersionRequest() + ); + request.version ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.UpdateVersionRequest', ['version', 'name']); + request.version.name = defaultValue1; + const expectedHeaderRequestParams = `version.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Version() + ); + client.innerApiCalls.updateVersion = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateVersion( + request, + (err?: Error|null, result?: protos.google.cloud.apihub.v1.IVersion|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateVersion with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.UpdateVersionRequest() + ); + request.version ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.UpdateVersionRequest', ['version', 'name']); + request.version.name = defaultValue1; + const expectedHeaderRequestParams = `version.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateVersion = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateVersion(request), expectedError); + const actualRequest = (client.innerApiCalls.updateVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateVersion with closed client', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.UpdateVersionRequest() + ); + request.version ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.UpdateVersionRequest', ['version', 'name']); + request.version.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateVersion(request), expectedError); + }); + }); + + describe('deleteVersion', () => { + it('invokes deleteVersion without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DeleteVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.DeleteVersionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteVersion = stubSimpleCall(expectedResponse); + const [response] = await client.deleteVersion(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteVersion without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DeleteVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.DeleteVersionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteVersion = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteVersion( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteVersion with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DeleteVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.DeleteVersionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteVersion = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteVersion(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteVersion with closed client', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DeleteVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.DeleteVersionRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteVersion(request), expectedError); + }); + }); + + describe('createSpec', () => { + it('invokes createSpec without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateSpecRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.CreateSpecRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Spec() + ); + client.innerApiCalls.createSpec = stubSimpleCall(expectedResponse); + const [response] = await client.createSpec(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createSpec as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createSpec as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSpec without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateSpecRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.CreateSpecRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Spec() + ); + client.innerApiCalls.createSpec = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createSpec( + request, + (err?: Error|null, result?: protos.google.cloud.apihub.v1.ISpec|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createSpec as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createSpec as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSpec with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateSpecRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.CreateSpecRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createSpec = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createSpec(request), expectedError); + const actualRequest = (client.innerApiCalls.createSpec as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createSpec as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSpec with closed client', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateSpecRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.CreateSpecRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createSpec(request), expectedError); + }); + }); + + describe('getSpec', () => { + it('invokes getSpec without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetSpecRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetSpecRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Spec() + ); + client.innerApiCalls.getSpec = stubSimpleCall(expectedResponse); + const [response] = await client.getSpec(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getSpec as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getSpec as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSpec without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetSpecRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetSpecRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Spec() + ); + client.innerApiCalls.getSpec = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getSpec( + request, + (err?: Error|null, result?: protos.google.cloud.apihub.v1.ISpec|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getSpec as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getSpec as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSpec with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetSpecRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetSpecRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getSpec = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getSpec(request), expectedError); + const actualRequest = (client.innerApiCalls.getSpec as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getSpec as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSpec with closed client', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetSpecRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetSpecRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getSpec(request), expectedError); + }); + }); + + describe('getSpecContents', () => { + it('invokes getSpecContents without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetSpecContentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetSpecContentsRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.SpecContents() + ); + client.innerApiCalls.getSpecContents = stubSimpleCall(expectedResponse); + const [response] = await client.getSpecContents(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getSpecContents as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getSpecContents as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSpecContents without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetSpecContentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetSpecContentsRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.SpecContents() + ); + client.innerApiCalls.getSpecContents = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getSpecContents( + request, + (err?: Error|null, result?: protos.google.cloud.apihub.v1.ISpecContents|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getSpecContents as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getSpecContents as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSpecContents with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetSpecContentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetSpecContentsRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getSpecContents = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getSpecContents(request), expectedError); + const actualRequest = (client.innerApiCalls.getSpecContents as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getSpecContents as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSpecContents with closed client', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetSpecContentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetSpecContentsRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getSpecContents(request), expectedError); + }); + }); + + describe('updateSpec', () => { + it('invokes updateSpec without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.UpdateSpecRequest() + ); + request.spec ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.UpdateSpecRequest', ['spec', 'name']); + request.spec.name = defaultValue1; + const expectedHeaderRequestParams = `spec.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Spec() + ); + client.innerApiCalls.updateSpec = stubSimpleCall(expectedResponse); + const [response] = await client.updateSpec(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateSpec as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateSpec as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSpec without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.UpdateSpecRequest() + ); + request.spec ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.UpdateSpecRequest', ['spec', 'name']); + request.spec.name = defaultValue1; + const expectedHeaderRequestParams = `spec.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Spec() + ); + client.innerApiCalls.updateSpec = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateSpec( + request, + (err?: Error|null, result?: protos.google.cloud.apihub.v1.ISpec|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateSpec as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateSpec as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSpec with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.UpdateSpecRequest() + ); + request.spec ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.UpdateSpecRequest', ['spec', 'name']); + request.spec.name = defaultValue1; + const expectedHeaderRequestParams = `spec.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateSpec = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateSpec(request), expectedError); + const actualRequest = (client.innerApiCalls.updateSpec as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateSpec as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSpec with closed client', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.UpdateSpecRequest() + ); + request.spec ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.UpdateSpecRequest', ['spec', 'name']); + request.spec.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateSpec(request), expectedError); + }); + }); + + describe('deleteSpec', () => { + it('invokes deleteSpec without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DeleteSpecRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.DeleteSpecRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteSpec = stubSimpleCall(expectedResponse); + const [response] = await client.deleteSpec(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteSpec as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteSpec as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSpec without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DeleteSpecRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.DeleteSpecRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteSpec = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteSpec( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteSpec as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteSpec as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSpec with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DeleteSpecRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.DeleteSpecRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteSpec = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteSpec(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteSpec as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteSpec as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSpec with closed client', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DeleteSpecRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.DeleteSpecRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteSpec(request), expectedError); + }); + }); + + describe('getApiOperation', () => { + it('invokes getApiOperation without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetApiOperationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetApiOperationRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.ApiOperation() + ); + client.innerApiCalls.getApiOperation = stubSimpleCall(expectedResponse); + const [response] = await client.getApiOperation(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getApiOperation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getApiOperation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getApiOperation without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetApiOperationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetApiOperationRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.ApiOperation() + ); + client.innerApiCalls.getApiOperation = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getApiOperation( + request, + (err?: Error|null, result?: protos.google.cloud.apihub.v1.IApiOperation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getApiOperation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getApiOperation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getApiOperation with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetApiOperationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetApiOperationRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getApiOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getApiOperation(request), expectedError); + const actualRequest = (client.innerApiCalls.getApiOperation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getApiOperation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getApiOperation with closed client', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetApiOperationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetApiOperationRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getApiOperation(request), expectedError); + }); + }); + + describe('getDefinition', () => { + it('invokes getDefinition without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetDefinitionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetDefinitionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Definition() + ); + client.innerApiCalls.getDefinition = stubSimpleCall(expectedResponse); + const [response] = await client.getDefinition(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getDefinition as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getDefinition as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDefinition without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetDefinitionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetDefinitionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Definition() + ); + client.innerApiCalls.getDefinition = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getDefinition( + request, + (err?: Error|null, result?: protos.google.cloud.apihub.v1.IDefinition|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getDefinition as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getDefinition as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDefinition with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetDefinitionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetDefinitionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getDefinition = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getDefinition(request), expectedError); + const actualRequest = (client.innerApiCalls.getDefinition as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getDefinition as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDefinition with closed client', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetDefinitionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetDefinitionRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getDefinition(request), expectedError); + }); + }); + + describe('createDeployment', () => { + it('invokes createDeployment without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateDeploymentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.CreateDeploymentRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Deployment() + ); + client.innerApiCalls.createDeployment = stubSimpleCall(expectedResponse); + const [response] = await client.createDeployment(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createDeployment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createDeployment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createDeployment without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateDeploymentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.CreateDeploymentRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Deployment() + ); + client.innerApiCalls.createDeployment = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createDeployment( + request, + (err?: Error|null, result?: protos.google.cloud.apihub.v1.IDeployment|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createDeployment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createDeployment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createDeployment with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateDeploymentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.CreateDeploymentRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createDeployment = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createDeployment(request), expectedError); + const actualRequest = (client.innerApiCalls.createDeployment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createDeployment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createDeployment with closed client', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateDeploymentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.CreateDeploymentRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createDeployment(request), expectedError); + }); + }); + + describe('getDeployment', () => { + it('invokes getDeployment without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetDeploymentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetDeploymentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Deployment() + ); + client.innerApiCalls.getDeployment = stubSimpleCall(expectedResponse); + const [response] = await client.getDeployment(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getDeployment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getDeployment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDeployment without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetDeploymentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetDeploymentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Deployment() + ); + client.innerApiCalls.getDeployment = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getDeployment( + request, + (err?: Error|null, result?: protos.google.cloud.apihub.v1.IDeployment|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getDeployment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getDeployment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDeployment with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetDeploymentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetDeploymentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getDeployment = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getDeployment(request), expectedError); + const actualRequest = (client.innerApiCalls.getDeployment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getDeployment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDeployment with closed client', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetDeploymentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetDeploymentRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getDeployment(request), expectedError); + }); + }); + + describe('updateDeployment', () => { + it('invokes updateDeployment without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.UpdateDeploymentRequest() + ); + request.deployment ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.UpdateDeploymentRequest', ['deployment', 'name']); + request.deployment.name = defaultValue1; + const expectedHeaderRequestParams = `deployment.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Deployment() + ); + client.innerApiCalls.updateDeployment = stubSimpleCall(expectedResponse); + const [response] = await client.updateDeployment(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateDeployment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateDeployment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDeployment without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.UpdateDeploymentRequest() + ); + request.deployment ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.UpdateDeploymentRequest', ['deployment', 'name']); + request.deployment.name = defaultValue1; + const expectedHeaderRequestParams = `deployment.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Deployment() + ); + client.innerApiCalls.updateDeployment = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateDeployment( + request, + (err?: Error|null, result?: protos.google.cloud.apihub.v1.IDeployment|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateDeployment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateDeployment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDeployment with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.UpdateDeploymentRequest() + ); + request.deployment ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.UpdateDeploymentRequest', ['deployment', 'name']); + request.deployment.name = defaultValue1; + const expectedHeaderRequestParams = `deployment.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateDeployment = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateDeployment(request), expectedError); + const actualRequest = (client.innerApiCalls.updateDeployment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateDeployment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDeployment with closed client', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.UpdateDeploymentRequest() + ); + request.deployment ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.UpdateDeploymentRequest', ['deployment', 'name']); + request.deployment.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateDeployment(request), expectedError); + }); + }); + + describe('deleteDeployment', () => { + it('invokes deleteDeployment without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DeleteDeploymentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.DeleteDeploymentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteDeployment = stubSimpleCall(expectedResponse); + const [response] = await client.deleteDeployment(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteDeployment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteDeployment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteDeployment without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DeleteDeploymentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.DeleteDeploymentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteDeployment = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteDeployment( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteDeployment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteDeployment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteDeployment with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DeleteDeploymentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.DeleteDeploymentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteDeployment = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteDeployment(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteDeployment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteDeployment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteDeployment with closed client', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DeleteDeploymentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.DeleteDeploymentRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteDeployment(request), expectedError); + }); + }); + + describe('createAttribute', () => { + it('invokes createAttribute without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateAttributeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.CreateAttributeRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Attribute() + ); + client.innerApiCalls.createAttribute = stubSimpleCall(expectedResponse); + const [response] = await client.createAttribute(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createAttribute as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createAttribute as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createAttribute without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateAttributeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.CreateAttributeRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Attribute() + ); + client.innerApiCalls.createAttribute = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createAttribute( + request, + (err?: Error|null, result?: protos.google.cloud.apihub.v1.IAttribute|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createAttribute as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createAttribute as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createAttribute with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateAttributeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.CreateAttributeRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createAttribute = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createAttribute(request), expectedError); + const actualRequest = (client.innerApiCalls.createAttribute as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createAttribute as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createAttribute with closed client', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateAttributeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.CreateAttributeRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createAttribute(request), expectedError); + }); + }); + + describe('getAttribute', () => { + it('invokes getAttribute without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetAttributeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetAttributeRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Attribute() + ); + client.innerApiCalls.getAttribute = stubSimpleCall(expectedResponse); + const [response] = await client.getAttribute(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getAttribute as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getAttribute as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAttribute without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetAttributeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetAttributeRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Attribute() + ); + client.innerApiCalls.getAttribute = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getAttribute( + request, + (err?: Error|null, result?: protos.google.cloud.apihub.v1.IAttribute|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getAttribute as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getAttribute as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAttribute with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetAttributeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetAttributeRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getAttribute = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getAttribute(request), expectedError); + const actualRequest = (client.innerApiCalls.getAttribute as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getAttribute as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAttribute with closed client', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetAttributeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetAttributeRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getAttribute(request), expectedError); + }); + }); + + describe('updateAttribute', () => { + it('invokes updateAttribute without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.UpdateAttributeRequest() + ); + request.attribute ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.UpdateAttributeRequest', ['attribute', 'name']); + request.attribute.name = defaultValue1; + const expectedHeaderRequestParams = `attribute.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Attribute() + ); + client.innerApiCalls.updateAttribute = stubSimpleCall(expectedResponse); + const [response] = await client.updateAttribute(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateAttribute as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateAttribute as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateAttribute without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.UpdateAttributeRequest() + ); + request.attribute ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.UpdateAttributeRequest', ['attribute', 'name']); + request.attribute.name = defaultValue1; + const expectedHeaderRequestParams = `attribute.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Attribute() + ); + client.innerApiCalls.updateAttribute = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateAttribute( + request, + (err?: Error|null, result?: protos.google.cloud.apihub.v1.IAttribute|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateAttribute as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateAttribute as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateAttribute with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.UpdateAttributeRequest() + ); + request.attribute ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.UpdateAttributeRequest', ['attribute', 'name']); + request.attribute.name = defaultValue1; + const expectedHeaderRequestParams = `attribute.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateAttribute = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateAttribute(request), expectedError); + const actualRequest = (client.innerApiCalls.updateAttribute as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateAttribute as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateAttribute with closed client', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.UpdateAttributeRequest() + ); + request.attribute ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.UpdateAttributeRequest', ['attribute', 'name']); + request.attribute.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateAttribute(request), expectedError); + }); + }); + + describe('deleteAttribute', () => { + it('invokes deleteAttribute without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DeleteAttributeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.DeleteAttributeRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteAttribute = stubSimpleCall(expectedResponse); + const [response] = await client.deleteAttribute(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteAttribute as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteAttribute as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteAttribute without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DeleteAttributeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.DeleteAttributeRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteAttribute = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteAttribute( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteAttribute as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteAttribute as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteAttribute with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DeleteAttributeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.DeleteAttributeRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteAttribute = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteAttribute(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteAttribute as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteAttribute as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteAttribute with closed client', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DeleteAttributeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.DeleteAttributeRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteAttribute(request), expectedError); + }); + }); + + describe('createExternalApi', () => { + it('invokes createExternalApi without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateExternalApiRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.CreateExternalApiRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.ExternalApi() + ); + client.innerApiCalls.createExternalApi = stubSimpleCall(expectedResponse); + const [response] = await client.createExternalApi(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createExternalApi as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createExternalApi as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createExternalApi without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateExternalApiRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.CreateExternalApiRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.ExternalApi() + ); + client.innerApiCalls.createExternalApi = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createExternalApi( + request, + (err?: Error|null, result?: protos.google.cloud.apihub.v1.IExternalApi|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createExternalApi as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createExternalApi as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createExternalApi with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateExternalApiRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.CreateExternalApiRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createExternalApi = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createExternalApi(request), expectedError); + const actualRequest = (client.innerApiCalls.createExternalApi as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createExternalApi as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createExternalApi with closed client', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateExternalApiRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.CreateExternalApiRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createExternalApi(request), expectedError); + }); + }); + + describe('getExternalApi', () => { + it('invokes getExternalApi without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetExternalApiRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetExternalApiRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.ExternalApi() + ); + client.innerApiCalls.getExternalApi = stubSimpleCall(expectedResponse); + const [response] = await client.getExternalApi(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getExternalApi as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getExternalApi as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getExternalApi without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetExternalApiRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetExternalApiRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.ExternalApi() + ); + client.innerApiCalls.getExternalApi = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getExternalApi( + request, + (err?: Error|null, result?: protos.google.cloud.apihub.v1.IExternalApi|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getExternalApi as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getExternalApi as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getExternalApi with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetExternalApiRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetExternalApiRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getExternalApi = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getExternalApi(request), expectedError); + const actualRequest = (client.innerApiCalls.getExternalApi as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getExternalApi as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getExternalApi with closed client', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetExternalApiRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetExternalApiRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getExternalApi(request), expectedError); + }); + }); + + describe('updateExternalApi', () => { + it('invokes updateExternalApi without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.UpdateExternalApiRequest() + ); + request.externalApi ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.UpdateExternalApiRequest', ['externalApi', 'name']); + request.externalApi.name = defaultValue1; + const expectedHeaderRequestParams = `external_api.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.ExternalApi() + ); + client.innerApiCalls.updateExternalApi = stubSimpleCall(expectedResponse); + const [response] = await client.updateExternalApi(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateExternalApi as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateExternalApi as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateExternalApi without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.UpdateExternalApiRequest() + ); + request.externalApi ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.UpdateExternalApiRequest', ['externalApi', 'name']); + request.externalApi.name = defaultValue1; + const expectedHeaderRequestParams = `external_api.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.ExternalApi() + ); + client.innerApiCalls.updateExternalApi = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateExternalApi( + request, + (err?: Error|null, result?: protos.google.cloud.apihub.v1.IExternalApi|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateExternalApi as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateExternalApi as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateExternalApi with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.UpdateExternalApiRequest() + ); + request.externalApi ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.UpdateExternalApiRequest', ['externalApi', 'name']); + request.externalApi.name = defaultValue1; + const expectedHeaderRequestParams = `external_api.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateExternalApi = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateExternalApi(request), expectedError); + const actualRequest = (client.innerApiCalls.updateExternalApi as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateExternalApi as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateExternalApi with closed client', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.UpdateExternalApiRequest() + ); + request.externalApi ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.UpdateExternalApiRequest', ['externalApi', 'name']); + request.externalApi.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateExternalApi(request), expectedError); + }); + }); + + describe('deleteExternalApi', () => { + it('invokes deleteExternalApi without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DeleteExternalApiRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.DeleteExternalApiRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteExternalApi = stubSimpleCall(expectedResponse); + const [response] = await client.deleteExternalApi(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteExternalApi as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteExternalApi as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteExternalApi without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DeleteExternalApiRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.DeleteExternalApiRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteExternalApi = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteExternalApi( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteExternalApi as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteExternalApi as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteExternalApi with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DeleteExternalApiRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.DeleteExternalApiRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteExternalApi = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteExternalApi(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteExternalApi as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteExternalApi as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteExternalApi with closed client', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DeleteExternalApiRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.DeleteExternalApiRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteExternalApi(request), expectedError); + }); + }); + + describe('listApis', () => { + it('invokes listApis without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListApisRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListApisRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.Api()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Api()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Api()), + ]; + client.innerApiCalls.listApis = stubSimpleCall(expectedResponse); + const [response] = await client.listApis(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listApis as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listApis as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listApis without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListApisRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListApisRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.Api()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Api()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Api()), + ]; + client.innerApiCalls.listApis = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listApis( + request, + (err?: Error|null, result?: protos.google.cloud.apihub.v1.IApi[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listApis as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listApis as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listApis with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListApisRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListApisRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listApis = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listApis(request), expectedError); + const actualRequest = (client.innerApiCalls.listApis as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listApis as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listApisStream without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListApisRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListApisRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.Api()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Api()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Api()), + ]; + client.descriptors.page.listApis.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listApisStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.apihub.v1.Api[] = []; + stream.on('data', (response: protos.google.cloud.apihub.v1.Api) => { + 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.listApis.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listApis, request)); + assert( + (client.descriptors.page.listApis.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listApisStream with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListApisRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListApisRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listApis.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listApisStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.apihub.v1.Api[] = []; + stream.on('data', (response: protos.google.cloud.apihub.v1.Api) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listApis.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listApis, request)); + assert( + (client.descriptors.page.listApis.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listApis without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListApisRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListApisRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.Api()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Api()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Api()), + ]; + client.descriptors.page.listApis.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.apihub.v1.IApi[] = []; + const iterable = client.listApisAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listApis.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listApis.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listApis with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListApisRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListApisRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listApis.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listApisAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.apihub.v1.IApi[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listApis.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listApis.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listVersions', () => { + it('invokes listVersions without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListVersionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListVersionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.Version()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Version()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Version()), + ]; + client.innerApiCalls.listVersions = stubSimpleCall(expectedResponse); + const [response] = await client.listVersions(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listVersions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listVersions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listVersions without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListVersionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListVersionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.Version()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Version()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Version()), + ]; + client.innerApiCalls.listVersions = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listVersions( + request, + (err?: Error|null, result?: protos.google.cloud.apihub.v1.IVersion[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listVersions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listVersions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listVersions with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListVersionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListVersionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listVersions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listVersions(request), expectedError); + const actualRequest = (client.innerApiCalls.listVersions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listVersions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listVersionsStream without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListVersionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListVersionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.Version()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Version()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Version()), + ]; + client.descriptors.page.listVersions.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listVersionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.apihub.v1.Version[] = []; + stream.on('data', (response: protos.google.cloud.apihub.v1.Version) => { + 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.listVersions.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listVersions, request)); + assert( + (client.descriptors.page.listVersions.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listVersionsStream with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListVersionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListVersionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listVersions.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listVersionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.apihub.v1.Version[] = []; + stream.on('data', (response: protos.google.cloud.apihub.v1.Version) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listVersions.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listVersions, request)); + assert( + (client.descriptors.page.listVersions.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listVersions without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListVersionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListVersionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.Version()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Version()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Version()), + ]; + client.descriptors.page.listVersions.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.apihub.v1.IVersion[] = []; + const iterable = client.listVersionsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listVersions.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listVersions.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listVersions with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListVersionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListVersionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listVersions.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listVersionsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.apihub.v1.IVersion[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listVersions.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listVersions.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listSpecs', () => { + it('invokes listSpecs without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListSpecsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListSpecsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.Spec()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Spec()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Spec()), + ]; + client.innerApiCalls.listSpecs = stubSimpleCall(expectedResponse); + const [response] = await client.listSpecs(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listSpecs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listSpecs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSpecs without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListSpecsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListSpecsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.Spec()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Spec()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Spec()), + ]; + client.innerApiCalls.listSpecs = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listSpecs( + request, + (err?: Error|null, result?: protos.google.cloud.apihub.v1.ISpec[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listSpecs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listSpecs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSpecs with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListSpecsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListSpecsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listSpecs = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listSpecs(request), expectedError); + const actualRequest = (client.innerApiCalls.listSpecs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listSpecs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSpecsStream without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListSpecsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListSpecsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.Spec()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Spec()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Spec()), + ]; + client.descriptors.page.listSpecs.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listSpecsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.apihub.v1.Spec[] = []; + stream.on('data', (response: protos.google.cloud.apihub.v1.Spec) => { + 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.listSpecs.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listSpecs, request)); + assert( + (client.descriptors.page.listSpecs.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listSpecsStream with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListSpecsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListSpecsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listSpecs.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listSpecsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.apihub.v1.Spec[] = []; + stream.on('data', (response: protos.google.cloud.apihub.v1.Spec) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listSpecs.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listSpecs, request)); + assert( + (client.descriptors.page.listSpecs.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listSpecs without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListSpecsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListSpecsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.Spec()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Spec()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Spec()), + ]; + client.descriptors.page.listSpecs.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.apihub.v1.ISpec[] = []; + const iterable = client.listSpecsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listSpecs.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listSpecs.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listSpecs with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListSpecsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListSpecsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listSpecs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listSpecsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.apihub.v1.ISpec[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listSpecs.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listSpecs.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listApiOperations', () => { + it('invokes listApiOperations without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListApiOperationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListApiOperationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.ApiOperation()), + generateSampleMessage(new protos.google.cloud.apihub.v1.ApiOperation()), + generateSampleMessage(new protos.google.cloud.apihub.v1.ApiOperation()), + ]; + client.innerApiCalls.listApiOperations = stubSimpleCall(expectedResponse); + const [response] = await client.listApiOperations(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listApiOperations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listApiOperations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listApiOperations without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListApiOperationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListApiOperationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.ApiOperation()), + generateSampleMessage(new protos.google.cloud.apihub.v1.ApiOperation()), + generateSampleMessage(new protos.google.cloud.apihub.v1.ApiOperation()), + ]; + client.innerApiCalls.listApiOperations = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listApiOperations( + request, + (err?: Error|null, result?: protos.google.cloud.apihub.v1.IApiOperation[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listApiOperations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listApiOperations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listApiOperations with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListApiOperationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListApiOperationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listApiOperations = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listApiOperations(request), expectedError); + const actualRequest = (client.innerApiCalls.listApiOperations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listApiOperations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listApiOperationsStream without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListApiOperationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListApiOperationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.ApiOperation()), + generateSampleMessage(new protos.google.cloud.apihub.v1.ApiOperation()), + generateSampleMessage(new protos.google.cloud.apihub.v1.ApiOperation()), + ]; + client.descriptors.page.listApiOperations.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listApiOperationsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.apihub.v1.ApiOperation[] = []; + stream.on('data', (response: protos.google.cloud.apihub.v1.ApiOperation) => { + 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.listApiOperations.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listApiOperations, request)); + assert( + (client.descriptors.page.listApiOperations.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listApiOperationsStream with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListApiOperationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListApiOperationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listApiOperations.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listApiOperationsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.apihub.v1.ApiOperation[] = []; + stream.on('data', (response: protos.google.cloud.apihub.v1.ApiOperation) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listApiOperations.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listApiOperations, request)); + assert( + (client.descriptors.page.listApiOperations.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listApiOperations without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListApiOperationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListApiOperationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.ApiOperation()), + generateSampleMessage(new protos.google.cloud.apihub.v1.ApiOperation()), + generateSampleMessage(new protos.google.cloud.apihub.v1.ApiOperation()), + ]; + client.descriptors.page.listApiOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.apihub.v1.IApiOperation[] = []; + const iterable = client.listApiOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listApiOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listApiOperations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listApiOperations with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListApiOperationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListApiOperationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listApiOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listApiOperationsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.apihub.v1.IApiOperation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listApiOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listApiOperations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listDeployments', () => { + it('invokes listDeployments without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListDeploymentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListDeploymentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.Deployment()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Deployment()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Deployment()), + ]; + client.innerApiCalls.listDeployments = stubSimpleCall(expectedResponse); + const [response] = await client.listDeployments(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listDeployments as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listDeployments as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDeployments without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListDeploymentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListDeploymentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.Deployment()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Deployment()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Deployment()), + ]; + client.innerApiCalls.listDeployments = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listDeployments( + request, + (err?: Error|null, result?: protos.google.cloud.apihub.v1.IDeployment[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listDeployments as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listDeployments as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDeployments with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListDeploymentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListDeploymentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listDeployments = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listDeployments(request), expectedError); + const actualRequest = (client.innerApiCalls.listDeployments as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listDeployments as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDeploymentsStream without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListDeploymentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListDeploymentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.Deployment()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Deployment()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Deployment()), + ]; + client.descriptors.page.listDeployments.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listDeploymentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.apihub.v1.Deployment[] = []; + stream.on('data', (response: protos.google.cloud.apihub.v1.Deployment) => { + 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.listDeployments.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listDeployments, request)); + assert( + (client.descriptors.page.listDeployments.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listDeploymentsStream with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListDeploymentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListDeploymentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listDeployments.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listDeploymentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.apihub.v1.Deployment[] = []; + stream.on('data', (response: protos.google.cloud.apihub.v1.Deployment) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listDeployments.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listDeployments, request)); + assert( + (client.descriptors.page.listDeployments.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listDeployments without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListDeploymentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListDeploymentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.Deployment()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Deployment()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Deployment()), + ]; + client.descriptors.page.listDeployments.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.apihub.v1.IDeployment[] = []; + const iterable = client.listDeploymentsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listDeployments.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listDeployments.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listDeployments with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListDeploymentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListDeploymentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listDeployments.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listDeploymentsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.apihub.v1.IDeployment[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listDeployments.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listDeployments.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listAttributes', () => { + it('invokes listAttributes without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListAttributesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListAttributesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.Attribute()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Attribute()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Attribute()), + ]; + client.innerApiCalls.listAttributes = stubSimpleCall(expectedResponse); + const [response] = await client.listAttributes(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listAttributes as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listAttributes as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAttributes without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListAttributesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListAttributesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.Attribute()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Attribute()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Attribute()), + ]; + client.innerApiCalls.listAttributes = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listAttributes( + request, + (err?: Error|null, result?: protos.google.cloud.apihub.v1.IAttribute[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listAttributes as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listAttributes as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAttributes with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListAttributesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListAttributesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listAttributes = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listAttributes(request), expectedError); + const actualRequest = (client.innerApiCalls.listAttributes as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listAttributes as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAttributesStream without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListAttributesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListAttributesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.Attribute()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Attribute()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Attribute()), + ]; + client.descriptors.page.listAttributes.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listAttributesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.apihub.v1.Attribute[] = []; + stream.on('data', (response: protos.google.cloud.apihub.v1.Attribute) => { + 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.listAttributes.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listAttributes, request)); + assert( + (client.descriptors.page.listAttributes.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listAttributesStream with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListAttributesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListAttributesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listAttributes.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listAttributesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.apihub.v1.Attribute[] = []; + stream.on('data', (response: protos.google.cloud.apihub.v1.Attribute) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listAttributes.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listAttributes, request)); + assert( + (client.descriptors.page.listAttributes.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listAttributes without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListAttributesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListAttributesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.Attribute()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Attribute()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Attribute()), + ]; + client.descriptors.page.listAttributes.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.apihub.v1.IAttribute[] = []; + const iterable = client.listAttributesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listAttributes.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listAttributes.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listAttributes with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListAttributesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListAttributesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listAttributes.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listAttributesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.apihub.v1.IAttribute[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listAttributes.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listAttributes.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('searchResources', () => { + it('invokes searchResources without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.SearchResourcesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.SearchResourcesRequest', ['location']); + request.location = defaultValue1; + const expectedHeaderRequestParams = `location=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.SearchResult()), + generateSampleMessage(new protos.google.cloud.apihub.v1.SearchResult()), + generateSampleMessage(new protos.google.cloud.apihub.v1.SearchResult()), + ]; + client.innerApiCalls.searchResources = stubSimpleCall(expectedResponse); + const [response] = await client.searchResources(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.searchResources as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.searchResources as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes searchResources without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.SearchResourcesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.SearchResourcesRequest', ['location']); + request.location = defaultValue1; + const expectedHeaderRequestParams = `location=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.SearchResult()), + generateSampleMessage(new protos.google.cloud.apihub.v1.SearchResult()), + generateSampleMessage(new protos.google.cloud.apihub.v1.SearchResult()), + ]; + client.innerApiCalls.searchResources = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.searchResources( + request, + (err?: Error|null, result?: protos.google.cloud.apihub.v1.ISearchResult[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.searchResources as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.searchResources as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes searchResources with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.SearchResourcesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.SearchResourcesRequest', ['location']); + request.location = defaultValue1; + const expectedHeaderRequestParams = `location=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.searchResources = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.searchResources(request), expectedError); + const actualRequest = (client.innerApiCalls.searchResources as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.searchResources as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes searchResourcesStream without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.SearchResourcesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.SearchResourcesRequest', ['location']); + request.location = defaultValue1; + const expectedHeaderRequestParams = `location=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.SearchResult()), + generateSampleMessage(new protos.google.cloud.apihub.v1.SearchResult()), + generateSampleMessage(new protos.google.cloud.apihub.v1.SearchResult()), + ]; + client.descriptors.page.searchResources.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.searchResourcesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.apihub.v1.SearchResult[] = []; + stream.on('data', (response: protos.google.cloud.apihub.v1.SearchResult) => { + 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.searchResources.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.searchResources, request)); + assert( + (client.descriptors.page.searchResources.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes searchResourcesStream with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.SearchResourcesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.SearchResourcesRequest', ['location']); + request.location = defaultValue1; + const expectedHeaderRequestParams = `location=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.searchResources.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.searchResourcesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.apihub.v1.SearchResult[] = []; + stream.on('data', (response: protos.google.cloud.apihub.v1.SearchResult) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.searchResources.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.searchResources, request)); + assert( + (client.descriptors.page.searchResources.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with searchResources without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.SearchResourcesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.SearchResourcesRequest', ['location']); + request.location = defaultValue1; + const expectedHeaderRequestParams = `location=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.SearchResult()), + generateSampleMessage(new protos.google.cloud.apihub.v1.SearchResult()), + generateSampleMessage(new protos.google.cloud.apihub.v1.SearchResult()), + ]; + client.descriptors.page.searchResources.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.apihub.v1.ISearchResult[] = []; + const iterable = client.searchResourcesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.searchResources.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.searchResources.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with searchResources with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.SearchResourcesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.SearchResourcesRequest', ['location']); + request.location = defaultValue1; + const expectedHeaderRequestParams = `location=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.searchResources.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.searchResourcesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.apihub.v1.ISearchResult[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.searchResources.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.searchResources.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listExternalApis', () => { + it('invokes listExternalApis without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListExternalApisRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListExternalApisRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.ExternalApi()), + generateSampleMessage(new protos.google.cloud.apihub.v1.ExternalApi()), + generateSampleMessage(new protos.google.cloud.apihub.v1.ExternalApi()), + ]; + client.innerApiCalls.listExternalApis = stubSimpleCall(expectedResponse); + const [response] = await client.listExternalApis(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listExternalApis as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listExternalApis as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listExternalApis without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListExternalApisRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListExternalApisRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.ExternalApi()), + generateSampleMessage(new protos.google.cloud.apihub.v1.ExternalApi()), + generateSampleMessage(new protos.google.cloud.apihub.v1.ExternalApi()), + ]; + client.innerApiCalls.listExternalApis = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listExternalApis( + request, + (err?: Error|null, result?: protos.google.cloud.apihub.v1.IExternalApi[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listExternalApis as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listExternalApis as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listExternalApis with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListExternalApisRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListExternalApisRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listExternalApis = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listExternalApis(request), expectedError); + const actualRequest = (client.innerApiCalls.listExternalApis as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listExternalApis as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listExternalApisStream without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListExternalApisRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListExternalApisRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.ExternalApi()), + generateSampleMessage(new protos.google.cloud.apihub.v1.ExternalApi()), + generateSampleMessage(new protos.google.cloud.apihub.v1.ExternalApi()), + ]; + client.descriptors.page.listExternalApis.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listExternalApisStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.apihub.v1.ExternalApi[] = []; + stream.on('data', (response: protos.google.cloud.apihub.v1.ExternalApi) => { + 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.listExternalApis.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listExternalApis, request)); + assert( + (client.descriptors.page.listExternalApis.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listExternalApisStream with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListExternalApisRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListExternalApisRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listExternalApis.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listExternalApisStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.apihub.v1.ExternalApi[] = []; + stream.on('data', (response: protos.google.cloud.apihub.v1.ExternalApi) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listExternalApis.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listExternalApis, request)); + assert( + (client.descriptors.page.listExternalApis.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listExternalApis without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListExternalApisRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListExternalApisRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.ExternalApi()), + generateSampleMessage(new protos.google.cloud.apihub.v1.ExternalApi()), + generateSampleMessage(new protos.google.cloud.apihub.v1.ExternalApi()), + ]; + client.descriptors.page.listExternalApis.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.apihub.v1.IExternalApi[] = []; + const iterable = client.listExternalApisAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listExternalApis.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listExternalApis.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listExternalApis with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListExternalApisRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListExternalApisRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listExternalApis.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listExternalApisAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.apihub.v1.IExternalApi[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listExternalApis.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listExternalApis.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + 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 apihubModule.v1.ApiHubClient({ + 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 apihubModule.v1.ApiHubClient({ + 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 apihubModule.v1.ApiHubClient({ + 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 apihubModule.v1.ApiHubClient({ + 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('Path templates', () => { + + describe('api', () => { + const fakePath = "/rendered/path/api"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + api: "apiValue", + }; + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.apiPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.apiPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('apiPath', () => { + const result = client.apiPath("projectValue", "locationValue", "apiValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.apiPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromApiName', () => { + const result = client.matchProjectFromApiName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.apiPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromApiName', () => { + const result = client.matchLocationFromApiName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.apiPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchApiFromApiName', () => { + const result = client.matchApiFromApiName(fakePath); + assert.strictEqual(result, "apiValue"); + assert((client.pathTemplates.apiPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('apiHubInstance', () => { + const fakePath = "/rendered/path/apiHubInstance"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + api_hub_instance: "apiHubInstanceValue", + }; + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.apiHubInstancePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.apiHubInstancePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('apiHubInstancePath', () => { + const result = client.apiHubInstancePath("projectValue", "locationValue", "apiHubInstanceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.apiHubInstancePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromApiHubInstanceName', () => { + const result = client.matchProjectFromApiHubInstanceName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromApiHubInstanceName', () => { + const result = client.matchLocationFromApiHubInstanceName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchApiHubInstanceFromApiHubInstanceName', () => { + const result = client.matchApiHubInstanceFromApiHubInstanceName(fakePath); + assert.strictEqual(result, "apiHubInstanceValue"); + assert((client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('apiOperation', () => { + const fakePath = "/rendered/path/apiOperation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + api: "apiValue", + version: "versionValue", + operation: "operationValue", + }; + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.apiOperationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.apiOperationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('apiOperationPath', () => { + const result = client.apiOperationPath("projectValue", "locationValue", "apiValue", "versionValue", "operationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.apiOperationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromApiOperationName', () => { + const result = client.matchProjectFromApiOperationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromApiOperationName', () => { + const result = client.matchLocationFromApiOperationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchApiFromApiOperationName', () => { + const result = client.matchApiFromApiOperationName(fakePath); + assert.strictEqual(result, "apiValue"); + assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchVersionFromApiOperationName', () => { + const result = client.matchVersionFromApiOperationName(fakePath); + assert.strictEqual(result, "versionValue"); + assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchOperationFromApiOperationName', () => { + const result = client.matchOperationFromApiOperationName(fakePath); + assert.strictEqual(result, "operationValue"); + assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('attribute', () => { + const fakePath = "/rendered/path/attribute"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + attribute: "attributeValue", + }; + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.attributePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.attributePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('attributePath', () => { + const result = client.attributePath("projectValue", "locationValue", "attributeValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.attributePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAttributeName', () => { + const result = client.matchProjectFromAttributeName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.attributePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAttributeName', () => { + const result = client.matchLocationFromAttributeName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.attributePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAttributeFromAttributeName', () => { + const result = client.matchAttributeFromAttributeName(fakePath); + assert.strictEqual(result, "attributeValue"); + assert((client.pathTemplates.attributePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('definition', () => { + const fakePath = "/rendered/path/definition"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + api: "apiValue", + version: "versionValue", + definition: "definitionValue", + }; + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.definitionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.definitionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('definitionPath', () => { + const result = client.definitionPath("projectValue", "locationValue", "apiValue", "versionValue", "definitionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.definitionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDefinitionName', () => { + const result = client.matchProjectFromDefinitionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDefinitionName', () => { + const result = client.matchLocationFromDefinitionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchApiFromDefinitionName', () => { + const result = client.matchApiFromDefinitionName(fakePath); + assert.strictEqual(result, "apiValue"); + assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchVersionFromDefinitionName', () => { + const result = client.matchVersionFromDefinitionName(fakePath); + assert.strictEqual(result, "versionValue"); + assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDefinitionFromDefinitionName', () => { + const result = client.matchDefinitionFromDefinitionName(fakePath); + assert.strictEqual(result, "definitionValue"); + assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dependency', () => { + const fakePath = "/rendered/path/dependency"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dependency: "dependencyValue", + }; + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dependencyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.dependencyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('dependencyPath', () => { + const result = client.dependencyPath("projectValue", "locationValue", "dependencyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.dependencyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDependencyName', () => { + const result = client.matchProjectFromDependencyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.dependencyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDependencyName', () => { + const result = client.matchLocationFromDependencyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.dependencyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDependencyFromDependencyName', () => { + const result = client.matchDependencyFromDependencyName(fakePath); + assert.strictEqual(result, "dependencyValue"); + assert((client.pathTemplates.dependencyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('deployment', () => { + const fakePath = "/rendered/path/deployment"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + deployment: "deploymentValue", + }; + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.deploymentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.deploymentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('deploymentPath', () => { + const result = client.deploymentPath("projectValue", "locationValue", "deploymentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.deploymentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDeploymentName', () => { + const result = client.matchProjectFromDeploymentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDeploymentName', () => { + const result = client.matchLocationFromDeploymentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDeploymentFromDeploymentName', () => { + const result = client.matchDeploymentFromDeploymentName(fakePath); + assert.strictEqual(result, "deploymentValue"); + assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('externalApi', () => { + const fakePath = "/rendered/path/externalApi"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + external_api: "externalApiValue", + }; + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.externalApiPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.externalApiPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('externalApiPath', () => { + const result = client.externalApiPath("projectValue", "locationValue", "externalApiValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.externalApiPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromExternalApiName', () => { + const result = client.matchProjectFromExternalApiName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.externalApiPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromExternalApiName', () => { + const result = client.matchLocationFromExternalApiName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.externalApiPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExternalApiFromExternalApiName', () => { + const result = client.matchExternalApiFromExternalApiName(fakePath); + assert.strictEqual(result, "externalApiValue"); + assert((client.pathTemplates.externalApiPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('hostProjectRegistration', () => { + const fakePath = "/rendered/path/hostProjectRegistration"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + host_project_registration: "hostProjectRegistrationValue", + }; + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.hostProjectRegistrationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.hostProjectRegistrationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('hostProjectRegistrationPath', () => { + const result = client.hostProjectRegistrationPath("projectValue", "locationValue", "hostProjectRegistrationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.hostProjectRegistrationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromHostProjectRegistrationName', () => { + const result = client.matchProjectFromHostProjectRegistrationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.hostProjectRegistrationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromHostProjectRegistrationName', () => { + const result = client.matchLocationFromHostProjectRegistrationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.hostProjectRegistrationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchHostProjectRegistrationFromHostProjectRegistrationName', () => { + const result = client.matchHostProjectRegistrationFromHostProjectRegistrationName(fakePath); + assert.strictEqual(result, "hostProjectRegistrationValue"); + assert((client.pathTemplates.hostProjectRegistrationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('location', () => { + const fakePath = "/rendered/path/location"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + }; + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.locationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.locationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath("projectValue", "locationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('plugin', () => { + const fakePath = "/rendered/path/plugin"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + plugin: "pluginValue", + }; + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.pluginPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.pluginPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('pluginPath', () => { + const result = client.pluginPath("projectValue", "locationValue", "pluginValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.pluginPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromPluginName', () => { + const result = client.matchProjectFromPluginName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.pluginPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromPluginName', () => { + const result = client.matchLocationFromPluginName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.pluginPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPluginFromPluginName', () => { + const result = client.matchPluginFromPluginName(fakePath); + assert.strictEqual(result, "pluginValue"); + assert((client.pathTemplates.pluginPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('project', () => { + const fakePath = "/rendered/path/project"; + const expectedParameters = { + project: "projectValue", + }; + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath("projectValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('runtimeProjectAttachment', () => { + const fakePath = "/rendered/path/runtimeProjectAttachment"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + runtime_project_attachment: "runtimeProjectAttachmentValue", + }; + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.runtimeProjectAttachmentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.runtimeProjectAttachmentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('runtimeProjectAttachmentPath', () => { + const result = client.runtimeProjectAttachmentPath("projectValue", "locationValue", "runtimeProjectAttachmentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromRuntimeProjectAttachmentName', () => { + const result = client.matchProjectFromRuntimeProjectAttachmentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromRuntimeProjectAttachmentName', () => { + const result = client.matchLocationFromRuntimeProjectAttachmentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName', () => { + const result = client.matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName(fakePath); + assert.strictEqual(result, "runtimeProjectAttachmentValue"); + assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('spec', () => { + const fakePath = "/rendered/path/spec"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + api: "apiValue", + version: "versionValue", + spec: "specValue", + }; + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.specPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.specPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('specPath', () => { + const result = client.specPath("projectValue", "locationValue", "apiValue", "versionValue", "specValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.specPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSpecName', () => { + const result = client.matchProjectFromSpecName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSpecName', () => { + const result = client.matchLocationFromSpecName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchApiFromSpecName', () => { + const result = client.matchApiFromSpecName(fakePath); + assert.strictEqual(result, "apiValue"); + assert((client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchVersionFromSpecName', () => { + const result = client.matchVersionFromSpecName(fakePath); + assert.strictEqual(result, "versionValue"); + assert((client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSpecFromSpecName', () => { + const result = client.matchSpecFromSpecName(fakePath); + assert.strictEqual(result, "specValue"); + assert((client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('styleGuide', () => { + const fakePath = "/rendered/path/styleGuide"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + plugin: "pluginValue", + }; + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.styleGuidePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.styleGuidePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('styleGuidePath', () => { + const result = client.styleGuidePath("projectValue", "locationValue", "pluginValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.styleGuidePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromStyleGuideName', () => { + const result = client.matchProjectFromStyleGuideName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.styleGuidePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromStyleGuideName', () => { + const result = client.matchLocationFromStyleGuideName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.styleGuidePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPluginFromStyleGuideName', () => { + const result = client.matchPluginFromStyleGuideName(fakePath); + assert.strictEqual(result, "pluginValue"); + assert((client.pathTemplates.styleGuidePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('version', () => { + const fakePath = "/rendered/path/version"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + api: "apiValue", + version: "versionValue", + }; + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.versionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.versionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('versionPath', () => { + const result = client.versionPath("projectValue", "locationValue", "apiValue", "versionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.versionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromVersionName', () => { + const result = client.matchProjectFromVersionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromVersionName', () => { + const result = client.matchLocationFromVersionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchApiFromVersionName', () => { + const result = client.matchApiFromVersionName(fakePath); + assert.strictEqual(result, "apiValue"); + assert((client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchVersionFromVersionName', () => { + const result = client.matchVersionFromVersionName(fakePath); + assert.strictEqual(result, "versionValue"); + assert((client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-apihub/v1/test/gapic_host_project_registration_service_v1.ts b/owl-bot-staging/google-cloud-apihub/v1/test/gapic_host_project_registration_service_v1.ts new file mode 100644 index 00000000000..e0a3281285e --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/test/gapic_host_project_registration_service_v1.ts @@ -0,0 +1,1659 @@ +// Copyright 2024 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 hostprojectregistrationserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, 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 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.HostProjectRegistrationServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'apihub.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, "googleapis.com"); + }); + + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient.servicePath; + assert.strictEqual(servicePath, 'apihub.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'apihub.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'apihub.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'apihub.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'apihub.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'apihub.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.hostProjectRegistrationServiceStub, undefined); + await client.initialize(); + assert(client.hostProjectRegistrationServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.hostProjectRegistrationServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.hostProjectRegistrationServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ + 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 hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ + 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('createHostProjectRegistration', () => { + it('invokes createHostProjectRegistration without error', async () => { + const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateHostProjectRegistrationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.CreateHostProjectRegistrationRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.HostProjectRegistration() + ); + client.innerApiCalls.createHostProjectRegistration = stubSimpleCall(expectedResponse); + const [response] = await client.createHostProjectRegistration(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createHostProjectRegistration as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createHostProjectRegistration as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createHostProjectRegistration without error using callback', async () => { + const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateHostProjectRegistrationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.CreateHostProjectRegistrationRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.HostProjectRegistration() + ); + client.innerApiCalls.createHostProjectRegistration = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createHostProjectRegistration( + request, + (err?: Error|null, result?: protos.google.cloud.apihub.v1.IHostProjectRegistration|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createHostProjectRegistration as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createHostProjectRegistration as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createHostProjectRegistration with error', async () => { + const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateHostProjectRegistrationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.CreateHostProjectRegistrationRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createHostProjectRegistration = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createHostProjectRegistration(request), expectedError); + const actualRequest = (client.innerApiCalls.createHostProjectRegistration as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createHostProjectRegistration as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createHostProjectRegistration with closed client', async () => { + const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateHostProjectRegistrationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.CreateHostProjectRegistrationRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createHostProjectRegistration(request), expectedError); + }); + }); + + describe('getHostProjectRegistration', () => { + it('invokes getHostProjectRegistration without error', async () => { + const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetHostProjectRegistrationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetHostProjectRegistrationRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.HostProjectRegistration() + ); + client.innerApiCalls.getHostProjectRegistration = stubSimpleCall(expectedResponse); + const [response] = await client.getHostProjectRegistration(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getHostProjectRegistration as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getHostProjectRegistration as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getHostProjectRegistration without error using callback', async () => { + const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetHostProjectRegistrationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetHostProjectRegistrationRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.HostProjectRegistration() + ); + client.innerApiCalls.getHostProjectRegistration = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getHostProjectRegistration( + request, + (err?: Error|null, result?: protos.google.cloud.apihub.v1.IHostProjectRegistration|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getHostProjectRegistration as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getHostProjectRegistration as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getHostProjectRegistration with error', async () => { + const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetHostProjectRegistrationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetHostProjectRegistrationRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getHostProjectRegistration = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getHostProjectRegistration(request), expectedError); + const actualRequest = (client.innerApiCalls.getHostProjectRegistration as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getHostProjectRegistration as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getHostProjectRegistration with closed client', async () => { + const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetHostProjectRegistrationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetHostProjectRegistrationRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getHostProjectRegistration(request), expectedError); + }); + }); + + describe('listHostProjectRegistrations', () => { + it('invokes listHostProjectRegistrations without error', async () => { + const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.HostProjectRegistration()), + generateSampleMessage(new protos.google.cloud.apihub.v1.HostProjectRegistration()), + generateSampleMessage(new protos.google.cloud.apihub.v1.HostProjectRegistration()), + ]; + client.innerApiCalls.listHostProjectRegistrations = stubSimpleCall(expectedResponse); + const [response] = await client.listHostProjectRegistrations(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listHostProjectRegistrations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listHostProjectRegistrations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listHostProjectRegistrations without error using callback', async () => { + const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.HostProjectRegistration()), + generateSampleMessage(new protos.google.cloud.apihub.v1.HostProjectRegistration()), + generateSampleMessage(new protos.google.cloud.apihub.v1.HostProjectRegistration()), + ]; + client.innerApiCalls.listHostProjectRegistrations = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listHostProjectRegistrations( + request, + (err?: Error|null, result?: protos.google.cloud.apihub.v1.IHostProjectRegistration[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listHostProjectRegistrations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listHostProjectRegistrations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listHostProjectRegistrations with error', async () => { + const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listHostProjectRegistrations = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listHostProjectRegistrations(request), expectedError); + const actualRequest = (client.innerApiCalls.listHostProjectRegistrations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listHostProjectRegistrations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listHostProjectRegistrationsStream without error', async () => { + const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.HostProjectRegistration()), + generateSampleMessage(new protos.google.cloud.apihub.v1.HostProjectRegistration()), + generateSampleMessage(new protos.google.cloud.apihub.v1.HostProjectRegistration()), + ]; + client.descriptors.page.listHostProjectRegistrations.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listHostProjectRegistrationsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.apihub.v1.HostProjectRegistration[] = []; + stream.on('data', (response: protos.google.cloud.apihub.v1.HostProjectRegistration) => { + 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.listHostProjectRegistrations.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listHostProjectRegistrations, request)); + assert( + (client.descriptors.page.listHostProjectRegistrations.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listHostProjectRegistrationsStream with error', async () => { + const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listHostProjectRegistrations.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listHostProjectRegistrationsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.apihub.v1.HostProjectRegistration[] = []; + stream.on('data', (response: protos.google.cloud.apihub.v1.HostProjectRegistration) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listHostProjectRegistrations.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listHostProjectRegistrations, request)); + assert( + (client.descriptors.page.listHostProjectRegistrations.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listHostProjectRegistrations without error', async () => { + const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.HostProjectRegistration()), + generateSampleMessage(new protos.google.cloud.apihub.v1.HostProjectRegistration()), + generateSampleMessage(new protos.google.cloud.apihub.v1.HostProjectRegistration()), + ]; + client.descriptors.page.listHostProjectRegistrations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.apihub.v1.IHostProjectRegistration[] = []; + const iterable = client.listHostProjectRegistrationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listHostProjectRegistrations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listHostProjectRegistrations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listHostProjectRegistrations with error', async () => { + const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listHostProjectRegistrations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listHostProjectRegistrationsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.apihub.v1.IHostProjectRegistration[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listHostProjectRegistrations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listHostProjectRegistrations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ + 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 hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ + 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 hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ + 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 hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ + 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 hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ + 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('Path templates', () => { + + describe('api', () => { + const fakePath = "/rendered/path/api"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + api: "apiValue", + }; + const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.apiPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.apiPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('apiPath', () => { + const result = client.apiPath("projectValue", "locationValue", "apiValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.apiPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromApiName', () => { + const result = client.matchProjectFromApiName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.apiPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromApiName', () => { + const result = client.matchLocationFromApiName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.apiPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchApiFromApiName', () => { + const result = client.matchApiFromApiName(fakePath); + assert.strictEqual(result, "apiValue"); + assert((client.pathTemplates.apiPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('apiHubInstance', () => { + const fakePath = "/rendered/path/apiHubInstance"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + api_hub_instance: "apiHubInstanceValue", + }; + const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.apiHubInstancePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.apiHubInstancePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('apiHubInstancePath', () => { + const result = client.apiHubInstancePath("projectValue", "locationValue", "apiHubInstanceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.apiHubInstancePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromApiHubInstanceName', () => { + const result = client.matchProjectFromApiHubInstanceName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromApiHubInstanceName', () => { + const result = client.matchLocationFromApiHubInstanceName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchApiHubInstanceFromApiHubInstanceName', () => { + const result = client.matchApiHubInstanceFromApiHubInstanceName(fakePath); + assert.strictEqual(result, "apiHubInstanceValue"); + assert((client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('apiOperation', () => { + const fakePath = "/rendered/path/apiOperation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + api: "apiValue", + version: "versionValue", + operation: "operationValue", + }; + const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.apiOperationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.apiOperationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('apiOperationPath', () => { + const result = client.apiOperationPath("projectValue", "locationValue", "apiValue", "versionValue", "operationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.apiOperationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromApiOperationName', () => { + const result = client.matchProjectFromApiOperationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromApiOperationName', () => { + const result = client.matchLocationFromApiOperationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchApiFromApiOperationName', () => { + const result = client.matchApiFromApiOperationName(fakePath); + assert.strictEqual(result, "apiValue"); + assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchVersionFromApiOperationName', () => { + const result = client.matchVersionFromApiOperationName(fakePath); + assert.strictEqual(result, "versionValue"); + assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchOperationFromApiOperationName', () => { + const result = client.matchOperationFromApiOperationName(fakePath); + assert.strictEqual(result, "operationValue"); + assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('attribute', () => { + const fakePath = "/rendered/path/attribute"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + attribute: "attributeValue", + }; + const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.attributePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.attributePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('attributePath', () => { + const result = client.attributePath("projectValue", "locationValue", "attributeValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.attributePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAttributeName', () => { + const result = client.matchProjectFromAttributeName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.attributePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAttributeName', () => { + const result = client.matchLocationFromAttributeName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.attributePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAttributeFromAttributeName', () => { + const result = client.matchAttributeFromAttributeName(fakePath); + assert.strictEqual(result, "attributeValue"); + assert((client.pathTemplates.attributePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('definition', () => { + const fakePath = "/rendered/path/definition"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + api: "apiValue", + version: "versionValue", + definition: "definitionValue", + }; + const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.definitionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.definitionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('definitionPath', () => { + const result = client.definitionPath("projectValue", "locationValue", "apiValue", "versionValue", "definitionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.definitionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDefinitionName', () => { + const result = client.matchProjectFromDefinitionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDefinitionName', () => { + const result = client.matchLocationFromDefinitionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchApiFromDefinitionName', () => { + const result = client.matchApiFromDefinitionName(fakePath); + assert.strictEqual(result, "apiValue"); + assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchVersionFromDefinitionName', () => { + const result = client.matchVersionFromDefinitionName(fakePath); + assert.strictEqual(result, "versionValue"); + assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDefinitionFromDefinitionName', () => { + const result = client.matchDefinitionFromDefinitionName(fakePath); + assert.strictEqual(result, "definitionValue"); + assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dependency', () => { + const fakePath = "/rendered/path/dependency"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dependency: "dependencyValue", + }; + const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dependencyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.dependencyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('dependencyPath', () => { + const result = client.dependencyPath("projectValue", "locationValue", "dependencyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.dependencyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDependencyName', () => { + const result = client.matchProjectFromDependencyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.dependencyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDependencyName', () => { + const result = client.matchLocationFromDependencyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.dependencyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDependencyFromDependencyName', () => { + const result = client.matchDependencyFromDependencyName(fakePath); + assert.strictEqual(result, "dependencyValue"); + assert((client.pathTemplates.dependencyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('deployment', () => { + const fakePath = "/rendered/path/deployment"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + deployment: "deploymentValue", + }; + const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.deploymentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.deploymentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('deploymentPath', () => { + const result = client.deploymentPath("projectValue", "locationValue", "deploymentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.deploymentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDeploymentName', () => { + const result = client.matchProjectFromDeploymentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDeploymentName', () => { + const result = client.matchLocationFromDeploymentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDeploymentFromDeploymentName', () => { + const result = client.matchDeploymentFromDeploymentName(fakePath); + assert.strictEqual(result, "deploymentValue"); + assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('externalApi', () => { + const fakePath = "/rendered/path/externalApi"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + external_api: "externalApiValue", + }; + const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.externalApiPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.externalApiPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('externalApiPath', () => { + const result = client.externalApiPath("projectValue", "locationValue", "externalApiValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.externalApiPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromExternalApiName', () => { + const result = client.matchProjectFromExternalApiName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.externalApiPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromExternalApiName', () => { + const result = client.matchLocationFromExternalApiName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.externalApiPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExternalApiFromExternalApiName', () => { + const result = client.matchExternalApiFromExternalApiName(fakePath); + assert.strictEqual(result, "externalApiValue"); + assert((client.pathTemplates.externalApiPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('hostProjectRegistration', () => { + const fakePath = "/rendered/path/hostProjectRegistration"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + host_project_registration: "hostProjectRegistrationValue", + }; + const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.hostProjectRegistrationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.hostProjectRegistrationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('hostProjectRegistrationPath', () => { + const result = client.hostProjectRegistrationPath("projectValue", "locationValue", "hostProjectRegistrationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.hostProjectRegistrationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromHostProjectRegistrationName', () => { + const result = client.matchProjectFromHostProjectRegistrationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.hostProjectRegistrationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromHostProjectRegistrationName', () => { + const result = client.matchLocationFromHostProjectRegistrationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.hostProjectRegistrationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchHostProjectRegistrationFromHostProjectRegistrationName', () => { + const result = client.matchHostProjectRegistrationFromHostProjectRegistrationName(fakePath); + assert.strictEqual(result, "hostProjectRegistrationValue"); + assert((client.pathTemplates.hostProjectRegistrationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('location', () => { + const fakePath = "/rendered/path/location"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + }; + const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.locationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.locationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath("projectValue", "locationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('plugin', () => { + const fakePath = "/rendered/path/plugin"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + plugin: "pluginValue", + }; + const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.pluginPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.pluginPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('pluginPath', () => { + const result = client.pluginPath("projectValue", "locationValue", "pluginValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.pluginPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromPluginName', () => { + const result = client.matchProjectFromPluginName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.pluginPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromPluginName', () => { + const result = client.matchLocationFromPluginName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.pluginPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPluginFromPluginName', () => { + const result = client.matchPluginFromPluginName(fakePath); + assert.strictEqual(result, "pluginValue"); + assert((client.pathTemplates.pluginPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('project', () => { + const fakePath = "/rendered/path/project"; + const expectedParameters = { + project: "projectValue", + }; + const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath("projectValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('runtimeProjectAttachment', () => { + const fakePath = "/rendered/path/runtimeProjectAttachment"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + runtime_project_attachment: "runtimeProjectAttachmentValue", + }; + const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.runtimeProjectAttachmentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.runtimeProjectAttachmentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('runtimeProjectAttachmentPath', () => { + const result = client.runtimeProjectAttachmentPath("projectValue", "locationValue", "runtimeProjectAttachmentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromRuntimeProjectAttachmentName', () => { + const result = client.matchProjectFromRuntimeProjectAttachmentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromRuntimeProjectAttachmentName', () => { + const result = client.matchLocationFromRuntimeProjectAttachmentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName', () => { + const result = client.matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName(fakePath); + assert.strictEqual(result, "runtimeProjectAttachmentValue"); + assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('spec', () => { + const fakePath = "/rendered/path/spec"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + api: "apiValue", + version: "versionValue", + spec: "specValue", + }; + const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.specPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.specPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('specPath', () => { + const result = client.specPath("projectValue", "locationValue", "apiValue", "versionValue", "specValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.specPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSpecName', () => { + const result = client.matchProjectFromSpecName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSpecName', () => { + const result = client.matchLocationFromSpecName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchApiFromSpecName', () => { + const result = client.matchApiFromSpecName(fakePath); + assert.strictEqual(result, "apiValue"); + assert((client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchVersionFromSpecName', () => { + const result = client.matchVersionFromSpecName(fakePath); + assert.strictEqual(result, "versionValue"); + assert((client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSpecFromSpecName', () => { + const result = client.matchSpecFromSpecName(fakePath); + assert.strictEqual(result, "specValue"); + assert((client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('styleGuide', () => { + const fakePath = "/rendered/path/styleGuide"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + plugin: "pluginValue", + }; + const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.styleGuidePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.styleGuidePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('styleGuidePath', () => { + const result = client.styleGuidePath("projectValue", "locationValue", "pluginValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.styleGuidePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromStyleGuideName', () => { + const result = client.matchProjectFromStyleGuideName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.styleGuidePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromStyleGuideName', () => { + const result = client.matchLocationFromStyleGuideName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.styleGuidePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPluginFromStyleGuideName', () => { + const result = client.matchPluginFromStyleGuideName(fakePath); + assert.strictEqual(result, "pluginValue"); + assert((client.pathTemplates.styleGuidePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('version', () => { + const fakePath = "/rendered/path/version"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + api: "apiValue", + version: "versionValue", + }; + const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.versionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.versionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('versionPath', () => { + const result = client.versionPath("projectValue", "locationValue", "apiValue", "versionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.versionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromVersionName', () => { + const result = client.matchProjectFromVersionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromVersionName', () => { + const result = client.matchLocationFromVersionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchApiFromVersionName', () => { + const result = client.matchApiFromVersionName(fakePath); + assert.strictEqual(result, "apiValue"); + assert((client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchVersionFromVersionName', () => { + const result = client.matchVersionFromVersionName(fakePath); + assert.strictEqual(result, "versionValue"); + assert((client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-apihub/v1/test/gapic_linting_service_v1.ts b/owl-bot-staging/google-cloud-apihub/v1/test/gapic_linting_service_v1.ts new file mode 100644 index 00000000000..9ec56921975 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/test/gapic_linting_service_v1.ts @@ -0,0 +1,1539 @@ +// Copyright 2024 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 lintingserviceModule from '../src'; + +import {protobuf, 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 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.LintingServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new lintingserviceModule.v1.LintingServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'apihub.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new lintingserviceModule.v1.LintingServiceClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, "googleapis.com"); + }); + + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = lintingserviceModule.v1.LintingServiceClient.servicePath; + assert.strictEqual(servicePath, 'apihub.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = lintingserviceModule.v1.LintingServiceClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'apihub.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new lintingserviceModule.v1.LintingServiceClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'apihub.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new lintingserviceModule.v1.LintingServiceClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'apihub.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new lintingserviceModule.v1.LintingServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'apihub.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new lintingserviceModule.v1.LintingServiceClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'apihub.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { new lintingserviceModule.v1.LintingServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = lintingserviceModule.v1.LintingServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new lintingserviceModule.v1.LintingServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new lintingserviceModule.v1.LintingServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new lintingserviceModule.v1.LintingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.lintingServiceStub, undefined); + await client.initialize(); + assert(client.lintingServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new lintingserviceModule.v1.LintingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.lintingServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new lintingserviceModule.v1.LintingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.lintingServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new lintingserviceModule.v1.LintingServiceClient({ + 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 lintingserviceModule.v1.LintingServiceClient({ + 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('getStyleGuide', () => { + it('invokes getStyleGuide without error', async () => { + const client = new lintingserviceModule.v1.LintingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetStyleGuideRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetStyleGuideRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.StyleGuide() + ); + client.innerApiCalls.getStyleGuide = stubSimpleCall(expectedResponse); + const [response] = await client.getStyleGuide(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getStyleGuide as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getStyleGuide as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getStyleGuide without error using callback', async () => { + const client = new lintingserviceModule.v1.LintingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetStyleGuideRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetStyleGuideRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.StyleGuide() + ); + client.innerApiCalls.getStyleGuide = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getStyleGuide( + request, + (err?: Error|null, result?: protos.google.cloud.apihub.v1.IStyleGuide|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getStyleGuide as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getStyleGuide as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getStyleGuide with error', async () => { + const client = new lintingserviceModule.v1.LintingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetStyleGuideRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetStyleGuideRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getStyleGuide = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getStyleGuide(request), expectedError); + const actualRequest = (client.innerApiCalls.getStyleGuide as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getStyleGuide as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getStyleGuide with closed client', async () => { + const client = new lintingserviceModule.v1.LintingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetStyleGuideRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetStyleGuideRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getStyleGuide(request), expectedError); + }); + }); + + describe('updateStyleGuide', () => { + it('invokes updateStyleGuide without error', async () => { + const client = new lintingserviceModule.v1.LintingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.UpdateStyleGuideRequest() + ); + request.styleGuide ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.UpdateStyleGuideRequest', ['styleGuide', 'name']); + request.styleGuide.name = defaultValue1; + const expectedHeaderRequestParams = `style_guide.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.StyleGuide() + ); + client.innerApiCalls.updateStyleGuide = stubSimpleCall(expectedResponse); + const [response] = await client.updateStyleGuide(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateStyleGuide as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateStyleGuide as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateStyleGuide without error using callback', async () => { + const client = new lintingserviceModule.v1.LintingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.UpdateStyleGuideRequest() + ); + request.styleGuide ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.UpdateStyleGuideRequest', ['styleGuide', 'name']); + request.styleGuide.name = defaultValue1; + const expectedHeaderRequestParams = `style_guide.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.StyleGuide() + ); + client.innerApiCalls.updateStyleGuide = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateStyleGuide( + request, + (err?: Error|null, result?: protos.google.cloud.apihub.v1.IStyleGuide|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateStyleGuide as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateStyleGuide as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateStyleGuide with error', async () => { + const client = new lintingserviceModule.v1.LintingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.UpdateStyleGuideRequest() + ); + request.styleGuide ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.UpdateStyleGuideRequest', ['styleGuide', 'name']); + request.styleGuide.name = defaultValue1; + const expectedHeaderRequestParams = `style_guide.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateStyleGuide = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateStyleGuide(request), expectedError); + const actualRequest = (client.innerApiCalls.updateStyleGuide as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateStyleGuide as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateStyleGuide with closed client', async () => { + const client = new lintingserviceModule.v1.LintingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.UpdateStyleGuideRequest() + ); + request.styleGuide ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.UpdateStyleGuideRequest', ['styleGuide', 'name']); + request.styleGuide.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateStyleGuide(request), expectedError); + }); + }); + + describe('getStyleGuideContents', () => { + it('invokes getStyleGuideContents without error', async () => { + const client = new lintingserviceModule.v1.LintingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetStyleGuideContentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetStyleGuideContentsRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.StyleGuideContents() + ); + client.innerApiCalls.getStyleGuideContents = stubSimpleCall(expectedResponse); + const [response] = await client.getStyleGuideContents(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getStyleGuideContents as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getStyleGuideContents as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getStyleGuideContents without error using callback', async () => { + const client = new lintingserviceModule.v1.LintingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetStyleGuideContentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetStyleGuideContentsRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.StyleGuideContents() + ); + client.innerApiCalls.getStyleGuideContents = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getStyleGuideContents( + request, + (err?: Error|null, result?: protos.google.cloud.apihub.v1.IStyleGuideContents|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getStyleGuideContents as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getStyleGuideContents as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getStyleGuideContents with error', async () => { + const client = new lintingserviceModule.v1.LintingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetStyleGuideContentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetStyleGuideContentsRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getStyleGuideContents = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getStyleGuideContents(request), expectedError); + const actualRequest = (client.innerApiCalls.getStyleGuideContents as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getStyleGuideContents as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getStyleGuideContents with closed client', async () => { + const client = new lintingserviceModule.v1.LintingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetStyleGuideContentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetStyleGuideContentsRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getStyleGuideContents(request), expectedError); + }); + }); + + describe('lintSpec', () => { + it('invokes lintSpec without error', async () => { + const client = new lintingserviceModule.v1.LintingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.LintSpecRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.LintSpecRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.lintSpec = stubSimpleCall(expectedResponse); + const [response] = await client.lintSpec(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.lintSpec as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.lintSpec as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes lintSpec without error using callback', async () => { + const client = new lintingserviceModule.v1.LintingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.LintSpecRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.LintSpecRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.lintSpec = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.lintSpec( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.lintSpec as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.lintSpec as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes lintSpec with error', async () => { + const client = new lintingserviceModule.v1.LintingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.LintSpecRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.LintSpecRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.lintSpec = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.lintSpec(request), expectedError); + const actualRequest = (client.innerApiCalls.lintSpec as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.lintSpec as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes lintSpec with closed client', async () => { + const client = new lintingserviceModule.v1.LintingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.LintSpecRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.LintSpecRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.lintSpec(request), expectedError); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new lintingserviceModule.v1.LintingServiceClient({ + 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 lintingserviceModule.v1.LintingServiceClient({ + 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 lintingserviceModule.v1.LintingServiceClient({ + 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 lintingserviceModule.v1.LintingServiceClient({ + 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 lintingserviceModule.v1.LintingServiceClient({ + 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('Path templates', () => { + + describe('api', () => { + const fakePath = "/rendered/path/api"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + api: "apiValue", + }; + const client = new lintingserviceModule.v1.LintingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.apiPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.apiPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('apiPath', () => { + const result = client.apiPath("projectValue", "locationValue", "apiValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.apiPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromApiName', () => { + const result = client.matchProjectFromApiName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.apiPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromApiName', () => { + const result = client.matchLocationFromApiName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.apiPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchApiFromApiName', () => { + const result = client.matchApiFromApiName(fakePath); + assert.strictEqual(result, "apiValue"); + assert((client.pathTemplates.apiPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('apiHubInstance', () => { + const fakePath = "/rendered/path/apiHubInstance"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + api_hub_instance: "apiHubInstanceValue", + }; + const client = new lintingserviceModule.v1.LintingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.apiHubInstancePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.apiHubInstancePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('apiHubInstancePath', () => { + const result = client.apiHubInstancePath("projectValue", "locationValue", "apiHubInstanceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.apiHubInstancePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromApiHubInstanceName', () => { + const result = client.matchProjectFromApiHubInstanceName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromApiHubInstanceName', () => { + const result = client.matchLocationFromApiHubInstanceName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchApiHubInstanceFromApiHubInstanceName', () => { + const result = client.matchApiHubInstanceFromApiHubInstanceName(fakePath); + assert.strictEqual(result, "apiHubInstanceValue"); + assert((client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('apiOperation', () => { + const fakePath = "/rendered/path/apiOperation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + api: "apiValue", + version: "versionValue", + operation: "operationValue", + }; + const client = new lintingserviceModule.v1.LintingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.apiOperationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.apiOperationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('apiOperationPath', () => { + const result = client.apiOperationPath("projectValue", "locationValue", "apiValue", "versionValue", "operationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.apiOperationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromApiOperationName', () => { + const result = client.matchProjectFromApiOperationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromApiOperationName', () => { + const result = client.matchLocationFromApiOperationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchApiFromApiOperationName', () => { + const result = client.matchApiFromApiOperationName(fakePath); + assert.strictEqual(result, "apiValue"); + assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchVersionFromApiOperationName', () => { + const result = client.matchVersionFromApiOperationName(fakePath); + assert.strictEqual(result, "versionValue"); + assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchOperationFromApiOperationName', () => { + const result = client.matchOperationFromApiOperationName(fakePath); + assert.strictEqual(result, "operationValue"); + assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('attribute', () => { + const fakePath = "/rendered/path/attribute"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + attribute: "attributeValue", + }; + const client = new lintingserviceModule.v1.LintingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.attributePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.attributePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('attributePath', () => { + const result = client.attributePath("projectValue", "locationValue", "attributeValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.attributePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAttributeName', () => { + const result = client.matchProjectFromAttributeName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.attributePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAttributeName', () => { + const result = client.matchLocationFromAttributeName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.attributePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAttributeFromAttributeName', () => { + const result = client.matchAttributeFromAttributeName(fakePath); + assert.strictEqual(result, "attributeValue"); + assert((client.pathTemplates.attributePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('definition', () => { + const fakePath = "/rendered/path/definition"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + api: "apiValue", + version: "versionValue", + definition: "definitionValue", + }; + const client = new lintingserviceModule.v1.LintingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.definitionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.definitionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('definitionPath', () => { + const result = client.definitionPath("projectValue", "locationValue", "apiValue", "versionValue", "definitionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.definitionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDefinitionName', () => { + const result = client.matchProjectFromDefinitionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDefinitionName', () => { + const result = client.matchLocationFromDefinitionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchApiFromDefinitionName', () => { + const result = client.matchApiFromDefinitionName(fakePath); + assert.strictEqual(result, "apiValue"); + assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchVersionFromDefinitionName', () => { + const result = client.matchVersionFromDefinitionName(fakePath); + assert.strictEqual(result, "versionValue"); + assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDefinitionFromDefinitionName', () => { + const result = client.matchDefinitionFromDefinitionName(fakePath); + assert.strictEqual(result, "definitionValue"); + assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dependency', () => { + const fakePath = "/rendered/path/dependency"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dependency: "dependencyValue", + }; + const client = new lintingserviceModule.v1.LintingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dependencyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.dependencyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('dependencyPath', () => { + const result = client.dependencyPath("projectValue", "locationValue", "dependencyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.dependencyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDependencyName', () => { + const result = client.matchProjectFromDependencyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.dependencyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDependencyName', () => { + const result = client.matchLocationFromDependencyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.dependencyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDependencyFromDependencyName', () => { + const result = client.matchDependencyFromDependencyName(fakePath); + assert.strictEqual(result, "dependencyValue"); + assert((client.pathTemplates.dependencyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('deployment', () => { + const fakePath = "/rendered/path/deployment"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + deployment: "deploymentValue", + }; + const client = new lintingserviceModule.v1.LintingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.deploymentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.deploymentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('deploymentPath', () => { + const result = client.deploymentPath("projectValue", "locationValue", "deploymentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.deploymentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDeploymentName', () => { + const result = client.matchProjectFromDeploymentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDeploymentName', () => { + const result = client.matchLocationFromDeploymentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDeploymentFromDeploymentName', () => { + const result = client.matchDeploymentFromDeploymentName(fakePath); + assert.strictEqual(result, "deploymentValue"); + assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('externalApi', () => { + const fakePath = "/rendered/path/externalApi"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + external_api: "externalApiValue", + }; + const client = new lintingserviceModule.v1.LintingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.externalApiPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.externalApiPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('externalApiPath', () => { + const result = client.externalApiPath("projectValue", "locationValue", "externalApiValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.externalApiPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromExternalApiName', () => { + const result = client.matchProjectFromExternalApiName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.externalApiPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromExternalApiName', () => { + const result = client.matchLocationFromExternalApiName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.externalApiPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExternalApiFromExternalApiName', () => { + const result = client.matchExternalApiFromExternalApiName(fakePath); + assert.strictEqual(result, "externalApiValue"); + assert((client.pathTemplates.externalApiPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('hostProjectRegistration', () => { + const fakePath = "/rendered/path/hostProjectRegistration"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + host_project_registration: "hostProjectRegistrationValue", + }; + const client = new lintingserviceModule.v1.LintingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.hostProjectRegistrationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.hostProjectRegistrationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('hostProjectRegistrationPath', () => { + const result = client.hostProjectRegistrationPath("projectValue", "locationValue", "hostProjectRegistrationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.hostProjectRegistrationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromHostProjectRegistrationName', () => { + const result = client.matchProjectFromHostProjectRegistrationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.hostProjectRegistrationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromHostProjectRegistrationName', () => { + const result = client.matchLocationFromHostProjectRegistrationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.hostProjectRegistrationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchHostProjectRegistrationFromHostProjectRegistrationName', () => { + const result = client.matchHostProjectRegistrationFromHostProjectRegistrationName(fakePath); + assert.strictEqual(result, "hostProjectRegistrationValue"); + assert((client.pathTemplates.hostProjectRegistrationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('plugin', () => { + const fakePath = "/rendered/path/plugin"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + plugin: "pluginValue", + }; + const client = new lintingserviceModule.v1.LintingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.pluginPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.pluginPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('pluginPath', () => { + const result = client.pluginPath("projectValue", "locationValue", "pluginValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.pluginPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromPluginName', () => { + const result = client.matchProjectFromPluginName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.pluginPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromPluginName', () => { + const result = client.matchLocationFromPluginName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.pluginPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPluginFromPluginName', () => { + const result = client.matchPluginFromPluginName(fakePath); + assert.strictEqual(result, "pluginValue"); + assert((client.pathTemplates.pluginPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('runtimeProjectAttachment', () => { + const fakePath = "/rendered/path/runtimeProjectAttachment"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + runtime_project_attachment: "runtimeProjectAttachmentValue", + }; + const client = new lintingserviceModule.v1.LintingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.runtimeProjectAttachmentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.runtimeProjectAttachmentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('runtimeProjectAttachmentPath', () => { + const result = client.runtimeProjectAttachmentPath("projectValue", "locationValue", "runtimeProjectAttachmentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromRuntimeProjectAttachmentName', () => { + const result = client.matchProjectFromRuntimeProjectAttachmentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromRuntimeProjectAttachmentName', () => { + const result = client.matchLocationFromRuntimeProjectAttachmentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName', () => { + const result = client.matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName(fakePath); + assert.strictEqual(result, "runtimeProjectAttachmentValue"); + assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('spec', () => { + const fakePath = "/rendered/path/spec"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + api: "apiValue", + version: "versionValue", + spec: "specValue", + }; + const client = new lintingserviceModule.v1.LintingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.specPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.specPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('specPath', () => { + const result = client.specPath("projectValue", "locationValue", "apiValue", "versionValue", "specValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.specPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSpecName', () => { + const result = client.matchProjectFromSpecName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSpecName', () => { + const result = client.matchLocationFromSpecName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchApiFromSpecName', () => { + const result = client.matchApiFromSpecName(fakePath); + assert.strictEqual(result, "apiValue"); + assert((client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchVersionFromSpecName', () => { + const result = client.matchVersionFromSpecName(fakePath); + assert.strictEqual(result, "versionValue"); + assert((client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSpecFromSpecName', () => { + const result = client.matchSpecFromSpecName(fakePath); + assert.strictEqual(result, "specValue"); + assert((client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('styleGuide', () => { + const fakePath = "/rendered/path/styleGuide"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + plugin: "pluginValue", + }; + const client = new lintingserviceModule.v1.LintingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.styleGuidePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.styleGuidePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('styleGuidePath', () => { + const result = client.styleGuidePath("projectValue", "locationValue", "pluginValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.styleGuidePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromStyleGuideName', () => { + const result = client.matchProjectFromStyleGuideName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.styleGuidePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromStyleGuideName', () => { + const result = client.matchLocationFromStyleGuideName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.styleGuidePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPluginFromStyleGuideName', () => { + const result = client.matchPluginFromStyleGuideName(fakePath); + assert.strictEqual(result, "pluginValue"); + assert((client.pathTemplates.styleGuidePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('version', () => { + const fakePath = "/rendered/path/version"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + api: "apiValue", + version: "versionValue", + }; + const client = new lintingserviceModule.v1.LintingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.versionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.versionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('versionPath', () => { + const result = client.versionPath("projectValue", "locationValue", "apiValue", "versionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.versionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromVersionName', () => { + const result = client.matchProjectFromVersionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromVersionName', () => { + const result = client.matchLocationFromVersionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchApiFromVersionName', () => { + const result = client.matchApiFromVersionName(fakePath); + assert.strictEqual(result, "apiValue"); + assert((client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchVersionFromVersionName', () => { + const result = client.matchVersionFromVersionName(fakePath); + assert.strictEqual(result, "versionValue"); + assert((client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-apihub/v1/test/gapic_provisioning_v1.ts b/owl-bot-staging/google-cloud-apihub/v1/test/gapic_provisioning_v1.ts new file mode 100644 index 00000000000..342c8447958 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/test/gapic_provisioning_v1.ts @@ -0,0 +1,1812 @@ +// Copyright 2024 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 provisioningModule from '../src'; + +import {protobuf, LROperation, operationsProtos, 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 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.ProvisioningClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new provisioningModule.v1.ProvisioningClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'apihub.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new provisioningModule.v1.ProvisioningClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, "googleapis.com"); + }); + + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = provisioningModule.v1.ProvisioningClient.servicePath; + assert.strictEqual(servicePath, 'apihub.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = provisioningModule.v1.ProvisioningClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'apihub.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new provisioningModule.v1.ProvisioningClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'apihub.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new provisioningModule.v1.ProvisioningClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'apihub.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new provisioningModule.v1.ProvisioningClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'apihub.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new provisioningModule.v1.ProvisioningClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'apihub.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { new provisioningModule.v1.ProvisioningClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = provisioningModule.v1.ProvisioningClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new provisioningModule.v1.ProvisioningClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new provisioningModule.v1.ProvisioningClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.provisioningStub, undefined); + await client.initialize(); + assert(client.provisioningStub); + }); + + it('has close method for the initialized client', done => { + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.provisioningStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.provisioningStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new provisioningModule.v1.ProvisioningClient({ + 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 provisioningModule.v1.ProvisioningClient({ + 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('getApiHubInstance', () => { + it('invokes getApiHubInstance without error', async () => { + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetApiHubInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetApiHubInstanceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.ApiHubInstance() + ); + client.innerApiCalls.getApiHubInstance = stubSimpleCall(expectedResponse); + const [response] = await client.getApiHubInstance(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getApiHubInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getApiHubInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getApiHubInstance without error using callback', async () => { + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetApiHubInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetApiHubInstanceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.ApiHubInstance() + ); + client.innerApiCalls.getApiHubInstance = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getApiHubInstance( + request, + (err?: Error|null, result?: protos.google.cloud.apihub.v1.IApiHubInstance|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getApiHubInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getApiHubInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getApiHubInstance with error', async () => { + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetApiHubInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetApiHubInstanceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getApiHubInstance = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getApiHubInstance(request), expectedError); + const actualRequest = (client.innerApiCalls.getApiHubInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getApiHubInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getApiHubInstance with closed client', async () => { + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetApiHubInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetApiHubInstanceRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getApiHubInstance(request), expectedError); + }); + }); + + describe('lookupApiHubInstance', () => { + it('invokes lookupApiHubInstance without error', async () => { + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.LookupApiHubInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.LookupApiHubInstanceRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.LookupApiHubInstanceResponse() + ); + client.innerApiCalls.lookupApiHubInstance = stubSimpleCall(expectedResponse); + const [response] = await client.lookupApiHubInstance(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.lookupApiHubInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.lookupApiHubInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes lookupApiHubInstance without error using callback', async () => { + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.LookupApiHubInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.LookupApiHubInstanceRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.LookupApiHubInstanceResponse() + ); + client.innerApiCalls.lookupApiHubInstance = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.lookupApiHubInstance( + request, + (err?: Error|null, result?: protos.google.cloud.apihub.v1.ILookupApiHubInstanceResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.lookupApiHubInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.lookupApiHubInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes lookupApiHubInstance with error', async () => { + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.LookupApiHubInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.LookupApiHubInstanceRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.lookupApiHubInstance = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.lookupApiHubInstance(request), expectedError); + const actualRequest = (client.innerApiCalls.lookupApiHubInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.lookupApiHubInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes lookupApiHubInstance with closed client', async () => { + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.LookupApiHubInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.LookupApiHubInstanceRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.lookupApiHubInstance(request), expectedError); + }); + }); + + describe('createApiHubInstance', () => { + it('invokes createApiHubInstance without error', async () => { + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateApiHubInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.CreateApiHubInstanceRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createApiHubInstance = stubLongRunningCall(expectedResponse); + const [operation] = await client.createApiHubInstance(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createApiHubInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createApiHubInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createApiHubInstance without error using callback', async () => { + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateApiHubInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.CreateApiHubInstanceRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createApiHubInstance = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createApiHubInstance( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createApiHubInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createApiHubInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createApiHubInstance with call error', async () => { + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateApiHubInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.CreateApiHubInstanceRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createApiHubInstance = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createApiHubInstance(request), expectedError); + const actualRequest = (client.innerApiCalls.createApiHubInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createApiHubInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createApiHubInstance with LRO error', async () => { + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateApiHubInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.CreateApiHubInstanceRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createApiHubInstance = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createApiHubInstance(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.createApiHubInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createApiHubInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateApiHubInstanceProgress without error', async () => { + const client = new provisioningModule.v1.ProvisioningClient({ + 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.checkCreateApiHubInstanceProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateApiHubInstanceProgress with error', async () => { + const client = new provisioningModule.v1.ProvisioningClient({ + 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.checkCreateApiHubInstanceProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new provisioningModule.v1.ProvisioningClient({ + 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 provisioningModule.v1.ProvisioningClient({ + 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 provisioningModule.v1.ProvisioningClient({ + 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 provisioningModule.v1.ProvisioningClient({ + 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 provisioningModule.v1.ProvisioningClient({ + 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 provisioningModule.v1.ProvisioningClient({ + 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 provisioningModule.v1.ProvisioningClient({ + 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 provisioningModule.v1.ProvisioningClient({ + 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 provisioningModule.v1.ProvisioningClient({ + 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 provisioningModule.v1.ProvisioningClient({ + 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 provisioningModule.v1.ProvisioningClient({ + 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 provisioningModule.v1.ProvisioningClient({ + 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 provisioningModule.v1.ProvisioningClient({ + 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 provisioningModule.v1.ProvisioningClient({ + 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 provisioningModule.v1.ProvisioningClient({ + 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 provisioningModule.v1.ProvisioningClient({ + 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('api', () => { + const fakePath = "/rendered/path/api"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + api: "apiValue", + }; + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.apiPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.apiPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('apiPath', () => { + const result = client.apiPath("projectValue", "locationValue", "apiValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.apiPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromApiName', () => { + const result = client.matchProjectFromApiName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.apiPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromApiName', () => { + const result = client.matchLocationFromApiName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.apiPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchApiFromApiName', () => { + const result = client.matchApiFromApiName(fakePath); + assert.strictEqual(result, "apiValue"); + assert((client.pathTemplates.apiPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('apiHubInstance', () => { + const fakePath = "/rendered/path/apiHubInstance"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + api_hub_instance: "apiHubInstanceValue", + }; + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.apiHubInstancePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.apiHubInstancePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('apiHubInstancePath', () => { + const result = client.apiHubInstancePath("projectValue", "locationValue", "apiHubInstanceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.apiHubInstancePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromApiHubInstanceName', () => { + const result = client.matchProjectFromApiHubInstanceName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromApiHubInstanceName', () => { + const result = client.matchLocationFromApiHubInstanceName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchApiHubInstanceFromApiHubInstanceName', () => { + const result = client.matchApiHubInstanceFromApiHubInstanceName(fakePath); + assert.strictEqual(result, "apiHubInstanceValue"); + assert((client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('apiOperation', () => { + const fakePath = "/rendered/path/apiOperation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + api: "apiValue", + version: "versionValue", + operation: "operationValue", + }; + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.apiOperationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.apiOperationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('apiOperationPath', () => { + const result = client.apiOperationPath("projectValue", "locationValue", "apiValue", "versionValue", "operationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.apiOperationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromApiOperationName', () => { + const result = client.matchProjectFromApiOperationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromApiOperationName', () => { + const result = client.matchLocationFromApiOperationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchApiFromApiOperationName', () => { + const result = client.matchApiFromApiOperationName(fakePath); + assert.strictEqual(result, "apiValue"); + assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchVersionFromApiOperationName', () => { + const result = client.matchVersionFromApiOperationName(fakePath); + assert.strictEqual(result, "versionValue"); + assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchOperationFromApiOperationName', () => { + const result = client.matchOperationFromApiOperationName(fakePath); + assert.strictEqual(result, "operationValue"); + assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('attribute', () => { + const fakePath = "/rendered/path/attribute"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + attribute: "attributeValue", + }; + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.attributePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.attributePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('attributePath', () => { + const result = client.attributePath("projectValue", "locationValue", "attributeValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.attributePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAttributeName', () => { + const result = client.matchProjectFromAttributeName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.attributePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAttributeName', () => { + const result = client.matchLocationFromAttributeName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.attributePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAttributeFromAttributeName', () => { + const result = client.matchAttributeFromAttributeName(fakePath); + assert.strictEqual(result, "attributeValue"); + assert((client.pathTemplates.attributePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('definition', () => { + const fakePath = "/rendered/path/definition"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + api: "apiValue", + version: "versionValue", + definition: "definitionValue", + }; + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.definitionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.definitionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('definitionPath', () => { + const result = client.definitionPath("projectValue", "locationValue", "apiValue", "versionValue", "definitionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.definitionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDefinitionName', () => { + const result = client.matchProjectFromDefinitionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDefinitionName', () => { + const result = client.matchLocationFromDefinitionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchApiFromDefinitionName', () => { + const result = client.matchApiFromDefinitionName(fakePath); + assert.strictEqual(result, "apiValue"); + assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchVersionFromDefinitionName', () => { + const result = client.matchVersionFromDefinitionName(fakePath); + assert.strictEqual(result, "versionValue"); + assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDefinitionFromDefinitionName', () => { + const result = client.matchDefinitionFromDefinitionName(fakePath); + assert.strictEqual(result, "definitionValue"); + assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dependency', () => { + const fakePath = "/rendered/path/dependency"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dependency: "dependencyValue", + }; + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dependencyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.dependencyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('dependencyPath', () => { + const result = client.dependencyPath("projectValue", "locationValue", "dependencyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.dependencyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDependencyName', () => { + const result = client.matchProjectFromDependencyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.dependencyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDependencyName', () => { + const result = client.matchLocationFromDependencyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.dependencyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDependencyFromDependencyName', () => { + const result = client.matchDependencyFromDependencyName(fakePath); + assert.strictEqual(result, "dependencyValue"); + assert((client.pathTemplates.dependencyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('deployment', () => { + const fakePath = "/rendered/path/deployment"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + deployment: "deploymentValue", + }; + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.deploymentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.deploymentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('deploymentPath', () => { + const result = client.deploymentPath("projectValue", "locationValue", "deploymentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.deploymentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDeploymentName', () => { + const result = client.matchProjectFromDeploymentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDeploymentName', () => { + const result = client.matchLocationFromDeploymentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDeploymentFromDeploymentName', () => { + const result = client.matchDeploymentFromDeploymentName(fakePath); + assert.strictEqual(result, "deploymentValue"); + assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('externalApi', () => { + const fakePath = "/rendered/path/externalApi"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + external_api: "externalApiValue", + }; + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.externalApiPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.externalApiPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('externalApiPath', () => { + const result = client.externalApiPath("projectValue", "locationValue", "externalApiValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.externalApiPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromExternalApiName', () => { + const result = client.matchProjectFromExternalApiName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.externalApiPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromExternalApiName', () => { + const result = client.matchLocationFromExternalApiName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.externalApiPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExternalApiFromExternalApiName', () => { + const result = client.matchExternalApiFromExternalApiName(fakePath); + assert.strictEqual(result, "externalApiValue"); + assert((client.pathTemplates.externalApiPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('hostProjectRegistration', () => { + const fakePath = "/rendered/path/hostProjectRegistration"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + host_project_registration: "hostProjectRegistrationValue", + }; + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.hostProjectRegistrationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.hostProjectRegistrationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('hostProjectRegistrationPath', () => { + const result = client.hostProjectRegistrationPath("projectValue", "locationValue", "hostProjectRegistrationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.hostProjectRegistrationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromHostProjectRegistrationName', () => { + const result = client.matchProjectFromHostProjectRegistrationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.hostProjectRegistrationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromHostProjectRegistrationName', () => { + const result = client.matchLocationFromHostProjectRegistrationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.hostProjectRegistrationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchHostProjectRegistrationFromHostProjectRegistrationName', () => { + const result = client.matchHostProjectRegistrationFromHostProjectRegistrationName(fakePath); + assert.strictEqual(result, "hostProjectRegistrationValue"); + assert((client.pathTemplates.hostProjectRegistrationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('location', () => { + const fakePath = "/rendered/path/location"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + }; + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.locationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.locationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath("projectValue", "locationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('plugin', () => { + const fakePath = "/rendered/path/plugin"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + plugin: "pluginValue", + }; + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.pluginPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.pluginPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('pluginPath', () => { + const result = client.pluginPath("projectValue", "locationValue", "pluginValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.pluginPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromPluginName', () => { + const result = client.matchProjectFromPluginName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.pluginPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromPluginName', () => { + const result = client.matchLocationFromPluginName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.pluginPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPluginFromPluginName', () => { + const result = client.matchPluginFromPluginName(fakePath); + assert.strictEqual(result, "pluginValue"); + assert((client.pathTemplates.pluginPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('project', () => { + const fakePath = "/rendered/path/project"; + const expectedParameters = { + project: "projectValue", + }; + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath("projectValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('runtimeProjectAttachment', () => { + const fakePath = "/rendered/path/runtimeProjectAttachment"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + runtime_project_attachment: "runtimeProjectAttachmentValue", + }; + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.runtimeProjectAttachmentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.runtimeProjectAttachmentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('runtimeProjectAttachmentPath', () => { + const result = client.runtimeProjectAttachmentPath("projectValue", "locationValue", "runtimeProjectAttachmentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromRuntimeProjectAttachmentName', () => { + const result = client.matchProjectFromRuntimeProjectAttachmentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromRuntimeProjectAttachmentName', () => { + const result = client.matchLocationFromRuntimeProjectAttachmentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName', () => { + const result = client.matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName(fakePath); + assert.strictEqual(result, "runtimeProjectAttachmentValue"); + assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('spec', () => { + const fakePath = "/rendered/path/spec"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + api: "apiValue", + version: "versionValue", + spec: "specValue", + }; + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.specPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.specPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('specPath', () => { + const result = client.specPath("projectValue", "locationValue", "apiValue", "versionValue", "specValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.specPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSpecName', () => { + const result = client.matchProjectFromSpecName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSpecName', () => { + const result = client.matchLocationFromSpecName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchApiFromSpecName', () => { + const result = client.matchApiFromSpecName(fakePath); + assert.strictEqual(result, "apiValue"); + assert((client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchVersionFromSpecName', () => { + const result = client.matchVersionFromSpecName(fakePath); + assert.strictEqual(result, "versionValue"); + assert((client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSpecFromSpecName', () => { + const result = client.matchSpecFromSpecName(fakePath); + assert.strictEqual(result, "specValue"); + assert((client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('styleGuide', () => { + const fakePath = "/rendered/path/styleGuide"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + plugin: "pluginValue", + }; + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.styleGuidePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.styleGuidePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('styleGuidePath', () => { + const result = client.styleGuidePath("projectValue", "locationValue", "pluginValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.styleGuidePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromStyleGuideName', () => { + const result = client.matchProjectFromStyleGuideName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.styleGuidePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromStyleGuideName', () => { + const result = client.matchLocationFromStyleGuideName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.styleGuidePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPluginFromStyleGuideName', () => { + const result = client.matchPluginFromStyleGuideName(fakePath); + assert.strictEqual(result, "pluginValue"); + assert((client.pathTemplates.styleGuidePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('version', () => { + const fakePath = "/rendered/path/version"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + api: "apiValue", + version: "versionValue", + }; + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.versionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.versionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('versionPath', () => { + const result = client.versionPath("projectValue", "locationValue", "apiValue", "versionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.versionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromVersionName', () => { + const result = client.matchProjectFromVersionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromVersionName', () => { + const result = client.matchLocationFromVersionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchApiFromVersionName', () => { + const result = client.matchApiFromVersionName(fakePath); + assert.strictEqual(result, "apiValue"); + assert((client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchVersionFromVersionName', () => { + const result = client.matchVersionFromVersionName(fakePath); + assert.strictEqual(result, "versionValue"); + assert((client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-apihub/v1/test/gapic_runtime_project_attachment_service_v1.ts b/owl-bot-staging/google-cloud-apihub/v1/test/gapic_runtime_project_attachment_service_v1.ts new file mode 100644 index 00000000000..1a71bbbdd43 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/test/gapic_runtime_project_attachment_service_v1.ts @@ -0,0 +1,1875 @@ +// Copyright 2024 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 runtimeprojectattachmentserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, 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 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.RuntimeProjectAttachmentServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'apihub.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, "googleapis.com"); + }); + + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient.servicePath; + assert.strictEqual(servicePath, 'apihub.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'apihub.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'apihub.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'apihub.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'apihub.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'apihub.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.runtimeProjectAttachmentServiceStub, undefined); + await client.initialize(); + assert(client.runtimeProjectAttachmentServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.runtimeProjectAttachmentServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.runtimeProjectAttachmentServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ + 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 runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ + 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('createRuntimeProjectAttachment', () => { + it('invokes createRuntimeProjectAttachment without error', async () => { + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.RuntimeProjectAttachment() + ); + client.innerApiCalls.createRuntimeProjectAttachment = stubSimpleCall(expectedResponse); + const [response] = await client.createRuntimeProjectAttachment(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createRuntimeProjectAttachment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createRuntimeProjectAttachment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createRuntimeProjectAttachment without error using callback', async () => { + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.RuntimeProjectAttachment() + ); + client.innerApiCalls.createRuntimeProjectAttachment = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createRuntimeProjectAttachment( + request, + (err?: Error|null, result?: protos.google.cloud.apihub.v1.IRuntimeProjectAttachment|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createRuntimeProjectAttachment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createRuntimeProjectAttachment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createRuntimeProjectAttachment with error', async () => { + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createRuntimeProjectAttachment = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createRuntimeProjectAttachment(request), expectedError); + const actualRequest = (client.innerApiCalls.createRuntimeProjectAttachment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createRuntimeProjectAttachment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createRuntimeProjectAttachment with closed client', async () => { + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createRuntimeProjectAttachment(request), expectedError); + }); + }); + + describe('getRuntimeProjectAttachment', () => { + it('invokes getRuntimeProjectAttachment without error', async () => { + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.RuntimeProjectAttachment() + ); + client.innerApiCalls.getRuntimeProjectAttachment = stubSimpleCall(expectedResponse); + const [response] = await client.getRuntimeProjectAttachment(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getRuntimeProjectAttachment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getRuntimeProjectAttachment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getRuntimeProjectAttachment without error using callback', async () => { + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.RuntimeProjectAttachment() + ); + client.innerApiCalls.getRuntimeProjectAttachment = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getRuntimeProjectAttachment( + request, + (err?: Error|null, result?: protos.google.cloud.apihub.v1.IRuntimeProjectAttachment|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getRuntimeProjectAttachment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getRuntimeProjectAttachment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getRuntimeProjectAttachment with error', async () => { + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getRuntimeProjectAttachment = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getRuntimeProjectAttachment(request), expectedError); + const actualRequest = (client.innerApiCalls.getRuntimeProjectAttachment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getRuntimeProjectAttachment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getRuntimeProjectAttachment with closed client', async () => { + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getRuntimeProjectAttachment(request), expectedError); + }); + }); + + describe('deleteRuntimeProjectAttachment', () => { + it('invokes deleteRuntimeProjectAttachment without error', async () => { + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteRuntimeProjectAttachment = stubSimpleCall(expectedResponse); + const [response] = await client.deleteRuntimeProjectAttachment(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteRuntimeProjectAttachment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteRuntimeProjectAttachment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteRuntimeProjectAttachment without error using callback', async () => { + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteRuntimeProjectAttachment = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteRuntimeProjectAttachment( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteRuntimeProjectAttachment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteRuntimeProjectAttachment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteRuntimeProjectAttachment with error', async () => { + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteRuntimeProjectAttachment = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteRuntimeProjectAttachment(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteRuntimeProjectAttachment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteRuntimeProjectAttachment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteRuntimeProjectAttachment with closed client', async () => { + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteRuntimeProjectAttachment(request), expectedError); + }); + }); + + describe('lookupRuntimeProjectAttachment', () => { + it('invokes lookupRuntimeProjectAttachment without error', async () => { + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse() + ); + client.innerApiCalls.lookupRuntimeProjectAttachment = stubSimpleCall(expectedResponse); + const [response] = await client.lookupRuntimeProjectAttachment(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.lookupRuntimeProjectAttachment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.lookupRuntimeProjectAttachment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes lookupRuntimeProjectAttachment without error using callback', async () => { + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse() + ); + client.innerApiCalls.lookupRuntimeProjectAttachment = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.lookupRuntimeProjectAttachment( + request, + (err?: Error|null, result?: protos.google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.lookupRuntimeProjectAttachment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.lookupRuntimeProjectAttachment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes lookupRuntimeProjectAttachment with error', async () => { + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.lookupRuntimeProjectAttachment = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.lookupRuntimeProjectAttachment(request), expectedError); + const actualRequest = (client.innerApiCalls.lookupRuntimeProjectAttachment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.lookupRuntimeProjectAttachment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes lookupRuntimeProjectAttachment with closed client', async () => { + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.lookupRuntimeProjectAttachment(request), expectedError); + }); + }); + + describe('listRuntimeProjectAttachments', () => { + it('invokes listRuntimeProjectAttachments without error', async () => { + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.RuntimeProjectAttachment()), + generateSampleMessage(new protos.google.cloud.apihub.v1.RuntimeProjectAttachment()), + generateSampleMessage(new protos.google.cloud.apihub.v1.RuntimeProjectAttachment()), + ]; + client.innerApiCalls.listRuntimeProjectAttachments = stubSimpleCall(expectedResponse); + const [response] = await client.listRuntimeProjectAttachments(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listRuntimeProjectAttachments as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listRuntimeProjectAttachments as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listRuntimeProjectAttachments without error using callback', async () => { + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.RuntimeProjectAttachment()), + generateSampleMessage(new protos.google.cloud.apihub.v1.RuntimeProjectAttachment()), + generateSampleMessage(new protos.google.cloud.apihub.v1.RuntimeProjectAttachment()), + ]; + client.innerApiCalls.listRuntimeProjectAttachments = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listRuntimeProjectAttachments( + request, + (err?: Error|null, result?: protos.google.cloud.apihub.v1.IRuntimeProjectAttachment[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listRuntimeProjectAttachments as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listRuntimeProjectAttachments as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listRuntimeProjectAttachments with error', async () => { + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listRuntimeProjectAttachments = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listRuntimeProjectAttachments(request), expectedError); + const actualRequest = (client.innerApiCalls.listRuntimeProjectAttachments as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listRuntimeProjectAttachments as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listRuntimeProjectAttachmentsStream without error', async () => { + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.RuntimeProjectAttachment()), + generateSampleMessage(new protos.google.cloud.apihub.v1.RuntimeProjectAttachment()), + generateSampleMessage(new protos.google.cloud.apihub.v1.RuntimeProjectAttachment()), + ]; + client.descriptors.page.listRuntimeProjectAttachments.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listRuntimeProjectAttachmentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.apihub.v1.RuntimeProjectAttachment[] = []; + stream.on('data', (response: protos.google.cloud.apihub.v1.RuntimeProjectAttachment) => { + 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.listRuntimeProjectAttachments.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listRuntimeProjectAttachments, request)); + assert( + (client.descriptors.page.listRuntimeProjectAttachments.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listRuntimeProjectAttachmentsStream with error', async () => { + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listRuntimeProjectAttachments.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listRuntimeProjectAttachmentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.apihub.v1.RuntimeProjectAttachment[] = []; + stream.on('data', (response: protos.google.cloud.apihub.v1.RuntimeProjectAttachment) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listRuntimeProjectAttachments.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listRuntimeProjectAttachments, request)); + assert( + (client.descriptors.page.listRuntimeProjectAttachments.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listRuntimeProjectAttachments without error', async () => { + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.RuntimeProjectAttachment()), + generateSampleMessage(new protos.google.cloud.apihub.v1.RuntimeProjectAttachment()), + generateSampleMessage(new protos.google.cloud.apihub.v1.RuntimeProjectAttachment()), + ]; + client.descriptors.page.listRuntimeProjectAttachments.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.apihub.v1.IRuntimeProjectAttachment[] = []; + const iterable = client.listRuntimeProjectAttachmentsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listRuntimeProjectAttachments.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listRuntimeProjectAttachments.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listRuntimeProjectAttachments with error', async () => { + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listRuntimeProjectAttachments.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listRuntimeProjectAttachmentsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.apihub.v1.IRuntimeProjectAttachment[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listRuntimeProjectAttachments.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listRuntimeProjectAttachments.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ + 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 runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ + 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 runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ + 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 runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ + 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 runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ + 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('Path templates', () => { + + describe('api', () => { + const fakePath = "/rendered/path/api"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + api: "apiValue", + }; + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.apiPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.apiPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('apiPath', () => { + const result = client.apiPath("projectValue", "locationValue", "apiValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.apiPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromApiName', () => { + const result = client.matchProjectFromApiName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.apiPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromApiName', () => { + const result = client.matchLocationFromApiName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.apiPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchApiFromApiName', () => { + const result = client.matchApiFromApiName(fakePath); + assert.strictEqual(result, "apiValue"); + assert((client.pathTemplates.apiPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('apiHubInstance', () => { + const fakePath = "/rendered/path/apiHubInstance"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + api_hub_instance: "apiHubInstanceValue", + }; + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.apiHubInstancePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.apiHubInstancePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('apiHubInstancePath', () => { + const result = client.apiHubInstancePath("projectValue", "locationValue", "apiHubInstanceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.apiHubInstancePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromApiHubInstanceName', () => { + const result = client.matchProjectFromApiHubInstanceName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromApiHubInstanceName', () => { + const result = client.matchLocationFromApiHubInstanceName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchApiHubInstanceFromApiHubInstanceName', () => { + const result = client.matchApiHubInstanceFromApiHubInstanceName(fakePath); + assert.strictEqual(result, "apiHubInstanceValue"); + assert((client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('apiOperation', () => { + const fakePath = "/rendered/path/apiOperation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + api: "apiValue", + version: "versionValue", + operation: "operationValue", + }; + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.apiOperationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.apiOperationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('apiOperationPath', () => { + const result = client.apiOperationPath("projectValue", "locationValue", "apiValue", "versionValue", "operationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.apiOperationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromApiOperationName', () => { + const result = client.matchProjectFromApiOperationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromApiOperationName', () => { + const result = client.matchLocationFromApiOperationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchApiFromApiOperationName', () => { + const result = client.matchApiFromApiOperationName(fakePath); + assert.strictEqual(result, "apiValue"); + assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchVersionFromApiOperationName', () => { + const result = client.matchVersionFromApiOperationName(fakePath); + assert.strictEqual(result, "versionValue"); + assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchOperationFromApiOperationName', () => { + const result = client.matchOperationFromApiOperationName(fakePath); + assert.strictEqual(result, "operationValue"); + assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('attribute', () => { + const fakePath = "/rendered/path/attribute"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + attribute: "attributeValue", + }; + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.attributePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.attributePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('attributePath', () => { + const result = client.attributePath("projectValue", "locationValue", "attributeValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.attributePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAttributeName', () => { + const result = client.matchProjectFromAttributeName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.attributePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAttributeName', () => { + const result = client.matchLocationFromAttributeName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.attributePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAttributeFromAttributeName', () => { + const result = client.matchAttributeFromAttributeName(fakePath); + assert.strictEqual(result, "attributeValue"); + assert((client.pathTemplates.attributePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('definition', () => { + const fakePath = "/rendered/path/definition"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + api: "apiValue", + version: "versionValue", + definition: "definitionValue", + }; + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.definitionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.definitionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('definitionPath', () => { + const result = client.definitionPath("projectValue", "locationValue", "apiValue", "versionValue", "definitionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.definitionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDefinitionName', () => { + const result = client.matchProjectFromDefinitionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDefinitionName', () => { + const result = client.matchLocationFromDefinitionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchApiFromDefinitionName', () => { + const result = client.matchApiFromDefinitionName(fakePath); + assert.strictEqual(result, "apiValue"); + assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchVersionFromDefinitionName', () => { + const result = client.matchVersionFromDefinitionName(fakePath); + assert.strictEqual(result, "versionValue"); + assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDefinitionFromDefinitionName', () => { + const result = client.matchDefinitionFromDefinitionName(fakePath); + assert.strictEqual(result, "definitionValue"); + assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dependency', () => { + const fakePath = "/rendered/path/dependency"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dependency: "dependencyValue", + }; + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dependencyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.dependencyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('dependencyPath', () => { + const result = client.dependencyPath("projectValue", "locationValue", "dependencyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.dependencyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDependencyName', () => { + const result = client.matchProjectFromDependencyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.dependencyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDependencyName', () => { + const result = client.matchLocationFromDependencyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.dependencyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDependencyFromDependencyName', () => { + const result = client.matchDependencyFromDependencyName(fakePath); + assert.strictEqual(result, "dependencyValue"); + assert((client.pathTemplates.dependencyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('deployment', () => { + const fakePath = "/rendered/path/deployment"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + deployment: "deploymentValue", + }; + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.deploymentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.deploymentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('deploymentPath', () => { + const result = client.deploymentPath("projectValue", "locationValue", "deploymentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.deploymentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDeploymentName', () => { + const result = client.matchProjectFromDeploymentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDeploymentName', () => { + const result = client.matchLocationFromDeploymentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDeploymentFromDeploymentName', () => { + const result = client.matchDeploymentFromDeploymentName(fakePath); + assert.strictEqual(result, "deploymentValue"); + assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('externalApi', () => { + const fakePath = "/rendered/path/externalApi"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + external_api: "externalApiValue", + }; + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.externalApiPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.externalApiPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('externalApiPath', () => { + const result = client.externalApiPath("projectValue", "locationValue", "externalApiValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.externalApiPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromExternalApiName', () => { + const result = client.matchProjectFromExternalApiName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.externalApiPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromExternalApiName', () => { + const result = client.matchLocationFromExternalApiName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.externalApiPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExternalApiFromExternalApiName', () => { + const result = client.matchExternalApiFromExternalApiName(fakePath); + assert.strictEqual(result, "externalApiValue"); + assert((client.pathTemplates.externalApiPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('hostProjectRegistration', () => { + const fakePath = "/rendered/path/hostProjectRegistration"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + host_project_registration: "hostProjectRegistrationValue", + }; + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.hostProjectRegistrationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.hostProjectRegistrationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('hostProjectRegistrationPath', () => { + const result = client.hostProjectRegistrationPath("projectValue", "locationValue", "hostProjectRegistrationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.hostProjectRegistrationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromHostProjectRegistrationName', () => { + const result = client.matchProjectFromHostProjectRegistrationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.hostProjectRegistrationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromHostProjectRegistrationName', () => { + const result = client.matchLocationFromHostProjectRegistrationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.hostProjectRegistrationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchHostProjectRegistrationFromHostProjectRegistrationName', () => { + const result = client.matchHostProjectRegistrationFromHostProjectRegistrationName(fakePath); + assert.strictEqual(result, "hostProjectRegistrationValue"); + assert((client.pathTemplates.hostProjectRegistrationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('location', () => { + const fakePath = "/rendered/path/location"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + }; + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.locationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.locationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath("projectValue", "locationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('plugin', () => { + const fakePath = "/rendered/path/plugin"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + plugin: "pluginValue", + }; + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.pluginPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.pluginPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('pluginPath', () => { + const result = client.pluginPath("projectValue", "locationValue", "pluginValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.pluginPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromPluginName', () => { + const result = client.matchProjectFromPluginName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.pluginPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromPluginName', () => { + const result = client.matchLocationFromPluginName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.pluginPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPluginFromPluginName', () => { + const result = client.matchPluginFromPluginName(fakePath); + assert.strictEqual(result, "pluginValue"); + assert((client.pathTemplates.pluginPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('project', () => { + const fakePath = "/rendered/path/project"; + const expectedParameters = { + project: "projectValue", + }; + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath("projectValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('runtimeProjectAttachment', () => { + const fakePath = "/rendered/path/runtimeProjectAttachment"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + runtime_project_attachment: "runtimeProjectAttachmentValue", + }; + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.runtimeProjectAttachmentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.runtimeProjectAttachmentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('runtimeProjectAttachmentPath', () => { + const result = client.runtimeProjectAttachmentPath("projectValue", "locationValue", "runtimeProjectAttachmentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromRuntimeProjectAttachmentName', () => { + const result = client.matchProjectFromRuntimeProjectAttachmentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromRuntimeProjectAttachmentName', () => { + const result = client.matchLocationFromRuntimeProjectAttachmentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName', () => { + const result = client.matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName(fakePath); + assert.strictEqual(result, "runtimeProjectAttachmentValue"); + assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('spec', () => { + const fakePath = "/rendered/path/spec"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + api: "apiValue", + version: "versionValue", + spec: "specValue", + }; + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.specPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.specPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('specPath', () => { + const result = client.specPath("projectValue", "locationValue", "apiValue", "versionValue", "specValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.specPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSpecName', () => { + const result = client.matchProjectFromSpecName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSpecName', () => { + const result = client.matchLocationFromSpecName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchApiFromSpecName', () => { + const result = client.matchApiFromSpecName(fakePath); + assert.strictEqual(result, "apiValue"); + assert((client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchVersionFromSpecName', () => { + const result = client.matchVersionFromSpecName(fakePath); + assert.strictEqual(result, "versionValue"); + assert((client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSpecFromSpecName', () => { + const result = client.matchSpecFromSpecName(fakePath); + assert.strictEqual(result, "specValue"); + assert((client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('styleGuide', () => { + const fakePath = "/rendered/path/styleGuide"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + plugin: "pluginValue", + }; + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.styleGuidePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.styleGuidePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('styleGuidePath', () => { + const result = client.styleGuidePath("projectValue", "locationValue", "pluginValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.styleGuidePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromStyleGuideName', () => { + const result = client.matchProjectFromStyleGuideName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.styleGuidePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromStyleGuideName', () => { + const result = client.matchLocationFromStyleGuideName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.styleGuidePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPluginFromStyleGuideName', () => { + const result = client.matchPluginFromStyleGuideName(fakePath); + assert.strictEqual(result, "pluginValue"); + assert((client.pathTemplates.styleGuidePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('version', () => { + const fakePath = "/rendered/path/version"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + api: "apiValue", + version: "versionValue", + }; + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.versionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.versionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('versionPath', () => { + const result = client.versionPath("projectValue", "locationValue", "apiValue", "versionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.versionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromVersionName', () => { + const result = client.matchProjectFromVersionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromVersionName', () => { + const result = client.matchLocationFromVersionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchApiFromVersionName', () => { + const result = client.matchApiFromVersionName(fakePath); + assert.strictEqual(result, "apiValue"); + assert((client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchVersionFromVersionName', () => { + const result = client.matchVersionFromVersionName(fakePath); + assert.strictEqual(result, "versionValue"); + assert((client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-apihub/v1/tsconfig.json b/owl-bot-staging/google-cloud-apihub/v1/tsconfig.json new file mode 100644 index 00000000000..c78f1c884ef --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/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/owl-bot-staging/google-cloud-apihub/v1/webpack.config.js b/owl-bot-staging/google-cloud-apihub/v1/webpack.config.js new file mode 100644 index 00000000000..6b83a6f3e3f --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/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: 'ApiHub', + filename: './api-hub.js', + }, + node: { + child_process: 'empty', + fs: 'empty', + crypto: 'empty', + }, + resolve: { + alias: { + '../../../package.json': path.resolve(__dirname, 'package.json'), + }, + extensions: ['.js', '.json', '.ts'], + }, + module: { + rules: [ + { + test: /\.tsx?$/, + use: 'ts-loader', + exclude: /node_modules/ + }, + { + test: /node_modules[\\/]@grpc[\\/]grpc-js/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]grpc/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]retry-request/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]https?-proxy-agent/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]gtoken/, + use: 'null-loader' + }, + ], + }, + mode: 'production', +}; From 545022f4d2dba65c4148cc020861f6b69f36121a Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Thu, 15 Aug 2024 21:23:17 +0000 Subject: [PATCH 04/11] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20?= =?UTF-8?q?post-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- .../google-cloud-apihub/v1/README.md | 1 - .../google-cloud-apihub/v1/package.json | 64 - ...ippet_metadata_google.cloud.apihub.v1.json | 2595 ------ .../v1/src/v1/api_hub_client.ts | 6151 -------------- .../v1/test/gapic_api_hub_dependencies_v1.ts | 1879 ----- .../v1/test/gapic_api_hub_plugin_v1.ts | 1427 ---- .../v1/test/gapic_api_hub_v1.ts | 6098 ------------- ...ic_host_project_registration_service_v1.ts | 1659 ---- .../v1/test/gapic_linting_service_v1.ts | 1539 ---- .../v1/test/gapic_provisioning_v1.ts | 1812 ---- ...c_runtime_project_attachment_service_v1.ts | 1875 ---- .../google-cloud-apihub}/.eslintignore | 4 +- .../google-cloud-apihub}/.eslintrc.json | 0 packages/google-cloud-apihub/.gitattributes | 4 + .../google-cloud-apihub}/.gitignore | 0 .../google-cloud-apihub}/.jsdoc.js | 0 .../google-cloud-apihub}/.mocharc.js | 10 +- packages/google-cloud-apihub/.nycrc | 24 + packages/google-cloud-apihub/.prettierignore | 6 + .../google-cloud-apihub}/.prettierrc.js | 7 +- .../google-cloud-apihub/CODE_OF_CONDUCT.md | 94 + packages/google-cloud-apihub/CONTRIBUTING.md | 76 + packages/google-cloud-apihub/README.md | 299 + .../cloud/apihub/v1/apihub_service.proto | 0 .../cloud/apihub/v1/common_fields.proto | 0 .../host_project_registration_service.proto | 0 .../cloud/apihub/v1/linting_service.proto | 0 .../cloud/apihub/v1/plugin_service.proto | 0 .../apihub/v1/provisioning_service.proto | 0 .../runtime_project_attachment_service.proto | 0 .../google-cloud-apihub}/protos/protos.d.ts | 9 - .../google-cloud-apihub}/protos/protos.js | 53 +- .../google-cloud-apihub}/protos/protos.json | 26 +- .../google-cloud-apihub/samples/README.md | 1094 +++ .../generated/v1/api_hub.create_api.js | 0 .../generated/v1/api_hub.create_attribute.js | 0 .../generated/v1/api_hub.create_deployment.js | 0 .../v1/api_hub.create_external_api.js | 0 .../generated/v1/api_hub.create_spec.js | 0 .../generated/v1/api_hub.create_version.js | 0 .../generated/v1/api_hub.delete_api.js | 0 .../generated/v1/api_hub.delete_attribute.js | 0 .../generated/v1/api_hub.delete_deployment.js | 0 .../v1/api_hub.delete_external_api.js | 0 .../generated/v1/api_hub.delete_spec.js | 0 .../generated/v1/api_hub.delete_version.js | 0 .../samples/generated/v1/api_hub.get_api.js | 0 .../generated/v1/api_hub.get_api_operation.js | 0 .../generated/v1/api_hub.get_attribute.js | 0 .../generated/v1/api_hub.get_definition.js | 0 .../generated/v1/api_hub.get_deployment.js | 0 .../generated/v1/api_hub.get_external_api.js | 0 .../samples/generated/v1/api_hub.get_spec.js | 0 .../generated/v1/api_hub.get_spec_contents.js | 0 .../generated/v1/api_hub.get_version.js | 0 .../v1/api_hub.list_api_operations.js | 0 .../samples/generated/v1/api_hub.list_apis.js | 0 .../generated/v1/api_hub.list_attributes.js | 0 .../generated/v1/api_hub.list_deployments.js | 0 .../v1/api_hub.list_external_apis.js | 0 .../generated/v1/api_hub.list_specs.js | 0 .../generated/v1/api_hub.list_versions.js | 0 .../generated/v1/api_hub.search_resources.js | 0 .../generated/v1/api_hub.update_api.js | 0 .../generated/v1/api_hub.update_attribute.js | 0 .../generated/v1/api_hub.update_deployment.js | 0 .../v1/api_hub.update_external_api.js | 0 .../generated/v1/api_hub.update_spec.js | 0 .../generated/v1/api_hub.update_version.js | 0 .../api_hub_dependencies.create_dependency.js | 0 .../api_hub_dependencies.delete_dependency.js | 0 .../v1/api_hub_dependencies.get_dependency.js | 0 .../api_hub_dependencies.list_dependencies.js | 0 .../api_hub_dependencies.update_dependency.js | 0 .../v1/api_hub_plugin.disable_plugin.js | 0 .../v1/api_hub_plugin.enable_plugin.js | 0 .../generated/v1/api_hub_plugin.get_plugin.js | 0 ...ervice.create_host_project_registration.js | 0 ...n_service.get_host_project_registration.js | 0 ...service.list_host_project_registrations.js | 0 .../v1/linting_service.get_style_guide.js | 0 ...inting_service.get_style_guide_contents.js | 0 .../generated/v1/linting_service.lint_spec.js | 0 .../v1/linting_service.update_style_guide.js | 0 .../provisioning.create_api_hub_instance.js | 0 .../v1/provisioning.get_api_hub_instance.js | 0 .../provisioning.lookup_api_hub_instance.js | 0 ...rvice.create_runtime_project_attachment.js | 0 ...rvice.delete_runtime_project_attachment.js | 0 ..._service.get_runtime_project_attachment.js | 0 ...ervice.list_runtime_project_attachments.js | 0 ...rvice.lookup_runtime_project_attachment.js | 0 ...ippet_metadata_google.cloud.apihub.v1.json | 2595 ++++++ .../google-cloud-apihub/samples/quickstart.js | 131 + .../samples/test/quickstart.js | 8 +- .../google-cloud-apihub}/src/index.ts | 42 +- .../src/v1/api_hub_client.ts | 6802 +++++++++++++++ .../src/v1/api_hub_client_config.json | 0 .../src/v1/api_hub_dependencies_client.ts | 1382 +-- .../api_hub_dependencies_client_config.json | 0 .../v1/api_hub_dependencies_proto_list.json | 0 .../src/v1/api_hub_plugin_client.ts | 686 +- .../src/v1/api_hub_plugin_client_config.json | 0 .../src/v1/api_hub_plugin_proto_list.json | 0 .../src/v1/api_hub_proto_list.json | 0 .../src/v1/gapic_metadata.json | 0 ...ost_project_registration_service_client.ts | 1088 ++- ...ct_registration_service_client_config.json | 0 ...oject_registration_service_proto_list.json | 0 .../google-cloud-apihub}/src/v1/index.ts | 0 .../src/v1/linting_service_client.ts | 825 +- .../src/v1/linting_service_client_config.json | 0 .../src/v1/linting_service_proto_list.json | 0 .../src/v1/provisioning_client.ts | 847 +- .../src/v1/provisioning_client_config.json | 0 .../src/v1/provisioning_proto_list.json | 0 ...ntime_project_attachment_service_client.ts | 1368 +-- ...ject_attachment_service_client_config.json | 0 ...project_attachment_service_proto_list.json | 0 .../system-test/fixtures/sample/src/index.js | 7 +- .../system-test/fixtures/sample/src/index.ts | 32 +- .../system-test/install.ts | 18 +- .../test/gapic_api_hub_dependencies_v1.ts | 2436 ++++++ .../test/gapic_api_hub_plugin_v1.ts | 1869 ++++ .../test/gapic_api_hub_v1.ts | 7516 +++++++++++++++++ ...ic_host_project_registration_service_v1.ts | 2380 ++++++ .../test/gapic_linting_service_v1.ts | 2010 +++++ .../test/gapic_provisioning_v1.ts | 2366 ++++++ ...c_runtime_project_attachment_service_v1.ts | 2682 ++++++ .../google-cloud-apihub}/tsconfig.json | 0 .../google-cloud-apihub}/webpack.config.js | 12 +- release-please-config.json | 3 +- 132 files changed, 36235 insertions(+), 27676 deletions(-) delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/README.md delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/package.json delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/snippet_metadata_google.cloud.apihub.v1.json delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_client.ts delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/test/gapic_api_hub_dependencies_v1.ts delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/test/gapic_api_hub_plugin_v1.ts delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/test/gapic_api_hub_v1.ts delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/test/gapic_host_project_registration_service_v1.ts delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/test/gapic_linting_service_v1.ts delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/test/gapic_provisioning_v1.ts delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/test/gapic_runtime_project_attachment_service_v1.ts rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/.eslintignore (68%) rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/.eslintrc.json (100%) create mode 100644 packages/google-cloud-apihub/.gitattributes rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/.gitignore (100%) rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/.jsdoc.js (100%) rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/.mocharc.js (77%) create mode 100644 packages/google-cloud-apihub/.nycrc create mode 100644 packages/google-cloud-apihub/.prettierignore rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/.prettierrc.js (70%) create mode 100644 packages/google-cloud-apihub/CODE_OF_CONDUCT.md create mode 100644 packages/google-cloud-apihub/CONTRIBUTING.md create mode 100644 packages/google-cloud-apihub/README.md rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/protos/google/cloud/apihub/v1/apihub_service.proto (100%) rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/protos/google/cloud/apihub/v1/common_fields.proto (100%) rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/protos/google/cloud/apihub/v1/host_project_registration_service.proto (100%) rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/protos/google/cloud/apihub/v1/linting_service.proto (100%) rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/protos/google/cloud/apihub/v1/plugin_service.proto (100%) rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/protos/google/cloud/apihub/v1/provisioning_service.proto (100%) rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/protos/google/cloud/apihub/v1/runtime_project_attachment_service.proto (100%) rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/protos/protos.d.ts (99%) rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/protos/protos.js (99%) rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/protos/protos.json (99%) create mode 100644 packages/google-cloud-apihub/samples/README.md rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/samples/generated/v1/api_hub.create_api.js (100%) rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/samples/generated/v1/api_hub.create_attribute.js (100%) rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/samples/generated/v1/api_hub.create_deployment.js (100%) rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/samples/generated/v1/api_hub.create_external_api.js (100%) rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/samples/generated/v1/api_hub.create_spec.js (100%) rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/samples/generated/v1/api_hub.create_version.js (100%) rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/samples/generated/v1/api_hub.delete_api.js (100%) rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/samples/generated/v1/api_hub.delete_attribute.js (100%) rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/samples/generated/v1/api_hub.delete_deployment.js (100%) rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/samples/generated/v1/api_hub.delete_external_api.js (100%) rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/samples/generated/v1/api_hub.delete_spec.js (100%) rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/samples/generated/v1/api_hub.delete_version.js (100%) rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/samples/generated/v1/api_hub.get_api.js (100%) rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/samples/generated/v1/api_hub.get_api_operation.js (100%) rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/samples/generated/v1/api_hub.get_attribute.js (100%) rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/samples/generated/v1/api_hub.get_definition.js (100%) rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/samples/generated/v1/api_hub.get_deployment.js (100%) rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/samples/generated/v1/api_hub.get_external_api.js (100%) rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/samples/generated/v1/api_hub.get_spec.js (100%) rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/samples/generated/v1/api_hub.get_spec_contents.js (100%) rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/samples/generated/v1/api_hub.get_version.js (100%) rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/samples/generated/v1/api_hub.list_api_operations.js (100%) rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/samples/generated/v1/api_hub.list_apis.js (100%) rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/samples/generated/v1/api_hub.list_attributes.js (100%) rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/samples/generated/v1/api_hub.list_deployments.js (100%) rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/samples/generated/v1/api_hub.list_external_apis.js (100%) rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/samples/generated/v1/api_hub.list_specs.js (100%) rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/samples/generated/v1/api_hub.list_versions.js (100%) rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/samples/generated/v1/api_hub.search_resources.js (100%) rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/samples/generated/v1/api_hub.update_api.js (100%) rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/samples/generated/v1/api_hub.update_attribute.js (100%) rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/samples/generated/v1/api_hub.update_deployment.js (100%) rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/samples/generated/v1/api_hub.update_external_api.js (100%) rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/samples/generated/v1/api_hub.update_spec.js (100%) rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/samples/generated/v1/api_hub.update_version.js (100%) rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/samples/generated/v1/api_hub_dependencies.create_dependency.js (100%) rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/samples/generated/v1/api_hub_dependencies.delete_dependency.js (100%) rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/samples/generated/v1/api_hub_dependencies.get_dependency.js (100%) rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/samples/generated/v1/api_hub_dependencies.list_dependencies.js (100%) rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/samples/generated/v1/api_hub_dependencies.update_dependency.js (100%) rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/samples/generated/v1/api_hub_plugin.disable_plugin.js (100%) rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/samples/generated/v1/api_hub_plugin.enable_plugin.js (100%) rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/samples/generated/v1/api_hub_plugin.get_plugin.js (100%) rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/samples/generated/v1/host_project_registration_service.create_host_project_registration.js (100%) rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/samples/generated/v1/host_project_registration_service.get_host_project_registration.js (100%) rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/samples/generated/v1/host_project_registration_service.list_host_project_registrations.js (100%) rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/samples/generated/v1/linting_service.get_style_guide.js (100%) rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/samples/generated/v1/linting_service.get_style_guide_contents.js (100%) rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/samples/generated/v1/linting_service.lint_spec.js (100%) rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/samples/generated/v1/linting_service.update_style_guide.js (100%) rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/samples/generated/v1/provisioning.create_api_hub_instance.js (100%) rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/samples/generated/v1/provisioning.get_api_hub_instance.js (100%) rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/samples/generated/v1/provisioning.lookup_api_hub_instance.js (100%) rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/samples/generated/v1/runtime_project_attachment_service.create_runtime_project_attachment.js (100%) rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/samples/generated/v1/runtime_project_attachment_service.delete_runtime_project_attachment.js (100%) rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/samples/generated/v1/runtime_project_attachment_service.get_runtime_project_attachment.js (100%) rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/samples/generated/v1/runtime_project_attachment_service.list_runtime_project_attachments.js (100%) rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/samples/generated/v1/runtime_project_attachment_service.lookup_runtime_project_attachment.js (100%) create mode 100644 packages/google-cloud-apihub/samples/generated/v1/snippet_metadata_google.cloud.apihub.v1.json create mode 100644 packages/google-cloud-apihub/samples/quickstart.js rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/src/index.ts (57%) create mode 100644 packages/google-cloud-apihub/src/v1/api_hub_client.ts rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/src/v1/api_hub_client_config.json (100%) rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/src/v1/api_hub_dependencies_client.ts (58%) rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/src/v1/api_hub_dependencies_client_config.json (100%) rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/src/v1/api_hub_dependencies_proto_list.json (100%) rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/src/v1/api_hub_plugin_client.ts (74%) rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/src/v1/api_hub_plugin_client_config.json (100%) rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/src/v1/api_hub_plugin_proto_list.json (100%) rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/src/v1/api_hub_proto_list.json (100%) rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/src/v1/gapic_metadata.json (100%) rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/src/v1/host_project_registration_service_client.ts (64%) rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/src/v1/host_project_registration_service_client_config.json (100%) rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/src/v1/host_project_registration_service_proto_list.json (100%) rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/src/v1/index.ts (100%) rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/src/v1/linting_service_client.ts (71%) rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/src/v1/linting_service_client_config.json (100%) rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/src/v1/linting_service_proto_list.json (100%) rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/src/v1/provisioning_client.ts (73%) rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/src/v1/provisioning_client_config.json (100%) rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/src/v1/provisioning_proto_list.json (100%) rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/src/v1/runtime_project_attachment_service_client.ts (59%) rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/src/v1/runtime_project_attachment_service_client_config.json (100%) rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/src/v1/runtime_project_attachment_service_proto_list.json (100%) rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/system-test/fixtures/sample/src/index.js (85%) rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/system-test/fixtures/sample/src/index.ts (72%) rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/system-test/install.ts (81%) create mode 100644 packages/google-cloud-apihub/test/gapic_api_hub_dependencies_v1.ts create mode 100644 packages/google-cloud-apihub/test/gapic_api_hub_plugin_v1.ts create mode 100644 packages/google-cloud-apihub/test/gapic_api_hub_v1.ts create mode 100644 packages/google-cloud-apihub/test/gapic_host_project_registration_service_v1.ts create mode 100644 packages/google-cloud-apihub/test/gapic_linting_service_v1.ts create mode 100644 packages/google-cloud-apihub/test/gapic_provisioning_v1.ts create mode 100644 packages/google-cloud-apihub/test/gapic_runtime_project_attachment_service_v1.ts rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/tsconfig.json (100%) rename {owl-bot-staging/google-cloud-apihub/v1 => packages/google-cloud-apihub}/webpack.config.js (89%) diff --git a/owl-bot-staging/google-cloud-apihub/v1/README.md b/owl-bot-staging/google-cloud-apihub/v1/README.md deleted file mode 100644 index dc4fd3e19f6..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/README.md +++ /dev/null @@ -1 +0,0 @@ -Apihub: Nodejs Client diff --git a/owl-bot-staging/google-cloud-apihub/v1/package.json b/owl-bot-staging/google-cloud-apihub/v1/package.json deleted file mode 100644 index 92b7f5f827b..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/package.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "name": "@google-cloud/apihub", - "version": "0.1.0", - "description": "Apihub client for Node.js", - "repository": "googleapis/nodejs-apihub", - "license": "Apache-2.0", - "author": "Google LLC", - "main": "build/src/index.js", - "files": [ - "build/src", - "build/protos" - ], - "keywords": [ - "google apis client", - "google api client", - "google apis", - "google api", - "google", - "google cloud platform", - "google cloud", - "cloud", - "google apihub", - "apihub", - "api hub", - "api hub dependencies", - "api hub plugin", - "host project registration service", - "linting service", - "provisioning", - "runtime project attachment service" - ], - "scripts": { - "clean": "gts clean", - "compile": "tsc -p . && cp -r protos build/ && minifyProtoJson", - "compile-protos": "compileProtos src", - "docs": "jsdoc -c .jsdoc.js", - "fix": "gts fix", - "lint": "gts check", - "prepare": "npm run compile-protos && npm run compile", - "system-test": "c8 mocha build/system-test", - "test": "c8 mocha build/test" - }, - "dependencies": { - "google-gax": "^4.3.4" - }, - "devDependencies": { - "@types/mocha": "^10.0.6", - "@types/node": "^20.12.12", - "@types/sinon": "^10.0.20", - "c8": "^9.1.0", - "gapic-tools": "^0.4.2", - "gts": "5.3.0", - "jsdoc": "^4.0.3", - "jsdoc-fresh": "^3.0.0", - "jsdoc-region-tag": "^3.0.0", - "mocha": "^10.4.0", - "pack-n-play": "^2.0.3", - "sinon": "^15.2.0", - "typescript": "5.1.6" - }, - "engines": { - "node": ">=v14" - } -} diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/snippet_metadata_google.cloud.apihub.v1.json b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/snippet_metadata_google.cloud.apihub.v1.json deleted file mode 100644 index 9690b6949f7..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/snippet_metadata_google.cloud.apihub.v1.json +++ /dev/null @@ -1,2595 +0,0 @@ -{ - "clientLibrary": { - "name": "nodejs-apihub", - "version": "0.1.0", - "language": "TYPESCRIPT", - "apis": [ - { - "id": "google.cloud.apihub.v1", - "version": "v1" - } - ] - }, - "snippets": [ - { - "regionTag": "apihub_v1_generated_ApiHub_CreateApi_async", - "title": "ApiHub createApi Sample", - "origin": "API_DEFINITION", - "description": " Create an API resource in the API hub. Once an API resource is created, versions can be added to it.", - "canonical": true, - "file": "api_hub.create_api.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 69, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateApi", - "fullName": "google.cloud.apihub.v1.ApiHub.CreateApi", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "api_id", - "type": "TYPE_STRING" - }, - { - "name": "api", - "type": ".google.cloud.apihub.v1.Api" - } - ], - "resultType": ".google.cloud.apihub.v1.Api", - "client": { - "shortName": "ApiHubClient", - "fullName": "google.cloud.apihub.v1.ApiHubClient" - }, - "method": { - "shortName": "CreateApi", - "fullName": "google.cloud.apihub.v1.ApiHub.CreateApi", - "service": { - "shortName": "ApiHub", - "fullName": "google.cloud.apihub.v1.ApiHub" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_ApiHub_GetApi_async", - "title": "ApiHub getApi Sample", - "origin": "API_DEFINITION", - "description": " Get API resource details including the API versions contained in it.", - "canonical": true, - "file": "api_hub.get_api.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetApi", - "fullName": "google.cloud.apihub.v1.ApiHub.GetApi", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.apihub.v1.Api", - "client": { - "shortName": "ApiHubClient", - "fullName": "google.cloud.apihub.v1.ApiHubClient" - }, - "method": { - "shortName": "GetApi", - "fullName": "google.cloud.apihub.v1.ApiHub.GetApi", - "service": { - "shortName": "ApiHub", - "fullName": "google.cloud.apihub.v1.ApiHub" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_ApiHub_ListApis_async", - "title": "ApiHub listApis Sample", - "origin": "API_DEFINITION", - "description": " List API resources in the API hub.", - "canonical": true, - "file": "api_hub.list_apis.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 138, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListApis", - "fullName": "google.cloud.apihub.v1.ApiHub.ListApis", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.apihub.v1.ListApisResponse", - "client": { - "shortName": "ApiHubClient", - "fullName": "google.cloud.apihub.v1.ApiHubClient" - }, - "method": { - "shortName": "ListApis", - "fullName": "google.cloud.apihub.v1.ApiHub.ListApis", - "service": { - "shortName": "ApiHub", - "fullName": "google.cloud.apihub.v1.ApiHub" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_ApiHub_UpdateApi_async", - "title": "ApiHub updateApi Sample", - "origin": "API_DEFINITION", - "description": " Update an API resource in the API hub. The following fields in the [API][] can be updated: * [display_name][google.cloud.apihub.v1.Api.display_name] * [description][google.cloud.apihub.v1.Api.description] * [owner][google.cloud.apihub.v1.Api.owner] * [documentation][google.cloud.apihub.v1.Api.documentation] * [target_user][google.cloud.apihub.v1.Api.target_user] * [team][google.cloud.apihub.v1.Api.team] * [business_unit][google.cloud.apihub.v1.Api.business_unit] * [maturity_level][google.cloud.apihub.v1.Api.maturity_level] * [attributes][google.cloud.apihub.v1.Api.attributes] The [update_mask][google.cloud.apihub.v1.UpdateApiRequest.update_mask] should be used to specify the fields being updated. Updating the owner field requires complete owner message and updates both owner and email fields.", - "canonical": true, - "file": "api_hub.update_api.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 61, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateApi", - "fullName": "google.cloud.apihub.v1.ApiHub.UpdateApi", - "async": true, - "parameters": [ - { - "name": "api", - "type": ".google.cloud.apihub.v1.Api" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.cloud.apihub.v1.Api", - "client": { - "shortName": "ApiHubClient", - "fullName": "google.cloud.apihub.v1.ApiHubClient" - }, - "method": { - "shortName": "UpdateApi", - "fullName": "google.cloud.apihub.v1.ApiHub.UpdateApi", - "service": { - "shortName": "ApiHub", - "fullName": "google.cloud.apihub.v1.ApiHub" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_ApiHub_DeleteApi_async", - "title": "ApiHub deleteApi Sample", - "origin": "API_DEFINITION", - "description": " Delete an API resource in the API hub. API can only be deleted if all underlying versions are deleted.", - "canonical": true, - "file": "api_hub.delete_api.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 59, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteApi", - "fullName": "google.cloud.apihub.v1.ApiHub.DeleteApi", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "force", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "ApiHubClient", - "fullName": "google.cloud.apihub.v1.ApiHubClient" - }, - "method": { - "shortName": "DeleteApi", - "fullName": "google.cloud.apihub.v1.ApiHub.DeleteApi", - "service": { - "shortName": "ApiHub", - "fullName": "google.cloud.apihub.v1.ApiHub" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_ApiHub_CreateVersion_async", - "title": "ApiHub createVersion Sample", - "origin": "API_DEFINITION", - "description": " Create an API version for an API resource in the API hub.", - "canonical": true, - "file": "api_hub.create_version.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 69, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateVersion", - "fullName": "google.cloud.apihub.v1.ApiHub.CreateVersion", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "version_id", - "type": "TYPE_STRING" - }, - { - "name": "version", - "type": ".google.cloud.apihub.v1.Version" - } - ], - "resultType": ".google.cloud.apihub.v1.Version", - "client": { - "shortName": "ApiHubClient", - "fullName": "google.cloud.apihub.v1.ApiHubClient" - }, - "method": { - "shortName": "CreateVersion", - "fullName": "google.cloud.apihub.v1.ApiHub.CreateVersion", - "service": { - "shortName": "ApiHub", - "fullName": "google.cloud.apihub.v1.ApiHub" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_ApiHub_GetVersion_async", - "title": "ApiHub getVersion Sample", - "origin": "API_DEFINITION", - "description": " Get details about the API version of an API resource. This will include information about the specs and operations present in the API version as well as the deployments linked to it.", - "canonical": true, - "file": "api_hub.get_version.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetVersion", - "fullName": "google.cloud.apihub.v1.ApiHub.GetVersion", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.apihub.v1.Version", - "client": { - "shortName": "ApiHubClient", - "fullName": "google.cloud.apihub.v1.ApiHubClient" - }, - "method": { - "shortName": "GetVersion", - "fullName": "google.cloud.apihub.v1.ApiHub.GetVersion", - "service": { - "shortName": "ApiHub", - "fullName": "google.cloud.apihub.v1.ApiHub" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_ApiHub_ListVersions_async", - "title": "ApiHub listVersions Sample", - "origin": "API_DEFINITION", - "description": " List API versions of an API resource in the API hub.", - "canonical": true, - "file": "api_hub.list_versions.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 126, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListVersions", - "fullName": "google.cloud.apihub.v1.ApiHub.ListVersions", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.apihub.v1.ListVersionsResponse", - "client": { - "shortName": "ApiHubClient", - "fullName": "google.cloud.apihub.v1.ApiHubClient" - }, - "method": { - "shortName": "ListVersions", - "fullName": "google.cloud.apihub.v1.ApiHub.ListVersions", - "service": { - "shortName": "ApiHub", - "fullName": "google.cloud.apihub.v1.ApiHub" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_ApiHub_UpdateVersion_async", - "title": "ApiHub updateVersion Sample", - "origin": "API_DEFINITION", - "description": " Update API version. The following fields in the [version][google.cloud.apihub.v1.Version] can be updated currently: * [display_name][google.cloud.apihub.v1.Version.display_name] * [description][google.cloud.apihub.v1.Version.description] * [documentation][google.cloud.apihub.v1.Version.documentation] * [deployments][google.cloud.apihub.v1.Version.deployments] * [lifecycle][google.cloud.apihub.v1.Version.lifecycle] * [compliance][google.cloud.apihub.v1.Version.compliance] * [accreditation][google.cloud.apihub.v1.Version.accreditation] * [attributes][google.cloud.apihub.v1.Version.attributes] The [update_mask][google.cloud.apihub.v1.UpdateVersionRequest.update_mask] should be used to specify the fields being updated.", - "canonical": true, - "file": "api_hub.update_version.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 61, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateVersion", - "fullName": "google.cloud.apihub.v1.ApiHub.UpdateVersion", - "async": true, - "parameters": [ - { - "name": "version", - "type": ".google.cloud.apihub.v1.Version" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.cloud.apihub.v1.Version", - "client": { - "shortName": "ApiHubClient", - "fullName": "google.cloud.apihub.v1.ApiHubClient" - }, - "method": { - "shortName": "UpdateVersion", - "fullName": "google.cloud.apihub.v1.ApiHub.UpdateVersion", - "service": { - "shortName": "ApiHub", - "fullName": "google.cloud.apihub.v1.ApiHub" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_ApiHub_DeleteVersion_async", - "title": "ApiHub deleteVersion Sample", - "origin": "API_DEFINITION", - "description": " Delete an API version. Version can only be deleted if all underlying specs, operations, definitions and linked deployments are deleted.", - "canonical": true, - "file": "api_hub.delete_version.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 60, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteVersion", - "fullName": "google.cloud.apihub.v1.ApiHub.DeleteVersion", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "force", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "ApiHubClient", - "fullName": "google.cloud.apihub.v1.ApiHubClient" - }, - "method": { - "shortName": "DeleteVersion", - "fullName": "google.cloud.apihub.v1.ApiHub.DeleteVersion", - "service": { - "shortName": "ApiHub", - "fullName": "google.cloud.apihub.v1.ApiHub" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_ApiHub_CreateSpec_async", - "title": "ApiHub createSpec Sample", - "origin": "API_DEFINITION", - "description": " Add a spec to an API version in the API hub. Multiple specs can be added to an API version. Note, while adding a spec, at least one of `contents` or `source_uri` must be provided. If `contents` is provided, then `spec_type` must also be provided. On adding a spec with contents to the version, the operations present in it will be added to the version.Note that the file contents in the spec should be of the same type as defined in the `projects/{project}/locations/{location}/attributes/system-spec-type` attribute associated with spec resource. Note that specs of various types can be uploaded, however parsing of details is supported for OpenAPI spec currently. In order to access the information parsed from the spec, use the [GetSpec][google.cloud.apihub.v1.ApiHub.GetSpec] method. In order to access the raw contents for a particular spec, use the [GetSpecContents][google.cloud.apihub.v1.ApiHub.GetSpecContents] method. In order to access the operations parsed from the spec, use the [ListAPIOperations][google.cloud.apihub.v1.ApiHub.ListApiOperations] method.", - "canonical": true, - "file": "api_hub.create_spec.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 71, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateSpec", - "fullName": "google.cloud.apihub.v1.ApiHub.CreateSpec", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "spec_id", - "type": "TYPE_STRING" - }, - { - "name": "spec", - "type": ".google.cloud.apihub.v1.Spec" - } - ], - "resultType": ".google.cloud.apihub.v1.Spec", - "client": { - "shortName": "ApiHubClient", - "fullName": "google.cloud.apihub.v1.ApiHubClient" - }, - "method": { - "shortName": "CreateSpec", - "fullName": "google.cloud.apihub.v1.ApiHub.CreateSpec", - "service": { - "shortName": "ApiHub", - "fullName": "google.cloud.apihub.v1.ApiHub" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_ApiHub_GetSpec_async", - "title": "ApiHub getSpec Sample", - "origin": "API_DEFINITION", - "description": " Get details about the information parsed from a spec. Note that this method does not return the raw spec contents. Use [GetSpecContents][google.cloud.apihub.v1.ApiHub.GetSpecContents] method to retrieve the same.", - "canonical": true, - "file": "api_hub.get_spec.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetSpec", - "fullName": "google.cloud.apihub.v1.ApiHub.GetSpec", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.apihub.v1.Spec", - "client": { - "shortName": "ApiHubClient", - "fullName": "google.cloud.apihub.v1.ApiHubClient" - }, - "method": { - "shortName": "GetSpec", - "fullName": "google.cloud.apihub.v1.ApiHub.GetSpec", - "service": { - "shortName": "ApiHub", - "fullName": "google.cloud.apihub.v1.ApiHub" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_ApiHub_GetSpecContents_async", - "title": "ApiHub getSpecContents Sample", - "origin": "API_DEFINITION", - "description": " Get spec contents.", - "canonical": true, - "file": "api_hub.get_spec_contents.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetSpecContents", - "fullName": "google.cloud.apihub.v1.ApiHub.GetSpecContents", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.apihub.v1.SpecContents", - "client": { - "shortName": "ApiHubClient", - "fullName": "google.cloud.apihub.v1.ApiHubClient" - }, - "method": { - "shortName": "GetSpecContents", - "fullName": "google.cloud.apihub.v1.ApiHub.GetSpecContents", - "service": { - "shortName": "ApiHub", - "fullName": "google.cloud.apihub.v1.ApiHub" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_ApiHub_ListSpecs_async", - "title": "ApiHub listSpecs Sample", - "origin": "API_DEFINITION", - "description": " List specs corresponding to a particular API resource.", - "canonical": true, - "file": "api_hub.list_specs.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 119, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListSpecs", - "fullName": "google.cloud.apihub.v1.ApiHub.ListSpecs", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.apihub.v1.ListSpecsResponse", - "client": { - "shortName": "ApiHubClient", - "fullName": "google.cloud.apihub.v1.ApiHubClient" - }, - "method": { - "shortName": "ListSpecs", - "fullName": "google.cloud.apihub.v1.ApiHub.ListSpecs", - "service": { - "shortName": "ApiHub", - "fullName": "google.cloud.apihub.v1.ApiHub" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_ApiHub_UpdateSpec_async", - "title": "ApiHub updateSpec Sample", - "origin": "API_DEFINITION", - "description": " Update spec. The following fields in the [spec][google.cloud.apihub.v1.Spec] can be updated: * [display_name][google.cloud.apihub.v1.Spec.display_name] * [source_uri][google.cloud.apihub.v1.Spec.source_uri] * [lint_response][google.cloud.apihub.v1.Spec.lint_response] * [attributes][google.cloud.apihub.v1.Spec.attributes] * [contents][google.cloud.apihub.v1.Spec.contents] * [spec_type][google.cloud.apihub.v1.Spec.spec_type] In case of an OAS spec, updating spec contents can lead to: 1. Creation, deletion and update of operations. 2. Creation, deletion and update of definitions. 3. Update of other info parsed out from the new spec. In case of contents or source_uri being present in update mask, spec_type must also be present. Also, spec_type can not be present in update mask if contents or source_uri is not present. The [update_mask][google.cloud.apihub.v1.UpdateSpecRequest.update_mask] should be used to specify the fields being updated.", - "canonical": true, - "file": "api_hub.update_spec.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 61, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateSpec", - "fullName": "google.cloud.apihub.v1.ApiHub.UpdateSpec", - "async": true, - "parameters": [ - { - "name": "spec", - "type": ".google.cloud.apihub.v1.Spec" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.cloud.apihub.v1.Spec", - "client": { - "shortName": "ApiHubClient", - "fullName": "google.cloud.apihub.v1.ApiHubClient" - }, - "method": { - "shortName": "UpdateSpec", - "fullName": "google.cloud.apihub.v1.ApiHub.UpdateSpec", - "service": { - "shortName": "ApiHub", - "fullName": "google.cloud.apihub.v1.ApiHub" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_ApiHub_DeleteSpec_async", - "title": "ApiHub deleteSpec Sample", - "origin": "API_DEFINITION", - "description": " Delete a spec. Deleting a spec will also delete the associated operations from the version.", - "canonical": true, - "file": "api_hub.delete_spec.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteSpec", - "fullName": "google.cloud.apihub.v1.ApiHub.DeleteSpec", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "ApiHubClient", - "fullName": "google.cloud.apihub.v1.ApiHubClient" - }, - "method": { - "shortName": "DeleteSpec", - "fullName": "google.cloud.apihub.v1.ApiHub.DeleteSpec", - "service": { - "shortName": "ApiHub", - "fullName": "google.cloud.apihub.v1.ApiHub" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_ApiHub_GetApiOperation_async", - "title": "ApiHub getApiOperation Sample", - "origin": "API_DEFINITION", - "description": " Get details about a particular operation in API version.", - "canonical": true, - "file": "api_hub.get_api_operation.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetApiOperation", - "fullName": "google.cloud.apihub.v1.ApiHub.GetApiOperation", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.apihub.v1.ApiOperation", - "client": { - "shortName": "ApiHubClient", - "fullName": "google.cloud.apihub.v1.ApiHubClient" - }, - "method": { - "shortName": "GetApiOperation", - "fullName": "google.cloud.apihub.v1.ApiHub.GetApiOperation", - "service": { - "shortName": "ApiHub", - "fullName": "google.cloud.apihub.v1.ApiHub" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_ApiHub_ListApiOperations_async", - "title": "ApiHub listApiOperations Sample", - "origin": "API_DEFINITION", - "description": " List operations in an API version.", - "canonical": true, - "file": "api_hub.list_api_operations.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 109, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListApiOperations", - "fullName": "google.cloud.apihub.v1.ApiHub.ListApiOperations", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.apihub.v1.ListApiOperationsResponse", - "client": { - "shortName": "ApiHubClient", - "fullName": "google.cloud.apihub.v1.ApiHubClient" - }, - "method": { - "shortName": "ListApiOperations", - "fullName": "google.cloud.apihub.v1.ApiHub.ListApiOperations", - "service": { - "shortName": "ApiHub", - "fullName": "google.cloud.apihub.v1.ApiHub" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_ApiHub_GetDefinition_async", - "title": "ApiHub getDefinition Sample", - "origin": "API_DEFINITION", - "description": " Get details about a definition in an API version.", - "canonical": true, - "file": "api_hub.get_definition.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetDefinition", - "fullName": "google.cloud.apihub.v1.ApiHub.GetDefinition", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.apihub.v1.Definition", - "client": { - "shortName": "ApiHubClient", - "fullName": "google.cloud.apihub.v1.ApiHubClient" - }, - "method": { - "shortName": "GetDefinition", - "fullName": "google.cloud.apihub.v1.ApiHub.GetDefinition", - "service": { - "shortName": "ApiHub", - "fullName": "google.cloud.apihub.v1.ApiHub" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_ApiHub_CreateDeployment_async", - "title": "ApiHub createDeployment Sample", - "origin": "API_DEFINITION", - "description": " Create a deployment resource in the API hub. Once a deployment resource is created, it can be associated with API versions.", - "canonical": true, - "file": "api_hub.create_deployment.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 70, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateDeployment", - "fullName": "google.cloud.apihub.v1.ApiHub.CreateDeployment", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "deployment_id", - "type": "TYPE_STRING" - }, - { - "name": "deployment", - "type": ".google.cloud.apihub.v1.Deployment" - } - ], - "resultType": ".google.cloud.apihub.v1.Deployment", - "client": { - "shortName": "ApiHubClient", - "fullName": "google.cloud.apihub.v1.ApiHubClient" - }, - "method": { - "shortName": "CreateDeployment", - "fullName": "google.cloud.apihub.v1.ApiHub.CreateDeployment", - "service": { - "shortName": "ApiHub", - "fullName": "google.cloud.apihub.v1.ApiHub" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_ApiHub_GetDeployment_async", - "title": "ApiHub getDeployment Sample", - "origin": "API_DEFINITION", - "description": " Get details about a deployment and the API versions linked to it.", - "canonical": true, - "file": "api_hub.get_deployment.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetDeployment", - "fullName": "google.cloud.apihub.v1.ApiHub.GetDeployment", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.apihub.v1.Deployment", - "client": { - "shortName": "ApiHubClient", - "fullName": "google.cloud.apihub.v1.ApiHubClient" - }, - "method": { - "shortName": "GetDeployment", - "fullName": "google.cloud.apihub.v1.ApiHub.GetDeployment", - "service": { - "shortName": "ApiHub", - "fullName": "google.cloud.apihub.v1.ApiHub" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_ApiHub_ListDeployments_async", - "title": "ApiHub listDeployments Sample", - "origin": "API_DEFINITION", - "description": " List deployment resources in the API hub.", - "canonical": true, - "file": "api_hub.list_deployments.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 125, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListDeployments", - "fullName": "google.cloud.apihub.v1.ApiHub.ListDeployments", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.apihub.v1.ListDeploymentsResponse", - "client": { - "shortName": "ApiHubClient", - "fullName": "google.cloud.apihub.v1.ApiHubClient" - }, - "method": { - "shortName": "ListDeployments", - "fullName": "google.cloud.apihub.v1.ApiHub.ListDeployments", - "service": { - "shortName": "ApiHub", - "fullName": "google.cloud.apihub.v1.ApiHub" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_ApiHub_UpdateDeployment_async", - "title": "ApiHub updateDeployment Sample", - "origin": "API_DEFINITION", - "description": " Update a deployment resource in the API hub. The following fields in the [deployment resource][google.cloud.apihub.v1.Deployment] can be updated: * [display_name][google.cloud.apihub.v1.Deployment.display_name] * [description][google.cloud.apihub.v1.Deployment.description] * [documentation][google.cloud.apihub.v1.Deployment.documentation] * [deployment_type][google.cloud.apihub.v1.Deployment.deployment_type] * [resource_uri][google.cloud.apihub.v1.Deployment.resource_uri] * [endpoints][google.cloud.apihub.v1.Deployment.endpoints] * [slo][google.cloud.apihub.v1.Deployment.slo] * [environment][google.cloud.apihub.v1.Deployment.environment] * [attributes][google.cloud.apihub.v1.Deployment.attributes] The [update_mask][google.cloud.apihub.v1.UpdateDeploymentRequest.update_mask] should be used to specify the fields being updated.", - "canonical": true, - "file": "api_hub.update_deployment.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 61, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateDeployment", - "fullName": "google.cloud.apihub.v1.ApiHub.UpdateDeployment", - "async": true, - "parameters": [ - { - "name": "deployment", - "type": ".google.cloud.apihub.v1.Deployment" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.cloud.apihub.v1.Deployment", - "client": { - "shortName": "ApiHubClient", - "fullName": "google.cloud.apihub.v1.ApiHubClient" - }, - "method": { - "shortName": "UpdateDeployment", - "fullName": "google.cloud.apihub.v1.ApiHub.UpdateDeployment", - "service": { - "shortName": "ApiHub", - "fullName": "google.cloud.apihub.v1.ApiHub" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_ApiHub_DeleteDeployment_async", - "title": "ApiHub deleteDeployment Sample", - "origin": "API_DEFINITION", - "description": " Delete a deployment resource in the API hub.", - "canonical": true, - "file": "api_hub.delete_deployment.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteDeployment", - "fullName": "google.cloud.apihub.v1.ApiHub.DeleteDeployment", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "ApiHubClient", - "fullName": "google.cloud.apihub.v1.ApiHubClient" - }, - "method": { - "shortName": "DeleteDeployment", - "fullName": "google.cloud.apihub.v1.ApiHub.DeleteDeployment", - "service": { - "shortName": "ApiHub", - "fullName": "google.cloud.apihub.v1.ApiHub" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_ApiHub_CreateAttribute_async", - "title": "ApiHub createAttribute Sample", - "origin": "API_DEFINITION", - "description": " Create a user defined attribute. Certain pre defined attributes are already created by the API hub. These attributes will have type as `SYSTEM_DEFINED` and can be listed via [ListAttributes][google.cloud.apihub.v1.ApiHub.ListAttributes] method. Allowed values for the same can be updated via [UpdateAttribute][google.cloud.apihub.v1.ApiHub.UpdateAttribute] method.", - "canonical": true, - "file": "api_hub.create_attribute.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 70, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateAttribute", - "fullName": "google.cloud.apihub.v1.ApiHub.CreateAttribute", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "attribute_id", - "type": "TYPE_STRING" - }, - { - "name": "attribute", - "type": ".google.cloud.apihub.v1.Attribute" - } - ], - "resultType": ".google.cloud.apihub.v1.Attribute", - "client": { - "shortName": "ApiHubClient", - "fullName": "google.cloud.apihub.v1.ApiHubClient" - }, - "method": { - "shortName": "CreateAttribute", - "fullName": "google.cloud.apihub.v1.ApiHub.CreateAttribute", - "service": { - "shortName": "ApiHub", - "fullName": "google.cloud.apihub.v1.ApiHub" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_ApiHub_GetAttribute_async", - "title": "ApiHub getAttribute Sample", - "origin": "API_DEFINITION", - "description": " Get details about the attribute.", - "canonical": true, - "file": "api_hub.get_attribute.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetAttribute", - "fullName": "google.cloud.apihub.v1.ApiHub.GetAttribute", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.apihub.v1.Attribute", - "client": { - "shortName": "ApiHubClient", - "fullName": "google.cloud.apihub.v1.ApiHubClient" - }, - "method": { - "shortName": "GetAttribute", - "fullName": "google.cloud.apihub.v1.ApiHub.GetAttribute", - "service": { - "shortName": "ApiHub", - "fullName": "google.cloud.apihub.v1.ApiHub" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_ApiHub_UpdateAttribute_async", - "title": "ApiHub updateAttribute Sample", - "origin": "API_DEFINITION", - "description": " Update the attribute. The following fields in the [Attribute resource][google.cloud.apihub.v1.Attribute] can be updated: * [display_name][google.cloud.apihub.v1.Attribute.display_name] The display name can be updated for user defined attributes only. * [description][google.cloud.apihub.v1.Attribute.description] The description can be updated for user defined attributes only. * [allowed_values][google.cloud.apihub.v1.Attribute.allowed_values] To update the list of allowed values, clients need to use the fetched list of allowed values and add or remove values to or from the same list. The mutable allowed values can be updated for both user defined and System defined attributes. The immutable allowed values cannot be updated or deleted. The updated list of allowed values cannot be empty. If an allowed value that is already used by some resource's attribute is deleted, then the association between the resource and the attribute value will also be deleted. * [cardinality][google.cloud.apihub.v1.Attribute.cardinality] The cardinality can be updated for user defined attributes only. Cardinality can only be increased during an update. The [update_mask][google.cloud.apihub.v1.UpdateAttributeRequest.update_mask] should be used to specify the fields being updated.", - "canonical": true, - "file": "api_hub.update_attribute.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 61, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateAttribute", - "fullName": "google.cloud.apihub.v1.ApiHub.UpdateAttribute", - "async": true, - "parameters": [ - { - "name": "attribute", - "type": ".google.cloud.apihub.v1.Attribute" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.cloud.apihub.v1.Attribute", - "client": { - "shortName": "ApiHubClient", - "fullName": "google.cloud.apihub.v1.ApiHubClient" - }, - "method": { - "shortName": "UpdateAttribute", - "fullName": "google.cloud.apihub.v1.ApiHub.UpdateAttribute", - "service": { - "shortName": "ApiHub", - "fullName": "google.cloud.apihub.v1.ApiHub" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_ApiHub_DeleteAttribute_async", - "title": "ApiHub deleteAttribute Sample", - "origin": "API_DEFINITION", - "description": " Delete an attribute. Note: System defined attributes cannot be deleted. All associations of the attribute being deleted with any API hub resource will also get deleted.", - "canonical": true, - "file": "api_hub.delete_attribute.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteAttribute", - "fullName": "google.cloud.apihub.v1.ApiHub.DeleteAttribute", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "ApiHubClient", - "fullName": "google.cloud.apihub.v1.ApiHubClient" - }, - "method": { - "shortName": "DeleteAttribute", - "fullName": "google.cloud.apihub.v1.ApiHub.DeleteAttribute", - "service": { - "shortName": "ApiHub", - "fullName": "google.cloud.apihub.v1.ApiHub" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_ApiHub_ListAttributes_async", - "title": "ApiHub listAttributes Sample", - "origin": "API_DEFINITION", - "description": " List all attributes.", - "canonical": true, - "file": "api_hub.list_attributes.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 110, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListAttributes", - "fullName": "google.cloud.apihub.v1.ApiHub.ListAttributes", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.apihub.v1.ListAttributesResponse", - "client": { - "shortName": "ApiHubClient", - "fullName": "google.cloud.apihub.v1.ApiHubClient" - }, - "method": { - "shortName": "ListAttributes", - "fullName": "google.cloud.apihub.v1.ApiHub.ListAttributes", - "service": { - "shortName": "ApiHub", - "fullName": "google.cloud.apihub.v1.ApiHub" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_ApiHub_SearchResources_async", - "title": "ApiHub searchResources Sample", - "origin": "API_DEFINITION", - "description": " Search across API-Hub resources.", - "canonical": true, - "file": "api_hub.search_resources.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 100, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SearchResources", - "fullName": "google.cloud.apihub.v1.ApiHub.SearchResources", - "async": true, - "parameters": [ - { - "name": "location", - "type": "TYPE_STRING" - }, - { - "name": "query", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.apihub.v1.SearchResourcesResponse", - "client": { - "shortName": "ApiHubClient", - "fullName": "google.cloud.apihub.v1.ApiHubClient" - }, - "method": { - "shortName": "SearchResources", - "fullName": "google.cloud.apihub.v1.ApiHub.SearchResources", - "service": { - "shortName": "ApiHub", - "fullName": "google.cloud.apihub.v1.ApiHub" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_ApiHub_CreateExternalApi_async", - "title": "ApiHub createExternalApi Sample", - "origin": "API_DEFINITION", - "description": " Create an External API resource in the API hub.", - "canonical": true, - "file": "api_hub.create_external_api.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 71, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateExternalApi", - "fullName": "google.cloud.apihub.v1.ApiHub.CreateExternalApi", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "external_api_id", - "type": "TYPE_STRING" - }, - { - "name": "external_api", - "type": ".google.cloud.apihub.v1.ExternalApi" - } - ], - "resultType": ".google.cloud.apihub.v1.ExternalApi", - "client": { - "shortName": "ApiHubClient", - "fullName": "google.cloud.apihub.v1.ApiHubClient" - }, - "method": { - "shortName": "CreateExternalApi", - "fullName": "google.cloud.apihub.v1.ApiHub.CreateExternalApi", - "service": { - "shortName": "ApiHub", - "fullName": "google.cloud.apihub.v1.ApiHub" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_ApiHub_GetExternalApi_async", - "title": "ApiHub getExternalApi Sample", - "origin": "API_DEFINITION", - "description": " Get details about an External API resource in the API hub.", - "canonical": true, - "file": "api_hub.get_external_api.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetExternalApi", - "fullName": "google.cloud.apihub.v1.ApiHub.GetExternalApi", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.apihub.v1.ExternalApi", - "client": { - "shortName": "ApiHubClient", - "fullName": "google.cloud.apihub.v1.ApiHubClient" - }, - "method": { - "shortName": "GetExternalApi", - "fullName": "google.cloud.apihub.v1.ApiHub.GetExternalApi", - "service": { - "shortName": "ApiHub", - "fullName": "google.cloud.apihub.v1.ApiHub" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_ApiHub_UpdateExternalApi_async", - "title": "ApiHub updateExternalApi Sample", - "origin": "API_DEFINITION", - "description": " Update an External API resource in the API hub. The following fields can be updated: * [display_name][google.cloud.apihub.v1.ExternalApi.display_name] * [description][google.cloud.apihub.v1.ExternalApi.description] * [documentation][google.cloud.apihub.v1.ExternalApi.documentation] * [endpoints][google.cloud.apihub.v1.ExternalApi.endpoints] * [paths][google.cloud.apihub.v1.ExternalApi.paths] The [update_mask][google.cloud.apihub.v1.UpdateExternalApiRequest.update_mask] should be used to specify the fields being updated.", - "canonical": true, - "file": "api_hub.update_external_api.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 61, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateExternalApi", - "fullName": "google.cloud.apihub.v1.ApiHub.UpdateExternalApi", - "async": true, - "parameters": [ - { - "name": "external_api", - "type": ".google.cloud.apihub.v1.ExternalApi" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.cloud.apihub.v1.ExternalApi", - "client": { - "shortName": "ApiHubClient", - "fullName": "google.cloud.apihub.v1.ApiHubClient" - }, - "method": { - "shortName": "UpdateExternalApi", - "fullName": "google.cloud.apihub.v1.ApiHub.UpdateExternalApi", - "service": { - "shortName": "ApiHub", - "fullName": "google.cloud.apihub.v1.ApiHub" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_ApiHub_DeleteExternalApi_async", - "title": "ApiHub deleteExternalApi Sample", - "origin": "API_DEFINITION", - "description": " Delete an External API resource in the API hub.", - "canonical": true, - "file": "api_hub.delete_external_api.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteExternalApi", - "fullName": "google.cloud.apihub.v1.ApiHub.DeleteExternalApi", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "ApiHubClient", - "fullName": "google.cloud.apihub.v1.ApiHubClient" - }, - "method": { - "shortName": "DeleteExternalApi", - "fullName": "google.cloud.apihub.v1.ApiHub.DeleteExternalApi", - "service": { - "shortName": "ApiHub", - "fullName": "google.cloud.apihub.v1.ApiHub" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_ApiHub_ListExternalApis_async", - "title": "ApiHub listExternalApis Sample", - "origin": "API_DEFINITION", - "description": " List External API resources in the API hub.", - "canonical": true, - "file": "api_hub.list_external_apis.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 70, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListExternalApis", - "fullName": "google.cloud.apihub.v1.ApiHub.ListExternalApis", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.apihub.v1.ListExternalApisResponse", - "client": { - "shortName": "ApiHubClient", - "fullName": "google.cloud.apihub.v1.ApiHubClient" - }, - "method": { - "shortName": "ListExternalApis", - "fullName": "google.cloud.apihub.v1.ApiHub.ListExternalApis", - "service": { - "shortName": "ApiHub", - "fullName": "google.cloud.apihub.v1.ApiHub" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_ApiHubDependencies_CreateDependency_async", - "title": "ApiHub createDependency Sample", - "origin": "API_DEFINITION", - "description": " Create a dependency between two entities in the API hub.", - "canonical": true, - "file": "api_hub_dependencies.create_dependency.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 69, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateDependency", - "fullName": "google.cloud.apihub.v1.ApiHubDependencies.CreateDependency", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "dependency_id", - "type": "TYPE_STRING" - }, - { - "name": "dependency", - "type": ".google.cloud.apihub.v1.Dependency" - } - ], - "resultType": ".google.cloud.apihub.v1.Dependency", - "client": { - "shortName": "ApiHubDependenciesClient", - "fullName": "google.cloud.apihub.v1.ApiHubDependenciesClient" - }, - "method": { - "shortName": "CreateDependency", - "fullName": "google.cloud.apihub.v1.ApiHubDependencies.CreateDependency", - "service": { - "shortName": "ApiHubDependencies", - "fullName": "google.cloud.apihub.v1.ApiHubDependencies" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_ApiHubDependencies_GetDependency_async", - "title": "ApiHub getDependency Sample", - "origin": "API_DEFINITION", - "description": " Get details about a dependency resource in the API hub.", - "canonical": true, - "file": "api_hub_dependencies.get_dependency.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetDependency", - "fullName": "google.cloud.apihub.v1.ApiHubDependencies.GetDependency", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.apihub.v1.Dependency", - "client": { - "shortName": "ApiHubDependenciesClient", - "fullName": "google.cloud.apihub.v1.ApiHubDependenciesClient" - }, - "method": { - "shortName": "GetDependency", - "fullName": "google.cloud.apihub.v1.ApiHubDependencies.GetDependency", - "service": { - "shortName": "ApiHubDependencies", - "fullName": "google.cloud.apihub.v1.ApiHubDependencies" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_ApiHubDependencies_UpdateDependency_async", - "title": "ApiHub updateDependency Sample", - "origin": "API_DEFINITION", - "description": " Update a dependency based on the [update_mask][google.cloud.apihub.v1.UpdateDependencyRequest.update_mask] provided in the request. The following fields in the [dependency][google.cloud.apihub.v1.Dependency] can be updated: * [description][google.cloud.apihub.v1.Dependency.description]", - "canonical": true, - "file": "api_hub_dependencies.update_dependency.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 60, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateDependency", - "fullName": "google.cloud.apihub.v1.ApiHubDependencies.UpdateDependency", - "async": true, - "parameters": [ - { - "name": "dependency", - "type": ".google.cloud.apihub.v1.Dependency" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.cloud.apihub.v1.Dependency", - "client": { - "shortName": "ApiHubDependenciesClient", - "fullName": "google.cloud.apihub.v1.ApiHubDependenciesClient" - }, - "method": { - "shortName": "UpdateDependency", - "fullName": "google.cloud.apihub.v1.ApiHubDependencies.UpdateDependency", - "service": { - "shortName": "ApiHubDependencies", - "fullName": "google.cloud.apihub.v1.ApiHubDependencies" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_ApiHubDependencies_DeleteDependency_async", - "title": "ApiHub deleteDependency Sample", - "origin": "API_DEFINITION", - "description": " Delete the dependency resource.", - "canonical": true, - "file": "api_hub_dependencies.delete_dependency.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteDependency", - "fullName": "google.cloud.apihub.v1.ApiHubDependencies.DeleteDependency", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "ApiHubDependenciesClient", - "fullName": "google.cloud.apihub.v1.ApiHubDependenciesClient" - }, - "method": { - "shortName": "DeleteDependency", - "fullName": "google.cloud.apihub.v1.ApiHubDependencies.DeleteDependency", - "service": { - "shortName": "ApiHubDependencies", - "fullName": "google.cloud.apihub.v1.ApiHubDependencies" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_ApiHubDependencies_ListDependencies_async", - "title": "ApiHub listDependencies Sample", - "origin": "API_DEFINITION", - "description": " List dependencies based on the provided filter and pagination parameters.", - "canonical": true, - "file": "api_hub_dependencies.list_dependencies.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 102, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListDependencies", - "fullName": "google.cloud.apihub.v1.ApiHubDependencies.ListDependencies", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.apihub.v1.ListDependenciesResponse", - "client": { - "shortName": "ApiHubDependenciesClient", - "fullName": "google.cloud.apihub.v1.ApiHubDependenciesClient" - }, - "method": { - "shortName": "ListDependencies", - "fullName": "google.cloud.apihub.v1.ApiHubDependencies.ListDependencies", - "service": { - "shortName": "ApiHubDependencies", - "fullName": "google.cloud.apihub.v1.ApiHubDependencies" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_ApiHubPlugin_GetPlugin_async", - "title": "ApiHub getPlugin Sample", - "origin": "API_DEFINITION", - "description": " Get details about an API Hub plugin.", - "canonical": true, - "file": "api_hub_plugin.get_plugin.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetPlugin", - "fullName": "google.cloud.apihub.v1.ApiHubPlugin.GetPlugin", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.apihub.v1.Plugin", - "client": { - "shortName": "ApiHubPluginClient", - "fullName": "google.cloud.apihub.v1.ApiHubPluginClient" - }, - "method": { - "shortName": "GetPlugin", - "fullName": "google.cloud.apihub.v1.ApiHubPlugin.GetPlugin", - "service": { - "shortName": "ApiHubPlugin", - "fullName": "google.cloud.apihub.v1.ApiHubPlugin" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_ApiHubPlugin_EnablePlugin_async", - "title": "ApiHub enablePlugin Sample", - "origin": "API_DEFINITION", - "description": " Enables a plugin. The `state` of the plugin after enabling is `ENABLED`", - "canonical": true, - "file": "api_hub_plugin.enable_plugin.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "EnablePlugin", - "fullName": "google.cloud.apihub.v1.ApiHubPlugin.EnablePlugin", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.apihub.v1.Plugin", - "client": { - "shortName": "ApiHubPluginClient", - "fullName": "google.cloud.apihub.v1.ApiHubPluginClient" - }, - "method": { - "shortName": "EnablePlugin", - "fullName": "google.cloud.apihub.v1.ApiHubPlugin.EnablePlugin", - "service": { - "shortName": "ApiHubPlugin", - "fullName": "google.cloud.apihub.v1.ApiHubPlugin" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_ApiHubPlugin_DisablePlugin_async", - "title": "ApiHub disablePlugin Sample", - "origin": "API_DEFINITION", - "description": " Disables a plugin. The `state` of the plugin after disabling is `DISABLED`", - "canonical": true, - "file": "api_hub_plugin.disable_plugin.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DisablePlugin", - "fullName": "google.cloud.apihub.v1.ApiHubPlugin.DisablePlugin", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.apihub.v1.Plugin", - "client": { - "shortName": "ApiHubPluginClient", - "fullName": "google.cloud.apihub.v1.ApiHubPluginClient" - }, - "method": { - "shortName": "DisablePlugin", - "fullName": "google.cloud.apihub.v1.ApiHubPlugin.DisablePlugin", - "service": { - "shortName": "ApiHubPlugin", - "fullName": "google.cloud.apihub.v1.ApiHubPlugin" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_HostProjectRegistrationService_CreateHostProjectRegistration_async", - "title": "ApiHub createHostProjectRegistration Sample", - "origin": "API_DEFINITION", - "description": " Create a host project registration. A Google cloud project can be registered as a host project if it is not attached as a runtime project to another host project. A project can be registered as a host project only once. Subsequent register calls for the same project will fail.", - "canonical": true, - "file": "host_project_registration_service.create_host_project_registration.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 67, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateHostProjectRegistration", - "fullName": "google.cloud.apihub.v1.HostProjectRegistrationService.CreateHostProjectRegistration", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "host_project_registration_id", - "type": "TYPE_STRING" - }, - { - "name": "host_project_registration", - "type": ".google.cloud.apihub.v1.HostProjectRegistration" - } - ], - "resultType": ".google.cloud.apihub.v1.HostProjectRegistration", - "client": { - "shortName": "HostProjectRegistrationServiceClient", - "fullName": "google.cloud.apihub.v1.HostProjectRegistrationServiceClient" - }, - "method": { - "shortName": "CreateHostProjectRegistration", - "fullName": "google.cloud.apihub.v1.HostProjectRegistrationService.CreateHostProjectRegistration", - "service": { - "shortName": "HostProjectRegistrationService", - "fullName": "google.cloud.apihub.v1.HostProjectRegistrationService" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_HostProjectRegistrationService_GetHostProjectRegistration_async", - "title": "ApiHub getHostProjectRegistration Sample", - "origin": "API_DEFINITION", - "description": " Get a host project registration.", - "canonical": true, - "file": "host_project_registration_service.get_host_project_registration.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetHostProjectRegistration", - "fullName": "google.cloud.apihub.v1.HostProjectRegistrationService.GetHostProjectRegistration", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.apihub.v1.HostProjectRegistration", - "client": { - "shortName": "HostProjectRegistrationServiceClient", - "fullName": "google.cloud.apihub.v1.HostProjectRegistrationServiceClient" - }, - "method": { - "shortName": "GetHostProjectRegistration", - "fullName": "google.cloud.apihub.v1.HostProjectRegistrationService.GetHostProjectRegistration", - "service": { - "shortName": "HostProjectRegistrationService", - "fullName": "google.cloud.apihub.v1.HostProjectRegistrationService" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_HostProjectRegistrationService_ListHostProjectRegistrations_async", - "title": "ApiHub listHostProjectRegistrations Sample", - "origin": "API_DEFINITION", - "description": " Lists host project registrations.", - "canonical": true, - "file": "host_project_registration_service.list_host_project_registrations.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 92, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListHostProjectRegistrations", - "fullName": "google.cloud.apihub.v1.HostProjectRegistrationService.ListHostProjectRegistrations", - "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" - } - ], - "resultType": ".google.cloud.apihub.v1.ListHostProjectRegistrationsResponse", - "client": { - "shortName": "HostProjectRegistrationServiceClient", - "fullName": "google.cloud.apihub.v1.HostProjectRegistrationServiceClient" - }, - "method": { - "shortName": "ListHostProjectRegistrations", - "fullName": "google.cloud.apihub.v1.HostProjectRegistrationService.ListHostProjectRegistrations", - "service": { - "shortName": "HostProjectRegistrationService", - "fullName": "google.cloud.apihub.v1.HostProjectRegistrationService" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_LintingService_GetStyleGuide_async", - "title": "ApiHub getStyleGuide Sample", - "origin": "API_DEFINITION", - "description": " Get the style guide being used for linting.", - "canonical": true, - "file": "linting_service.get_style_guide.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetStyleGuide", - "fullName": "google.cloud.apihub.v1.LintingService.GetStyleGuide", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.apihub.v1.StyleGuide", - "client": { - "shortName": "LintingServiceClient", - "fullName": "google.cloud.apihub.v1.LintingServiceClient" - }, - "method": { - "shortName": "GetStyleGuide", - "fullName": "google.cloud.apihub.v1.LintingService.GetStyleGuide", - "service": { - "shortName": "LintingService", - "fullName": "google.cloud.apihub.v1.LintingService" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_LintingService_UpdateStyleGuide_async", - "title": "ApiHub updateStyleGuide Sample", - "origin": "API_DEFINITION", - "description": " Update the styleGuide to be used for liniting in by API hub.", - "canonical": true, - "file": "linting_service.update_style_guide.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 57, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateStyleGuide", - "fullName": "google.cloud.apihub.v1.LintingService.UpdateStyleGuide", - "async": true, - "parameters": [ - { - "name": "style_guide", - "type": ".google.cloud.apihub.v1.StyleGuide" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.cloud.apihub.v1.StyleGuide", - "client": { - "shortName": "LintingServiceClient", - "fullName": "google.cloud.apihub.v1.LintingServiceClient" - }, - "method": { - "shortName": "UpdateStyleGuide", - "fullName": "google.cloud.apihub.v1.LintingService.UpdateStyleGuide", - "service": { - "shortName": "LintingService", - "fullName": "google.cloud.apihub.v1.LintingService" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_LintingService_GetStyleGuideContents_async", - "title": "ApiHub getStyleGuideContents Sample", - "origin": "API_DEFINITION", - "description": " Get the contents of the style guide.", - "canonical": true, - "file": "linting_service.get_style_guide_contents.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 56, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetStyleGuideContents", - "fullName": "google.cloud.apihub.v1.LintingService.GetStyleGuideContents", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.apihub.v1.StyleGuideContents", - "client": { - "shortName": "LintingServiceClient", - "fullName": "google.cloud.apihub.v1.LintingServiceClient" - }, - "method": { - "shortName": "GetStyleGuideContents", - "fullName": "google.cloud.apihub.v1.LintingService.GetStyleGuideContents", - "service": { - "shortName": "LintingService", - "fullName": "google.cloud.apihub.v1.LintingService" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_LintingService_LintSpec_async", - "title": "ApiHub lintSpec Sample", - "origin": "API_DEFINITION", - "description": " Lints the requested spec and updates the corresponding API Spec with the lint response. This lint response will be available in all subsequent Get and List Spec calls to Core service.", - "canonical": true, - "file": "linting_service.lint_spec.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "LintSpec", - "fullName": "google.cloud.apihub.v1.LintingService.LintSpec", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "LintingServiceClient", - "fullName": "google.cloud.apihub.v1.LintingServiceClient" - }, - "method": { - "shortName": "LintSpec", - "fullName": "google.cloud.apihub.v1.LintingService.LintSpec", - "service": { - "shortName": "LintingService", - "fullName": "google.cloud.apihub.v1.LintingService" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_Provisioning_CreateApiHubInstance_async", - "title": "ApiHub createApiHubInstance Sample", - "origin": "API_DEFINITION", - "description": " Provisions instance resources for the API Hub.", - "canonical": true, - "file": "provisioning.create_api_hub_instance.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 68, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateApiHubInstance", - "fullName": "google.cloud.apihub.v1.Provisioning.CreateApiHubInstance", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "api_hub_instance_id", - "type": "TYPE_STRING" - }, - { - "name": "api_hub_instance", - "type": ".google.cloud.apihub.v1.ApiHubInstance" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "ProvisioningClient", - "fullName": "google.cloud.apihub.v1.ProvisioningClient" - }, - "method": { - "shortName": "CreateApiHubInstance", - "fullName": "google.cloud.apihub.v1.Provisioning.CreateApiHubInstance", - "service": { - "shortName": "Provisioning", - "fullName": "google.cloud.apihub.v1.Provisioning" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_Provisioning_GetApiHubInstance_async", - "title": "ApiHub getApiHubInstance Sample", - "origin": "API_DEFINITION", - "description": " Gets details of a single API Hub instance.", - "canonical": true, - "file": "provisioning.get_api_hub_instance.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetApiHubInstance", - "fullName": "google.cloud.apihub.v1.Provisioning.GetApiHubInstance", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.apihub.v1.ApiHubInstance", - "client": { - "shortName": "ProvisioningClient", - "fullName": "google.cloud.apihub.v1.ProvisioningClient" - }, - "method": { - "shortName": "GetApiHubInstance", - "fullName": "google.cloud.apihub.v1.Provisioning.GetApiHubInstance", - "service": { - "shortName": "Provisioning", - "fullName": "google.cloud.apihub.v1.Provisioning" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_Provisioning_LookupApiHubInstance_async", - "title": "ApiHub lookupApiHubInstance Sample", - "origin": "API_DEFINITION", - "description": " Looks up an Api Hub instance in a given GCP project. There will always be only one Api Hub instance for a GCP project across all locations.", - "canonical": true, - "file": "provisioning.lookup_api_hub_instance.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 56, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "LookupApiHubInstance", - "fullName": "google.cloud.apihub.v1.Provisioning.LookupApiHubInstance", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.apihub.v1.LookupApiHubInstanceResponse", - "client": { - "shortName": "ProvisioningClient", - "fullName": "google.cloud.apihub.v1.ProvisioningClient" - }, - "method": { - "shortName": "LookupApiHubInstance", - "fullName": "google.cloud.apihub.v1.Provisioning.LookupApiHubInstance", - "service": { - "shortName": "Provisioning", - "fullName": "google.cloud.apihub.v1.Provisioning" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_RuntimeProjectAttachmentService_CreateRuntimeProjectAttachment_async", - "title": "ApiHub createRuntimeProjectAttachment Sample", - "origin": "API_DEFINITION", - "description": " Attaches a runtime project to the host project.", - "canonical": true, - "file": "runtime_project_attachment_service.create_runtime_project_attachment.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 67, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateRuntimeProjectAttachment", - "fullName": "google.cloud.apihub.v1.RuntimeProjectAttachmentService.CreateRuntimeProjectAttachment", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "runtime_project_attachment_id", - "type": "TYPE_STRING" - }, - { - "name": "runtime_project_attachment", - "type": ".google.cloud.apihub.v1.RuntimeProjectAttachment" - } - ], - "resultType": ".google.cloud.apihub.v1.RuntimeProjectAttachment", - "client": { - "shortName": "RuntimeProjectAttachmentServiceClient", - "fullName": "google.cloud.apihub.v1.RuntimeProjectAttachmentServiceClient" - }, - "method": { - "shortName": "CreateRuntimeProjectAttachment", - "fullName": "google.cloud.apihub.v1.RuntimeProjectAttachmentService.CreateRuntimeProjectAttachment", - "service": { - "shortName": "RuntimeProjectAttachmentService", - "fullName": "google.cloud.apihub.v1.RuntimeProjectAttachmentService" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_RuntimeProjectAttachmentService_GetRuntimeProjectAttachment_async", - "title": "ApiHub getRuntimeProjectAttachment Sample", - "origin": "API_DEFINITION", - "description": " Gets a runtime project attachment.", - "canonical": true, - "file": "runtime_project_attachment_service.get_runtime_project_attachment.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetRuntimeProjectAttachment", - "fullName": "google.cloud.apihub.v1.RuntimeProjectAttachmentService.GetRuntimeProjectAttachment", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.apihub.v1.RuntimeProjectAttachment", - "client": { - "shortName": "RuntimeProjectAttachmentServiceClient", - "fullName": "google.cloud.apihub.v1.RuntimeProjectAttachmentServiceClient" - }, - "method": { - "shortName": "GetRuntimeProjectAttachment", - "fullName": "google.cloud.apihub.v1.RuntimeProjectAttachmentService.GetRuntimeProjectAttachment", - "service": { - "shortName": "RuntimeProjectAttachmentService", - "fullName": "google.cloud.apihub.v1.RuntimeProjectAttachmentService" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_RuntimeProjectAttachmentService_ListRuntimeProjectAttachments_async", - "title": "ApiHub listRuntimeProjectAttachments Sample", - "origin": "API_DEFINITION", - "description": " List runtime projects attached to the host project.", - "canonical": true, - "file": "runtime_project_attachment_service.list_runtime_project_attachments.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 92, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListRuntimeProjectAttachments", - "fullName": "google.cloud.apihub.v1.RuntimeProjectAttachmentService.ListRuntimeProjectAttachments", - "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" - } - ], - "resultType": ".google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse", - "client": { - "shortName": "RuntimeProjectAttachmentServiceClient", - "fullName": "google.cloud.apihub.v1.RuntimeProjectAttachmentServiceClient" - }, - "method": { - "shortName": "ListRuntimeProjectAttachments", - "fullName": "google.cloud.apihub.v1.RuntimeProjectAttachmentService.ListRuntimeProjectAttachments", - "service": { - "shortName": "RuntimeProjectAttachmentService", - "fullName": "google.cloud.apihub.v1.RuntimeProjectAttachmentService" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_RuntimeProjectAttachmentService_DeleteRuntimeProjectAttachment_async", - "title": "ApiHub deleteRuntimeProjectAttachment Sample", - "origin": "API_DEFINITION", - "description": " Delete a runtime project attachment in the API Hub. This call will detach the runtime project from the host project.", - "canonical": true, - "file": "runtime_project_attachment_service.delete_runtime_project_attachment.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteRuntimeProjectAttachment", - "fullName": "google.cloud.apihub.v1.RuntimeProjectAttachmentService.DeleteRuntimeProjectAttachment", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "RuntimeProjectAttachmentServiceClient", - "fullName": "google.cloud.apihub.v1.RuntimeProjectAttachmentServiceClient" - }, - "method": { - "shortName": "DeleteRuntimeProjectAttachment", - "fullName": "google.cloud.apihub.v1.RuntimeProjectAttachmentService.DeleteRuntimeProjectAttachment", - "service": { - "shortName": "RuntimeProjectAttachmentService", - "fullName": "google.cloud.apihub.v1.RuntimeProjectAttachmentService" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_RuntimeProjectAttachmentService_LookupRuntimeProjectAttachment_async", - "title": "ApiHub lookupRuntimeProjectAttachment Sample", - "origin": "API_DEFINITION", - "description": " Look up a runtime project attachment. This API can be called in the context of any project.", - "canonical": true, - "file": "runtime_project_attachment_service.lookup_runtime_project_attachment.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "LookupRuntimeProjectAttachment", - "fullName": "google.cloud.apihub.v1.RuntimeProjectAttachmentService.LookupRuntimeProjectAttachment", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse", - "client": { - "shortName": "RuntimeProjectAttachmentServiceClient", - "fullName": "google.cloud.apihub.v1.RuntimeProjectAttachmentServiceClient" - }, - "method": { - "shortName": "LookupRuntimeProjectAttachment", - "fullName": "google.cloud.apihub.v1.RuntimeProjectAttachmentService.LookupRuntimeProjectAttachment", - "service": { - "shortName": "RuntimeProjectAttachmentService", - "fullName": "google.cloud.apihub.v1.RuntimeProjectAttachmentService" - } - } - } - } - ] -} diff --git a/owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_client.ts b/owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_client.ts deleted file mode 100644 index b9accd2a212..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_client.ts +++ /dev/null @@ -1,6151 +0,0 @@ -// Copyright 2024 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, PaginationCallback, GaxCall, 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/api_hub_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './api_hub_client_config.json'; -const version = require('../../../package.json').version; - -/** - * This service provides all methods related to the API hub. - * @class - * @memberof v1 - */ -export class ApiHubClient { - 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}; - private _universeDomain: string; - private _servicePath: string; - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - locationsClient: LocationsClient; - pathTemplates: {[name: string]: gax.PathTemplate}; - apiHubStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of ApiHubClient. - * - * @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 ApiHubClient({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 ApiHubClient; - if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { - throw new Error('Please set either universe_domain or universeDomain, but not both.'); - } - const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; - this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; - this._servicePath = 'apihub.' + this._universeDomain; - const servicePath = opts?.servicePath || opts?.apiEndpoint || this._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 !== this._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 = this._servicePath; - - // Set the default scopes in auth client if needed. - if (servicePath === this._servicePath) { - this.auth.defaultScopes = staticMembers.scopes; - } - 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 === 'object' && '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 = { - apiPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apis/{api}' - ), - apiHubInstancePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apiHubInstances/{api_hub_instance}' - ), - apiOperationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}' - ), - attributePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/attributes/{attribute}' - ), - definitionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}' - ), - dependencyPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/dependencies/{dependency}' - ), - deploymentPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/deployments/{deployment}' - ), - externalApiPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/externalApis/{external_api}' - ), - hostProjectRegistrationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/hostProjectRegistrations/{host_project_registration}' - ), - locationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}' - ), - pluginPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/plugins/{plugin}' - ), - projectPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}' - ), - runtimeProjectAttachmentPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}' - ), - specPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}' - ), - styleGuidePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/plugins/{plugin}/styleGuide' - ), - versionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apis/{api}/versions/{version}' - ), - }; - - // 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 = { - listApis: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'apis'), - listVersions: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'versions'), - listSpecs: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'specs'), - listApiOperations: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'apiOperations'), - listDeployments: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'deployments'), - listAttributes: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'attributes'), - searchResources: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'searchResults'), - listExternalApis: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'externalApis') - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.apihub.v1.ApiHub', 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.apiHubStub) { - return this.apiHubStub; - } - - // Put together the "service stub" for - // google.cloud.apihub.v1.ApiHub. - this.apiHubStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.apihub.v1.ApiHub') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.apihub.v1.ApiHub, - 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 apiHubStubMethods = - ['createApi', 'getApi', 'listApis', 'updateApi', 'deleteApi', 'createVersion', 'getVersion', 'listVersions', 'updateVersion', 'deleteVersion', 'createSpec', 'getSpec', 'getSpecContents', 'listSpecs', 'updateSpec', 'deleteSpec', 'getApiOperation', 'listApiOperations', 'getDefinition', 'createDeployment', 'getDeployment', 'listDeployments', 'updateDeployment', 'deleteDeployment', 'createAttribute', 'getAttribute', 'updateAttribute', 'deleteAttribute', 'listAttributes', 'searchResources', 'createExternalApi', 'getExternalApi', 'updateExternalApi', 'deleteExternalApi', 'listExternalApis']; - for (const methodName of apiHubStubMethods) { - const callPromise = this.apiHubStub.then( - stub => (...args: Array<{}>) => { - if (this._terminated) { - return Promise.reject('The client has already been closed.'); - } - const func = stub[methodName]; - return func.apply(stub, args); - }, - (err: Error|null|undefined) => () => { - throw err; - }); - - const descriptor = - this.descriptors.page[methodName] || - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor, - this._opts.fallback - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.apiHubStub; - } - - /** - * The DNS address for this API service. - * @deprecated Use the apiEndpoint method of the client instance. - * @returns {string} The DNS address for this service. - */ - static get servicePath() { - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); - } - return 'apihub.googleapis.com'; - } - - /** - * The DNS address for this API service - same as servicePath. - * @deprecated Use the apiEndpoint method of the client instance. - * @returns {string} The DNS address for this service. - */ - static get apiEndpoint() { - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); - } - return 'apihub.googleapis.com'; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - get apiEndpoint() { - return this._servicePath; - } - - get universeDomain() { - return this._universeDomain; - } - - /** - * 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 -- - // ------------------- -/** - * Create an API resource in the API hub. - * Once an API resource is created, versions can be added to it. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource for the API resource. - * Format: `projects/{project}/locations/{location}` - * @param {string} [request.apiId] - * Optional. The ID to use for the API resource, which will become the final - * component of the API's resource name. This field is optional. - * - * * If provided, the same will be used. The service will throw an error if - * the specified id is already used by another API resource in the API hub. - * * If not provided, a system generated id will be used. - * - * This value should be 4-500 characters, and valid characters - * are /{@link protos.A-Z|a-z}[0-9]-_/. - * @param {google.cloud.apihub.v1.Api} request.api - * Required. The API resource to create. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.apihub.v1.Api|Api}. - * 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/api_hub.create_api.js - * region_tag:apihub_v1_generated_ApiHub_CreateApi_async - */ - createApi( - request?: protos.google.cloud.apihub.v1.ICreateApiRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apihub.v1.IApi, - protos.google.cloud.apihub.v1.ICreateApiRequest|undefined, {}|undefined - ]>; - createApi( - request: protos.google.cloud.apihub.v1.ICreateApiRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.apihub.v1.IApi, - protos.google.cloud.apihub.v1.ICreateApiRequest|null|undefined, - {}|null|undefined>): void; - createApi( - request: protos.google.cloud.apihub.v1.ICreateApiRequest, - callback: Callback< - protos.google.cloud.apihub.v1.IApi, - protos.google.cloud.apihub.v1.ICreateApiRequest|null|undefined, - {}|null|undefined>): void; - createApi( - request?: protos.google.cloud.apihub.v1.ICreateApiRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.apihub.v1.IApi, - protos.google.cloud.apihub.v1.ICreateApiRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.apihub.v1.IApi, - protos.google.cloud.apihub.v1.ICreateApiRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.apihub.v1.IApi, - protos.google.cloud.apihub.v1.ICreateApiRequest|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.createApi(request, options, callback); - } -/** - * Get API resource details including the API versions contained in it. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the API resource to retrieve. - * Format: `projects/{project}/locations/{location}/apis/{api}` - * @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.apihub.v1.Api|Api}. - * 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/api_hub.get_api.js - * region_tag:apihub_v1_generated_ApiHub_GetApi_async - */ - getApi( - request?: protos.google.cloud.apihub.v1.IGetApiRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apihub.v1.IApi, - protos.google.cloud.apihub.v1.IGetApiRequest|undefined, {}|undefined - ]>; - getApi( - request: protos.google.cloud.apihub.v1.IGetApiRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.apihub.v1.IApi, - protos.google.cloud.apihub.v1.IGetApiRequest|null|undefined, - {}|null|undefined>): void; - getApi( - request: protos.google.cloud.apihub.v1.IGetApiRequest, - callback: Callback< - protos.google.cloud.apihub.v1.IApi, - protos.google.cloud.apihub.v1.IGetApiRequest|null|undefined, - {}|null|undefined>): void; - getApi( - request?: protos.google.cloud.apihub.v1.IGetApiRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.apihub.v1.IApi, - protos.google.cloud.apihub.v1.IGetApiRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.apihub.v1.IApi, - protos.google.cloud.apihub.v1.IGetApiRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.apihub.v1.IApi, - protos.google.cloud.apihub.v1.IGetApiRequest|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.getApi(request, options, callback); - } -/** - * Update an API resource in the API hub. The following fields in the - * {@link protos.|API} can be updated: - * - * * {@link protos.google.cloud.apihub.v1.Api.display_name|display_name} - * * {@link protos.google.cloud.apihub.v1.Api.description|description} - * * {@link protos.google.cloud.apihub.v1.Api.owner|owner} - * * {@link protos.google.cloud.apihub.v1.Api.documentation|documentation} - * * {@link protos.google.cloud.apihub.v1.Api.target_user|target_user} - * * {@link protos.google.cloud.apihub.v1.Api.team|team} - * * {@link protos.google.cloud.apihub.v1.Api.business_unit|business_unit} - * * {@link protos.google.cloud.apihub.v1.Api.maturity_level|maturity_level} - * * {@link protos.google.cloud.apihub.v1.Api.attributes|attributes} - * - * The - * {@link protos.google.cloud.apihub.v1.UpdateApiRequest.update_mask|update_mask} - * should be used to specify the fields being updated. - * - * Updating the owner field requires complete owner message - * and updates both owner and email fields. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.apihub.v1.Api} request.api - * Required. The API resource to update. - * - * The API resource's `name` field is used to identify the API resource to - * update. - * Format: `projects/{project}/locations/{location}/apis/{api}` - * @param {google.protobuf.FieldMask} request.updateMask - * Required. The list of fields to update. - * @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.apihub.v1.Api|Api}. - * 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/api_hub.update_api.js - * region_tag:apihub_v1_generated_ApiHub_UpdateApi_async - */ - updateApi( - request?: protos.google.cloud.apihub.v1.IUpdateApiRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apihub.v1.IApi, - protos.google.cloud.apihub.v1.IUpdateApiRequest|undefined, {}|undefined - ]>; - updateApi( - request: protos.google.cloud.apihub.v1.IUpdateApiRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.apihub.v1.IApi, - protos.google.cloud.apihub.v1.IUpdateApiRequest|null|undefined, - {}|null|undefined>): void; - updateApi( - request: protos.google.cloud.apihub.v1.IUpdateApiRequest, - callback: Callback< - protos.google.cloud.apihub.v1.IApi, - protos.google.cloud.apihub.v1.IUpdateApiRequest|null|undefined, - {}|null|undefined>): void; - updateApi( - request?: protos.google.cloud.apihub.v1.IUpdateApiRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.apihub.v1.IApi, - protos.google.cloud.apihub.v1.IUpdateApiRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.apihub.v1.IApi, - protos.google.cloud.apihub.v1.IUpdateApiRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.apihub.v1.IApi, - protos.google.cloud.apihub.v1.IUpdateApiRequest|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({ - 'api.name': request.api!.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.updateApi(request, options, callback); - } -/** - * Delete an API resource in the API hub. API can only be deleted if all - * underlying versions are deleted. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the API resource to delete. - * Format: `projects/{project}/locations/{location}/apis/{api}` - * @param {boolean} [request.force] - * Optional. If set to true, any versions from this API will also be deleted. - * Otherwise, the request will only work if the API has no versions. - * @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.protobuf.Empty|Empty}. - * 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/api_hub.delete_api.js - * region_tag:apihub_v1_generated_ApiHub_DeleteApi_async - */ - deleteApi( - request?: protos.google.cloud.apihub.v1.IDeleteApiRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.IDeleteApiRequest|undefined, {}|undefined - ]>; - deleteApi( - request: protos.google.cloud.apihub.v1.IDeleteApiRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.IDeleteApiRequest|null|undefined, - {}|null|undefined>): void; - deleteApi( - request: protos.google.cloud.apihub.v1.IDeleteApiRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.IDeleteApiRequest|null|undefined, - {}|null|undefined>): void; - deleteApi( - request?: protos.google.cloud.apihub.v1.IDeleteApiRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.IDeleteApiRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.IDeleteApiRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.IDeleteApiRequest|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.deleteApi(request, options, callback); - } -/** - * Create an API version for an API resource in the API hub. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource for API version. - * Format: `projects/{project}/locations/{location}/apis/{api}` - * @param {string} [request.versionId] - * Optional. The ID to use for the API version, which will become the final - * component of the version's resource name. This field is optional. - * - * * If provided, the same will be used. The service will throw an error if - * the specified id is already used by another version in the API resource. - * * If not provided, a system generated id will be used. - * - * This value should be 4-500 characters, and valid characters - * are /{@link protos.A-Z|a-z}[0-9]-_/. - * @param {google.cloud.apihub.v1.Version} request.version - * Required. The version to create. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.apihub.v1.Version|Version}. - * 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/api_hub.create_version.js - * region_tag:apihub_v1_generated_ApiHub_CreateVersion_async - */ - createVersion( - request?: protos.google.cloud.apihub.v1.ICreateVersionRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apihub.v1.IVersion, - protos.google.cloud.apihub.v1.ICreateVersionRequest|undefined, {}|undefined - ]>; - createVersion( - request: protos.google.cloud.apihub.v1.ICreateVersionRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.apihub.v1.IVersion, - protos.google.cloud.apihub.v1.ICreateVersionRequest|null|undefined, - {}|null|undefined>): void; - createVersion( - request: protos.google.cloud.apihub.v1.ICreateVersionRequest, - callback: Callback< - protos.google.cloud.apihub.v1.IVersion, - protos.google.cloud.apihub.v1.ICreateVersionRequest|null|undefined, - {}|null|undefined>): void; - createVersion( - request?: protos.google.cloud.apihub.v1.ICreateVersionRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.apihub.v1.IVersion, - protos.google.cloud.apihub.v1.ICreateVersionRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.apihub.v1.IVersion, - protos.google.cloud.apihub.v1.ICreateVersionRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.apihub.v1.IVersion, - protos.google.cloud.apihub.v1.ICreateVersionRequest|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.createVersion(request, options, callback); - } -/** - * Get details about the API version of an API resource. This will include - * information about the specs and operations present in the API - * version as well as the deployments linked to it. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the API version to retrieve. - * Format: - * `projects/{project}/locations/{location}/apis/{api}/versions/{version}` - * @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.apihub.v1.Version|Version}. - * 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/api_hub.get_version.js - * region_tag:apihub_v1_generated_ApiHub_GetVersion_async - */ - getVersion( - request?: protos.google.cloud.apihub.v1.IGetVersionRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apihub.v1.IVersion, - protos.google.cloud.apihub.v1.IGetVersionRequest|undefined, {}|undefined - ]>; - getVersion( - request: protos.google.cloud.apihub.v1.IGetVersionRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.apihub.v1.IVersion, - protos.google.cloud.apihub.v1.IGetVersionRequest|null|undefined, - {}|null|undefined>): void; - getVersion( - request: protos.google.cloud.apihub.v1.IGetVersionRequest, - callback: Callback< - protos.google.cloud.apihub.v1.IVersion, - protos.google.cloud.apihub.v1.IGetVersionRequest|null|undefined, - {}|null|undefined>): void; - getVersion( - request?: protos.google.cloud.apihub.v1.IGetVersionRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.apihub.v1.IVersion, - protos.google.cloud.apihub.v1.IGetVersionRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.apihub.v1.IVersion, - protos.google.cloud.apihub.v1.IGetVersionRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.apihub.v1.IVersion, - protos.google.cloud.apihub.v1.IGetVersionRequest|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.getVersion(request, options, callback); - } -/** - * Update API version. The following fields in the - * {@link protos.google.cloud.apihub.v1.Version|version} can be updated currently: - * - * * {@link protos.google.cloud.apihub.v1.Version.display_name|display_name} - * * {@link protos.google.cloud.apihub.v1.Version.description|description} - * * {@link protos.google.cloud.apihub.v1.Version.documentation|documentation} - * * {@link protos.google.cloud.apihub.v1.Version.deployments|deployments} - * * {@link protos.google.cloud.apihub.v1.Version.lifecycle|lifecycle} - * * {@link protos.google.cloud.apihub.v1.Version.compliance|compliance} - * * {@link protos.google.cloud.apihub.v1.Version.accreditation|accreditation} - * * {@link protos.google.cloud.apihub.v1.Version.attributes|attributes} - * - * The - * {@link protos.google.cloud.apihub.v1.UpdateVersionRequest.update_mask|update_mask} - * should be used to specify the fields being updated. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.apihub.v1.Version} request.version - * Required. The API version to update. - * - * The version's `name` field is used to identify the API version to update. - * Format: - * `projects/{project}/locations/{location}/apis/{api}/versions/{version}` - * @param {google.protobuf.FieldMask} request.updateMask - * Required. The list of fields to update. - * @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.apihub.v1.Version|Version}. - * 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/api_hub.update_version.js - * region_tag:apihub_v1_generated_ApiHub_UpdateVersion_async - */ - updateVersion( - request?: protos.google.cloud.apihub.v1.IUpdateVersionRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apihub.v1.IVersion, - protos.google.cloud.apihub.v1.IUpdateVersionRequest|undefined, {}|undefined - ]>; - updateVersion( - request: protos.google.cloud.apihub.v1.IUpdateVersionRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.apihub.v1.IVersion, - protos.google.cloud.apihub.v1.IUpdateVersionRequest|null|undefined, - {}|null|undefined>): void; - updateVersion( - request: protos.google.cloud.apihub.v1.IUpdateVersionRequest, - callback: Callback< - protos.google.cloud.apihub.v1.IVersion, - protos.google.cloud.apihub.v1.IUpdateVersionRequest|null|undefined, - {}|null|undefined>): void; - updateVersion( - request?: protos.google.cloud.apihub.v1.IUpdateVersionRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.apihub.v1.IVersion, - protos.google.cloud.apihub.v1.IUpdateVersionRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.apihub.v1.IVersion, - protos.google.cloud.apihub.v1.IUpdateVersionRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.apihub.v1.IVersion, - protos.google.cloud.apihub.v1.IUpdateVersionRequest|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({ - 'version.name': request.version!.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.updateVersion(request, options, callback); - } -/** - * Delete an API version. Version can only be deleted if all underlying specs, - * operations, definitions and linked deployments are deleted. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the version to delete. - * Format: - * `projects/{project}/locations/{location}/apis/{api}/versions/{version}` - * @param {boolean} [request.force] - * Optional. If set to true, any specs from this version will also be deleted. - * Otherwise, the request will only work if the version has no specs. - * @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.protobuf.Empty|Empty}. - * 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/api_hub.delete_version.js - * region_tag:apihub_v1_generated_ApiHub_DeleteVersion_async - */ - deleteVersion( - request?: protos.google.cloud.apihub.v1.IDeleteVersionRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.IDeleteVersionRequest|undefined, {}|undefined - ]>; - deleteVersion( - request: protos.google.cloud.apihub.v1.IDeleteVersionRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.IDeleteVersionRequest|null|undefined, - {}|null|undefined>): void; - deleteVersion( - request: protos.google.cloud.apihub.v1.IDeleteVersionRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.IDeleteVersionRequest|null|undefined, - {}|null|undefined>): void; - deleteVersion( - request?: protos.google.cloud.apihub.v1.IDeleteVersionRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.IDeleteVersionRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.IDeleteVersionRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.IDeleteVersionRequest|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.deleteVersion(request, options, callback); - } -/** - * Add a spec to an API version in the API hub. - * Multiple specs can be added to an API version. - * Note, while adding a spec, at least one of `contents` or `source_uri` must - * be provided. If `contents` is provided, then `spec_type` must also be - * provided. - * - * On adding a spec with contents to the version, the operations present in it - * will be added to the version.Note that the file contents in the spec should - * be of the same type as defined in the - * `projects/{project}/locations/{location}/attributes/system-spec-type` - * attribute associated with spec resource. Note that specs of various types - * can be uploaded, however parsing of details is supported for OpenAPI spec - * currently. - * - * In order to access the information parsed from the spec, use the - * {@link protos.google.cloud.apihub.v1.ApiHub.GetSpec|GetSpec} method. - * In order to access the raw contents for a particular spec, use the - * {@link protos.google.cloud.apihub.v1.ApiHub.GetSpecContents|GetSpecContents} method. - * In order to access the operations parsed from the spec, use the - * {@link protos.google.cloud.apihub.v1.ApiHub.ListApiOperations|ListAPIOperations} - * method. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource for Spec. - * Format: - * `projects/{project}/locations/{location}/apis/{api}/versions/{version}` - * @param {string} [request.specId] - * Optional. The ID to use for the spec, which will become the final component - * of the spec's resource name. This field is optional. - * - * * If provided, the same will be used. The service will throw an error if - * the specified id is already used by another spec in the API - * resource. - * * If not provided, a system generated id will be used. - * - * This value should be 4-500 characters, and valid characters - * are /{@link protos.A-Z|a-z}[0-9]-_/. - * @param {google.cloud.apihub.v1.Spec} request.spec - * Required. The spec to create. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.apihub.v1.Spec|Spec}. - * 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/api_hub.create_spec.js - * region_tag:apihub_v1_generated_ApiHub_CreateSpec_async - */ - createSpec( - request?: protos.google.cloud.apihub.v1.ICreateSpecRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apihub.v1.ISpec, - protos.google.cloud.apihub.v1.ICreateSpecRequest|undefined, {}|undefined - ]>; - createSpec( - request: protos.google.cloud.apihub.v1.ICreateSpecRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.apihub.v1.ISpec, - protos.google.cloud.apihub.v1.ICreateSpecRequest|null|undefined, - {}|null|undefined>): void; - createSpec( - request: protos.google.cloud.apihub.v1.ICreateSpecRequest, - callback: Callback< - protos.google.cloud.apihub.v1.ISpec, - protos.google.cloud.apihub.v1.ICreateSpecRequest|null|undefined, - {}|null|undefined>): void; - createSpec( - request?: protos.google.cloud.apihub.v1.ICreateSpecRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.apihub.v1.ISpec, - protos.google.cloud.apihub.v1.ICreateSpecRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.apihub.v1.ISpec, - protos.google.cloud.apihub.v1.ICreateSpecRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.apihub.v1.ISpec, - protos.google.cloud.apihub.v1.ICreateSpecRequest|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.createSpec(request, options, callback); - } -/** - * Get details about the information parsed from a spec. - * Note that this method does not return the raw spec contents. - * Use {@link protos.google.cloud.apihub.v1.ApiHub.GetSpecContents|GetSpecContents} method - * to retrieve the same. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the spec to retrieve. - * Format: - * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}` - * @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.apihub.v1.Spec|Spec}. - * 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/api_hub.get_spec.js - * region_tag:apihub_v1_generated_ApiHub_GetSpec_async - */ - getSpec( - request?: protos.google.cloud.apihub.v1.IGetSpecRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apihub.v1.ISpec, - protos.google.cloud.apihub.v1.IGetSpecRequest|undefined, {}|undefined - ]>; - getSpec( - request: protos.google.cloud.apihub.v1.IGetSpecRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.apihub.v1.ISpec, - protos.google.cloud.apihub.v1.IGetSpecRequest|null|undefined, - {}|null|undefined>): void; - getSpec( - request: protos.google.cloud.apihub.v1.IGetSpecRequest, - callback: Callback< - protos.google.cloud.apihub.v1.ISpec, - protos.google.cloud.apihub.v1.IGetSpecRequest|null|undefined, - {}|null|undefined>): void; - getSpec( - request?: protos.google.cloud.apihub.v1.IGetSpecRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.apihub.v1.ISpec, - protos.google.cloud.apihub.v1.IGetSpecRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.apihub.v1.ISpec, - protos.google.cloud.apihub.v1.IGetSpecRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.apihub.v1.ISpec, - protos.google.cloud.apihub.v1.IGetSpecRequest|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.getSpec(request, options, callback); - } -/** - * Get spec contents. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the spec whose contents need to be retrieved. - * Format: - * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}` - * @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.apihub.v1.SpecContents|SpecContents}. - * 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/api_hub.get_spec_contents.js - * region_tag:apihub_v1_generated_ApiHub_GetSpecContents_async - */ - getSpecContents( - request?: protos.google.cloud.apihub.v1.IGetSpecContentsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apihub.v1.ISpecContents, - protos.google.cloud.apihub.v1.IGetSpecContentsRequest|undefined, {}|undefined - ]>; - getSpecContents( - request: protos.google.cloud.apihub.v1.IGetSpecContentsRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.apihub.v1.ISpecContents, - protos.google.cloud.apihub.v1.IGetSpecContentsRequest|null|undefined, - {}|null|undefined>): void; - getSpecContents( - request: protos.google.cloud.apihub.v1.IGetSpecContentsRequest, - callback: Callback< - protos.google.cloud.apihub.v1.ISpecContents, - protos.google.cloud.apihub.v1.IGetSpecContentsRequest|null|undefined, - {}|null|undefined>): void; - getSpecContents( - request?: protos.google.cloud.apihub.v1.IGetSpecContentsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.apihub.v1.ISpecContents, - protos.google.cloud.apihub.v1.IGetSpecContentsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.apihub.v1.ISpecContents, - protos.google.cloud.apihub.v1.IGetSpecContentsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.apihub.v1.ISpecContents, - protos.google.cloud.apihub.v1.IGetSpecContentsRequest|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.getSpecContents(request, options, callback); - } -/** - * Update spec. The following fields in the - * {@link protos.google.cloud.apihub.v1.Spec|spec} can be updated: - * - * * {@link protos.google.cloud.apihub.v1.Spec.display_name|display_name} - * * {@link protos.google.cloud.apihub.v1.Spec.source_uri|source_uri} - * * {@link protos.google.cloud.apihub.v1.Spec.lint_response|lint_response} - * * {@link protos.google.cloud.apihub.v1.Spec.attributes|attributes} - * * {@link protos.google.cloud.apihub.v1.Spec.contents|contents} - * * {@link protos.google.cloud.apihub.v1.Spec.spec_type|spec_type} - * - * In case of an OAS spec, updating spec contents can lead to: - * 1. Creation, deletion and update of operations. - * 2. Creation, deletion and update of definitions. - * 3. Update of other info parsed out from the new spec. - * - * In case of contents or source_uri being present in update mask, spec_type - * must also be present. Also, spec_type can not be present in update mask if - * contents or source_uri is not present. - * - * The - * {@link protos.google.cloud.apihub.v1.UpdateSpecRequest.update_mask|update_mask} - * should be used to specify the fields being updated. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.apihub.v1.Spec} request.spec - * Required. The spec to update. - * - * The spec's `name` field is used to identify the spec to - * update. Format: - * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}` - * @param {google.protobuf.FieldMask} request.updateMask - * Required. The list of fields to update. - * @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.apihub.v1.Spec|Spec}. - * 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/api_hub.update_spec.js - * region_tag:apihub_v1_generated_ApiHub_UpdateSpec_async - */ - updateSpec( - request?: protos.google.cloud.apihub.v1.IUpdateSpecRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apihub.v1.ISpec, - protos.google.cloud.apihub.v1.IUpdateSpecRequest|undefined, {}|undefined - ]>; - updateSpec( - request: protos.google.cloud.apihub.v1.IUpdateSpecRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.apihub.v1.ISpec, - protos.google.cloud.apihub.v1.IUpdateSpecRequest|null|undefined, - {}|null|undefined>): void; - updateSpec( - request: protos.google.cloud.apihub.v1.IUpdateSpecRequest, - callback: Callback< - protos.google.cloud.apihub.v1.ISpec, - protos.google.cloud.apihub.v1.IUpdateSpecRequest|null|undefined, - {}|null|undefined>): void; - updateSpec( - request?: protos.google.cloud.apihub.v1.IUpdateSpecRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.apihub.v1.ISpec, - protos.google.cloud.apihub.v1.IUpdateSpecRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.apihub.v1.ISpec, - protos.google.cloud.apihub.v1.IUpdateSpecRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.apihub.v1.ISpec, - protos.google.cloud.apihub.v1.IUpdateSpecRequest|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({ - 'spec.name': request.spec!.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.updateSpec(request, options, callback); - } -/** - * Delete a spec. - * Deleting a spec will also delete the associated operations from the - * version. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the spec to delete. - * Format: - * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}` - * @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.protobuf.Empty|Empty}. - * 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/api_hub.delete_spec.js - * region_tag:apihub_v1_generated_ApiHub_DeleteSpec_async - */ - deleteSpec( - request?: protos.google.cloud.apihub.v1.IDeleteSpecRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.IDeleteSpecRequest|undefined, {}|undefined - ]>; - deleteSpec( - request: protos.google.cloud.apihub.v1.IDeleteSpecRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.IDeleteSpecRequest|null|undefined, - {}|null|undefined>): void; - deleteSpec( - request: protos.google.cloud.apihub.v1.IDeleteSpecRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.IDeleteSpecRequest|null|undefined, - {}|null|undefined>): void; - deleteSpec( - request?: protos.google.cloud.apihub.v1.IDeleteSpecRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.IDeleteSpecRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.IDeleteSpecRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.IDeleteSpecRequest|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.deleteSpec(request, options, callback); - } -/** - * Get details about a particular operation in API version. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the operation to retrieve. - * Format: - * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}` - * @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.apihub.v1.ApiOperation|ApiOperation}. - * 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/api_hub.get_api_operation.js - * region_tag:apihub_v1_generated_ApiHub_GetApiOperation_async - */ - getApiOperation( - request?: protos.google.cloud.apihub.v1.IGetApiOperationRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apihub.v1.IApiOperation, - protos.google.cloud.apihub.v1.IGetApiOperationRequest|undefined, {}|undefined - ]>; - getApiOperation( - request: protos.google.cloud.apihub.v1.IGetApiOperationRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.apihub.v1.IApiOperation, - protos.google.cloud.apihub.v1.IGetApiOperationRequest|null|undefined, - {}|null|undefined>): void; - getApiOperation( - request: protos.google.cloud.apihub.v1.IGetApiOperationRequest, - callback: Callback< - protos.google.cloud.apihub.v1.IApiOperation, - protos.google.cloud.apihub.v1.IGetApiOperationRequest|null|undefined, - {}|null|undefined>): void; - getApiOperation( - request?: protos.google.cloud.apihub.v1.IGetApiOperationRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.apihub.v1.IApiOperation, - protos.google.cloud.apihub.v1.IGetApiOperationRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.apihub.v1.IApiOperation, - protos.google.cloud.apihub.v1.IGetApiOperationRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.apihub.v1.IApiOperation, - protos.google.cloud.apihub.v1.IGetApiOperationRequest|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.getApiOperation(request, options, callback); - } -/** - * Get details about a definition in an API version. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the definition to retrieve. - * Format: - * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}` - * @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.apihub.v1.Definition|Definition}. - * 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/api_hub.get_definition.js - * region_tag:apihub_v1_generated_ApiHub_GetDefinition_async - */ - getDefinition( - request?: protos.google.cloud.apihub.v1.IGetDefinitionRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apihub.v1.IDefinition, - protos.google.cloud.apihub.v1.IGetDefinitionRequest|undefined, {}|undefined - ]>; - getDefinition( - request: protos.google.cloud.apihub.v1.IGetDefinitionRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.apihub.v1.IDefinition, - protos.google.cloud.apihub.v1.IGetDefinitionRequest|null|undefined, - {}|null|undefined>): void; - getDefinition( - request: protos.google.cloud.apihub.v1.IGetDefinitionRequest, - callback: Callback< - protos.google.cloud.apihub.v1.IDefinition, - protos.google.cloud.apihub.v1.IGetDefinitionRequest|null|undefined, - {}|null|undefined>): void; - getDefinition( - request?: protos.google.cloud.apihub.v1.IGetDefinitionRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.apihub.v1.IDefinition, - protos.google.cloud.apihub.v1.IGetDefinitionRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.apihub.v1.IDefinition, - protos.google.cloud.apihub.v1.IGetDefinitionRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.apihub.v1.IDefinition, - protos.google.cloud.apihub.v1.IGetDefinitionRequest|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.getDefinition(request, options, callback); - } -/** - * Create a deployment resource in the API hub. - * Once a deployment resource is created, it can be associated with API - * versions. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource for the deployment resource. - * Format: `projects/{project}/locations/{location}` - * @param {string} [request.deploymentId] - * Optional. The ID to use for the deployment resource, which will become the - * final component of the deployment's resource name. This field is optional. - * - * * If provided, the same will be used. The service will throw an error if - * the specified id is already used by another deployment resource in the API - * hub. - * * If not provided, a system generated id will be used. - * - * This value should be 4-500 characters, and valid characters - * are /{@link protos.A-Z|a-z}[0-9]-_/. - * @param {google.cloud.apihub.v1.Deployment} request.deployment - * Required. The deployment resource to create. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.apihub.v1.Deployment|Deployment}. - * 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/api_hub.create_deployment.js - * region_tag:apihub_v1_generated_ApiHub_CreateDeployment_async - */ - createDeployment( - request?: protos.google.cloud.apihub.v1.ICreateDeploymentRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apihub.v1.IDeployment, - protos.google.cloud.apihub.v1.ICreateDeploymentRequest|undefined, {}|undefined - ]>; - createDeployment( - request: protos.google.cloud.apihub.v1.ICreateDeploymentRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.apihub.v1.IDeployment, - protos.google.cloud.apihub.v1.ICreateDeploymentRequest|null|undefined, - {}|null|undefined>): void; - createDeployment( - request: protos.google.cloud.apihub.v1.ICreateDeploymentRequest, - callback: Callback< - protos.google.cloud.apihub.v1.IDeployment, - protos.google.cloud.apihub.v1.ICreateDeploymentRequest|null|undefined, - {}|null|undefined>): void; - createDeployment( - request?: protos.google.cloud.apihub.v1.ICreateDeploymentRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.apihub.v1.IDeployment, - protos.google.cloud.apihub.v1.ICreateDeploymentRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.apihub.v1.IDeployment, - protos.google.cloud.apihub.v1.ICreateDeploymentRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.apihub.v1.IDeployment, - protos.google.cloud.apihub.v1.ICreateDeploymentRequest|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.createDeployment(request, options, callback); - } -/** - * Get details about a deployment and the API versions linked to it. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the deployment resource to retrieve. - * Format: `projects/{project}/locations/{location}/deployments/{deployment}` - * @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.apihub.v1.Deployment|Deployment}. - * 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/api_hub.get_deployment.js - * region_tag:apihub_v1_generated_ApiHub_GetDeployment_async - */ - getDeployment( - request?: protos.google.cloud.apihub.v1.IGetDeploymentRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apihub.v1.IDeployment, - protos.google.cloud.apihub.v1.IGetDeploymentRequest|undefined, {}|undefined - ]>; - getDeployment( - request: protos.google.cloud.apihub.v1.IGetDeploymentRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.apihub.v1.IDeployment, - protos.google.cloud.apihub.v1.IGetDeploymentRequest|null|undefined, - {}|null|undefined>): void; - getDeployment( - request: protos.google.cloud.apihub.v1.IGetDeploymentRequest, - callback: Callback< - protos.google.cloud.apihub.v1.IDeployment, - protos.google.cloud.apihub.v1.IGetDeploymentRequest|null|undefined, - {}|null|undefined>): void; - getDeployment( - request?: protos.google.cloud.apihub.v1.IGetDeploymentRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.apihub.v1.IDeployment, - protos.google.cloud.apihub.v1.IGetDeploymentRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.apihub.v1.IDeployment, - protos.google.cloud.apihub.v1.IGetDeploymentRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.apihub.v1.IDeployment, - protos.google.cloud.apihub.v1.IGetDeploymentRequest|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.getDeployment(request, options, callback); - } -/** - * Update a deployment resource in the API hub. The following fields in the - * {@link protos.google.cloud.apihub.v1.Deployment|deployment resource} can be - * updated: - * - * * {@link protos.google.cloud.apihub.v1.Deployment.display_name|display_name} - * * {@link protos.google.cloud.apihub.v1.Deployment.description|description} - * * {@link protos.google.cloud.apihub.v1.Deployment.documentation|documentation} - * * {@link protos.google.cloud.apihub.v1.Deployment.deployment_type|deployment_type} - * * {@link protos.google.cloud.apihub.v1.Deployment.resource_uri|resource_uri} - * * {@link protos.google.cloud.apihub.v1.Deployment.endpoints|endpoints} - * * {@link protos.google.cloud.apihub.v1.Deployment.slo|slo} - * * {@link protos.google.cloud.apihub.v1.Deployment.environment|environment} - * * {@link protos.google.cloud.apihub.v1.Deployment.attributes|attributes} - * - * The - * {@link protos.google.cloud.apihub.v1.UpdateDeploymentRequest.update_mask|update_mask} - * should be used to specify the fields being updated. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.apihub.v1.Deployment} request.deployment - * Required. The deployment resource to update. - * - * The deployment resource's `name` field is used to identify the deployment - * resource to update. - * Format: `projects/{project}/locations/{location}/deployments/{deployment}` - * @param {google.protobuf.FieldMask} request.updateMask - * Required. The list of fields to update. - * @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.apihub.v1.Deployment|Deployment}. - * 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/api_hub.update_deployment.js - * region_tag:apihub_v1_generated_ApiHub_UpdateDeployment_async - */ - updateDeployment( - request?: protos.google.cloud.apihub.v1.IUpdateDeploymentRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apihub.v1.IDeployment, - protos.google.cloud.apihub.v1.IUpdateDeploymentRequest|undefined, {}|undefined - ]>; - updateDeployment( - request: protos.google.cloud.apihub.v1.IUpdateDeploymentRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.apihub.v1.IDeployment, - protos.google.cloud.apihub.v1.IUpdateDeploymentRequest|null|undefined, - {}|null|undefined>): void; - updateDeployment( - request: protos.google.cloud.apihub.v1.IUpdateDeploymentRequest, - callback: Callback< - protos.google.cloud.apihub.v1.IDeployment, - protos.google.cloud.apihub.v1.IUpdateDeploymentRequest|null|undefined, - {}|null|undefined>): void; - updateDeployment( - request?: protos.google.cloud.apihub.v1.IUpdateDeploymentRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.apihub.v1.IDeployment, - protos.google.cloud.apihub.v1.IUpdateDeploymentRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.apihub.v1.IDeployment, - protos.google.cloud.apihub.v1.IUpdateDeploymentRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.apihub.v1.IDeployment, - protos.google.cloud.apihub.v1.IUpdateDeploymentRequest|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({ - 'deployment.name': request.deployment!.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.updateDeployment(request, options, callback); - } -/** - * Delete a deployment resource in the API hub. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the deployment resource to delete. - * Format: `projects/{project}/locations/{location}/deployments/{deployment}` - * @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.protobuf.Empty|Empty}. - * 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/api_hub.delete_deployment.js - * region_tag:apihub_v1_generated_ApiHub_DeleteDeployment_async - */ - deleteDeployment( - request?: protos.google.cloud.apihub.v1.IDeleteDeploymentRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.IDeleteDeploymentRequest|undefined, {}|undefined - ]>; - deleteDeployment( - request: protos.google.cloud.apihub.v1.IDeleteDeploymentRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.IDeleteDeploymentRequest|null|undefined, - {}|null|undefined>): void; - deleteDeployment( - request: protos.google.cloud.apihub.v1.IDeleteDeploymentRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.IDeleteDeploymentRequest|null|undefined, - {}|null|undefined>): void; - deleteDeployment( - request?: protos.google.cloud.apihub.v1.IDeleteDeploymentRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.IDeleteDeploymentRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.IDeleteDeploymentRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.IDeleteDeploymentRequest|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.deleteDeployment(request, options, callback); - } -/** - * Create a user defined attribute. - * - * Certain pre defined attributes are already created by the API hub. These - * attributes will have type as `SYSTEM_DEFINED` and can be listed via - * {@link protos.google.cloud.apihub.v1.ApiHub.ListAttributes|ListAttributes} method. - * Allowed values for the same can be updated via - * {@link protos.google.cloud.apihub.v1.ApiHub.UpdateAttribute|UpdateAttribute} method. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource for Attribute. - * Format: `projects/{project}/locations/{location}` - * @param {string} [request.attributeId] - * Optional. The ID to use for the attribute, which will become the final - * component of the attribute's resource name. This field is optional. - * - * * If provided, the same will be used. The service will throw an error if - * the specified id is already used by another attribute resource in the API - * hub. - * * If not provided, a system generated id will be used. - * - * This value should be 4-500 characters, and valid characters - * are /{@link protos.A-Z|a-z}[0-9]-_/. - * @param {google.cloud.apihub.v1.Attribute} request.attribute - * Required. The attribute to create. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.apihub.v1.Attribute|Attribute}. - * 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/api_hub.create_attribute.js - * region_tag:apihub_v1_generated_ApiHub_CreateAttribute_async - */ - createAttribute( - request?: protos.google.cloud.apihub.v1.ICreateAttributeRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apihub.v1.IAttribute, - protos.google.cloud.apihub.v1.ICreateAttributeRequest|undefined, {}|undefined - ]>; - createAttribute( - request: protos.google.cloud.apihub.v1.ICreateAttributeRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.apihub.v1.IAttribute, - protos.google.cloud.apihub.v1.ICreateAttributeRequest|null|undefined, - {}|null|undefined>): void; - createAttribute( - request: protos.google.cloud.apihub.v1.ICreateAttributeRequest, - callback: Callback< - protos.google.cloud.apihub.v1.IAttribute, - protos.google.cloud.apihub.v1.ICreateAttributeRequest|null|undefined, - {}|null|undefined>): void; - createAttribute( - request?: protos.google.cloud.apihub.v1.ICreateAttributeRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.apihub.v1.IAttribute, - protos.google.cloud.apihub.v1.ICreateAttributeRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.apihub.v1.IAttribute, - protos.google.cloud.apihub.v1.ICreateAttributeRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.apihub.v1.IAttribute, - protos.google.cloud.apihub.v1.ICreateAttributeRequest|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.createAttribute(request, options, callback); - } -/** - * Get details about the attribute. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the attribute to retrieve. - * Format: - * `projects/{project}/locations/{location}/attributes/{attribute}` - * @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.apihub.v1.Attribute|Attribute}. - * 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/api_hub.get_attribute.js - * region_tag:apihub_v1_generated_ApiHub_GetAttribute_async - */ - getAttribute( - request?: protos.google.cloud.apihub.v1.IGetAttributeRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apihub.v1.IAttribute, - protos.google.cloud.apihub.v1.IGetAttributeRequest|undefined, {}|undefined - ]>; - getAttribute( - request: protos.google.cloud.apihub.v1.IGetAttributeRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.apihub.v1.IAttribute, - protos.google.cloud.apihub.v1.IGetAttributeRequest|null|undefined, - {}|null|undefined>): void; - getAttribute( - request: protos.google.cloud.apihub.v1.IGetAttributeRequest, - callback: Callback< - protos.google.cloud.apihub.v1.IAttribute, - protos.google.cloud.apihub.v1.IGetAttributeRequest|null|undefined, - {}|null|undefined>): void; - getAttribute( - request?: protos.google.cloud.apihub.v1.IGetAttributeRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.apihub.v1.IAttribute, - protos.google.cloud.apihub.v1.IGetAttributeRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.apihub.v1.IAttribute, - protos.google.cloud.apihub.v1.IGetAttributeRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.apihub.v1.IAttribute, - protos.google.cloud.apihub.v1.IGetAttributeRequest|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.getAttribute(request, options, callback); - } -/** - * Update the attribute. The following fields in the - * {@link protos.google.cloud.apihub.v1.Attribute|Attribute resource} can be updated: - * - * * {@link protos.google.cloud.apihub.v1.Attribute.display_name|display_name} - * The display name can be updated for user defined attributes only. - * * {@link protos.google.cloud.apihub.v1.Attribute.description|description} - * The description can be updated for user defined attributes only. - * * {@link protos.google.cloud.apihub.v1.Attribute.allowed_values|allowed_values} - * To update the list of allowed values, clients need to use the fetched list - * of allowed values and add or remove values to or from the same list. - * The mutable allowed values can be updated for both user defined and System - * defined attributes. The immutable allowed values cannot be updated or - * deleted. The updated list of allowed values cannot be empty. If an allowed - * value that is already used by some resource's attribute is deleted, then - * the association between the resource and the attribute value will also be - * deleted. - * * {@link protos.google.cloud.apihub.v1.Attribute.cardinality|cardinality} - * The cardinality can be updated for user defined attributes only. - * Cardinality can only be increased during an update. - * - * The - * {@link protos.google.cloud.apihub.v1.UpdateAttributeRequest.update_mask|update_mask} - * should be used to specify the fields being updated. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.apihub.v1.Attribute} request.attribute - * Required. The attribute to update. - * - * The attribute's `name` field is used to identify the attribute to update. - * Format: - * `projects/{project}/locations/{location}/attributes/{attribute}` - * @param {google.protobuf.FieldMask} request.updateMask - * Required. The list of fields to update. - * @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.apihub.v1.Attribute|Attribute}. - * 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/api_hub.update_attribute.js - * region_tag:apihub_v1_generated_ApiHub_UpdateAttribute_async - */ - updateAttribute( - request?: protos.google.cloud.apihub.v1.IUpdateAttributeRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apihub.v1.IAttribute, - protos.google.cloud.apihub.v1.IUpdateAttributeRequest|undefined, {}|undefined - ]>; - updateAttribute( - request: protos.google.cloud.apihub.v1.IUpdateAttributeRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.apihub.v1.IAttribute, - protos.google.cloud.apihub.v1.IUpdateAttributeRequest|null|undefined, - {}|null|undefined>): void; - updateAttribute( - request: protos.google.cloud.apihub.v1.IUpdateAttributeRequest, - callback: Callback< - protos.google.cloud.apihub.v1.IAttribute, - protos.google.cloud.apihub.v1.IUpdateAttributeRequest|null|undefined, - {}|null|undefined>): void; - updateAttribute( - request?: protos.google.cloud.apihub.v1.IUpdateAttributeRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.apihub.v1.IAttribute, - protos.google.cloud.apihub.v1.IUpdateAttributeRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.apihub.v1.IAttribute, - protos.google.cloud.apihub.v1.IUpdateAttributeRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.apihub.v1.IAttribute, - protos.google.cloud.apihub.v1.IUpdateAttributeRequest|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({ - 'attribute.name': request.attribute!.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.updateAttribute(request, options, callback); - } -/** - * Delete an attribute. - * - * Note: System defined attributes cannot be deleted. All - * associations of the attribute being deleted with any API hub resource will - * also get deleted. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the attribute to delete. - * Format: - * `projects/{project}/locations/{location}/attributes/{attribute}` - * @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.protobuf.Empty|Empty}. - * 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/api_hub.delete_attribute.js - * region_tag:apihub_v1_generated_ApiHub_DeleteAttribute_async - */ - deleteAttribute( - request?: protos.google.cloud.apihub.v1.IDeleteAttributeRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.IDeleteAttributeRequest|undefined, {}|undefined - ]>; - deleteAttribute( - request: protos.google.cloud.apihub.v1.IDeleteAttributeRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.IDeleteAttributeRequest|null|undefined, - {}|null|undefined>): void; - deleteAttribute( - request: protos.google.cloud.apihub.v1.IDeleteAttributeRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.IDeleteAttributeRequest|null|undefined, - {}|null|undefined>): void; - deleteAttribute( - request?: protos.google.cloud.apihub.v1.IDeleteAttributeRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.IDeleteAttributeRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.IDeleteAttributeRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.IDeleteAttributeRequest|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.deleteAttribute(request, options, callback); - } -/** - * Create an External API resource in the API hub. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource for the External API resource. - * Format: `projects/{project}/locations/{location}` - * @param {string} [request.externalApiId] - * Optional. The ID to use for the External API resource, which will become - * the final component of the External API's resource name. This field is - * optional. - * - * * If provided, the same will be used. The service will throw an error if - * the specified id is already used by another External API resource in the - * API hub. - * * If not provided, a system generated id will be used. - * - * This value should be 4-500 characters, and valid characters - * are /{@link protos.A-Z|a-z}[0-9]-_/. - * @param {google.cloud.apihub.v1.ExternalApi} request.externalApi - * Required. The External API resource to create. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.apihub.v1.ExternalApi|ExternalApi}. - * 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/api_hub.create_external_api.js - * region_tag:apihub_v1_generated_ApiHub_CreateExternalApi_async - */ - createExternalApi( - request?: protos.google.cloud.apihub.v1.ICreateExternalApiRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apihub.v1.IExternalApi, - protos.google.cloud.apihub.v1.ICreateExternalApiRequest|undefined, {}|undefined - ]>; - createExternalApi( - request: protos.google.cloud.apihub.v1.ICreateExternalApiRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.apihub.v1.IExternalApi, - protos.google.cloud.apihub.v1.ICreateExternalApiRequest|null|undefined, - {}|null|undefined>): void; - createExternalApi( - request: protos.google.cloud.apihub.v1.ICreateExternalApiRequest, - callback: Callback< - protos.google.cloud.apihub.v1.IExternalApi, - protos.google.cloud.apihub.v1.ICreateExternalApiRequest|null|undefined, - {}|null|undefined>): void; - createExternalApi( - request?: protos.google.cloud.apihub.v1.ICreateExternalApiRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.apihub.v1.IExternalApi, - protos.google.cloud.apihub.v1.ICreateExternalApiRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.apihub.v1.IExternalApi, - protos.google.cloud.apihub.v1.ICreateExternalApiRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.apihub.v1.IExternalApi, - protos.google.cloud.apihub.v1.ICreateExternalApiRequest|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.createExternalApi(request, options, callback); - } -/** - * Get details about an External API resource in the API hub. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the External API resource to retrieve. - * Format: - * `projects/{project}/locations/{location}/externalApis/{externalApi}` - * @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.apihub.v1.ExternalApi|ExternalApi}. - * 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/api_hub.get_external_api.js - * region_tag:apihub_v1_generated_ApiHub_GetExternalApi_async - */ - getExternalApi( - request?: protos.google.cloud.apihub.v1.IGetExternalApiRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apihub.v1.IExternalApi, - protos.google.cloud.apihub.v1.IGetExternalApiRequest|undefined, {}|undefined - ]>; - getExternalApi( - request: protos.google.cloud.apihub.v1.IGetExternalApiRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.apihub.v1.IExternalApi, - protos.google.cloud.apihub.v1.IGetExternalApiRequest|null|undefined, - {}|null|undefined>): void; - getExternalApi( - request: protos.google.cloud.apihub.v1.IGetExternalApiRequest, - callback: Callback< - protos.google.cloud.apihub.v1.IExternalApi, - protos.google.cloud.apihub.v1.IGetExternalApiRequest|null|undefined, - {}|null|undefined>): void; - getExternalApi( - request?: protos.google.cloud.apihub.v1.IGetExternalApiRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.apihub.v1.IExternalApi, - protos.google.cloud.apihub.v1.IGetExternalApiRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.apihub.v1.IExternalApi, - protos.google.cloud.apihub.v1.IGetExternalApiRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.apihub.v1.IExternalApi, - protos.google.cloud.apihub.v1.IGetExternalApiRequest|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.getExternalApi(request, options, callback); - } -/** - * Update an External API resource in the API hub. The following fields can be - * updated: - * - * * {@link protos.google.cloud.apihub.v1.ExternalApi.display_name|display_name} - * * {@link protos.google.cloud.apihub.v1.ExternalApi.description|description} - * * {@link protos.google.cloud.apihub.v1.ExternalApi.documentation|documentation} - * * {@link protos.google.cloud.apihub.v1.ExternalApi.endpoints|endpoints} - * * {@link protos.google.cloud.apihub.v1.ExternalApi.paths|paths} - * - * The - * {@link protos.google.cloud.apihub.v1.UpdateExternalApiRequest.update_mask|update_mask} - * should be used to specify the fields being updated. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.apihub.v1.ExternalApi} request.externalApi - * Required. The External API resource to update. - * - * The External API resource's `name` field is used to identify the External - * API resource to update. Format: - * `projects/{project}/locations/{location}/externalApis/{externalApi}` - * @param {google.protobuf.FieldMask} request.updateMask - * Required. The list of fields to update. - * @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.apihub.v1.ExternalApi|ExternalApi}. - * 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/api_hub.update_external_api.js - * region_tag:apihub_v1_generated_ApiHub_UpdateExternalApi_async - */ - updateExternalApi( - request?: protos.google.cloud.apihub.v1.IUpdateExternalApiRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apihub.v1.IExternalApi, - protos.google.cloud.apihub.v1.IUpdateExternalApiRequest|undefined, {}|undefined - ]>; - updateExternalApi( - request: protos.google.cloud.apihub.v1.IUpdateExternalApiRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.apihub.v1.IExternalApi, - protos.google.cloud.apihub.v1.IUpdateExternalApiRequest|null|undefined, - {}|null|undefined>): void; - updateExternalApi( - request: protos.google.cloud.apihub.v1.IUpdateExternalApiRequest, - callback: Callback< - protos.google.cloud.apihub.v1.IExternalApi, - protos.google.cloud.apihub.v1.IUpdateExternalApiRequest|null|undefined, - {}|null|undefined>): void; - updateExternalApi( - request?: protos.google.cloud.apihub.v1.IUpdateExternalApiRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.apihub.v1.IExternalApi, - protos.google.cloud.apihub.v1.IUpdateExternalApiRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.apihub.v1.IExternalApi, - protos.google.cloud.apihub.v1.IUpdateExternalApiRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.apihub.v1.IExternalApi, - protos.google.cloud.apihub.v1.IUpdateExternalApiRequest|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({ - 'external_api.name': request.externalApi!.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.updateExternalApi(request, options, callback); - } -/** - * Delete an External API resource in the API hub. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the External API resource to delete. - * Format: - * `projects/{project}/locations/{location}/externalApis/{externalApi}` - * @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.protobuf.Empty|Empty}. - * 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/api_hub.delete_external_api.js - * region_tag:apihub_v1_generated_ApiHub_DeleteExternalApi_async - */ - deleteExternalApi( - request?: protos.google.cloud.apihub.v1.IDeleteExternalApiRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.IDeleteExternalApiRequest|undefined, {}|undefined - ]>; - deleteExternalApi( - request: protos.google.cloud.apihub.v1.IDeleteExternalApiRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.IDeleteExternalApiRequest|null|undefined, - {}|null|undefined>): void; - deleteExternalApi( - request: protos.google.cloud.apihub.v1.IDeleteExternalApiRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.IDeleteExternalApiRequest|null|undefined, - {}|null|undefined>): void; - deleteExternalApi( - request?: protos.google.cloud.apihub.v1.IDeleteExternalApiRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.IDeleteExternalApiRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.IDeleteExternalApiRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.IDeleteExternalApiRequest|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.deleteExternalApi(request, options, callback); - } - - /** - * List API resources in the API hub. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent, which owns this collection of API resources. - * Format: `projects/{project}/locations/{location}` - * @param {string} [request.filter] - * Optional. An expression that filters the list of ApiResources. - * - * A filter expression consists of a field name, a comparison - * operator, and a value for filtering. The value must be a string. The - * comparison operator must be one of: `<`, `>`, `:` or `=`. Filters are not - * case sensitive. - * - * The following fields in the `ApiResource` are eligible for filtering: - * - * * `owner.email` - The email of the team which owns the ApiResource. - * Allowed comparison operators: `=`. - * * `create_time` - The time at which the ApiResource was created. The - * value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] - * format. Allowed comparison operators: `>` and `<`. - * * `display_name` - The display name of the ApiResource. Allowed - * comparison operators: `=`. - * * `target_user.enum_values.values.id` - The allowed value id of the - * target users attribute associated with the ApiResource. Allowed - * comparison operator is `:`. - * * `target_user.enum_values.values.display_name` - The allowed value - * display name of the target users attribute associated with the - * ApiResource. Allowed comparison operator is `:`. - * * `team.enum_values.values.id` - The allowed value id of the team - * attribute associated with the ApiResource. Allowed comparison operator is - * `:`. - * * `team.enum_values.values.display_name` - The allowed value display name - * of the team attribute associated with the ApiResource. Allowed comparison - * operator is `:`. - * * `business_unit.enum_values.values.id` - The allowed value id of the - * business unit attribute associated with the ApiResource. Allowed - * comparison operator is `:`. - * * `business_unit.enum_values.values.display_name` - The allowed value - * display name of the business unit attribute associated with the - * ApiResource. Allowed comparison operator is `:`. - * * `maturity_level.enum_values.values.id` - The allowed value id of the - * maturity level attribute associated with the ApiResource. Allowed - * comparison operator is `:`. - * * `maturity_level.enum_values.values.display_name` - The allowed value - * display name of the maturity level attribute associated with the - * ApiResource. Allowed comparison operator is `:`. - * * `api_style.enum_values.values.id` - The allowed value id of the - * api style attribute associated with the ApiResource. Allowed - * comparison operator is `:`. - * * `api_style.enum_values.values.display_name` - The allowed value display - * name of the api style attribute associated with the ApiResource. Allowed - * comparison operator is `:`. - * - * Expressions are combined with either `AND` logic operator or `OR` logical - * operator but not both of them together i.e. only one of the `AND` or `OR` - * operator can be used throughout the filter string and both the operators - * cannot be used together. No other logical operators are supported. At most - * three filter fields are allowed in the filter string and if provided - * more than that then `INVALID_ARGUMENT` error is returned by the API. - * - * Here are a few examples: - * - * * `owner.email = \"apihub@google.com\"` - - The owner team email is - * _apihub@google.com_. - * * `owner.email = \"apihub@google.com\" AND create_time < - * \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - - * The owner team email is _apihub@google.com_ and the api was created - * before _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_. - * * `owner.email = \"apihub@google.com\" OR team.enum_values.values.id: - * apihub-team-id` - The filter string specifies the APIs where the owner - * team email is _apihub@google.com_ or the id of the allowed value - * associated with the team attribute is _apihub-team-id_. - * * `owner.email = \"apihub@google.com\" OR - * team.enum_values.values.display_name: ApiHub Team` - The filter string - * specifies the APIs where the owner team email is _apihub@google.com_ or - * the display name of the allowed value associated with the team attribute - * is `ApiHub Team`. - * @param {number} [request.pageSize] - * Optional. The maximum number of API resources to return. The service may - * return fewer than this value. If unspecified, at most 50 Apis will be - * returned. The maximum value is 1000; values above 1000 will be coerced to - * 1000. - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous `ListApis` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters (except page_size) provided to - * `ListApis` must match the call that provided the page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.cloud.apihub.v1.Api|Api}. - * 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 `listApisAsync()` - * 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. - */ - listApis( - request?: protos.google.cloud.apihub.v1.IListApisRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apihub.v1.IApi[], - protos.google.cloud.apihub.v1.IListApisRequest|null, - protos.google.cloud.apihub.v1.IListApisResponse - ]>; - listApis( - request: protos.google.cloud.apihub.v1.IListApisRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.apihub.v1.IListApisRequest, - protos.google.cloud.apihub.v1.IListApisResponse|null|undefined, - protos.google.cloud.apihub.v1.IApi>): void; - listApis( - request: protos.google.cloud.apihub.v1.IListApisRequest, - callback: PaginationCallback< - protos.google.cloud.apihub.v1.IListApisRequest, - protos.google.cloud.apihub.v1.IListApisResponse|null|undefined, - protos.google.cloud.apihub.v1.IApi>): void; - listApis( - request?: protos.google.cloud.apihub.v1.IListApisRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.apihub.v1.IListApisRequest, - protos.google.cloud.apihub.v1.IListApisResponse|null|undefined, - protos.google.cloud.apihub.v1.IApi>, - callback?: PaginationCallback< - protos.google.cloud.apihub.v1.IListApisRequest, - protos.google.cloud.apihub.v1.IListApisResponse|null|undefined, - protos.google.cloud.apihub.v1.IApi>): - Promise<[ - protos.google.cloud.apihub.v1.IApi[], - protos.google.cloud.apihub.v1.IListApisRequest|null, - protos.google.cloud.apihub.v1.IListApisResponse - ]>|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.listApis(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent, which owns this collection of API resources. - * Format: `projects/{project}/locations/{location}` - * @param {string} [request.filter] - * Optional. An expression that filters the list of ApiResources. - * - * A filter expression consists of a field name, a comparison - * operator, and a value for filtering. The value must be a string. The - * comparison operator must be one of: `<`, `>`, `:` or `=`. Filters are not - * case sensitive. - * - * The following fields in the `ApiResource` are eligible for filtering: - * - * * `owner.email` - The email of the team which owns the ApiResource. - * Allowed comparison operators: `=`. - * * `create_time` - The time at which the ApiResource was created. The - * value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] - * format. Allowed comparison operators: `>` and `<`. - * * `display_name` - The display name of the ApiResource. Allowed - * comparison operators: `=`. - * * `target_user.enum_values.values.id` - The allowed value id of the - * target users attribute associated with the ApiResource. Allowed - * comparison operator is `:`. - * * `target_user.enum_values.values.display_name` - The allowed value - * display name of the target users attribute associated with the - * ApiResource. Allowed comparison operator is `:`. - * * `team.enum_values.values.id` - The allowed value id of the team - * attribute associated with the ApiResource. Allowed comparison operator is - * `:`. - * * `team.enum_values.values.display_name` - The allowed value display name - * of the team attribute associated with the ApiResource. Allowed comparison - * operator is `:`. - * * `business_unit.enum_values.values.id` - The allowed value id of the - * business unit attribute associated with the ApiResource. Allowed - * comparison operator is `:`. - * * `business_unit.enum_values.values.display_name` - The allowed value - * display name of the business unit attribute associated with the - * ApiResource. Allowed comparison operator is `:`. - * * `maturity_level.enum_values.values.id` - The allowed value id of the - * maturity level attribute associated with the ApiResource. Allowed - * comparison operator is `:`. - * * `maturity_level.enum_values.values.display_name` - The allowed value - * display name of the maturity level attribute associated with the - * ApiResource. Allowed comparison operator is `:`. - * * `api_style.enum_values.values.id` - The allowed value id of the - * api style attribute associated with the ApiResource. Allowed - * comparison operator is `:`. - * * `api_style.enum_values.values.display_name` - The allowed value display - * name of the api style attribute associated with the ApiResource. Allowed - * comparison operator is `:`. - * - * Expressions are combined with either `AND` logic operator or `OR` logical - * operator but not both of them together i.e. only one of the `AND` or `OR` - * operator can be used throughout the filter string and both the operators - * cannot be used together. No other logical operators are supported. At most - * three filter fields are allowed in the filter string and if provided - * more than that then `INVALID_ARGUMENT` error is returned by the API. - * - * Here are a few examples: - * - * * `owner.email = \"apihub@google.com\"` - - The owner team email is - * _apihub@google.com_. - * * `owner.email = \"apihub@google.com\" AND create_time < - * \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - - * The owner team email is _apihub@google.com_ and the api was created - * before _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_. - * * `owner.email = \"apihub@google.com\" OR team.enum_values.values.id: - * apihub-team-id` - The filter string specifies the APIs where the owner - * team email is _apihub@google.com_ or the id of the allowed value - * associated with the team attribute is _apihub-team-id_. - * * `owner.email = \"apihub@google.com\" OR - * team.enum_values.values.display_name: ApiHub Team` - The filter string - * specifies the APIs where the owner team email is _apihub@google.com_ or - * the display name of the allowed value associated with the team attribute - * is `ApiHub Team`. - * @param {number} [request.pageSize] - * Optional. The maximum number of API resources to return. The service may - * return fewer than this value. If unspecified, at most 50 Apis will be - * returned. The maximum value is 1000; values above 1000 will be coerced to - * 1000. - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous `ListApis` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters (except page_size) provided to - * `ListApis` must match the call that provided the page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.cloud.apihub.v1.Api|Api} 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 `listApisAsync()` - * 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. - */ - listApisStream( - request?: protos.google.cloud.apihub.v1.IListApisRequest, - 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['listApis']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listApis.createStream( - this.innerApiCalls.listApis as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listApis`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent, which owns this collection of API resources. - * Format: `projects/{project}/locations/{location}` - * @param {string} [request.filter] - * Optional. An expression that filters the list of ApiResources. - * - * A filter expression consists of a field name, a comparison - * operator, and a value for filtering. The value must be a string. The - * comparison operator must be one of: `<`, `>`, `:` or `=`. Filters are not - * case sensitive. - * - * The following fields in the `ApiResource` are eligible for filtering: - * - * * `owner.email` - The email of the team which owns the ApiResource. - * Allowed comparison operators: `=`. - * * `create_time` - The time at which the ApiResource was created. The - * value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] - * format. Allowed comparison operators: `>` and `<`. - * * `display_name` - The display name of the ApiResource. Allowed - * comparison operators: `=`. - * * `target_user.enum_values.values.id` - The allowed value id of the - * target users attribute associated with the ApiResource. Allowed - * comparison operator is `:`. - * * `target_user.enum_values.values.display_name` - The allowed value - * display name of the target users attribute associated with the - * ApiResource. Allowed comparison operator is `:`. - * * `team.enum_values.values.id` - The allowed value id of the team - * attribute associated with the ApiResource. Allowed comparison operator is - * `:`. - * * `team.enum_values.values.display_name` - The allowed value display name - * of the team attribute associated with the ApiResource. Allowed comparison - * operator is `:`. - * * `business_unit.enum_values.values.id` - The allowed value id of the - * business unit attribute associated with the ApiResource. Allowed - * comparison operator is `:`. - * * `business_unit.enum_values.values.display_name` - The allowed value - * display name of the business unit attribute associated with the - * ApiResource. Allowed comparison operator is `:`. - * * `maturity_level.enum_values.values.id` - The allowed value id of the - * maturity level attribute associated with the ApiResource. Allowed - * comparison operator is `:`. - * * `maturity_level.enum_values.values.display_name` - The allowed value - * display name of the maturity level attribute associated with the - * ApiResource. Allowed comparison operator is `:`. - * * `api_style.enum_values.values.id` - The allowed value id of the - * api style attribute associated with the ApiResource. Allowed - * comparison operator is `:`. - * * `api_style.enum_values.values.display_name` - The allowed value display - * name of the api style attribute associated with the ApiResource. Allowed - * comparison operator is `:`. - * - * Expressions are combined with either `AND` logic operator or `OR` logical - * operator but not both of them together i.e. only one of the `AND` or `OR` - * operator can be used throughout the filter string and both the operators - * cannot be used together. No other logical operators are supported. At most - * three filter fields are allowed in the filter string and if provided - * more than that then `INVALID_ARGUMENT` error is returned by the API. - * - * Here are a few examples: - * - * * `owner.email = \"apihub@google.com\"` - - The owner team email is - * _apihub@google.com_. - * * `owner.email = \"apihub@google.com\" AND create_time < - * \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - - * The owner team email is _apihub@google.com_ and the api was created - * before _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_. - * * `owner.email = \"apihub@google.com\" OR team.enum_values.values.id: - * apihub-team-id` - The filter string specifies the APIs where the owner - * team email is _apihub@google.com_ or the id of the allowed value - * associated with the team attribute is _apihub-team-id_. - * * `owner.email = \"apihub@google.com\" OR - * team.enum_values.values.display_name: ApiHub Team` - The filter string - * specifies the APIs where the owner team email is _apihub@google.com_ or - * the display name of the allowed value associated with the team attribute - * is `ApiHub Team`. - * @param {number} [request.pageSize] - * Optional. The maximum number of API resources to return. The service may - * return fewer than this value. If unspecified, at most 50 Apis will be - * returned. The maximum value is 1000; values above 1000 will be coerced to - * 1000. - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous `ListApis` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters (except page_size) provided to - * `ListApis` must match the call that provided the page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@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.apihub.v1.Api|Api}. 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/api_hub.list_apis.js - * region_tag:apihub_v1_generated_ApiHub_ListApis_async - */ - listApisAsync( - request?: protos.google.cloud.apihub.v1.IListApisRequest, - 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['listApis']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listApis.asyncIterate( - this.innerApiCalls['listApis'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * List API versions of an API resource in the API hub. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent which owns this collection of API versions i.e., the - * API resource Format: `projects/{project}/locations/{location}/apis/{api}` - * @param {string} [request.filter] - * Optional. An expression that filters the list of Versions. - * - * A filter expression consists of a field name, a comparison - * operator, and a value for filtering. The value must be a string, a - * number, or a boolean. The comparison operator must be one of: `<`, `>` or - * `=`. Filters are not case sensitive. - * - * The following fields in the `Version` are eligible for filtering: - * - * * `display_name` - The display name of the Version. Allowed - * comparison operators: `=`. - * * `create_time` - The time at which the Version was created. The - * value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] - * format. Allowed comparison operators: `>` and `<`. - * * `lifecycle.enum_values.values.id` - The allowed value id of the - * lifecycle attribute associated with the Version. Allowed comparison - * operators: `:`. - * * `lifecycle.enum_values.values.display_name` - The allowed value display - * name of the lifecycle attribute associated with the Version. Allowed - * comparison operators: `:`. - * * `compliance.enum_values.values.id` - The allowed value id of the - * compliances attribute associated with the Version. Allowed comparison - * operators: `:`. - * * `compliance.enum_values.values.display_name` - The allowed value - * display name of the compliances attribute associated with the Version. - * Allowed comparison operators: `:`. - * * `accreditation.enum_values.values.id` - The allowed value id of the - * accreditations attribute associated with the Version. Allowed - * comparison operators: `:`. - * * `accreditation.enum_values.values.display_name` - The allowed value - * display name of the accreditations attribute associated with the Version. - * Allowed comparison operators: `:`. - * - * Expressions are combined with either `AND` logic operator or `OR` logical - * operator but not both of them together i.e. only one of the `AND` or `OR` - * operator can be used throughout the filter string and both the operators - * cannot be used together. No other logical operators are - * supported. At most three filter fields are allowed in the filter - * string and if provided more than that then `INVALID_ARGUMENT` error is - * returned by the API. - * - * Here are a few examples: - * - * * `lifecycle.enum_values.values.id: preview-id` - The filter string - * specifies that the id of the allowed value associated with the lifecycle - * attribute of the Version is _preview-id_. - * * `lifecycle.enum_values.values.display_name: \"Preview Display Name\"` - - * The filter string specifies that the display name of the allowed value - * associated with the lifecycle attribute of the Version is `Preview - * Display Name`. - * * `lifecycle.enum_values.values.id: preview-id AND create_time < - * \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - - * The id of the allowed value associated with the lifecycle attribute of - * the Version is _preview-id_ and it was created before _2021-08-15 - * 14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_. - * * `compliance.enum_values.values.id: gdpr-id OR - * compliance.enum_values.values.id: pci-dss-id` - * - The id of the allowed value associated with the compliance attribute is - * _gdpr-id_ or _pci-dss-id_. - * @param {number} [request.pageSize] - * Optional. The maximum number of versions to return. The service may return - * fewer than this value. If unspecified, at most 50 versions will be - * returned. The maximum value is 1000; values above 1000 will be coerced to - * 1000. - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous `ListVersions` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters (except page_size) provided to - * `ListVersions` must match the call that provided the page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.cloud.apihub.v1.Version|Version}. - * 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 `listVersionsAsync()` - * 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. - */ - listVersions( - request?: protos.google.cloud.apihub.v1.IListVersionsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apihub.v1.IVersion[], - protos.google.cloud.apihub.v1.IListVersionsRequest|null, - protos.google.cloud.apihub.v1.IListVersionsResponse - ]>; - listVersions( - request: protos.google.cloud.apihub.v1.IListVersionsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.apihub.v1.IListVersionsRequest, - protos.google.cloud.apihub.v1.IListVersionsResponse|null|undefined, - protos.google.cloud.apihub.v1.IVersion>): void; - listVersions( - request: protos.google.cloud.apihub.v1.IListVersionsRequest, - callback: PaginationCallback< - protos.google.cloud.apihub.v1.IListVersionsRequest, - protos.google.cloud.apihub.v1.IListVersionsResponse|null|undefined, - protos.google.cloud.apihub.v1.IVersion>): void; - listVersions( - request?: protos.google.cloud.apihub.v1.IListVersionsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.apihub.v1.IListVersionsRequest, - protos.google.cloud.apihub.v1.IListVersionsResponse|null|undefined, - protos.google.cloud.apihub.v1.IVersion>, - callback?: PaginationCallback< - protos.google.cloud.apihub.v1.IListVersionsRequest, - protos.google.cloud.apihub.v1.IListVersionsResponse|null|undefined, - protos.google.cloud.apihub.v1.IVersion>): - Promise<[ - protos.google.cloud.apihub.v1.IVersion[], - protos.google.cloud.apihub.v1.IListVersionsRequest|null, - protos.google.cloud.apihub.v1.IListVersionsResponse - ]>|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.listVersions(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent which owns this collection of API versions i.e., the - * API resource Format: `projects/{project}/locations/{location}/apis/{api}` - * @param {string} [request.filter] - * Optional. An expression that filters the list of Versions. - * - * A filter expression consists of a field name, a comparison - * operator, and a value for filtering. The value must be a string, a - * number, or a boolean. The comparison operator must be one of: `<`, `>` or - * `=`. Filters are not case sensitive. - * - * The following fields in the `Version` are eligible for filtering: - * - * * `display_name` - The display name of the Version. Allowed - * comparison operators: `=`. - * * `create_time` - The time at which the Version was created. The - * value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] - * format. Allowed comparison operators: `>` and `<`. - * * `lifecycle.enum_values.values.id` - The allowed value id of the - * lifecycle attribute associated with the Version. Allowed comparison - * operators: `:`. - * * `lifecycle.enum_values.values.display_name` - The allowed value display - * name of the lifecycle attribute associated with the Version. Allowed - * comparison operators: `:`. - * * `compliance.enum_values.values.id` - The allowed value id of the - * compliances attribute associated with the Version. Allowed comparison - * operators: `:`. - * * `compliance.enum_values.values.display_name` - The allowed value - * display name of the compliances attribute associated with the Version. - * Allowed comparison operators: `:`. - * * `accreditation.enum_values.values.id` - The allowed value id of the - * accreditations attribute associated with the Version. Allowed - * comparison operators: `:`. - * * `accreditation.enum_values.values.display_name` - The allowed value - * display name of the accreditations attribute associated with the Version. - * Allowed comparison operators: `:`. - * - * Expressions are combined with either `AND` logic operator or `OR` logical - * operator but not both of them together i.e. only one of the `AND` or `OR` - * operator can be used throughout the filter string and both the operators - * cannot be used together. No other logical operators are - * supported. At most three filter fields are allowed in the filter - * string and if provided more than that then `INVALID_ARGUMENT` error is - * returned by the API. - * - * Here are a few examples: - * - * * `lifecycle.enum_values.values.id: preview-id` - The filter string - * specifies that the id of the allowed value associated with the lifecycle - * attribute of the Version is _preview-id_. - * * `lifecycle.enum_values.values.display_name: \"Preview Display Name\"` - - * The filter string specifies that the display name of the allowed value - * associated with the lifecycle attribute of the Version is `Preview - * Display Name`. - * * `lifecycle.enum_values.values.id: preview-id AND create_time < - * \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - - * The id of the allowed value associated with the lifecycle attribute of - * the Version is _preview-id_ and it was created before _2021-08-15 - * 14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_. - * * `compliance.enum_values.values.id: gdpr-id OR - * compliance.enum_values.values.id: pci-dss-id` - * - The id of the allowed value associated with the compliance attribute is - * _gdpr-id_ or _pci-dss-id_. - * @param {number} [request.pageSize] - * Optional. The maximum number of versions to return. The service may return - * fewer than this value. If unspecified, at most 50 versions will be - * returned. The maximum value is 1000; values above 1000 will be coerced to - * 1000. - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous `ListVersions` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters (except page_size) provided to - * `ListVersions` must match the call that provided the page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.cloud.apihub.v1.Version|Version} 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 `listVersionsAsync()` - * 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. - */ - listVersionsStream( - request?: protos.google.cloud.apihub.v1.IListVersionsRequest, - 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['listVersions']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listVersions.createStream( - this.innerApiCalls.listVersions as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listVersions`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent which owns this collection of API versions i.e., the - * API resource Format: `projects/{project}/locations/{location}/apis/{api}` - * @param {string} [request.filter] - * Optional. An expression that filters the list of Versions. - * - * A filter expression consists of a field name, a comparison - * operator, and a value for filtering. The value must be a string, a - * number, or a boolean. The comparison operator must be one of: `<`, `>` or - * `=`. Filters are not case sensitive. - * - * The following fields in the `Version` are eligible for filtering: - * - * * `display_name` - The display name of the Version. Allowed - * comparison operators: `=`. - * * `create_time` - The time at which the Version was created. The - * value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] - * format. Allowed comparison operators: `>` and `<`. - * * `lifecycle.enum_values.values.id` - The allowed value id of the - * lifecycle attribute associated with the Version. Allowed comparison - * operators: `:`. - * * `lifecycle.enum_values.values.display_name` - The allowed value display - * name of the lifecycle attribute associated with the Version. Allowed - * comparison operators: `:`. - * * `compliance.enum_values.values.id` - The allowed value id of the - * compliances attribute associated with the Version. Allowed comparison - * operators: `:`. - * * `compliance.enum_values.values.display_name` - The allowed value - * display name of the compliances attribute associated with the Version. - * Allowed comparison operators: `:`. - * * `accreditation.enum_values.values.id` - The allowed value id of the - * accreditations attribute associated with the Version. Allowed - * comparison operators: `:`. - * * `accreditation.enum_values.values.display_name` - The allowed value - * display name of the accreditations attribute associated with the Version. - * Allowed comparison operators: `:`. - * - * Expressions are combined with either `AND` logic operator or `OR` logical - * operator but not both of them together i.e. only one of the `AND` or `OR` - * operator can be used throughout the filter string and both the operators - * cannot be used together. No other logical operators are - * supported. At most three filter fields are allowed in the filter - * string and if provided more than that then `INVALID_ARGUMENT` error is - * returned by the API. - * - * Here are a few examples: - * - * * `lifecycle.enum_values.values.id: preview-id` - The filter string - * specifies that the id of the allowed value associated with the lifecycle - * attribute of the Version is _preview-id_. - * * `lifecycle.enum_values.values.display_name: \"Preview Display Name\"` - - * The filter string specifies that the display name of the allowed value - * associated with the lifecycle attribute of the Version is `Preview - * Display Name`. - * * `lifecycle.enum_values.values.id: preview-id AND create_time < - * \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - - * The id of the allowed value associated with the lifecycle attribute of - * the Version is _preview-id_ and it was created before _2021-08-15 - * 14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_. - * * `compliance.enum_values.values.id: gdpr-id OR - * compliance.enum_values.values.id: pci-dss-id` - * - The id of the allowed value associated with the compliance attribute is - * _gdpr-id_ or _pci-dss-id_. - * @param {number} [request.pageSize] - * Optional. The maximum number of versions to return. The service may return - * fewer than this value. If unspecified, at most 50 versions will be - * returned. The maximum value is 1000; values above 1000 will be coerced to - * 1000. - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous `ListVersions` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters (except page_size) provided to - * `ListVersions` must match the call that provided the page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@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.apihub.v1.Version|Version}. 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/api_hub.list_versions.js - * region_tag:apihub_v1_generated_ApiHub_ListVersions_async - */ - listVersionsAsync( - request?: protos.google.cloud.apihub.v1.IListVersionsRequest, - 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['listVersions']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listVersions.asyncIterate( - this.innerApiCalls['listVersions'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * List specs corresponding to a particular API resource. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent, which owns this collection of specs. - * Format: - * `projects/{project}/locations/{location}/apis/{api}/versions/{version}` - * @param {string} [request.filter] - * Optional. An expression that filters the list of Specs. - * - * A filter expression consists of a field name, a comparison - * operator, and a value for filtering. The value must be a string. The - * comparison operator must be one of: `<`, `>`, `:` or `=`. Filters are not - * case sensitive. - * - * The following fields in the `Spec` are eligible for filtering: - * - * * `display_name` - The display name of the Spec. Allowed comparison - * operators: `=`. - * * `create_time` - The time at which the Spec was created. The - * value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] - * format. Allowed comparison operators: `>` and `<`. - * * `spec_type.enum_values.values.id` - The allowed value id of the - * spec_type attribute associated with the Spec. Allowed comparison - * operators: `:`. - * * `spec_type.enum_values.values.display_name` - The allowed value display - * name of the spec_type attribute associated with the Spec. Allowed - * comparison operators: `:`. - * * `lint_response.json_values.values` - The json value of the - * lint_response attribute associated with the Spec. Allowed comparison - * operators: `:`. - * * `mime_type` - The MIME type of the Spec. Allowed comparison - * operators: `=`. - * - * Expressions are combined with either `AND` logic operator or `OR` logical - * operator but not both of them together i.e. only one of the `AND` or `OR` - * operator can be used throughout the filter string and both the operators - * cannot be used together. No other logical operators are - * supported. At most three filter fields are allowed in the filter - * string and if provided more than that then `INVALID_ARGUMENT` error is - * returned by the API. - * - * Here are a few examples: - * - * * `spec_type.enum_values.values.id: rest-id` - The filter - * string specifies that the id of the allowed value associated with the - * spec_type attribute is _rest-id_. - * * `spec_type.enum_values.values.display_name: \"Rest Display Name\"` - - * The filter string specifies that the display name of the allowed value - * associated with the spec_type attribute is `Rest Display Name`. - * * `spec_type.enum_values.values.id: grpc-id AND create_time < - * \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - - * The id of the allowed value associated with the spec_type attribute is - * _grpc-id_ and the spec was created before _2021-08-15 14:50:00 UTC_ and - * after _2021-08-10 12:00:00 UTC_. - * * `spec_type.enum_values.values.id: rest-id OR - * spec_type.enum_values.values.id: grpc-id` - * - The id of the allowed value associated with the spec_type attribute is - * _rest-id_ or _grpc-id_. - * @param {number} [request.pageSize] - * Optional. The maximum number of specs to return. The service may return - * fewer than this value. If unspecified, at most 50 specs will be - * returned. The maximum value is 1000; values above 1000 will be coerced to - * 1000. - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous `ListSpecs` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to `ListSpecs` must - * match the call that provided the page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.cloud.apihub.v1.Spec|Spec}. - * 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 `listSpecsAsync()` - * 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. - */ - listSpecs( - request?: protos.google.cloud.apihub.v1.IListSpecsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apihub.v1.ISpec[], - protos.google.cloud.apihub.v1.IListSpecsRequest|null, - protos.google.cloud.apihub.v1.IListSpecsResponse - ]>; - listSpecs( - request: protos.google.cloud.apihub.v1.IListSpecsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.apihub.v1.IListSpecsRequest, - protos.google.cloud.apihub.v1.IListSpecsResponse|null|undefined, - protos.google.cloud.apihub.v1.ISpec>): void; - listSpecs( - request: protos.google.cloud.apihub.v1.IListSpecsRequest, - callback: PaginationCallback< - protos.google.cloud.apihub.v1.IListSpecsRequest, - protos.google.cloud.apihub.v1.IListSpecsResponse|null|undefined, - protos.google.cloud.apihub.v1.ISpec>): void; - listSpecs( - request?: protos.google.cloud.apihub.v1.IListSpecsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.apihub.v1.IListSpecsRequest, - protos.google.cloud.apihub.v1.IListSpecsResponse|null|undefined, - protos.google.cloud.apihub.v1.ISpec>, - callback?: PaginationCallback< - protos.google.cloud.apihub.v1.IListSpecsRequest, - protos.google.cloud.apihub.v1.IListSpecsResponse|null|undefined, - protos.google.cloud.apihub.v1.ISpec>): - Promise<[ - protos.google.cloud.apihub.v1.ISpec[], - protos.google.cloud.apihub.v1.IListSpecsRequest|null, - protos.google.cloud.apihub.v1.IListSpecsResponse - ]>|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.listSpecs(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent, which owns this collection of specs. - * Format: - * `projects/{project}/locations/{location}/apis/{api}/versions/{version}` - * @param {string} [request.filter] - * Optional. An expression that filters the list of Specs. - * - * A filter expression consists of a field name, a comparison - * operator, and a value for filtering. The value must be a string. The - * comparison operator must be one of: `<`, `>`, `:` or `=`. Filters are not - * case sensitive. - * - * The following fields in the `Spec` are eligible for filtering: - * - * * `display_name` - The display name of the Spec. Allowed comparison - * operators: `=`. - * * `create_time` - The time at which the Spec was created. The - * value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] - * format. Allowed comparison operators: `>` and `<`. - * * `spec_type.enum_values.values.id` - The allowed value id of the - * spec_type attribute associated with the Spec. Allowed comparison - * operators: `:`. - * * `spec_type.enum_values.values.display_name` - The allowed value display - * name of the spec_type attribute associated with the Spec. Allowed - * comparison operators: `:`. - * * `lint_response.json_values.values` - The json value of the - * lint_response attribute associated with the Spec. Allowed comparison - * operators: `:`. - * * `mime_type` - The MIME type of the Spec. Allowed comparison - * operators: `=`. - * - * Expressions are combined with either `AND` logic operator or `OR` logical - * operator but not both of them together i.e. only one of the `AND` or `OR` - * operator can be used throughout the filter string and both the operators - * cannot be used together. No other logical operators are - * supported. At most three filter fields are allowed in the filter - * string and if provided more than that then `INVALID_ARGUMENT` error is - * returned by the API. - * - * Here are a few examples: - * - * * `spec_type.enum_values.values.id: rest-id` - The filter - * string specifies that the id of the allowed value associated with the - * spec_type attribute is _rest-id_. - * * `spec_type.enum_values.values.display_name: \"Rest Display Name\"` - - * The filter string specifies that the display name of the allowed value - * associated with the spec_type attribute is `Rest Display Name`. - * * `spec_type.enum_values.values.id: grpc-id AND create_time < - * \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - - * The id of the allowed value associated with the spec_type attribute is - * _grpc-id_ and the spec was created before _2021-08-15 14:50:00 UTC_ and - * after _2021-08-10 12:00:00 UTC_. - * * `spec_type.enum_values.values.id: rest-id OR - * spec_type.enum_values.values.id: grpc-id` - * - The id of the allowed value associated with the spec_type attribute is - * _rest-id_ or _grpc-id_. - * @param {number} [request.pageSize] - * Optional. The maximum number of specs to return. The service may return - * fewer than this value. If unspecified, at most 50 specs will be - * returned. The maximum value is 1000; values above 1000 will be coerced to - * 1000. - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous `ListSpecs` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to `ListSpecs` must - * match the call that provided the page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.cloud.apihub.v1.Spec|Spec} 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 `listSpecsAsync()` - * 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. - */ - listSpecsStream( - request?: protos.google.cloud.apihub.v1.IListSpecsRequest, - 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['listSpecs']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listSpecs.createStream( - this.innerApiCalls.listSpecs as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listSpecs`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent, which owns this collection of specs. - * Format: - * `projects/{project}/locations/{location}/apis/{api}/versions/{version}` - * @param {string} [request.filter] - * Optional. An expression that filters the list of Specs. - * - * A filter expression consists of a field name, a comparison - * operator, and a value for filtering. The value must be a string. The - * comparison operator must be one of: `<`, `>`, `:` or `=`. Filters are not - * case sensitive. - * - * The following fields in the `Spec` are eligible for filtering: - * - * * `display_name` - The display name of the Spec. Allowed comparison - * operators: `=`. - * * `create_time` - The time at which the Spec was created. The - * value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] - * format. Allowed comparison operators: `>` and `<`. - * * `spec_type.enum_values.values.id` - The allowed value id of the - * spec_type attribute associated with the Spec. Allowed comparison - * operators: `:`. - * * `spec_type.enum_values.values.display_name` - The allowed value display - * name of the spec_type attribute associated with the Spec. Allowed - * comparison operators: `:`. - * * `lint_response.json_values.values` - The json value of the - * lint_response attribute associated with the Spec. Allowed comparison - * operators: `:`. - * * `mime_type` - The MIME type of the Spec. Allowed comparison - * operators: `=`. - * - * Expressions are combined with either `AND` logic operator or `OR` logical - * operator but not both of them together i.e. only one of the `AND` or `OR` - * operator can be used throughout the filter string and both the operators - * cannot be used together. No other logical operators are - * supported. At most three filter fields are allowed in the filter - * string and if provided more than that then `INVALID_ARGUMENT` error is - * returned by the API. - * - * Here are a few examples: - * - * * `spec_type.enum_values.values.id: rest-id` - The filter - * string specifies that the id of the allowed value associated with the - * spec_type attribute is _rest-id_. - * * `spec_type.enum_values.values.display_name: \"Rest Display Name\"` - - * The filter string specifies that the display name of the allowed value - * associated with the spec_type attribute is `Rest Display Name`. - * * `spec_type.enum_values.values.id: grpc-id AND create_time < - * \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - - * The id of the allowed value associated with the spec_type attribute is - * _grpc-id_ and the spec was created before _2021-08-15 14:50:00 UTC_ and - * after _2021-08-10 12:00:00 UTC_. - * * `spec_type.enum_values.values.id: rest-id OR - * spec_type.enum_values.values.id: grpc-id` - * - The id of the allowed value associated with the spec_type attribute is - * _rest-id_ or _grpc-id_. - * @param {number} [request.pageSize] - * Optional. The maximum number of specs to return. The service may return - * fewer than this value. If unspecified, at most 50 specs will be - * returned. The maximum value is 1000; values above 1000 will be coerced to - * 1000. - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous `ListSpecs` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to `ListSpecs` must - * match the call that provided the page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@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.apihub.v1.Spec|Spec}. 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/api_hub.list_specs.js - * region_tag:apihub_v1_generated_ApiHub_ListSpecs_async - */ - listSpecsAsync( - request?: protos.google.cloud.apihub.v1.IListSpecsRequest, - 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['listSpecs']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listSpecs.asyncIterate( - this.innerApiCalls['listSpecs'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * List operations in an API version. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent which owns this collection of operations i.e., the API - * version. Format: - * `projects/{project}/locations/{location}/apis/{api}/versions/{version}` - * @param {string} [request.filter] - * Optional. An expression that filters the list of ApiOperations. - * - * A filter expression consists of a field name, a comparison - * operator, and a value for filtering. The value must be a string or a - * boolean. The comparison operator must be one of: `<`, `>` or - * `=`. Filters are not case sensitive. - * - * The following fields in the `ApiOperation` are eligible for filtering: - * * `name` - The ApiOperation resource name. Allowed comparison - * operators: - * `=`. - * * `details.http_operation.path.path` - The http operation's complete path - * relative to server endpoint. Allowed comparison operators: `=`. - * * `details.http_operation.method` - The http operation method type. - * Allowed comparison operators: `=`. - * * `details.deprecated` - Indicates if the ApiOperation is deprecated. - * Allowed values are True / False indicating the deprycation status of the - * ApiOperation. Allowed comparison operators: `=`. - * * `create_time` - The time at which the ApiOperation was created. The - * value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] - * format. Allowed comparison operators: `>` and `<`. - * - * Expressions are combined with either `AND` logic operator or `OR` logical - * operator but not both of them together i.e. only one of the `AND` or `OR` - * operator can be used throughout the filter string and both the operators - * cannot be used together. No other logical operators are supported. At most - * three filter fields are allowed in the filter string and if provided - * more than that then `INVALID_ARGUMENT` error is returned by the API. - * - * Here are a few examples: - * - * * `details.deprecated = True` - The ApiOperation is deprecated. - * * `details.http_operation.method = GET AND create_time < - * \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - - * The method of the http operation of the ApiOperation is _GET_ and the - * spec was created before _2021-08-15 14:50:00 UTC_ and after _2021-08-10 - * 12:00:00 UTC_. - * * `details.http_operation.method = GET OR details.http_operation.method = - * POST`. - The http operation of the method of ApiOperation is _GET_ or - * _POST_. - * @param {number} [request.pageSize] - * Optional. The maximum number of operations to return. The service may - * return fewer than this value. If unspecified, at most 50 operations will be - * returned. The maximum value is 1000; values above 1000 will be coerced to - * 1000. - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous `ListApiOperations` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters (except page_size) provided to - * `ListApiOperations` must match the call that provided the page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.cloud.apihub.v1.ApiOperation|ApiOperation}. - * 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 `listApiOperationsAsync()` - * 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. - */ - listApiOperations( - request?: protos.google.cloud.apihub.v1.IListApiOperationsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apihub.v1.IApiOperation[], - protos.google.cloud.apihub.v1.IListApiOperationsRequest|null, - protos.google.cloud.apihub.v1.IListApiOperationsResponse - ]>; - listApiOperations( - request: protos.google.cloud.apihub.v1.IListApiOperationsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.apihub.v1.IListApiOperationsRequest, - protos.google.cloud.apihub.v1.IListApiOperationsResponse|null|undefined, - protos.google.cloud.apihub.v1.IApiOperation>): void; - listApiOperations( - request: protos.google.cloud.apihub.v1.IListApiOperationsRequest, - callback: PaginationCallback< - protos.google.cloud.apihub.v1.IListApiOperationsRequest, - protos.google.cloud.apihub.v1.IListApiOperationsResponse|null|undefined, - protos.google.cloud.apihub.v1.IApiOperation>): void; - listApiOperations( - request?: protos.google.cloud.apihub.v1.IListApiOperationsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.apihub.v1.IListApiOperationsRequest, - protos.google.cloud.apihub.v1.IListApiOperationsResponse|null|undefined, - protos.google.cloud.apihub.v1.IApiOperation>, - callback?: PaginationCallback< - protos.google.cloud.apihub.v1.IListApiOperationsRequest, - protos.google.cloud.apihub.v1.IListApiOperationsResponse|null|undefined, - protos.google.cloud.apihub.v1.IApiOperation>): - Promise<[ - protos.google.cloud.apihub.v1.IApiOperation[], - protos.google.cloud.apihub.v1.IListApiOperationsRequest|null, - protos.google.cloud.apihub.v1.IListApiOperationsResponse - ]>|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.listApiOperations(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent which owns this collection of operations i.e., the API - * version. Format: - * `projects/{project}/locations/{location}/apis/{api}/versions/{version}` - * @param {string} [request.filter] - * Optional. An expression that filters the list of ApiOperations. - * - * A filter expression consists of a field name, a comparison - * operator, and a value for filtering. The value must be a string or a - * boolean. The comparison operator must be one of: `<`, `>` or - * `=`. Filters are not case sensitive. - * - * The following fields in the `ApiOperation` are eligible for filtering: - * * `name` - The ApiOperation resource name. Allowed comparison - * operators: - * `=`. - * * `details.http_operation.path.path` - The http operation's complete path - * relative to server endpoint. Allowed comparison operators: `=`. - * * `details.http_operation.method` - The http operation method type. - * Allowed comparison operators: `=`. - * * `details.deprecated` - Indicates if the ApiOperation is deprecated. - * Allowed values are True / False indicating the deprycation status of the - * ApiOperation. Allowed comparison operators: `=`. - * * `create_time` - The time at which the ApiOperation was created. The - * value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] - * format. Allowed comparison operators: `>` and `<`. - * - * Expressions are combined with either `AND` logic operator or `OR` logical - * operator but not both of them together i.e. only one of the `AND` or `OR` - * operator can be used throughout the filter string and both the operators - * cannot be used together. No other logical operators are supported. At most - * three filter fields are allowed in the filter string and if provided - * more than that then `INVALID_ARGUMENT` error is returned by the API. - * - * Here are a few examples: - * - * * `details.deprecated = True` - The ApiOperation is deprecated. - * * `details.http_operation.method = GET AND create_time < - * \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - - * The method of the http operation of the ApiOperation is _GET_ and the - * spec was created before _2021-08-15 14:50:00 UTC_ and after _2021-08-10 - * 12:00:00 UTC_. - * * `details.http_operation.method = GET OR details.http_operation.method = - * POST`. - The http operation of the method of ApiOperation is _GET_ or - * _POST_. - * @param {number} [request.pageSize] - * Optional. The maximum number of operations to return. The service may - * return fewer than this value. If unspecified, at most 50 operations will be - * returned. The maximum value is 1000; values above 1000 will be coerced to - * 1000. - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous `ListApiOperations` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters (except page_size) provided to - * `ListApiOperations` must match the call that provided the page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.cloud.apihub.v1.ApiOperation|ApiOperation} 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 `listApiOperationsAsync()` - * 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. - */ - listApiOperationsStream( - request?: protos.google.cloud.apihub.v1.IListApiOperationsRequest, - 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['listApiOperations']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listApiOperations.createStream( - this.innerApiCalls.listApiOperations as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listApiOperations`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent which owns this collection of operations i.e., the API - * version. Format: - * `projects/{project}/locations/{location}/apis/{api}/versions/{version}` - * @param {string} [request.filter] - * Optional. An expression that filters the list of ApiOperations. - * - * A filter expression consists of a field name, a comparison - * operator, and a value for filtering. The value must be a string or a - * boolean. The comparison operator must be one of: `<`, `>` or - * `=`. Filters are not case sensitive. - * - * The following fields in the `ApiOperation` are eligible for filtering: - * * `name` - The ApiOperation resource name. Allowed comparison - * operators: - * `=`. - * * `details.http_operation.path.path` - The http operation's complete path - * relative to server endpoint. Allowed comparison operators: `=`. - * * `details.http_operation.method` - The http operation method type. - * Allowed comparison operators: `=`. - * * `details.deprecated` - Indicates if the ApiOperation is deprecated. - * Allowed values are True / False indicating the deprycation status of the - * ApiOperation. Allowed comparison operators: `=`. - * * `create_time` - The time at which the ApiOperation was created. The - * value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] - * format. Allowed comparison operators: `>` and `<`. - * - * Expressions are combined with either `AND` logic operator or `OR` logical - * operator but not both of them together i.e. only one of the `AND` or `OR` - * operator can be used throughout the filter string and both the operators - * cannot be used together. No other logical operators are supported. At most - * three filter fields are allowed in the filter string and if provided - * more than that then `INVALID_ARGUMENT` error is returned by the API. - * - * Here are a few examples: - * - * * `details.deprecated = True` - The ApiOperation is deprecated. - * * `details.http_operation.method = GET AND create_time < - * \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - - * The method of the http operation of the ApiOperation is _GET_ and the - * spec was created before _2021-08-15 14:50:00 UTC_ and after _2021-08-10 - * 12:00:00 UTC_. - * * `details.http_operation.method = GET OR details.http_operation.method = - * POST`. - The http operation of the method of ApiOperation is _GET_ or - * _POST_. - * @param {number} [request.pageSize] - * Optional. The maximum number of operations to return. The service may - * return fewer than this value. If unspecified, at most 50 operations will be - * returned. The maximum value is 1000; values above 1000 will be coerced to - * 1000. - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous `ListApiOperations` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters (except page_size) provided to - * `ListApiOperations` must match the call that provided the page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@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.apihub.v1.ApiOperation|ApiOperation}. 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/api_hub.list_api_operations.js - * region_tag:apihub_v1_generated_ApiHub_ListApiOperations_async - */ - listApiOperationsAsync( - request?: protos.google.cloud.apihub.v1.IListApiOperationsRequest, - 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['listApiOperations']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listApiOperations.asyncIterate( - this.innerApiCalls['listApiOperations'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * List deployment resources in the API hub. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent, which owns this collection of deployment resources. - * Format: `projects/{project}/locations/{location}` - * @param {string} [request.filter] - * Optional. An expression that filters the list of Deployments. - * - * A filter expression consists of a field name, a comparison - * operator, and a value for filtering. The value must be a string. The - * comparison operator must be one of: `<`, `>` or - * `=`. Filters are not case sensitive. - * - * The following fields in the `Deployments` are eligible for filtering: - * - * * `display_name` - The display name of the Deployment. Allowed - * comparison operators: `=`. - * * `create_time` - The time at which the Deployment was created. The - * value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] - * format. Allowed comparison operators: `>` and `<`. - * * `resource_uri` - A URI to the deployment resource. Allowed - * comparison operators: `=`. - * * `api_versions` - The API versions linked to this deployment. Allowed - * comparison operators: `:`. - * * `deployment_type.enum_values.values.id` - The allowed value id of the - * deployment_type attribute associated with the Deployment. Allowed - * comparison operators: `:`. - * * `deployment_type.enum_values.values.display_name` - The allowed value - * display name of the deployment_type attribute associated with the - * Deployment. Allowed comparison operators: `:`. - * * `slo.string_values.values` -The allowed string value of the slo - * attribute associated with the deployment. Allowed comparison - * operators: `:`. - * * `environment.enum_values.values.id` - The allowed value id of the - * environment attribute associated with the deployment. Allowed - * comparison operators: `:`. - * * `environment.enum_values.values.display_name` - The allowed value - * display name of the environment attribute associated with the deployment. - * Allowed comparison operators: `:`. - * - * Expressions are combined with either `AND` logic operator or `OR` logical - * operator but not both of them together i.e. only one of the `AND` or `OR` - * operator can be used throughout the filter string and both the operators - * cannot be used together. No other logical operators are supported. At most - * three filter fields are allowed in the filter string and if provided - * more than that then `INVALID_ARGUMENT` error is returned by the API. - * - * Here are a few examples: - * - * * `environment.enum_values.values.id: staging-id` - The allowed value id - * of the environment attribute associated with the Deployment is - * _staging-id_. - * * `environment.enum_values.values.display_name: \"Staging Deployment\"` - - * The allowed value display name of the environment attribute associated - * with the Deployment is `Staging Deployment`. - * * `environment.enum_values.values.id: production-id AND create_time < - * \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - - * The allowed value id of the environment attribute associated with the - * Deployment is _production-id_ and Deployment was created before - * _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_. - * * `environment.enum_values.values.id: production-id OR - * slo.string_values.values: \"99.99%\"` - * - The allowed value id of the environment attribute Deployment is - * _production-id_ or string value of the slo attribute is _99.99%_. - * @param {number} [request.pageSize] - * Optional. The maximum number of deployment resources to return. The service - * may return fewer than this value. If unspecified, at most 50 deployments - * will be returned. The maximum value is 1000; values above 1000 will be - * coerced to 1000. - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous `ListDeployments` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters (except page_size) provided to - * `ListDeployments` must match the call that provided the page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.cloud.apihub.v1.Deployment|Deployment}. - * 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 `listDeploymentsAsync()` - * 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. - */ - listDeployments( - request?: protos.google.cloud.apihub.v1.IListDeploymentsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apihub.v1.IDeployment[], - protos.google.cloud.apihub.v1.IListDeploymentsRequest|null, - protos.google.cloud.apihub.v1.IListDeploymentsResponse - ]>; - listDeployments( - request: protos.google.cloud.apihub.v1.IListDeploymentsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.apihub.v1.IListDeploymentsRequest, - protos.google.cloud.apihub.v1.IListDeploymentsResponse|null|undefined, - protos.google.cloud.apihub.v1.IDeployment>): void; - listDeployments( - request: protos.google.cloud.apihub.v1.IListDeploymentsRequest, - callback: PaginationCallback< - protos.google.cloud.apihub.v1.IListDeploymentsRequest, - protos.google.cloud.apihub.v1.IListDeploymentsResponse|null|undefined, - protos.google.cloud.apihub.v1.IDeployment>): void; - listDeployments( - request?: protos.google.cloud.apihub.v1.IListDeploymentsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.apihub.v1.IListDeploymentsRequest, - protos.google.cloud.apihub.v1.IListDeploymentsResponse|null|undefined, - protos.google.cloud.apihub.v1.IDeployment>, - callback?: PaginationCallback< - protos.google.cloud.apihub.v1.IListDeploymentsRequest, - protos.google.cloud.apihub.v1.IListDeploymentsResponse|null|undefined, - protos.google.cloud.apihub.v1.IDeployment>): - Promise<[ - protos.google.cloud.apihub.v1.IDeployment[], - protos.google.cloud.apihub.v1.IListDeploymentsRequest|null, - protos.google.cloud.apihub.v1.IListDeploymentsResponse - ]>|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.listDeployments(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent, which owns this collection of deployment resources. - * Format: `projects/{project}/locations/{location}` - * @param {string} [request.filter] - * Optional. An expression that filters the list of Deployments. - * - * A filter expression consists of a field name, a comparison - * operator, and a value for filtering. The value must be a string. The - * comparison operator must be one of: `<`, `>` or - * `=`. Filters are not case sensitive. - * - * The following fields in the `Deployments` are eligible for filtering: - * - * * `display_name` - The display name of the Deployment. Allowed - * comparison operators: `=`. - * * `create_time` - The time at which the Deployment was created. The - * value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] - * format. Allowed comparison operators: `>` and `<`. - * * `resource_uri` - A URI to the deployment resource. Allowed - * comparison operators: `=`. - * * `api_versions` - The API versions linked to this deployment. Allowed - * comparison operators: `:`. - * * `deployment_type.enum_values.values.id` - The allowed value id of the - * deployment_type attribute associated with the Deployment. Allowed - * comparison operators: `:`. - * * `deployment_type.enum_values.values.display_name` - The allowed value - * display name of the deployment_type attribute associated with the - * Deployment. Allowed comparison operators: `:`. - * * `slo.string_values.values` -The allowed string value of the slo - * attribute associated with the deployment. Allowed comparison - * operators: `:`. - * * `environment.enum_values.values.id` - The allowed value id of the - * environment attribute associated with the deployment. Allowed - * comparison operators: `:`. - * * `environment.enum_values.values.display_name` - The allowed value - * display name of the environment attribute associated with the deployment. - * Allowed comparison operators: `:`. - * - * Expressions are combined with either `AND` logic operator or `OR` logical - * operator but not both of them together i.e. only one of the `AND` or `OR` - * operator can be used throughout the filter string and both the operators - * cannot be used together. No other logical operators are supported. At most - * three filter fields are allowed in the filter string and if provided - * more than that then `INVALID_ARGUMENT` error is returned by the API. - * - * Here are a few examples: - * - * * `environment.enum_values.values.id: staging-id` - The allowed value id - * of the environment attribute associated with the Deployment is - * _staging-id_. - * * `environment.enum_values.values.display_name: \"Staging Deployment\"` - - * The allowed value display name of the environment attribute associated - * with the Deployment is `Staging Deployment`. - * * `environment.enum_values.values.id: production-id AND create_time < - * \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - - * The allowed value id of the environment attribute associated with the - * Deployment is _production-id_ and Deployment was created before - * _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_. - * * `environment.enum_values.values.id: production-id OR - * slo.string_values.values: \"99.99%\"` - * - The allowed value id of the environment attribute Deployment is - * _production-id_ or string value of the slo attribute is _99.99%_. - * @param {number} [request.pageSize] - * Optional. The maximum number of deployment resources to return. The service - * may return fewer than this value. If unspecified, at most 50 deployments - * will be returned. The maximum value is 1000; values above 1000 will be - * coerced to 1000. - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous `ListDeployments` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters (except page_size) provided to - * `ListDeployments` must match the call that provided the page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.cloud.apihub.v1.Deployment|Deployment} 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 `listDeploymentsAsync()` - * 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. - */ - listDeploymentsStream( - request?: protos.google.cloud.apihub.v1.IListDeploymentsRequest, - 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['listDeployments']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listDeployments.createStream( - this.innerApiCalls.listDeployments as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listDeployments`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent, which owns this collection of deployment resources. - * Format: `projects/{project}/locations/{location}` - * @param {string} [request.filter] - * Optional. An expression that filters the list of Deployments. - * - * A filter expression consists of a field name, a comparison - * operator, and a value for filtering. The value must be a string. The - * comparison operator must be one of: `<`, `>` or - * `=`. Filters are not case sensitive. - * - * The following fields in the `Deployments` are eligible for filtering: - * - * * `display_name` - The display name of the Deployment. Allowed - * comparison operators: `=`. - * * `create_time` - The time at which the Deployment was created. The - * value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] - * format. Allowed comparison operators: `>` and `<`. - * * `resource_uri` - A URI to the deployment resource. Allowed - * comparison operators: `=`. - * * `api_versions` - The API versions linked to this deployment. Allowed - * comparison operators: `:`. - * * `deployment_type.enum_values.values.id` - The allowed value id of the - * deployment_type attribute associated with the Deployment. Allowed - * comparison operators: `:`. - * * `deployment_type.enum_values.values.display_name` - The allowed value - * display name of the deployment_type attribute associated with the - * Deployment. Allowed comparison operators: `:`. - * * `slo.string_values.values` -The allowed string value of the slo - * attribute associated with the deployment. Allowed comparison - * operators: `:`. - * * `environment.enum_values.values.id` - The allowed value id of the - * environment attribute associated with the deployment. Allowed - * comparison operators: `:`. - * * `environment.enum_values.values.display_name` - The allowed value - * display name of the environment attribute associated with the deployment. - * Allowed comparison operators: `:`. - * - * Expressions are combined with either `AND` logic operator or `OR` logical - * operator but not both of them together i.e. only one of the `AND` or `OR` - * operator can be used throughout the filter string and both the operators - * cannot be used together. No other logical operators are supported. At most - * three filter fields are allowed in the filter string and if provided - * more than that then `INVALID_ARGUMENT` error is returned by the API. - * - * Here are a few examples: - * - * * `environment.enum_values.values.id: staging-id` - The allowed value id - * of the environment attribute associated with the Deployment is - * _staging-id_. - * * `environment.enum_values.values.display_name: \"Staging Deployment\"` - - * The allowed value display name of the environment attribute associated - * with the Deployment is `Staging Deployment`. - * * `environment.enum_values.values.id: production-id AND create_time < - * \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - - * The allowed value id of the environment attribute associated with the - * Deployment is _production-id_ and Deployment was created before - * _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_. - * * `environment.enum_values.values.id: production-id OR - * slo.string_values.values: \"99.99%\"` - * - The allowed value id of the environment attribute Deployment is - * _production-id_ or string value of the slo attribute is _99.99%_. - * @param {number} [request.pageSize] - * Optional. The maximum number of deployment resources to return. The service - * may return fewer than this value. If unspecified, at most 50 deployments - * will be returned. The maximum value is 1000; values above 1000 will be - * coerced to 1000. - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous `ListDeployments` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters (except page_size) provided to - * `ListDeployments` must match the call that provided the page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@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.apihub.v1.Deployment|Deployment}. 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/api_hub.list_deployments.js - * region_tag:apihub_v1_generated_ApiHub_ListDeployments_async - */ - listDeploymentsAsync( - request?: protos.google.cloud.apihub.v1.IListDeploymentsRequest, - 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['listDeployments']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listDeployments.asyncIterate( - this.innerApiCalls['listDeployments'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * List all attributes. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource for Attribute. - * Format: `projects/{project}/locations/{location}` - * @param {string} [request.filter] - * Optional. An expression that filters the list of Attributes. - * - * A filter expression consists of a field name, a comparison - * operator, and a value for filtering. The value must be a string or a - * boolean. The comparison operator must be one of: `<`, `>` or - * `=`. Filters are not case sensitive. - * - * The following fields in the `Attribute` are eligible for filtering: - * - * * `display_name` - The display name of the Attribute. Allowed - * comparison operators: `=`. - * * `definition_type` - The definition type of the attribute. Allowed - * comparison operators: `=`. - * * `scope` - The scope of the attribute. Allowed comparison operators: - * `=`. - * * `data_type` - The type of the data of the attribute. Allowed - * comparison operators: `=`. - * * `mandatory` - Denotes whether the attribute is mandatory or not. - * Allowed comparison operators: `=`. - * * `create_time` - The time at which the Attribute was created. The - * value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] - * format. Allowed comparison operators: `>` and `<`. - * - * Expressions are combined with either `AND` logic operator or `OR` logical - * operator but not both of them together i.e. only one of the `AND` or `OR` - * operator can be used throughout the filter string and both the operators - * cannot be used together. No other logical operators are - * supported. At most three filter fields are allowed in the filter - * string and if provided more than that then `INVALID_ARGUMENT` error is - * returned by the API. - * - * Here are a few examples: - * - * * `display_name = production` - - The display name of the attribute is - * _production_. - * * `(display_name = production) AND (create_time < - * \"2021-08-15T14:50:00Z\") AND (create_time > \"2021-08-10T12:00:00Z\")` - - * The display name of the attribute is _production_ and the attribute was - * created before _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00 - * UTC_. - * * `display_name = production OR scope = api` - - * The attribute where the display name is _production_ or the scope is - * _api_. - * @param {number} [request.pageSize] - * Optional. The maximum number of attribute resources to return. The service - * may return fewer than this value. If unspecified, at most 50 attributes - * will be returned. The maximum value is 1000; values above 1000 will be - * coerced to 1000. - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous `ListAttributes` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to `ListAttributes` must - * match the call that provided the page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.cloud.apihub.v1.Attribute|Attribute}. - * 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 `listAttributesAsync()` - * 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. - */ - listAttributes( - request?: protos.google.cloud.apihub.v1.IListAttributesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apihub.v1.IAttribute[], - protos.google.cloud.apihub.v1.IListAttributesRequest|null, - protos.google.cloud.apihub.v1.IListAttributesResponse - ]>; - listAttributes( - request: protos.google.cloud.apihub.v1.IListAttributesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.apihub.v1.IListAttributesRequest, - protos.google.cloud.apihub.v1.IListAttributesResponse|null|undefined, - protos.google.cloud.apihub.v1.IAttribute>): void; - listAttributes( - request: protos.google.cloud.apihub.v1.IListAttributesRequest, - callback: PaginationCallback< - protos.google.cloud.apihub.v1.IListAttributesRequest, - protos.google.cloud.apihub.v1.IListAttributesResponse|null|undefined, - protos.google.cloud.apihub.v1.IAttribute>): void; - listAttributes( - request?: protos.google.cloud.apihub.v1.IListAttributesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.apihub.v1.IListAttributesRequest, - protos.google.cloud.apihub.v1.IListAttributesResponse|null|undefined, - protos.google.cloud.apihub.v1.IAttribute>, - callback?: PaginationCallback< - protos.google.cloud.apihub.v1.IListAttributesRequest, - protos.google.cloud.apihub.v1.IListAttributesResponse|null|undefined, - protos.google.cloud.apihub.v1.IAttribute>): - Promise<[ - protos.google.cloud.apihub.v1.IAttribute[], - protos.google.cloud.apihub.v1.IListAttributesRequest|null, - protos.google.cloud.apihub.v1.IListAttributesResponse - ]>|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.listAttributes(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource for Attribute. - * Format: `projects/{project}/locations/{location}` - * @param {string} [request.filter] - * Optional. An expression that filters the list of Attributes. - * - * A filter expression consists of a field name, a comparison - * operator, and a value for filtering. The value must be a string or a - * boolean. The comparison operator must be one of: `<`, `>` or - * `=`. Filters are not case sensitive. - * - * The following fields in the `Attribute` are eligible for filtering: - * - * * `display_name` - The display name of the Attribute. Allowed - * comparison operators: `=`. - * * `definition_type` - The definition type of the attribute. Allowed - * comparison operators: `=`. - * * `scope` - The scope of the attribute. Allowed comparison operators: - * `=`. - * * `data_type` - The type of the data of the attribute. Allowed - * comparison operators: `=`. - * * `mandatory` - Denotes whether the attribute is mandatory or not. - * Allowed comparison operators: `=`. - * * `create_time` - The time at which the Attribute was created. The - * value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] - * format. Allowed comparison operators: `>` and `<`. - * - * Expressions are combined with either `AND` logic operator or `OR` logical - * operator but not both of them together i.e. only one of the `AND` or `OR` - * operator can be used throughout the filter string and both the operators - * cannot be used together. No other logical operators are - * supported. At most three filter fields are allowed in the filter - * string and if provided more than that then `INVALID_ARGUMENT` error is - * returned by the API. - * - * Here are a few examples: - * - * * `display_name = production` - - The display name of the attribute is - * _production_. - * * `(display_name = production) AND (create_time < - * \"2021-08-15T14:50:00Z\") AND (create_time > \"2021-08-10T12:00:00Z\")` - - * The display name of the attribute is _production_ and the attribute was - * created before _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00 - * UTC_. - * * `display_name = production OR scope = api` - - * The attribute where the display name is _production_ or the scope is - * _api_. - * @param {number} [request.pageSize] - * Optional. The maximum number of attribute resources to return. The service - * may return fewer than this value. If unspecified, at most 50 attributes - * will be returned. The maximum value is 1000; values above 1000 will be - * coerced to 1000. - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous `ListAttributes` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to `ListAttributes` must - * match the call that provided the page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.cloud.apihub.v1.Attribute|Attribute} 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 `listAttributesAsync()` - * 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. - */ - listAttributesStream( - request?: protos.google.cloud.apihub.v1.IListAttributesRequest, - 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['listAttributes']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listAttributes.createStream( - this.innerApiCalls.listAttributes as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listAttributes`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource for Attribute. - * Format: `projects/{project}/locations/{location}` - * @param {string} [request.filter] - * Optional. An expression that filters the list of Attributes. - * - * A filter expression consists of a field name, a comparison - * operator, and a value for filtering. The value must be a string or a - * boolean. The comparison operator must be one of: `<`, `>` or - * `=`. Filters are not case sensitive. - * - * The following fields in the `Attribute` are eligible for filtering: - * - * * `display_name` - The display name of the Attribute. Allowed - * comparison operators: `=`. - * * `definition_type` - The definition type of the attribute. Allowed - * comparison operators: `=`. - * * `scope` - The scope of the attribute. Allowed comparison operators: - * `=`. - * * `data_type` - The type of the data of the attribute. Allowed - * comparison operators: `=`. - * * `mandatory` - Denotes whether the attribute is mandatory or not. - * Allowed comparison operators: `=`. - * * `create_time` - The time at which the Attribute was created. The - * value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] - * format. Allowed comparison operators: `>` and `<`. - * - * Expressions are combined with either `AND` logic operator or `OR` logical - * operator but not both of them together i.e. only one of the `AND` or `OR` - * operator can be used throughout the filter string and both the operators - * cannot be used together. No other logical operators are - * supported. At most three filter fields are allowed in the filter - * string and if provided more than that then `INVALID_ARGUMENT` error is - * returned by the API. - * - * Here are a few examples: - * - * * `display_name = production` - - The display name of the attribute is - * _production_. - * * `(display_name = production) AND (create_time < - * \"2021-08-15T14:50:00Z\") AND (create_time > \"2021-08-10T12:00:00Z\")` - - * The display name of the attribute is _production_ and the attribute was - * created before _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00 - * UTC_. - * * `display_name = production OR scope = api` - - * The attribute where the display name is _production_ or the scope is - * _api_. - * @param {number} [request.pageSize] - * Optional. The maximum number of attribute resources to return. The service - * may return fewer than this value. If unspecified, at most 50 attributes - * will be returned. The maximum value is 1000; values above 1000 will be - * coerced to 1000. - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous `ListAttributes` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to `ListAttributes` must - * match the call that provided the page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@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.apihub.v1.Attribute|Attribute}. 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/api_hub.list_attributes.js - * region_tag:apihub_v1_generated_ApiHub_ListAttributes_async - */ - listAttributesAsync( - request?: protos.google.cloud.apihub.v1.IListAttributesRequest, - 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['listAttributes']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listAttributes.asyncIterate( - this.innerApiCalls['listAttributes'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Search across API-Hub resources. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.location - * Required. The resource name of the location which will be of the type - * `projects/{project_id}/locations/{location_id}`. This field is used to - * identify the instance of API-Hub in which resources should be searched. - * @param {string} request.query - * Required. The free text search query. This query can contain keywords which - * could be related to any detail of the API-Hub resources such display names, - * descriptions, attributes etc. - * @param {string} [request.filter] - * Optional. An expression that filters the list of search results. - * - * A filter expression consists of a field name, a comparison operator, - * and a value for filtering. The value must be a string, a number, or a - * boolean. The comparison operator must be `=`. Filters are not case - * sensitive. - * - * The following field names are eligible for filtering: - * * `resource_type` - The type of resource in the search results. - * Must be one of the following: `Api`, `ApiOperation`, `Deployment`, - * `Definition`, `Spec` or `Version`. This field can only be specified once - * in the filter. - * - * Here are is an example: - * - * * `resource_type = Api` - The resource_type is _Api_. - * @param {number} [request.pageSize] - * Optional. The maximum number of search results to return. The service may - * return fewer than this value. If unspecified at most 10 search results will - * be returned. If value is negative then `INVALID_ARGUMENT` error is - * returned. The maximum value is 25; values above 25 will be coerced to 25. - * While paginating, you can specify a new page size parameter for each page - * of search results to be listed. - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous - * {@link protos.SearchResources|SearchResources} - * call. Specify this parameter to retrieve the next page of transactions. - * - * When paginating, you must specify the `page_token` parameter and all the - * other parameters except - * {@link protos.google.cloud.apihub.v1.SearchResourcesRequest.page_size|page_size} - * should be specified with the same value which was used in the previous - * call. If the other fields are set with a different value than the previous - * call then `INVALID_ARGUMENT` error is returned. - * @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.apihub.v1.SearchResult|SearchResult}. - * 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 `searchResourcesAsync()` - * 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. - */ - searchResources( - request?: protos.google.cloud.apihub.v1.ISearchResourcesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apihub.v1.ISearchResult[], - protos.google.cloud.apihub.v1.ISearchResourcesRequest|null, - protos.google.cloud.apihub.v1.ISearchResourcesResponse - ]>; - searchResources( - request: protos.google.cloud.apihub.v1.ISearchResourcesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.apihub.v1.ISearchResourcesRequest, - protos.google.cloud.apihub.v1.ISearchResourcesResponse|null|undefined, - protos.google.cloud.apihub.v1.ISearchResult>): void; - searchResources( - request: protos.google.cloud.apihub.v1.ISearchResourcesRequest, - callback: PaginationCallback< - protos.google.cloud.apihub.v1.ISearchResourcesRequest, - protos.google.cloud.apihub.v1.ISearchResourcesResponse|null|undefined, - protos.google.cloud.apihub.v1.ISearchResult>): void; - searchResources( - request?: protos.google.cloud.apihub.v1.ISearchResourcesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.apihub.v1.ISearchResourcesRequest, - protos.google.cloud.apihub.v1.ISearchResourcesResponse|null|undefined, - protos.google.cloud.apihub.v1.ISearchResult>, - callback?: PaginationCallback< - protos.google.cloud.apihub.v1.ISearchResourcesRequest, - protos.google.cloud.apihub.v1.ISearchResourcesResponse|null|undefined, - protos.google.cloud.apihub.v1.ISearchResult>): - Promise<[ - protos.google.cloud.apihub.v1.ISearchResult[], - protos.google.cloud.apihub.v1.ISearchResourcesRequest|null, - protos.google.cloud.apihub.v1.ISearchResourcesResponse - ]>|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({ - 'location': request.location ?? '', - }); - this.initialize(); - return this.innerApiCalls.searchResources(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.location - * Required. The resource name of the location which will be of the type - * `projects/{project_id}/locations/{location_id}`. This field is used to - * identify the instance of API-Hub in which resources should be searched. - * @param {string} request.query - * Required. The free text search query. This query can contain keywords which - * could be related to any detail of the API-Hub resources such display names, - * descriptions, attributes etc. - * @param {string} [request.filter] - * Optional. An expression that filters the list of search results. - * - * A filter expression consists of a field name, a comparison operator, - * and a value for filtering. The value must be a string, a number, or a - * boolean. The comparison operator must be `=`. Filters are not case - * sensitive. - * - * The following field names are eligible for filtering: - * * `resource_type` - The type of resource in the search results. - * Must be one of the following: `Api`, `ApiOperation`, `Deployment`, - * `Definition`, `Spec` or `Version`. This field can only be specified once - * in the filter. - * - * Here are is an example: - * - * * `resource_type = Api` - The resource_type is _Api_. - * @param {number} [request.pageSize] - * Optional. The maximum number of search results to return. The service may - * return fewer than this value. If unspecified at most 10 search results will - * be returned. If value is negative then `INVALID_ARGUMENT` error is - * returned. The maximum value is 25; values above 25 will be coerced to 25. - * While paginating, you can specify a new page size parameter for each page - * of search results to be listed. - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous - * {@link protos.SearchResources|SearchResources} - * call. Specify this parameter to retrieve the next page of transactions. - * - * When paginating, you must specify the `page_token` parameter and all the - * other parameters except - * {@link protos.google.cloud.apihub.v1.SearchResourcesRequest.page_size|page_size} - * should be specified with the same value which was used in the previous - * call. If the other fields are set with a different value than the previous - * call then `INVALID_ARGUMENT` error is returned. - * @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.apihub.v1.SearchResult|SearchResult} 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 `searchResourcesAsync()` - * 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. - */ - searchResourcesStream( - request?: protos.google.cloud.apihub.v1.ISearchResourcesRequest, - 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({ - 'location': request.location ?? '', - }); - const defaultCallSettings = this._defaults['searchResources']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.searchResources.createStream( - this.innerApiCalls.searchResources as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `searchResources`, 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.location - * Required. The resource name of the location which will be of the type - * `projects/{project_id}/locations/{location_id}`. This field is used to - * identify the instance of API-Hub in which resources should be searched. - * @param {string} request.query - * Required. The free text search query. This query can contain keywords which - * could be related to any detail of the API-Hub resources such display names, - * descriptions, attributes etc. - * @param {string} [request.filter] - * Optional. An expression that filters the list of search results. - * - * A filter expression consists of a field name, a comparison operator, - * and a value for filtering. The value must be a string, a number, or a - * boolean. The comparison operator must be `=`. Filters are not case - * sensitive. - * - * The following field names are eligible for filtering: - * * `resource_type` - The type of resource in the search results. - * Must be one of the following: `Api`, `ApiOperation`, `Deployment`, - * `Definition`, `Spec` or `Version`. This field can only be specified once - * in the filter. - * - * Here are is an example: - * - * * `resource_type = Api` - The resource_type is _Api_. - * @param {number} [request.pageSize] - * Optional. The maximum number of search results to return. The service may - * return fewer than this value. If unspecified at most 10 search results will - * be returned. If value is negative then `INVALID_ARGUMENT` error is - * returned. The maximum value is 25; values above 25 will be coerced to 25. - * While paginating, you can specify a new page size parameter for each page - * of search results to be listed. - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous - * {@link protos.SearchResources|SearchResources} - * call. Specify this parameter to retrieve the next page of transactions. - * - * When paginating, you must specify the `page_token` parameter and all the - * other parameters except - * {@link protos.google.cloud.apihub.v1.SearchResourcesRequest.page_size|page_size} - * should be specified with the same value which was used in the previous - * call. If the other fields are set with a different value than the previous - * call then `INVALID_ARGUMENT` error is returned. - * @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.apihub.v1.SearchResult|SearchResult}. 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/api_hub.search_resources.js - * region_tag:apihub_v1_generated_ApiHub_SearchResources_async - */ - searchResourcesAsync( - request?: protos.google.cloud.apihub.v1.ISearchResourcesRequest, - 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({ - 'location': request.location ?? '', - }); - const defaultCallSettings = this._defaults['searchResources']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.searchResources.asyncIterate( - this.innerApiCalls['searchResources'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * List External API resources in the API hub. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent, which owns this collection of External API resources. - * Format: `projects/{project}/locations/{location}` - * @param {number} [request.pageSize] - * Optional. The maximum number of External API resources to return. The - * service may return fewer than this value. If unspecified, at most 50 - * ExternalApis will be returned. The maximum value is 1000; values above 1000 - * will be coerced to 1000. - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous `ListExternalApis` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters (except page_size) provided to - * `ListExternalApis` must match the call that provided the page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.cloud.apihub.v1.ExternalApi|ExternalApi}. - * 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 `listExternalApisAsync()` - * 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. - */ - listExternalApis( - request?: protos.google.cloud.apihub.v1.IListExternalApisRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apihub.v1.IExternalApi[], - protos.google.cloud.apihub.v1.IListExternalApisRequest|null, - protos.google.cloud.apihub.v1.IListExternalApisResponse - ]>; - listExternalApis( - request: protos.google.cloud.apihub.v1.IListExternalApisRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.apihub.v1.IListExternalApisRequest, - protos.google.cloud.apihub.v1.IListExternalApisResponse|null|undefined, - protos.google.cloud.apihub.v1.IExternalApi>): void; - listExternalApis( - request: protos.google.cloud.apihub.v1.IListExternalApisRequest, - callback: PaginationCallback< - protos.google.cloud.apihub.v1.IListExternalApisRequest, - protos.google.cloud.apihub.v1.IListExternalApisResponse|null|undefined, - protos.google.cloud.apihub.v1.IExternalApi>): void; - listExternalApis( - request?: protos.google.cloud.apihub.v1.IListExternalApisRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.apihub.v1.IListExternalApisRequest, - protos.google.cloud.apihub.v1.IListExternalApisResponse|null|undefined, - protos.google.cloud.apihub.v1.IExternalApi>, - callback?: PaginationCallback< - protos.google.cloud.apihub.v1.IListExternalApisRequest, - protos.google.cloud.apihub.v1.IListExternalApisResponse|null|undefined, - protos.google.cloud.apihub.v1.IExternalApi>): - Promise<[ - protos.google.cloud.apihub.v1.IExternalApi[], - protos.google.cloud.apihub.v1.IListExternalApisRequest|null, - protos.google.cloud.apihub.v1.IListExternalApisResponse - ]>|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.listExternalApis(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent, which owns this collection of External API resources. - * Format: `projects/{project}/locations/{location}` - * @param {number} [request.pageSize] - * Optional. The maximum number of External API resources to return. The - * service may return fewer than this value. If unspecified, at most 50 - * ExternalApis will be returned. The maximum value is 1000; values above 1000 - * will be coerced to 1000. - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous `ListExternalApis` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters (except page_size) provided to - * `ListExternalApis` must match the call that provided the page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.cloud.apihub.v1.ExternalApi|ExternalApi} 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 `listExternalApisAsync()` - * 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. - */ - listExternalApisStream( - request?: protos.google.cloud.apihub.v1.IListExternalApisRequest, - 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['listExternalApis']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listExternalApis.createStream( - this.innerApiCalls.listExternalApis as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listExternalApis`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent, which owns this collection of External API resources. - * Format: `projects/{project}/locations/{location}` - * @param {number} [request.pageSize] - * Optional. The maximum number of External API resources to return. The - * service may return fewer than this value. If unspecified, at most 50 - * ExternalApis will be returned. The maximum value is 1000; values above 1000 - * will be coerced to 1000. - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous `ListExternalApis` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters (except page_size) provided to - * `ListExternalApis` must match the call that provided the page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@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.apihub.v1.ExternalApi|ExternalApi}. 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/api_hub.list_external_apis.js - * region_tag:apihub_v1_generated_ApiHub_ListExternalApis_async - */ - listExternalApisAsync( - request?: protos.google.cloud.apihub.v1.IListExternalApisRequest, - 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['listExternalApis']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listExternalApis.asyncIterate( - this.innerApiCalls['listExternalApis'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } -/** - * 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); - } - - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified api resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} api - * @returns {string} Resource name string. - */ - apiPath(project:string,location:string,api:string) { - return this.pathTemplates.apiPathTemplate.render({ - project: project, - location: location, - api: api, - }); - } - - /** - * Parse the project from Api resource. - * - * @param {string} apiName - * A fully-qualified path representing Api resource. - * @returns {string} A string representing the project. - */ - matchProjectFromApiName(apiName: string) { - return this.pathTemplates.apiPathTemplate.match(apiName).project; - } - - /** - * Parse the location from Api resource. - * - * @param {string} apiName - * A fully-qualified path representing Api resource. - * @returns {string} A string representing the location. - */ - matchLocationFromApiName(apiName: string) { - return this.pathTemplates.apiPathTemplate.match(apiName).location; - } - - /** - * Parse the api from Api resource. - * - * @param {string} apiName - * A fully-qualified path representing Api resource. - * @returns {string} A string representing the api. - */ - matchApiFromApiName(apiName: string) { - return this.pathTemplates.apiPathTemplate.match(apiName).api; - } - - /** - * Return a fully-qualified apiHubInstance resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} api_hub_instance - * @returns {string} Resource name string. - */ - apiHubInstancePath(project:string,location:string,apiHubInstance:string) { - return this.pathTemplates.apiHubInstancePathTemplate.render({ - project: project, - location: location, - api_hub_instance: apiHubInstance, - }); - } - - /** - * Parse the project from ApiHubInstance resource. - * - * @param {string} apiHubInstanceName - * A fully-qualified path representing ApiHubInstance resource. - * @returns {string} A string representing the project. - */ - matchProjectFromApiHubInstanceName(apiHubInstanceName: string) { - return this.pathTemplates.apiHubInstancePathTemplate.match(apiHubInstanceName).project; - } - - /** - * Parse the location from ApiHubInstance resource. - * - * @param {string} apiHubInstanceName - * A fully-qualified path representing ApiHubInstance resource. - * @returns {string} A string representing the location. - */ - matchLocationFromApiHubInstanceName(apiHubInstanceName: string) { - return this.pathTemplates.apiHubInstancePathTemplate.match(apiHubInstanceName).location; - } - - /** - * Parse the api_hub_instance from ApiHubInstance resource. - * - * @param {string} apiHubInstanceName - * A fully-qualified path representing ApiHubInstance resource. - * @returns {string} A string representing the api_hub_instance. - */ - matchApiHubInstanceFromApiHubInstanceName(apiHubInstanceName: string) { - return this.pathTemplates.apiHubInstancePathTemplate.match(apiHubInstanceName).api_hub_instance; - } - - /** - * Return a fully-qualified apiOperation resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} api - * @param {string} version - * @param {string} operation - * @returns {string} Resource name string. - */ - apiOperationPath(project:string,location:string,api:string,version:string,operation:string) { - return this.pathTemplates.apiOperationPathTemplate.render({ - project: project, - location: location, - api: api, - version: version, - operation: operation, - }); - } - - /** - * Parse the project from ApiOperation resource. - * - * @param {string} apiOperationName - * A fully-qualified path representing ApiOperation resource. - * @returns {string} A string representing the project. - */ - matchProjectFromApiOperationName(apiOperationName: string) { - return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).project; - } - - /** - * Parse the location from ApiOperation resource. - * - * @param {string} apiOperationName - * A fully-qualified path representing ApiOperation resource. - * @returns {string} A string representing the location. - */ - matchLocationFromApiOperationName(apiOperationName: string) { - return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).location; - } - - /** - * Parse the api from ApiOperation resource. - * - * @param {string} apiOperationName - * A fully-qualified path representing ApiOperation resource. - * @returns {string} A string representing the api. - */ - matchApiFromApiOperationName(apiOperationName: string) { - return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).api; - } - - /** - * Parse the version from ApiOperation resource. - * - * @param {string} apiOperationName - * A fully-qualified path representing ApiOperation resource. - * @returns {string} A string representing the version. - */ - matchVersionFromApiOperationName(apiOperationName: string) { - return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).version; - } - - /** - * Parse the operation from ApiOperation resource. - * - * @param {string} apiOperationName - * A fully-qualified path representing ApiOperation resource. - * @returns {string} A string representing the operation. - */ - matchOperationFromApiOperationName(apiOperationName: string) { - return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).operation; - } - - /** - * Return a fully-qualified attribute resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} attribute - * @returns {string} Resource name string. - */ - attributePath(project:string,location:string,attribute:string) { - return this.pathTemplates.attributePathTemplate.render({ - project: project, - location: location, - attribute: attribute, - }); - } - - /** - * Parse the project from Attribute resource. - * - * @param {string} attributeName - * A fully-qualified path representing Attribute resource. - * @returns {string} A string representing the project. - */ - matchProjectFromAttributeName(attributeName: string) { - return this.pathTemplates.attributePathTemplate.match(attributeName).project; - } - - /** - * Parse the location from Attribute resource. - * - * @param {string} attributeName - * A fully-qualified path representing Attribute resource. - * @returns {string} A string representing the location. - */ - matchLocationFromAttributeName(attributeName: string) { - return this.pathTemplates.attributePathTemplate.match(attributeName).location; - } - - /** - * Parse the attribute from Attribute resource. - * - * @param {string} attributeName - * A fully-qualified path representing Attribute resource. - * @returns {string} A string representing the attribute. - */ - matchAttributeFromAttributeName(attributeName: string) { - return this.pathTemplates.attributePathTemplate.match(attributeName).attribute; - } - - /** - * Return a fully-qualified definition resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} api - * @param {string} version - * @param {string} definition - * @returns {string} Resource name string. - */ - definitionPath(project:string,location:string,api:string,version:string,definition:string) { - return this.pathTemplates.definitionPathTemplate.render({ - project: project, - location: location, - api: api, - version: version, - definition: definition, - }); - } - - /** - * Parse the project from Definition resource. - * - * @param {string} definitionName - * A fully-qualified path representing Definition resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDefinitionName(definitionName: string) { - return this.pathTemplates.definitionPathTemplate.match(definitionName).project; - } - - /** - * Parse the location from Definition resource. - * - * @param {string} definitionName - * A fully-qualified path representing Definition resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDefinitionName(definitionName: string) { - return this.pathTemplates.definitionPathTemplate.match(definitionName).location; - } - - /** - * Parse the api from Definition resource. - * - * @param {string} definitionName - * A fully-qualified path representing Definition resource. - * @returns {string} A string representing the api. - */ - matchApiFromDefinitionName(definitionName: string) { - return this.pathTemplates.definitionPathTemplate.match(definitionName).api; - } - - /** - * Parse the version from Definition resource. - * - * @param {string} definitionName - * A fully-qualified path representing Definition resource. - * @returns {string} A string representing the version. - */ - matchVersionFromDefinitionName(definitionName: string) { - return this.pathTemplates.definitionPathTemplate.match(definitionName).version; - } - - /** - * Parse the definition from Definition resource. - * - * @param {string} definitionName - * A fully-qualified path representing Definition resource. - * @returns {string} A string representing the definition. - */ - matchDefinitionFromDefinitionName(definitionName: string) { - return this.pathTemplates.definitionPathTemplate.match(definitionName).definition; - } - - /** - * Return a fully-qualified dependency resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dependency - * @returns {string} Resource name string. - */ - dependencyPath(project:string,location:string,dependency:string) { - return this.pathTemplates.dependencyPathTemplate.render({ - project: project, - location: location, - dependency: dependency, - }); - } - - /** - * Parse the project from Dependency resource. - * - * @param {string} dependencyName - * A fully-qualified path representing Dependency resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDependencyName(dependencyName: string) { - return this.pathTemplates.dependencyPathTemplate.match(dependencyName).project; - } - - /** - * Parse the location from Dependency resource. - * - * @param {string} dependencyName - * A fully-qualified path representing Dependency resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDependencyName(dependencyName: string) { - return this.pathTemplates.dependencyPathTemplate.match(dependencyName).location; - } - - /** - * Parse the dependency from Dependency resource. - * - * @param {string} dependencyName - * A fully-qualified path representing Dependency resource. - * @returns {string} A string representing the dependency. - */ - matchDependencyFromDependencyName(dependencyName: string) { - return this.pathTemplates.dependencyPathTemplate.match(dependencyName).dependency; - } - - /** - * Return a fully-qualified deployment resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} deployment - * @returns {string} Resource name string. - */ - deploymentPath(project:string,location:string,deployment:string) { - return this.pathTemplates.deploymentPathTemplate.render({ - project: project, - location: location, - deployment: deployment, - }); - } - - /** - * Parse the project from Deployment resource. - * - * @param {string} deploymentName - * A fully-qualified path representing Deployment resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDeploymentName(deploymentName: string) { - return this.pathTemplates.deploymentPathTemplate.match(deploymentName).project; - } - - /** - * Parse the location from Deployment resource. - * - * @param {string} deploymentName - * A fully-qualified path representing Deployment resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDeploymentName(deploymentName: string) { - return this.pathTemplates.deploymentPathTemplate.match(deploymentName).location; - } - - /** - * Parse the deployment from Deployment resource. - * - * @param {string} deploymentName - * A fully-qualified path representing Deployment resource. - * @returns {string} A string representing the deployment. - */ - matchDeploymentFromDeploymentName(deploymentName: string) { - return this.pathTemplates.deploymentPathTemplate.match(deploymentName).deployment; - } - - /** - * Return a fully-qualified externalApi resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} external_api - * @returns {string} Resource name string. - */ - externalApiPath(project:string,location:string,externalApi:string) { - return this.pathTemplates.externalApiPathTemplate.render({ - project: project, - location: location, - external_api: externalApi, - }); - } - - /** - * Parse the project from ExternalApi resource. - * - * @param {string} externalApiName - * A fully-qualified path representing ExternalApi resource. - * @returns {string} A string representing the project. - */ - matchProjectFromExternalApiName(externalApiName: string) { - return this.pathTemplates.externalApiPathTemplate.match(externalApiName).project; - } - - /** - * Parse the location from ExternalApi resource. - * - * @param {string} externalApiName - * A fully-qualified path representing ExternalApi resource. - * @returns {string} A string representing the location. - */ - matchLocationFromExternalApiName(externalApiName: string) { - return this.pathTemplates.externalApiPathTemplate.match(externalApiName).location; - } - - /** - * Parse the external_api from ExternalApi resource. - * - * @param {string} externalApiName - * A fully-qualified path representing ExternalApi resource. - * @returns {string} A string representing the external_api. - */ - matchExternalApiFromExternalApiName(externalApiName: string) { - return this.pathTemplates.externalApiPathTemplate.match(externalApiName).external_api; - } - - /** - * Return a fully-qualified hostProjectRegistration resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} host_project_registration - * @returns {string} Resource name string. - */ - hostProjectRegistrationPath(project:string,location:string,hostProjectRegistration:string) { - return this.pathTemplates.hostProjectRegistrationPathTemplate.render({ - project: project, - location: location, - host_project_registration: hostProjectRegistration, - }); - } - - /** - * Parse the project from HostProjectRegistration resource. - * - * @param {string} hostProjectRegistrationName - * A fully-qualified path representing HostProjectRegistration resource. - * @returns {string} A string representing the project. - */ - matchProjectFromHostProjectRegistrationName(hostProjectRegistrationName: string) { - return this.pathTemplates.hostProjectRegistrationPathTemplate.match(hostProjectRegistrationName).project; - } - - /** - * Parse the location from HostProjectRegistration resource. - * - * @param {string} hostProjectRegistrationName - * A fully-qualified path representing HostProjectRegistration resource. - * @returns {string} A string representing the location. - */ - matchLocationFromHostProjectRegistrationName(hostProjectRegistrationName: string) { - return this.pathTemplates.hostProjectRegistrationPathTemplate.match(hostProjectRegistrationName).location; - } - - /** - * Parse the host_project_registration from HostProjectRegistration resource. - * - * @param {string} hostProjectRegistrationName - * A fully-qualified path representing HostProjectRegistration resource. - * @returns {string} A string representing the host_project_registration. - */ - matchHostProjectRegistrationFromHostProjectRegistrationName(hostProjectRegistrationName: string) { - return this.pathTemplates.hostProjectRegistrationPathTemplate.match(hostProjectRegistrationName).host_project_registration; - } - - /** - * Return a fully-qualified location resource name string. - * - * @param {string} project - * @param {string} location - * @returns {string} Resource name string. - */ - locationPath(project:string,location:string) { - return this.pathTemplates.locationPathTemplate.render({ - project: project, - location: location, - }); - } - - /** - * Parse the project from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the project. - */ - matchProjectFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).project; - } - - /** - * Parse the location from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the location. - */ - matchLocationFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).location; - } - - /** - * Return a fully-qualified plugin resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} plugin - * @returns {string} Resource name string. - */ - pluginPath(project:string,location:string,plugin:string) { - return this.pathTemplates.pluginPathTemplate.render({ - project: project, - location: location, - plugin: plugin, - }); - } - - /** - * Parse the project from Plugin resource. - * - * @param {string} pluginName - * A fully-qualified path representing Plugin resource. - * @returns {string} A string representing the project. - */ - matchProjectFromPluginName(pluginName: string) { - return this.pathTemplates.pluginPathTemplate.match(pluginName).project; - } - - /** - * Parse the location from Plugin resource. - * - * @param {string} pluginName - * A fully-qualified path representing Plugin resource. - * @returns {string} A string representing the location. - */ - matchLocationFromPluginName(pluginName: string) { - return this.pathTemplates.pluginPathTemplate.match(pluginName).location; - } - - /** - * Parse the plugin from Plugin resource. - * - * @param {string} pluginName - * A fully-qualified path representing Plugin resource. - * @returns {string} A string representing the plugin. - */ - matchPluginFromPluginName(pluginName: string) { - return this.pathTemplates.pluginPathTemplate.match(pluginName).plugin; - } - - /** - * Return a fully-qualified project resource name string. - * - * @param {string} project - * @returns {string} Resource name string. - */ - projectPath(project:string) { - return this.pathTemplates.projectPathTemplate.render({ - project: project, - }); - } - - /** - * Parse the project from Project resource. - * - * @param {string} projectName - * A fully-qualified path representing Project resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectName(projectName: string) { - return this.pathTemplates.projectPathTemplate.match(projectName).project; - } - - /** - * Return a fully-qualified runtimeProjectAttachment resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} runtime_project_attachment - * @returns {string} Resource name string. - */ - runtimeProjectAttachmentPath(project:string,location:string,runtimeProjectAttachment:string) { - return this.pathTemplates.runtimeProjectAttachmentPathTemplate.render({ - project: project, - location: location, - runtime_project_attachment: runtimeProjectAttachment, - }); - } - - /** - * Parse the project from RuntimeProjectAttachment resource. - * - * @param {string} runtimeProjectAttachmentName - * A fully-qualified path representing RuntimeProjectAttachment resource. - * @returns {string} A string representing the project. - */ - matchProjectFromRuntimeProjectAttachmentName(runtimeProjectAttachmentName: string) { - return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match(runtimeProjectAttachmentName).project; - } - - /** - * Parse the location from RuntimeProjectAttachment resource. - * - * @param {string} runtimeProjectAttachmentName - * A fully-qualified path representing RuntimeProjectAttachment resource. - * @returns {string} A string representing the location. - */ - matchLocationFromRuntimeProjectAttachmentName(runtimeProjectAttachmentName: string) { - return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match(runtimeProjectAttachmentName).location; - } - - /** - * Parse the runtime_project_attachment from RuntimeProjectAttachment resource. - * - * @param {string} runtimeProjectAttachmentName - * A fully-qualified path representing RuntimeProjectAttachment resource. - * @returns {string} A string representing the runtime_project_attachment. - */ - matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName(runtimeProjectAttachmentName: string) { - return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match(runtimeProjectAttachmentName).runtime_project_attachment; - } - - /** - * Return a fully-qualified spec resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} api - * @param {string} version - * @param {string} spec - * @returns {string} Resource name string. - */ - specPath(project:string,location:string,api:string,version:string,spec:string) { - return this.pathTemplates.specPathTemplate.render({ - project: project, - location: location, - api: api, - version: version, - spec: spec, - }); - } - - /** - * Parse the project from Spec resource. - * - * @param {string} specName - * A fully-qualified path representing Spec resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSpecName(specName: string) { - return this.pathTemplates.specPathTemplate.match(specName).project; - } - - /** - * Parse the location from Spec resource. - * - * @param {string} specName - * A fully-qualified path representing Spec resource. - * @returns {string} A string representing the location. - */ - matchLocationFromSpecName(specName: string) { - return this.pathTemplates.specPathTemplate.match(specName).location; - } - - /** - * Parse the api from Spec resource. - * - * @param {string} specName - * A fully-qualified path representing Spec resource. - * @returns {string} A string representing the api. - */ - matchApiFromSpecName(specName: string) { - return this.pathTemplates.specPathTemplate.match(specName).api; - } - - /** - * Parse the version from Spec resource. - * - * @param {string} specName - * A fully-qualified path representing Spec resource. - * @returns {string} A string representing the version. - */ - matchVersionFromSpecName(specName: string) { - return this.pathTemplates.specPathTemplate.match(specName).version; - } - - /** - * Parse the spec from Spec resource. - * - * @param {string} specName - * A fully-qualified path representing Spec resource. - * @returns {string} A string representing the spec. - */ - matchSpecFromSpecName(specName: string) { - return this.pathTemplates.specPathTemplate.match(specName).spec; - } - - /** - * Return a fully-qualified styleGuide resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} plugin - * @returns {string} Resource name string. - */ - styleGuidePath(project:string,location:string,plugin:string) { - return this.pathTemplates.styleGuidePathTemplate.render({ - project: project, - location: location, - plugin: plugin, - }); - } - - /** - * Parse the project from StyleGuide resource. - * - * @param {string} styleGuideName - * A fully-qualified path representing StyleGuide resource. - * @returns {string} A string representing the project. - */ - matchProjectFromStyleGuideName(styleGuideName: string) { - return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName).project; - } - - /** - * Parse the location from StyleGuide resource. - * - * @param {string} styleGuideName - * A fully-qualified path representing StyleGuide resource. - * @returns {string} A string representing the location. - */ - matchLocationFromStyleGuideName(styleGuideName: string) { - return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName).location; - } - - /** - * Parse the plugin from StyleGuide resource. - * - * @param {string} styleGuideName - * A fully-qualified path representing StyleGuide resource. - * @returns {string} A string representing the plugin. - */ - matchPluginFromStyleGuideName(styleGuideName: string) { - return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName).plugin; - } - - /** - * Return a fully-qualified version resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} api - * @param {string} version - * @returns {string} Resource name string. - */ - versionPath(project:string,location:string,api:string,version:string) { - return this.pathTemplates.versionPathTemplate.render({ - project: project, - location: location, - api: api, - version: version, - }); - } - - /** - * Parse the project from Version resource. - * - * @param {string} versionName - * A fully-qualified path representing Version resource. - * @returns {string} A string representing the project. - */ - matchProjectFromVersionName(versionName: string) { - return this.pathTemplates.versionPathTemplate.match(versionName).project; - } - - /** - * Parse the location from Version resource. - * - * @param {string} versionName - * A fully-qualified path representing Version resource. - * @returns {string} A string representing the location. - */ - matchLocationFromVersionName(versionName: string) { - return this.pathTemplates.versionPathTemplate.match(versionName).location; - } - - /** - * Parse the api from Version resource. - * - * @param {string} versionName - * A fully-qualified path representing Version resource. - * @returns {string} A string representing the api. - */ - matchApiFromVersionName(versionName: string) { - return this.pathTemplates.versionPathTemplate.match(versionName).api; - } - - /** - * Parse the version from Version resource. - * - * @param {string} versionName - * A fully-qualified path representing Version resource. - * @returns {string} A string representing the version. - */ - matchVersionFromVersionName(versionName: string) { - return this.pathTemplates.versionPathTemplate.match(versionName).version; - } - - /** - * 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.apiHubStub && !this._terminated) { - return this.apiHubStub.then(stub => { - this._terminated = true; - stub.close(); - this.locationsClient.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/owl-bot-staging/google-cloud-apihub/v1/test/gapic_api_hub_dependencies_v1.ts b/owl-bot-staging/google-cloud-apihub/v1/test/gapic_api_hub_dependencies_v1.ts deleted file mode 100644 index 41539ec55ca..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/test/gapic_api_hub_dependencies_v1.ts +++ /dev/null @@ -1,1879 +0,0 @@ -// Copyright 2024 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 apihubdependenciesModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf, 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 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.ApiHubDependenciesClient', () => { - describe('Common methods', () => { - it('has apiEndpoint', () => { - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient(); - const apiEndpoint = client.apiEndpoint; - assert.strictEqual(apiEndpoint, 'apihub.googleapis.com'); - }); - - it('has universeDomain', () => { - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient(); - const universeDomain = client.universeDomain; - assert.strictEqual(universeDomain, "googleapis.com"); - }); - - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - it('throws DeprecationWarning if static servicePath is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const servicePath = apihubdependenciesModule.v1.ApiHubDependenciesClient.servicePath; - assert.strictEqual(servicePath, 'apihub.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - - it('throws DeprecationWarning if static apiEndpoint is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const apiEndpoint = apihubdependenciesModule.v1.ApiHubDependenciesClient.apiEndpoint; - assert.strictEqual(apiEndpoint, 'apihub.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - } - it('sets apiEndpoint according to universe domain camelCase', () => { - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({universeDomain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'apihub.example.com'); - }); - - it('sets apiEndpoint according to universe domain snakeCase', () => { - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({universe_domain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'apihub.example.com'); - }); - - if (typeof process === 'object' && 'env' in process) { - describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { - it('sets apiEndpoint from environment variable', () => { - const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient(); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'apihub.example.com'); - if (saved) { - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; - } else { - delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - } - }); - - it('value configured in code has priority over environment variable', () => { - const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({universeDomain: 'configured.example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'apihub.configured.example.com'); - if (saved) { - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; - } else { - delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - } - }); - }); - } - it('does not allow setting both universeDomain and universe_domain', () => { - assert.throws(() => { new apihubdependenciesModule.v1.ApiHubDependenciesClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); - }); - - it('has port', () => { - const port = apihubdependenciesModule.v1.ApiHubDependenciesClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.apiHubDependenciesStub, undefined); - await client.initialize(); - assert(client.apiHubDependenciesStub); - }); - - it('has close method for the initialized client', done => { - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - assert(client.apiHubDependenciesStub); - client.close().then(() => { - done(); - }); - }); - - it('has close method for the non-initialized client', done => { - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.apiHubDependenciesStub, undefined); - client.close().then(() => { - done(); - }); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - 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 apihubdependenciesModule.v1.ApiHubDependenciesClient({ - 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('createDependency', () => { - it('invokes createDependency without error', async () => { - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.CreateDependencyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.CreateDependencyRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.Dependency() - ); - client.innerApiCalls.createDependency = stubSimpleCall(expectedResponse); - const [response] = await client.createDependency(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createDependency as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createDependency as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createDependency without error using callback', async () => { - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.CreateDependencyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.CreateDependencyRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.Dependency() - ); - client.innerApiCalls.createDependency = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createDependency( - request, - (err?: Error|null, result?: protos.google.cloud.apihub.v1.IDependency|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createDependency as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createDependency as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createDependency with error', async () => { - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.CreateDependencyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.CreateDependencyRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createDependency = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createDependency(request), expectedError); - const actualRequest = (client.innerApiCalls.createDependency as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createDependency as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createDependency with closed client', async () => { - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.CreateDependencyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.CreateDependencyRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createDependency(request), expectedError); - }); - }); - - describe('getDependency', () => { - it('invokes getDependency without error', async () => { - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetDependencyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetDependencyRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.Dependency() - ); - client.innerApiCalls.getDependency = stubSimpleCall(expectedResponse); - const [response] = await client.getDependency(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getDependency as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getDependency as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getDependency without error using callback', async () => { - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetDependencyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetDependencyRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.Dependency() - ); - client.innerApiCalls.getDependency = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getDependency( - request, - (err?: Error|null, result?: protos.google.cloud.apihub.v1.IDependency|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getDependency as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getDependency as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getDependency with error', async () => { - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetDependencyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetDependencyRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getDependency = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getDependency(request), expectedError); - const actualRequest = (client.innerApiCalls.getDependency as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getDependency as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getDependency with closed client', async () => { - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetDependencyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetDependencyRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getDependency(request), expectedError); - }); - }); - - describe('updateDependency', () => { - it('invokes updateDependency without error', async () => { - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.UpdateDependencyRequest() - ); - request.dependency ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.UpdateDependencyRequest', ['dependency', 'name']); - request.dependency.name = defaultValue1; - const expectedHeaderRequestParams = `dependency.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.Dependency() - ); - client.innerApiCalls.updateDependency = stubSimpleCall(expectedResponse); - const [response] = await client.updateDependency(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateDependency as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateDependency as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateDependency without error using callback', async () => { - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.UpdateDependencyRequest() - ); - request.dependency ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.UpdateDependencyRequest', ['dependency', 'name']); - request.dependency.name = defaultValue1; - const expectedHeaderRequestParams = `dependency.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.Dependency() - ); - client.innerApiCalls.updateDependency = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateDependency( - request, - (err?: Error|null, result?: protos.google.cloud.apihub.v1.IDependency|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateDependency as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateDependency as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateDependency with error', async () => { - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.UpdateDependencyRequest() - ); - request.dependency ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.UpdateDependencyRequest', ['dependency', 'name']); - request.dependency.name = defaultValue1; - const expectedHeaderRequestParams = `dependency.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateDependency = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateDependency(request), expectedError); - const actualRequest = (client.innerApiCalls.updateDependency as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateDependency as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateDependency with closed client', async () => { - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.UpdateDependencyRequest() - ); - request.dependency ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.UpdateDependencyRequest', ['dependency', 'name']); - request.dependency.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateDependency(request), expectedError); - }); - }); - - describe('deleteDependency', () => { - it('invokes deleteDependency without error', async () => { - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.DeleteDependencyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.DeleteDependencyRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteDependency = stubSimpleCall(expectedResponse); - const [response] = await client.deleteDependency(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteDependency as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteDependency as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteDependency without error using callback', async () => { - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.DeleteDependencyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.DeleteDependencyRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteDependency = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteDependency( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteDependency as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteDependency as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteDependency with error', async () => { - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.DeleteDependencyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.DeleteDependencyRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteDependency = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteDependency(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteDependency as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteDependency as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteDependency with closed client', async () => { - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.DeleteDependencyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.DeleteDependencyRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.deleteDependency(request), expectedError); - }); - }); - - describe('listDependencies', () => { - it('invokes listDependencies without error', async () => { - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListDependenciesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListDependenciesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apihub.v1.Dependency()), - generateSampleMessage(new protos.google.cloud.apihub.v1.Dependency()), - generateSampleMessage(new protos.google.cloud.apihub.v1.Dependency()), - ]; - client.innerApiCalls.listDependencies = stubSimpleCall(expectedResponse); - const [response] = await client.listDependencies(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listDependencies as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listDependencies as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listDependencies without error using callback', async () => { - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListDependenciesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListDependenciesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apihub.v1.Dependency()), - generateSampleMessage(new protos.google.cloud.apihub.v1.Dependency()), - generateSampleMessage(new protos.google.cloud.apihub.v1.Dependency()), - ]; - client.innerApiCalls.listDependencies = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listDependencies( - request, - (err?: Error|null, result?: protos.google.cloud.apihub.v1.IDependency[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listDependencies as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listDependencies as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listDependencies with error', async () => { - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListDependenciesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListDependenciesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listDependencies = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listDependencies(request), expectedError); - const actualRequest = (client.innerApiCalls.listDependencies as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listDependencies as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listDependenciesStream without error', async () => { - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListDependenciesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListDependenciesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apihub.v1.Dependency()), - generateSampleMessage(new protos.google.cloud.apihub.v1.Dependency()), - generateSampleMessage(new protos.google.cloud.apihub.v1.Dependency()), - ]; - client.descriptors.page.listDependencies.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listDependenciesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.apihub.v1.Dependency[] = []; - stream.on('data', (response: protos.google.cloud.apihub.v1.Dependency) => { - 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.listDependencies.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listDependencies, request)); - assert( - (client.descriptors.page.listDependencies.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listDependenciesStream with error', async () => { - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListDependenciesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListDependenciesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listDependencies.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listDependenciesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.apihub.v1.Dependency[] = []; - stream.on('data', (response: protos.google.cloud.apihub.v1.Dependency) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listDependencies.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listDependencies, request)); - assert( - (client.descriptors.page.listDependencies.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listDependencies without error', async () => { - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListDependenciesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListDependenciesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apihub.v1.Dependency()), - generateSampleMessage(new protos.google.cloud.apihub.v1.Dependency()), - generateSampleMessage(new protos.google.cloud.apihub.v1.Dependency()), - ]; - client.descriptors.page.listDependencies.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.apihub.v1.IDependency[] = []; - const iterable = client.listDependenciesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listDependencies.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listDependencies.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listDependencies with error', async () => { - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListDependenciesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListDependenciesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listDependencies.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listDependenciesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.apihub.v1.IDependency[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listDependencies.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listDependencies.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getLocation', () => { - it('invokes getLocation without error', async () => { - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - 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 apihubdependenciesModule.v1.ApiHubDependenciesClient({ - 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 apihubdependenciesModule.v1.ApiHubDependenciesClient({ - 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 apihubdependenciesModule.v1.ApiHubDependenciesClient({ - 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 apihubdependenciesModule.v1.ApiHubDependenciesClient({ - 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('Path templates', () => { - - describe('api', () => { - const fakePath = "/rendered/path/api"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - api: "apiValue", - }; - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.apiPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.apiPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('apiPath', () => { - const result = client.apiPath("projectValue", "locationValue", "apiValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.apiPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromApiName', () => { - const result = client.matchProjectFromApiName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.apiPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromApiName', () => { - const result = client.matchLocationFromApiName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.apiPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchApiFromApiName', () => { - const result = client.matchApiFromApiName(fakePath); - assert.strictEqual(result, "apiValue"); - assert((client.pathTemplates.apiPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('apiHubInstance', () => { - const fakePath = "/rendered/path/apiHubInstance"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - api_hub_instance: "apiHubInstanceValue", - }; - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.apiHubInstancePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.apiHubInstancePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('apiHubInstancePath', () => { - const result = client.apiHubInstancePath("projectValue", "locationValue", "apiHubInstanceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.apiHubInstancePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromApiHubInstanceName', () => { - const result = client.matchProjectFromApiHubInstanceName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromApiHubInstanceName', () => { - const result = client.matchLocationFromApiHubInstanceName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchApiHubInstanceFromApiHubInstanceName', () => { - const result = client.matchApiHubInstanceFromApiHubInstanceName(fakePath); - assert.strictEqual(result, "apiHubInstanceValue"); - assert((client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('apiOperation', () => { - const fakePath = "/rendered/path/apiOperation"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - api: "apiValue", - version: "versionValue", - operation: "operationValue", - }; - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.apiOperationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.apiOperationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('apiOperationPath', () => { - const result = client.apiOperationPath("projectValue", "locationValue", "apiValue", "versionValue", "operationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.apiOperationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromApiOperationName', () => { - const result = client.matchProjectFromApiOperationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromApiOperationName', () => { - const result = client.matchLocationFromApiOperationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchApiFromApiOperationName', () => { - const result = client.matchApiFromApiOperationName(fakePath); - assert.strictEqual(result, "apiValue"); - assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchVersionFromApiOperationName', () => { - const result = client.matchVersionFromApiOperationName(fakePath); - assert.strictEqual(result, "versionValue"); - assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchOperationFromApiOperationName', () => { - const result = client.matchOperationFromApiOperationName(fakePath); - assert.strictEqual(result, "operationValue"); - assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('attribute', () => { - const fakePath = "/rendered/path/attribute"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - attribute: "attributeValue", - }; - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.attributePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.attributePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('attributePath', () => { - const result = client.attributePath("projectValue", "locationValue", "attributeValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.attributePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromAttributeName', () => { - const result = client.matchProjectFromAttributeName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.attributePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromAttributeName', () => { - const result = client.matchLocationFromAttributeName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.attributePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAttributeFromAttributeName', () => { - const result = client.matchAttributeFromAttributeName(fakePath); - assert.strictEqual(result, "attributeValue"); - assert((client.pathTemplates.attributePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('definition', () => { - const fakePath = "/rendered/path/definition"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - api: "apiValue", - version: "versionValue", - definition: "definitionValue", - }; - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.definitionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.definitionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('definitionPath', () => { - const result = client.definitionPath("projectValue", "locationValue", "apiValue", "versionValue", "definitionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.definitionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDefinitionName', () => { - const result = client.matchProjectFromDefinitionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDefinitionName', () => { - const result = client.matchLocationFromDefinitionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchApiFromDefinitionName', () => { - const result = client.matchApiFromDefinitionName(fakePath); - assert.strictEqual(result, "apiValue"); - assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchVersionFromDefinitionName', () => { - const result = client.matchVersionFromDefinitionName(fakePath); - assert.strictEqual(result, "versionValue"); - assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDefinitionFromDefinitionName', () => { - const result = client.matchDefinitionFromDefinitionName(fakePath); - assert.strictEqual(result, "definitionValue"); - assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dependency', () => { - const fakePath = "/rendered/path/dependency"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dependency: "dependencyValue", - }; - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.dependencyPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.dependencyPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('dependencyPath', () => { - const result = client.dependencyPath("projectValue", "locationValue", "dependencyValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.dependencyPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDependencyName', () => { - const result = client.matchProjectFromDependencyName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.dependencyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDependencyName', () => { - const result = client.matchLocationFromDependencyName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.dependencyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDependencyFromDependencyName', () => { - const result = client.matchDependencyFromDependencyName(fakePath); - assert.strictEqual(result, "dependencyValue"); - assert((client.pathTemplates.dependencyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('deployment', () => { - const fakePath = "/rendered/path/deployment"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - deployment: "deploymentValue", - }; - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.deploymentPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.deploymentPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('deploymentPath', () => { - const result = client.deploymentPath("projectValue", "locationValue", "deploymentValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.deploymentPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDeploymentName', () => { - const result = client.matchProjectFromDeploymentName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDeploymentName', () => { - const result = client.matchLocationFromDeploymentName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDeploymentFromDeploymentName', () => { - const result = client.matchDeploymentFromDeploymentName(fakePath); - assert.strictEqual(result, "deploymentValue"); - assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('externalApi', () => { - const fakePath = "/rendered/path/externalApi"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - external_api: "externalApiValue", - }; - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.externalApiPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.externalApiPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('externalApiPath', () => { - const result = client.externalApiPath("projectValue", "locationValue", "externalApiValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.externalApiPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromExternalApiName', () => { - const result = client.matchProjectFromExternalApiName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.externalApiPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromExternalApiName', () => { - const result = client.matchLocationFromExternalApiName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.externalApiPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExternalApiFromExternalApiName', () => { - const result = client.matchExternalApiFromExternalApiName(fakePath); - assert.strictEqual(result, "externalApiValue"); - assert((client.pathTemplates.externalApiPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('hostProjectRegistration', () => { - const fakePath = "/rendered/path/hostProjectRegistration"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - host_project_registration: "hostProjectRegistrationValue", - }; - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.hostProjectRegistrationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.hostProjectRegistrationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('hostProjectRegistrationPath', () => { - const result = client.hostProjectRegistrationPath("projectValue", "locationValue", "hostProjectRegistrationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.hostProjectRegistrationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromHostProjectRegistrationName', () => { - const result = client.matchProjectFromHostProjectRegistrationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.hostProjectRegistrationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromHostProjectRegistrationName', () => { - const result = client.matchLocationFromHostProjectRegistrationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.hostProjectRegistrationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchHostProjectRegistrationFromHostProjectRegistrationName', () => { - const result = client.matchHostProjectRegistrationFromHostProjectRegistrationName(fakePath); - assert.strictEqual(result, "hostProjectRegistrationValue"); - assert((client.pathTemplates.hostProjectRegistrationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('location', () => { - const fakePath = "/rendered/path/location"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - }; - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.locationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.locationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('locationPath', () => { - const result = client.locationPath("projectValue", "locationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.locationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromLocationName', () => { - const result = client.matchProjectFromLocationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromLocationName', () => { - const result = client.matchLocationFromLocationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('plugin', () => { - const fakePath = "/rendered/path/plugin"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - plugin: "pluginValue", - }; - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.pluginPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.pluginPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('pluginPath', () => { - const result = client.pluginPath("projectValue", "locationValue", "pluginValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.pluginPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromPluginName', () => { - const result = client.matchProjectFromPluginName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.pluginPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromPluginName', () => { - const result = client.matchLocationFromPluginName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.pluginPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchPluginFromPluginName', () => { - const result = client.matchPluginFromPluginName(fakePath); - assert.strictEqual(result, "pluginValue"); - assert((client.pathTemplates.pluginPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('project', () => { - const fakePath = "/rendered/path/project"; - const expectedParameters = { - project: "projectValue", - }; - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.projectPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectPath', () => { - const result = client.projectPath("projectValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectName', () => { - const result = client.matchProjectFromProjectName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('runtimeProjectAttachment', () => { - const fakePath = "/rendered/path/runtimeProjectAttachment"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - runtime_project_attachment: "runtimeProjectAttachmentValue", - }; - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.runtimeProjectAttachmentPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.runtimeProjectAttachmentPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('runtimeProjectAttachmentPath', () => { - const result = client.runtimeProjectAttachmentPath("projectValue", "locationValue", "runtimeProjectAttachmentValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromRuntimeProjectAttachmentName', () => { - const result = client.matchProjectFromRuntimeProjectAttachmentName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromRuntimeProjectAttachmentName', () => { - const result = client.matchLocationFromRuntimeProjectAttachmentName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName', () => { - const result = client.matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName(fakePath); - assert.strictEqual(result, "runtimeProjectAttachmentValue"); - assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('spec', () => { - const fakePath = "/rendered/path/spec"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - api: "apiValue", - version: "versionValue", - spec: "specValue", - }; - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.specPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.specPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('specPath', () => { - const result = client.specPath("projectValue", "locationValue", "apiValue", "versionValue", "specValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.specPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSpecName', () => { - const result = client.matchProjectFromSpecName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.specPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSpecName', () => { - const result = client.matchLocationFromSpecName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.specPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchApiFromSpecName', () => { - const result = client.matchApiFromSpecName(fakePath); - assert.strictEqual(result, "apiValue"); - assert((client.pathTemplates.specPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchVersionFromSpecName', () => { - const result = client.matchVersionFromSpecName(fakePath); - assert.strictEqual(result, "versionValue"); - assert((client.pathTemplates.specPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSpecFromSpecName', () => { - const result = client.matchSpecFromSpecName(fakePath); - assert.strictEqual(result, "specValue"); - assert((client.pathTemplates.specPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('styleGuide', () => { - const fakePath = "/rendered/path/styleGuide"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - plugin: "pluginValue", - }; - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.styleGuidePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.styleGuidePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('styleGuidePath', () => { - const result = client.styleGuidePath("projectValue", "locationValue", "pluginValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.styleGuidePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromStyleGuideName', () => { - const result = client.matchProjectFromStyleGuideName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.styleGuidePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromStyleGuideName', () => { - const result = client.matchLocationFromStyleGuideName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.styleGuidePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchPluginFromStyleGuideName', () => { - const result = client.matchPluginFromStyleGuideName(fakePath); - assert.strictEqual(result, "pluginValue"); - assert((client.pathTemplates.styleGuidePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('version', () => { - const fakePath = "/rendered/path/version"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - api: "apiValue", - version: "versionValue", - }; - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.versionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.versionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('versionPath', () => { - const result = client.versionPath("projectValue", "locationValue", "apiValue", "versionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.versionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromVersionName', () => { - const result = client.matchProjectFromVersionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.versionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromVersionName', () => { - const result = client.matchLocationFromVersionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.versionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchApiFromVersionName', () => { - const result = client.matchApiFromVersionName(fakePath); - assert.strictEqual(result, "apiValue"); - assert((client.pathTemplates.versionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchVersionFromVersionName', () => { - const result = client.matchVersionFromVersionName(fakePath); - assert.strictEqual(result, "versionValue"); - assert((client.pathTemplates.versionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/google-cloud-apihub/v1/test/gapic_api_hub_plugin_v1.ts b/owl-bot-staging/google-cloud-apihub/v1/test/gapic_api_hub_plugin_v1.ts deleted file mode 100644 index 5321fb6dc11..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/test/gapic_api_hub_plugin_v1.ts +++ /dev/null @@ -1,1427 +0,0 @@ -// Copyright 2024 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 apihubpluginModule from '../src'; - -import {protobuf, 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 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.ApiHubPluginClient', () => { - describe('Common methods', () => { - it('has apiEndpoint', () => { - const client = new apihubpluginModule.v1.ApiHubPluginClient(); - const apiEndpoint = client.apiEndpoint; - assert.strictEqual(apiEndpoint, 'apihub.googleapis.com'); - }); - - it('has universeDomain', () => { - const client = new apihubpluginModule.v1.ApiHubPluginClient(); - const universeDomain = client.universeDomain; - assert.strictEqual(universeDomain, "googleapis.com"); - }); - - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - it('throws DeprecationWarning if static servicePath is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const servicePath = apihubpluginModule.v1.ApiHubPluginClient.servicePath; - assert.strictEqual(servicePath, 'apihub.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - - it('throws DeprecationWarning if static apiEndpoint is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const apiEndpoint = apihubpluginModule.v1.ApiHubPluginClient.apiEndpoint; - assert.strictEqual(apiEndpoint, 'apihub.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - } - it('sets apiEndpoint according to universe domain camelCase', () => { - const client = new apihubpluginModule.v1.ApiHubPluginClient({universeDomain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'apihub.example.com'); - }); - - it('sets apiEndpoint according to universe domain snakeCase', () => { - const client = new apihubpluginModule.v1.ApiHubPluginClient({universe_domain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'apihub.example.com'); - }); - - if (typeof process === 'object' && 'env' in process) { - describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { - it('sets apiEndpoint from environment variable', () => { - const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; - const client = new apihubpluginModule.v1.ApiHubPluginClient(); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'apihub.example.com'); - if (saved) { - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; - } else { - delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - } - }); - - it('value configured in code has priority over environment variable', () => { - const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; - const client = new apihubpluginModule.v1.ApiHubPluginClient({universeDomain: 'configured.example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'apihub.configured.example.com'); - if (saved) { - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; - } else { - delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - } - }); - }); - } - it('does not allow setting both universeDomain and universe_domain', () => { - assert.throws(() => { new apihubpluginModule.v1.ApiHubPluginClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); - }); - - it('has port', () => { - const port = apihubpluginModule.v1.ApiHubPluginClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new apihubpluginModule.v1.ApiHubPluginClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new apihubpluginModule.v1.ApiHubPluginClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new apihubpluginModule.v1.ApiHubPluginClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.apiHubPluginStub, undefined); - await client.initialize(); - assert(client.apiHubPluginStub); - }); - - it('has close method for the initialized client', done => { - const client = new apihubpluginModule.v1.ApiHubPluginClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - assert(client.apiHubPluginStub); - client.close().then(() => { - done(); - }); - }); - - it('has close method for the non-initialized client', done => { - const client = new apihubpluginModule.v1.ApiHubPluginClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.apiHubPluginStub, undefined); - client.close().then(() => { - done(); - }); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new apihubpluginModule.v1.ApiHubPluginClient({ - 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 apihubpluginModule.v1.ApiHubPluginClient({ - 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('getPlugin', () => { - it('invokes getPlugin without error', async () => { - const client = new apihubpluginModule.v1.ApiHubPluginClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetPluginRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetPluginRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.Plugin() - ); - client.innerApiCalls.getPlugin = stubSimpleCall(expectedResponse); - const [response] = await client.getPlugin(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getPlugin as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getPlugin as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getPlugin without error using callback', async () => { - const client = new apihubpluginModule.v1.ApiHubPluginClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetPluginRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetPluginRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.Plugin() - ); - client.innerApiCalls.getPlugin = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getPlugin( - request, - (err?: Error|null, result?: protos.google.cloud.apihub.v1.IPlugin|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getPlugin as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getPlugin as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getPlugin with error', async () => { - const client = new apihubpluginModule.v1.ApiHubPluginClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetPluginRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetPluginRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getPlugin = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getPlugin(request), expectedError); - const actualRequest = (client.innerApiCalls.getPlugin as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getPlugin as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getPlugin with closed client', async () => { - const client = new apihubpluginModule.v1.ApiHubPluginClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetPluginRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetPluginRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getPlugin(request), expectedError); - }); - }); - - describe('enablePlugin', () => { - it('invokes enablePlugin without error', async () => { - const client = new apihubpluginModule.v1.ApiHubPluginClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.EnablePluginRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.EnablePluginRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.Plugin() - ); - client.innerApiCalls.enablePlugin = stubSimpleCall(expectedResponse); - const [response] = await client.enablePlugin(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.enablePlugin as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.enablePlugin as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes enablePlugin without error using callback', async () => { - const client = new apihubpluginModule.v1.ApiHubPluginClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.EnablePluginRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.EnablePluginRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.Plugin() - ); - client.innerApiCalls.enablePlugin = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.enablePlugin( - request, - (err?: Error|null, result?: protos.google.cloud.apihub.v1.IPlugin|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.enablePlugin as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.enablePlugin as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes enablePlugin with error', async () => { - const client = new apihubpluginModule.v1.ApiHubPluginClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.EnablePluginRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.EnablePluginRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.enablePlugin = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.enablePlugin(request), expectedError); - const actualRequest = (client.innerApiCalls.enablePlugin as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.enablePlugin as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes enablePlugin with closed client', async () => { - const client = new apihubpluginModule.v1.ApiHubPluginClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.EnablePluginRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.EnablePluginRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.enablePlugin(request), expectedError); - }); - }); - - describe('disablePlugin', () => { - it('invokes disablePlugin without error', async () => { - const client = new apihubpluginModule.v1.ApiHubPluginClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.DisablePluginRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.DisablePluginRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.Plugin() - ); - client.innerApiCalls.disablePlugin = stubSimpleCall(expectedResponse); - const [response] = await client.disablePlugin(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.disablePlugin as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.disablePlugin as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes disablePlugin without error using callback', async () => { - const client = new apihubpluginModule.v1.ApiHubPluginClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.DisablePluginRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.DisablePluginRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.Plugin() - ); - client.innerApiCalls.disablePlugin = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.disablePlugin( - request, - (err?: Error|null, result?: protos.google.cloud.apihub.v1.IPlugin|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.disablePlugin as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.disablePlugin as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes disablePlugin with error', async () => { - const client = new apihubpluginModule.v1.ApiHubPluginClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.DisablePluginRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.DisablePluginRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.disablePlugin = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.disablePlugin(request), expectedError); - const actualRequest = (client.innerApiCalls.disablePlugin as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.disablePlugin as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes disablePlugin with closed client', async () => { - const client = new apihubpluginModule.v1.ApiHubPluginClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.DisablePluginRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.DisablePluginRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.disablePlugin(request), expectedError); - }); - }); - describe('getLocation', () => { - it('invokes getLocation without error', async () => { - const client = new apihubpluginModule.v1.ApiHubPluginClient({ - 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 apihubpluginModule.v1.ApiHubPluginClient({ - 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 apihubpluginModule.v1.ApiHubPluginClient({ - 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 apihubpluginModule.v1.ApiHubPluginClient({ - 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 apihubpluginModule.v1.ApiHubPluginClient({ - 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('Path templates', () => { - - describe('api', () => { - const fakePath = "/rendered/path/api"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - api: "apiValue", - }; - const client = new apihubpluginModule.v1.ApiHubPluginClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.apiPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.apiPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('apiPath', () => { - const result = client.apiPath("projectValue", "locationValue", "apiValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.apiPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromApiName', () => { - const result = client.matchProjectFromApiName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.apiPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromApiName', () => { - const result = client.matchLocationFromApiName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.apiPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchApiFromApiName', () => { - const result = client.matchApiFromApiName(fakePath); - assert.strictEqual(result, "apiValue"); - assert((client.pathTemplates.apiPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('apiHubInstance', () => { - const fakePath = "/rendered/path/apiHubInstance"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - api_hub_instance: "apiHubInstanceValue", - }; - const client = new apihubpluginModule.v1.ApiHubPluginClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.apiHubInstancePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.apiHubInstancePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('apiHubInstancePath', () => { - const result = client.apiHubInstancePath("projectValue", "locationValue", "apiHubInstanceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.apiHubInstancePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromApiHubInstanceName', () => { - const result = client.matchProjectFromApiHubInstanceName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromApiHubInstanceName', () => { - const result = client.matchLocationFromApiHubInstanceName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchApiHubInstanceFromApiHubInstanceName', () => { - const result = client.matchApiHubInstanceFromApiHubInstanceName(fakePath); - assert.strictEqual(result, "apiHubInstanceValue"); - assert((client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('apiOperation', () => { - const fakePath = "/rendered/path/apiOperation"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - api: "apiValue", - version: "versionValue", - operation: "operationValue", - }; - const client = new apihubpluginModule.v1.ApiHubPluginClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.apiOperationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.apiOperationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('apiOperationPath', () => { - const result = client.apiOperationPath("projectValue", "locationValue", "apiValue", "versionValue", "operationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.apiOperationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromApiOperationName', () => { - const result = client.matchProjectFromApiOperationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromApiOperationName', () => { - const result = client.matchLocationFromApiOperationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchApiFromApiOperationName', () => { - const result = client.matchApiFromApiOperationName(fakePath); - assert.strictEqual(result, "apiValue"); - assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchVersionFromApiOperationName', () => { - const result = client.matchVersionFromApiOperationName(fakePath); - assert.strictEqual(result, "versionValue"); - assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchOperationFromApiOperationName', () => { - const result = client.matchOperationFromApiOperationName(fakePath); - assert.strictEqual(result, "operationValue"); - assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('attribute', () => { - const fakePath = "/rendered/path/attribute"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - attribute: "attributeValue", - }; - const client = new apihubpluginModule.v1.ApiHubPluginClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.attributePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.attributePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('attributePath', () => { - const result = client.attributePath("projectValue", "locationValue", "attributeValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.attributePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromAttributeName', () => { - const result = client.matchProjectFromAttributeName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.attributePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromAttributeName', () => { - const result = client.matchLocationFromAttributeName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.attributePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAttributeFromAttributeName', () => { - const result = client.matchAttributeFromAttributeName(fakePath); - assert.strictEqual(result, "attributeValue"); - assert((client.pathTemplates.attributePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('definition', () => { - const fakePath = "/rendered/path/definition"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - api: "apiValue", - version: "versionValue", - definition: "definitionValue", - }; - const client = new apihubpluginModule.v1.ApiHubPluginClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.definitionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.definitionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('definitionPath', () => { - const result = client.definitionPath("projectValue", "locationValue", "apiValue", "versionValue", "definitionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.definitionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDefinitionName', () => { - const result = client.matchProjectFromDefinitionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDefinitionName', () => { - const result = client.matchLocationFromDefinitionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchApiFromDefinitionName', () => { - const result = client.matchApiFromDefinitionName(fakePath); - assert.strictEqual(result, "apiValue"); - assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchVersionFromDefinitionName', () => { - const result = client.matchVersionFromDefinitionName(fakePath); - assert.strictEqual(result, "versionValue"); - assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDefinitionFromDefinitionName', () => { - const result = client.matchDefinitionFromDefinitionName(fakePath); - assert.strictEqual(result, "definitionValue"); - assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dependency', () => { - const fakePath = "/rendered/path/dependency"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dependency: "dependencyValue", - }; - const client = new apihubpluginModule.v1.ApiHubPluginClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.dependencyPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.dependencyPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('dependencyPath', () => { - const result = client.dependencyPath("projectValue", "locationValue", "dependencyValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.dependencyPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDependencyName', () => { - const result = client.matchProjectFromDependencyName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.dependencyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDependencyName', () => { - const result = client.matchLocationFromDependencyName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.dependencyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDependencyFromDependencyName', () => { - const result = client.matchDependencyFromDependencyName(fakePath); - assert.strictEqual(result, "dependencyValue"); - assert((client.pathTemplates.dependencyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('deployment', () => { - const fakePath = "/rendered/path/deployment"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - deployment: "deploymentValue", - }; - const client = new apihubpluginModule.v1.ApiHubPluginClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.deploymentPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.deploymentPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('deploymentPath', () => { - const result = client.deploymentPath("projectValue", "locationValue", "deploymentValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.deploymentPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDeploymentName', () => { - const result = client.matchProjectFromDeploymentName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDeploymentName', () => { - const result = client.matchLocationFromDeploymentName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDeploymentFromDeploymentName', () => { - const result = client.matchDeploymentFromDeploymentName(fakePath); - assert.strictEqual(result, "deploymentValue"); - assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('externalApi', () => { - const fakePath = "/rendered/path/externalApi"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - external_api: "externalApiValue", - }; - const client = new apihubpluginModule.v1.ApiHubPluginClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.externalApiPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.externalApiPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('externalApiPath', () => { - const result = client.externalApiPath("projectValue", "locationValue", "externalApiValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.externalApiPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromExternalApiName', () => { - const result = client.matchProjectFromExternalApiName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.externalApiPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromExternalApiName', () => { - const result = client.matchLocationFromExternalApiName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.externalApiPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExternalApiFromExternalApiName', () => { - const result = client.matchExternalApiFromExternalApiName(fakePath); - assert.strictEqual(result, "externalApiValue"); - assert((client.pathTemplates.externalApiPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('hostProjectRegistration', () => { - const fakePath = "/rendered/path/hostProjectRegistration"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - host_project_registration: "hostProjectRegistrationValue", - }; - const client = new apihubpluginModule.v1.ApiHubPluginClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.hostProjectRegistrationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.hostProjectRegistrationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('hostProjectRegistrationPath', () => { - const result = client.hostProjectRegistrationPath("projectValue", "locationValue", "hostProjectRegistrationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.hostProjectRegistrationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromHostProjectRegistrationName', () => { - const result = client.matchProjectFromHostProjectRegistrationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.hostProjectRegistrationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromHostProjectRegistrationName', () => { - const result = client.matchLocationFromHostProjectRegistrationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.hostProjectRegistrationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchHostProjectRegistrationFromHostProjectRegistrationName', () => { - const result = client.matchHostProjectRegistrationFromHostProjectRegistrationName(fakePath); - assert.strictEqual(result, "hostProjectRegistrationValue"); - assert((client.pathTemplates.hostProjectRegistrationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('plugin', () => { - const fakePath = "/rendered/path/plugin"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - plugin: "pluginValue", - }; - const client = new apihubpluginModule.v1.ApiHubPluginClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.pluginPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.pluginPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('pluginPath', () => { - const result = client.pluginPath("projectValue", "locationValue", "pluginValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.pluginPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromPluginName', () => { - const result = client.matchProjectFromPluginName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.pluginPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromPluginName', () => { - const result = client.matchLocationFromPluginName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.pluginPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchPluginFromPluginName', () => { - const result = client.matchPluginFromPluginName(fakePath); - assert.strictEqual(result, "pluginValue"); - assert((client.pathTemplates.pluginPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('runtimeProjectAttachment', () => { - const fakePath = "/rendered/path/runtimeProjectAttachment"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - runtime_project_attachment: "runtimeProjectAttachmentValue", - }; - const client = new apihubpluginModule.v1.ApiHubPluginClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.runtimeProjectAttachmentPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.runtimeProjectAttachmentPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('runtimeProjectAttachmentPath', () => { - const result = client.runtimeProjectAttachmentPath("projectValue", "locationValue", "runtimeProjectAttachmentValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromRuntimeProjectAttachmentName', () => { - const result = client.matchProjectFromRuntimeProjectAttachmentName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromRuntimeProjectAttachmentName', () => { - const result = client.matchLocationFromRuntimeProjectAttachmentName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName', () => { - const result = client.matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName(fakePath); - assert.strictEqual(result, "runtimeProjectAttachmentValue"); - assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('spec', () => { - const fakePath = "/rendered/path/spec"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - api: "apiValue", - version: "versionValue", - spec: "specValue", - }; - const client = new apihubpluginModule.v1.ApiHubPluginClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.specPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.specPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('specPath', () => { - const result = client.specPath("projectValue", "locationValue", "apiValue", "versionValue", "specValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.specPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSpecName', () => { - const result = client.matchProjectFromSpecName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.specPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSpecName', () => { - const result = client.matchLocationFromSpecName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.specPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchApiFromSpecName', () => { - const result = client.matchApiFromSpecName(fakePath); - assert.strictEqual(result, "apiValue"); - assert((client.pathTemplates.specPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchVersionFromSpecName', () => { - const result = client.matchVersionFromSpecName(fakePath); - assert.strictEqual(result, "versionValue"); - assert((client.pathTemplates.specPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSpecFromSpecName', () => { - const result = client.matchSpecFromSpecName(fakePath); - assert.strictEqual(result, "specValue"); - assert((client.pathTemplates.specPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('styleGuide', () => { - const fakePath = "/rendered/path/styleGuide"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - plugin: "pluginValue", - }; - const client = new apihubpluginModule.v1.ApiHubPluginClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.styleGuidePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.styleGuidePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('styleGuidePath', () => { - const result = client.styleGuidePath("projectValue", "locationValue", "pluginValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.styleGuidePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromStyleGuideName', () => { - const result = client.matchProjectFromStyleGuideName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.styleGuidePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromStyleGuideName', () => { - const result = client.matchLocationFromStyleGuideName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.styleGuidePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchPluginFromStyleGuideName', () => { - const result = client.matchPluginFromStyleGuideName(fakePath); - assert.strictEqual(result, "pluginValue"); - assert((client.pathTemplates.styleGuidePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('version', () => { - const fakePath = "/rendered/path/version"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - api: "apiValue", - version: "versionValue", - }; - const client = new apihubpluginModule.v1.ApiHubPluginClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.versionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.versionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('versionPath', () => { - const result = client.versionPath("projectValue", "locationValue", "apiValue", "versionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.versionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromVersionName', () => { - const result = client.matchProjectFromVersionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.versionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromVersionName', () => { - const result = client.matchLocationFromVersionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.versionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchApiFromVersionName', () => { - const result = client.matchApiFromVersionName(fakePath); - assert.strictEqual(result, "apiValue"); - assert((client.pathTemplates.versionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchVersionFromVersionName', () => { - const result = client.matchVersionFromVersionName(fakePath); - assert.strictEqual(result, "versionValue"); - assert((client.pathTemplates.versionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/google-cloud-apihub/v1/test/gapic_api_hub_v1.ts b/owl-bot-staging/google-cloud-apihub/v1/test/gapic_api_hub_v1.ts deleted file mode 100644 index 6be08b8e121..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/test/gapic_api_hub_v1.ts +++ /dev/null @@ -1,6098 +0,0 @@ -// Copyright 2024 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 apihubModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf, 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 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.ApiHubClient', () => { - describe('Common methods', () => { - it('has apiEndpoint', () => { - const client = new apihubModule.v1.ApiHubClient(); - const apiEndpoint = client.apiEndpoint; - assert.strictEqual(apiEndpoint, 'apihub.googleapis.com'); - }); - - it('has universeDomain', () => { - const client = new apihubModule.v1.ApiHubClient(); - const universeDomain = client.universeDomain; - assert.strictEqual(universeDomain, "googleapis.com"); - }); - - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - it('throws DeprecationWarning if static servicePath is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const servicePath = apihubModule.v1.ApiHubClient.servicePath; - assert.strictEqual(servicePath, 'apihub.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - - it('throws DeprecationWarning if static apiEndpoint is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const apiEndpoint = apihubModule.v1.ApiHubClient.apiEndpoint; - assert.strictEqual(apiEndpoint, 'apihub.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - } - it('sets apiEndpoint according to universe domain camelCase', () => { - const client = new apihubModule.v1.ApiHubClient({universeDomain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'apihub.example.com'); - }); - - it('sets apiEndpoint according to universe domain snakeCase', () => { - const client = new apihubModule.v1.ApiHubClient({universe_domain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'apihub.example.com'); - }); - - if (typeof process === 'object' && 'env' in process) { - describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { - it('sets apiEndpoint from environment variable', () => { - const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; - const client = new apihubModule.v1.ApiHubClient(); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'apihub.example.com'); - if (saved) { - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; - } else { - delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - } - }); - - it('value configured in code has priority over environment variable', () => { - const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; - const client = new apihubModule.v1.ApiHubClient({universeDomain: 'configured.example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'apihub.configured.example.com'); - if (saved) { - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; - } else { - delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - } - }); - }); - } - it('does not allow setting both universeDomain and universe_domain', () => { - assert.throws(() => { new apihubModule.v1.ApiHubClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); - }); - - it('has port', () => { - const port = apihubModule.v1.ApiHubClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new apihubModule.v1.ApiHubClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new apihubModule.v1.ApiHubClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.apiHubStub, undefined); - await client.initialize(); - assert(client.apiHubStub); - }); - - it('has close method for the initialized client', done => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - assert(client.apiHubStub); - client.close().then(() => { - done(); - }); - }); - - it('has close method for the non-initialized client', done => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.apiHubStub, undefined); - client.close().then(() => { - done(); - }); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new apihubModule.v1.ApiHubClient({ - 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 apihubModule.v1.ApiHubClient({ - 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('createApi', () => { - it('invokes createApi without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.CreateApiRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.CreateApiRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.Api() - ); - client.innerApiCalls.createApi = stubSimpleCall(expectedResponse); - const [response] = await client.createApi(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createApi as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createApi as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createApi without error using callback', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.CreateApiRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.CreateApiRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.Api() - ); - client.innerApiCalls.createApi = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createApi( - request, - (err?: Error|null, result?: protos.google.cloud.apihub.v1.IApi|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createApi as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createApi as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createApi with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.CreateApiRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.CreateApiRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createApi = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createApi(request), expectedError); - const actualRequest = (client.innerApiCalls.createApi as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createApi as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createApi with closed client', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.CreateApiRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.CreateApiRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createApi(request), expectedError); - }); - }); - - describe('getApi', () => { - it('invokes getApi without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetApiRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetApiRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.Api() - ); - client.innerApiCalls.getApi = stubSimpleCall(expectedResponse); - const [response] = await client.getApi(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getApi as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getApi as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getApi without error using callback', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetApiRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetApiRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.Api() - ); - client.innerApiCalls.getApi = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getApi( - request, - (err?: Error|null, result?: protos.google.cloud.apihub.v1.IApi|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getApi as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getApi as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getApi with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetApiRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetApiRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getApi = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getApi(request), expectedError); - const actualRequest = (client.innerApiCalls.getApi as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getApi as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getApi with closed client', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetApiRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetApiRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getApi(request), expectedError); - }); - }); - - describe('updateApi', () => { - it('invokes updateApi without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.UpdateApiRequest() - ); - request.api ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.UpdateApiRequest', ['api', 'name']); - request.api.name = defaultValue1; - const expectedHeaderRequestParams = `api.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.Api() - ); - client.innerApiCalls.updateApi = stubSimpleCall(expectedResponse); - const [response] = await client.updateApi(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateApi as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateApi as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateApi without error using callback', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.UpdateApiRequest() - ); - request.api ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.UpdateApiRequest', ['api', 'name']); - request.api.name = defaultValue1; - const expectedHeaderRequestParams = `api.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.Api() - ); - client.innerApiCalls.updateApi = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateApi( - request, - (err?: Error|null, result?: protos.google.cloud.apihub.v1.IApi|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateApi as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateApi as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateApi with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.UpdateApiRequest() - ); - request.api ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.UpdateApiRequest', ['api', 'name']); - request.api.name = defaultValue1; - const expectedHeaderRequestParams = `api.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateApi = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateApi(request), expectedError); - const actualRequest = (client.innerApiCalls.updateApi as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateApi as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateApi with closed client', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.UpdateApiRequest() - ); - request.api ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.UpdateApiRequest', ['api', 'name']); - request.api.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateApi(request), expectedError); - }); - }); - - describe('deleteApi', () => { - it('invokes deleteApi without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.DeleteApiRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.DeleteApiRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteApi = stubSimpleCall(expectedResponse); - const [response] = await client.deleteApi(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteApi as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteApi as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteApi without error using callback', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.DeleteApiRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.DeleteApiRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteApi = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteApi( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteApi as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteApi as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteApi with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.DeleteApiRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.DeleteApiRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteApi = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteApi(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteApi as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteApi as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteApi with closed client', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.DeleteApiRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.DeleteApiRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.deleteApi(request), expectedError); - }); - }); - - describe('createVersion', () => { - it('invokes createVersion without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.CreateVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.CreateVersionRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.Version() - ); - client.innerApiCalls.createVersion = stubSimpleCall(expectedResponse); - const [response] = await client.createVersion(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createVersion without error using callback', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.CreateVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.CreateVersionRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.Version() - ); - client.innerApiCalls.createVersion = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createVersion( - request, - (err?: Error|null, result?: protos.google.cloud.apihub.v1.IVersion|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createVersion with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.CreateVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.CreateVersionRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createVersion = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createVersion(request), expectedError); - const actualRequest = (client.innerApiCalls.createVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createVersion with closed client', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.CreateVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.CreateVersionRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createVersion(request), expectedError); - }); - }); - - describe('getVersion', () => { - it('invokes getVersion without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetVersionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.Version() - ); - client.innerApiCalls.getVersion = stubSimpleCall(expectedResponse); - const [response] = await client.getVersion(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getVersion without error using callback', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetVersionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.Version() - ); - client.innerApiCalls.getVersion = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getVersion( - request, - (err?: Error|null, result?: protos.google.cloud.apihub.v1.IVersion|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getVersion with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetVersionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getVersion = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getVersion(request), expectedError); - const actualRequest = (client.innerApiCalls.getVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getVersion with closed client', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetVersionRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getVersion(request), expectedError); - }); - }); - - describe('updateVersion', () => { - it('invokes updateVersion without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.UpdateVersionRequest() - ); - request.version ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.UpdateVersionRequest', ['version', 'name']); - request.version.name = defaultValue1; - const expectedHeaderRequestParams = `version.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.Version() - ); - client.innerApiCalls.updateVersion = stubSimpleCall(expectedResponse); - const [response] = await client.updateVersion(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateVersion without error using callback', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.UpdateVersionRequest() - ); - request.version ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.UpdateVersionRequest', ['version', 'name']); - request.version.name = defaultValue1; - const expectedHeaderRequestParams = `version.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.Version() - ); - client.innerApiCalls.updateVersion = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateVersion( - request, - (err?: Error|null, result?: protos.google.cloud.apihub.v1.IVersion|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateVersion with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.UpdateVersionRequest() - ); - request.version ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.UpdateVersionRequest', ['version', 'name']); - request.version.name = defaultValue1; - const expectedHeaderRequestParams = `version.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateVersion = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateVersion(request), expectedError); - const actualRequest = (client.innerApiCalls.updateVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateVersion with closed client', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.UpdateVersionRequest() - ); - request.version ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.UpdateVersionRequest', ['version', 'name']); - request.version.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateVersion(request), expectedError); - }); - }); - - describe('deleteVersion', () => { - it('invokes deleteVersion without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.DeleteVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.DeleteVersionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteVersion = stubSimpleCall(expectedResponse); - const [response] = await client.deleteVersion(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteVersion without error using callback', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.DeleteVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.DeleteVersionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteVersion = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteVersion( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteVersion with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.DeleteVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.DeleteVersionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteVersion = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteVersion(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteVersion with closed client', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.DeleteVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.DeleteVersionRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.deleteVersion(request), expectedError); - }); - }); - - describe('createSpec', () => { - it('invokes createSpec without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.CreateSpecRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.CreateSpecRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.Spec() - ); - client.innerApiCalls.createSpec = stubSimpleCall(expectedResponse); - const [response] = await client.createSpec(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createSpec as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createSpec as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createSpec without error using callback', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.CreateSpecRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.CreateSpecRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.Spec() - ); - client.innerApiCalls.createSpec = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createSpec( - request, - (err?: Error|null, result?: protos.google.cloud.apihub.v1.ISpec|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createSpec as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createSpec as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createSpec with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.CreateSpecRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.CreateSpecRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createSpec = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createSpec(request), expectedError); - const actualRequest = (client.innerApiCalls.createSpec as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createSpec as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createSpec with closed client', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.CreateSpecRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.CreateSpecRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createSpec(request), expectedError); - }); - }); - - describe('getSpec', () => { - it('invokes getSpec without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetSpecRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetSpecRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.Spec() - ); - client.innerApiCalls.getSpec = stubSimpleCall(expectedResponse); - const [response] = await client.getSpec(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getSpec as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getSpec as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getSpec without error using callback', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetSpecRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetSpecRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.Spec() - ); - client.innerApiCalls.getSpec = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getSpec( - request, - (err?: Error|null, result?: protos.google.cloud.apihub.v1.ISpec|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getSpec as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getSpec as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getSpec with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetSpecRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetSpecRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getSpec = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getSpec(request), expectedError); - const actualRequest = (client.innerApiCalls.getSpec as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getSpec as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getSpec with closed client', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetSpecRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetSpecRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getSpec(request), expectedError); - }); - }); - - describe('getSpecContents', () => { - it('invokes getSpecContents without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetSpecContentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetSpecContentsRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.SpecContents() - ); - client.innerApiCalls.getSpecContents = stubSimpleCall(expectedResponse); - const [response] = await client.getSpecContents(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getSpecContents as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getSpecContents as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getSpecContents without error using callback', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetSpecContentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetSpecContentsRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.SpecContents() - ); - client.innerApiCalls.getSpecContents = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getSpecContents( - request, - (err?: Error|null, result?: protos.google.cloud.apihub.v1.ISpecContents|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getSpecContents as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getSpecContents as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getSpecContents with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetSpecContentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetSpecContentsRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getSpecContents = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getSpecContents(request), expectedError); - const actualRequest = (client.innerApiCalls.getSpecContents as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getSpecContents as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getSpecContents with closed client', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetSpecContentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetSpecContentsRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getSpecContents(request), expectedError); - }); - }); - - describe('updateSpec', () => { - it('invokes updateSpec without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.UpdateSpecRequest() - ); - request.spec ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.UpdateSpecRequest', ['spec', 'name']); - request.spec.name = defaultValue1; - const expectedHeaderRequestParams = `spec.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.Spec() - ); - client.innerApiCalls.updateSpec = stubSimpleCall(expectedResponse); - const [response] = await client.updateSpec(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateSpec as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateSpec as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateSpec without error using callback', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.UpdateSpecRequest() - ); - request.spec ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.UpdateSpecRequest', ['spec', 'name']); - request.spec.name = defaultValue1; - const expectedHeaderRequestParams = `spec.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.Spec() - ); - client.innerApiCalls.updateSpec = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateSpec( - request, - (err?: Error|null, result?: protos.google.cloud.apihub.v1.ISpec|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateSpec as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateSpec as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateSpec with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.UpdateSpecRequest() - ); - request.spec ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.UpdateSpecRequest', ['spec', 'name']); - request.spec.name = defaultValue1; - const expectedHeaderRequestParams = `spec.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateSpec = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateSpec(request), expectedError); - const actualRequest = (client.innerApiCalls.updateSpec as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateSpec as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateSpec with closed client', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.UpdateSpecRequest() - ); - request.spec ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.UpdateSpecRequest', ['spec', 'name']); - request.spec.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateSpec(request), expectedError); - }); - }); - - describe('deleteSpec', () => { - it('invokes deleteSpec without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.DeleteSpecRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.DeleteSpecRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteSpec = stubSimpleCall(expectedResponse); - const [response] = await client.deleteSpec(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteSpec as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteSpec as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteSpec without error using callback', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.DeleteSpecRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.DeleteSpecRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteSpec = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteSpec( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteSpec as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteSpec as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteSpec with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.DeleteSpecRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.DeleteSpecRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteSpec = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteSpec(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteSpec as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteSpec as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteSpec with closed client', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.DeleteSpecRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.DeleteSpecRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.deleteSpec(request), expectedError); - }); - }); - - describe('getApiOperation', () => { - it('invokes getApiOperation without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetApiOperationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetApiOperationRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.ApiOperation() - ); - client.innerApiCalls.getApiOperation = stubSimpleCall(expectedResponse); - const [response] = await client.getApiOperation(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getApiOperation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getApiOperation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getApiOperation without error using callback', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetApiOperationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetApiOperationRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.ApiOperation() - ); - client.innerApiCalls.getApiOperation = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getApiOperation( - request, - (err?: Error|null, result?: protos.google.cloud.apihub.v1.IApiOperation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getApiOperation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getApiOperation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getApiOperation with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetApiOperationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetApiOperationRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getApiOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getApiOperation(request), expectedError); - const actualRequest = (client.innerApiCalls.getApiOperation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getApiOperation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getApiOperation with closed client', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetApiOperationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetApiOperationRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getApiOperation(request), expectedError); - }); - }); - - describe('getDefinition', () => { - it('invokes getDefinition without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetDefinitionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetDefinitionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.Definition() - ); - client.innerApiCalls.getDefinition = stubSimpleCall(expectedResponse); - const [response] = await client.getDefinition(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getDefinition as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getDefinition as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getDefinition without error using callback', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetDefinitionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetDefinitionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.Definition() - ); - client.innerApiCalls.getDefinition = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getDefinition( - request, - (err?: Error|null, result?: protos.google.cloud.apihub.v1.IDefinition|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getDefinition as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getDefinition as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getDefinition with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetDefinitionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetDefinitionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getDefinition = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getDefinition(request), expectedError); - const actualRequest = (client.innerApiCalls.getDefinition as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getDefinition as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getDefinition with closed client', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetDefinitionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetDefinitionRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getDefinition(request), expectedError); - }); - }); - - describe('createDeployment', () => { - it('invokes createDeployment without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.CreateDeploymentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.CreateDeploymentRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.Deployment() - ); - client.innerApiCalls.createDeployment = stubSimpleCall(expectedResponse); - const [response] = await client.createDeployment(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createDeployment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createDeployment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createDeployment without error using callback', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.CreateDeploymentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.CreateDeploymentRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.Deployment() - ); - client.innerApiCalls.createDeployment = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createDeployment( - request, - (err?: Error|null, result?: protos.google.cloud.apihub.v1.IDeployment|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createDeployment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createDeployment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createDeployment with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.CreateDeploymentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.CreateDeploymentRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createDeployment = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createDeployment(request), expectedError); - const actualRequest = (client.innerApiCalls.createDeployment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createDeployment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createDeployment with closed client', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.CreateDeploymentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.CreateDeploymentRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createDeployment(request), expectedError); - }); - }); - - describe('getDeployment', () => { - it('invokes getDeployment without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetDeploymentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetDeploymentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.Deployment() - ); - client.innerApiCalls.getDeployment = stubSimpleCall(expectedResponse); - const [response] = await client.getDeployment(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getDeployment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getDeployment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getDeployment without error using callback', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetDeploymentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetDeploymentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.Deployment() - ); - client.innerApiCalls.getDeployment = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getDeployment( - request, - (err?: Error|null, result?: protos.google.cloud.apihub.v1.IDeployment|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getDeployment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getDeployment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getDeployment with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetDeploymentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetDeploymentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getDeployment = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getDeployment(request), expectedError); - const actualRequest = (client.innerApiCalls.getDeployment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getDeployment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getDeployment with closed client', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetDeploymentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetDeploymentRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getDeployment(request), expectedError); - }); - }); - - describe('updateDeployment', () => { - it('invokes updateDeployment without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.UpdateDeploymentRequest() - ); - request.deployment ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.UpdateDeploymentRequest', ['deployment', 'name']); - request.deployment.name = defaultValue1; - const expectedHeaderRequestParams = `deployment.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.Deployment() - ); - client.innerApiCalls.updateDeployment = stubSimpleCall(expectedResponse); - const [response] = await client.updateDeployment(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateDeployment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateDeployment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateDeployment without error using callback', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.UpdateDeploymentRequest() - ); - request.deployment ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.UpdateDeploymentRequest', ['deployment', 'name']); - request.deployment.name = defaultValue1; - const expectedHeaderRequestParams = `deployment.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.Deployment() - ); - client.innerApiCalls.updateDeployment = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateDeployment( - request, - (err?: Error|null, result?: protos.google.cloud.apihub.v1.IDeployment|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateDeployment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateDeployment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateDeployment with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.UpdateDeploymentRequest() - ); - request.deployment ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.UpdateDeploymentRequest', ['deployment', 'name']); - request.deployment.name = defaultValue1; - const expectedHeaderRequestParams = `deployment.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateDeployment = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateDeployment(request), expectedError); - const actualRequest = (client.innerApiCalls.updateDeployment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateDeployment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateDeployment with closed client', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.UpdateDeploymentRequest() - ); - request.deployment ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.UpdateDeploymentRequest', ['deployment', 'name']); - request.deployment.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateDeployment(request), expectedError); - }); - }); - - describe('deleteDeployment', () => { - it('invokes deleteDeployment without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.DeleteDeploymentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.DeleteDeploymentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteDeployment = stubSimpleCall(expectedResponse); - const [response] = await client.deleteDeployment(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteDeployment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteDeployment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteDeployment without error using callback', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.DeleteDeploymentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.DeleteDeploymentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteDeployment = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteDeployment( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteDeployment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteDeployment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteDeployment with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.DeleteDeploymentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.DeleteDeploymentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteDeployment = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteDeployment(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteDeployment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteDeployment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteDeployment with closed client', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.DeleteDeploymentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.DeleteDeploymentRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.deleteDeployment(request), expectedError); - }); - }); - - describe('createAttribute', () => { - it('invokes createAttribute without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.CreateAttributeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.CreateAttributeRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.Attribute() - ); - client.innerApiCalls.createAttribute = stubSimpleCall(expectedResponse); - const [response] = await client.createAttribute(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createAttribute as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createAttribute as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createAttribute without error using callback', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.CreateAttributeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.CreateAttributeRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.Attribute() - ); - client.innerApiCalls.createAttribute = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createAttribute( - request, - (err?: Error|null, result?: protos.google.cloud.apihub.v1.IAttribute|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createAttribute as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createAttribute as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createAttribute with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.CreateAttributeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.CreateAttributeRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createAttribute = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createAttribute(request), expectedError); - const actualRequest = (client.innerApiCalls.createAttribute as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createAttribute as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createAttribute with closed client', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.CreateAttributeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.CreateAttributeRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createAttribute(request), expectedError); - }); - }); - - describe('getAttribute', () => { - it('invokes getAttribute without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetAttributeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetAttributeRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.Attribute() - ); - client.innerApiCalls.getAttribute = stubSimpleCall(expectedResponse); - const [response] = await client.getAttribute(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getAttribute as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getAttribute as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getAttribute without error using callback', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetAttributeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetAttributeRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.Attribute() - ); - client.innerApiCalls.getAttribute = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getAttribute( - request, - (err?: Error|null, result?: protos.google.cloud.apihub.v1.IAttribute|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getAttribute as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getAttribute as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getAttribute with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetAttributeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetAttributeRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getAttribute = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getAttribute(request), expectedError); - const actualRequest = (client.innerApiCalls.getAttribute as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getAttribute as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getAttribute with closed client', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetAttributeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetAttributeRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getAttribute(request), expectedError); - }); - }); - - describe('updateAttribute', () => { - it('invokes updateAttribute without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.UpdateAttributeRequest() - ); - request.attribute ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.UpdateAttributeRequest', ['attribute', 'name']); - request.attribute.name = defaultValue1; - const expectedHeaderRequestParams = `attribute.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.Attribute() - ); - client.innerApiCalls.updateAttribute = stubSimpleCall(expectedResponse); - const [response] = await client.updateAttribute(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateAttribute as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateAttribute as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateAttribute without error using callback', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.UpdateAttributeRequest() - ); - request.attribute ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.UpdateAttributeRequest', ['attribute', 'name']); - request.attribute.name = defaultValue1; - const expectedHeaderRequestParams = `attribute.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.Attribute() - ); - client.innerApiCalls.updateAttribute = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateAttribute( - request, - (err?: Error|null, result?: protos.google.cloud.apihub.v1.IAttribute|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateAttribute as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateAttribute as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateAttribute with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.UpdateAttributeRequest() - ); - request.attribute ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.UpdateAttributeRequest', ['attribute', 'name']); - request.attribute.name = defaultValue1; - const expectedHeaderRequestParams = `attribute.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateAttribute = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateAttribute(request), expectedError); - const actualRequest = (client.innerApiCalls.updateAttribute as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateAttribute as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateAttribute with closed client', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.UpdateAttributeRequest() - ); - request.attribute ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.UpdateAttributeRequest', ['attribute', 'name']); - request.attribute.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateAttribute(request), expectedError); - }); - }); - - describe('deleteAttribute', () => { - it('invokes deleteAttribute without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.DeleteAttributeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.DeleteAttributeRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteAttribute = stubSimpleCall(expectedResponse); - const [response] = await client.deleteAttribute(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteAttribute as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteAttribute as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteAttribute without error using callback', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.DeleteAttributeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.DeleteAttributeRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteAttribute = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteAttribute( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteAttribute as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteAttribute as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteAttribute with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.DeleteAttributeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.DeleteAttributeRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteAttribute = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteAttribute(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteAttribute as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteAttribute as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteAttribute with closed client', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.DeleteAttributeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.DeleteAttributeRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.deleteAttribute(request), expectedError); - }); - }); - - describe('createExternalApi', () => { - it('invokes createExternalApi without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.CreateExternalApiRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.CreateExternalApiRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.ExternalApi() - ); - client.innerApiCalls.createExternalApi = stubSimpleCall(expectedResponse); - const [response] = await client.createExternalApi(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createExternalApi as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createExternalApi as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createExternalApi without error using callback', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.CreateExternalApiRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.CreateExternalApiRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.ExternalApi() - ); - client.innerApiCalls.createExternalApi = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createExternalApi( - request, - (err?: Error|null, result?: protos.google.cloud.apihub.v1.IExternalApi|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createExternalApi as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createExternalApi as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createExternalApi with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.CreateExternalApiRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.CreateExternalApiRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createExternalApi = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createExternalApi(request), expectedError); - const actualRequest = (client.innerApiCalls.createExternalApi as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createExternalApi as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createExternalApi with closed client', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.CreateExternalApiRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.CreateExternalApiRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createExternalApi(request), expectedError); - }); - }); - - describe('getExternalApi', () => { - it('invokes getExternalApi without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetExternalApiRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetExternalApiRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.ExternalApi() - ); - client.innerApiCalls.getExternalApi = stubSimpleCall(expectedResponse); - const [response] = await client.getExternalApi(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getExternalApi as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getExternalApi as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getExternalApi without error using callback', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetExternalApiRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetExternalApiRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.ExternalApi() - ); - client.innerApiCalls.getExternalApi = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getExternalApi( - request, - (err?: Error|null, result?: protos.google.cloud.apihub.v1.IExternalApi|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getExternalApi as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getExternalApi as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getExternalApi with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetExternalApiRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetExternalApiRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getExternalApi = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getExternalApi(request), expectedError); - const actualRequest = (client.innerApiCalls.getExternalApi as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getExternalApi as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getExternalApi with closed client', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetExternalApiRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetExternalApiRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getExternalApi(request), expectedError); - }); - }); - - describe('updateExternalApi', () => { - it('invokes updateExternalApi without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.UpdateExternalApiRequest() - ); - request.externalApi ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.UpdateExternalApiRequest', ['externalApi', 'name']); - request.externalApi.name = defaultValue1; - const expectedHeaderRequestParams = `external_api.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.ExternalApi() - ); - client.innerApiCalls.updateExternalApi = stubSimpleCall(expectedResponse); - const [response] = await client.updateExternalApi(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateExternalApi as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateExternalApi as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateExternalApi without error using callback', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.UpdateExternalApiRequest() - ); - request.externalApi ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.UpdateExternalApiRequest', ['externalApi', 'name']); - request.externalApi.name = defaultValue1; - const expectedHeaderRequestParams = `external_api.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.ExternalApi() - ); - client.innerApiCalls.updateExternalApi = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateExternalApi( - request, - (err?: Error|null, result?: protos.google.cloud.apihub.v1.IExternalApi|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateExternalApi as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateExternalApi as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateExternalApi with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.UpdateExternalApiRequest() - ); - request.externalApi ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.UpdateExternalApiRequest', ['externalApi', 'name']); - request.externalApi.name = defaultValue1; - const expectedHeaderRequestParams = `external_api.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateExternalApi = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateExternalApi(request), expectedError); - const actualRequest = (client.innerApiCalls.updateExternalApi as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateExternalApi as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateExternalApi with closed client', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.UpdateExternalApiRequest() - ); - request.externalApi ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.UpdateExternalApiRequest', ['externalApi', 'name']); - request.externalApi.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateExternalApi(request), expectedError); - }); - }); - - describe('deleteExternalApi', () => { - it('invokes deleteExternalApi without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.DeleteExternalApiRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.DeleteExternalApiRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteExternalApi = stubSimpleCall(expectedResponse); - const [response] = await client.deleteExternalApi(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteExternalApi as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteExternalApi as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteExternalApi without error using callback', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.DeleteExternalApiRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.DeleteExternalApiRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteExternalApi = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteExternalApi( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteExternalApi as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteExternalApi as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteExternalApi with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.DeleteExternalApiRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.DeleteExternalApiRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteExternalApi = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteExternalApi(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteExternalApi as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteExternalApi as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteExternalApi with closed client', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.DeleteExternalApiRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.DeleteExternalApiRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.deleteExternalApi(request), expectedError); - }); - }); - - describe('listApis', () => { - it('invokes listApis without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListApisRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListApisRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apihub.v1.Api()), - generateSampleMessage(new protos.google.cloud.apihub.v1.Api()), - generateSampleMessage(new protos.google.cloud.apihub.v1.Api()), - ]; - client.innerApiCalls.listApis = stubSimpleCall(expectedResponse); - const [response] = await client.listApis(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listApis as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listApis as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listApis without error using callback', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListApisRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListApisRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apihub.v1.Api()), - generateSampleMessage(new protos.google.cloud.apihub.v1.Api()), - generateSampleMessage(new protos.google.cloud.apihub.v1.Api()), - ]; - client.innerApiCalls.listApis = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listApis( - request, - (err?: Error|null, result?: protos.google.cloud.apihub.v1.IApi[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listApis as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listApis as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listApis with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListApisRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListApisRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listApis = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listApis(request), expectedError); - const actualRequest = (client.innerApiCalls.listApis as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listApis as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listApisStream without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListApisRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListApisRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apihub.v1.Api()), - generateSampleMessage(new protos.google.cloud.apihub.v1.Api()), - generateSampleMessage(new protos.google.cloud.apihub.v1.Api()), - ]; - client.descriptors.page.listApis.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listApisStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.apihub.v1.Api[] = []; - stream.on('data', (response: protos.google.cloud.apihub.v1.Api) => { - 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.listApis.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listApis, request)); - assert( - (client.descriptors.page.listApis.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listApisStream with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListApisRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListApisRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listApis.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listApisStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.apihub.v1.Api[] = []; - stream.on('data', (response: protos.google.cloud.apihub.v1.Api) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listApis.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listApis, request)); - assert( - (client.descriptors.page.listApis.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listApis without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListApisRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListApisRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apihub.v1.Api()), - generateSampleMessage(new protos.google.cloud.apihub.v1.Api()), - generateSampleMessage(new protos.google.cloud.apihub.v1.Api()), - ]; - client.descriptors.page.listApis.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.apihub.v1.IApi[] = []; - const iterable = client.listApisAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listApis.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listApis.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listApis with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListApisRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListApisRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listApis.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listApisAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.apihub.v1.IApi[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listApis.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listApis.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listVersions', () => { - it('invokes listVersions without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListVersionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListVersionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apihub.v1.Version()), - generateSampleMessage(new protos.google.cloud.apihub.v1.Version()), - generateSampleMessage(new protos.google.cloud.apihub.v1.Version()), - ]; - client.innerApiCalls.listVersions = stubSimpleCall(expectedResponse); - const [response] = await client.listVersions(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listVersions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listVersions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listVersions without error using callback', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListVersionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListVersionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apihub.v1.Version()), - generateSampleMessage(new protos.google.cloud.apihub.v1.Version()), - generateSampleMessage(new protos.google.cloud.apihub.v1.Version()), - ]; - client.innerApiCalls.listVersions = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listVersions( - request, - (err?: Error|null, result?: protos.google.cloud.apihub.v1.IVersion[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listVersions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listVersions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listVersions with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListVersionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListVersionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listVersions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listVersions(request), expectedError); - const actualRequest = (client.innerApiCalls.listVersions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listVersions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listVersionsStream without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListVersionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListVersionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apihub.v1.Version()), - generateSampleMessage(new protos.google.cloud.apihub.v1.Version()), - generateSampleMessage(new protos.google.cloud.apihub.v1.Version()), - ]; - client.descriptors.page.listVersions.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listVersionsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.apihub.v1.Version[] = []; - stream.on('data', (response: protos.google.cloud.apihub.v1.Version) => { - 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.listVersions.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listVersions, request)); - assert( - (client.descriptors.page.listVersions.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listVersionsStream with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListVersionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListVersionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listVersions.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listVersionsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.apihub.v1.Version[] = []; - stream.on('data', (response: protos.google.cloud.apihub.v1.Version) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listVersions.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listVersions, request)); - assert( - (client.descriptors.page.listVersions.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listVersions without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListVersionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListVersionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apihub.v1.Version()), - generateSampleMessage(new protos.google.cloud.apihub.v1.Version()), - generateSampleMessage(new protos.google.cloud.apihub.v1.Version()), - ]; - client.descriptors.page.listVersions.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.apihub.v1.IVersion[] = []; - const iterable = client.listVersionsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listVersions.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listVersions.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listVersions with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListVersionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListVersionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listVersions.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listVersionsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.apihub.v1.IVersion[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listVersions.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listVersions.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listSpecs', () => { - it('invokes listSpecs without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListSpecsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListSpecsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apihub.v1.Spec()), - generateSampleMessage(new protos.google.cloud.apihub.v1.Spec()), - generateSampleMessage(new protos.google.cloud.apihub.v1.Spec()), - ]; - client.innerApiCalls.listSpecs = stubSimpleCall(expectedResponse); - const [response] = await client.listSpecs(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listSpecs as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listSpecs as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listSpecs without error using callback', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListSpecsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListSpecsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apihub.v1.Spec()), - generateSampleMessage(new protos.google.cloud.apihub.v1.Spec()), - generateSampleMessage(new protos.google.cloud.apihub.v1.Spec()), - ]; - client.innerApiCalls.listSpecs = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listSpecs( - request, - (err?: Error|null, result?: protos.google.cloud.apihub.v1.ISpec[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listSpecs as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listSpecs as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listSpecs with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListSpecsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListSpecsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listSpecs = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listSpecs(request), expectedError); - const actualRequest = (client.innerApiCalls.listSpecs as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listSpecs as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listSpecsStream without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListSpecsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListSpecsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apihub.v1.Spec()), - generateSampleMessage(new protos.google.cloud.apihub.v1.Spec()), - generateSampleMessage(new protos.google.cloud.apihub.v1.Spec()), - ]; - client.descriptors.page.listSpecs.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listSpecsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.apihub.v1.Spec[] = []; - stream.on('data', (response: protos.google.cloud.apihub.v1.Spec) => { - 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.listSpecs.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listSpecs, request)); - assert( - (client.descriptors.page.listSpecs.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listSpecsStream with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListSpecsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListSpecsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listSpecs.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listSpecsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.apihub.v1.Spec[] = []; - stream.on('data', (response: protos.google.cloud.apihub.v1.Spec) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listSpecs.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listSpecs, request)); - assert( - (client.descriptors.page.listSpecs.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listSpecs without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListSpecsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListSpecsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apihub.v1.Spec()), - generateSampleMessage(new protos.google.cloud.apihub.v1.Spec()), - generateSampleMessage(new protos.google.cloud.apihub.v1.Spec()), - ]; - client.descriptors.page.listSpecs.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.apihub.v1.ISpec[] = []; - const iterable = client.listSpecsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listSpecs.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listSpecs.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listSpecs with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListSpecsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListSpecsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listSpecs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listSpecsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.apihub.v1.ISpec[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listSpecs.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listSpecs.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listApiOperations', () => { - it('invokes listApiOperations without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListApiOperationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListApiOperationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apihub.v1.ApiOperation()), - generateSampleMessage(new protos.google.cloud.apihub.v1.ApiOperation()), - generateSampleMessage(new protos.google.cloud.apihub.v1.ApiOperation()), - ]; - client.innerApiCalls.listApiOperations = stubSimpleCall(expectedResponse); - const [response] = await client.listApiOperations(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listApiOperations as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listApiOperations as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listApiOperations without error using callback', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListApiOperationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListApiOperationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apihub.v1.ApiOperation()), - generateSampleMessage(new protos.google.cloud.apihub.v1.ApiOperation()), - generateSampleMessage(new protos.google.cloud.apihub.v1.ApiOperation()), - ]; - client.innerApiCalls.listApiOperations = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listApiOperations( - request, - (err?: Error|null, result?: protos.google.cloud.apihub.v1.IApiOperation[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listApiOperations as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listApiOperations as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listApiOperations with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListApiOperationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListApiOperationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listApiOperations = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listApiOperations(request), expectedError); - const actualRequest = (client.innerApiCalls.listApiOperations as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listApiOperations as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listApiOperationsStream without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListApiOperationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListApiOperationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apihub.v1.ApiOperation()), - generateSampleMessage(new protos.google.cloud.apihub.v1.ApiOperation()), - generateSampleMessage(new protos.google.cloud.apihub.v1.ApiOperation()), - ]; - client.descriptors.page.listApiOperations.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listApiOperationsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.apihub.v1.ApiOperation[] = []; - stream.on('data', (response: protos.google.cloud.apihub.v1.ApiOperation) => { - 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.listApiOperations.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listApiOperations, request)); - assert( - (client.descriptors.page.listApiOperations.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listApiOperationsStream with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListApiOperationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListApiOperationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listApiOperations.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listApiOperationsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.apihub.v1.ApiOperation[] = []; - stream.on('data', (response: protos.google.cloud.apihub.v1.ApiOperation) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listApiOperations.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listApiOperations, request)); - assert( - (client.descriptors.page.listApiOperations.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listApiOperations without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListApiOperationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListApiOperationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apihub.v1.ApiOperation()), - generateSampleMessage(new protos.google.cloud.apihub.v1.ApiOperation()), - generateSampleMessage(new protos.google.cloud.apihub.v1.ApiOperation()), - ]; - client.descriptors.page.listApiOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.apihub.v1.IApiOperation[] = []; - const iterable = client.listApiOperationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listApiOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listApiOperations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listApiOperations with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListApiOperationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListApiOperationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listApiOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listApiOperationsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.apihub.v1.IApiOperation[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listApiOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listApiOperations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listDeployments', () => { - it('invokes listDeployments without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListDeploymentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListDeploymentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apihub.v1.Deployment()), - generateSampleMessage(new protos.google.cloud.apihub.v1.Deployment()), - generateSampleMessage(new protos.google.cloud.apihub.v1.Deployment()), - ]; - client.innerApiCalls.listDeployments = stubSimpleCall(expectedResponse); - const [response] = await client.listDeployments(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listDeployments as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listDeployments as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listDeployments without error using callback', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListDeploymentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListDeploymentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apihub.v1.Deployment()), - generateSampleMessage(new protos.google.cloud.apihub.v1.Deployment()), - generateSampleMessage(new protos.google.cloud.apihub.v1.Deployment()), - ]; - client.innerApiCalls.listDeployments = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listDeployments( - request, - (err?: Error|null, result?: protos.google.cloud.apihub.v1.IDeployment[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listDeployments as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listDeployments as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listDeployments with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListDeploymentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListDeploymentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listDeployments = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listDeployments(request), expectedError); - const actualRequest = (client.innerApiCalls.listDeployments as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listDeployments as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listDeploymentsStream without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListDeploymentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListDeploymentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apihub.v1.Deployment()), - generateSampleMessage(new protos.google.cloud.apihub.v1.Deployment()), - generateSampleMessage(new protos.google.cloud.apihub.v1.Deployment()), - ]; - client.descriptors.page.listDeployments.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listDeploymentsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.apihub.v1.Deployment[] = []; - stream.on('data', (response: protos.google.cloud.apihub.v1.Deployment) => { - 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.listDeployments.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listDeployments, request)); - assert( - (client.descriptors.page.listDeployments.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listDeploymentsStream with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListDeploymentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListDeploymentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listDeployments.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listDeploymentsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.apihub.v1.Deployment[] = []; - stream.on('data', (response: protos.google.cloud.apihub.v1.Deployment) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listDeployments.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listDeployments, request)); - assert( - (client.descriptors.page.listDeployments.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listDeployments without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListDeploymentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListDeploymentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apihub.v1.Deployment()), - generateSampleMessage(new protos.google.cloud.apihub.v1.Deployment()), - generateSampleMessage(new protos.google.cloud.apihub.v1.Deployment()), - ]; - client.descriptors.page.listDeployments.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.apihub.v1.IDeployment[] = []; - const iterable = client.listDeploymentsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listDeployments.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listDeployments.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listDeployments with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListDeploymentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListDeploymentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listDeployments.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listDeploymentsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.apihub.v1.IDeployment[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listDeployments.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listDeployments.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listAttributes', () => { - it('invokes listAttributes without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListAttributesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListAttributesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apihub.v1.Attribute()), - generateSampleMessage(new protos.google.cloud.apihub.v1.Attribute()), - generateSampleMessage(new protos.google.cloud.apihub.v1.Attribute()), - ]; - client.innerApiCalls.listAttributes = stubSimpleCall(expectedResponse); - const [response] = await client.listAttributes(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listAttributes as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listAttributes as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listAttributes without error using callback', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListAttributesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListAttributesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apihub.v1.Attribute()), - generateSampleMessage(new protos.google.cloud.apihub.v1.Attribute()), - generateSampleMessage(new protos.google.cloud.apihub.v1.Attribute()), - ]; - client.innerApiCalls.listAttributes = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listAttributes( - request, - (err?: Error|null, result?: protos.google.cloud.apihub.v1.IAttribute[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listAttributes as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listAttributes as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listAttributes with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListAttributesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListAttributesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listAttributes = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listAttributes(request), expectedError); - const actualRequest = (client.innerApiCalls.listAttributes as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listAttributes as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listAttributesStream without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListAttributesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListAttributesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apihub.v1.Attribute()), - generateSampleMessage(new protos.google.cloud.apihub.v1.Attribute()), - generateSampleMessage(new protos.google.cloud.apihub.v1.Attribute()), - ]; - client.descriptors.page.listAttributes.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listAttributesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.apihub.v1.Attribute[] = []; - stream.on('data', (response: protos.google.cloud.apihub.v1.Attribute) => { - 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.listAttributes.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listAttributes, request)); - assert( - (client.descriptors.page.listAttributes.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listAttributesStream with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListAttributesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListAttributesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listAttributes.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listAttributesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.apihub.v1.Attribute[] = []; - stream.on('data', (response: protos.google.cloud.apihub.v1.Attribute) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listAttributes.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listAttributes, request)); - assert( - (client.descriptors.page.listAttributes.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listAttributes without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListAttributesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListAttributesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apihub.v1.Attribute()), - generateSampleMessage(new protos.google.cloud.apihub.v1.Attribute()), - generateSampleMessage(new protos.google.cloud.apihub.v1.Attribute()), - ]; - client.descriptors.page.listAttributes.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.apihub.v1.IAttribute[] = []; - const iterable = client.listAttributesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listAttributes.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listAttributes.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listAttributes with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListAttributesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListAttributesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listAttributes.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listAttributesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.apihub.v1.IAttribute[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listAttributes.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listAttributes.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('searchResources', () => { - it('invokes searchResources without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.SearchResourcesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.SearchResourcesRequest', ['location']); - request.location = defaultValue1; - const expectedHeaderRequestParams = `location=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apihub.v1.SearchResult()), - generateSampleMessage(new protos.google.cloud.apihub.v1.SearchResult()), - generateSampleMessage(new protos.google.cloud.apihub.v1.SearchResult()), - ]; - client.innerApiCalls.searchResources = stubSimpleCall(expectedResponse); - const [response] = await client.searchResources(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.searchResources as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.searchResources as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes searchResources without error using callback', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.SearchResourcesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.SearchResourcesRequest', ['location']); - request.location = defaultValue1; - const expectedHeaderRequestParams = `location=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apihub.v1.SearchResult()), - generateSampleMessage(new protos.google.cloud.apihub.v1.SearchResult()), - generateSampleMessage(new protos.google.cloud.apihub.v1.SearchResult()), - ]; - client.innerApiCalls.searchResources = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.searchResources( - request, - (err?: Error|null, result?: protos.google.cloud.apihub.v1.ISearchResult[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.searchResources as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.searchResources as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes searchResources with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.SearchResourcesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.SearchResourcesRequest', ['location']); - request.location = defaultValue1; - const expectedHeaderRequestParams = `location=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.searchResources = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.searchResources(request), expectedError); - const actualRequest = (client.innerApiCalls.searchResources as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.searchResources as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes searchResourcesStream without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.SearchResourcesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.SearchResourcesRequest', ['location']); - request.location = defaultValue1; - const expectedHeaderRequestParams = `location=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apihub.v1.SearchResult()), - generateSampleMessage(new protos.google.cloud.apihub.v1.SearchResult()), - generateSampleMessage(new protos.google.cloud.apihub.v1.SearchResult()), - ]; - client.descriptors.page.searchResources.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.searchResourcesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.apihub.v1.SearchResult[] = []; - stream.on('data', (response: protos.google.cloud.apihub.v1.SearchResult) => { - 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.searchResources.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.searchResources, request)); - assert( - (client.descriptors.page.searchResources.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes searchResourcesStream with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.SearchResourcesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.SearchResourcesRequest', ['location']); - request.location = defaultValue1; - const expectedHeaderRequestParams = `location=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.searchResources.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.searchResourcesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.apihub.v1.SearchResult[] = []; - stream.on('data', (response: protos.google.cloud.apihub.v1.SearchResult) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.searchResources.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.searchResources, request)); - assert( - (client.descriptors.page.searchResources.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with searchResources without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.SearchResourcesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.SearchResourcesRequest', ['location']); - request.location = defaultValue1; - const expectedHeaderRequestParams = `location=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apihub.v1.SearchResult()), - generateSampleMessage(new protos.google.cloud.apihub.v1.SearchResult()), - generateSampleMessage(new protos.google.cloud.apihub.v1.SearchResult()), - ]; - client.descriptors.page.searchResources.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.apihub.v1.ISearchResult[] = []; - const iterable = client.searchResourcesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.searchResources.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.searchResources.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with searchResources with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.SearchResourcesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.SearchResourcesRequest', ['location']); - request.location = defaultValue1; - const expectedHeaderRequestParams = `location=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.searchResources.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.searchResourcesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.apihub.v1.ISearchResult[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.searchResources.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.searchResources.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listExternalApis', () => { - it('invokes listExternalApis without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListExternalApisRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListExternalApisRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apihub.v1.ExternalApi()), - generateSampleMessage(new protos.google.cloud.apihub.v1.ExternalApi()), - generateSampleMessage(new protos.google.cloud.apihub.v1.ExternalApi()), - ]; - client.innerApiCalls.listExternalApis = stubSimpleCall(expectedResponse); - const [response] = await client.listExternalApis(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listExternalApis as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listExternalApis as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listExternalApis without error using callback', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListExternalApisRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListExternalApisRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apihub.v1.ExternalApi()), - generateSampleMessage(new protos.google.cloud.apihub.v1.ExternalApi()), - generateSampleMessage(new protos.google.cloud.apihub.v1.ExternalApi()), - ]; - client.innerApiCalls.listExternalApis = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listExternalApis( - request, - (err?: Error|null, result?: protos.google.cloud.apihub.v1.IExternalApi[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listExternalApis as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listExternalApis as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listExternalApis with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListExternalApisRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListExternalApisRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listExternalApis = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listExternalApis(request), expectedError); - const actualRequest = (client.innerApiCalls.listExternalApis as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listExternalApis as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listExternalApisStream without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListExternalApisRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListExternalApisRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apihub.v1.ExternalApi()), - generateSampleMessage(new protos.google.cloud.apihub.v1.ExternalApi()), - generateSampleMessage(new protos.google.cloud.apihub.v1.ExternalApi()), - ]; - client.descriptors.page.listExternalApis.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listExternalApisStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.apihub.v1.ExternalApi[] = []; - stream.on('data', (response: protos.google.cloud.apihub.v1.ExternalApi) => { - 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.listExternalApis.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listExternalApis, request)); - assert( - (client.descriptors.page.listExternalApis.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listExternalApisStream with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListExternalApisRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListExternalApisRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listExternalApis.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listExternalApisStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.apihub.v1.ExternalApi[] = []; - stream.on('data', (response: protos.google.cloud.apihub.v1.ExternalApi) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listExternalApis.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listExternalApis, request)); - assert( - (client.descriptors.page.listExternalApis.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listExternalApis without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListExternalApisRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListExternalApisRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apihub.v1.ExternalApi()), - generateSampleMessage(new protos.google.cloud.apihub.v1.ExternalApi()), - generateSampleMessage(new protos.google.cloud.apihub.v1.ExternalApi()), - ]; - client.descriptors.page.listExternalApis.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.apihub.v1.IExternalApi[] = []; - const iterable = client.listExternalApisAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listExternalApis.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listExternalApis.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listExternalApis with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListExternalApisRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListExternalApisRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listExternalApis.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listExternalApisAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.apihub.v1.IExternalApi[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listExternalApis.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listExternalApis.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getLocation', () => { - it('invokes getLocation without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - 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 apihubModule.v1.ApiHubClient({ - 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 apihubModule.v1.ApiHubClient({ - 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 apihubModule.v1.ApiHubClient({ - 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 apihubModule.v1.ApiHubClient({ - 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('Path templates', () => { - - describe('api', () => { - const fakePath = "/rendered/path/api"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - api: "apiValue", - }; - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.apiPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.apiPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('apiPath', () => { - const result = client.apiPath("projectValue", "locationValue", "apiValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.apiPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromApiName', () => { - const result = client.matchProjectFromApiName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.apiPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromApiName', () => { - const result = client.matchLocationFromApiName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.apiPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchApiFromApiName', () => { - const result = client.matchApiFromApiName(fakePath); - assert.strictEqual(result, "apiValue"); - assert((client.pathTemplates.apiPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('apiHubInstance', () => { - const fakePath = "/rendered/path/apiHubInstance"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - api_hub_instance: "apiHubInstanceValue", - }; - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.apiHubInstancePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.apiHubInstancePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('apiHubInstancePath', () => { - const result = client.apiHubInstancePath("projectValue", "locationValue", "apiHubInstanceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.apiHubInstancePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromApiHubInstanceName', () => { - const result = client.matchProjectFromApiHubInstanceName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromApiHubInstanceName', () => { - const result = client.matchLocationFromApiHubInstanceName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchApiHubInstanceFromApiHubInstanceName', () => { - const result = client.matchApiHubInstanceFromApiHubInstanceName(fakePath); - assert.strictEqual(result, "apiHubInstanceValue"); - assert((client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('apiOperation', () => { - const fakePath = "/rendered/path/apiOperation"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - api: "apiValue", - version: "versionValue", - operation: "operationValue", - }; - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.apiOperationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.apiOperationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('apiOperationPath', () => { - const result = client.apiOperationPath("projectValue", "locationValue", "apiValue", "versionValue", "operationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.apiOperationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromApiOperationName', () => { - const result = client.matchProjectFromApiOperationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromApiOperationName', () => { - const result = client.matchLocationFromApiOperationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchApiFromApiOperationName', () => { - const result = client.matchApiFromApiOperationName(fakePath); - assert.strictEqual(result, "apiValue"); - assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchVersionFromApiOperationName', () => { - const result = client.matchVersionFromApiOperationName(fakePath); - assert.strictEqual(result, "versionValue"); - assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchOperationFromApiOperationName', () => { - const result = client.matchOperationFromApiOperationName(fakePath); - assert.strictEqual(result, "operationValue"); - assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('attribute', () => { - const fakePath = "/rendered/path/attribute"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - attribute: "attributeValue", - }; - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.attributePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.attributePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('attributePath', () => { - const result = client.attributePath("projectValue", "locationValue", "attributeValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.attributePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromAttributeName', () => { - const result = client.matchProjectFromAttributeName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.attributePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromAttributeName', () => { - const result = client.matchLocationFromAttributeName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.attributePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAttributeFromAttributeName', () => { - const result = client.matchAttributeFromAttributeName(fakePath); - assert.strictEqual(result, "attributeValue"); - assert((client.pathTemplates.attributePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('definition', () => { - const fakePath = "/rendered/path/definition"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - api: "apiValue", - version: "versionValue", - definition: "definitionValue", - }; - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.definitionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.definitionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('definitionPath', () => { - const result = client.definitionPath("projectValue", "locationValue", "apiValue", "versionValue", "definitionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.definitionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDefinitionName', () => { - const result = client.matchProjectFromDefinitionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDefinitionName', () => { - const result = client.matchLocationFromDefinitionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchApiFromDefinitionName', () => { - const result = client.matchApiFromDefinitionName(fakePath); - assert.strictEqual(result, "apiValue"); - assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchVersionFromDefinitionName', () => { - const result = client.matchVersionFromDefinitionName(fakePath); - assert.strictEqual(result, "versionValue"); - assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDefinitionFromDefinitionName', () => { - const result = client.matchDefinitionFromDefinitionName(fakePath); - assert.strictEqual(result, "definitionValue"); - assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dependency', () => { - const fakePath = "/rendered/path/dependency"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dependency: "dependencyValue", - }; - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.dependencyPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.dependencyPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('dependencyPath', () => { - const result = client.dependencyPath("projectValue", "locationValue", "dependencyValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.dependencyPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDependencyName', () => { - const result = client.matchProjectFromDependencyName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.dependencyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDependencyName', () => { - const result = client.matchLocationFromDependencyName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.dependencyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDependencyFromDependencyName', () => { - const result = client.matchDependencyFromDependencyName(fakePath); - assert.strictEqual(result, "dependencyValue"); - assert((client.pathTemplates.dependencyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('deployment', () => { - const fakePath = "/rendered/path/deployment"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - deployment: "deploymentValue", - }; - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.deploymentPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.deploymentPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('deploymentPath', () => { - const result = client.deploymentPath("projectValue", "locationValue", "deploymentValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.deploymentPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDeploymentName', () => { - const result = client.matchProjectFromDeploymentName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDeploymentName', () => { - const result = client.matchLocationFromDeploymentName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDeploymentFromDeploymentName', () => { - const result = client.matchDeploymentFromDeploymentName(fakePath); - assert.strictEqual(result, "deploymentValue"); - assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('externalApi', () => { - const fakePath = "/rendered/path/externalApi"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - external_api: "externalApiValue", - }; - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.externalApiPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.externalApiPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('externalApiPath', () => { - const result = client.externalApiPath("projectValue", "locationValue", "externalApiValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.externalApiPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromExternalApiName', () => { - const result = client.matchProjectFromExternalApiName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.externalApiPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromExternalApiName', () => { - const result = client.matchLocationFromExternalApiName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.externalApiPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExternalApiFromExternalApiName', () => { - const result = client.matchExternalApiFromExternalApiName(fakePath); - assert.strictEqual(result, "externalApiValue"); - assert((client.pathTemplates.externalApiPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('hostProjectRegistration', () => { - const fakePath = "/rendered/path/hostProjectRegistration"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - host_project_registration: "hostProjectRegistrationValue", - }; - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.hostProjectRegistrationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.hostProjectRegistrationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('hostProjectRegistrationPath', () => { - const result = client.hostProjectRegistrationPath("projectValue", "locationValue", "hostProjectRegistrationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.hostProjectRegistrationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromHostProjectRegistrationName', () => { - const result = client.matchProjectFromHostProjectRegistrationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.hostProjectRegistrationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromHostProjectRegistrationName', () => { - const result = client.matchLocationFromHostProjectRegistrationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.hostProjectRegistrationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchHostProjectRegistrationFromHostProjectRegistrationName', () => { - const result = client.matchHostProjectRegistrationFromHostProjectRegistrationName(fakePath); - assert.strictEqual(result, "hostProjectRegistrationValue"); - assert((client.pathTemplates.hostProjectRegistrationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('location', () => { - const fakePath = "/rendered/path/location"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - }; - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.locationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.locationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('locationPath', () => { - const result = client.locationPath("projectValue", "locationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.locationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromLocationName', () => { - const result = client.matchProjectFromLocationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromLocationName', () => { - const result = client.matchLocationFromLocationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('plugin', () => { - const fakePath = "/rendered/path/plugin"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - plugin: "pluginValue", - }; - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.pluginPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.pluginPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('pluginPath', () => { - const result = client.pluginPath("projectValue", "locationValue", "pluginValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.pluginPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromPluginName', () => { - const result = client.matchProjectFromPluginName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.pluginPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromPluginName', () => { - const result = client.matchLocationFromPluginName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.pluginPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchPluginFromPluginName', () => { - const result = client.matchPluginFromPluginName(fakePath); - assert.strictEqual(result, "pluginValue"); - assert((client.pathTemplates.pluginPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('project', () => { - const fakePath = "/rendered/path/project"; - const expectedParameters = { - project: "projectValue", - }; - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.projectPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectPath', () => { - const result = client.projectPath("projectValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectName', () => { - const result = client.matchProjectFromProjectName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('runtimeProjectAttachment', () => { - const fakePath = "/rendered/path/runtimeProjectAttachment"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - runtime_project_attachment: "runtimeProjectAttachmentValue", - }; - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.runtimeProjectAttachmentPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.runtimeProjectAttachmentPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('runtimeProjectAttachmentPath', () => { - const result = client.runtimeProjectAttachmentPath("projectValue", "locationValue", "runtimeProjectAttachmentValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromRuntimeProjectAttachmentName', () => { - const result = client.matchProjectFromRuntimeProjectAttachmentName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromRuntimeProjectAttachmentName', () => { - const result = client.matchLocationFromRuntimeProjectAttachmentName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName', () => { - const result = client.matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName(fakePath); - assert.strictEqual(result, "runtimeProjectAttachmentValue"); - assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('spec', () => { - const fakePath = "/rendered/path/spec"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - api: "apiValue", - version: "versionValue", - spec: "specValue", - }; - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.specPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.specPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('specPath', () => { - const result = client.specPath("projectValue", "locationValue", "apiValue", "versionValue", "specValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.specPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSpecName', () => { - const result = client.matchProjectFromSpecName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.specPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSpecName', () => { - const result = client.matchLocationFromSpecName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.specPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchApiFromSpecName', () => { - const result = client.matchApiFromSpecName(fakePath); - assert.strictEqual(result, "apiValue"); - assert((client.pathTemplates.specPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchVersionFromSpecName', () => { - const result = client.matchVersionFromSpecName(fakePath); - assert.strictEqual(result, "versionValue"); - assert((client.pathTemplates.specPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSpecFromSpecName', () => { - const result = client.matchSpecFromSpecName(fakePath); - assert.strictEqual(result, "specValue"); - assert((client.pathTemplates.specPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('styleGuide', () => { - const fakePath = "/rendered/path/styleGuide"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - plugin: "pluginValue", - }; - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.styleGuidePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.styleGuidePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('styleGuidePath', () => { - const result = client.styleGuidePath("projectValue", "locationValue", "pluginValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.styleGuidePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromStyleGuideName', () => { - const result = client.matchProjectFromStyleGuideName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.styleGuidePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromStyleGuideName', () => { - const result = client.matchLocationFromStyleGuideName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.styleGuidePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchPluginFromStyleGuideName', () => { - const result = client.matchPluginFromStyleGuideName(fakePath); - assert.strictEqual(result, "pluginValue"); - assert((client.pathTemplates.styleGuidePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('version', () => { - const fakePath = "/rendered/path/version"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - api: "apiValue", - version: "versionValue", - }; - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.versionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.versionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('versionPath', () => { - const result = client.versionPath("projectValue", "locationValue", "apiValue", "versionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.versionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromVersionName', () => { - const result = client.matchProjectFromVersionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.versionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromVersionName', () => { - const result = client.matchLocationFromVersionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.versionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchApiFromVersionName', () => { - const result = client.matchApiFromVersionName(fakePath); - assert.strictEqual(result, "apiValue"); - assert((client.pathTemplates.versionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchVersionFromVersionName', () => { - const result = client.matchVersionFromVersionName(fakePath); - assert.strictEqual(result, "versionValue"); - assert((client.pathTemplates.versionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/google-cloud-apihub/v1/test/gapic_host_project_registration_service_v1.ts b/owl-bot-staging/google-cloud-apihub/v1/test/gapic_host_project_registration_service_v1.ts deleted file mode 100644 index e0a3281285e..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/test/gapic_host_project_registration_service_v1.ts +++ /dev/null @@ -1,1659 +0,0 @@ -// Copyright 2024 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 hostprojectregistrationserviceModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf, 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 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.HostProjectRegistrationServiceClient', () => { - describe('Common methods', () => { - it('has apiEndpoint', () => { - const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient(); - const apiEndpoint = client.apiEndpoint; - assert.strictEqual(apiEndpoint, 'apihub.googleapis.com'); - }); - - it('has universeDomain', () => { - const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient(); - const universeDomain = client.universeDomain; - assert.strictEqual(universeDomain, "googleapis.com"); - }); - - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - it('throws DeprecationWarning if static servicePath is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const servicePath = hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient.servicePath; - assert.strictEqual(servicePath, 'apihub.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - - it('throws DeprecationWarning if static apiEndpoint is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const apiEndpoint = hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient.apiEndpoint; - assert.strictEqual(apiEndpoint, 'apihub.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - } - it('sets apiEndpoint according to universe domain camelCase', () => { - const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({universeDomain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'apihub.example.com'); - }); - - it('sets apiEndpoint according to universe domain snakeCase', () => { - const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({universe_domain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'apihub.example.com'); - }); - - if (typeof process === 'object' && 'env' in process) { - describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { - it('sets apiEndpoint from environment variable', () => { - const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; - const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient(); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'apihub.example.com'); - if (saved) { - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; - } else { - delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - } - }); - - it('value configured in code has priority over environment variable', () => { - const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; - const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({universeDomain: 'configured.example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'apihub.configured.example.com'); - if (saved) { - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; - } else { - delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - } - }); - }); - } - it('does not allow setting both universeDomain and universe_domain', () => { - assert.throws(() => { new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); - }); - - it('has port', () => { - const port = hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.hostProjectRegistrationServiceStub, undefined); - await client.initialize(); - assert(client.hostProjectRegistrationServiceStub); - }); - - it('has close method for the initialized client', done => { - const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - assert(client.hostProjectRegistrationServiceStub); - client.close().then(() => { - done(); - }); - }); - - it('has close method for the non-initialized client', done => { - const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.hostProjectRegistrationServiceStub, undefined); - client.close().then(() => { - done(); - }); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ - 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 hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ - 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('createHostProjectRegistration', () => { - it('invokes createHostProjectRegistration without error', async () => { - const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.CreateHostProjectRegistrationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.CreateHostProjectRegistrationRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.HostProjectRegistration() - ); - client.innerApiCalls.createHostProjectRegistration = stubSimpleCall(expectedResponse); - const [response] = await client.createHostProjectRegistration(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createHostProjectRegistration as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createHostProjectRegistration as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createHostProjectRegistration without error using callback', async () => { - const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.CreateHostProjectRegistrationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.CreateHostProjectRegistrationRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.HostProjectRegistration() - ); - client.innerApiCalls.createHostProjectRegistration = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createHostProjectRegistration( - request, - (err?: Error|null, result?: protos.google.cloud.apihub.v1.IHostProjectRegistration|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createHostProjectRegistration as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createHostProjectRegistration as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createHostProjectRegistration with error', async () => { - const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.CreateHostProjectRegistrationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.CreateHostProjectRegistrationRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createHostProjectRegistration = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createHostProjectRegistration(request), expectedError); - const actualRequest = (client.innerApiCalls.createHostProjectRegistration as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createHostProjectRegistration as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createHostProjectRegistration with closed client', async () => { - const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.CreateHostProjectRegistrationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.CreateHostProjectRegistrationRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createHostProjectRegistration(request), expectedError); - }); - }); - - describe('getHostProjectRegistration', () => { - it('invokes getHostProjectRegistration without error', async () => { - const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetHostProjectRegistrationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetHostProjectRegistrationRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.HostProjectRegistration() - ); - client.innerApiCalls.getHostProjectRegistration = stubSimpleCall(expectedResponse); - const [response] = await client.getHostProjectRegistration(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getHostProjectRegistration as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getHostProjectRegistration as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getHostProjectRegistration without error using callback', async () => { - const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetHostProjectRegistrationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetHostProjectRegistrationRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.HostProjectRegistration() - ); - client.innerApiCalls.getHostProjectRegistration = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getHostProjectRegistration( - request, - (err?: Error|null, result?: protos.google.cloud.apihub.v1.IHostProjectRegistration|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getHostProjectRegistration as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getHostProjectRegistration as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getHostProjectRegistration with error', async () => { - const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetHostProjectRegistrationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetHostProjectRegistrationRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getHostProjectRegistration = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getHostProjectRegistration(request), expectedError); - const actualRequest = (client.innerApiCalls.getHostProjectRegistration as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getHostProjectRegistration as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getHostProjectRegistration with closed client', async () => { - const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetHostProjectRegistrationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetHostProjectRegistrationRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getHostProjectRegistration(request), expectedError); - }); - }); - - describe('listHostProjectRegistrations', () => { - it('invokes listHostProjectRegistrations without error', async () => { - const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apihub.v1.HostProjectRegistration()), - generateSampleMessage(new protos.google.cloud.apihub.v1.HostProjectRegistration()), - generateSampleMessage(new protos.google.cloud.apihub.v1.HostProjectRegistration()), - ]; - client.innerApiCalls.listHostProjectRegistrations = stubSimpleCall(expectedResponse); - const [response] = await client.listHostProjectRegistrations(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listHostProjectRegistrations as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listHostProjectRegistrations as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listHostProjectRegistrations without error using callback', async () => { - const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apihub.v1.HostProjectRegistration()), - generateSampleMessage(new protos.google.cloud.apihub.v1.HostProjectRegistration()), - generateSampleMessage(new protos.google.cloud.apihub.v1.HostProjectRegistration()), - ]; - client.innerApiCalls.listHostProjectRegistrations = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listHostProjectRegistrations( - request, - (err?: Error|null, result?: protos.google.cloud.apihub.v1.IHostProjectRegistration[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listHostProjectRegistrations as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listHostProjectRegistrations as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listHostProjectRegistrations with error', async () => { - const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listHostProjectRegistrations = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listHostProjectRegistrations(request), expectedError); - const actualRequest = (client.innerApiCalls.listHostProjectRegistrations as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listHostProjectRegistrations as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listHostProjectRegistrationsStream without error', async () => { - const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apihub.v1.HostProjectRegistration()), - generateSampleMessage(new protos.google.cloud.apihub.v1.HostProjectRegistration()), - generateSampleMessage(new protos.google.cloud.apihub.v1.HostProjectRegistration()), - ]; - client.descriptors.page.listHostProjectRegistrations.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listHostProjectRegistrationsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.apihub.v1.HostProjectRegistration[] = []; - stream.on('data', (response: protos.google.cloud.apihub.v1.HostProjectRegistration) => { - 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.listHostProjectRegistrations.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listHostProjectRegistrations, request)); - assert( - (client.descriptors.page.listHostProjectRegistrations.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listHostProjectRegistrationsStream with error', async () => { - const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listHostProjectRegistrations.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listHostProjectRegistrationsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.apihub.v1.HostProjectRegistration[] = []; - stream.on('data', (response: protos.google.cloud.apihub.v1.HostProjectRegistration) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listHostProjectRegistrations.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listHostProjectRegistrations, request)); - assert( - (client.descriptors.page.listHostProjectRegistrations.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listHostProjectRegistrations without error', async () => { - const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apihub.v1.HostProjectRegistration()), - generateSampleMessage(new protos.google.cloud.apihub.v1.HostProjectRegistration()), - generateSampleMessage(new protos.google.cloud.apihub.v1.HostProjectRegistration()), - ]; - client.descriptors.page.listHostProjectRegistrations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.apihub.v1.IHostProjectRegistration[] = []; - const iterable = client.listHostProjectRegistrationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listHostProjectRegistrations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listHostProjectRegistrations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listHostProjectRegistrations with error', async () => { - const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listHostProjectRegistrations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listHostProjectRegistrationsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.apihub.v1.IHostProjectRegistration[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listHostProjectRegistrations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listHostProjectRegistrations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getLocation', () => { - it('invokes getLocation without error', async () => { - const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ - 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 hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ - 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 hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ - 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 hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ - 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 hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ - 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('Path templates', () => { - - describe('api', () => { - const fakePath = "/rendered/path/api"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - api: "apiValue", - }; - const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.apiPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.apiPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('apiPath', () => { - const result = client.apiPath("projectValue", "locationValue", "apiValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.apiPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromApiName', () => { - const result = client.matchProjectFromApiName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.apiPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromApiName', () => { - const result = client.matchLocationFromApiName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.apiPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchApiFromApiName', () => { - const result = client.matchApiFromApiName(fakePath); - assert.strictEqual(result, "apiValue"); - assert((client.pathTemplates.apiPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('apiHubInstance', () => { - const fakePath = "/rendered/path/apiHubInstance"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - api_hub_instance: "apiHubInstanceValue", - }; - const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.apiHubInstancePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.apiHubInstancePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('apiHubInstancePath', () => { - const result = client.apiHubInstancePath("projectValue", "locationValue", "apiHubInstanceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.apiHubInstancePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromApiHubInstanceName', () => { - const result = client.matchProjectFromApiHubInstanceName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromApiHubInstanceName', () => { - const result = client.matchLocationFromApiHubInstanceName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchApiHubInstanceFromApiHubInstanceName', () => { - const result = client.matchApiHubInstanceFromApiHubInstanceName(fakePath); - assert.strictEqual(result, "apiHubInstanceValue"); - assert((client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('apiOperation', () => { - const fakePath = "/rendered/path/apiOperation"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - api: "apiValue", - version: "versionValue", - operation: "operationValue", - }; - const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.apiOperationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.apiOperationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('apiOperationPath', () => { - const result = client.apiOperationPath("projectValue", "locationValue", "apiValue", "versionValue", "operationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.apiOperationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromApiOperationName', () => { - const result = client.matchProjectFromApiOperationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromApiOperationName', () => { - const result = client.matchLocationFromApiOperationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchApiFromApiOperationName', () => { - const result = client.matchApiFromApiOperationName(fakePath); - assert.strictEqual(result, "apiValue"); - assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchVersionFromApiOperationName', () => { - const result = client.matchVersionFromApiOperationName(fakePath); - assert.strictEqual(result, "versionValue"); - assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchOperationFromApiOperationName', () => { - const result = client.matchOperationFromApiOperationName(fakePath); - assert.strictEqual(result, "operationValue"); - assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('attribute', () => { - const fakePath = "/rendered/path/attribute"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - attribute: "attributeValue", - }; - const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.attributePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.attributePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('attributePath', () => { - const result = client.attributePath("projectValue", "locationValue", "attributeValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.attributePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromAttributeName', () => { - const result = client.matchProjectFromAttributeName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.attributePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromAttributeName', () => { - const result = client.matchLocationFromAttributeName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.attributePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAttributeFromAttributeName', () => { - const result = client.matchAttributeFromAttributeName(fakePath); - assert.strictEqual(result, "attributeValue"); - assert((client.pathTemplates.attributePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('definition', () => { - const fakePath = "/rendered/path/definition"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - api: "apiValue", - version: "versionValue", - definition: "definitionValue", - }; - const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.definitionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.definitionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('definitionPath', () => { - const result = client.definitionPath("projectValue", "locationValue", "apiValue", "versionValue", "definitionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.definitionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDefinitionName', () => { - const result = client.matchProjectFromDefinitionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDefinitionName', () => { - const result = client.matchLocationFromDefinitionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchApiFromDefinitionName', () => { - const result = client.matchApiFromDefinitionName(fakePath); - assert.strictEqual(result, "apiValue"); - assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchVersionFromDefinitionName', () => { - const result = client.matchVersionFromDefinitionName(fakePath); - assert.strictEqual(result, "versionValue"); - assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDefinitionFromDefinitionName', () => { - const result = client.matchDefinitionFromDefinitionName(fakePath); - assert.strictEqual(result, "definitionValue"); - assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dependency', () => { - const fakePath = "/rendered/path/dependency"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dependency: "dependencyValue", - }; - const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.dependencyPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.dependencyPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('dependencyPath', () => { - const result = client.dependencyPath("projectValue", "locationValue", "dependencyValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.dependencyPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDependencyName', () => { - const result = client.matchProjectFromDependencyName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.dependencyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDependencyName', () => { - const result = client.matchLocationFromDependencyName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.dependencyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDependencyFromDependencyName', () => { - const result = client.matchDependencyFromDependencyName(fakePath); - assert.strictEqual(result, "dependencyValue"); - assert((client.pathTemplates.dependencyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('deployment', () => { - const fakePath = "/rendered/path/deployment"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - deployment: "deploymentValue", - }; - const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.deploymentPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.deploymentPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('deploymentPath', () => { - const result = client.deploymentPath("projectValue", "locationValue", "deploymentValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.deploymentPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDeploymentName', () => { - const result = client.matchProjectFromDeploymentName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDeploymentName', () => { - const result = client.matchLocationFromDeploymentName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDeploymentFromDeploymentName', () => { - const result = client.matchDeploymentFromDeploymentName(fakePath); - assert.strictEqual(result, "deploymentValue"); - assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('externalApi', () => { - const fakePath = "/rendered/path/externalApi"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - external_api: "externalApiValue", - }; - const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.externalApiPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.externalApiPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('externalApiPath', () => { - const result = client.externalApiPath("projectValue", "locationValue", "externalApiValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.externalApiPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromExternalApiName', () => { - const result = client.matchProjectFromExternalApiName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.externalApiPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromExternalApiName', () => { - const result = client.matchLocationFromExternalApiName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.externalApiPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExternalApiFromExternalApiName', () => { - const result = client.matchExternalApiFromExternalApiName(fakePath); - assert.strictEqual(result, "externalApiValue"); - assert((client.pathTemplates.externalApiPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('hostProjectRegistration', () => { - const fakePath = "/rendered/path/hostProjectRegistration"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - host_project_registration: "hostProjectRegistrationValue", - }; - const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.hostProjectRegistrationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.hostProjectRegistrationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('hostProjectRegistrationPath', () => { - const result = client.hostProjectRegistrationPath("projectValue", "locationValue", "hostProjectRegistrationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.hostProjectRegistrationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromHostProjectRegistrationName', () => { - const result = client.matchProjectFromHostProjectRegistrationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.hostProjectRegistrationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromHostProjectRegistrationName', () => { - const result = client.matchLocationFromHostProjectRegistrationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.hostProjectRegistrationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchHostProjectRegistrationFromHostProjectRegistrationName', () => { - const result = client.matchHostProjectRegistrationFromHostProjectRegistrationName(fakePath); - assert.strictEqual(result, "hostProjectRegistrationValue"); - assert((client.pathTemplates.hostProjectRegistrationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('location', () => { - const fakePath = "/rendered/path/location"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - }; - const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.locationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.locationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('locationPath', () => { - const result = client.locationPath("projectValue", "locationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.locationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromLocationName', () => { - const result = client.matchProjectFromLocationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromLocationName', () => { - const result = client.matchLocationFromLocationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('plugin', () => { - const fakePath = "/rendered/path/plugin"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - plugin: "pluginValue", - }; - const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.pluginPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.pluginPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('pluginPath', () => { - const result = client.pluginPath("projectValue", "locationValue", "pluginValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.pluginPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromPluginName', () => { - const result = client.matchProjectFromPluginName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.pluginPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromPluginName', () => { - const result = client.matchLocationFromPluginName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.pluginPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchPluginFromPluginName', () => { - const result = client.matchPluginFromPluginName(fakePath); - assert.strictEqual(result, "pluginValue"); - assert((client.pathTemplates.pluginPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('project', () => { - const fakePath = "/rendered/path/project"; - const expectedParameters = { - project: "projectValue", - }; - const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.projectPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectPath', () => { - const result = client.projectPath("projectValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectName', () => { - const result = client.matchProjectFromProjectName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('runtimeProjectAttachment', () => { - const fakePath = "/rendered/path/runtimeProjectAttachment"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - runtime_project_attachment: "runtimeProjectAttachmentValue", - }; - const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.runtimeProjectAttachmentPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.runtimeProjectAttachmentPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('runtimeProjectAttachmentPath', () => { - const result = client.runtimeProjectAttachmentPath("projectValue", "locationValue", "runtimeProjectAttachmentValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromRuntimeProjectAttachmentName', () => { - const result = client.matchProjectFromRuntimeProjectAttachmentName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromRuntimeProjectAttachmentName', () => { - const result = client.matchLocationFromRuntimeProjectAttachmentName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName', () => { - const result = client.matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName(fakePath); - assert.strictEqual(result, "runtimeProjectAttachmentValue"); - assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('spec', () => { - const fakePath = "/rendered/path/spec"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - api: "apiValue", - version: "versionValue", - spec: "specValue", - }; - const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.specPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.specPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('specPath', () => { - const result = client.specPath("projectValue", "locationValue", "apiValue", "versionValue", "specValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.specPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSpecName', () => { - const result = client.matchProjectFromSpecName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.specPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSpecName', () => { - const result = client.matchLocationFromSpecName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.specPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchApiFromSpecName', () => { - const result = client.matchApiFromSpecName(fakePath); - assert.strictEqual(result, "apiValue"); - assert((client.pathTemplates.specPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchVersionFromSpecName', () => { - const result = client.matchVersionFromSpecName(fakePath); - assert.strictEqual(result, "versionValue"); - assert((client.pathTemplates.specPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSpecFromSpecName', () => { - const result = client.matchSpecFromSpecName(fakePath); - assert.strictEqual(result, "specValue"); - assert((client.pathTemplates.specPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('styleGuide', () => { - const fakePath = "/rendered/path/styleGuide"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - plugin: "pluginValue", - }; - const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.styleGuidePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.styleGuidePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('styleGuidePath', () => { - const result = client.styleGuidePath("projectValue", "locationValue", "pluginValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.styleGuidePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromStyleGuideName', () => { - const result = client.matchProjectFromStyleGuideName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.styleGuidePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromStyleGuideName', () => { - const result = client.matchLocationFromStyleGuideName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.styleGuidePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchPluginFromStyleGuideName', () => { - const result = client.matchPluginFromStyleGuideName(fakePath); - assert.strictEqual(result, "pluginValue"); - assert((client.pathTemplates.styleGuidePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('version', () => { - const fakePath = "/rendered/path/version"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - api: "apiValue", - version: "versionValue", - }; - const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.versionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.versionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('versionPath', () => { - const result = client.versionPath("projectValue", "locationValue", "apiValue", "versionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.versionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromVersionName', () => { - const result = client.matchProjectFromVersionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.versionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromVersionName', () => { - const result = client.matchLocationFromVersionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.versionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchApiFromVersionName', () => { - const result = client.matchApiFromVersionName(fakePath); - assert.strictEqual(result, "apiValue"); - assert((client.pathTemplates.versionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchVersionFromVersionName', () => { - const result = client.matchVersionFromVersionName(fakePath); - assert.strictEqual(result, "versionValue"); - assert((client.pathTemplates.versionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/google-cloud-apihub/v1/test/gapic_linting_service_v1.ts b/owl-bot-staging/google-cloud-apihub/v1/test/gapic_linting_service_v1.ts deleted file mode 100644 index 9ec56921975..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/test/gapic_linting_service_v1.ts +++ /dev/null @@ -1,1539 +0,0 @@ -// Copyright 2024 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 lintingserviceModule from '../src'; - -import {protobuf, 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 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.LintingServiceClient', () => { - describe('Common methods', () => { - it('has apiEndpoint', () => { - const client = new lintingserviceModule.v1.LintingServiceClient(); - const apiEndpoint = client.apiEndpoint; - assert.strictEqual(apiEndpoint, 'apihub.googleapis.com'); - }); - - it('has universeDomain', () => { - const client = new lintingserviceModule.v1.LintingServiceClient(); - const universeDomain = client.universeDomain; - assert.strictEqual(universeDomain, "googleapis.com"); - }); - - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - it('throws DeprecationWarning if static servicePath is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const servicePath = lintingserviceModule.v1.LintingServiceClient.servicePath; - assert.strictEqual(servicePath, 'apihub.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - - it('throws DeprecationWarning if static apiEndpoint is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const apiEndpoint = lintingserviceModule.v1.LintingServiceClient.apiEndpoint; - assert.strictEqual(apiEndpoint, 'apihub.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - } - it('sets apiEndpoint according to universe domain camelCase', () => { - const client = new lintingserviceModule.v1.LintingServiceClient({universeDomain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'apihub.example.com'); - }); - - it('sets apiEndpoint according to universe domain snakeCase', () => { - const client = new lintingserviceModule.v1.LintingServiceClient({universe_domain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'apihub.example.com'); - }); - - if (typeof process === 'object' && 'env' in process) { - describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { - it('sets apiEndpoint from environment variable', () => { - const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; - const client = new lintingserviceModule.v1.LintingServiceClient(); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'apihub.example.com'); - if (saved) { - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; - } else { - delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - } - }); - - it('value configured in code has priority over environment variable', () => { - const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; - const client = new lintingserviceModule.v1.LintingServiceClient({universeDomain: 'configured.example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'apihub.configured.example.com'); - if (saved) { - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; - } else { - delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - } - }); - }); - } - it('does not allow setting both universeDomain and universe_domain', () => { - assert.throws(() => { new lintingserviceModule.v1.LintingServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); - }); - - it('has port', () => { - const port = lintingserviceModule.v1.LintingServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new lintingserviceModule.v1.LintingServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new lintingserviceModule.v1.LintingServiceClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new lintingserviceModule.v1.LintingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.lintingServiceStub, undefined); - await client.initialize(); - assert(client.lintingServiceStub); - }); - - it('has close method for the initialized client', done => { - const client = new lintingserviceModule.v1.LintingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - assert(client.lintingServiceStub); - client.close().then(() => { - done(); - }); - }); - - it('has close method for the non-initialized client', done => { - const client = new lintingserviceModule.v1.LintingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.lintingServiceStub, undefined); - client.close().then(() => { - done(); - }); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new lintingserviceModule.v1.LintingServiceClient({ - 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 lintingserviceModule.v1.LintingServiceClient({ - 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('getStyleGuide', () => { - it('invokes getStyleGuide without error', async () => { - const client = new lintingserviceModule.v1.LintingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetStyleGuideRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetStyleGuideRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.StyleGuide() - ); - client.innerApiCalls.getStyleGuide = stubSimpleCall(expectedResponse); - const [response] = await client.getStyleGuide(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getStyleGuide as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getStyleGuide as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getStyleGuide without error using callback', async () => { - const client = new lintingserviceModule.v1.LintingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetStyleGuideRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetStyleGuideRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.StyleGuide() - ); - client.innerApiCalls.getStyleGuide = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getStyleGuide( - request, - (err?: Error|null, result?: protos.google.cloud.apihub.v1.IStyleGuide|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getStyleGuide as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getStyleGuide as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getStyleGuide with error', async () => { - const client = new lintingserviceModule.v1.LintingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetStyleGuideRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetStyleGuideRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getStyleGuide = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getStyleGuide(request), expectedError); - const actualRequest = (client.innerApiCalls.getStyleGuide as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getStyleGuide as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getStyleGuide with closed client', async () => { - const client = new lintingserviceModule.v1.LintingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetStyleGuideRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetStyleGuideRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getStyleGuide(request), expectedError); - }); - }); - - describe('updateStyleGuide', () => { - it('invokes updateStyleGuide without error', async () => { - const client = new lintingserviceModule.v1.LintingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.UpdateStyleGuideRequest() - ); - request.styleGuide ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.UpdateStyleGuideRequest', ['styleGuide', 'name']); - request.styleGuide.name = defaultValue1; - const expectedHeaderRequestParams = `style_guide.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.StyleGuide() - ); - client.innerApiCalls.updateStyleGuide = stubSimpleCall(expectedResponse); - const [response] = await client.updateStyleGuide(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateStyleGuide as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateStyleGuide as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateStyleGuide without error using callback', async () => { - const client = new lintingserviceModule.v1.LintingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.UpdateStyleGuideRequest() - ); - request.styleGuide ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.UpdateStyleGuideRequest', ['styleGuide', 'name']); - request.styleGuide.name = defaultValue1; - const expectedHeaderRequestParams = `style_guide.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.StyleGuide() - ); - client.innerApiCalls.updateStyleGuide = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateStyleGuide( - request, - (err?: Error|null, result?: protos.google.cloud.apihub.v1.IStyleGuide|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateStyleGuide as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateStyleGuide as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateStyleGuide with error', async () => { - const client = new lintingserviceModule.v1.LintingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.UpdateStyleGuideRequest() - ); - request.styleGuide ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.UpdateStyleGuideRequest', ['styleGuide', 'name']); - request.styleGuide.name = defaultValue1; - const expectedHeaderRequestParams = `style_guide.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateStyleGuide = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateStyleGuide(request), expectedError); - const actualRequest = (client.innerApiCalls.updateStyleGuide as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateStyleGuide as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateStyleGuide with closed client', async () => { - const client = new lintingserviceModule.v1.LintingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.UpdateStyleGuideRequest() - ); - request.styleGuide ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.UpdateStyleGuideRequest', ['styleGuide', 'name']); - request.styleGuide.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateStyleGuide(request), expectedError); - }); - }); - - describe('getStyleGuideContents', () => { - it('invokes getStyleGuideContents without error', async () => { - const client = new lintingserviceModule.v1.LintingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetStyleGuideContentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetStyleGuideContentsRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.StyleGuideContents() - ); - client.innerApiCalls.getStyleGuideContents = stubSimpleCall(expectedResponse); - const [response] = await client.getStyleGuideContents(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getStyleGuideContents as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getStyleGuideContents as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getStyleGuideContents without error using callback', async () => { - const client = new lintingserviceModule.v1.LintingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetStyleGuideContentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetStyleGuideContentsRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.StyleGuideContents() - ); - client.innerApiCalls.getStyleGuideContents = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getStyleGuideContents( - request, - (err?: Error|null, result?: protos.google.cloud.apihub.v1.IStyleGuideContents|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getStyleGuideContents as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getStyleGuideContents as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getStyleGuideContents with error', async () => { - const client = new lintingserviceModule.v1.LintingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetStyleGuideContentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetStyleGuideContentsRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getStyleGuideContents = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getStyleGuideContents(request), expectedError); - const actualRequest = (client.innerApiCalls.getStyleGuideContents as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getStyleGuideContents as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getStyleGuideContents with closed client', async () => { - const client = new lintingserviceModule.v1.LintingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetStyleGuideContentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetStyleGuideContentsRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getStyleGuideContents(request), expectedError); - }); - }); - - describe('lintSpec', () => { - it('invokes lintSpec without error', async () => { - const client = new lintingserviceModule.v1.LintingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.LintSpecRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.LintSpecRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.lintSpec = stubSimpleCall(expectedResponse); - const [response] = await client.lintSpec(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.lintSpec as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.lintSpec as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes lintSpec without error using callback', async () => { - const client = new lintingserviceModule.v1.LintingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.LintSpecRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.LintSpecRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.lintSpec = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.lintSpec( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.lintSpec as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.lintSpec as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes lintSpec with error', async () => { - const client = new lintingserviceModule.v1.LintingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.LintSpecRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.LintSpecRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.lintSpec = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.lintSpec(request), expectedError); - const actualRequest = (client.innerApiCalls.lintSpec as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.lintSpec as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes lintSpec with closed client', async () => { - const client = new lintingserviceModule.v1.LintingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.LintSpecRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.LintSpecRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.lintSpec(request), expectedError); - }); - }); - describe('getLocation', () => { - it('invokes getLocation without error', async () => { - const client = new lintingserviceModule.v1.LintingServiceClient({ - 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 lintingserviceModule.v1.LintingServiceClient({ - 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 lintingserviceModule.v1.LintingServiceClient({ - 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 lintingserviceModule.v1.LintingServiceClient({ - 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 lintingserviceModule.v1.LintingServiceClient({ - 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('Path templates', () => { - - describe('api', () => { - const fakePath = "/rendered/path/api"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - api: "apiValue", - }; - const client = new lintingserviceModule.v1.LintingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.apiPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.apiPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('apiPath', () => { - const result = client.apiPath("projectValue", "locationValue", "apiValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.apiPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromApiName', () => { - const result = client.matchProjectFromApiName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.apiPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromApiName', () => { - const result = client.matchLocationFromApiName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.apiPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchApiFromApiName', () => { - const result = client.matchApiFromApiName(fakePath); - assert.strictEqual(result, "apiValue"); - assert((client.pathTemplates.apiPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('apiHubInstance', () => { - const fakePath = "/rendered/path/apiHubInstance"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - api_hub_instance: "apiHubInstanceValue", - }; - const client = new lintingserviceModule.v1.LintingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.apiHubInstancePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.apiHubInstancePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('apiHubInstancePath', () => { - const result = client.apiHubInstancePath("projectValue", "locationValue", "apiHubInstanceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.apiHubInstancePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromApiHubInstanceName', () => { - const result = client.matchProjectFromApiHubInstanceName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromApiHubInstanceName', () => { - const result = client.matchLocationFromApiHubInstanceName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchApiHubInstanceFromApiHubInstanceName', () => { - const result = client.matchApiHubInstanceFromApiHubInstanceName(fakePath); - assert.strictEqual(result, "apiHubInstanceValue"); - assert((client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('apiOperation', () => { - const fakePath = "/rendered/path/apiOperation"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - api: "apiValue", - version: "versionValue", - operation: "operationValue", - }; - const client = new lintingserviceModule.v1.LintingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.apiOperationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.apiOperationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('apiOperationPath', () => { - const result = client.apiOperationPath("projectValue", "locationValue", "apiValue", "versionValue", "operationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.apiOperationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromApiOperationName', () => { - const result = client.matchProjectFromApiOperationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromApiOperationName', () => { - const result = client.matchLocationFromApiOperationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchApiFromApiOperationName', () => { - const result = client.matchApiFromApiOperationName(fakePath); - assert.strictEqual(result, "apiValue"); - assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchVersionFromApiOperationName', () => { - const result = client.matchVersionFromApiOperationName(fakePath); - assert.strictEqual(result, "versionValue"); - assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchOperationFromApiOperationName', () => { - const result = client.matchOperationFromApiOperationName(fakePath); - assert.strictEqual(result, "operationValue"); - assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('attribute', () => { - const fakePath = "/rendered/path/attribute"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - attribute: "attributeValue", - }; - const client = new lintingserviceModule.v1.LintingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.attributePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.attributePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('attributePath', () => { - const result = client.attributePath("projectValue", "locationValue", "attributeValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.attributePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromAttributeName', () => { - const result = client.matchProjectFromAttributeName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.attributePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromAttributeName', () => { - const result = client.matchLocationFromAttributeName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.attributePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAttributeFromAttributeName', () => { - const result = client.matchAttributeFromAttributeName(fakePath); - assert.strictEqual(result, "attributeValue"); - assert((client.pathTemplates.attributePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('definition', () => { - const fakePath = "/rendered/path/definition"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - api: "apiValue", - version: "versionValue", - definition: "definitionValue", - }; - const client = new lintingserviceModule.v1.LintingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.definitionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.definitionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('definitionPath', () => { - const result = client.definitionPath("projectValue", "locationValue", "apiValue", "versionValue", "definitionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.definitionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDefinitionName', () => { - const result = client.matchProjectFromDefinitionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDefinitionName', () => { - const result = client.matchLocationFromDefinitionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchApiFromDefinitionName', () => { - const result = client.matchApiFromDefinitionName(fakePath); - assert.strictEqual(result, "apiValue"); - assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchVersionFromDefinitionName', () => { - const result = client.matchVersionFromDefinitionName(fakePath); - assert.strictEqual(result, "versionValue"); - assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDefinitionFromDefinitionName', () => { - const result = client.matchDefinitionFromDefinitionName(fakePath); - assert.strictEqual(result, "definitionValue"); - assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dependency', () => { - const fakePath = "/rendered/path/dependency"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dependency: "dependencyValue", - }; - const client = new lintingserviceModule.v1.LintingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.dependencyPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.dependencyPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('dependencyPath', () => { - const result = client.dependencyPath("projectValue", "locationValue", "dependencyValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.dependencyPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDependencyName', () => { - const result = client.matchProjectFromDependencyName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.dependencyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDependencyName', () => { - const result = client.matchLocationFromDependencyName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.dependencyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDependencyFromDependencyName', () => { - const result = client.matchDependencyFromDependencyName(fakePath); - assert.strictEqual(result, "dependencyValue"); - assert((client.pathTemplates.dependencyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('deployment', () => { - const fakePath = "/rendered/path/deployment"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - deployment: "deploymentValue", - }; - const client = new lintingserviceModule.v1.LintingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.deploymentPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.deploymentPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('deploymentPath', () => { - const result = client.deploymentPath("projectValue", "locationValue", "deploymentValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.deploymentPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDeploymentName', () => { - const result = client.matchProjectFromDeploymentName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDeploymentName', () => { - const result = client.matchLocationFromDeploymentName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDeploymentFromDeploymentName', () => { - const result = client.matchDeploymentFromDeploymentName(fakePath); - assert.strictEqual(result, "deploymentValue"); - assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('externalApi', () => { - const fakePath = "/rendered/path/externalApi"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - external_api: "externalApiValue", - }; - const client = new lintingserviceModule.v1.LintingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.externalApiPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.externalApiPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('externalApiPath', () => { - const result = client.externalApiPath("projectValue", "locationValue", "externalApiValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.externalApiPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromExternalApiName', () => { - const result = client.matchProjectFromExternalApiName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.externalApiPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromExternalApiName', () => { - const result = client.matchLocationFromExternalApiName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.externalApiPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExternalApiFromExternalApiName', () => { - const result = client.matchExternalApiFromExternalApiName(fakePath); - assert.strictEqual(result, "externalApiValue"); - assert((client.pathTemplates.externalApiPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('hostProjectRegistration', () => { - const fakePath = "/rendered/path/hostProjectRegistration"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - host_project_registration: "hostProjectRegistrationValue", - }; - const client = new lintingserviceModule.v1.LintingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.hostProjectRegistrationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.hostProjectRegistrationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('hostProjectRegistrationPath', () => { - const result = client.hostProjectRegistrationPath("projectValue", "locationValue", "hostProjectRegistrationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.hostProjectRegistrationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromHostProjectRegistrationName', () => { - const result = client.matchProjectFromHostProjectRegistrationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.hostProjectRegistrationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromHostProjectRegistrationName', () => { - const result = client.matchLocationFromHostProjectRegistrationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.hostProjectRegistrationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchHostProjectRegistrationFromHostProjectRegistrationName', () => { - const result = client.matchHostProjectRegistrationFromHostProjectRegistrationName(fakePath); - assert.strictEqual(result, "hostProjectRegistrationValue"); - assert((client.pathTemplates.hostProjectRegistrationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('plugin', () => { - const fakePath = "/rendered/path/plugin"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - plugin: "pluginValue", - }; - const client = new lintingserviceModule.v1.LintingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.pluginPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.pluginPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('pluginPath', () => { - const result = client.pluginPath("projectValue", "locationValue", "pluginValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.pluginPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromPluginName', () => { - const result = client.matchProjectFromPluginName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.pluginPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromPluginName', () => { - const result = client.matchLocationFromPluginName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.pluginPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchPluginFromPluginName', () => { - const result = client.matchPluginFromPluginName(fakePath); - assert.strictEqual(result, "pluginValue"); - assert((client.pathTemplates.pluginPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('runtimeProjectAttachment', () => { - const fakePath = "/rendered/path/runtimeProjectAttachment"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - runtime_project_attachment: "runtimeProjectAttachmentValue", - }; - const client = new lintingserviceModule.v1.LintingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.runtimeProjectAttachmentPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.runtimeProjectAttachmentPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('runtimeProjectAttachmentPath', () => { - const result = client.runtimeProjectAttachmentPath("projectValue", "locationValue", "runtimeProjectAttachmentValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromRuntimeProjectAttachmentName', () => { - const result = client.matchProjectFromRuntimeProjectAttachmentName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromRuntimeProjectAttachmentName', () => { - const result = client.matchLocationFromRuntimeProjectAttachmentName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName', () => { - const result = client.matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName(fakePath); - assert.strictEqual(result, "runtimeProjectAttachmentValue"); - assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('spec', () => { - const fakePath = "/rendered/path/spec"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - api: "apiValue", - version: "versionValue", - spec: "specValue", - }; - const client = new lintingserviceModule.v1.LintingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.specPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.specPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('specPath', () => { - const result = client.specPath("projectValue", "locationValue", "apiValue", "versionValue", "specValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.specPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSpecName', () => { - const result = client.matchProjectFromSpecName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.specPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSpecName', () => { - const result = client.matchLocationFromSpecName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.specPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchApiFromSpecName', () => { - const result = client.matchApiFromSpecName(fakePath); - assert.strictEqual(result, "apiValue"); - assert((client.pathTemplates.specPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchVersionFromSpecName', () => { - const result = client.matchVersionFromSpecName(fakePath); - assert.strictEqual(result, "versionValue"); - assert((client.pathTemplates.specPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSpecFromSpecName', () => { - const result = client.matchSpecFromSpecName(fakePath); - assert.strictEqual(result, "specValue"); - assert((client.pathTemplates.specPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('styleGuide', () => { - const fakePath = "/rendered/path/styleGuide"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - plugin: "pluginValue", - }; - const client = new lintingserviceModule.v1.LintingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.styleGuidePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.styleGuidePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('styleGuidePath', () => { - const result = client.styleGuidePath("projectValue", "locationValue", "pluginValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.styleGuidePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromStyleGuideName', () => { - const result = client.matchProjectFromStyleGuideName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.styleGuidePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromStyleGuideName', () => { - const result = client.matchLocationFromStyleGuideName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.styleGuidePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchPluginFromStyleGuideName', () => { - const result = client.matchPluginFromStyleGuideName(fakePath); - assert.strictEqual(result, "pluginValue"); - assert((client.pathTemplates.styleGuidePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('version', () => { - const fakePath = "/rendered/path/version"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - api: "apiValue", - version: "versionValue", - }; - const client = new lintingserviceModule.v1.LintingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.versionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.versionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('versionPath', () => { - const result = client.versionPath("projectValue", "locationValue", "apiValue", "versionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.versionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromVersionName', () => { - const result = client.matchProjectFromVersionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.versionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromVersionName', () => { - const result = client.matchLocationFromVersionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.versionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchApiFromVersionName', () => { - const result = client.matchApiFromVersionName(fakePath); - assert.strictEqual(result, "apiValue"); - assert((client.pathTemplates.versionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchVersionFromVersionName', () => { - const result = client.matchVersionFromVersionName(fakePath); - assert.strictEqual(result, "versionValue"); - assert((client.pathTemplates.versionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/google-cloud-apihub/v1/test/gapic_provisioning_v1.ts b/owl-bot-staging/google-cloud-apihub/v1/test/gapic_provisioning_v1.ts deleted file mode 100644 index 342c8447958..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/test/gapic_provisioning_v1.ts +++ /dev/null @@ -1,1812 +0,0 @@ -// Copyright 2024 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 provisioningModule from '../src'; - -import {protobuf, LROperation, operationsProtos, 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 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.ProvisioningClient', () => { - describe('Common methods', () => { - it('has apiEndpoint', () => { - const client = new provisioningModule.v1.ProvisioningClient(); - const apiEndpoint = client.apiEndpoint; - assert.strictEqual(apiEndpoint, 'apihub.googleapis.com'); - }); - - it('has universeDomain', () => { - const client = new provisioningModule.v1.ProvisioningClient(); - const universeDomain = client.universeDomain; - assert.strictEqual(universeDomain, "googleapis.com"); - }); - - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - it('throws DeprecationWarning if static servicePath is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const servicePath = provisioningModule.v1.ProvisioningClient.servicePath; - assert.strictEqual(servicePath, 'apihub.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - - it('throws DeprecationWarning if static apiEndpoint is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const apiEndpoint = provisioningModule.v1.ProvisioningClient.apiEndpoint; - assert.strictEqual(apiEndpoint, 'apihub.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - } - it('sets apiEndpoint according to universe domain camelCase', () => { - const client = new provisioningModule.v1.ProvisioningClient({universeDomain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'apihub.example.com'); - }); - - it('sets apiEndpoint according to universe domain snakeCase', () => { - const client = new provisioningModule.v1.ProvisioningClient({universe_domain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'apihub.example.com'); - }); - - if (typeof process === 'object' && 'env' in process) { - describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { - it('sets apiEndpoint from environment variable', () => { - const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; - const client = new provisioningModule.v1.ProvisioningClient(); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'apihub.example.com'); - if (saved) { - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; - } else { - delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - } - }); - - it('value configured in code has priority over environment variable', () => { - const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; - const client = new provisioningModule.v1.ProvisioningClient({universeDomain: 'configured.example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'apihub.configured.example.com'); - if (saved) { - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; - } else { - delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - } - }); - }); - } - it('does not allow setting both universeDomain and universe_domain', () => { - assert.throws(() => { new provisioningModule.v1.ProvisioningClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); - }); - - it('has port', () => { - const port = provisioningModule.v1.ProvisioningClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new provisioningModule.v1.ProvisioningClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new provisioningModule.v1.ProvisioningClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.provisioningStub, undefined); - await client.initialize(); - assert(client.provisioningStub); - }); - - it('has close method for the initialized client', done => { - const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - assert(client.provisioningStub); - client.close().then(() => { - done(); - }); - }); - - it('has close method for the non-initialized client', done => { - const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.provisioningStub, undefined); - client.close().then(() => { - done(); - }); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new provisioningModule.v1.ProvisioningClient({ - 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 provisioningModule.v1.ProvisioningClient({ - 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('getApiHubInstance', () => { - it('invokes getApiHubInstance without error', async () => { - const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetApiHubInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetApiHubInstanceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.ApiHubInstance() - ); - client.innerApiCalls.getApiHubInstance = stubSimpleCall(expectedResponse); - const [response] = await client.getApiHubInstance(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getApiHubInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getApiHubInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getApiHubInstance without error using callback', async () => { - const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetApiHubInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetApiHubInstanceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.ApiHubInstance() - ); - client.innerApiCalls.getApiHubInstance = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getApiHubInstance( - request, - (err?: Error|null, result?: protos.google.cloud.apihub.v1.IApiHubInstance|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getApiHubInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getApiHubInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getApiHubInstance with error', async () => { - const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetApiHubInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetApiHubInstanceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getApiHubInstance = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getApiHubInstance(request), expectedError); - const actualRequest = (client.innerApiCalls.getApiHubInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getApiHubInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getApiHubInstance with closed client', async () => { - const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetApiHubInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetApiHubInstanceRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getApiHubInstance(request), expectedError); - }); - }); - - describe('lookupApiHubInstance', () => { - it('invokes lookupApiHubInstance without error', async () => { - const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.LookupApiHubInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.LookupApiHubInstanceRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.LookupApiHubInstanceResponse() - ); - client.innerApiCalls.lookupApiHubInstance = stubSimpleCall(expectedResponse); - const [response] = await client.lookupApiHubInstance(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.lookupApiHubInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.lookupApiHubInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes lookupApiHubInstance without error using callback', async () => { - const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.LookupApiHubInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.LookupApiHubInstanceRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.LookupApiHubInstanceResponse() - ); - client.innerApiCalls.lookupApiHubInstance = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.lookupApiHubInstance( - request, - (err?: Error|null, result?: protos.google.cloud.apihub.v1.ILookupApiHubInstanceResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.lookupApiHubInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.lookupApiHubInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes lookupApiHubInstance with error', async () => { - const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.LookupApiHubInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.LookupApiHubInstanceRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.lookupApiHubInstance = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.lookupApiHubInstance(request), expectedError); - const actualRequest = (client.innerApiCalls.lookupApiHubInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.lookupApiHubInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes lookupApiHubInstance with closed client', async () => { - const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.LookupApiHubInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.LookupApiHubInstanceRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.lookupApiHubInstance(request), expectedError); - }); - }); - - describe('createApiHubInstance', () => { - it('invokes createApiHubInstance without error', async () => { - const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.CreateApiHubInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.CreateApiHubInstanceRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createApiHubInstance = stubLongRunningCall(expectedResponse); - const [operation] = await client.createApiHubInstance(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createApiHubInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createApiHubInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createApiHubInstance without error using callback', async () => { - const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.CreateApiHubInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.CreateApiHubInstanceRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createApiHubInstance = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createApiHubInstance( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createApiHubInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createApiHubInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createApiHubInstance with call error', async () => { - const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.CreateApiHubInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.CreateApiHubInstanceRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createApiHubInstance = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.createApiHubInstance(request), expectedError); - const actualRequest = (client.innerApiCalls.createApiHubInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createApiHubInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createApiHubInstance with LRO error', async () => { - const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.CreateApiHubInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.CreateApiHubInstanceRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createApiHubInstance = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createApiHubInstance(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.createApiHubInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createApiHubInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkCreateApiHubInstanceProgress without error', async () => { - const client = new provisioningModule.v1.ProvisioningClient({ - 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.checkCreateApiHubInstanceProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkCreateApiHubInstanceProgress with error', async () => { - const client = new provisioningModule.v1.ProvisioningClient({ - 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.checkCreateApiHubInstanceProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - describe('getLocation', () => { - it('invokes getLocation without error', async () => { - const client = new provisioningModule.v1.ProvisioningClient({ - 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 provisioningModule.v1.ProvisioningClient({ - 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 provisioningModule.v1.ProvisioningClient({ - 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 provisioningModule.v1.ProvisioningClient({ - 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 provisioningModule.v1.ProvisioningClient({ - 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 provisioningModule.v1.ProvisioningClient({ - 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 provisioningModule.v1.ProvisioningClient({ - 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 provisioningModule.v1.ProvisioningClient({ - 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 provisioningModule.v1.ProvisioningClient({ - 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 provisioningModule.v1.ProvisioningClient({ - 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 provisioningModule.v1.ProvisioningClient({ - 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 provisioningModule.v1.ProvisioningClient({ - 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 provisioningModule.v1.ProvisioningClient({ - 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 provisioningModule.v1.ProvisioningClient({ - 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 provisioningModule.v1.ProvisioningClient({ - 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 provisioningModule.v1.ProvisioningClient({ - 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('api', () => { - const fakePath = "/rendered/path/api"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - api: "apiValue", - }; - const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.apiPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.apiPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('apiPath', () => { - const result = client.apiPath("projectValue", "locationValue", "apiValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.apiPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromApiName', () => { - const result = client.matchProjectFromApiName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.apiPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromApiName', () => { - const result = client.matchLocationFromApiName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.apiPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchApiFromApiName', () => { - const result = client.matchApiFromApiName(fakePath); - assert.strictEqual(result, "apiValue"); - assert((client.pathTemplates.apiPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('apiHubInstance', () => { - const fakePath = "/rendered/path/apiHubInstance"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - api_hub_instance: "apiHubInstanceValue", - }; - const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.apiHubInstancePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.apiHubInstancePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('apiHubInstancePath', () => { - const result = client.apiHubInstancePath("projectValue", "locationValue", "apiHubInstanceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.apiHubInstancePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromApiHubInstanceName', () => { - const result = client.matchProjectFromApiHubInstanceName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromApiHubInstanceName', () => { - const result = client.matchLocationFromApiHubInstanceName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchApiHubInstanceFromApiHubInstanceName', () => { - const result = client.matchApiHubInstanceFromApiHubInstanceName(fakePath); - assert.strictEqual(result, "apiHubInstanceValue"); - assert((client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('apiOperation', () => { - const fakePath = "/rendered/path/apiOperation"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - api: "apiValue", - version: "versionValue", - operation: "operationValue", - }; - const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.apiOperationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.apiOperationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('apiOperationPath', () => { - const result = client.apiOperationPath("projectValue", "locationValue", "apiValue", "versionValue", "operationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.apiOperationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromApiOperationName', () => { - const result = client.matchProjectFromApiOperationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromApiOperationName', () => { - const result = client.matchLocationFromApiOperationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchApiFromApiOperationName', () => { - const result = client.matchApiFromApiOperationName(fakePath); - assert.strictEqual(result, "apiValue"); - assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchVersionFromApiOperationName', () => { - const result = client.matchVersionFromApiOperationName(fakePath); - assert.strictEqual(result, "versionValue"); - assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchOperationFromApiOperationName', () => { - const result = client.matchOperationFromApiOperationName(fakePath); - assert.strictEqual(result, "operationValue"); - assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('attribute', () => { - const fakePath = "/rendered/path/attribute"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - attribute: "attributeValue", - }; - const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.attributePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.attributePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('attributePath', () => { - const result = client.attributePath("projectValue", "locationValue", "attributeValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.attributePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromAttributeName', () => { - const result = client.matchProjectFromAttributeName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.attributePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromAttributeName', () => { - const result = client.matchLocationFromAttributeName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.attributePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAttributeFromAttributeName', () => { - const result = client.matchAttributeFromAttributeName(fakePath); - assert.strictEqual(result, "attributeValue"); - assert((client.pathTemplates.attributePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('definition', () => { - const fakePath = "/rendered/path/definition"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - api: "apiValue", - version: "versionValue", - definition: "definitionValue", - }; - const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.definitionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.definitionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('definitionPath', () => { - const result = client.definitionPath("projectValue", "locationValue", "apiValue", "versionValue", "definitionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.definitionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDefinitionName', () => { - const result = client.matchProjectFromDefinitionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDefinitionName', () => { - const result = client.matchLocationFromDefinitionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchApiFromDefinitionName', () => { - const result = client.matchApiFromDefinitionName(fakePath); - assert.strictEqual(result, "apiValue"); - assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchVersionFromDefinitionName', () => { - const result = client.matchVersionFromDefinitionName(fakePath); - assert.strictEqual(result, "versionValue"); - assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDefinitionFromDefinitionName', () => { - const result = client.matchDefinitionFromDefinitionName(fakePath); - assert.strictEqual(result, "definitionValue"); - assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dependency', () => { - const fakePath = "/rendered/path/dependency"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dependency: "dependencyValue", - }; - const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.dependencyPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.dependencyPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('dependencyPath', () => { - const result = client.dependencyPath("projectValue", "locationValue", "dependencyValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.dependencyPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDependencyName', () => { - const result = client.matchProjectFromDependencyName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.dependencyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDependencyName', () => { - const result = client.matchLocationFromDependencyName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.dependencyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDependencyFromDependencyName', () => { - const result = client.matchDependencyFromDependencyName(fakePath); - assert.strictEqual(result, "dependencyValue"); - assert((client.pathTemplates.dependencyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('deployment', () => { - const fakePath = "/rendered/path/deployment"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - deployment: "deploymentValue", - }; - const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.deploymentPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.deploymentPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('deploymentPath', () => { - const result = client.deploymentPath("projectValue", "locationValue", "deploymentValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.deploymentPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDeploymentName', () => { - const result = client.matchProjectFromDeploymentName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDeploymentName', () => { - const result = client.matchLocationFromDeploymentName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDeploymentFromDeploymentName', () => { - const result = client.matchDeploymentFromDeploymentName(fakePath); - assert.strictEqual(result, "deploymentValue"); - assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('externalApi', () => { - const fakePath = "/rendered/path/externalApi"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - external_api: "externalApiValue", - }; - const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.externalApiPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.externalApiPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('externalApiPath', () => { - const result = client.externalApiPath("projectValue", "locationValue", "externalApiValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.externalApiPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromExternalApiName', () => { - const result = client.matchProjectFromExternalApiName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.externalApiPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromExternalApiName', () => { - const result = client.matchLocationFromExternalApiName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.externalApiPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExternalApiFromExternalApiName', () => { - const result = client.matchExternalApiFromExternalApiName(fakePath); - assert.strictEqual(result, "externalApiValue"); - assert((client.pathTemplates.externalApiPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('hostProjectRegistration', () => { - const fakePath = "/rendered/path/hostProjectRegistration"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - host_project_registration: "hostProjectRegistrationValue", - }; - const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.hostProjectRegistrationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.hostProjectRegistrationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('hostProjectRegistrationPath', () => { - const result = client.hostProjectRegistrationPath("projectValue", "locationValue", "hostProjectRegistrationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.hostProjectRegistrationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromHostProjectRegistrationName', () => { - const result = client.matchProjectFromHostProjectRegistrationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.hostProjectRegistrationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromHostProjectRegistrationName', () => { - const result = client.matchLocationFromHostProjectRegistrationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.hostProjectRegistrationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchHostProjectRegistrationFromHostProjectRegistrationName', () => { - const result = client.matchHostProjectRegistrationFromHostProjectRegistrationName(fakePath); - assert.strictEqual(result, "hostProjectRegistrationValue"); - assert((client.pathTemplates.hostProjectRegistrationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('location', () => { - const fakePath = "/rendered/path/location"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - }; - const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.locationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.locationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('locationPath', () => { - const result = client.locationPath("projectValue", "locationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.locationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromLocationName', () => { - const result = client.matchProjectFromLocationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromLocationName', () => { - const result = client.matchLocationFromLocationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('plugin', () => { - const fakePath = "/rendered/path/plugin"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - plugin: "pluginValue", - }; - const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.pluginPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.pluginPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('pluginPath', () => { - const result = client.pluginPath("projectValue", "locationValue", "pluginValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.pluginPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromPluginName', () => { - const result = client.matchProjectFromPluginName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.pluginPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromPluginName', () => { - const result = client.matchLocationFromPluginName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.pluginPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchPluginFromPluginName', () => { - const result = client.matchPluginFromPluginName(fakePath); - assert.strictEqual(result, "pluginValue"); - assert((client.pathTemplates.pluginPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('project', () => { - const fakePath = "/rendered/path/project"; - const expectedParameters = { - project: "projectValue", - }; - const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.projectPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectPath', () => { - const result = client.projectPath("projectValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectName', () => { - const result = client.matchProjectFromProjectName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('runtimeProjectAttachment', () => { - const fakePath = "/rendered/path/runtimeProjectAttachment"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - runtime_project_attachment: "runtimeProjectAttachmentValue", - }; - const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.runtimeProjectAttachmentPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.runtimeProjectAttachmentPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('runtimeProjectAttachmentPath', () => { - const result = client.runtimeProjectAttachmentPath("projectValue", "locationValue", "runtimeProjectAttachmentValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromRuntimeProjectAttachmentName', () => { - const result = client.matchProjectFromRuntimeProjectAttachmentName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromRuntimeProjectAttachmentName', () => { - const result = client.matchLocationFromRuntimeProjectAttachmentName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName', () => { - const result = client.matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName(fakePath); - assert.strictEqual(result, "runtimeProjectAttachmentValue"); - assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('spec', () => { - const fakePath = "/rendered/path/spec"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - api: "apiValue", - version: "versionValue", - spec: "specValue", - }; - const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.specPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.specPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('specPath', () => { - const result = client.specPath("projectValue", "locationValue", "apiValue", "versionValue", "specValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.specPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSpecName', () => { - const result = client.matchProjectFromSpecName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.specPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSpecName', () => { - const result = client.matchLocationFromSpecName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.specPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchApiFromSpecName', () => { - const result = client.matchApiFromSpecName(fakePath); - assert.strictEqual(result, "apiValue"); - assert((client.pathTemplates.specPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchVersionFromSpecName', () => { - const result = client.matchVersionFromSpecName(fakePath); - assert.strictEqual(result, "versionValue"); - assert((client.pathTemplates.specPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSpecFromSpecName', () => { - const result = client.matchSpecFromSpecName(fakePath); - assert.strictEqual(result, "specValue"); - assert((client.pathTemplates.specPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('styleGuide', () => { - const fakePath = "/rendered/path/styleGuide"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - plugin: "pluginValue", - }; - const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.styleGuidePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.styleGuidePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('styleGuidePath', () => { - const result = client.styleGuidePath("projectValue", "locationValue", "pluginValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.styleGuidePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromStyleGuideName', () => { - const result = client.matchProjectFromStyleGuideName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.styleGuidePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromStyleGuideName', () => { - const result = client.matchLocationFromStyleGuideName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.styleGuidePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchPluginFromStyleGuideName', () => { - const result = client.matchPluginFromStyleGuideName(fakePath); - assert.strictEqual(result, "pluginValue"); - assert((client.pathTemplates.styleGuidePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('version', () => { - const fakePath = "/rendered/path/version"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - api: "apiValue", - version: "versionValue", - }; - const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.versionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.versionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('versionPath', () => { - const result = client.versionPath("projectValue", "locationValue", "apiValue", "versionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.versionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromVersionName', () => { - const result = client.matchProjectFromVersionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.versionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromVersionName', () => { - const result = client.matchLocationFromVersionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.versionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchApiFromVersionName', () => { - const result = client.matchApiFromVersionName(fakePath); - assert.strictEqual(result, "apiValue"); - assert((client.pathTemplates.versionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchVersionFromVersionName', () => { - const result = client.matchVersionFromVersionName(fakePath); - assert.strictEqual(result, "versionValue"); - assert((client.pathTemplates.versionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/google-cloud-apihub/v1/test/gapic_runtime_project_attachment_service_v1.ts b/owl-bot-staging/google-cloud-apihub/v1/test/gapic_runtime_project_attachment_service_v1.ts deleted file mode 100644 index 1a71bbbdd43..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/test/gapic_runtime_project_attachment_service_v1.ts +++ /dev/null @@ -1,1875 +0,0 @@ -// Copyright 2024 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 runtimeprojectattachmentserviceModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf, 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 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.RuntimeProjectAttachmentServiceClient', () => { - describe('Common methods', () => { - it('has apiEndpoint', () => { - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient(); - const apiEndpoint = client.apiEndpoint; - assert.strictEqual(apiEndpoint, 'apihub.googleapis.com'); - }); - - it('has universeDomain', () => { - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient(); - const universeDomain = client.universeDomain; - assert.strictEqual(universeDomain, "googleapis.com"); - }); - - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - it('throws DeprecationWarning if static servicePath is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const servicePath = runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient.servicePath; - assert.strictEqual(servicePath, 'apihub.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - - it('throws DeprecationWarning if static apiEndpoint is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const apiEndpoint = runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient.apiEndpoint; - assert.strictEqual(apiEndpoint, 'apihub.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - } - it('sets apiEndpoint according to universe domain camelCase', () => { - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({universeDomain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'apihub.example.com'); - }); - - it('sets apiEndpoint according to universe domain snakeCase', () => { - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({universe_domain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'apihub.example.com'); - }); - - if (typeof process === 'object' && 'env' in process) { - describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { - it('sets apiEndpoint from environment variable', () => { - const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient(); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'apihub.example.com'); - if (saved) { - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; - } else { - delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - } - }); - - it('value configured in code has priority over environment variable', () => { - const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({universeDomain: 'configured.example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'apihub.configured.example.com'); - if (saved) { - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; - } else { - delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - } - }); - }); - } - it('does not allow setting both universeDomain and universe_domain', () => { - assert.throws(() => { new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); - }); - - it('has port', () => { - const port = runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.runtimeProjectAttachmentServiceStub, undefined); - await client.initialize(); - assert(client.runtimeProjectAttachmentServiceStub); - }); - - it('has close method for the initialized client', done => { - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - assert(client.runtimeProjectAttachmentServiceStub); - client.close().then(() => { - done(); - }); - }); - - it('has close method for the non-initialized client', done => { - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.runtimeProjectAttachmentServiceStub, undefined); - client.close().then(() => { - done(); - }); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ - 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 runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ - 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('createRuntimeProjectAttachment', () => { - it('invokes createRuntimeProjectAttachment without error', async () => { - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.RuntimeProjectAttachment() - ); - client.innerApiCalls.createRuntimeProjectAttachment = stubSimpleCall(expectedResponse); - const [response] = await client.createRuntimeProjectAttachment(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createRuntimeProjectAttachment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createRuntimeProjectAttachment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createRuntimeProjectAttachment without error using callback', async () => { - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.RuntimeProjectAttachment() - ); - client.innerApiCalls.createRuntimeProjectAttachment = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createRuntimeProjectAttachment( - request, - (err?: Error|null, result?: protos.google.cloud.apihub.v1.IRuntimeProjectAttachment|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createRuntimeProjectAttachment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createRuntimeProjectAttachment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createRuntimeProjectAttachment with error', async () => { - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createRuntimeProjectAttachment = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createRuntimeProjectAttachment(request), expectedError); - const actualRequest = (client.innerApiCalls.createRuntimeProjectAttachment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createRuntimeProjectAttachment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createRuntimeProjectAttachment with closed client', async () => { - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createRuntimeProjectAttachment(request), expectedError); - }); - }); - - describe('getRuntimeProjectAttachment', () => { - it('invokes getRuntimeProjectAttachment without error', async () => { - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.RuntimeProjectAttachment() - ); - client.innerApiCalls.getRuntimeProjectAttachment = stubSimpleCall(expectedResponse); - const [response] = await client.getRuntimeProjectAttachment(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getRuntimeProjectAttachment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getRuntimeProjectAttachment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getRuntimeProjectAttachment without error using callback', async () => { - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.RuntimeProjectAttachment() - ); - client.innerApiCalls.getRuntimeProjectAttachment = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getRuntimeProjectAttachment( - request, - (err?: Error|null, result?: protos.google.cloud.apihub.v1.IRuntimeProjectAttachment|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getRuntimeProjectAttachment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getRuntimeProjectAttachment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getRuntimeProjectAttachment with error', async () => { - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getRuntimeProjectAttachment = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getRuntimeProjectAttachment(request), expectedError); - const actualRequest = (client.innerApiCalls.getRuntimeProjectAttachment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getRuntimeProjectAttachment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getRuntimeProjectAttachment with closed client', async () => { - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getRuntimeProjectAttachment(request), expectedError); - }); - }); - - describe('deleteRuntimeProjectAttachment', () => { - it('invokes deleteRuntimeProjectAttachment without error', async () => { - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteRuntimeProjectAttachment = stubSimpleCall(expectedResponse); - const [response] = await client.deleteRuntimeProjectAttachment(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteRuntimeProjectAttachment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteRuntimeProjectAttachment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteRuntimeProjectAttachment without error using callback', async () => { - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteRuntimeProjectAttachment = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteRuntimeProjectAttachment( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteRuntimeProjectAttachment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteRuntimeProjectAttachment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteRuntimeProjectAttachment with error', async () => { - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteRuntimeProjectAttachment = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteRuntimeProjectAttachment(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteRuntimeProjectAttachment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteRuntimeProjectAttachment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteRuntimeProjectAttachment with closed client', async () => { - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.deleteRuntimeProjectAttachment(request), expectedError); - }); - }); - - describe('lookupRuntimeProjectAttachment', () => { - it('invokes lookupRuntimeProjectAttachment without error', async () => { - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse() - ); - client.innerApiCalls.lookupRuntimeProjectAttachment = stubSimpleCall(expectedResponse); - const [response] = await client.lookupRuntimeProjectAttachment(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.lookupRuntimeProjectAttachment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.lookupRuntimeProjectAttachment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes lookupRuntimeProjectAttachment without error using callback', async () => { - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse() - ); - client.innerApiCalls.lookupRuntimeProjectAttachment = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.lookupRuntimeProjectAttachment( - request, - (err?: Error|null, result?: protos.google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.lookupRuntimeProjectAttachment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.lookupRuntimeProjectAttachment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes lookupRuntimeProjectAttachment with error', async () => { - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.lookupRuntimeProjectAttachment = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.lookupRuntimeProjectAttachment(request), expectedError); - const actualRequest = (client.innerApiCalls.lookupRuntimeProjectAttachment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.lookupRuntimeProjectAttachment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes lookupRuntimeProjectAttachment with closed client', async () => { - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.lookupRuntimeProjectAttachment(request), expectedError); - }); - }); - - describe('listRuntimeProjectAttachments', () => { - it('invokes listRuntimeProjectAttachments without error', async () => { - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apihub.v1.RuntimeProjectAttachment()), - generateSampleMessage(new protos.google.cloud.apihub.v1.RuntimeProjectAttachment()), - generateSampleMessage(new protos.google.cloud.apihub.v1.RuntimeProjectAttachment()), - ]; - client.innerApiCalls.listRuntimeProjectAttachments = stubSimpleCall(expectedResponse); - const [response] = await client.listRuntimeProjectAttachments(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listRuntimeProjectAttachments as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listRuntimeProjectAttachments as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listRuntimeProjectAttachments without error using callback', async () => { - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apihub.v1.RuntimeProjectAttachment()), - generateSampleMessage(new protos.google.cloud.apihub.v1.RuntimeProjectAttachment()), - generateSampleMessage(new protos.google.cloud.apihub.v1.RuntimeProjectAttachment()), - ]; - client.innerApiCalls.listRuntimeProjectAttachments = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listRuntimeProjectAttachments( - request, - (err?: Error|null, result?: protos.google.cloud.apihub.v1.IRuntimeProjectAttachment[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listRuntimeProjectAttachments as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listRuntimeProjectAttachments as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listRuntimeProjectAttachments with error', async () => { - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listRuntimeProjectAttachments = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listRuntimeProjectAttachments(request), expectedError); - const actualRequest = (client.innerApiCalls.listRuntimeProjectAttachments as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listRuntimeProjectAttachments as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listRuntimeProjectAttachmentsStream without error', async () => { - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apihub.v1.RuntimeProjectAttachment()), - generateSampleMessage(new protos.google.cloud.apihub.v1.RuntimeProjectAttachment()), - generateSampleMessage(new protos.google.cloud.apihub.v1.RuntimeProjectAttachment()), - ]; - client.descriptors.page.listRuntimeProjectAttachments.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listRuntimeProjectAttachmentsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.apihub.v1.RuntimeProjectAttachment[] = []; - stream.on('data', (response: protos.google.cloud.apihub.v1.RuntimeProjectAttachment) => { - 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.listRuntimeProjectAttachments.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listRuntimeProjectAttachments, request)); - assert( - (client.descriptors.page.listRuntimeProjectAttachments.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listRuntimeProjectAttachmentsStream with error', async () => { - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listRuntimeProjectAttachments.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listRuntimeProjectAttachmentsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.apihub.v1.RuntimeProjectAttachment[] = []; - stream.on('data', (response: protos.google.cloud.apihub.v1.RuntimeProjectAttachment) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listRuntimeProjectAttachments.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listRuntimeProjectAttachments, request)); - assert( - (client.descriptors.page.listRuntimeProjectAttachments.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listRuntimeProjectAttachments without error', async () => { - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apihub.v1.RuntimeProjectAttachment()), - generateSampleMessage(new protos.google.cloud.apihub.v1.RuntimeProjectAttachment()), - generateSampleMessage(new protos.google.cloud.apihub.v1.RuntimeProjectAttachment()), - ]; - client.descriptors.page.listRuntimeProjectAttachments.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.apihub.v1.IRuntimeProjectAttachment[] = []; - const iterable = client.listRuntimeProjectAttachmentsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listRuntimeProjectAttachments.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listRuntimeProjectAttachments.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listRuntimeProjectAttachments with error', async () => { - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listRuntimeProjectAttachments.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listRuntimeProjectAttachmentsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.apihub.v1.IRuntimeProjectAttachment[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listRuntimeProjectAttachments.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listRuntimeProjectAttachments.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getLocation', () => { - it('invokes getLocation without error', async () => { - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ - 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 runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ - 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 runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ - 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 runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ - 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 runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ - 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('Path templates', () => { - - describe('api', () => { - const fakePath = "/rendered/path/api"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - api: "apiValue", - }; - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.apiPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.apiPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('apiPath', () => { - const result = client.apiPath("projectValue", "locationValue", "apiValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.apiPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromApiName', () => { - const result = client.matchProjectFromApiName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.apiPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromApiName', () => { - const result = client.matchLocationFromApiName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.apiPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchApiFromApiName', () => { - const result = client.matchApiFromApiName(fakePath); - assert.strictEqual(result, "apiValue"); - assert((client.pathTemplates.apiPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('apiHubInstance', () => { - const fakePath = "/rendered/path/apiHubInstance"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - api_hub_instance: "apiHubInstanceValue", - }; - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.apiHubInstancePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.apiHubInstancePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('apiHubInstancePath', () => { - const result = client.apiHubInstancePath("projectValue", "locationValue", "apiHubInstanceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.apiHubInstancePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromApiHubInstanceName', () => { - const result = client.matchProjectFromApiHubInstanceName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromApiHubInstanceName', () => { - const result = client.matchLocationFromApiHubInstanceName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchApiHubInstanceFromApiHubInstanceName', () => { - const result = client.matchApiHubInstanceFromApiHubInstanceName(fakePath); - assert.strictEqual(result, "apiHubInstanceValue"); - assert((client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('apiOperation', () => { - const fakePath = "/rendered/path/apiOperation"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - api: "apiValue", - version: "versionValue", - operation: "operationValue", - }; - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.apiOperationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.apiOperationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('apiOperationPath', () => { - const result = client.apiOperationPath("projectValue", "locationValue", "apiValue", "versionValue", "operationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.apiOperationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromApiOperationName', () => { - const result = client.matchProjectFromApiOperationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromApiOperationName', () => { - const result = client.matchLocationFromApiOperationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchApiFromApiOperationName', () => { - const result = client.matchApiFromApiOperationName(fakePath); - assert.strictEqual(result, "apiValue"); - assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchVersionFromApiOperationName', () => { - const result = client.matchVersionFromApiOperationName(fakePath); - assert.strictEqual(result, "versionValue"); - assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchOperationFromApiOperationName', () => { - const result = client.matchOperationFromApiOperationName(fakePath); - assert.strictEqual(result, "operationValue"); - assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('attribute', () => { - const fakePath = "/rendered/path/attribute"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - attribute: "attributeValue", - }; - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.attributePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.attributePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('attributePath', () => { - const result = client.attributePath("projectValue", "locationValue", "attributeValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.attributePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromAttributeName', () => { - const result = client.matchProjectFromAttributeName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.attributePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromAttributeName', () => { - const result = client.matchLocationFromAttributeName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.attributePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAttributeFromAttributeName', () => { - const result = client.matchAttributeFromAttributeName(fakePath); - assert.strictEqual(result, "attributeValue"); - assert((client.pathTemplates.attributePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('definition', () => { - const fakePath = "/rendered/path/definition"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - api: "apiValue", - version: "versionValue", - definition: "definitionValue", - }; - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.definitionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.definitionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('definitionPath', () => { - const result = client.definitionPath("projectValue", "locationValue", "apiValue", "versionValue", "definitionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.definitionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDefinitionName', () => { - const result = client.matchProjectFromDefinitionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDefinitionName', () => { - const result = client.matchLocationFromDefinitionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchApiFromDefinitionName', () => { - const result = client.matchApiFromDefinitionName(fakePath); - assert.strictEqual(result, "apiValue"); - assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchVersionFromDefinitionName', () => { - const result = client.matchVersionFromDefinitionName(fakePath); - assert.strictEqual(result, "versionValue"); - assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDefinitionFromDefinitionName', () => { - const result = client.matchDefinitionFromDefinitionName(fakePath); - assert.strictEqual(result, "definitionValue"); - assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dependency', () => { - const fakePath = "/rendered/path/dependency"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dependency: "dependencyValue", - }; - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.dependencyPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.dependencyPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('dependencyPath', () => { - const result = client.dependencyPath("projectValue", "locationValue", "dependencyValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.dependencyPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDependencyName', () => { - const result = client.matchProjectFromDependencyName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.dependencyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDependencyName', () => { - const result = client.matchLocationFromDependencyName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.dependencyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDependencyFromDependencyName', () => { - const result = client.matchDependencyFromDependencyName(fakePath); - assert.strictEqual(result, "dependencyValue"); - assert((client.pathTemplates.dependencyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('deployment', () => { - const fakePath = "/rendered/path/deployment"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - deployment: "deploymentValue", - }; - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.deploymentPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.deploymentPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('deploymentPath', () => { - const result = client.deploymentPath("projectValue", "locationValue", "deploymentValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.deploymentPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDeploymentName', () => { - const result = client.matchProjectFromDeploymentName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDeploymentName', () => { - const result = client.matchLocationFromDeploymentName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDeploymentFromDeploymentName', () => { - const result = client.matchDeploymentFromDeploymentName(fakePath); - assert.strictEqual(result, "deploymentValue"); - assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('externalApi', () => { - const fakePath = "/rendered/path/externalApi"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - external_api: "externalApiValue", - }; - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.externalApiPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.externalApiPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('externalApiPath', () => { - const result = client.externalApiPath("projectValue", "locationValue", "externalApiValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.externalApiPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromExternalApiName', () => { - const result = client.matchProjectFromExternalApiName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.externalApiPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromExternalApiName', () => { - const result = client.matchLocationFromExternalApiName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.externalApiPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExternalApiFromExternalApiName', () => { - const result = client.matchExternalApiFromExternalApiName(fakePath); - assert.strictEqual(result, "externalApiValue"); - assert((client.pathTemplates.externalApiPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('hostProjectRegistration', () => { - const fakePath = "/rendered/path/hostProjectRegistration"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - host_project_registration: "hostProjectRegistrationValue", - }; - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.hostProjectRegistrationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.hostProjectRegistrationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('hostProjectRegistrationPath', () => { - const result = client.hostProjectRegistrationPath("projectValue", "locationValue", "hostProjectRegistrationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.hostProjectRegistrationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromHostProjectRegistrationName', () => { - const result = client.matchProjectFromHostProjectRegistrationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.hostProjectRegistrationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromHostProjectRegistrationName', () => { - const result = client.matchLocationFromHostProjectRegistrationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.hostProjectRegistrationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchHostProjectRegistrationFromHostProjectRegistrationName', () => { - const result = client.matchHostProjectRegistrationFromHostProjectRegistrationName(fakePath); - assert.strictEqual(result, "hostProjectRegistrationValue"); - assert((client.pathTemplates.hostProjectRegistrationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('location', () => { - const fakePath = "/rendered/path/location"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - }; - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.locationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.locationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('locationPath', () => { - const result = client.locationPath("projectValue", "locationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.locationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromLocationName', () => { - const result = client.matchProjectFromLocationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromLocationName', () => { - const result = client.matchLocationFromLocationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('plugin', () => { - const fakePath = "/rendered/path/plugin"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - plugin: "pluginValue", - }; - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.pluginPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.pluginPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('pluginPath', () => { - const result = client.pluginPath("projectValue", "locationValue", "pluginValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.pluginPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromPluginName', () => { - const result = client.matchProjectFromPluginName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.pluginPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromPluginName', () => { - const result = client.matchLocationFromPluginName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.pluginPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchPluginFromPluginName', () => { - const result = client.matchPluginFromPluginName(fakePath); - assert.strictEqual(result, "pluginValue"); - assert((client.pathTemplates.pluginPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('project', () => { - const fakePath = "/rendered/path/project"; - const expectedParameters = { - project: "projectValue", - }; - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.projectPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectPath', () => { - const result = client.projectPath("projectValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectName', () => { - const result = client.matchProjectFromProjectName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('runtimeProjectAttachment', () => { - const fakePath = "/rendered/path/runtimeProjectAttachment"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - runtime_project_attachment: "runtimeProjectAttachmentValue", - }; - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.runtimeProjectAttachmentPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.runtimeProjectAttachmentPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('runtimeProjectAttachmentPath', () => { - const result = client.runtimeProjectAttachmentPath("projectValue", "locationValue", "runtimeProjectAttachmentValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromRuntimeProjectAttachmentName', () => { - const result = client.matchProjectFromRuntimeProjectAttachmentName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromRuntimeProjectAttachmentName', () => { - const result = client.matchLocationFromRuntimeProjectAttachmentName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName', () => { - const result = client.matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName(fakePath); - assert.strictEqual(result, "runtimeProjectAttachmentValue"); - assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('spec', () => { - const fakePath = "/rendered/path/spec"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - api: "apiValue", - version: "versionValue", - spec: "specValue", - }; - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.specPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.specPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('specPath', () => { - const result = client.specPath("projectValue", "locationValue", "apiValue", "versionValue", "specValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.specPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSpecName', () => { - const result = client.matchProjectFromSpecName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.specPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSpecName', () => { - const result = client.matchLocationFromSpecName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.specPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchApiFromSpecName', () => { - const result = client.matchApiFromSpecName(fakePath); - assert.strictEqual(result, "apiValue"); - assert((client.pathTemplates.specPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchVersionFromSpecName', () => { - const result = client.matchVersionFromSpecName(fakePath); - assert.strictEqual(result, "versionValue"); - assert((client.pathTemplates.specPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSpecFromSpecName', () => { - const result = client.matchSpecFromSpecName(fakePath); - assert.strictEqual(result, "specValue"); - assert((client.pathTemplates.specPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('styleGuide', () => { - const fakePath = "/rendered/path/styleGuide"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - plugin: "pluginValue", - }; - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.styleGuidePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.styleGuidePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('styleGuidePath', () => { - const result = client.styleGuidePath("projectValue", "locationValue", "pluginValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.styleGuidePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromStyleGuideName', () => { - const result = client.matchProjectFromStyleGuideName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.styleGuidePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromStyleGuideName', () => { - const result = client.matchLocationFromStyleGuideName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.styleGuidePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchPluginFromStyleGuideName', () => { - const result = client.matchPluginFromStyleGuideName(fakePath); - assert.strictEqual(result, "pluginValue"); - assert((client.pathTemplates.styleGuidePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('version', () => { - const fakePath = "/rendered/path/version"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - api: "apiValue", - version: "versionValue", - }; - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.versionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.versionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('versionPath', () => { - const result = client.versionPath("projectValue", "locationValue", "apiValue", "versionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.versionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromVersionName', () => { - const result = client.matchProjectFromVersionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.versionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromVersionName', () => { - const result = client.matchLocationFromVersionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.versionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchApiFromVersionName', () => { - const result = client.matchApiFromVersionName(fakePath); - assert.strictEqual(result, "apiValue"); - assert((client.pathTemplates.versionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchVersionFromVersionName', () => { - const result = client.matchVersionFromVersionName(fakePath); - assert.strictEqual(result, "versionValue"); - assert((client.pathTemplates.versionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/google-cloud-apihub/v1/.eslintignore b/packages/google-cloud-apihub/.eslintignore similarity index 68% rename from owl-bot-staging/google-cloud-apihub/v1/.eslintignore rename to packages/google-cloud-apihub/.eslintignore index cfc348ec4d1..ea5b04aebe6 100644 --- a/owl-bot-staging/google-cloud-apihub/v1/.eslintignore +++ b/packages/google-cloud-apihub/.eslintignore @@ -1,7 +1,7 @@ **/node_modules -**/.coverage +**/coverage +test/fixtures build/ docs/ protos/ -system-test/ samples/generated/ diff --git a/owl-bot-staging/google-cloud-apihub/v1/.eslintrc.json b/packages/google-cloud-apihub/.eslintrc.json similarity index 100% rename from owl-bot-staging/google-cloud-apihub/v1/.eslintrc.json rename to packages/google-cloud-apihub/.eslintrc.json diff --git a/packages/google-cloud-apihub/.gitattributes b/packages/google-cloud-apihub/.gitattributes new file mode 100644 index 00000000000..33739cb74e4 --- /dev/null +++ b/packages/google-cloud-apihub/.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/owl-bot-staging/google-cloud-apihub/v1/.gitignore b/packages/google-cloud-apihub/.gitignore similarity index 100% rename from owl-bot-staging/google-cloud-apihub/v1/.gitignore rename to packages/google-cloud-apihub/.gitignore diff --git a/owl-bot-staging/google-cloud-apihub/v1/.jsdoc.js b/packages/google-cloud-apihub/.jsdoc.js similarity index 100% rename from owl-bot-staging/google-cloud-apihub/v1/.jsdoc.js rename to packages/google-cloud-apihub/.jsdoc.js diff --git a/owl-bot-staging/google-cloud-apihub/v1/.mocharc.js b/packages/google-cloud-apihub/.mocharc.js similarity index 77% rename from owl-bot-staging/google-cloud-apihub/v1/.mocharc.js rename to packages/google-cloud-apihub/.mocharc.js index 13b67c34edc..7e843ab5a75 100644 --- a/owl-bot-staging/google-cloud-apihub/v1/.mocharc.js +++ b/packages/google-cloud-apihub/.mocharc.js @@ -4,22 +4,18 @@ // 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 +// http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - const config = { "enable-source-maps": true, "throw-deprecation": true, - "timeout": 10000 + "timeout": 10000, + "recursive": true } if (process.env.MOCHA_THROW_DEPRECATION === 'false') { delete config['throw-deprecation']; diff --git a/packages/google-cloud-apihub/.nycrc b/packages/google-cloud-apihub/.nycrc new file mode 100644 index 00000000000..b18d5472b62 --- /dev/null +++ b/packages/google-cloud-apihub/.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-apihub/.prettierignore b/packages/google-cloud-apihub/.prettierignore new file mode 100644 index 00000000000..9340ad9b86d --- /dev/null +++ b/packages/google-cloud-apihub/.prettierignore @@ -0,0 +1,6 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ diff --git a/owl-bot-staging/google-cloud-apihub/v1/.prettierrc.js b/packages/google-cloud-apihub/.prettierrc.js similarity index 70% rename from owl-bot-staging/google-cloud-apihub/v1/.prettierrc.js rename to packages/google-cloud-apihub/.prettierrc.js index 9a8fd690982..120c6aa3e6e 100644 --- a/owl-bot-staging/google-cloud-apihub/v1/.prettierrc.js +++ b/packages/google-cloud-apihub/.prettierrc.js @@ -4,18 +4,13 @@ // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// https://www.apache.org/licenses/LICENSE-2.0 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - module.exports = { ...require('gts/.prettierrc.json') diff --git a/packages/google-cloud-apihub/CODE_OF_CONDUCT.md b/packages/google-cloud-apihub/CODE_OF_CONDUCT.md new file mode 100644 index 00000000000..2add2547a81 --- /dev/null +++ b/packages/google-cloud-apihub/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-apihub/CONTRIBUTING.md b/packages/google-cloud-apihub/CONTRIBUTING.md new file mode 100644 index 00000000000..a96529eed8d --- /dev/null +++ b/packages/google-cloud-apihub/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 API hub 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=apihub.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/packages/google-cloud-apihub/README.md b/packages/google-cloud-apihub/README.md new file mode 100644 index 00000000000..03e179643c0 --- /dev/null +++ b/packages/google-cloud-apihub/README.md @@ -0,0 +1,299 @@ +[//]: # "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 + +# [API hub API: Node.js Client](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-apihub) + +[![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/apihub.svg)](https://www.npmjs.org/package/@google-cloud/apihub) + + + + +API hub 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-apihub/CHANGELOG.md). + +* [API hub API Node.js Client API Reference][client-docs] +* [API hub API Documentation][product-docs] +* [github.com/googleapis/google-cloud-node/packages/google-cloud-apihub](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-apihub) + +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 API hub 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/apihub +``` + + +### 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. The parent, which owns this collection of deployment resources. + * Format: `projects/{project}/locations/{location}` + */ +// const parent = 'abc123' +/** + * Optional. An expression that filters the list of Deployments. + * A filter expression consists of a field name, a comparison + * operator, and a value for filtering. The value must be a string. The + * comparison operator must be one of: `<`, `>` or + * `=`. Filters are not case sensitive. + * The following fields in the `Deployments` are eligible for filtering: + * * `display_name` - The display name of the Deployment. Allowed + * comparison operators: `=`. + * * `create_time` - The time at which the Deployment was created. The + * value should be in the (RFC3339)https://tools.ietf.org/html/rfc3339 + * format. Allowed comparison operators: `>` and `<`. + * * `resource_uri` - A URI to the deployment resource. Allowed + * comparison operators: `=`. + * * `api_versions` - The API versions linked to this deployment. Allowed + * comparison operators: `:`. + * * `deployment_type.enum_values.values.id` - The allowed value id of the + * deployment_type attribute associated with the Deployment. Allowed + * comparison operators: `:`. + * * `deployment_type.enum_values.values.display_name` - The allowed value + * display name of the deployment_type attribute associated with the + * Deployment. Allowed comparison operators: `:`. + * * `slo.string_values.values` -The allowed string value of the slo + * attribute associated with the deployment. Allowed comparison + * operators: `:`. + * * `environment.enum_values.values.id` - The allowed value id of the + * environment attribute associated with the deployment. Allowed + * comparison operators: `:`. + * * `environment.enum_values.values.display_name` - The allowed value + * display name of the environment attribute associated with the deployment. + * Allowed comparison operators: `:`. + * Expressions are combined with either `AND` logic operator or `OR` logical + * operator but not both of them together i.e. only one of the `AND` or `OR` + * operator can be used throughout the filter string and both the operators + * cannot be used together. No other logical operators are supported. At most + * three filter fields are allowed in the filter string and if provided + * more than that then `INVALID_ARGUMENT` error is returned by the API. + * Here are a few examples: + * * `environment.enum_values.values.id: staging-id` - The allowed value id + * of the environment attribute associated with the Deployment is + * _staging-id_. + * * `environment.enum_values.values.display_name: \"Staging Deployment\"` - + * The allowed value display name of the environment attribute associated + * with the Deployment is `Staging Deployment`. + * * `environment.enum_values.values.id: production-id AND create_time < + * \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - + * The allowed value id of the environment attribute associated with the + * Deployment is _production-id_ and Deployment was created before + * _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_. + * * `environment.enum_values.values.id: production-id OR + * slo.string_values.values: \"99.99%\"` + * - The allowed value id of the environment attribute Deployment is + * _production-id_ or string value of the slo attribute is _99.99%_. + */ +// const filter = 'abc123' +/** + * Optional. The maximum number of deployment resources to return. The service + * may return fewer than this value. If unspecified, at most 50 deployments + * will be returned. The maximum value is 1000; values above 1000 will be + * coerced to 1000. + */ +// const pageSize = 1234 +/** + * Optional. A page token, received from a previous `ListDeployments` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters (except page_size) provided to + * `ListDeployments` must match the call that provided the page token. + */ +// const pageToken = 'abc123' + +// Imports the Apihub library +const {ApiHubClient} = require('@google-cloud/apihub').v1; + +// Instantiates a client +const apihubClient = new ApiHubClient(); + +async function callListDeployments() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = apihubClient.listDeploymentsAsync(request); + for await (const response of iterable) { + console.log(response); + } +} + +callListDeployments(); + +``` + + + +## Samples + +Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-apihub/samples) directory. Each sample's `README.md` has instructions for running its sample. + +| Sample | Source Code | Try it | +| --------------------------- | --------------------------------- | ------ | +| Api_hub.create_api | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/api_hub.create_api.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-apihub/samples/generated/v1/api_hub.create_api.js,packages/google-cloud-apihub/samples/README.md) | +| Api_hub.create_attribute | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/api_hub.create_attribute.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-apihub/samples/generated/v1/api_hub.create_attribute.js,packages/google-cloud-apihub/samples/README.md) | +| Api_hub.create_deployment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/api_hub.create_deployment.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-apihub/samples/generated/v1/api_hub.create_deployment.js,packages/google-cloud-apihub/samples/README.md) | +| Api_hub.create_external_api | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/api_hub.create_external_api.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-apihub/samples/generated/v1/api_hub.create_external_api.js,packages/google-cloud-apihub/samples/README.md) | +| Api_hub.create_spec | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/api_hub.create_spec.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-apihub/samples/generated/v1/api_hub.create_spec.js,packages/google-cloud-apihub/samples/README.md) | +| Api_hub.create_version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/api_hub.create_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-apihub/samples/generated/v1/api_hub.create_version.js,packages/google-cloud-apihub/samples/README.md) | +| Api_hub.delete_api | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/api_hub.delete_api.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-apihub/samples/generated/v1/api_hub.delete_api.js,packages/google-cloud-apihub/samples/README.md) | +| Api_hub.delete_attribute | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/api_hub.delete_attribute.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-apihub/samples/generated/v1/api_hub.delete_attribute.js,packages/google-cloud-apihub/samples/README.md) | +| Api_hub.delete_deployment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/api_hub.delete_deployment.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-apihub/samples/generated/v1/api_hub.delete_deployment.js,packages/google-cloud-apihub/samples/README.md) | +| Api_hub.delete_external_api | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/api_hub.delete_external_api.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-apihub/samples/generated/v1/api_hub.delete_external_api.js,packages/google-cloud-apihub/samples/README.md) | +| Api_hub.delete_spec | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/api_hub.delete_spec.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-apihub/samples/generated/v1/api_hub.delete_spec.js,packages/google-cloud-apihub/samples/README.md) | +| Api_hub.delete_version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/api_hub.delete_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-apihub/samples/generated/v1/api_hub.delete_version.js,packages/google-cloud-apihub/samples/README.md) | +| Api_hub.get_api | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/api_hub.get_api.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-apihub/samples/generated/v1/api_hub.get_api.js,packages/google-cloud-apihub/samples/README.md) | +| Api_hub.get_api_operation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/api_hub.get_api_operation.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-apihub/samples/generated/v1/api_hub.get_api_operation.js,packages/google-cloud-apihub/samples/README.md) | +| Api_hub.get_attribute | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/api_hub.get_attribute.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-apihub/samples/generated/v1/api_hub.get_attribute.js,packages/google-cloud-apihub/samples/README.md) | +| Api_hub.get_definition | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/api_hub.get_definition.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-apihub/samples/generated/v1/api_hub.get_definition.js,packages/google-cloud-apihub/samples/README.md) | +| Api_hub.get_deployment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/api_hub.get_deployment.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-apihub/samples/generated/v1/api_hub.get_deployment.js,packages/google-cloud-apihub/samples/README.md) | +| Api_hub.get_external_api | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/api_hub.get_external_api.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-apihub/samples/generated/v1/api_hub.get_external_api.js,packages/google-cloud-apihub/samples/README.md) | +| Api_hub.get_spec | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/api_hub.get_spec.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-apihub/samples/generated/v1/api_hub.get_spec.js,packages/google-cloud-apihub/samples/README.md) | +| Api_hub.get_spec_contents | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/api_hub.get_spec_contents.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-apihub/samples/generated/v1/api_hub.get_spec_contents.js,packages/google-cloud-apihub/samples/README.md) | +| Api_hub.get_version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/api_hub.get_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-apihub/samples/generated/v1/api_hub.get_version.js,packages/google-cloud-apihub/samples/README.md) | +| Api_hub.list_api_operations | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/api_hub.list_api_operations.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-apihub/samples/generated/v1/api_hub.list_api_operations.js,packages/google-cloud-apihub/samples/README.md) | +| Api_hub.list_apis | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/api_hub.list_apis.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-apihub/samples/generated/v1/api_hub.list_apis.js,packages/google-cloud-apihub/samples/README.md) | +| Api_hub.list_attributes | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/api_hub.list_attributes.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-apihub/samples/generated/v1/api_hub.list_attributes.js,packages/google-cloud-apihub/samples/README.md) | +| Api_hub.list_deployments | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/api_hub.list_deployments.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-apihub/samples/generated/v1/api_hub.list_deployments.js,packages/google-cloud-apihub/samples/README.md) | +| Api_hub.list_external_apis | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/api_hub.list_external_apis.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-apihub/samples/generated/v1/api_hub.list_external_apis.js,packages/google-cloud-apihub/samples/README.md) | +| Api_hub.list_specs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/api_hub.list_specs.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-apihub/samples/generated/v1/api_hub.list_specs.js,packages/google-cloud-apihub/samples/README.md) | +| Api_hub.list_versions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/api_hub.list_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-apihub/samples/generated/v1/api_hub.list_versions.js,packages/google-cloud-apihub/samples/README.md) | +| Api_hub.search_resources | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/api_hub.search_resources.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-apihub/samples/generated/v1/api_hub.search_resources.js,packages/google-cloud-apihub/samples/README.md) | +| Api_hub.update_api | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/api_hub.update_api.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-apihub/samples/generated/v1/api_hub.update_api.js,packages/google-cloud-apihub/samples/README.md) | +| Api_hub.update_attribute | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/api_hub.update_attribute.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-apihub/samples/generated/v1/api_hub.update_attribute.js,packages/google-cloud-apihub/samples/README.md) | +| Api_hub.update_deployment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/api_hub.update_deployment.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-apihub/samples/generated/v1/api_hub.update_deployment.js,packages/google-cloud-apihub/samples/README.md) | +| Api_hub.update_external_api | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/api_hub.update_external_api.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-apihub/samples/generated/v1/api_hub.update_external_api.js,packages/google-cloud-apihub/samples/README.md) | +| Api_hub.update_spec | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/api_hub.update_spec.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-apihub/samples/generated/v1/api_hub.update_spec.js,packages/google-cloud-apihub/samples/README.md) | +| Api_hub.update_version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/api_hub.update_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-apihub/samples/generated/v1/api_hub.update_version.js,packages/google-cloud-apihub/samples/README.md) | +| Api_hub_dependencies.create_dependency | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/api_hub_dependencies.create_dependency.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-apihub/samples/generated/v1/api_hub_dependencies.create_dependency.js,packages/google-cloud-apihub/samples/README.md) | +| Api_hub_dependencies.delete_dependency | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/api_hub_dependencies.delete_dependency.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-apihub/samples/generated/v1/api_hub_dependencies.delete_dependency.js,packages/google-cloud-apihub/samples/README.md) | +| Api_hub_dependencies.get_dependency | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/api_hub_dependencies.get_dependency.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-apihub/samples/generated/v1/api_hub_dependencies.get_dependency.js,packages/google-cloud-apihub/samples/README.md) | +| Api_hub_dependencies.list_dependencies | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/api_hub_dependencies.list_dependencies.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-apihub/samples/generated/v1/api_hub_dependencies.list_dependencies.js,packages/google-cloud-apihub/samples/README.md) | +| Api_hub_dependencies.update_dependency | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/api_hub_dependencies.update_dependency.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-apihub/samples/generated/v1/api_hub_dependencies.update_dependency.js,packages/google-cloud-apihub/samples/README.md) | +| Api_hub_plugin.disable_plugin | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/api_hub_plugin.disable_plugin.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-apihub/samples/generated/v1/api_hub_plugin.disable_plugin.js,packages/google-cloud-apihub/samples/README.md) | +| Api_hub_plugin.enable_plugin | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/api_hub_plugin.enable_plugin.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-apihub/samples/generated/v1/api_hub_plugin.enable_plugin.js,packages/google-cloud-apihub/samples/README.md) | +| Api_hub_plugin.get_plugin | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/api_hub_plugin.get_plugin.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-apihub/samples/generated/v1/api_hub_plugin.get_plugin.js,packages/google-cloud-apihub/samples/README.md) | +| Host_project_registration_service.create_host_project_registration | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/host_project_registration_service.create_host_project_registration.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-apihub/samples/generated/v1/host_project_registration_service.create_host_project_registration.js,packages/google-cloud-apihub/samples/README.md) | +| Host_project_registration_service.get_host_project_registration | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/host_project_registration_service.get_host_project_registration.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-apihub/samples/generated/v1/host_project_registration_service.get_host_project_registration.js,packages/google-cloud-apihub/samples/README.md) | +| Host_project_registration_service.list_host_project_registrations | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/host_project_registration_service.list_host_project_registrations.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-apihub/samples/generated/v1/host_project_registration_service.list_host_project_registrations.js,packages/google-cloud-apihub/samples/README.md) | +| Linting_service.get_style_guide | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/linting_service.get_style_guide.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-apihub/samples/generated/v1/linting_service.get_style_guide.js,packages/google-cloud-apihub/samples/README.md) | +| Linting_service.get_style_guide_contents | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/linting_service.get_style_guide_contents.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-apihub/samples/generated/v1/linting_service.get_style_guide_contents.js,packages/google-cloud-apihub/samples/README.md) | +| Linting_service.lint_spec | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/linting_service.lint_spec.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-apihub/samples/generated/v1/linting_service.lint_spec.js,packages/google-cloud-apihub/samples/README.md) | +| Linting_service.update_style_guide | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/linting_service.update_style_guide.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-apihub/samples/generated/v1/linting_service.update_style_guide.js,packages/google-cloud-apihub/samples/README.md) | +| Provisioning.create_api_hub_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/provisioning.create_api_hub_instance.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-apihub/samples/generated/v1/provisioning.create_api_hub_instance.js,packages/google-cloud-apihub/samples/README.md) | +| Provisioning.get_api_hub_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/provisioning.get_api_hub_instance.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-apihub/samples/generated/v1/provisioning.get_api_hub_instance.js,packages/google-cloud-apihub/samples/README.md) | +| Provisioning.lookup_api_hub_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/provisioning.lookup_api_hub_instance.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-apihub/samples/generated/v1/provisioning.lookup_api_hub_instance.js,packages/google-cloud-apihub/samples/README.md) | +| Runtime_project_attachment_service.create_runtime_project_attachment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/runtime_project_attachment_service.create_runtime_project_attachment.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-apihub/samples/generated/v1/runtime_project_attachment_service.create_runtime_project_attachment.js,packages/google-cloud-apihub/samples/README.md) | +| Runtime_project_attachment_service.delete_runtime_project_attachment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/runtime_project_attachment_service.delete_runtime_project_attachment.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-apihub/samples/generated/v1/runtime_project_attachment_service.delete_runtime_project_attachment.js,packages/google-cloud-apihub/samples/README.md) | +| Runtime_project_attachment_service.get_runtime_project_attachment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/runtime_project_attachment_service.get_runtime_project_attachment.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-apihub/samples/generated/v1/runtime_project_attachment_service.get_runtime_project_attachment.js,packages/google-cloud-apihub/samples/README.md) | +| Runtime_project_attachment_service.list_runtime_project_attachments | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/runtime_project_attachment_service.list_runtime_project_attachments.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-apihub/samples/generated/v1/runtime_project_attachment_service.list_runtime_project_attachments.js,packages/google-cloud-apihub/samples/README.md) | +| Runtime_project_attachment_service.lookup_runtime_project_attachment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/runtime_project_attachment_service.lookup_runtime_project_attachment.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-apihub/samples/generated/v1/runtime_project_attachment_service.lookup_runtime_project_attachment.js,packages/google-cloud-apihub/samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/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-apihub/samples/quickstart.js,packages/google-cloud-apihub/samples/README.md) | + + + +The [API hub 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/apihub@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/apihub/latest +[product-docs]: https://cloud.google.com/apigee/docs/apihub/what-is-api-hub +[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=apihub.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started diff --git a/owl-bot-staging/google-cloud-apihub/v1/protos/google/cloud/apihub/v1/apihub_service.proto b/packages/google-cloud-apihub/protos/google/cloud/apihub/v1/apihub_service.proto similarity index 100% rename from owl-bot-staging/google-cloud-apihub/v1/protos/google/cloud/apihub/v1/apihub_service.proto rename to packages/google-cloud-apihub/protos/google/cloud/apihub/v1/apihub_service.proto diff --git a/owl-bot-staging/google-cloud-apihub/v1/protos/google/cloud/apihub/v1/common_fields.proto b/packages/google-cloud-apihub/protos/google/cloud/apihub/v1/common_fields.proto similarity index 100% rename from owl-bot-staging/google-cloud-apihub/v1/protos/google/cloud/apihub/v1/common_fields.proto rename to packages/google-cloud-apihub/protos/google/cloud/apihub/v1/common_fields.proto diff --git a/owl-bot-staging/google-cloud-apihub/v1/protos/google/cloud/apihub/v1/host_project_registration_service.proto b/packages/google-cloud-apihub/protos/google/cloud/apihub/v1/host_project_registration_service.proto similarity index 100% rename from owl-bot-staging/google-cloud-apihub/v1/protos/google/cloud/apihub/v1/host_project_registration_service.proto rename to packages/google-cloud-apihub/protos/google/cloud/apihub/v1/host_project_registration_service.proto diff --git a/owl-bot-staging/google-cloud-apihub/v1/protos/google/cloud/apihub/v1/linting_service.proto b/packages/google-cloud-apihub/protos/google/cloud/apihub/v1/linting_service.proto similarity index 100% rename from owl-bot-staging/google-cloud-apihub/v1/protos/google/cloud/apihub/v1/linting_service.proto rename to packages/google-cloud-apihub/protos/google/cloud/apihub/v1/linting_service.proto diff --git a/owl-bot-staging/google-cloud-apihub/v1/protos/google/cloud/apihub/v1/plugin_service.proto b/packages/google-cloud-apihub/protos/google/cloud/apihub/v1/plugin_service.proto similarity index 100% rename from owl-bot-staging/google-cloud-apihub/v1/protos/google/cloud/apihub/v1/plugin_service.proto rename to packages/google-cloud-apihub/protos/google/cloud/apihub/v1/plugin_service.proto diff --git a/owl-bot-staging/google-cloud-apihub/v1/protos/google/cloud/apihub/v1/provisioning_service.proto b/packages/google-cloud-apihub/protos/google/cloud/apihub/v1/provisioning_service.proto similarity index 100% rename from owl-bot-staging/google-cloud-apihub/v1/protos/google/cloud/apihub/v1/provisioning_service.proto rename to packages/google-cloud-apihub/protos/google/cloud/apihub/v1/provisioning_service.proto diff --git a/owl-bot-staging/google-cloud-apihub/v1/protos/google/cloud/apihub/v1/runtime_project_attachment_service.proto b/packages/google-cloud-apihub/protos/google/cloud/apihub/v1/runtime_project_attachment_service.proto similarity index 100% rename from owl-bot-staging/google-cloud-apihub/v1/protos/google/cloud/apihub/v1/runtime_project_attachment_service.proto rename to packages/google-cloud-apihub/protos/google/cloud/apihub/v1/runtime_project_attachment_service.proto diff --git a/owl-bot-staging/google-cloud-apihub/v1/protos/protos.d.ts b/packages/google-cloud-apihub/protos/protos.d.ts similarity index 99% rename from owl-bot-staging/google-cloud-apihub/v1/protos/protos.d.ts rename to packages/google-cloud-apihub/protos/protos.d.ts index 0ec6d0a3e62..84a774eb6ba 100644 --- a/owl-bot-staging/google-cloud-apihub/v1/protos/protos.d.ts +++ b/packages/google-cloud-apihub/protos/protos.d.ts @@ -14271,9 +14271,6 @@ export namespace google { /** Publishing protoReferenceDocumentationUri */ protoReferenceDocumentationUri?: (string|null); - - /** Publishing restReferenceDocumentationUri */ - restReferenceDocumentationUri?: (string|null); } /** Represents a Publishing. */ @@ -14315,9 +14312,6 @@ export namespace google { /** Publishing protoReferenceDocumentationUri. */ public protoReferenceDocumentationUri: string; - /** Publishing restReferenceDocumentationUri. */ - public restReferenceDocumentationUri: string; - /** * Creates a new Publishing instance using the specified properties. * @param [properties] Properties to set @@ -18535,9 +18529,6 @@ export namespace google { /** ServiceOptions .google.api.oauthScopes */ ".google.api.oauthScopes"?: (string|null); - - /** ServiceOptions .google.api.apiVersion */ - ".google.api.apiVersion"?: (string|null); } /** Represents a ServiceOptions. */ diff --git a/owl-bot-staging/google-cloud-apihub/v1/protos/protos.js b/packages/google-cloud-apihub/protos/protos.js similarity index 99% rename from owl-bot-staging/google-cloud-apihub/v1/protos/protos.js rename to packages/google-cloud-apihub/protos/protos.js index dafb3c6f8b2..9036d3f2bc3 100644 --- a/owl-bot-staging/google-cloud-apihub/v1/protos/protos.js +++ b/packages/google-cloud-apihub/protos/protos.js @@ -33998,7 +33998,6 @@ * @property {google.api.ClientLibraryOrganization|null} [organization] Publishing organization * @property {Array.|null} [librarySettings] Publishing librarySettings * @property {string|null} [protoReferenceDocumentationUri] Publishing protoReferenceDocumentationUri - * @property {string|null} [restReferenceDocumentationUri] Publishing restReferenceDocumentationUri */ /** @@ -34099,14 +34098,6 @@ */ Publishing.prototype.protoReferenceDocumentationUri = ""; - /** - * Publishing restReferenceDocumentationUri. - * @member {string} restReferenceDocumentationUri - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.restReferenceDocumentationUri = ""; - /** * Creates a new Publishing instance using the specified properties. * @function create @@ -34154,8 +34145,6 @@ $root.google.api.ClientLibrarySettings.encode(message.librarySettings[i], writer.uint32(/* id 109, wireType 2 =*/874).fork()).ldelim(); if (message.protoReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "protoReferenceDocumentationUri")) writer.uint32(/* id 110, wireType 2 =*/882).string(message.protoReferenceDocumentationUri); - if (message.restReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "restReferenceDocumentationUri")) - writer.uint32(/* id 111, wireType 2 =*/890).string(message.restReferenceDocumentationUri); return writer; }; @@ -34236,10 +34225,6 @@ message.protoReferenceDocumentationUri = reader.string(); break; } - case 111: { - message.restReferenceDocumentationUri = reader.string(); - break; - } default: reader.skipType(tag & 7); break; @@ -34332,9 +34317,6 @@ if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) if (!$util.isString(message.protoReferenceDocumentationUri)) return "protoReferenceDocumentationUri: string expected"; - if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) - if (!$util.isString(message.restReferenceDocumentationUri)) - return "restReferenceDocumentationUri: string expected"; return null; }; @@ -34429,8 +34411,6 @@ } if (object.protoReferenceDocumentationUri != null) message.protoReferenceDocumentationUri = String(object.protoReferenceDocumentationUri); - if (object.restReferenceDocumentationUri != null) - message.restReferenceDocumentationUri = String(object.restReferenceDocumentationUri); return message; }; @@ -34460,7 +34440,6 @@ object.docTagPrefix = ""; object.organization = options.enums === String ? "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED" : 0; object.protoReferenceDocumentationUri = ""; - object.restReferenceDocumentationUri = ""; } if (message.methodSettings && message.methodSettings.length) { object.methodSettings = []; @@ -34491,8 +34470,6 @@ } if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) object.protoReferenceDocumentationUri = message.protoReferenceDocumentationUri; - if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) - object.restReferenceDocumentationUri = message.restReferenceDocumentationUri; return object; }; @@ -44216,9 +44193,12 @@ 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) + 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.uint32(/* id 1052, wireType 0 =*/8416).int32(message[".google.api.fieldBehavior"][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; @@ -46064,7 +46044,6 @@ * @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 - * @property {string|null} [".google.api.apiVersion"] ServiceOptions .google.api.apiVersion */ /** @@ -46123,14 +46102,6 @@ */ ServiceOptions.prototype[".google.api.oauthScopes"] = ""; - /** - * ServiceOptions .google.api.apiVersion. - * @member {string} .google.api.apiVersion - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype[".google.api.apiVersion"] = ""; - /** * Creates a new ServiceOptions instance using the specified properties. * @function create @@ -46166,8 +46137,6 @@ 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"]); - if (message[".google.api.apiVersion"] != null && Object.hasOwnProperty.call(message, ".google.api.apiVersion")) - writer.uint32(/* id 525000001, wireType 2 =*/4200000010).string(message[".google.api.apiVersion"]); return writer; }; @@ -46224,10 +46193,6 @@ message[".google.api.oauthScopes"] = reader.string(); break; } - case 525000001: { - message[".google.api.apiVersion"] = reader.string(); - break; - } default: reader.skipType(tag & 7); break; @@ -46286,9 +46251,6 @@ if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) if (!$util.isString(message[".google.api.oauthScopes"])) return ".google.api.oauthScopes: string expected"; - if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) - if (!$util.isString(message[".google.api.apiVersion"])) - return ".google.api.apiVersion: string expected"; return null; }; @@ -46325,8 +46287,6 @@ message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); if (object[".google.api.oauthScopes"] != null) message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); - if (object[".google.api.apiVersion"] != null) - message[".google.api.apiVersion"] = String(object[".google.api.apiVersion"]); return message; }; @@ -46350,7 +46310,6 @@ object.features = null; object[".google.api.defaultHost"] = ""; object[".google.api.oauthScopes"] = ""; - object[".google.api.apiVersion"] = ""; } if (message.deprecated != null && message.hasOwnProperty("deprecated")) object.deprecated = message.deprecated; @@ -46365,8 +46324,6 @@ 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"]; - if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) - object[".google.api.apiVersion"] = message[".google.api.apiVersion"]; return object; }; diff --git a/owl-bot-staging/google-cloud-apihub/v1/protos/protos.json b/packages/google-cloud-apihub/protos/protos.json similarity index 99% rename from owl-bot-staging/google-cloud-apihub/v1/protos/protos.json rename to packages/google-cloud-apihub/protos/protos.json index eb17125dfb0..464b7235307 100644 --- a/owl-bot-staging/google-cloud-apihub/v1/protos/protos.json +++ b/packages/google-cloud-apihub/protos/protos.json @@ -4344,11 +4344,6 @@ "id": 1050, "extend": "google.protobuf.ServiceOptions" }, - "apiVersion": { - "type": "string", - "id": 525000001, - "extend": "google.protobuf.ServiceOptions" - }, "CommonLanguageSettings": { "fields": { "referenceDocsUri": { @@ -4457,10 +4452,6 @@ "protoReferenceDocumentationUri": { "type": "string", "id": 110 - }, - "restReferenceDocumentationUri": { - "type": "string", - "id": 111 } } }, @@ -4636,10 +4627,7 @@ "rule": "repeated", "type": "google.api.FieldBehavior", "id": 1052, - "extend": "google.protobuf.FieldOptions", - "options": { - "packed": false - } + "extend": "google.protobuf.FieldOptions" }, "FieldBehavior": { "values": { @@ -5837,21 +5825,9 @@ 1001, 1001 ], - [ - 1002, - 1002 - ], - [ - 9990, - 9990 - ], [ 9995, 9999 - ], - [ - 10000, - 10000 ] ], "reserved": [ diff --git a/packages/google-cloud-apihub/samples/README.md b/packages/google-cloud-apihub/samples/README.md new file mode 100644 index 00000000000..ee3828c2d38 --- /dev/null +++ b/packages/google-cloud-apihub/samples/README.md @@ -0,0 +1,1094 @@ +[//]: # "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 + +# [API hub 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) + * [Api_hub.create_api](#api_hub.create_api) + * [Api_hub.create_attribute](#api_hub.create_attribute) + * [Api_hub.create_deployment](#api_hub.create_deployment) + * [Api_hub.create_external_api](#api_hub.create_external_api) + * [Api_hub.create_spec](#api_hub.create_spec) + * [Api_hub.create_version](#api_hub.create_version) + * [Api_hub.delete_api](#api_hub.delete_api) + * [Api_hub.delete_attribute](#api_hub.delete_attribute) + * [Api_hub.delete_deployment](#api_hub.delete_deployment) + * [Api_hub.delete_external_api](#api_hub.delete_external_api) + * [Api_hub.delete_spec](#api_hub.delete_spec) + * [Api_hub.delete_version](#api_hub.delete_version) + * [Api_hub.get_api](#api_hub.get_api) + * [Api_hub.get_api_operation](#api_hub.get_api_operation) + * [Api_hub.get_attribute](#api_hub.get_attribute) + * [Api_hub.get_definition](#api_hub.get_definition) + * [Api_hub.get_deployment](#api_hub.get_deployment) + * [Api_hub.get_external_api](#api_hub.get_external_api) + * [Api_hub.get_spec](#api_hub.get_spec) + * [Api_hub.get_spec_contents](#api_hub.get_spec_contents) + * [Api_hub.get_version](#api_hub.get_version) + * [Api_hub.list_api_operations](#api_hub.list_api_operations) + * [Api_hub.list_apis](#api_hub.list_apis) + * [Api_hub.list_attributes](#api_hub.list_attributes) + * [Api_hub.list_deployments](#api_hub.list_deployments) + * [Api_hub.list_external_apis](#api_hub.list_external_apis) + * [Api_hub.list_specs](#api_hub.list_specs) + * [Api_hub.list_versions](#api_hub.list_versions) + * [Api_hub.search_resources](#api_hub.search_resources) + * [Api_hub.update_api](#api_hub.update_api) + * [Api_hub.update_attribute](#api_hub.update_attribute) + * [Api_hub.update_deployment](#api_hub.update_deployment) + * [Api_hub.update_external_api](#api_hub.update_external_api) + * [Api_hub.update_spec](#api_hub.update_spec) + * [Api_hub.update_version](#api_hub.update_version) + * [Api_hub_dependencies.create_dependency](#api_hub_dependencies.create_dependency) + * [Api_hub_dependencies.delete_dependency](#api_hub_dependencies.delete_dependency) + * [Api_hub_dependencies.get_dependency](#api_hub_dependencies.get_dependency) + * [Api_hub_dependencies.list_dependencies](#api_hub_dependencies.list_dependencies) + * [Api_hub_dependencies.update_dependency](#api_hub_dependencies.update_dependency) + * [Api_hub_plugin.disable_plugin](#api_hub_plugin.disable_plugin) + * [Api_hub_plugin.enable_plugin](#api_hub_plugin.enable_plugin) + * [Api_hub_plugin.get_plugin](#api_hub_plugin.get_plugin) + * [Host_project_registration_service.create_host_project_registration](#host_project_registration_service.create_host_project_registration) + * [Host_project_registration_service.get_host_project_registration](#host_project_registration_service.get_host_project_registration) + * [Host_project_registration_service.list_host_project_registrations](#host_project_registration_service.list_host_project_registrations) + * [Linting_service.get_style_guide](#linting_service.get_style_guide) + * [Linting_service.get_style_guide_contents](#linting_service.get_style_guide_contents) + * [Linting_service.lint_spec](#linting_service.lint_spec) + * [Linting_service.update_style_guide](#linting_service.update_style_guide) + * [Provisioning.create_api_hub_instance](#provisioning.create_api_hub_instance) + * [Provisioning.get_api_hub_instance](#provisioning.get_api_hub_instance) + * [Provisioning.lookup_api_hub_instance](#provisioning.lookup_api_hub_instance) + * [Runtime_project_attachment_service.create_runtime_project_attachment](#runtime_project_attachment_service.create_runtime_project_attachment) + * [Runtime_project_attachment_service.delete_runtime_project_attachment](#runtime_project_attachment_service.delete_runtime_project_attachment) + * [Runtime_project_attachment_service.get_runtime_project_attachment](#runtime_project_attachment_service.get_runtime_project_attachment) + * [Runtime_project_attachment_service.list_runtime_project_attachments](#runtime_project_attachment_service.list_runtime_project_attachments) + * [Runtime_project_attachment_service.lookup_runtime_project_attachment](#runtime_project_attachment_service.lookup_runtime_project_attachment) + * [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 + + + +### Api_hub.create_api + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/api_hub.create_api.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-apihub/samples/generated/v1/api_hub.create_api.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apihub/samples/generated/v1/api_hub.create_api.js` + + +----- + + + + +### Api_hub.create_attribute + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/api_hub.create_attribute.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-apihub/samples/generated/v1/api_hub.create_attribute.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apihub/samples/generated/v1/api_hub.create_attribute.js` + + +----- + + + + +### Api_hub.create_deployment + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/api_hub.create_deployment.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-apihub/samples/generated/v1/api_hub.create_deployment.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apihub/samples/generated/v1/api_hub.create_deployment.js` + + +----- + + + + +### Api_hub.create_external_api + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/api_hub.create_external_api.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-apihub/samples/generated/v1/api_hub.create_external_api.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apihub/samples/generated/v1/api_hub.create_external_api.js` + + +----- + + + + +### Api_hub.create_spec + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/api_hub.create_spec.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-apihub/samples/generated/v1/api_hub.create_spec.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apihub/samples/generated/v1/api_hub.create_spec.js` + + +----- + + + + +### Api_hub.create_version + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/api_hub.create_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-apihub/samples/generated/v1/api_hub.create_version.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apihub/samples/generated/v1/api_hub.create_version.js` + + +----- + + + + +### Api_hub.delete_api + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/api_hub.delete_api.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-apihub/samples/generated/v1/api_hub.delete_api.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apihub/samples/generated/v1/api_hub.delete_api.js` + + +----- + + + + +### Api_hub.delete_attribute + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/api_hub.delete_attribute.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-apihub/samples/generated/v1/api_hub.delete_attribute.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apihub/samples/generated/v1/api_hub.delete_attribute.js` + + +----- + + + + +### Api_hub.delete_deployment + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/api_hub.delete_deployment.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-apihub/samples/generated/v1/api_hub.delete_deployment.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apihub/samples/generated/v1/api_hub.delete_deployment.js` + + +----- + + + + +### Api_hub.delete_external_api + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/api_hub.delete_external_api.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-apihub/samples/generated/v1/api_hub.delete_external_api.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apihub/samples/generated/v1/api_hub.delete_external_api.js` + + +----- + + + + +### Api_hub.delete_spec + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/api_hub.delete_spec.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-apihub/samples/generated/v1/api_hub.delete_spec.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apihub/samples/generated/v1/api_hub.delete_spec.js` + + +----- + + + + +### Api_hub.delete_version + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/api_hub.delete_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-apihub/samples/generated/v1/api_hub.delete_version.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apihub/samples/generated/v1/api_hub.delete_version.js` + + +----- + + + + +### Api_hub.get_api + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/api_hub.get_api.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-apihub/samples/generated/v1/api_hub.get_api.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apihub/samples/generated/v1/api_hub.get_api.js` + + +----- + + + + +### Api_hub.get_api_operation + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/api_hub.get_api_operation.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-apihub/samples/generated/v1/api_hub.get_api_operation.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apihub/samples/generated/v1/api_hub.get_api_operation.js` + + +----- + + + + +### Api_hub.get_attribute + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/api_hub.get_attribute.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-apihub/samples/generated/v1/api_hub.get_attribute.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apihub/samples/generated/v1/api_hub.get_attribute.js` + + +----- + + + + +### Api_hub.get_definition + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/api_hub.get_definition.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-apihub/samples/generated/v1/api_hub.get_definition.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apihub/samples/generated/v1/api_hub.get_definition.js` + + +----- + + + + +### Api_hub.get_deployment + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/api_hub.get_deployment.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-apihub/samples/generated/v1/api_hub.get_deployment.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apihub/samples/generated/v1/api_hub.get_deployment.js` + + +----- + + + + +### Api_hub.get_external_api + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/api_hub.get_external_api.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-apihub/samples/generated/v1/api_hub.get_external_api.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apihub/samples/generated/v1/api_hub.get_external_api.js` + + +----- + + + + +### Api_hub.get_spec + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/api_hub.get_spec.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-apihub/samples/generated/v1/api_hub.get_spec.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apihub/samples/generated/v1/api_hub.get_spec.js` + + +----- + + + + +### Api_hub.get_spec_contents + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/api_hub.get_spec_contents.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-apihub/samples/generated/v1/api_hub.get_spec_contents.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apihub/samples/generated/v1/api_hub.get_spec_contents.js` + + +----- + + + + +### Api_hub.get_version + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/api_hub.get_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-apihub/samples/generated/v1/api_hub.get_version.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apihub/samples/generated/v1/api_hub.get_version.js` + + +----- + + + + +### Api_hub.list_api_operations + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/api_hub.list_api_operations.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-apihub/samples/generated/v1/api_hub.list_api_operations.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apihub/samples/generated/v1/api_hub.list_api_operations.js` + + +----- + + + + +### Api_hub.list_apis + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/api_hub.list_apis.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-apihub/samples/generated/v1/api_hub.list_apis.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apihub/samples/generated/v1/api_hub.list_apis.js` + + +----- + + + + +### Api_hub.list_attributes + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/api_hub.list_attributes.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-apihub/samples/generated/v1/api_hub.list_attributes.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apihub/samples/generated/v1/api_hub.list_attributes.js` + + +----- + + + + +### Api_hub.list_deployments + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/api_hub.list_deployments.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-apihub/samples/generated/v1/api_hub.list_deployments.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apihub/samples/generated/v1/api_hub.list_deployments.js` + + +----- + + + + +### Api_hub.list_external_apis + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/api_hub.list_external_apis.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-apihub/samples/generated/v1/api_hub.list_external_apis.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apihub/samples/generated/v1/api_hub.list_external_apis.js` + + +----- + + + + +### Api_hub.list_specs + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/api_hub.list_specs.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-apihub/samples/generated/v1/api_hub.list_specs.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apihub/samples/generated/v1/api_hub.list_specs.js` + + +----- + + + + +### Api_hub.list_versions + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/api_hub.list_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-apihub/samples/generated/v1/api_hub.list_versions.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apihub/samples/generated/v1/api_hub.list_versions.js` + + +----- + + + + +### Api_hub.search_resources + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/api_hub.search_resources.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-apihub/samples/generated/v1/api_hub.search_resources.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apihub/samples/generated/v1/api_hub.search_resources.js` + + +----- + + + + +### Api_hub.update_api + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/api_hub.update_api.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-apihub/samples/generated/v1/api_hub.update_api.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apihub/samples/generated/v1/api_hub.update_api.js` + + +----- + + + + +### Api_hub.update_attribute + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/api_hub.update_attribute.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-apihub/samples/generated/v1/api_hub.update_attribute.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apihub/samples/generated/v1/api_hub.update_attribute.js` + + +----- + + + + +### Api_hub.update_deployment + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/api_hub.update_deployment.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-apihub/samples/generated/v1/api_hub.update_deployment.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apihub/samples/generated/v1/api_hub.update_deployment.js` + + +----- + + + + +### Api_hub.update_external_api + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/api_hub.update_external_api.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-apihub/samples/generated/v1/api_hub.update_external_api.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apihub/samples/generated/v1/api_hub.update_external_api.js` + + +----- + + + + +### Api_hub.update_spec + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/api_hub.update_spec.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-apihub/samples/generated/v1/api_hub.update_spec.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apihub/samples/generated/v1/api_hub.update_spec.js` + + +----- + + + + +### Api_hub.update_version + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/api_hub.update_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-apihub/samples/generated/v1/api_hub.update_version.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apihub/samples/generated/v1/api_hub.update_version.js` + + +----- + + + + +### Api_hub_dependencies.create_dependency + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/api_hub_dependencies.create_dependency.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-apihub/samples/generated/v1/api_hub_dependencies.create_dependency.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apihub/samples/generated/v1/api_hub_dependencies.create_dependency.js` + + +----- + + + + +### Api_hub_dependencies.delete_dependency + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/api_hub_dependencies.delete_dependency.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-apihub/samples/generated/v1/api_hub_dependencies.delete_dependency.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apihub/samples/generated/v1/api_hub_dependencies.delete_dependency.js` + + +----- + + + + +### Api_hub_dependencies.get_dependency + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/api_hub_dependencies.get_dependency.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-apihub/samples/generated/v1/api_hub_dependencies.get_dependency.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apihub/samples/generated/v1/api_hub_dependencies.get_dependency.js` + + +----- + + + + +### Api_hub_dependencies.list_dependencies + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/api_hub_dependencies.list_dependencies.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-apihub/samples/generated/v1/api_hub_dependencies.list_dependencies.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apihub/samples/generated/v1/api_hub_dependencies.list_dependencies.js` + + +----- + + + + +### Api_hub_dependencies.update_dependency + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/api_hub_dependencies.update_dependency.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-apihub/samples/generated/v1/api_hub_dependencies.update_dependency.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apihub/samples/generated/v1/api_hub_dependencies.update_dependency.js` + + +----- + + + + +### Api_hub_plugin.disable_plugin + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/api_hub_plugin.disable_plugin.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-apihub/samples/generated/v1/api_hub_plugin.disable_plugin.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apihub/samples/generated/v1/api_hub_plugin.disable_plugin.js` + + +----- + + + + +### Api_hub_plugin.enable_plugin + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/api_hub_plugin.enable_plugin.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-apihub/samples/generated/v1/api_hub_plugin.enable_plugin.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apihub/samples/generated/v1/api_hub_plugin.enable_plugin.js` + + +----- + + + + +### Api_hub_plugin.get_plugin + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/api_hub_plugin.get_plugin.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-apihub/samples/generated/v1/api_hub_plugin.get_plugin.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apihub/samples/generated/v1/api_hub_plugin.get_plugin.js` + + +----- + + + + +### Host_project_registration_service.create_host_project_registration + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/host_project_registration_service.create_host_project_registration.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-apihub/samples/generated/v1/host_project_registration_service.create_host_project_registration.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apihub/samples/generated/v1/host_project_registration_service.create_host_project_registration.js` + + +----- + + + + +### Host_project_registration_service.get_host_project_registration + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/host_project_registration_service.get_host_project_registration.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-apihub/samples/generated/v1/host_project_registration_service.get_host_project_registration.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apihub/samples/generated/v1/host_project_registration_service.get_host_project_registration.js` + + +----- + + + + +### Host_project_registration_service.list_host_project_registrations + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/host_project_registration_service.list_host_project_registrations.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-apihub/samples/generated/v1/host_project_registration_service.list_host_project_registrations.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apihub/samples/generated/v1/host_project_registration_service.list_host_project_registrations.js` + + +----- + + + + +### Linting_service.get_style_guide + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/linting_service.get_style_guide.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-apihub/samples/generated/v1/linting_service.get_style_guide.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apihub/samples/generated/v1/linting_service.get_style_guide.js` + + +----- + + + + +### Linting_service.get_style_guide_contents + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/linting_service.get_style_guide_contents.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-apihub/samples/generated/v1/linting_service.get_style_guide_contents.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apihub/samples/generated/v1/linting_service.get_style_guide_contents.js` + + +----- + + + + +### Linting_service.lint_spec + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/linting_service.lint_spec.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-apihub/samples/generated/v1/linting_service.lint_spec.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apihub/samples/generated/v1/linting_service.lint_spec.js` + + +----- + + + + +### Linting_service.update_style_guide + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/linting_service.update_style_guide.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-apihub/samples/generated/v1/linting_service.update_style_guide.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apihub/samples/generated/v1/linting_service.update_style_guide.js` + + +----- + + + + +### Provisioning.create_api_hub_instance + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/provisioning.create_api_hub_instance.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-apihub/samples/generated/v1/provisioning.create_api_hub_instance.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apihub/samples/generated/v1/provisioning.create_api_hub_instance.js` + + +----- + + + + +### Provisioning.get_api_hub_instance + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/provisioning.get_api_hub_instance.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-apihub/samples/generated/v1/provisioning.get_api_hub_instance.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apihub/samples/generated/v1/provisioning.get_api_hub_instance.js` + + +----- + + + + +### Provisioning.lookup_api_hub_instance + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/provisioning.lookup_api_hub_instance.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-apihub/samples/generated/v1/provisioning.lookup_api_hub_instance.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apihub/samples/generated/v1/provisioning.lookup_api_hub_instance.js` + + +----- + + + + +### Runtime_project_attachment_service.create_runtime_project_attachment + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/runtime_project_attachment_service.create_runtime_project_attachment.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-apihub/samples/generated/v1/runtime_project_attachment_service.create_runtime_project_attachment.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apihub/samples/generated/v1/runtime_project_attachment_service.create_runtime_project_attachment.js` + + +----- + + + + +### Runtime_project_attachment_service.delete_runtime_project_attachment + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/runtime_project_attachment_service.delete_runtime_project_attachment.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-apihub/samples/generated/v1/runtime_project_attachment_service.delete_runtime_project_attachment.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apihub/samples/generated/v1/runtime_project_attachment_service.delete_runtime_project_attachment.js` + + +----- + + + + +### Runtime_project_attachment_service.get_runtime_project_attachment + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/runtime_project_attachment_service.get_runtime_project_attachment.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-apihub/samples/generated/v1/runtime_project_attachment_service.get_runtime_project_attachment.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apihub/samples/generated/v1/runtime_project_attachment_service.get_runtime_project_attachment.js` + + +----- + + + + +### Runtime_project_attachment_service.list_runtime_project_attachments + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/runtime_project_attachment_service.list_runtime_project_attachments.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-apihub/samples/generated/v1/runtime_project_attachment_service.list_runtime_project_attachments.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apihub/samples/generated/v1/runtime_project_attachment_service.list_runtime_project_attachments.js` + + +----- + + + + +### Runtime_project_attachment_service.lookup_runtime_project_attachment + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/samples/generated/v1/runtime_project_attachment_service.lookup_runtime_project_attachment.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-apihub/samples/generated/v1/runtime_project_attachment_service.lookup_runtime_project_attachment.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apihub/samples/generated/v1/runtime_project_attachment_service.lookup_runtime_project_attachment.js` + + +----- + + + + +### Quickstart + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apihub/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-apihub/samples/quickstart.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apihub/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]: https://cloud.google.com/apigee/docs/apihub/what-is-api-hub diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.create_api.js b/packages/google-cloud-apihub/samples/generated/v1/api_hub.create_api.js similarity index 100% rename from owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.create_api.js rename to packages/google-cloud-apihub/samples/generated/v1/api_hub.create_api.js diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.create_attribute.js b/packages/google-cloud-apihub/samples/generated/v1/api_hub.create_attribute.js similarity index 100% rename from owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.create_attribute.js rename to packages/google-cloud-apihub/samples/generated/v1/api_hub.create_attribute.js diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.create_deployment.js b/packages/google-cloud-apihub/samples/generated/v1/api_hub.create_deployment.js similarity index 100% rename from owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.create_deployment.js rename to packages/google-cloud-apihub/samples/generated/v1/api_hub.create_deployment.js diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.create_external_api.js b/packages/google-cloud-apihub/samples/generated/v1/api_hub.create_external_api.js similarity index 100% rename from owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.create_external_api.js rename to packages/google-cloud-apihub/samples/generated/v1/api_hub.create_external_api.js diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.create_spec.js b/packages/google-cloud-apihub/samples/generated/v1/api_hub.create_spec.js similarity index 100% rename from owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.create_spec.js rename to packages/google-cloud-apihub/samples/generated/v1/api_hub.create_spec.js diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.create_version.js b/packages/google-cloud-apihub/samples/generated/v1/api_hub.create_version.js similarity index 100% rename from owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.create_version.js rename to packages/google-cloud-apihub/samples/generated/v1/api_hub.create_version.js diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.delete_api.js b/packages/google-cloud-apihub/samples/generated/v1/api_hub.delete_api.js similarity index 100% rename from owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.delete_api.js rename to packages/google-cloud-apihub/samples/generated/v1/api_hub.delete_api.js diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.delete_attribute.js b/packages/google-cloud-apihub/samples/generated/v1/api_hub.delete_attribute.js similarity index 100% rename from owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.delete_attribute.js rename to packages/google-cloud-apihub/samples/generated/v1/api_hub.delete_attribute.js diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.delete_deployment.js b/packages/google-cloud-apihub/samples/generated/v1/api_hub.delete_deployment.js similarity index 100% rename from owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.delete_deployment.js rename to packages/google-cloud-apihub/samples/generated/v1/api_hub.delete_deployment.js diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.delete_external_api.js b/packages/google-cloud-apihub/samples/generated/v1/api_hub.delete_external_api.js similarity index 100% rename from owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.delete_external_api.js rename to packages/google-cloud-apihub/samples/generated/v1/api_hub.delete_external_api.js diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.delete_spec.js b/packages/google-cloud-apihub/samples/generated/v1/api_hub.delete_spec.js similarity index 100% rename from owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.delete_spec.js rename to packages/google-cloud-apihub/samples/generated/v1/api_hub.delete_spec.js diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.delete_version.js b/packages/google-cloud-apihub/samples/generated/v1/api_hub.delete_version.js similarity index 100% rename from owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.delete_version.js rename to packages/google-cloud-apihub/samples/generated/v1/api_hub.delete_version.js diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_api.js b/packages/google-cloud-apihub/samples/generated/v1/api_hub.get_api.js similarity index 100% rename from owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_api.js rename to packages/google-cloud-apihub/samples/generated/v1/api_hub.get_api.js diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_api_operation.js b/packages/google-cloud-apihub/samples/generated/v1/api_hub.get_api_operation.js similarity index 100% rename from owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_api_operation.js rename to packages/google-cloud-apihub/samples/generated/v1/api_hub.get_api_operation.js diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_attribute.js b/packages/google-cloud-apihub/samples/generated/v1/api_hub.get_attribute.js similarity index 100% rename from owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_attribute.js rename to packages/google-cloud-apihub/samples/generated/v1/api_hub.get_attribute.js diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_definition.js b/packages/google-cloud-apihub/samples/generated/v1/api_hub.get_definition.js similarity index 100% rename from owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_definition.js rename to packages/google-cloud-apihub/samples/generated/v1/api_hub.get_definition.js diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_deployment.js b/packages/google-cloud-apihub/samples/generated/v1/api_hub.get_deployment.js similarity index 100% rename from owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_deployment.js rename to packages/google-cloud-apihub/samples/generated/v1/api_hub.get_deployment.js diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_external_api.js b/packages/google-cloud-apihub/samples/generated/v1/api_hub.get_external_api.js similarity index 100% rename from owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_external_api.js rename to packages/google-cloud-apihub/samples/generated/v1/api_hub.get_external_api.js diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_spec.js b/packages/google-cloud-apihub/samples/generated/v1/api_hub.get_spec.js similarity index 100% rename from owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_spec.js rename to packages/google-cloud-apihub/samples/generated/v1/api_hub.get_spec.js diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_spec_contents.js b/packages/google-cloud-apihub/samples/generated/v1/api_hub.get_spec_contents.js similarity index 100% rename from owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_spec_contents.js rename to packages/google-cloud-apihub/samples/generated/v1/api_hub.get_spec_contents.js diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_version.js b/packages/google-cloud-apihub/samples/generated/v1/api_hub.get_version.js similarity index 100% rename from owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_version.js rename to packages/google-cloud-apihub/samples/generated/v1/api_hub.get_version.js diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.list_api_operations.js b/packages/google-cloud-apihub/samples/generated/v1/api_hub.list_api_operations.js similarity index 100% rename from owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.list_api_operations.js rename to packages/google-cloud-apihub/samples/generated/v1/api_hub.list_api_operations.js diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.list_apis.js b/packages/google-cloud-apihub/samples/generated/v1/api_hub.list_apis.js similarity index 100% rename from owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.list_apis.js rename to packages/google-cloud-apihub/samples/generated/v1/api_hub.list_apis.js diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.list_attributes.js b/packages/google-cloud-apihub/samples/generated/v1/api_hub.list_attributes.js similarity index 100% rename from owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.list_attributes.js rename to packages/google-cloud-apihub/samples/generated/v1/api_hub.list_attributes.js diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.list_deployments.js b/packages/google-cloud-apihub/samples/generated/v1/api_hub.list_deployments.js similarity index 100% rename from owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.list_deployments.js rename to packages/google-cloud-apihub/samples/generated/v1/api_hub.list_deployments.js diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.list_external_apis.js b/packages/google-cloud-apihub/samples/generated/v1/api_hub.list_external_apis.js similarity index 100% rename from owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.list_external_apis.js rename to packages/google-cloud-apihub/samples/generated/v1/api_hub.list_external_apis.js diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.list_specs.js b/packages/google-cloud-apihub/samples/generated/v1/api_hub.list_specs.js similarity index 100% rename from owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.list_specs.js rename to packages/google-cloud-apihub/samples/generated/v1/api_hub.list_specs.js diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.list_versions.js b/packages/google-cloud-apihub/samples/generated/v1/api_hub.list_versions.js similarity index 100% rename from owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.list_versions.js rename to packages/google-cloud-apihub/samples/generated/v1/api_hub.list_versions.js diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.search_resources.js b/packages/google-cloud-apihub/samples/generated/v1/api_hub.search_resources.js similarity index 100% rename from owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.search_resources.js rename to packages/google-cloud-apihub/samples/generated/v1/api_hub.search_resources.js diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.update_api.js b/packages/google-cloud-apihub/samples/generated/v1/api_hub.update_api.js similarity index 100% rename from owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.update_api.js rename to packages/google-cloud-apihub/samples/generated/v1/api_hub.update_api.js diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.update_attribute.js b/packages/google-cloud-apihub/samples/generated/v1/api_hub.update_attribute.js similarity index 100% rename from owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.update_attribute.js rename to packages/google-cloud-apihub/samples/generated/v1/api_hub.update_attribute.js diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.update_deployment.js b/packages/google-cloud-apihub/samples/generated/v1/api_hub.update_deployment.js similarity index 100% rename from owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.update_deployment.js rename to packages/google-cloud-apihub/samples/generated/v1/api_hub.update_deployment.js diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.update_external_api.js b/packages/google-cloud-apihub/samples/generated/v1/api_hub.update_external_api.js similarity index 100% rename from owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.update_external_api.js rename to packages/google-cloud-apihub/samples/generated/v1/api_hub.update_external_api.js diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.update_spec.js b/packages/google-cloud-apihub/samples/generated/v1/api_hub.update_spec.js similarity index 100% rename from owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.update_spec.js rename to packages/google-cloud-apihub/samples/generated/v1/api_hub.update_spec.js diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.update_version.js b/packages/google-cloud-apihub/samples/generated/v1/api_hub.update_version.js similarity index 100% rename from owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.update_version.js rename to packages/google-cloud-apihub/samples/generated/v1/api_hub.update_version.js diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_dependencies.create_dependency.js b/packages/google-cloud-apihub/samples/generated/v1/api_hub_dependencies.create_dependency.js similarity index 100% rename from owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_dependencies.create_dependency.js rename to packages/google-cloud-apihub/samples/generated/v1/api_hub_dependencies.create_dependency.js diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_dependencies.delete_dependency.js b/packages/google-cloud-apihub/samples/generated/v1/api_hub_dependencies.delete_dependency.js similarity index 100% rename from owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_dependencies.delete_dependency.js rename to packages/google-cloud-apihub/samples/generated/v1/api_hub_dependencies.delete_dependency.js diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_dependencies.get_dependency.js b/packages/google-cloud-apihub/samples/generated/v1/api_hub_dependencies.get_dependency.js similarity index 100% rename from owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_dependencies.get_dependency.js rename to packages/google-cloud-apihub/samples/generated/v1/api_hub_dependencies.get_dependency.js diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_dependencies.list_dependencies.js b/packages/google-cloud-apihub/samples/generated/v1/api_hub_dependencies.list_dependencies.js similarity index 100% rename from owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_dependencies.list_dependencies.js rename to packages/google-cloud-apihub/samples/generated/v1/api_hub_dependencies.list_dependencies.js diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_dependencies.update_dependency.js b/packages/google-cloud-apihub/samples/generated/v1/api_hub_dependencies.update_dependency.js similarity index 100% rename from owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_dependencies.update_dependency.js rename to packages/google-cloud-apihub/samples/generated/v1/api_hub_dependencies.update_dependency.js diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_plugin.disable_plugin.js b/packages/google-cloud-apihub/samples/generated/v1/api_hub_plugin.disable_plugin.js similarity index 100% rename from owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_plugin.disable_plugin.js rename to packages/google-cloud-apihub/samples/generated/v1/api_hub_plugin.disable_plugin.js diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_plugin.enable_plugin.js b/packages/google-cloud-apihub/samples/generated/v1/api_hub_plugin.enable_plugin.js similarity index 100% rename from owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_plugin.enable_plugin.js rename to packages/google-cloud-apihub/samples/generated/v1/api_hub_plugin.enable_plugin.js diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_plugin.get_plugin.js b/packages/google-cloud-apihub/samples/generated/v1/api_hub_plugin.get_plugin.js similarity index 100% rename from owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_plugin.get_plugin.js rename to packages/google-cloud-apihub/samples/generated/v1/api_hub_plugin.get_plugin.js diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/host_project_registration_service.create_host_project_registration.js b/packages/google-cloud-apihub/samples/generated/v1/host_project_registration_service.create_host_project_registration.js similarity index 100% rename from owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/host_project_registration_service.create_host_project_registration.js rename to packages/google-cloud-apihub/samples/generated/v1/host_project_registration_service.create_host_project_registration.js diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/host_project_registration_service.get_host_project_registration.js b/packages/google-cloud-apihub/samples/generated/v1/host_project_registration_service.get_host_project_registration.js similarity index 100% rename from owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/host_project_registration_service.get_host_project_registration.js rename to packages/google-cloud-apihub/samples/generated/v1/host_project_registration_service.get_host_project_registration.js diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/host_project_registration_service.list_host_project_registrations.js b/packages/google-cloud-apihub/samples/generated/v1/host_project_registration_service.list_host_project_registrations.js similarity index 100% rename from owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/host_project_registration_service.list_host_project_registrations.js rename to packages/google-cloud-apihub/samples/generated/v1/host_project_registration_service.list_host_project_registrations.js diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/linting_service.get_style_guide.js b/packages/google-cloud-apihub/samples/generated/v1/linting_service.get_style_guide.js similarity index 100% rename from owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/linting_service.get_style_guide.js rename to packages/google-cloud-apihub/samples/generated/v1/linting_service.get_style_guide.js diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/linting_service.get_style_guide_contents.js b/packages/google-cloud-apihub/samples/generated/v1/linting_service.get_style_guide_contents.js similarity index 100% rename from owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/linting_service.get_style_guide_contents.js rename to packages/google-cloud-apihub/samples/generated/v1/linting_service.get_style_guide_contents.js diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/linting_service.lint_spec.js b/packages/google-cloud-apihub/samples/generated/v1/linting_service.lint_spec.js similarity index 100% rename from owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/linting_service.lint_spec.js rename to packages/google-cloud-apihub/samples/generated/v1/linting_service.lint_spec.js diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/linting_service.update_style_guide.js b/packages/google-cloud-apihub/samples/generated/v1/linting_service.update_style_guide.js similarity index 100% rename from owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/linting_service.update_style_guide.js rename to packages/google-cloud-apihub/samples/generated/v1/linting_service.update_style_guide.js diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/provisioning.create_api_hub_instance.js b/packages/google-cloud-apihub/samples/generated/v1/provisioning.create_api_hub_instance.js similarity index 100% rename from owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/provisioning.create_api_hub_instance.js rename to packages/google-cloud-apihub/samples/generated/v1/provisioning.create_api_hub_instance.js diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/provisioning.get_api_hub_instance.js b/packages/google-cloud-apihub/samples/generated/v1/provisioning.get_api_hub_instance.js similarity index 100% rename from owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/provisioning.get_api_hub_instance.js rename to packages/google-cloud-apihub/samples/generated/v1/provisioning.get_api_hub_instance.js diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/provisioning.lookup_api_hub_instance.js b/packages/google-cloud-apihub/samples/generated/v1/provisioning.lookup_api_hub_instance.js similarity index 100% rename from owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/provisioning.lookup_api_hub_instance.js rename to packages/google-cloud-apihub/samples/generated/v1/provisioning.lookup_api_hub_instance.js diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/runtime_project_attachment_service.create_runtime_project_attachment.js b/packages/google-cloud-apihub/samples/generated/v1/runtime_project_attachment_service.create_runtime_project_attachment.js similarity index 100% rename from owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/runtime_project_attachment_service.create_runtime_project_attachment.js rename to packages/google-cloud-apihub/samples/generated/v1/runtime_project_attachment_service.create_runtime_project_attachment.js diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/runtime_project_attachment_service.delete_runtime_project_attachment.js b/packages/google-cloud-apihub/samples/generated/v1/runtime_project_attachment_service.delete_runtime_project_attachment.js similarity index 100% rename from owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/runtime_project_attachment_service.delete_runtime_project_attachment.js rename to packages/google-cloud-apihub/samples/generated/v1/runtime_project_attachment_service.delete_runtime_project_attachment.js diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/runtime_project_attachment_service.get_runtime_project_attachment.js b/packages/google-cloud-apihub/samples/generated/v1/runtime_project_attachment_service.get_runtime_project_attachment.js similarity index 100% rename from owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/runtime_project_attachment_service.get_runtime_project_attachment.js rename to packages/google-cloud-apihub/samples/generated/v1/runtime_project_attachment_service.get_runtime_project_attachment.js diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/runtime_project_attachment_service.list_runtime_project_attachments.js b/packages/google-cloud-apihub/samples/generated/v1/runtime_project_attachment_service.list_runtime_project_attachments.js similarity index 100% rename from owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/runtime_project_attachment_service.list_runtime_project_attachments.js rename to packages/google-cloud-apihub/samples/generated/v1/runtime_project_attachment_service.list_runtime_project_attachments.js diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/runtime_project_attachment_service.lookup_runtime_project_attachment.js b/packages/google-cloud-apihub/samples/generated/v1/runtime_project_attachment_service.lookup_runtime_project_attachment.js similarity index 100% rename from owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/runtime_project_attachment_service.lookup_runtime_project_attachment.js rename to packages/google-cloud-apihub/samples/generated/v1/runtime_project_attachment_service.lookup_runtime_project_attachment.js diff --git a/packages/google-cloud-apihub/samples/generated/v1/snippet_metadata_google.cloud.apihub.v1.json b/packages/google-cloud-apihub/samples/generated/v1/snippet_metadata_google.cloud.apihub.v1.json new file mode 100644 index 00000000000..8c7644d27f0 --- /dev/null +++ b/packages/google-cloud-apihub/samples/generated/v1/snippet_metadata_google.cloud.apihub.v1.json @@ -0,0 +1,2595 @@ +{ + "clientLibrary": { + "name": "nodejs-apihub", + "version": "0.0.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.apihub.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "regionTag": "apihub_v1_generated_ApiHub_CreateApi_async", + "title": "ApiHub createApi Sample", + "origin": "API_DEFINITION", + "description": " Create an API resource in the API hub. Once an API resource is created, versions can be added to it.", + "canonical": true, + "file": "api_hub.create_api.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateApi", + "fullName": "google.cloud.apihub.v1.ApiHub.CreateApi", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "api_id", + "type": "TYPE_STRING" + }, + { + "name": "api", + "type": ".google.cloud.apihub.v1.Api" + } + ], + "resultType": ".google.cloud.apihub.v1.Api", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "CreateApi", + "fullName": "google.cloud.apihub.v1.ApiHub.CreateApi", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_GetApi_async", + "title": "ApiHub getApi Sample", + "origin": "API_DEFINITION", + "description": " Get API resource details including the API versions contained in it.", + "canonical": true, + "file": "api_hub.get_api.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetApi", + "fullName": "google.cloud.apihub.v1.ApiHub.GetApi", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apihub.v1.Api", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "GetApi", + "fullName": "google.cloud.apihub.v1.ApiHub.GetApi", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_ListApis_async", + "title": "ApiHub listApis Sample", + "origin": "API_DEFINITION", + "description": " List API resources in the API hub.", + "canonical": true, + "file": "api_hub.list_apis.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 138, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListApis", + "fullName": "google.cloud.apihub.v1.ApiHub.ListApis", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apihub.v1.ListApisResponse", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "ListApis", + "fullName": "google.cloud.apihub.v1.ApiHub.ListApis", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_UpdateApi_async", + "title": "ApiHub updateApi Sample", + "origin": "API_DEFINITION", + "description": " Update an API resource in the API hub. The following fields in the [API][] can be updated: * [display_name][google.cloud.apihub.v1.Api.display_name] * [description][google.cloud.apihub.v1.Api.description] * [owner][google.cloud.apihub.v1.Api.owner] * [documentation][google.cloud.apihub.v1.Api.documentation] * [target_user][google.cloud.apihub.v1.Api.target_user] * [team][google.cloud.apihub.v1.Api.team] * [business_unit][google.cloud.apihub.v1.Api.business_unit] * [maturity_level][google.cloud.apihub.v1.Api.maturity_level] * [attributes][google.cloud.apihub.v1.Api.attributes] The [update_mask][google.cloud.apihub.v1.UpdateApiRequest.update_mask] should be used to specify the fields being updated. Updating the owner field requires complete owner message and updates both owner and email fields.", + "canonical": true, + "file": "api_hub.update_api.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateApi", + "fullName": "google.cloud.apihub.v1.ApiHub.UpdateApi", + "async": true, + "parameters": [ + { + "name": "api", + "type": ".google.cloud.apihub.v1.Api" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.apihub.v1.Api", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "UpdateApi", + "fullName": "google.cloud.apihub.v1.ApiHub.UpdateApi", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_DeleteApi_async", + "title": "ApiHub deleteApi Sample", + "origin": "API_DEFINITION", + "description": " Delete an API resource in the API hub. API can only be deleted if all underlying versions are deleted.", + "canonical": true, + "file": "api_hub.delete_api.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteApi", + "fullName": "google.cloud.apihub.v1.ApiHub.DeleteApi", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "force", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "DeleteApi", + "fullName": "google.cloud.apihub.v1.ApiHub.DeleteApi", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_CreateVersion_async", + "title": "ApiHub createVersion Sample", + "origin": "API_DEFINITION", + "description": " Create an API version for an API resource in the API hub.", + "canonical": true, + "file": "api_hub.create_version.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateVersion", + "fullName": "google.cloud.apihub.v1.ApiHub.CreateVersion", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "version_id", + "type": "TYPE_STRING" + }, + { + "name": "version", + "type": ".google.cloud.apihub.v1.Version" + } + ], + "resultType": ".google.cloud.apihub.v1.Version", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "CreateVersion", + "fullName": "google.cloud.apihub.v1.ApiHub.CreateVersion", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_GetVersion_async", + "title": "ApiHub getVersion Sample", + "origin": "API_DEFINITION", + "description": " Get details about the API version of an API resource. This will include information about the specs and operations present in the API version as well as the deployments linked to it.", + "canonical": true, + "file": "api_hub.get_version.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetVersion", + "fullName": "google.cloud.apihub.v1.ApiHub.GetVersion", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apihub.v1.Version", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "GetVersion", + "fullName": "google.cloud.apihub.v1.ApiHub.GetVersion", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_ListVersions_async", + "title": "ApiHub listVersions Sample", + "origin": "API_DEFINITION", + "description": " List API versions of an API resource in the API hub.", + "canonical": true, + "file": "api_hub.list_versions.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 126, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListVersions", + "fullName": "google.cloud.apihub.v1.ApiHub.ListVersions", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apihub.v1.ListVersionsResponse", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "ListVersions", + "fullName": "google.cloud.apihub.v1.ApiHub.ListVersions", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_UpdateVersion_async", + "title": "ApiHub updateVersion Sample", + "origin": "API_DEFINITION", + "description": " Update API version. The following fields in the [version][google.cloud.apihub.v1.Version] can be updated currently: * [display_name][google.cloud.apihub.v1.Version.display_name] * [description][google.cloud.apihub.v1.Version.description] * [documentation][google.cloud.apihub.v1.Version.documentation] * [deployments][google.cloud.apihub.v1.Version.deployments] * [lifecycle][google.cloud.apihub.v1.Version.lifecycle] * [compliance][google.cloud.apihub.v1.Version.compliance] * [accreditation][google.cloud.apihub.v1.Version.accreditation] * [attributes][google.cloud.apihub.v1.Version.attributes] The [update_mask][google.cloud.apihub.v1.UpdateVersionRequest.update_mask] should be used to specify the fields being updated.", + "canonical": true, + "file": "api_hub.update_version.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateVersion", + "fullName": "google.cloud.apihub.v1.ApiHub.UpdateVersion", + "async": true, + "parameters": [ + { + "name": "version", + "type": ".google.cloud.apihub.v1.Version" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.apihub.v1.Version", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "UpdateVersion", + "fullName": "google.cloud.apihub.v1.ApiHub.UpdateVersion", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_DeleteVersion_async", + "title": "ApiHub deleteVersion Sample", + "origin": "API_DEFINITION", + "description": " Delete an API version. Version can only be deleted if all underlying specs, operations, definitions and linked deployments are deleted.", + "canonical": true, + "file": "api_hub.delete_version.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteVersion", + "fullName": "google.cloud.apihub.v1.ApiHub.DeleteVersion", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "force", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "DeleteVersion", + "fullName": "google.cloud.apihub.v1.ApiHub.DeleteVersion", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_CreateSpec_async", + "title": "ApiHub createSpec Sample", + "origin": "API_DEFINITION", + "description": " Add a spec to an API version in the API hub. Multiple specs can be added to an API version. Note, while adding a spec, at least one of `contents` or `source_uri` must be provided. If `contents` is provided, then `spec_type` must also be provided. On adding a spec with contents to the version, the operations present in it will be added to the version.Note that the file contents in the spec should be of the same type as defined in the `projects/{project}/locations/{location}/attributes/system-spec-type` attribute associated with spec resource. Note that specs of various types can be uploaded, however parsing of details is supported for OpenAPI spec currently. In order to access the information parsed from the spec, use the [GetSpec][google.cloud.apihub.v1.ApiHub.GetSpec] method. In order to access the raw contents for a particular spec, use the [GetSpecContents][google.cloud.apihub.v1.ApiHub.GetSpecContents] method. In order to access the operations parsed from the spec, use the [ListAPIOperations][google.cloud.apihub.v1.ApiHub.ListApiOperations] method.", + "canonical": true, + "file": "api_hub.create_spec.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 71, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateSpec", + "fullName": "google.cloud.apihub.v1.ApiHub.CreateSpec", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "spec_id", + "type": "TYPE_STRING" + }, + { + "name": "spec", + "type": ".google.cloud.apihub.v1.Spec" + } + ], + "resultType": ".google.cloud.apihub.v1.Spec", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "CreateSpec", + "fullName": "google.cloud.apihub.v1.ApiHub.CreateSpec", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_GetSpec_async", + "title": "ApiHub getSpec Sample", + "origin": "API_DEFINITION", + "description": " Get details about the information parsed from a spec. Note that this method does not return the raw spec contents. Use [GetSpecContents][google.cloud.apihub.v1.ApiHub.GetSpecContents] method to retrieve the same.", + "canonical": true, + "file": "api_hub.get_spec.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetSpec", + "fullName": "google.cloud.apihub.v1.ApiHub.GetSpec", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apihub.v1.Spec", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "GetSpec", + "fullName": "google.cloud.apihub.v1.ApiHub.GetSpec", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_GetSpecContents_async", + "title": "ApiHub getSpecContents Sample", + "origin": "API_DEFINITION", + "description": " Get spec contents.", + "canonical": true, + "file": "api_hub.get_spec_contents.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetSpecContents", + "fullName": "google.cloud.apihub.v1.ApiHub.GetSpecContents", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apihub.v1.SpecContents", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "GetSpecContents", + "fullName": "google.cloud.apihub.v1.ApiHub.GetSpecContents", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_ListSpecs_async", + "title": "ApiHub listSpecs Sample", + "origin": "API_DEFINITION", + "description": " List specs corresponding to a particular API resource.", + "canonical": true, + "file": "api_hub.list_specs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 119, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListSpecs", + "fullName": "google.cloud.apihub.v1.ApiHub.ListSpecs", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apihub.v1.ListSpecsResponse", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "ListSpecs", + "fullName": "google.cloud.apihub.v1.ApiHub.ListSpecs", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_UpdateSpec_async", + "title": "ApiHub updateSpec Sample", + "origin": "API_DEFINITION", + "description": " Update spec. The following fields in the [spec][google.cloud.apihub.v1.Spec] can be updated: * [display_name][google.cloud.apihub.v1.Spec.display_name] * [source_uri][google.cloud.apihub.v1.Spec.source_uri] * [lint_response][google.cloud.apihub.v1.Spec.lint_response] * [attributes][google.cloud.apihub.v1.Spec.attributes] * [contents][google.cloud.apihub.v1.Spec.contents] * [spec_type][google.cloud.apihub.v1.Spec.spec_type] In case of an OAS spec, updating spec contents can lead to: 1. Creation, deletion and update of operations. 2. Creation, deletion and update of definitions. 3. Update of other info parsed out from the new spec. In case of contents or source_uri being present in update mask, spec_type must also be present. Also, spec_type can not be present in update mask if contents or source_uri is not present. The [update_mask][google.cloud.apihub.v1.UpdateSpecRequest.update_mask] should be used to specify the fields being updated.", + "canonical": true, + "file": "api_hub.update_spec.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateSpec", + "fullName": "google.cloud.apihub.v1.ApiHub.UpdateSpec", + "async": true, + "parameters": [ + { + "name": "spec", + "type": ".google.cloud.apihub.v1.Spec" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.apihub.v1.Spec", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "UpdateSpec", + "fullName": "google.cloud.apihub.v1.ApiHub.UpdateSpec", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_DeleteSpec_async", + "title": "ApiHub deleteSpec Sample", + "origin": "API_DEFINITION", + "description": " Delete a spec. Deleting a spec will also delete the associated operations from the version.", + "canonical": true, + "file": "api_hub.delete_spec.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteSpec", + "fullName": "google.cloud.apihub.v1.ApiHub.DeleteSpec", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "DeleteSpec", + "fullName": "google.cloud.apihub.v1.ApiHub.DeleteSpec", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_GetApiOperation_async", + "title": "ApiHub getApiOperation Sample", + "origin": "API_DEFINITION", + "description": " Get details about a particular operation in API version.", + "canonical": true, + "file": "api_hub.get_api_operation.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetApiOperation", + "fullName": "google.cloud.apihub.v1.ApiHub.GetApiOperation", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apihub.v1.ApiOperation", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "GetApiOperation", + "fullName": "google.cloud.apihub.v1.ApiHub.GetApiOperation", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_ListApiOperations_async", + "title": "ApiHub listApiOperations Sample", + "origin": "API_DEFINITION", + "description": " List operations in an API version.", + "canonical": true, + "file": "api_hub.list_api_operations.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 109, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListApiOperations", + "fullName": "google.cloud.apihub.v1.ApiHub.ListApiOperations", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apihub.v1.ListApiOperationsResponse", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "ListApiOperations", + "fullName": "google.cloud.apihub.v1.ApiHub.ListApiOperations", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_GetDefinition_async", + "title": "ApiHub getDefinition Sample", + "origin": "API_DEFINITION", + "description": " Get details about a definition in an API version.", + "canonical": true, + "file": "api_hub.get_definition.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetDefinition", + "fullName": "google.cloud.apihub.v1.ApiHub.GetDefinition", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apihub.v1.Definition", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "GetDefinition", + "fullName": "google.cloud.apihub.v1.ApiHub.GetDefinition", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_CreateDeployment_async", + "title": "ApiHub createDeployment Sample", + "origin": "API_DEFINITION", + "description": " Create a deployment resource in the API hub. Once a deployment resource is created, it can be associated with API versions.", + "canonical": true, + "file": "api_hub.create_deployment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 70, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateDeployment", + "fullName": "google.cloud.apihub.v1.ApiHub.CreateDeployment", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "deployment_id", + "type": "TYPE_STRING" + }, + { + "name": "deployment", + "type": ".google.cloud.apihub.v1.Deployment" + } + ], + "resultType": ".google.cloud.apihub.v1.Deployment", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "CreateDeployment", + "fullName": "google.cloud.apihub.v1.ApiHub.CreateDeployment", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_GetDeployment_async", + "title": "ApiHub getDeployment Sample", + "origin": "API_DEFINITION", + "description": " Get details about a deployment and the API versions linked to it.", + "canonical": true, + "file": "api_hub.get_deployment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetDeployment", + "fullName": "google.cloud.apihub.v1.ApiHub.GetDeployment", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apihub.v1.Deployment", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "GetDeployment", + "fullName": "google.cloud.apihub.v1.ApiHub.GetDeployment", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_ListDeployments_async", + "title": "ApiHub listDeployments Sample", + "origin": "API_DEFINITION", + "description": " List deployment resources in the API hub.", + "canonical": true, + "file": "api_hub.list_deployments.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 125, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListDeployments", + "fullName": "google.cloud.apihub.v1.ApiHub.ListDeployments", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apihub.v1.ListDeploymentsResponse", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "ListDeployments", + "fullName": "google.cloud.apihub.v1.ApiHub.ListDeployments", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_UpdateDeployment_async", + "title": "ApiHub updateDeployment Sample", + "origin": "API_DEFINITION", + "description": " Update a deployment resource in the API hub. The following fields in the [deployment resource][google.cloud.apihub.v1.Deployment] can be updated: * [display_name][google.cloud.apihub.v1.Deployment.display_name] * [description][google.cloud.apihub.v1.Deployment.description] * [documentation][google.cloud.apihub.v1.Deployment.documentation] * [deployment_type][google.cloud.apihub.v1.Deployment.deployment_type] * [resource_uri][google.cloud.apihub.v1.Deployment.resource_uri] * [endpoints][google.cloud.apihub.v1.Deployment.endpoints] * [slo][google.cloud.apihub.v1.Deployment.slo] * [environment][google.cloud.apihub.v1.Deployment.environment] * [attributes][google.cloud.apihub.v1.Deployment.attributes] The [update_mask][google.cloud.apihub.v1.UpdateDeploymentRequest.update_mask] should be used to specify the fields being updated.", + "canonical": true, + "file": "api_hub.update_deployment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateDeployment", + "fullName": "google.cloud.apihub.v1.ApiHub.UpdateDeployment", + "async": true, + "parameters": [ + { + "name": "deployment", + "type": ".google.cloud.apihub.v1.Deployment" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.apihub.v1.Deployment", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "UpdateDeployment", + "fullName": "google.cloud.apihub.v1.ApiHub.UpdateDeployment", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_DeleteDeployment_async", + "title": "ApiHub deleteDeployment Sample", + "origin": "API_DEFINITION", + "description": " Delete a deployment resource in the API hub.", + "canonical": true, + "file": "api_hub.delete_deployment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteDeployment", + "fullName": "google.cloud.apihub.v1.ApiHub.DeleteDeployment", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "DeleteDeployment", + "fullName": "google.cloud.apihub.v1.ApiHub.DeleteDeployment", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_CreateAttribute_async", + "title": "ApiHub createAttribute Sample", + "origin": "API_DEFINITION", + "description": " Create a user defined attribute. Certain pre defined attributes are already created by the API hub. These attributes will have type as `SYSTEM_DEFINED` and can be listed via [ListAttributes][google.cloud.apihub.v1.ApiHub.ListAttributes] method. Allowed values for the same can be updated via [UpdateAttribute][google.cloud.apihub.v1.ApiHub.UpdateAttribute] method.", + "canonical": true, + "file": "api_hub.create_attribute.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 70, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateAttribute", + "fullName": "google.cloud.apihub.v1.ApiHub.CreateAttribute", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "attribute_id", + "type": "TYPE_STRING" + }, + { + "name": "attribute", + "type": ".google.cloud.apihub.v1.Attribute" + } + ], + "resultType": ".google.cloud.apihub.v1.Attribute", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "CreateAttribute", + "fullName": "google.cloud.apihub.v1.ApiHub.CreateAttribute", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_GetAttribute_async", + "title": "ApiHub getAttribute Sample", + "origin": "API_DEFINITION", + "description": " Get details about the attribute.", + "canonical": true, + "file": "api_hub.get_attribute.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetAttribute", + "fullName": "google.cloud.apihub.v1.ApiHub.GetAttribute", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apihub.v1.Attribute", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "GetAttribute", + "fullName": "google.cloud.apihub.v1.ApiHub.GetAttribute", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_UpdateAttribute_async", + "title": "ApiHub updateAttribute Sample", + "origin": "API_DEFINITION", + "description": " Update the attribute. The following fields in the [Attribute resource][google.cloud.apihub.v1.Attribute] can be updated: * [display_name][google.cloud.apihub.v1.Attribute.display_name] The display name can be updated for user defined attributes only. * [description][google.cloud.apihub.v1.Attribute.description] The description can be updated for user defined attributes only. * [allowed_values][google.cloud.apihub.v1.Attribute.allowed_values] To update the list of allowed values, clients need to use the fetched list of allowed values and add or remove values to or from the same list. The mutable allowed values can be updated for both user defined and System defined attributes. The immutable allowed values cannot be updated or deleted. The updated list of allowed values cannot be empty. If an allowed value that is already used by some resource's attribute is deleted, then the association between the resource and the attribute value will also be deleted. * [cardinality][google.cloud.apihub.v1.Attribute.cardinality] The cardinality can be updated for user defined attributes only. Cardinality can only be increased during an update. The [update_mask][google.cloud.apihub.v1.UpdateAttributeRequest.update_mask] should be used to specify the fields being updated.", + "canonical": true, + "file": "api_hub.update_attribute.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateAttribute", + "fullName": "google.cloud.apihub.v1.ApiHub.UpdateAttribute", + "async": true, + "parameters": [ + { + "name": "attribute", + "type": ".google.cloud.apihub.v1.Attribute" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.apihub.v1.Attribute", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "UpdateAttribute", + "fullName": "google.cloud.apihub.v1.ApiHub.UpdateAttribute", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_DeleteAttribute_async", + "title": "ApiHub deleteAttribute Sample", + "origin": "API_DEFINITION", + "description": " Delete an attribute. Note: System defined attributes cannot be deleted. All associations of the attribute being deleted with any API hub resource will also get deleted.", + "canonical": true, + "file": "api_hub.delete_attribute.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteAttribute", + "fullName": "google.cloud.apihub.v1.ApiHub.DeleteAttribute", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "DeleteAttribute", + "fullName": "google.cloud.apihub.v1.ApiHub.DeleteAttribute", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_ListAttributes_async", + "title": "ApiHub listAttributes Sample", + "origin": "API_DEFINITION", + "description": " List all attributes.", + "canonical": true, + "file": "api_hub.list_attributes.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 110, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListAttributes", + "fullName": "google.cloud.apihub.v1.ApiHub.ListAttributes", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apihub.v1.ListAttributesResponse", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "ListAttributes", + "fullName": "google.cloud.apihub.v1.ApiHub.ListAttributes", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_SearchResources_async", + "title": "ApiHub searchResources Sample", + "origin": "API_DEFINITION", + "description": " Search across API-Hub resources.", + "canonical": true, + "file": "api_hub.search_resources.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 100, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SearchResources", + "fullName": "google.cloud.apihub.v1.ApiHub.SearchResources", + "async": true, + "parameters": [ + { + "name": "location", + "type": "TYPE_STRING" + }, + { + "name": "query", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apihub.v1.SearchResourcesResponse", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "SearchResources", + "fullName": "google.cloud.apihub.v1.ApiHub.SearchResources", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_CreateExternalApi_async", + "title": "ApiHub createExternalApi Sample", + "origin": "API_DEFINITION", + "description": " Create an External API resource in the API hub.", + "canonical": true, + "file": "api_hub.create_external_api.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 71, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateExternalApi", + "fullName": "google.cloud.apihub.v1.ApiHub.CreateExternalApi", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "external_api_id", + "type": "TYPE_STRING" + }, + { + "name": "external_api", + "type": ".google.cloud.apihub.v1.ExternalApi" + } + ], + "resultType": ".google.cloud.apihub.v1.ExternalApi", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "CreateExternalApi", + "fullName": "google.cloud.apihub.v1.ApiHub.CreateExternalApi", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_GetExternalApi_async", + "title": "ApiHub getExternalApi Sample", + "origin": "API_DEFINITION", + "description": " Get details about an External API resource in the API hub.", + "canonical": true, + "file": "api_hub.get_external_api.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetExternalApi", + "fullName": "google.cloud.apihub.v1.ApiHub.GetExternalApi", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apihub.v1.ExternalApi", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "GetExternalApi", + "fullName": "google.cloud.apihub.v1.ApiHub.GetExternalApi", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_UpdateExternalApi_async", + "title": "ApiHub updateExternalApi Sample", + "origin": "API_DEFINITION", + "description": " Update an External API resource in the API hub. The following fields can be updated: * [display_name][google.cloud.apihub.v1.ExternalApi.display_name] * [description][google.cloud.apihub.v1.ExternalApi.description] * [documentation][google.cloud.apihub.v1.ExternalApi.documentation] * [endpoints][google.cloud.apihub.v1.ExternalApi.endpoints] * [paths][google.cloud.apihub.v1.ExternalApi.paths] The [update_mask][google.cloud.apihub.v1.UpdateExternalApiRequest.update_mask] should be used to specify the fields being updated.", + "canonical": true, + "file": "api_hub.update_external_api.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateExternalApi", + "fullName": "google.cloud.apihub.v1.ApiHub.UpdateExternalApi", + "async": true, + "parameters": [ + { + "name": "external_api", + "type": ".google.cloud.apihub.v1.ExternalApi" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.apihub.v1.ExternalApi", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "UpdateExternalApi", + "fullName": "google.cloud.apihub.v1.ApiHub.UpdateExternalApi", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_DeleteExternalApi_async", + "title": "ApiHub deleteExternalApi Sample", + "origin": "API_DEFINITION", + "description": " Delete an External API resource in the API hub.", + "canonical": true, + "file": "api_hub.delete_external_api.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteExternalApi", + "fullName": "google.cloud.apihub.v1.ApiHub.DeleteExternalApi", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "DeleteExternalApi", + "fullName": "google.cloud.apihub.v1.ApiHub.DeleteExternalApi", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_ListExternalApis_async", + "title": "ApiHub listExternalApis Sample", + "origin": "API_DEFINITION", + "description": " List External API resources in the API hub.", + "canonical": true, + "file": "api_hub.list_external_apis.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 70, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListExternalApis", + "fullName": "google.cloud.apihub.v1.ApiHub.ListExternalApis", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apihub.v1.ListExternalApisResponse", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "ListExternalApis", + "fullName": "google.cloud.apihub.v1.ApiHub.ListExternalApis", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHubDependencies_CreateDependency_async", + "title": "ApiHub createDependency Sample", + "origin": "API_DEFINITION", + "description": " Create a dependency between two entities in the API hub.", + "canonical": true, + "file": "api_hub_dependencies.create_dependency.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateDependency", + "fullName": "google.cloud.apihub.v1.ApiHubDependencies.CreateDependency", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "dependency_id", + "type": "TYPE_STRING" + }, + { + "name": "dependency", + "type": ".google.cloud.apihub.v1.Dependency" + } + ], + "resultType": ".google.cloud.apihub.v1.Dependency", + "client": { + "shortName": "ApiHubDependenciesClient", + "fullName": "google.cloud.apihub.v1.ApiHubDependenciesClient" + }, + "method": { + "shortName": "CreateDependency", + "fullName": "google.cloud.apihub.v1.ApiHubDependencies.CreateDependency", + "service": { + "shortName": "ApiHubDependencies", + "fullName": "google.cloud.apihub.v1.ApiHubDependencies" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHubDependencies_GetDependency_async", + "title": "ApiHub getDependency Sample", + "origin": "API_DEFINITION", + "description": " Get details about a dependency resource in the API hub.", + "canonical": true, + "file": "api_hub_dependencies.get_dependency.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetDependency", + "fullName": "google.cloud.apihub.v1.ApiHubDependencies.GetDependency", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apihub.v1.Dependency", + "client": { + "shortName": "ApiHubDependenciesClient", + "fullName": "google.cloud.apihub.v1.ApiHubDependenciesClient" + }, + "method": { + "shortName": "GetDependency", + "fullName": "google.cloud.apihub.v1.ApiHubDependencies.GetDependency", + "service": { + "shortName": "ApiHubDependencies", + "fullName": "google.cloud.apihub.v1.ApiHubDependencies" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHubDependencies_UpdateDependency_async", + "title": "ApiHub updateDependency Sample", + "origin": "API_DEFINITION", + "description": " Update a dependency based on the [update_mask][google.cloud.apihub.v1.UpdateDependencyRequest.update_mask] provided in the request. The following fields in the [dependency][google.cloud.apihub.v1.Dependency] can be updated: * [description][google.cloud.apihub.v1.Dependency.description]", + "canonical": true, + "file": "api_hub_dependencies.update_dependency.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateDependency", + "fullName": "google.cloud.apihub.v1.ApiHubDependencies.UpdateDependency", + "async": true, + "parameters": [ + { + "name": "dependency", + "type": ".google.cloud.apihub.v1.Dependency" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.apihub.v1.Dependency", + "client": { + "shortName": "ApiHubDependenciesClient", + "fullName": "google.cloud.apihub.v1.ApiHubDependenciesClient" + }, + "method": { + "shortName": "UpdateDependency", + "fullName": "google.cloud.apihub.v1.ApiHubDependencies.UpdateDependency", + "service": { + "shortName": "ApiHubDependencies", + "fullName": "google.cloud.apihub.v1.ApiHubDependencies" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHubDependencies_DeleteDependency_async", + "title": "ApiHub deleteDependency Sample", + "origin": "API_DEFINITION", + "description": " Delete the dependency resource.", + "canonical": true, + "file": "api_hub_dependencies.delete_dependency.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteDependency", + "fullName": "google.cloud.apihub.v1.ApiHubDependencies.DeleteDependency", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "ApiHubDependenciesClient", + "fullName": "google.cloud.apihub.v1.ApiHubDependenciesClient" + }, + "method": { + "shortName": "DeleteDependency", + "fullName": "google.cloud.apihub.v1.ApiHubDependencies.DeleteDependency", + "service": { + "shortName": "ApiHubDependencies", + "fullName": "google.cloud.apihub.v1.ApiHubDependencies" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHubDependencies_ListDependencies_async", + "title": "ApiHub listDependencies Sample", + "origin": "API_DEFINITION", + "description": " List dependencies based on the provided filter and pagination parameters.", + "canonical": true, + "file": "api_hub_dependencies.list_dependencies.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 102, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListDependencies", + "fullName": "google.cloud.apihub.v1.ApiHubDependencies.ListDependencies", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apihub.v1.ListDependenciesResponse", + "client": { + "shortName": "ApiHubDependenciesClient", + "fullName": "google.cloud.apihub.v1.ApiHubDependenciesClient" + }, + "method": { + "shortName": "ListDependencies", + "fullName": "google.cloud.apihub.v1.ApiHubDependencies.ListDependencies", + "service": { + "shortName": "ApiHubDependencies", + "fullName": "google.cloud.apihub.v1.ApiHubDependencies" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHubPlugin_GetPlugin_async", + "title": "ApiHub getPlugin Sample", + "origin": "API_DEFINITION", + "description": " Get details about an API Hub plugin.", + "canonical": true, + "file": "api_hub_plugin.get_plugin.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetPlugin", + "fullName": "google.cloud.apihub.v1.ApiHubPlugin.GetPlugin", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apihub.v1.Plugin", + "client": { + "shortName": "ApiHubPluginClient", + "fullName": "google.cloud.apihub.v1.ApiHubPluginClient" + }, + "method": { + "shortName": "GetPlugin", + "fullName": "google.cloud.apihub.v1.ApiHubPlugin.GetPlugin", + "service": { + "shortName": "ApiHubPlugin", + "fullName": "google.cloud.apihub.v1.ApiHubPlugin" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHubPlugin_EnablePlugin_async", + "title": "ApiHub enablePlugin Sample", + "origin": "API_DEFINITION", + "description": " Enables a plugin. The `state` of the plugin after enabling is `ENABLED`", + "canonical": true, + "file": "api_hub_plugin.enable_plugin.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "EnablePlugin", + "fullName": "google.cloud.apihub.v1.ApiHubPlugin.EnablePlugin", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apihub.v1.Plugin", + "client": { + "shortName": "ApiHubPluginClient", + "fullName": "google.cloud.apihub.v1.ApiHubPluginClient" + }, + "method": { + "shortName": "EnablePlugin", + "fullName": "google.cloud.apihub.v1.ApiHubPlugin.EnablePlugin", + "service": { + "shortName": "ApiHubPlugin", + "fullName": "google.cloud.apihub.v1.ApiHubPlugin" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHubPlugin_DisablePlugin_async", + "title": "ApiHub disablePlugin Sample", + "origin": "API_DEFINITION", + "description": " Disables a plugin. The `state` of the plugin after disabling is `DISABLED`", + "canonical": true, + "file": "api_hub_plugin.disable_plugin.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DisablePlugin", + "fullName": "google.cloud.apihub.v1.ApiHubPlugin.DisablePlugin", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apihub.v1.Plugin", + "client": { + "shortName": "ApiHubPluginClient", + "fullName": "google.cloud.apihub.v1.ApiHubPluginClient" + }, + "method": { + "shortName": "DisablePlugin", + "fullName": "google.cloud.apihub.v1.ApiHubPlugin.DisablePlugin", + "service": { + "shortName": "ApiHubPlugin", + "fullName": "google.cloud.apihub.v1.ApiHubPlugin" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_HostProjectRegistrationService_CreateHostProjectRegistration_async", + "title": "ApiHub createHostProjectRegistration Sample", + "origin": "API_DEFINITION", + "description": " Create a host project registration. A Google cloud project can be registered as a host project if it is not attached as a runtime project to another host project. A project can be registered as a host project only once. Subsequent register calls for the same project will fail.", + "canonical": true, + "file": "host_project_registration_service.create_host_project_registration.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateHostProjectRegistration", + "fullName": "google.cloud.apihub.v1.HostProjectRegistrationService.CreateHostProjectRegistration", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "host_project_registration_id", + "type": "TYPE_STRING" + }, + { + "name": "host_project_registration", + "type": ".google.cloud.apihub.v1.HostProjectRegistration" + } + ], + "resultType": ".google.cloud.apihub.v1.HostProjectRegistration", + "client": { + "shortName": "HostProjectRegistrationServiceClient", + "fullName": "google.cloud.apihub.v1.HostProjectRegistrationServiceClient" + }, + "method": { + "shortName": "CreateHostProjectRegistration", + "fullName": "google.cloud.apihub.v1.HostProjectRegistrationService.CreateHostProjectRegistration", + "service": { + "shortName": "HostProjectRegistrationService", + "fullName": "google.cloud.apihub.v1.HostProjectRegistrationService" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_HostProjectRegistrationService_GetHostProjectRegistration_async", + "title": "ApiHub getHostProjectRegistration Sample", + "origin": "API_DEFINITION", + "description": " Get a host project registration.", + "canonical": true, + "file": "host_project_registration_service.get_host_project_registration.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetHostProjectRegistration", + "fullName": "google.cloud.apihub.v1.HostProjectRegistrationService.GetHostProjectRegistration", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apihub.v1.HostProjectRegistration", + "client": { + "shortName": "HostProjectRegistrationServiceClient", + "fullName": "google.cloud.apihub.v1.HostProjectRegistrationServiceClient" + }, + "method": { + "shortName": "GetHostProjectRegistration", + "fullName": "google.cloud.apihub.v1.HostProjectRegistrationService.GetHostProjectRegistration", + "service": { + "shortName": "HostProjectRegistrationService", + "fullName": "google.cloud.apihub.v1.HostProjectRegistrationService" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_HostProjectRegistrationService_ListHostProjectRegistrations_async", + "title": "ApiHub listHostProjectRegistrations Sample", + "origin": "API_DEFINITION", + "description": " Lists host project registrations.", + "canonical": true, + "file": "host_project_registration_service.list_host_project_registrations.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 92, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListHostProjectRegistrations", + "fullName": "google.cloud.apihub.v1.HostProjectRegistrationService.ListHostProjectRegistrations", + "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" + } + ], + "resultType": ".google.cloud.apihub.v1.ListHostProjectRegistrationsResponse", + "client": { + "shortName": "HostProjectRegistrationServiceClient", + "fullName": "google.cloud.apihub.v1.HostProjectRegistrationServiceClient" + }, + "method": { + "shortName": "ListHostProjectRegistrations", + "fullName": "google.cloud.apihub.v1.HostProjectRegistrationService.ListHostProjectRegistrations", + "service": { + "shortName": "HostProjectRegistrationService", + "fullName": "google.cloud.apihub.v1.HostProjectRegistrationService" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_LintingService_GetStyleGuide_async", + "title": "ApiHub getStyleGuide Sample", + "origin": "API_DEFINITION", + "description": " Get the style guide being used for linting.", + "canonical": true, + "file": "linting_service.get_style_guide.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetStyleGuide", + "fullName": "google.cloud.apihub.v1.LintingService.GetStyleGuide", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apihub.v1.StyleGuide", + "client": { + "shortName": "LintingServiceClient", + "fullName": "google.cloud.apihub.v1.LintingServiceClient" + }, + "method": { + "shortName": "GetStyleGuide", + "fullName": "google.cloud.apihub.v1.LintingService.GetStyleGuide", + "service": { + "shortName": "LintingService", + "fullName": "google.cloud.apihub.v1.LintingService" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_LintingService_UpdateStyleGuide_async", + "title": "ApiHub updateStyleGuide Sample", + "origin": "API_DEFINITION", + "description": " Update the styleGuide to be used for liniting in by API hub.", + "canonical": true, + "file": "linting_service.update_style_guide.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateStyleGuide", + "fullName": "google.cloud.apihub.v1.LintingService.UpdateStyleGuide", + "async": true, + "parameters": [ + { + "name": "style_guide", + "type": ".google.cloud.apihub.v1.StyleGuide" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.apihub.v1.StyleGuide", + "client": { + "shortName": "LintingServiceClient", + "fullName": "google.cloud.apihub.v1.LintingServiceClient" + }, + "method": { + "shortName": "UpdateStyleGuide", + "fullName": "google.cloud.apihub.v1.LintingService.UpdateStyleGuide", + "service": { + "shortName": "LintingService", + "fullName": "google.cloud.apihub.v1.LintingService" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_LintingService_GetStyleGuideContents_async", + "title": "ApiHub getStyleGuideContents Sample", + "origin": "API_DEFINITION", + "description": " Get the contents of the style guide.", + "canonical": true, + "file": "linting_service.get_style_guide_contents.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetStyleGuideContents", + "fullName": "google.cloud.apihub.v1.LintingService.GetStyleGuideContents", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apihub.v1.StyleGuideContents", + "client": { + "shortName": "LintingServiceClient", + "fullName": "google.cloud.apihub.v1.LintingServiceClient" + }, + "method": { + "shortName": "GetStyleGuideContents", + "fullName": "google.cloud.apihub.v1.LintingService.GetStyleGuideContents", + "service": { + "shortName": "LintingService", + "fullName": "google.cloud.apihub.v1.LintingService" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_LintingService_LintSpec_async", + "title": "ApiHub lintSpec Sample", + "origin": "API_DEFINITION", + "description": " Lints the requested spec and updates the corresponding API Spec with the lint response. This lint response will be available in all subsequent Get and List Spec calls to Core service.", + "canonical": true, + "file": "linting_service.lint_spec.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "LintSpec", + "fullName": "google.cloud.apihub.v1.LintingService.LintSpec", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "LintingServiceClient", + "fullName": "google.cloud.apihub.v1.LintingServiceClient" + }, + "method": { + "shortName": "LintSpec", + "fullName": "google.cloud.apihub.v1.LintingService.LintSpec", + "service": { + "shortName": "LintingService", + "fullName": "google.cloud.apihub.v1.LintingService" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_Provisioning_CreateApiHubInstance_async", + "title": "ApiHub createApiHubInstance Sample", + "origin": "API_DEFINITION", + "description": " Provisions instance resources for the API Hub.", + "canonical": true, + "file": "provisioning.create_api_hub_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateApiHubInstance", + "fullName": "google.cloud.apihub.v1.Provisioning.CreateApiHubInstance", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "api_hub_instance_id", + "type": "TYPE_STRING" + }, + { + "name": "api_hub_instance", + "type": ".google.cloud.apihub.v1.ApiHubInstance" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "ProvisioningClient", + "fullName": "google.cloud.apihub.v1.ProvisioningClient" + }, + "method": { + "shortName": "CreateApiHubInstance", + "fullName": "google.cloud.apihub.v1.Provisioning.CreateApiHubInstance", + "service": { + "shortName": "Provisioning", + "fullName": "google.cloud.apihub.v1.Provisioning" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_Provisioning_GetApiHubInstance_async", + "title": "ApiHub getApiHubInstance Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single API Hub instance.", + "canonical": true, + "file": "provisioning.get_api_hub_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetApiHubInstance", + "fullName": "google.cloud.apihub.v1.Provisioning.GetApiHubInstance", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apihub.v1.ApiHubInstance", + "client": { + "shortName": "ProvisioningClient", + "fullName": "google.cloud.apihub.v1.ProvisioningClient" + }, + "method": { + "shortName": "GetApiHubInstance", + "fullName": "google.cloud.apihub.v1.Provisioning.GetApiHubInstance", + "service": { + "shortName": "Provisioning", + "fullName": "google.cloud.apihub.v1.Provisioning" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_Provisioning_LookupApiHubInstance_async", + "title": "ApiHub lookupApiHubInstance Sample", + "origin": "API_DEFINITION", + "description": " Looks up an Api Hub instance in a given GCP project. There will always be only one Api Hub instance for a GCP project across all locations.", + "canonical": true, + "file": "provisioning.lookup_api_hub_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "LookupApiHubInstance", + "fullName": "google.cloud.apihub.v1.Provisioning.LookupApiHubInstance", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apihub.v1.LookupApiHubInstanceResponse", + "client": { + "shortName": "ProvisioningClient", + "fullName": "google.cloud.apihub.v1.ProvisioningClient" + }, + "method": { + "shortName": "LookupApiHubInstance", + "fullName": "google.cloud.apihub.v1.Provisioning.LookupApiHubInstance", + "service": { + "shortName": "Provisioning", + "fullName": "google.cloud.apihub.v1.Provisioning" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_RuntimeProjectAttachmentService_CreateRuntimeProjectAttachment_async", + "title": "ApiHub createRuntimeProjectAttachment Sample", + "origin": "API_DEFINITION", + "description": " Attaches a runtime project to the host project.", + "canonical": true, + "file": "runtime_project_attachment_service.create_runtime_project_attachment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateRuntimeProjectAttachment", + "fullName": "google.cloud.apihub.v1.RuntimeProjectAttachmentService.CreateRuntimeProjectAttachment", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "runtime_project_attachment_id", + "type": "TYPE_STRING" + }, + { + "name": "runtime_project_attachment", + "type": ".google.cloud.apihub.v1.RuntimeProjectAttachment" + } + ], + "resultType": ".google.cloud.apihub.v1.RuntimeProjectAttachment", + "client": { + "shortName": "RuntimeProjectAttachmentServiceClient", + "fullName": "google.cloud.apihub.v1.RuntimeProjectAttachmentServiceClient" + }, + "method": { + "shortName": "CreateRuntimeProjectAttachment", + "fullName": "google.cloud.apihub.v1.RuntimeProjectAttachmentService.CreateRuntimeProjectAttachment", + "service": { + "shortName": "RuntimeProjectAttachmentService", + "fullName": "google.cloud.apihub.v1.RuntimeProjectAttachmentService" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_RuntimeProjectAttachmentService_GetRuntimeProjectAttachment_async", + "title": "ApiHub getRuntimeProjectAttachment Sample", + "origin": "API_DEFINITION", + "description": " Gets a runtime project attachment.", + "canonical": true, + "file": "runtime_project_attachment_service.get_runtime_project_attachment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetRuntimeProjectAttachment", + "fullName": "google.cloud.apihub.v1.RuntimeProjectAttachmentService.GetRuntimeProjectAttachment", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apihub.v1.RuntimeProjectAttachment", + "client": { + "shortName": "RuntimeProjectAttachmentServiceClient", + "fullName": "google.cloud.apihub.v1.RuntimeProjectAttachmentServiceClient" + }, + "method": { + "shortName": "GetRuntimeProjectAttachment", + "fullName": "google.cloud.apihub.v1.RuntimeProjectAttachmentService.GetRuntimeProjectAttachment", + "service": { + "shortName": "RuntimeProjectAttachmentService", + "fullName": "google.cloud.apihub.v1.RuntimeProjectAttachmentService" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_RuntimeProjectAttachmentService_ListRuntimeProjectAttachments_async", + "title": "ApiHub listRuntimeProjectAttachments Sample", + "origin": "API_DEFINITION", + "description": " List runtime projects attached to the host project.", + "canonical": true, + "file": "runtime_project_attachment_service.list_runtime_project_attachments.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 92, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListRuntimeProjectAttachments", + "fullName": "google.cloud.apihub.v1.RuntimeProjectAttachmentService.ListRuntimeProjectAttachments", + "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" + } + ], + "resultType": ".google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse", + "client": { + "shortName": "RuntimeProjectAttachmentServiceClient", + "fullName": "google.cloud.apihub.v1.RuntimeProjectAttachmentServiceClient" + }, + "method": { + "shortName": "ListRuntimeProjectAttachments", + "fullName": "google.cloud.apihub.v1.RuntimeProjectAttachmentService.ListRuntimeProjectAttachments", + "service": { + "shortName": "RuntimeProjectAttachmentService", + "fullName": "google.cloud.apihub.v1.RuntimeProjectAttachmentService" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_RuntimeProjectAttachmentService_DeleteRuntimeProjectAttachment_async", + "title": "ApiHub deleteRuntimeProjectAttachment Sample", + "origin": "API_DEFINITION", + "description": " Delete a runtime project attachment in the API Hub. This call will detach the runtime project from the host project.", + "canonical": true, + "file": "runtime_project_attachment_service.delete_runtime_project_attachment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteRuntimeProjectAttachment", + "fullName": "google.cloud.apihub.v1.RuntimeProjectAttachmentService.DeleteRuntimeProjectAttachment", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "RuntimeProjectAttachmentServiceClient", + "fullName": "google.cloud.apihub.v1.RuntimeProjectAttachmentServiceClient" + }, + "method": { + "shortName": "DeleteRuntimeProjectAttachment", + "fullName": "google.cloud.apihub.v1.RuntimeProjectAttachmentService.DeleteRuntimeProjectAttachment", + "service": { + "shortName": "RuntimeProjectAttachmentService", + "fullName": "google.cloud.apihub.v1.RuntimeProjectAttachmentService" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_RuntimeProjectAttachmentService_LookupRuntimeProjectAttachment_async", + "title": "ApiHub lookupRuntimeProjectAttachment Sample", + "origin": "API_DEFINITION", + "description": " Look up a runtime project attachment. This API can be called in the context of any project.", + "canonical": true, + "file": "runtime_project_attachment_service.lookup_runtime_project_attachment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "LookupRuntimeProjectAttachment", + "fullName": "google.cloud.apihub.v1.RuntimeProjectAttachmentService.LookupRuntimeProjectAttachment", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse", + "client": { + "shortName": "RuntimeProjectAttachmentServiceClient", + "fullName": "google.cloud.apihub.v1.RuntimeProjectAttachmentServiceClient" + }, + "method": { + "shortName": "LookupRuntimeProjectAttachment", + "fullName": "google.cloud.apihub.v1.RuntimeProjectAttachmentService.LookupRuntimeProjectAttachment", + "service": { + "shortName": "RuntimeProjectAttachmentService", + "fullName": "google.cloud.apihub.v1.RuntimeProjectAttachmentService" + } + } + } + } + ] +} \ No newline at end of file diff --git a/packages/google-cloud-apihub/samples/quickstart.js b/packages/google-cloud-apihub/samples/quickstart.js new file mode 100644 index 00000000000..61765374b9f --- /dev/null +++ b/packages/google-cloud-apihub/samples/quickstart.js @@ -0,0 +1,131 @@ +// Copyright 2024 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 apihub_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. The parent, which owns this collection of deployment resources. + * Format: `projects/{project}/locations/{location}` + */ + // const parent = 'abc123' + /** + * Optional. An expression that filters the list of Deployments. + * A filter expression consists of a field name, a comparison + * operator, and a value for filtering. The value must be a string. The + * comparison operator must be one of: `<`, `>` or + * `=`. Filters are not case sensitive. + * The following fields in the `Deployments` are eligible for filtering: + * * `display_name` - The display name of the Deployment. Allowed + * comparison operators: `=`. + * * `create_time` - The time at which the Deployment was created. The + * value should be in the (RFC3339)https://tools.ietf.org/html/rfc3339 + * format. Allowed comparison operators: `>` and `<`. + * * `resource_uri` - A URI to the deployment resource. Allowed + * comparison operators: `=`. + * * `api_versions` - The API versions linked to this deployment. Allowed + * comparison operators: `:`. + * * `deployment_type.enum_values.values.id` - The allowed value id of the + * deployment_type attribute associated with the Deployment. Allowed + * comparison operators: `:`. + * * `deployment_type.enum_values.values.display_name` - The allowed value + * display name of the deployment_type attribute associated with the + * Deployment. Allowed comparison operators: `:`. + * * `slo.string_values.values` -The allowed string value of the slo + * attribute associated with the deployment. Allowed comparison + * operators: `:`. + * * `environment.enum_values.values.id` - The allowed value id of the + * environment attribute associated with the deployment. Allowed + * comparison operators: `:`. + * * `environment.enum_values.values.display_name` - The allowed value + * display name of the environment attribute associated with the deployment. + * Allowed comparison operators: `:`. + * Expressions are combined with either `AND` logic operator or `OR` logical + * operator but not both of them together i.e. only one of the `AND` or `OR` + * operator can be used throughout the filter string and both the operators + * cannot be used together. No other logical operators are supported. At most + * three filter fields are allowed in the filter string and if provided + * more than that then `INVALID_ARGUMENT` error is returned by the API. + * Here are a few examples: + * * `environment.enum_values.values.id: staging-id` - The allowed value id + * of the environment attribute associated with the Deployment is + * _staging-id_. + * * `environment.enum_values.values.display_name: \"Staging Deployment\"` - + * The allowed value display name of the environment attribute associated + * with the Deployment is `Staging Deployment`. + * * `environment.enum_values.values.id: production-id AND create_time < + * \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - + * The allowed value id of the environment attribute associated with the + * Deployment is _production-id_ and Deployment was created before + * _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_. + * * `environment.enum_values.values.id: production-id OR + * slo.string_values.values: \"99.99%\"` + * - The allowed value id of the environment attribute Deployment is + * _production-id_ or string value of the slo attribute is _99.99%_. + */ + // const filter = 'abc123' + /** + * Optional. The maximum number of deployment resources to return. The service + * may return fewer than this value. If unspecified, at most 50 deployments + * will be returned. The maximum value is 1000; values above 1000 will be + * coerced to 1000. + */ + // const pageSize = 1234 + /** + * Optional. A page token, received from a previous `ListDeployments` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters (except page_size) provided to + * `ListDeployments` must match the call that provided the page token. + */ + // const pageToken = 'abc123' + + // Imports the Apihub library + const {ApiHubClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new ApiHubClient(); + + async function callListDeployments() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = apihubClient.listDeploymentsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListDeployments(); + // [END apihub_quickstart] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-apihub/samples/test/quickstart.js b/packages/google-cloud-apihub/samples/test/quickstart.js index 655d178f42b..7633db2256c 100644 --- a/packages/google-cloud-apihub/samples/test/quickstart.js +++ b/packages/google-cloud-apihub/samples/test/quickstart.js @@ -18,7 +18,8 @@ const assert = require('assert'); const path = require('path'); const cp = require('child_process'); const {describe, it, before} = require('mocha'); -const { RuntimeProjectAttachmentServiceClient } = require('@google-cloud/apihub').v1; +const {RuntimeProjectAttachmentServiceClient} = + require('@google-cloud/apihub').v1; const apihubClient = new RuntimeProjectAttachmentServiceClient(); const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); @@ -33,7 +34,10 @@ describe('Quickstart', () => { }); it('should run quickstart', async () => { - const output = execSync(`node ./quickstart.js projects/${projectId}/locations/us-central1`, {cwd}); + const output = execSync( + `node ./quickstart.js projects/${projectId}/locations/us-central1`, + {cwd} + ); assert(output !== null); }); }); diff --git a/owl-bot-staging/google-cloud-apihub/v1/src/index.ts b/packages/google-cloud-apihub/src/index.ts similarity index 57% rename from owl-bot-staging/google-cloud-apihub/v1/src/index.ts rename to packages/google-cloud-apihub/src/index.ts index dbd2cb2b100..f2a0759d217 100644 --- a/owl-bot-staging/google-cloud-apihub/v1/src/index.ts +++ b/packages/google-cloud-apihub/src/index.ts @@ -12,26 +12,50 @@ // See the License for the specific language governing permissions and // limitations under the License. // -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** This file is automatically generated by synthtool. ** +// ** https://github.com/googleapis/synthtool ** // ** All changes to this file may be overwritten. ** import * as v1 from './v1'; + const ApiHubClient = v1.ApiHubClient; type ApiHubClient = v1.ApiHubClient; const ApiHubDependenciesClient = v1.ApiHubDependenciesClient; type ApiHubDependenciesClient = v1.ApiHubDependenciesClient; const ApiHubPluginClient = v1.ApiHubPluginClient; type ApiHubPluginClient = v1.ApiHubPluginClient; -const HostProjectRegistrationServiceClient = v1.HostProjectRegistrationServiceClient; -type HostProjectRegistrationServiceClient = v1.HostProjectRegistrationServiceClient; +const HostProjectRegistrationServiceClient = + v1.HostProjectRegistrationServiceClient; +type HostProjectRegistrationServiceClient = + v1.HostProjectRegistrationServiceClient; const LintingServiceClient = v1.LintingServiceClient; type LintingServiceClient = v1.LintingServiceClient; const ProvisioningClient = v1.ProvisioningClient; type ProvisioningClient = v1.ProvisioningClient; -const RuntimeProjectAttachmentServiceClient = v1.RuntimeProjectAttachmentServiceClient; -type RuntimeProjectAttachmentServiceClient = v1.RuntimeProjectAttachmentServiceClient; -export {v1, ApiHubClient, ApiHubDependenciesClient, ApiHubPluginClient, HostProjectRegistrationServiceClient, LintingServiceClient, ProvisioningClient, RuntimeProjectAttachmentServiceClient}; -export default {v1, ApiHubClient, ApiHubDependenciesClient, ApiHubPluginClient, HostProjectRegistrationServiceClient, LintingServiceClient, ProvisioningClient, RuntimeProjectAttachmentServiceClient}; +const RuntimeProjectAttachmentServiceClient = + v1.RuntimeProjectAttachmentServiceClient; +type RuntimeProjectAttachmentServiceClient = + v1.RuntimeProjectAttachmentServiceClient; + +export { + v1, + ApiHubClient, + ApiHubDependenciesClient, + ApiHubPluginClient, + HostProjectRegistrationServiceClient, + LintingServiceClient, + ProvisioningClient, + RuntimeProjectAttachmentServiceClient, +}; +export default { + v1, + ApiHubClient, + ApiHubDependenciesClient, + ApiHubPluginClient, + HostProjectRegistrationServiceClient, + LintingServiceClient, + ProvisioningClient, + RuntimeProjectAttachmentServiceClient, +}; import * as protos from '../protos/protos'; -export {protos} +export {protos}; diff --git a/packages/google-cloud-apihub/src/v1/api_hub_client.ts b/packages/google-cloud-apihub/src/v1/api_hub_client.ts new file mode 100644 index 00000000000..55f3952267c --- /dev/null +++ b/packages/google-cloud-apihub/src/v1/api_hub_client.ts @@ -0,0 +1,6802 @@ +// Copyright 2024 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, + PaginationCallback, + GaxCall, + 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/api_hub_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './api_hub_client_config.json'; +const version = require('../../../package.json').version; + +/** + * This service provides all methods related to the API hub. + * @class + * @memberof v1 + */ +export class ApiHubClient { + 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}; + private _universeDomain: string; + private _servicePath: string; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + locationsClient: LocationsClient; + pathTemplates: {[name: string]: gax.PathTemplate}; + apiHubStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of ApiHubClient. + * + * @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 ApiHubClient({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 ApiHubClient; + if ( + opts?.universe_domain && + opts?.universeDomain && + opts?.universe_domain !== opts?.universeDomain + ) { + throw new Error( + 'Please set either universe_domain or universeDomain, but not both.' + ); + } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; + this._universeDomain = + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; + this._servicePath = 'apihub.' + this._universeDomain; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || this._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 !== this._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 = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + 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 === 'object' && '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 = { + apiPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}' + ), + apiHubInstancePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apiHubInstances/{api_hub_instance}' + ), + apiOperationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}' + ), + attributePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/attributes/{attribute}' + ), + definitionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}' + ), + dependencyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/dependencies/{dependency}' + ), + deploymentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/deployments/{deployment}' + ), + externalApiPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/externalApis/{external_api}' + ), + hostProjectRegistrationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/hostProjectRegistrations/{host_project_registration}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + pluginPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/plugins/{plugin}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + runtimeProjectAttachmentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}' + ), + specPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}' + ), + styleGuidePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/plugins/{plugin}/styleGuide' + ), + versionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}/versions/{version}' + ), + }; + + // 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 = { + listApis: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'apis' + ), + listVersions: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'versions' + ), + listSpecs: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'specs' + ), + listApiOperations: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'apiOperations' + ), + listDeployments: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'deployments' + ), + listAttributes: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'attributes' + ), + searchResources: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'searchResults' + ), + listExternalApis: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'externalApis' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.apihub.v1.ApiHub', + 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.apiHubStub) { + return this.apiHubStub; + } + + // Put together the "service stub" for + // google.cloud.apihub.v1.ApiHub. + this.apiHubStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.apihub.v1.ApiHub' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.apihub.v1.ApiHub, + 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 apiHubStubMethods = [ + 'createApi', + 'getApi', + 'listApis', + 'updateApi', + 'deleteApi', + 'createVersion', + 'getVersion', + 'listVersions', + 'updateVersion', + 'deleteVersion', + 'createSpec', + 'getSpec', + 'getSpecContents', + 'listSpecs', + 'updateSpec', + 'deleteSpec', + 'getApiOperation', + 'listApiOperations', + 'getDefinition', + 'createDeployment', + 'getDeployment', + 'listDeployments', + 'updateDeployment', + 'deleteDeployment', + 'createAttribute', + 'getAttribute', + 'updateAttribute', + 'deleteAttribute', + 'listAttributes', + 'searchResources', + 'createExternalApi', + 'getExternalApi', + 'updateExternalApi', + 'deleteExternalApi', + 'listExternalApis', + ]; + for (const methodName of apiHubStubMethods) { + const callPromise = this.apiHubStub.then( + stub => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const descriptor = this.descriptors.page[methodName] || undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.apiHubStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static servicePath is deprecated, please use the instance method instead.', + 'DeprecationWarning' + ); + } + return 'apihub.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static apiEndpoint is deprecated, please use the instance method instead.', + 'DeprecationWarning' + ); + } + return 'apihub.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * 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 -- + // ------------------- + /** + * Create an API resource in the API hub. + * Once an API resource is created, versions can be added to it. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource for the API resource. + * Format: `projects/{project}/locations/{location}` + * @param {string} [request.apiId] + * Optional. The ID to use for the API resource, which will become the final + * component of the API's resource name. This field is optional. + * + * * If provided, the same will be used. The service will throw an error if + * the specified id is already used by another API resource in the API hub. + * * If not provided, a system generated id will be used. + * + * This value should be 4-500 characters, and valid characters + * are /{@link protos.A-Z|a-z}[0-9]-_/. + * @param {google.cloud.apihub.v1.Api} request.api + * Required. The API resource to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.apihub.v1.Api|Api}. + * 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/api_hub.create_api.js + * region_tag:apihub_v1_generated_ApiHub_CreateApi_async + */ + createApi( + request?: protos.google.cloud.apihub.v1.ICreateApiRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apihub.v1.IApi, + protos.google.cloud.apihub.v1.ICreateApiRequest | undefined, + {} | undefined, + ] + >; + createApi( + request: protos.google.cloud.apihub.v1.ICreateApiRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.IApi, + protos.google.cloud.apihub.v1.ICreateApiRequest | null | undefined, + {} | null | undefined + > + ): void; + createApi( + request: protos.google.cloud.apihub.v1.ICreateApiRequest, + callback: Callback< + protos.google.cloud.apihub.v1.IApi, + protos.google.cloud.apihub.v1.ICreateApiRequest | null | undefined, + {} | null | undefined + > + ): void; + createApi( + request?: protos.google.cloud.apihub.v1.ICreateApiRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.apihub.v1.IApi, + protos.google.cloud.apihub.v1.ICreateApiRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.apihub.v1.IApi, + protos.google.cloud.apihub.v1.ICreateApiRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.apihub.v1.IApi, + protos.google.cloud.apihub.v1.ICreateApiRequest | 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.createApi(request, options, callback); + } + /** + * Get API resource details including the API versions contained in it. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the API resource to retrieve. + * Format: `projects/{project}/locations/{location}/apis/{api}` + * @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.apihub.v1.Api|Api}. + * 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/api_hub.get_api.js + * region_tag:apihub_v1_generated_ApiHub_GetApi_async + */ + getApi( + request?: protos.google.cloud.apihub.v1.IGetApiRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apihub.v1.IApi, + protos.google.cloud.apihub.v1.IGetApiRequest | undefined, + {} | undefined, + ] + >; + getApi( + request: protos.google.cloud.apihub.v1.IGetApiRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.IApi, + protos.google.cloud.apihub.v1.IGetApiRequest | null | undefined, + {} | null | undefined + > + ): void; + getApi( + request: protos.google.cloud.apihub.v1.IGetApiRequest, + callback: Callback< + protos.google.cloud.apihub.v1.IApi, + protos.google.cloud.apihub.v1.IGetApiRequest | null | undefined, + {} | null | undefined + > + ): void; + getApi( + request?: protos.google.cloud.apihub.v1.IGetApiRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.apihub.v1.IApi, + protos.google.cloud.apihub.v1.IGetApiRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.apihub.v1.IApi, + protos.google.cloud.apihub.v1.IGetApiRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.apihub.v1.IApi, + protos.google.cloud.apihub.v1.IGetApiRequest | 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.getApi(request, options, callback); + } + /** + * Update an API resource in the API hub. The following fields in the + * {@link protos.|API} can be updated: + * + * * {@link protos.google.cloud.apihub.v1.Api.display_name|display_name} + * * {@link protos.google.cloud.apihub.v1.Api.description|description} + * * {@link protos.google.cloud.apihub.v1.Api.owner|owner} + * * {@link protos.google.cloud.apihub.v1.Api.documentation|documentation} + * * {@link protos.google.cloud.apihub.v1.Api.target_user|target_user} + * * {@link protos.google.cloud.apihub.v1.Api.team|team} + * * {@link protos.google.cloud.apihub.v1.Api.business_unit|business_unit} + * * {@link protos.google.cloud.apihub.v1.Api.maturity_level|maturity_level} + * * {@link protos.google.cloud.apihub.v1.Api.attributes|attributes} + * + * The + * {@link protos.google.cloud.apihub.v1.UpdateApiRequest.update_mask|update_mask} + * should be used to specify the fields being updated. + * + * Updating the owner field requires complete owner message + * and updates both owner and email fields. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.apihub.v1.Api} request.api + * Required. The API resource to update. + * + * The API resource's `name` field is used to identify the API resource to + * update. + * Format: `projects/{project}/locations/{location}/apis/{api}` + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The list of fields to update. + * @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.apihub.v1.Api|Api}. + * 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/api_hub.update_api.js + * region_tag:apihub_v1_generated_ApiHub_UpdateApi_async + */ + updateApi( + request?: protos.google.cloud.apihub.v1.IUpdateApiRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apihub.v1.IApi, + protos.google.cloud.apihub.v1.IUpdateApiRequest | undefined, + {} | undefined, + ] + >; + updateApi( + request: protos.google.cloud.apihub.v1.IUpdateApiRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.IApi, + protos.google.cloud.apihub.v1.IUpdateApiRequest | null | undefined, + {} | null | undefined + > + ): void; + updateApi( + request: protos.google.cloud.apihub.v1.IUpdateApiRequest, + callback: Callback< + protos.google.cloud.apihub.v1.IApi, + protos.google.cloud.apihub.v1.IUpdateApiRequest | null | undefined, + {} | null | undefined + > + ): void; + updateApi( + request?: protos.google.cloud.apihub.v1.IUpdateApiRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.apihub.v1.IApi, + protos.google.cloud.apihub.v1.IUpdateApiRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.apihub.v1.IApi, + protos.google.cloud.apihub.v1.IUpdateApiRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.apihub.v1.IApi, + protos.google.cloud.apihub.v1.IUpdateApiRequest | 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({ + 'api.name': request.api!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateApi(request, options, callback); + } + /** + * Delete an API resource in the API hub. API can only be deleted if all + * underlying versions are deleted. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the API resource to delete. + * Format: `projects/{project}/locations/{location}/apis/{api}` + * @param {boolean} [request.force] + * Optional. If set to true, any versions from this API will also be deleted. + * Otherwise, the request will only work if the API has no versions. + * @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.protobuf.Empty|Empty}. + * 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/api_hub.delete_api.js + * region_tag:apihub_v1_generated_ApiHub_DeleteApi_async + */ + deleteApi( + request?: protos.google.cloud.apihub.v1.IDeleteApiRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteApiRequest | undefined, + {} | undefined, + ] + >; + deleteApi( + request: protos.google.cloud.apihub.v1.IDeleteApiRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteApiRequest | null | undefined, + {} | null | undefined + > + ): void; + deleteApi( + request: protos.google.cloud.apihub.v1.IDeleteApiRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteApiRequest | null | undefined, + {} | null | undefined + > + ): void; + deleteApi( + request?: protos.google.cloud.apihub.v1.IDeleteApiRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteApiRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteApiRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteApiRequest | 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.deleteApi(request, options, callback); + } + /** + * Create an API version for an API resource in the API hub. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource for API version. + * Format: `projects/{project}/locations/{location}/apis/{api}` + * @param {string} [request.versionId] + * Optional. The ID to use for the API version, which will become the final + * component of the version's resource name. This field is optional. + * + * * If provided, the same will be used. The service will throw an error if + * the specified id is already used by another version in the API resource. + * * If not provided, a system generated id will be used. + * + * This value should be 4-500 characters, and valid characters + * are /{@link protos.A-Z|a-z}[0-9]-_/. + * @param {google.cloud.apihub.v1.Version} request.version + * Required. The version to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.apihub.v1.Version|Version}. + * 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/api_hub.create_version.js + * region_tag:apihub_v1_generated_ApiHub_CreateVersion_async + */ + createVersion( + request?: protos.google.cloud.apihub.v1.ICreateVersionRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apihub.v1.IVersion, + protos.google.cloud.apihub.v1.ICreateVersionRequest | undefined, + {} | undefined, + ] + >; + createVersion( + request: protos.google.cloud.apihub.v1.ICreateVersionRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.IVersion, + protos.google.cloud.apihub.v1.ICreateVersionRequest | null | undefined, + {} | null | undefined + > + ): void; + createVersion( + request: protos.google.cloud.apihub.v1.ICreateVersionRequest, + callback: Callback< + protos.google.cloud.apihub.v1.IVersion, + protos.google.cloud.apihub.v1.ICreateVersionRequest | null | undefined, + {} | null | undefined + > + ): void; + createVersion( + request?: protos.google.cloud.apihub.v1.ICreateVersionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.apihub.v1.IVersion, + | protos.google.cloud.apihub.v1.ICreateVersionRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.apihub.v1.IVersion, + protos.google.cloud.apihub.v1.ICreateVersionRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.apihub.v1.IVersion, + protos.google.cloud.apihub.v1.ICreateVersionRequest | 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.createVersion(request, options, callback); + } + /** + * Get details about the API version of an API resource. This will include + * information about the specs and operations present in the API + * version as well as the deployments linked to it. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the API version to retrieve. + * Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}` + * @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.apihub.v1.Version|Version}. + * 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/api_hub.get_version.js + * region_tag:apihub_v1_generated_ApiHub_GetVersion_async + */ + getVersion( + request?: protos.google.cloud.apihub.v1.IGetVersionRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apihub.v1.IVersion, + protos.google.cloud.apihub.v1.IGetVersionRequest | undefined, + {} | undefined, + ] + >; + getVersion( + request: protos.google.cloud.apihub.v1.IGetVersionRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.IVersion, + protos.google.cloud.apihub.v1.IGetVersionRequest | null | undefined, + {} | null | undefined + > + ): void; + getVersion( + request: protos.google.cloud.apihub.v1.IGetVersionRequest, + callback: Callback< + protos.google.cloud.apihub.v1.IVersion, + protos.google.cloud.apihub.v1.IGetVersionRequest | null | undefined, + {} | null | undefined + > + ): void; + getVersion( + request?: protos.google.cloud.apihub.v1.IGetVersionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.apihub.v1.IVersion, + protos.google.cloud.apihub.v1.IGetVersionRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.apihub.v1.IVersion, + protos.google.cloud.apihub.v1.IGetVersionRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.apihub.v1.IVersion, + protos.google.cloud.apihub.v1.IGetVersionRequest | 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.getVersion(request, options, callback); + } + /** + * Update API version. The following fields in the + * {@link protos.google.cloud.apihub.v1.Version|version} can be updated currently: + * + * * {@link protos.google.cloud.apihub.v1.Version.display_name|display_name} + * * {@link protos.google.cloud.apihub.v1.Version.description|description} + * * {@link protos.google.cloud.apihub.v1.Version.documentation|documentation} + * * {@link protos.google.cloud.apihub.v1.Version.deployments|deployments} + * * {@link protos.google.cloud.apihub.v1.Version.lifecycle|lifecycle} + * * {@link protos.google.cloud.apihub.v1.Version.compliance|compliance} + * * {@link protos.google.cloud.apihub.v1.Version.accreditation|accreditation} + * * {@link protos.google.cloud.apihub.v1.Version.attributes|attributes} + * + * The + * {@link protos.google.cloud.apihub.v1.UpdateVersionRequest.update_mask|update_mask} + * should be used to specify the fields being updated. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.apihub.v1.Version} request.version + * Required. The API version to update. + * + * The version's `name` field is used to identify the API version to update. + * Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}` + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The list of fields to update. + * @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.apihub.v1.Version|Version}. + * 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/api_hub.update_version.js + * region_tag:apihub_v1_generated_ApiHub_UpdateVersion_async + */ + updateVersion( + request?: protos.google.cloud.apihub.v1.IUpdateVersionRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apihub.v1.IVersion, + protos.google.cloud.apihub.v1.IUpdateVersionRequest | undefined, + {} | undefined, + ] + >; + updateVersion( + request: protos.google.cloud.apihub.v1.IUpdateVersionRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.IVersion, + protos.google.cloud.apihub.v1.IUpdateVersionRequest | null | undefined, + {} | null | undefined + > + ): void; + updateVersion( + request: protos.google.cloud.apihub.v1.IUpdateVersionRequest, + callback: Callback< + protos.google.cloud.apihub.v1.IVersion, + protos.google.cloud.apihub.v1.IUpdateVersionRequest | null | undefined, + {} | null | undefined + > + ): void; + updateVersion( + request?: protos.google.cloud.apihub.v1.IUpdateVersionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.apihub.v1.IVersion, + | protos.google.cloud.apihub.v1.IUpdateVersionRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.apihub.v1.IVersion, + protos.google.cloud.apihub.v1.IUpdateVersionRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.apihub.v1.IVersion, + protos.google.cloud.apihub.v1.IUpdateVersionRequest | 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({ + 'version.name': request.version!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateVersion(request, options, callback); + } + /** + * Delete an API version. Version can only be deleted if all underlying specs, + * operations, definitions and linked deployments are deleted. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the version to delete. + * Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}` + * @param {boolean} [request.force] + * Optional. If set to true, any specs from this version will also be deleted. + * Otherwise, the request will only work if the version has no specs. + * @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.protobuf.Empty|Empty}. + * 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/api_hub.delete_version.js + * region_tag:apihub_v1_generated_ApiHub_DeleteVersion_async + */ + deleteVersion( + request?: protos.google.cloud.apihub.v1.IDeleteVersionRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteVersionRequest | undefined, + {} | undefined, + ] + >; + deleteVersion( + request: protos.google.cloud.apihub.v1.IDeleteVersionRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteVersionRequest | null | undefined, + {} | null | undefined + > + ): void; + deleteVersion( + request: protos.google.cloud.apihub.v1.IDeleteVersionRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteVersionRequest | null | undefined, + {} | null | undefined + > + ): void; + deleteVersion( + request?: protos.google.cloud.apihub.v1.IDeleteVersionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.apihub.v1.IDeleteVersionRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteVersionRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteVersionRequest | 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.deleteVersion(request, options, callback); + } + /** + * Add a spec to an API version in the API hub. + * Multiple specs can be added to an API version. + * Note, while adding a spec, at least one of `contents` or `source_uri` must + * be provided. If `contents` is provided, then `spec_type` must also be + * provided. + * + * On adding a spec with contents to the version, the operations present in it + * will be added to the version.Note that the file contents in the spec should + * be of the same type as defined in the + * `projects/{project}/locations/{location}/attributes/system-spec-type` + * attribute associated with spec resource. Note that specs of various types + * can be uploaded, however parsing of details is supported for OpenAPI spec + * currently. + * + * In order to access the information parsed from the spec, use the + * {@link protos.google.cloud.apihub.v1.ApiHub.GetSpec|GetSpec} method. + * In order to access the raw contents for a particular spec, use the + * {@link protos.google.cloud.apihub.v1.ApiHub.GetSpecContents|GetSpecContents} method. + * In order to access the operations parsed from the spec, use the + * {@link protos.google.cloud.apihub.v1.ApiHub.ListApiOperations|ListAPIOperations} + * method. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource for Spec. + * Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}` + * @param {string} [request.specId] + * Optional. The ID to use for the spec, which will become the final component + * of the spec's resource name. This field is optional. + * + * * If provided, the same will be used. The service will throw an error if + * the specified id is already used by another spec in the API + * resource. + * * If not provided, a system generated id will be used. + * + * This value should be 4-500 characters, and valid characters + * are /{@link protos.A-Z|a-z}[0-9]-_/. + * @param {google.cloud.apihub.v1.Spec} request.spec + * Required. The spec to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.apihub.v1.Spec|Spec}. + * 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/api_hub.create_spec.js + * region_tag:apihub_v1_generated_ApiHub_CreateSpec_async + */ + createSpec( + request?: protos.google.cloud.apihub.v1.ICreateSpecRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apihub.v1.ISpec, + protos.google.cloud.apihub.v1.ICreateSpecRequest | undefined, + {} | undefined, + ] + >; + createSpec( + request: protos.google.cloud.apihub.v1.ICreateSpecRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.ISpec, + protos.google.cloud.apihub.v1.ICreateSpecRequest | null | undefined, + {} | null | undefined + > + ): void; + createSpec( + request: protos.google.cloud.apihub.v1.ICreateSpecRequest, + callback: Callback< + protos.google.cloud.apihub.v1.ISpec, + protos.google.cloud.apihub.v1.ICreateSpecRequest | null | undefined, + {} | null | undefined + > + ): void; + createSpec( + request?: protos.google.cloud.apihub.v1.ICreateSpecRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.apihub.v1.ISpec, + protos.google.cloud.apihub.v1.ICreateSpecRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.apihub.v1.ISpec, + protos.google.cloud.apihub.v1.ICreateSpecRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.apihub.v1.ISpec, + protos.google.cloud.apihub.v1.ICreateSpecRequest | 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.createSpec(request, options, callback); + } + /** + * Get details about the information parsed from a spec. + * Note that this method does not return the raw spec contents. + * Use {@link protos.google.cloud.apihub.v1.ApiHub.GetSpecContents|GetSpecContents} method + * to retrieve the same. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the spec to retrieve. + * Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}` + * @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.apihub.v1.Spec|Spec}. + * 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/api_hub.get_spec.js + * region_tag:apihub_v1_generated_ApiHub_GetSpec_async + */ + getSpec( + request?: protos.google.cloud.apihub.v1.IGetSpecRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apihub.v1.ISpec, + protos.google.cloud.apihub.v1.IGetSpecRequest | undefined, + {} | undefined, + ] + >; + getSpec( + request: protos.google.cloud.apihub.v1.IGetSpecRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.ISpec, + protos.google.cloud.apihub.v1.IGetSpecRequest | null | undefined, + {} | null | undefined + > + ): void; + getSpec( + request: protos.google.cloud.apihub.v1.IGetSpecRequest, + callback: Callback< + protos.google.cloud.apihub.v1.ISpec, + protos.google.cloud.apihub.v1.IGetSpecRequest | null | undefined, + {} | null | undefined + > + ): void; + getSpec( + request?: protos.google.cloud.apihub.v1.IGetSpecRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.apihub.v1.ISpec, + protos.google.cloud.apihub.v1.IGetSpecRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.apihub.v1.ISpec, + protos.google.cloud.apihub.v1.IGetSpecRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.apihub.v1.ISpec, + protos.google.cloud.apihub.v1.IGetSpecRequest | 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.getSpec(request, options, callback); + } + /** + * Get spec contents. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the spec whose contents need to be retrieved. + * Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}` + * @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.apihub.v1.SpecContents|SpecContents}. + * 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/api_hub.get_spec_contents.js + * region_tag:apihub_v1_generated_ApiHub_GetSpecContents_async + */ + getSpecContents( + request?: protos.google.cloud.apihub.v1.IGetSpecContentsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apihub.v1.ISpecContents, + protos.google.cloud.apihub.v1.IGetSpecContentsRequest | undefined, + {} | undefined, + ] + >; + getSpecContents( + request: protos.google.cloud.apihub.v1.IGetSpecContentsRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.ISpecContents, + protos.google.cloud.apihub.v1.IGetSpecContentsRequest | null | undefined, + {} | null | undefined + > + ): void; + getSpecContents( + request: protos.google.cloud.apihub.v1.IGetSpecContentsRequest, + callback: Callback< + protos.google.cloud.apihub.v1.ISpecContents, + protos.google.cloud.apihub.v1.IGetSpecContentsRequest | null | undefined, + {} | null | undefined + > + ): void; + getSpecContents( + request?: protos.google.cloud.apihub.v1.IGetSpecContentsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.apihub.v1.ISpecContents, + | protos.google.cloud.apihub.v1.IGetSpecContentsRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.apihub.v1.ISpecContents, + protos.google.cloud.apihub.v1.IGetSpecContentsRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.apihub.v1.ISpecContents, + protos.google.cloud.apihub.v1.IGetSpecContentsRequest | 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.getSpecContents(request, options, callback); + } + /** + * Update spec. The following fields in the + * {@link protos.google.cloud.apihub.v1.Spec|spec} can be updated: + * + * * {@link protos.google.cloud.apihub.v1.Spec.display_name|display_name} + * * {@link protos.google.cloud.apihub.v1.Spec.source_uri|source_uri} + * * {@link protos.google.cloud.apihub.v1.Spec.lint_response|lint_response} + * * {@link protos.google.cloud.apihub.v1.Spec.attributes|attributes} + * * {@link protos.google.cloud.apihub.v1.Spec.contents|contents} + * * {@link protos.google.cloud.apihub.v1.Spec.spec_type|spec_type} + * + * In case of an OAS spec, updating spec contents can lead to: + * 1. Creation, deletion and update of operations. + * 2. Creation, deletion and update of definitions. + * 3. Update of other info parsed out from the new spec. + * + * In case of contents or source_uri being present in update mask, spec_type + * must also be present. Also, spec_type can not be present in update mask if + * contents or source_uri is not present. + * + * The + * {@link protos.google.cloud.apihub.v1.UpdateSpecRequest.update_mask|update_mask} + * should be used to specify the fields being updated. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.apihub.v1.Spec} request.spec + * Required. The spec to update. + * + * The spec's `name` field is used to identify the spec to + * update. Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}` + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The list of fields to update. + * @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.apihub.v1.Spec|Spec}. + * 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/api_hub.update_spec.js + * region_tag:apihub_v1_generated_ApiHub_UpdateSpec_async + */ + updateSpec( + request?: protos.google.cloud.apihub.v1.IUpdateSpecRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apihub.v1.ISpec, + protos.google.cloud.apihub.v1.IUpdateSpecRequest | undefined, + {} | undefined, + ] + >; + updateSpec( + request: protos.google.cloud.apihub.v1.IUpdateSpecRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.ISpec, + protos.google.cloud.apihub.v1.IUpdateSpecRequest | null | undefined, + {} | null | undefined + > + ): void; + updateSpec( + request: protos.google.cloud.apihub.v1.IUpdateSpecRequest, + callback: Callback< + protos.google.cloud.apihub.v1.ISpec, + protos.google.cloud.apihub.v1.IUpdateSpecRequest | null | undefined, + {} | null | undefined + > + ): void; + updateSpec( + request?: protos.google.cloud.apihub.v1.IUpdateSpecRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.apihub.v1.ISpec, + protos.google.cloud.apihub.v1.IUpdateSpecRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.apihub.v1.ISpec, + protos.google.cloud.apihub.v1.IUpdateSpecRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.apihub.v1.ISpec, + protos.google.cloud.apihub.v1.IUpdateSpecRequest | 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({ + 'spec.name': request.spec!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateSpec(request, options, callback); + } + /** + * Delete a spec. + * Deleting a spec will also delete the associated operations from the + * version. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the spec to delete. + * Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}` + * @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.protobuf.Empty|Empty}. + * 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/api_hub.delete_spec.js + * region_tag:apihub_v1_generated_ApiHub_DeleteSpec_async + */ + deleteSpec( + request?: protos.google.cloud.apihub.v1.IDeleteSpecRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteSpecRequest | undefined, + {} | undefined, + ] + >; + deleteSpec( + request: protos.google.cloud.apihub.v1.IDeleteSpecRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteSpecRequest | null | undefined, + {} | null | undefined + > + ): void; + deleteSpec( + request: protos.google.cloud.apihub.v1.IDeleteSpecRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteSpecRequest | null | undefined, + {} | null | undefined + > + ): void; + deleteSpec( + request?: protos.google.cloud.apihub.v1.IDeleteSpecRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteSpecRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteSpecRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteSpecRequest | 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.deleteSpec(request, options, callback); + } + /** + * Get details about a particular operation in API version. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the operation to retrieve. + * Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}` + * @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.apihub.v1.ApiOperation|ApiOperation}. + * 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/api_hub.get_api_operation.js + * region_tag:apihub_v1_generated_ApiHub_GetApiOperation_async + */ + getApiOperation( + request?: protos.google.cloud.apihub.v1.IGetApiOperationRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apihub.v1.IApiOperation, + protos.google.cloud.apihub.v1.IGetApiOperationRequest | undefined, + {} | undefined, + ] + >; + getApiOperation( + request: protos.google.cloud.apihub.v1.IGetApiOperationRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.IApiOperation, + protos.google.cloud.apihub.v1.IGetApiOperationRequest | null | undefined, + {} | null | undefined + > + ): void; + getApiOperation( + request: protos.google.cloud.apihub.v1.IGetApiOperationRequest, + callback: Callback< + protos.google.cloud.apihub.v1.IApiOperation, + protos.google.cloud.apihub.v1.IGetApiOperationRequest | null | undefined, + {} | null | undefined + > + ): void; + getApiOperation( + request?: protos.google.cloud.apihub.v1.IGetApiOperationRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.apihub.v1.IApiOperation, + | protos.google.cloud.apihub.v1.IGetApiOperationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.apihub.v1.IApiOperation, + protos.google.cloud.apihub.v1.IGetApiOperationRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.apihub.v1.IApiOperation, + protos.google.cloud.apihub.v1.IGetApiOperationRequest | 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.getApiOperation(request, options, callback); + } + /** + * Get details about a definition in an API version. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the definition to retrieve. + * Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}` + * @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.apihub.v1.Definition|Definition}. + * 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/api_hub.get_definition.js + * region_tag:apihub_v1_generated_ApiHub_GetDefinition_async + */ + getDefinition( + request?: protos.google.cloud.apihub.v1.IGetDefinitionRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apihub.v1.IDefinition, + protos.google.cloud.apihub.v1.IGetDefinitionRequest | undefined, + {} | undefined, + ] + >; + getDefinition( + request: protos.google.cloud.apihub.v1.IGetDefinitionRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.IDefinition, + protos.google.cloud.apihub.v1.IGetDefinitionRequest | null | undefined, + {} | null | undefined + > + ): void; + getDefinition( + request: protos.google.cloud.apihub.v1.IGetDefinitionRequest, + callback: Callback< + protos.google.cloud.apihub.v1.IDefinition, + protos.google.cloud.apihub.v1.IGetDefinitionRequest | null | undefined, + {} | null | undefined + > + ): void; + getDefinition( + request?: protos.google.cloud.apihub.v1.IGetDefinitionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.apihub.v1.IDefinition, + | protos.google.cloud.apihub.v1.IGetDefinitionRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.apihub.v1.IDefinition, + protos.google.cloud.apihub.v1.IGetDefinitionRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.apihub.v1.IDefinition, + protos.google.cloud.apihub.v1.IGetDefinitionRequest | 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.getDefinition(request, options, callback); + } + /** + * Create a deployment resource in the API hub. + * Once a deployment resource is created, it can be associated with API + * versions. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource for the deployment resource. + * Format: `projects/{project}/locations/{location}` + * @param {string} [request.deploymentId] + * Optional. The ID to use for the deployment resource, which will become the + * final component of the deployment's resource name. This field is optional. + * + * * If provided, the same will be used. The service will throw an error if + * the specified id is already used by another deployment resource in the API + * hub. + * * If not provided, a system generated id will be used. + * + * This value should be 4-500 characters, and valid characters + * are /{@link protos.A-Z|a-z}[0-9]-_/. + * @param {google.cloud.apihub.v1.Deployment} request.deployment + * Required. The deployment resource to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.apihub.v1.Deployment|Deployment}. + * 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/api_hub.create_deployment.js + * region_tag:apihub_v1_generated_ApiHub_CreateDeployment_async + */ + createDeployment( + request?: protos.google.cloud.apihub.v1.ICreateDeploymentRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apihub.v1.IDeployment, + protos.google.cloud.apihub.v1.ICreateDeploymentRequest | undefined, + {} | undefined, + ] + >; + createDeployment( + request: protos.google.cloud.apihub.v1.ICreateDeploymentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.IDeployment, + protos.google.cloud.apihub.v1.ICreateDeploymentRequest | null | undefined, + {} | null | undefined + > + ): void; + createDeployment( + request: protos.google.cloud.apihub.v1.ICreateDeploymentRequest, + callback: Callback< + protos.google.cloud.apihub.v1.IDeployment, + protos.google.cloud.apihub.v1.ICreateDeploymentRequest | null | undefined, + {} | null | undefined + > + ): void; + createDeployment( + request?: protos.google.cloud.apihub.v1.ICreateDeploymentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.apihub.v1.IDeployment, + | protos.google.cloud.apihub.v1.ICreateDeploymentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.apihub.v1.IDeployment, + protos.google.cloud.apihub.v1.ICreateDeploymentRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.apihub.v1.IDeployment, + protos.google.cloud.apihub.v1.ICreateDeploymentRequest | 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.createDeployment(request, options, callback); + } + /** + * Get details about a deployment and the API versions linked to it. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the deployment resource to retrieve. + * Format: `projects/{project}/locations/{location}/deployments/{deployment}` + * @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.apihub.v1.Deployment|Deployment}. + * 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/api_hub.get_deployment.js + * region_tag:apihub_v1_generated_ApiHub_GetDeployment_async + */ + getDeployment( + request?: protos.google.cloud.apihub.v1.IGetDeploymentRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apihub.v1.IDeployment, + protos.google.cloud.apihub.v1.IGetDeploymentRequest | undefined, + {} | undefined, + ] + >; + getDeployment( + request: protos.google.cloud.apihub.v1.IGetDeploymentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.IDeployment, + protos.google.cloud.apihub.v1.IGetDeploymentRequest | null | undefined, + {} | null | undefined + > + ): void; + getDeployment( + request: protos.google.cloud.apihub.v1.IGetDeploymentRequest, + callback: Callback< + protos.google.cloud.apihub.v1.IDeployment, + protos.google.cloud.apihub.v1.IGetDeploymentRequest | null | undefined, + {} | null | undefined + > + ): void; + getDeployment( + request?: protos.google.cloud.apihub.v1.IGetDeploymentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.apihub.v1.IDeployment, + | protos.google.cloud.apihub.v1.IGetDeploymentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.apihub.v1.IDeployment, + protos.google.cloud.apihub.v1.IGetDeploymentRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.apihub.v1.IDeployment, + protos.google.cloud.apihub.v1.IGetDeploymentRequest | 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.getDeployment(request, options, callback); + } + /** + * Update a deployment resource in the API hub. The following fields in the + * {@link protos.google.cloud.apihub.v1.Deployment|deployment resource} can be + * updated: + * + * * {@link protos.google.cloud.apihub.v1.Deployment.display_name|display_name} + * * {@link protos.google.cloud.apihub.v1.Deployment.description|description} + * * {@link protos.google.cloud.apihub.v1.Deployment.documentation|documentation} + * * {@link protos.google.cloud.apihub.v1.Deployment.deployment_type|deployment_type} + * * {@link protos.google.cloud.apihub.v1.Deployment.resource_uri|resource_uri} + * * {@link protos.google.cloud.apihub.v1.Deployment.endpoints|endpoints} + * * {@link protos.google.cloud.apihub.v1.Deployment.slo|slo} + * * {@link protos.google.cloud.apihub.v1.Deployment.environment|environment} + * * {@link protos.google.cloud.apihub.v1.Deployment.attributes|attributes} + * + * The + * {@link protos.google.cloud.apihub.v1.UpdateDeploymentRequest.update_mask|update_mask} + * should be used to specify the fields being updated. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.apihub.v1.Deployment} request.deployment + * Required. The deployment resource to update. + * + * The deployment resource's `name` field is used to identify the deployment + * resource to update. + * Format: `projects/{project}/locations/{location}/deployments/{deployment}` + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The list of fields to update. + * @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.apihub.v1.Deployment|Deployment}. + * 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/api_hub.update_deployment.js + * region_tag:apihub_v1_generated_ApiHub_UpdateDeployment_async + */ + updateDeployment( + request?: protos.google.cloud.apihub.v1.IUpdateDeploymentRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apihub.v1.IDeployment, + protos.google.cloud.apihub.v1.IUpdateDeploymentRequest | undefined, + {} | undefined, + ] + >; + updateDeployment( + request: protos.google.cloud.apihub.v1.IUpdateDeploymentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.IDeployment, + protos.google.cloud.apihub.v1.IUpdateDeploymentRequest | null | undefined, + {} | null | undefined + > + ): void; + updateDeployment( + request: protos.google.cloud.apihub.v1.IUpdateDeploymentRequest, + callback: Callback< + protos.google.cloud.apihub.v1.IDeployment, + protos.google.cloud.apihub.v1.IUpdateDeploymentRequest | null | undefined, + {} | null | undefined + > + ): void; + updateDeployment( + request?: protos.google.cloud.apihub.v1.IUpdateDeploymentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.apihub.v1.IDeployment, + | protos.google.cloud.apihub.v1.IUpdateDeploymentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.apihub.v1.IDeployment, + protos.google.cloud.apihub.v1.IUpdateDeploymentRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.apihub.v1.IDeployment, + protos.google.cloud.apihub.v1.IUpdateDeploymentRequest | 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({ + 'deployment.name': request.deployment!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateDeployment(request, options, callback); + } + /** + * Delete a deployment resource in the API hub. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the deployment resource to delete. + * Format: `projects/{project}/locations/{location}/deployments/{deployment}` + * @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.protobuf.Empty|Empty}. + * 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/api_hub.delete_deployment.js + * region_tag:apihub_v1_generated_ApiHub_DeleteDeployment_async + */ + deleteDeployment( + request?: protos.google.cloud.apihub.v1.IDeleteDeploymentRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteDeploymentRequest | undefined, + {} | undefined, + ] + >; + deleteDeployment( + request: protos.google.cloud.apihub.v1.IDeleteDeploymentRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteDeploymentRequest | null | undefined, + {} | null | undefined + > + ): void; + deleteDeployment( + request: protos.google.cloud.apihub.v1.IDeleteDeploymentRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteDeploymentRequest | null | undefined, + {} | null | undefined + > + ): void; + deleteDeployment( + request?: protos.google.cloud.apihub.v1.IDeleteDeploymentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.apihub.v1.IDeleteDeploymentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteDeploymentRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteDeploymentRequest | 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.deleteDeployment(request, options, callback); + } + /** + * Create a user defined attribute. + * + * Certain pre defined attributes are already created by the API hub. These + * attributes will have type as `SYSTEM_DEFINED` and can be listed via + * {@link protos.google.cloud.apihub.v1.ApiHub.ListAttributes|ListAttributes} method. + * Allowed values for the same can be updated via + * {@link protos.google.cloud.apihub.v1.ApiHub.UpdateAttribute|UpdateAttribute} method. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource for Attribute. + * Format: `projects/{project}/locations/{location}` + * @param {string} [request.attributeId] + * Optional. The ID to use for the attribute, which will become the final + * component of the attribute's resource name. This field is optional. + * + * * If provided, the same will be used. The service will throw an error if + * the specified id is already used by another attribute resource in the API + * hub. + * * If not provided, a system generated id will be used. + * + * This value should be 4-500 characters, and valid characters + * are /{@link protos.A-Z|a-z}[0-9]-_/. + * @param {google.cloud.apihub.v1.Attribute} request.attribute + * Required. The attribute to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.apihub.v1.Attribute|Attribute}. + * 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/api_hub.create_attribute.js + * region_tag:apihub_v1_generated_ApiHub_CreateAttribute_async + */ + createAttribute( + request?: protos.google.cloud.apihub.v1.ICreateAttributeRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apihub.v1.IAttribute, + protos.google.cloud.apihub.v1.ICreateAttributeRequest | undefined, + {} | undefined, + ] + >; + createAttribute( + request: protos.google.cloud.apihub.v1.ICreateAttributeRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.IAttribute, + protos.google.cloud.apihub.v1.ICreateAttributeRequest | null | undefined, + {} | null | undefined + > + ): void; + createAttribute( + request: protos.google.cloud.apihub.v1.ICreateAttributeRequest, + callback: Callback< + protos.google.cloud.apihub.v1.IAttribute, + protos.google.cloud.apihub.v1.ICreateAttributeRequest | null | undefined, + {} | null | undefined + > + ): void; + createAttribute( + request?: protos.google.cloud.apihub.v1.ICreateAttributeRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.apihub.v1.IAttribute, + | protos.google.cloud.apihub.v1.ICreateAttributeRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.apihub.v1.IAttribute, + protos.google.cloud.apihub.v1.ICreateAttributeRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.apihub.v1.IAttribute, + protos.google.cloud.apihub.v1.ICreateAttributeRequest | 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.createAttribute(request, options, callback); + } + /** + * Get details about the attribute. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the attribute to retrieve. + * Format: + * `projects/{project}/locations/{location}/attributes/{attribute}` + * @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.apihub.v1.Attribute|Attribute}. + * 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/api_hub.get_attribute.js + * region_tag:apihub_v1_generated_ApiHub_GetAttribute_async + */ + getAttribute( + request?: protos.google.cloud.apihub.v1.IGetAttributeRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apihub.v1.IAttribute, + protos.google.cloud.apihub.v1.IGetAttributeRequest | undefined, + {} | undefined, + ] + >; + getAttribute( + request: protos.google.cloud.apihub.v1.IGetAttributeRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.IAttribute, + protos.google.cloud.apihub.v1.IGetAttributeRequest | null | undefined, + {} | null | undefined + > + ): void; + getAttribute( + request: protos.google.cloud.apihub.v1.IGetAttributeRequest, + callback: Callback< + protos.google.cloud.apihub.v1.IAttribute, + protos.google.cloud.apihub.v1.IGetAttributeRequest | null | undefined, + {} | null | undefined + > + ): void; + getAttribute( + request?: protos.google.cloud.apihub.v1.IGetAttributeRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.apihub.v1.IAttribute, + protos.google.cloud.apihub.v1.IGetAttributeRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.apihub.v1.IAttribute, + protos.google.cloud.apihub.v1.IGetAttributeRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.apihub.v1.IAttribute, + protos.google.cloud.apihub.v1.IGetAttributeRequest | 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.getAttribute(request, options, callback); + } + /** + * Update the attribute. The following fields in the + * {@link protos.google.cloud.apihub.v1.Attribute|Attribute resource} can be updated: + * + * * {@link protos.google.cloud.apihub.v1.Attribute.display_name|display_name} + * The display name can be updated for user defined attributes only. + * * {@link protos.google.cloud.apihub.v1.Attribute.description|description} + * The description can be updated for user defined attributes only. + * * {@link protos.google.cloud.apihub.v1.Attribute.allowed_values|allowed_values} + * To update the list of allowed values, clients need to use the fetched list + * of allowed values and add or remove values to or from the same list. + * The mutable allowed values can be updated for both user defined and System + * defined attributes. The immutable allowed values cannot be updated or + * deleted. The updated list of allowed values cannot be empty. If an allowed + * value that is already used by some resource's attribute is deleted, then + * the association between the resource and the attribute value will also be + * deleted. + * * {@link protos.google.cloud.apihub.v1.Attribute.cardinality|cardinality} + * The cardinality can be updated for user defined attributes only. + * Cardinality can only be increased during an update. + * + * The + * {@link protos.google.cloud.apihub.v1.UpdateAttributeRequest.update_mask|update_mask} + * should be used to specify the fields being updated. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.apihub.v1.Attribute} request.attribute + * Required. The attribute to update. + * + * The attribute's `name` field is used to identify the attribute to update. + * Format: + * `projects/{project}/locations/{location}/attributes/{attribute}` + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The list of fields to update. + * @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.apihub.v1.Attribute|Attribute}. + * 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/api_hub.update_attribute.js + * region_tag:apihub_v1_generated_ApiHub_UpdateAttribute_async + */ + updateAttribute( + request?: protos.google.cloud.apihub.v1.IUpdateAttributeRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apihub.v1.IAttribute, + protos.google.cloud.apihub.v1.IUpdateAttributeRequest | undefined, + {} | undefined, + ] + >; + updateAttribute( + request: protos.google.cloud.apihub.v1.IUpdateAttributeRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.IAttribute, + protos.google.cloud.apihub.v1.IUpdateAttributeRequest | null | undefined, + {} | null | undefined + > + ): void; + updateAttribute( + request: protos.google.cloud.apihub.v1.IUpdateAttributeRequest, + callback: Callback< + protos.google.cloud.apihub.v1.IAttribute, + protos.google.cloud.apihub.v1.IUpdateAttributeRequest | null | undefined, + {} | null | undefined + > + ): void; + updateAttribute( + request?: protos.google.cloud.apihub.v1.IUpdateAttributeRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.apihub.v1.IAttribute, + | protos.google.cloud.apihub.v1.IUpdateAttributeRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.apihub.v1.IAttribute, + protos.google.cloud.apihub.v1.IUpdateAttributeRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.apihub.v1.IAttribute, + protos.google.cloud.apihub.v1.IUpdateAttributeRequest | 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({ + 'attribute.name': request.attribute!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateAttribute(request, options, callback); + } + /** + * Delete an attribute. + * + * Note: System defined attributes cannot be deleted. All + * associations of the attribute being deleted with any API hub resource will + * also get deleted. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the attribute to delete. + * Format: + * `projects/{project}/locations/{location}/attributes/{attribute}` + * @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.protobuf.Empty|Empty}. + * 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/api_hub.delete_attribute.js + * region_tag:apihub_v1_generated_ApiHub_DeleteAttribute_async + */ + deleteAttribute( + request?: protos.google.cloud.apihub.v1.IDeleteAttributeRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteAttributeRequest | undefined, + {} | undefined, + ] + >; + deleteAttribute( + request: protos.google.cloud.apihub.v1.IDeleteAttributeRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteAttributeRequest | null | undefined, + {} | null | undefined + > + ): void; + deleteAttribute( + request: protos.google.cloud.apihub.v1.IDeleteAttributeRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteAttributeRequest | null | undefined, + {} | null | undefined + > + ): void; + deleteAttribute( + request?: protos.google.cloud.apihub.v1.IDeleteAttributeRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.apihub.v1.IDeleteAttributeRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteAttributeRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteAttributeRequest | 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.deleteAttribute(request, options, callback); + } + /** + * Create an External API resource in the API hub. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource for the External API resource. + * Format: `projects/{project}/locations/{location}` + * @param {string} [request.externalApiId] + * Optional. The ID to use for the External API resource, which will become + * the final component of the External API's resource name. This field is + * optional. + * + * * If provided, the same will be used. The service will throw an error if + * the specified id is already used by another External API resource in the + * API hub. + * * If not provided, a system generated id will be used. + * + * This value should be 4-500 characters, and valid characters + * are /{@link protos.A-Z|a-z}[0-9]-_/. + * @param {google.cloud.apihub.v1.ExternalApi} request.externalApi + * Required. The External API resource to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.apihub.v1.ExternalApi|ExternalApi}. + * 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/api_hub.create_external_api.js + * region_tag:apihub_v1_generated_ApiHub_CreateExternalApi_async + */ + createExternalApi( + request?: protos.google.cloud.apihub.v1.ICreateExternalApiRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apihub.v1.IExternalApi, + protos.google.cloud.apihub.v1.ICreateExternalApiRequest | undefined, + {} | undefined, + ] + >; + createExternalApi( + request: protos.google.cloud.apihub.v1.ICreateExternalApiRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.IExternalApi, + | protos.google.cloud.apihub.v1.ICreateExternalApiRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createExternalApi( + request: protos.google.cloud.apihub.v1.ICreateExternalApiRequest, + callback: Callback< + protos.google.cloud.apihub.v1.IExternalApi, + | protos.google.cloud.apihub.v1.ICreateExternalApiRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createExternalApi( + request?: protos.google.cloud.apihub.v1.ICreateExternalApiRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.apihub.v1.IExternalApi, + | protos.google.cloud.apihub.v1.ICreateExternalApiRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.apihub.v1.IExternalApi, + | protos.google.cloud.apihub.v1.ICreateExternalApiRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.apihub.v1.IExternalApi, + protos.google.cloud.apihub.v1.ICreateExternalApiRequest | 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.createExternalApi(request, options, callback); + } + /** + * Get details about an External API resource in the API hub. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the External API resource to retrieve. + * Format: + * `projects/{project}/locations/{location}/externalApis/{externalApi}` + * @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.apihub.v1.ExternalApi|ExternalApi}. + * 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/api_hub.get_external_api.js + * region_tag:apihub_v1_generated_ApiHub_GetExternalApi_async + */ + getExternalApi( + request?: protos.google.cloud.apihub.v1.IGetExternalApiRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apihub.v1.IExternalApi, + protos.google.cloud.apihub.v1.IGetExternalApiRequest | undefined, + {} | undefined, + ] + >; + getExternalApi( + request: protos.google.cloud.apihub.v1.IGetExternalApiRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.IExternalApi, + protos.google.cloud.apihub.v1.IGetExternalApiRequest | null | undefined, + {} | null | undefined + > + ): void; + getExternalApi( + request: protos.google.cloud.apihub.v1.IGetExternalApiRequest, + callback: Callback< + protos.google.cloud.apihub.v1.IExternalApi, + protos.google.cloud.apihub.v1.IGetExternalApiRequest | null | undefined, + {} | null | undefined + > + ): void; + getExternalApi( + request?: protos.google.cloud.apihub.v1.IGetExternalApiRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.apihub.v1.IExternalApi, + | protos.google.cloud.apihub.v1.IGetExternalApiRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.apihub.v1.IExternalApi, + protos.google.cloud.apihub.v1.IGetExternalApiRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.apihub.v1.IExternalApi, + protos.google.cloud.apihub.v1.IGetExternalApiRequest | 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.getExternalApi(request, options, callback); + } + /** + * Update an External API resource in the API hub. The following fields can be + * updated: + * + * * {@link protos.google.cloud.apihub.v1.ExternalApi.display_name|display_name} + * * {@link protos.google.cloud.apihub.v1.ExternalApi.description|description} + * * {@link protos.google.cloud.apihub.v1.ExternalApi.documentation|documentation} + * * {@link protos.google.cloud.apihub.v1.ExternalApi.endpoints|endpoints} + * * {@link protos.google.cloud.apihub.v1.ExternalApi.paths|paths} + * + * The + * {@link protos.google.cloud.apihub.v1.UpdateExternalApiRequest.update_mask|update_mask} + * should be used to specify the fields being updated. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.apihub.v1.ExternalApi} request.externalApi + * Required. The External API resource to update. + * + * The External API resource's `name` field is used to identify the External + * API resource to update. Format: + * `projects/{project}/locations/{location}/externalApis/{externalApi}` + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The list of fields to update. + * @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.apihub.v1.ExternalApi|ExternalApi}. + * 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/api_hub.update_external_api.js + * region_tag:apihub_v1_generated_ApiHub_UpdateExternalApi_async + */ + updateExternalApi( + request?: protos.google.cloud.apihub.v1.IUpdateExternalApiRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apihub.v1.IExternalApi, + protos.google.cloud.apihub.v1.IUpdateExternalApiRequest | undefined, + {} | undefined, + ] + >; + updateExternalApi( + request: protos.google.cloud.apihub.v1.IUpdateExternalApiRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.IExternalApi, + | protos.google.cloud.apihub.v1.IUpdateExternalApiRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateExternalApi( + request: protos.google.cloud.apihub.v1.IUpdateExternalApiRequest, + callback: Callback< + protos.google.cloud.apihub.v1.IExternalApi, + | protos.google.cloud.apihub.v1.IUpdateExternalApiRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateExternalApi( + request?: protos.google.cloud.apihub.v1.IUpdateExternalApiRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.apihub.v1.IExternalApi, + | protos.google.cloud.apihub.v1.IUpdateExternalApiRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.apihub.v1.IExternalApi, + | protos.google.cloud.apihub.v1.IUpdateExternalApiRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.apihub.v1.IExternalApi, + protos.google.cloud.apihub.v1.IUpdateExternalApiRequest | 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({ + 'external_api.name': request.externalApi!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateExternalApi(request, options, callback); + } + /** + * Delete an External API resource in the API hub. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the External API resource to delete. + * Format: + * `projects/{project}/locations/{location}/externalApis/{externalApi}` + * @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.protobuf.Empty|Empty}. + * 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/api_hub.delete_external_api.js + * region_tag:apihub_v1_generated_ApiHub_DeleteExternalApi_async + */ + deleteExternalApi( + request?: protos.google.cloud.apihub.v1.IDeleteExternalApiRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteExternalApiRequest | undefined, + {} | undefined, + ] + >; + deleteExternalApi( + request: protos.google.cloud.apihub.v1.IDeleteExternalApiRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.apihub.v1.IDeleteExternalApiRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteExternalApi( + request: protos.google.cloud.apihub.v1.IDeleteExternalApiRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.apihub.v1.IDeleteExternalApiRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteExternalApi( + request?: protos.google.cloud.apihub.v1.IDeleteExternalApiRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.apihub.v1.IDeleteExternalApiRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.apihub.v1.IDeleteExternalApiRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteExternalApiRequest | 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.deleteExternalApi(request, options, callback); + } + + /** + * List API resources in the API hub. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of API resources. + * Format: `projects/{project}/locations/{location}` + * @param {string} [request.filter] + * Optional. An expression that filters the list of ApiResources. + * + * A filter expression consists of a field name, a comparison + * operator, and a value for filtering. The value must be a string. The + * comparison operator must be one of: `<`, `>`, `:` or `=`. Filters are not + * case sensitive. + * + * The following fields in the `ApiResource` are eligible for filtering: + * + * * `owner.email` - The email of the team which owns the ApiResource. + * Allowed comparison operators: `=`. + * * `create_time` - The time at which the ApiResource was created. The + * value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] + * format. Allowed comparison operators: `>` and `<`. + * * `display_name` - The display name of the ApiResource. Allowed + * comparison operators: `=`. + * * `target_user.enum_values.values.id` - The allowed value id of the + * target users attribute associated with the ApiResource. Allowed + * comparison operator is `:`. + * * `target_user.enum_values.values.display_name` - The allowed value + * display name of the target users attribute associated with the + * ApiResource. Allowed comparison operator is `:`. + * * `team.enum_values.values.id` - The allowed value id of the team + * attribute associated with the ApiResource. Allowed comparison operator is + * `:`. + * * `team.enum_values.values.display_name` - The allowed value display name + * of the team attribute associated with the ApiResource. Allowed comparison + * operator is `:`. + * * `business_unit.enum_values.values.id` - The allowed value id of the + * business unit attribute associated with the ApiResource. Allowed + * comparison operator is `:`. + * * `business_unit.enum_values.values.display_name` - The allowed value + * display name of the business unit attribute associated with the + * ApiResource. Allowed comparison operator is `:`. + * * `maturity_level.enum_values.values.id` - The allowed value id of the + * maturity level attribute associated with the ApiResource. Allowed + * comparison operator is `:`. + * * `maturity_level.enum_values.values.display_name` - The allowed value + * display name of the maturity level attribute associated with the + * ApiResource. Allowed comparison operator is `:`. + * * `api_style.enum_values.values.id` - The allowed value id of the + * api style attribute associated with the ApiResource. Allowed + * comparison operator is `:`. + * * `api_style.enum_values.values.display_name` - The allowed value display + * name of the api style attribute associated with the ApiResource. Allowed + * comparison operator is `:`. + * + * Expressions are combined with either `AND` logic operator or `OR` logical + * operator but not both of them together i.e. only one of the `AND` or `OR` + * operator can be used throughout the filter string and both the operators + * cannot be used together. No other logical operators are supported. At most + * three filter fields are allowed in the filter string and if provided + * more than that then `INVALID_ARGUMENT` error is returned by the API. + * + * Here are a few examples: + * + * * `owner.email = \"apihub@google.com\"` - - The owner team email is + * _apihub@google.com_. + * * `owner.email = \"apihub@google.com\" AND create_time < + * \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - + * The owner team email is _apihub@google.com_ and the api was created + * before _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_. + * * `owner.email = \"apihub@google.com\" OR team.enum_values.values.id: + * apihub-team-id` - The filter string specifies the APIs where the owner + * team email is _apihub@google.com_ or the id of the allowed value + * associated with the team attribute is _apihub-team-id_. + * * `owner.email = \"apihub@google.com\" OR + * team.enum_values.values.display_name: ApiHub Team` - The filter string + * specifies the APIs where the owner team email is _apihub@google.com_ or + * the display name of the allowed value associated with the team attribute + * is `ApiHub Team`. + * @param {number} [request.pageSize] + * Optional. The maximum number of API resources to return. The service may + * return fewer than this value. If unspecified, at most 50 Apis will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListApis` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters (except page_size) provided to + * `ListApis` must match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.apihub.v1.Api|Api}. + * 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 `listApisAsync()` + * 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. + */ + listApis( + request?: protos.google.cloud.apihub.v1.IListApisRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apihub.v1.IApi[], + protos.google.cloud.apihub.v1.IListApisRequest | null, + protos.google.cloud.apihub.v1.IListApisResponse, + ] + >; + listApis( + request: protos.google.cloud.apihub.v1.IListApisRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.apihub.v1.IListApisRequest, + protos.google.cloud.apihub.v1.IListApisResponse | null | undefined, + protos.google.cloud.apihub.v1.IApi + > + ): void; + listApis( + request: protos.google.cloud.apihub.v1.IListApisRequest, + callback: PaginationCallback< + protos.google.cloud.apihub.v1.IListApisRequest, + protos.google.cloud.apihub.v1.IListApisResponse | null | undefined, + protos.google.cloud.apihub.v1.IApi + > + ): void; + listApis( + request?: protos.google.cloud.apihub.v1.IListApisRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.apihub.v1.IListApisRequest, + protos.google.cloud.apihub.v1.IListApisResponse | null | undefined, + protos.google.cloud.apihub.v1.IApi + >, + callback?: PaginationCallback< + protos.google.cloud.apihub.v1.IListApisRequest, + protos.google.cloud.apihub.v1.IListApisResponse | null | undefined, + protos.google.cloud.apihub.v1.IApi + > + ): Promise< + [ + protos.google.cloud.apihub.v1.IApi[], + protos.google.cloud.apihub.v1.IListApisRequest | null, + protos.google.cloud.apihub.v1.IListApisResponse, + ] + > | 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.listApis(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of API resources. + * Format: `projects/{project}/locations/{location}` + * @param {string} [request.filter] + * Optional. An expression that filters the list of ApiResources. + * + * A filter expression consists of a field name, a comparison + * operator, and a value for filtering. The value must be a string. The + * comparison operator must be one of: `<`, `>`, `:` or `=`. Filters are not + * case sensitive. + * + * The following fields in the `ApiResource` are eligible for filtering: + * + * * `owner.email` - The email of the team which owns the ApiResource. + * Allowed comparison operators: `=`. + * * `create_time` - The time at which the ApiResource was created. The + * value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] + * format. Allowed comparison operators: `>` and `<`. + * * `display_name` - The display name of the ApiResource. Allowed + * comparison operators: `=`. + * * `target_user.enum_values.values.id` - The allowed value id of the + * target users attribute associated with the ApiResource. Allowed + * comparison operator is `:`. + * * `target_user.enum_values.values.display_name` - The allowed value + * display name of the target users attribute associated with the + * ApiResource. Allowed comparison operator is `:`. + * * `team.enum_values.values.id` - The allowed value id of the team + * attribute associated with the ApiResource. Allowed comparison operator is + * `:`. + * * `team.enum_values.values.display_name` - The allowed value display name + * of the team attribute associated with the ApiResource. Allowed comparison + * operator is `:`. + * * `business_unit.enum_values.values.id` - The allowed value id of the + * business unit attribute associated with the ApiResource. Allowed + * comparison operator is `:`. + * * `business_unit.enum_values.values.display_name` - The allowed value + * display name of the business unit attribute associated with the + * ApiResource. Allowed comparison operator is `:`. + * * `maturity_level.enum_values.values.id` - The allowed value id of the + * maturity level attribute associated with the ApiResource. Allowed + * comparison operator is `:`. + * * `maturity_level.enum_values.values.display_name` - The allowed value + * display name of the maturity level attribute associated with the + * ApiResource. Allowed comparison operator is `:`. + * * `api_style.enum_values.values.id` - The allowed value id of the + * api style attribute associated with the ApiResource. Allowed + * comparison operator is `:`. + * * `api_style.enum_values.values.display_name` - The allowed value display + * name of the api style attribute associated with the ApiResource. Allowed + * comparison operator is `:`. + * + * Expressions are combined with either `AND` logic operator or `OR` logical + * operator but not both of them together i.e. only one of the `AND` or `OR` + * operator can be used throughout the filter string and both the operators + * cannot be used together. No other logical operators are supported. At most + * three filter fields are allowed in the filter string and if provided + * more than that then `INVALID_ARGUMENT` error is returned by the API. + * + * Here are a few examples: + * + * * `owner.email = \"apihub@google.com\"` - - The owner team email is + * _apihub@google.com_. + * * `owner.email = \"apihub@google.com\" AND create_time < + * \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - + * The owner team email is _apihub@google.com_ and the api was created + * before _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_. + * * `owner.email = \"apihub@google.com\" OR team.enum_values.values.id: + * apihub-team-id` - The filter string specifies the APIs where the owner + * team email is _apihub@google.com_ or the id of the allowed value + * associated with the team attribute is _apihub-team-id_. + * * `owner.email = \"apihub@google.com\" OR + * team.enum_values.values.display_name: ApiHub Team` - The filter string + * specifies the APIs where the owner team email is _apihub@google.com_ or + * the display name of the allowed value associated with the team attribute + * is `ApiHub Team`. + * @param {number} [request.pageSize] + * Optional. The maximum number of API resources to return. The service may + * return fewer than this value. If unspecified, at most 50 Apis will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListApis` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters (except page_size) provided to + * `ListApis` must match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.apihub.v1.Api|Api} 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 `listApisAsync()` + * 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. + */ + listApisStream( + request?: protos.google.cloud.apihub.v1.IListApisRequest, + 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['listApis']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listApis.createStream( + this.innerApiCalls.listApis as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listApis`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of API resources. + * Format: `projects/{project}/locations/{location}` + * @param {string} [request.filter] + * Optional. An expression that filters the list of ApiResources. + * + * A filter expression consists of a field name, a comparison + * operator, and a value for filtering. The value must be a string. The + * comparison operator must be one of: `<`, `>`, `:` or `=`. Filters are not + * case sensitive. + * + * The following fields in the `ApiResource` are eligible for filtering: + * + * * `owner.email` - The email of the team which owns the ApiResource. + * Allowed comparison operators: `=`. + * * `create_time` - The time at which the ApiResource was created. The + * value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] + * format. Allowed comparison operators: `>` and `<`. + * * `display_name` - The display name of the ApiResource. Allowed + * comparison operators: `=`. + * * `target_user.enum_values.values.id` - The allowed value id of the + * target users attribute associated with the ApiResource. Allowed + * comparison operator is `:`. + * * `target_user.enum_values.values.display_name` - The allowed value + * display name of the target users attribute associated with the + * ApiResource. Allowed comparison operator is `:`. + * * `team.enum_values.values.id` - The allowed value id of the team + * attribute associated with the ApiResource. Allowed comparison operator is + * `:`. + * * `team.enum_values.values.display_name` - The allowed value display name + * of the team attribute associated with the ApiResource. Allowed comparison + * operator is `:`. + * * `business_unit.enum_values.values.id` - The allowed value id of the + * business unit attribute associated with the ApiResource. Allowed + * comparison operator is `:`. + * * `business_unit.enum_values.values.display_name` - The allowed value + * display name of the business unit attribute associated with the + * ApiResource. Allowed comparison operator is `:`. + * * `maturity_level.enum_values.values.id` - The allowed value id of the + * maturity level attribute associated with the ApiResource. Allowed + * comparison operator is `:`. + * * `maturity_level.enum_values.values.display_name` - The allowed value + * display name of the maturity level attribute associated with the + * ApiResource. Allowed comparison operator is `:`. + * * `api_style.enum_values.values.id` - The allowed value id of the + * api style attribute associated with the ApiResource. Allowed + * comparison operator is `:`. + * * `api_style.enum_values.values.display_name` - The allowed value display + * name of the api style attribute associated with the ApiResource. Allowed + * comparison operator is `:`. + * + * Expressions are combined with either `AND` logic operator or `OR` logical + * operator but not both of them together i.e. only one of the `AND` or `OR` + * operator can be used throughout the filter string and both the operators + * cannot be used together. No other logical operators are supported. At most + * three filter fields are allowed in the filter string and if provided + * more than that then `INVALID_ARGUMENT` error is returned by the API. + * + * Here are a few examples: + * + * * `owner.email = \"apihub@google.com\"` - - The owner team email is + * _apihub@google.com_. + * * `owner.email = \"apihub@google.com\" AND create_time < + * \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - + * The owner team email is _apihub@google.com_ and the api was created + * before _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_. + * * `owner.email = \"apihub@google.com\" OR team.enum_values.values.id: + * apihub-team-id` - The filter string specifies the APIs where the owner + * team email is _apihub@google.com_ or the id of the allowed value + * associated with the team attribute is _apihub-team-id_. + * * `owner.email = \"apihub@google.com\" OR + * team.enum_values.values.display_name: ApiHub Team` - The filter string + * specifies the APIs where the owner team email is _apihub@google.com_ or + * the display name of the allowed value associated with the team attribute + * is `ApiHub Team`. + * @param {number} [request.pageSize] + * Optional. The maximum number of API resources to return. The service may + * return fewer than this value. If unspecified, at most 50 Apis will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListApis` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters (except page_size) provided to + * `ListApis` must match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@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.apihub.v1.Api|Api}. 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/api_hub.list_apis.js + * region_tag:apihub_v1_generated_ApiHub_ListApis_async + */ + listApisAsync( + request?: protos.google.cloud.apihub.v1.IListApisRequest, + 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['listApis']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listApis.asyncIterate( + this.innerApiCalls['listApis'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * List API versions of an API resource in the API hub. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent which owns this collection of API versions i.e., the + * API resource Format: `projects/{project}/locations/{location}/apis/{api}` + * @param {string} [request.filter] + * Optional. An expression that filters the list of Versions. + * + * A filter expression consists of a field name, a comparison + * operator, and a value for filtering. The value must be a string, a + * number, or a boolean. The comparison operator must be one of: `<`, `>` or + * `=`. Filters are not case sensitive. + * + * The following fields in the `Version` are eligible for filtering: + * + * * `display_name` - The display name of the Version. Allowed + * comparison operators: `=`. + * * `create_time` - The time at which the Version was created. The + * value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] + * format. Allowed comparison operators: `>` and `<`. + * * `lifecycle.enum_values.values.id` - The allowed value id of the + * lifecycle attribute associated with the Version. Allowed comparison + * operators: `:`. + * * `lifecycle.enum_values.values.display_name` - The allowed value display + * name of the lifecycle attribute associated with the Version. Allowed + * comparison operators: `:`. + * * `compliance.enum_values.values.id` - The allowed value id of the + * compliances attribute associated with the Version. Allowed comparison + * operators: `:`. + * * `compliance.enum_values.values.display_name` - The allowed value + * display name of the compliances attribute associated with the Version. + * Allowed comparison operators: `:`. + * * `accreditation.enum_values.values.id` - The allowed value id of the + * accreditations attribute associated with the Version. Allowed + * comparison operators: `:`. + * * `accreditation.enum_values.values.display_name` - The allowed value + * display name of the accreditations attribute associated with the Version. + * Allowed comparison operators: `:`. + * + * Expressions are combined with either `AND` logic operator or `OR` logical + * operator but not both of them together i.e. only one of the `AND` or `OR` + * operator can be used throughout the filter string and both the operators + * cannot be used together. No other logical operators are + * supported. At most three filter fields are allowed in the filter + * string and if provided more than that then `INVALID_ARGUMENT` error is + * returned by the API. + * + * Here are a few examples: + * + * * `lifecycle.enum_values.values.id: preview-id` - The filter string + * specifies that the id of the allowed value associated with the lifecycle + * attribute of the Version is _preview-id_. + * * `lifecycle.enum_values.values.display_name: \"Preview Display Name\"` - + * The filter string specifies that the display name of the allowed value + * associated with the lifecycle attribute of the Version is `Preview + * Display Name`. + * * `lifecycle.enum_values.values.id: preview-id AND create_time < + * \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - + * The id of the allowed value associated with the lifecycle attribute of + * the Version is _preview-id_ and it was created before _2021-08-15 + * 14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_. + * * `compliance.enum_values.values.id: gdpr-id OR + * compliance.enum_values.values.id: pci-dss-id` + * - The id of the allowed value associated with the compliance attribute is + * _gdpr-id_ or _pci-dss-id_. + * @param {number} [request.pageSize] + * Optional. The maximum number of versions to return. The service may return + * fewer than this value. If unspecified, at most 50 versions will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListVersions` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters (except page_size) provided to + * `ListVersions` must match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.apihub.v1.Version|Version}. + * 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 `listVersionsAsync()` + * 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. + */ + listVersions( + request?: protos.google.cloud.apihub.v1.IListVersionsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apihub.v1.IVersion[], + protos.google.cloud.apihub.v1.IListVersionsRequest | null, + protos.google.cloud.apihub.v1.IListVersionsResponse, + ] + >; + listVersions( + request: protos.google.cloud.apihub.v1.IListVersionsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.apihub.v1.IListVersionsRequest, + protos.google.cloud.apihub.v1.IListVersionsResponse | null | undefined, + protos.google.cloud.apihub.v1.IVersion + > + ): void; + listVersions( + request: protos.google.cloud.apihub.v1.IListVersionsRequest, + callback: PaginationCallback< + protos.google.cloud.apihub.v1.IListVersionsRequest, + protos.google.cloud.apihub.v1.IListVersionsResponse | null | undefined, + protos.google.cloud.apihub.v1.IVersion + > + ): void; + listVersions( + request?: protos.google.cloud.apihub.v1.IListVersionsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.apihub.v1.IListVersionsRequest, + | protos.google.cloud.apihub.v1.IListVersionsResponse + | null + | undefined, + protos.google.cloud.apihub.v1.IVersion + >, + callback?: PaginationCallback< + protos.google.cloud.apihub.v1.IListVersionsRequest, + protos.google.cloud.apihub.v1.IListVersionsResponse | null | undefined, + protos.google.cloud.apihub.v1.IVersion + > + ): Promise< + [ + protos.google.cloud.apihub.v1.IVersion[], + protos.google.cloud.apihub.v1.IListVersionsRequest | null, + protos.google.cloud.apihub.v1.IListVersionsResponse, + ] + > | 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.listVersions(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent which owns this collection of API versions i.e., the + * API resource Format: `projects/{project}/locations/{location}/apis/{api}` + * @param {string} [request.filter] + * Optional. An expression that filters the list of Versions. + * + * A filter expression consists of a field name, a comparison + * operator, and a value for filtering. The value must be a string, a + * number, or a boolean. The comparison operator must be one of: `<`, `>` or + * `=`. Filters are not case sensitive. + * + * The following fields in the `Version` are eligible for filtering: + * + * * `display_name` - The display name of the Version. Allowed + * comparison operators: `=`. + * * `create_time` - The time at which the Version was created. The + * value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] + * format. Allowed comparison operators: `>` and `<`. + * * `lifecycle.enum_values.values.id` - The allowed value id of the + * lifecycle attribute associated with the Version. Allowed comparison + * operators: `:`. + * * `lifecycle.enum_values.values.display_name` - The allowed value display + * name of the lifecycle attribute associated with the Version. Allowed + * comparison operators: `:`. + * * `compliance.enum_values.values.id` - The allowed value id of the + * compliances attribute associated with the Version. Allowed comparison + * operators: `:`. + * * `compliance.enum_values.values.display_name` - The allowed value + * display name of the compliances attribute associated with the Version. + * Allowed comparison operators: `:`. + * * `accreditation.enum_values.values.id` - The allowed value id of the + * accreditations attribute associated with the Version. Allowed + * comparison operators: `:`. + * * `accreditation.enum_values.values.display_name` - The allowed value + * display name of the accreditations attribute associated with the Version. + * Allowed comparison operators: `:`. + * + * Expressions are combined with either `AND` logic operator or `OR` logical + * operator but not both of them together i.e. only one of the `AND` or `OR` + * operator can be used throughout the filter string and both the operators + * cannot be used together. No other logical operators are + * supported. At most three filter fields are allowed in the filter + * string and if provided more than that then `INVALID_ARGUMENT` error is + * returned by the API. + * + * Here are a few examples: + * + * * `lifecycle.enum_values.values.id: preview-id` - The filter string + * specifies that the id of the allowed value associated with the lifecycle + * attribute of the Version is _preview-id_. + * * `lifecycle.enum_values.values.display_name: \"Preview Display Name\"` - + * The filter string specifies that the display name of the allowed value + * associated with the lifecycle attribute of the Version is `Preview + * Display Name`. + * * `lifecycle.enum_values.values.id: preview-id AND create_time < + * \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - + * The id of the allowed value associated with the lifecycle attribute of + * the Version is _preview-id_ and it was created before _2021-08-15 + * 14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_. + * * `compliance.enum_values.values.id: gdpr-id OR + * compliance.enum_values.values.id: pci-dss-id` + * - The id of the allowed value associated with the compliance attribute is + * _gdpr-id_ or _pci-dss-id_. + * @param {number} [request.pageSize] + * Optional. The maximum number of versions to return. The service may return + * fewer than this value. If unspecified, at most 50 versions will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListVersions` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters (except page_size) provided to + * `ListVersions` must match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.apihub.v1.Version|Version} 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 `listVersionsAsync()` + * 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. + */ + listVersionsStream( + request?: protos.google.cloud.apihub.v1.IListVersionsRequest, + 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['listVersions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listVersions.createStream( + this.innerApiCalls.listVersions as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listVersions`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent which owns this collection of API versions i.e., the + * API resource Format: `projects/{project}/locations/{location}/apis/{api}` + * @param {string} [request.filter] + * Optional. An expression that filters the list of Versions. + * + * A filter expression consists of a field name, a comparison + * operator, and a value for filtering. The value must be a string, a + * number, or a boolean. The comparison operator must be one of: `<`, `>` or + * `=`. Filters are not case sensitive. + * + * The following fields in the `Version` are eligible for filtering: + * + * * `display_name` - The display name of the Version. Allowed + * comparison operators: `=`. + * * `create_time` - The time at which the Version was created. The + * value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] + * format. Allowed comparison operators: `>` and `<`. + * * `lifecycle.enum_values.values.id` - The allowed value id of the + * lifecycle attribute associated with the Version. Allowed comparison + * operators: `:`. + * * `lifecycle.enum_values.values.display_name` - The allowed value display + * name of the lifecycle attribute associated with the Version. Allowed + * comparison operators: `:`. + * * `compliance.enum_values.values.id` - The allowed value id of the + * compliances attribute associated with the Version. Allowed comparison + * operators: `:`. + * * `compliance.enum_values.values.display_name` - The allowed value + * display name of the compliances attribute associated with the Version. + * Allowed comparison operators: `:`. + * * `accreditation.enum_values.values.id` - The allowed value id of the + * accreditations attribute associated with the Version. Allowed + * comparison operators: `:`. + * * `accreditation.enum_values.values.display_name` - The allowed value + * display name of the accreditations attribute associated with the Version. + * Allowed comparison operators: `:`. + * + * Expressions are combined with either `AND` logic operator or `OR` logical + * operator but not both of them together i.e. only one of the `AND` or `OR` + * operator can be used throughout the filter string and both the operators + * cannot be used together. No other logical operators are + * supported. At most three filter fields are allowed in the filter + * string and if provided more than that then `INVALID_ARGUMENT` error is + * returned by the API. + * + * Here are a few examples: + * + * * `lifecycle.enum_values.values.id: preview-id` - The filter string + * specifies that the id of the allowed value associated with the lifecycle + * attribute of the Version is _preview-id_. + * * `lifecycle.enum_values.values.display_name: \"Preview Display Name\"` - + * The filter string specifies that the display name of the allowed value + * associated with the lifecycle attribute of the Version is `Preview + * Display Name`. + * * `lifecycle.enum_values.values.id: preview-id AND create_time < + * \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - + * The id of the allowed value associated with the lifecycle attribute of + * the Version is _preview-id_ and it was created before _2021-08-15 + * 14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_. + * * `compliance.enum_values.values.id: gdpr-id OR + * compliance.enum_values.values.id: pci-dss-id` + * - The id of the allowed value associated with the compliance attribute is + * _gdpr-id_ or _pci-dss-id_. + * @param {number} [request.pageSize] + * Optional. The maximum number of versions to return. The service may return + * fewer than this value. If unspecified, at most 50 versions will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListVersions` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters (except page_size) provided to + * `ListVersions` must match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@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.apihub.v1.Version|Version}. 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/api_hub.list_versions.js + * region_tag:apihub_v1_generated_ApiHub_ListVersions_async + */ + listVersionsAsync( + request?: protos.google.cloud.apihub.v1.IListVersionsRequest, + 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['listVersions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listVersions.asyncIterate( + this.innerApiCalls['listVersions'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * List specs corresponding to a particular API resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of specs. + * Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}` + * @param {string} [request.filter] + * Optional. An expression that filters the list of Specs. + * + * A filter expression consists of a field name, a comparison + * operator, and a value for filtering. The value must be a string. The + * comparison operator must be one of: `<`, `>`, `:` or `=`. Filters are not + * case sensitive. + * + * The following fields in the `Spec` are eligible for filtering: + * + * * `display_name` - The display name of the Spec. Allowed comparison + * operators: `=`. + * * `create_time` - The time at which the Spec was created. The + * value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] + * format. Allowed comparison operators: `>` and `<`. + * * `spec_type.enum_values.values.id` - The allowed value id of the + * spec_type attribute associated with the Spec. Allowed comparison + * operators: `:`. + * * `spec_type.enum_values.values.display_name` - The allowed value display + * name of the spec_type attribute associated with the Spec. Allowed + * comparison operators: `:`. + * * `lint_response.json_values.values` - The json value of the + * lint_response attribute associated with the Spec. Allowed comparison + * operators: `:`. + * * `mime_type` - The MIME type of the Spec. Allowed comparison + * operators: `=`. + * + * Expressions are combined with either `AND` logic operator or `OR` logical + * operator but not both of them together i.e. only one of the `AND` or `OR` + * operator can be used throughout the filter string and both the operators + * cannot be used together. No other logical operators are + * supported. At most three filter fields are allowed in the filter + * string and if provided more than that then `INVALID_ARGUMENT` error is + * returned by the API. + * + * Here are a few examples: + * + * * `spec_type.enum_values.values.id: rest-id` - The filter + * string specifies that the id of the allowed value associated with the + * spec_type attribute is _rest-id_. + * * `spec_type.enum_values.values.display_name: \"Rest Display Name\"` - + * The filter string specifies that the display name of the allowed value + * associated with the spec_type attribute is `Rest Display Name`. + * * `spec_type.enum_values.values.id: grpc-id AND create_time < + * \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - + * The id of the allowed value associated with the spec_type attribute is + * _grpc-id_ and the spec was created before _2021-08-15 14:50:00 UTC_ and + * after _2021-08-10 12:00:00 UTC_. + * * `spec_type.enum_values.values.id: rest-id OR + * spec_type.enum_values.values.id: grpc-id` + * - The id of the allowed value associated with the spec_type attribute is + * _rest-id_ or _grpc-id_. + * @param {number} [request.pageSize] + * Optional. The maximum number of specs to return. The service may return + * fewer than this value. If unspecified, at most 50 specs will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListSpecs` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListSpecs` must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.apihub.v1.Spec|Spec}. + * 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 `listSpecsAsync()` + * 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. + */ + listSpecs( + request?: protos.google.cloud.apihub.v1.IListSpecsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apihub.v1.ISpec[], + protos.google.cloud.apihub.v1.IListSpecsRequest | null, + protos.google.cloud.apihub.v1.IListSpecsResponse, + ] + >; + listSpecs( + request: protos.google.cloud.apihub.v1.IListSpecsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.apihub.v1.IListSpecsRequest, + protos.google.cloud.apihub.v1.IListSpecsResponse | null | undefined, + protos.google.cloud.apihub.v1.ISpec + > + ): void; + listSpecs( + request: protos.google.cloud.apihub.v1.IListSpecsRequest, + callback: PaginationCallback< + protos.google.cloud.apihub.v1.IListSpecsRequest, + protos.google.cloud.apihub.v1.IListSpecsResponse | null | undefined, + protos.google.cloud.apihub.v1.ISpec + > + ): void; + listSpecs( + request?: protos.google.cloud.apihub.v1.IListSpecsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.apihub.v1.IListSpecsRequest, + protos.google.cloud.apihub.v1.IListSpecsResponse | null | undefined, + protos.google.cloud.apihub.v1.ISpec + >, + callback?: PaginationCallback< + protos.google.cloud.apihub.v1.IListSpecsRequest, + protos.google.cloud.apihub.v1.IListSpecsResponse | null | undefined, + protos.google.cloud.apihub.v1.ISpec + > + ): Promise< + [ + protos.google.cloud.apihub.v1.ISpec[], + protos.google.cloud.apihub.v1.IListSpecsRequest | null, + protos.google.cloud.apihub.v1.IListSpecsResponse, + ] + > | 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.listSpecs(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of specs. + * Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}` + * @param {string} [request.filter] + * Optional. An expression that filters the list of Specs. + * + * A filter expression consists of a field name, a comparison + * operator, and a value for filtering. The value must be a string. The + * comparison operator must be one of: `<`, `>`, `:` or `=`. Filters are not + * case sensitive. + * + * The following fields in the `Spec` are eligible for filtering: + * + * * `display_name` - The display name of the Spec. Allowed comparison + * operators: `=`. + * * `create_time` - The time at which the Spec was created. The + * value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] + * format. Allowed comparison operators: `>` and `<`. + * * `spec_type.enum_values.values.id` - The allowed value id of the + * spec_type attribute associated with the Spec. Allowed comparison + * operators: `:`. + * * `spec_type.enum_values.values.display_name` - The allowed value display + * name of the spec_type attribute associated with the Spec. Allowed + * comparison operators: `:`. + * * `lint_response.json_values.values` - The json value of the + * lint_response attribute associated with the Spec. Allowed comparison + * operators: `:`. + * * `mime_type` - The MIME type of the Spec. Allowed comparison + * operators: `=`. + * + * Expressions are combined with either `AND` logic operator or `OR` logical + * operator but not both of them together i.e. only one of the `AND` or `OR` + * operator can be used throughout the filter string and both the operators + * cannot be used together. No other logical operators are + * supported. At most three filter fields are allowed in the filter + * string and if provided more than that then `INVALID_ARGUMENT` error is + * returned by the API. + * + * Here are a few examples: + * + * * `spec_type.enum_values.values.id: rest-id` - The filter + * string specifies that the id of the allowed value associated with the + * spec_type attribute is _rest-id_. + * * `spec_type.enum_values.values.display_name: \"Rest Display Name\"` - + * The filter string specifies that the display name of the allowed value + * associated with the spec_type attribute is `Rest Display Name`. + * * `spec_type.enum_values.values.id: grpc-id AND create_time < + * \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - + * The id of the allowed value associated with the spec_type attribute is + * _grpc-id_ and the spec was created before _2021-08-15 14:50:00 UTC_ and + * after _2021-08-10 12:00:00 UTC_. + * * `spec_type.enum_values.values.id: rest-id OR + * spec_type.enum_values.values.id: grpc-id` + * - The id of the allowed value associated with the spec_type attribute is + * _rest-id_ or _grpc-id_. + * @param {number} [request.pageSize] + * Optional. The maximum number of specs to return. The service may return + * fewer than this value. If unspecified, at most 50 specs will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListSpecs` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListSpecs` must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.apihub.v1.Spec|Spec} 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 `listSpecsAsync()` + * 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. + */ + listSpecsStream( + request?: protos.google.cloud.apihub.v1.IListSpecsRequest, + 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['listSpecs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listSpecs.createStream( + this.innerApiCalls.listSpecs as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listSpecs`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of specs. + * Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}` + * @param {string} [request.filter] + * Optional. An expression that filters the list of Specs. + * + * A filter expression consists of a field name, a comparison + * operator, and a value for filtering. The value must be a string. The + * comparison operator must be one of: `<`, `>`, `:` or `=`. Filters are not + * case sensitive. + * + * The following fields in the `Spec` are eligible for filtering: + * + * * `display_name` - The display name of the Spec. Allowed comparison + * operators: `=`. + * * `create_time` - The time at which the Spec was created. The + * value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] + * format. Allowed comparison operators: `>` and `<`. + * * `spec_type.enum_values.values.id` - The allowed value id of the + * spec_type attribute associated with the Spec. Allowed comparison + * operators: `:`. + * * `spec_type.enum_values.values.display_name` - The allowed value display + * name of the spec_type attribute associated with the Spec. Allowed + * comparison operators: `:`. + * * `lint_response.json_values.values` - The json value of the + * lint_response attribute associated with the Spec. Allowed comparison + * operators: `:`. + * * `mime_type` - The MIME type of the Spec. Allowed comparison + * operators: `=`. + * + * Expressions are combined with either `AND` logic operator or `OR` logical + * operator but not both of them together i.e. only one of the `AND` or `OR` + * operator can be used throughout the filter string and both the operators + * cannot be used together. No other logical operators are + * supported. At most three filter fields are allowed in the filter + * string and if provided more than that then `INVALID_ARGUMENT` error is + * returned by the API. + * + * Here are a few examples: + * + * * `spec_type.enum_values.values.id: rest-id` - The filter + * string specifies that the id of the allowed value associated with the + * spec_type attribute is _rest-id_. + * * `spec_type.enum_values.values.display_name: \"Rest Display Name\"` - + * The filter string specifies that the display name of the allowed value + * associated with the spec_type attribute is `Rest Display Name`. + * * `spec_type.enum_values.values.id: grpc-id AND create_time < + * \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - + * The id of the allowed value associated with the spec_type attribute is + * _grpc-id_ and the spec was created before _2021-08-15 14:50:00 UTC_ and + * after _2021-08-10 12:00:00 UTC_. + * * `spec_type.enum_values.values.id: rest-id OR + * spec_type.enum_values.values.id: grpc-id` + * - The id of the allowed value associated with the spec_type attribute is + * _rest-id_ or _grpc-id_. + * @param {number} [request.pageSize] + * Optional. The maximum number of specs to return. The service may return + * fewer than this value. If unspecified, at most 50 specs will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListSpecs` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListSpecs` must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@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.apihub.v1.Spec|Spec}. 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/api_hub.list_specs.js + * region_tag:apihub_v1_generated_ApiHub_ListSpecs_async + */ + listSpecsAsync( + request?: protos.google.cloud.apihub.v1.IListSpecsRequest, + 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['listSpecs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listSpecs.asyncIterate( + this.innerApiCalls['listSpecs'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * List operations in an API version. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent which owns this collection of operations i.e., the API + * version. Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}` + * @param {string} [request.filter] + * Optional. An expression that filters the list of ApiOperations. + * + * A filter expression consists of a field name, a comparison + * operator, and a value for filtering. The value must be a string or a + * boolean. The comparison operator must be one of: `<`, `>` or + * `=`. Filters are not case sensitive. + * + * The following fields in the `ApiOperation` are eligible for filtering: + * * `name` - The ApiOperation resource name. Allowed comparison + * operators: + * `=`. + * * `details.http_operation.path.path` - The http operation's complete path + * relative to server endpoint. Allowed comparison operators: `=`. + * * `details.http_operation.method` - The http operation method type. + * Allowed comparison operators: `=`. + * * `details.deprecated` - Indicates if the ApiOperation is deprecated. + * Allowed values are True / False indicating the deprycation status of the + * ApiOperation. Allowed comparison operators: `=`. + * * `create_time` - The time at which the ApiOperation was created. The + * value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] + * format. Allowed comparison operators: `>` and `<`. + * + * Expressions are combined with either `AND` logic operator or `OR` logical + * operator but not both of them together i.e. only one of the `AND` or `OR` + * operator can be used throughout the filter string and both the operators + * cannot be used together. No other logical operators are supported. At most + * three filter fields are allowed in the filter string and if provided + * more than that then `INVALID_ARGUMENT` error is returned by the API. + * + * Here are a few examples: + * + * * `details.deprecated = True` - The ApiOperation is deprecated. + * * `details.http_operation.method = GET AND create_time < + * \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - + * The method of the http operation of the ApiOperation is _GET_ and the + * spec was created before _2021-08-15 14:50:00 UTC_ and after _2021-08-10 + * 12:00:00 UTC_. + * * `details.http_operation.method = GET OR details.http_operation.method = + * POST`. - The http operation of the method of ApiOperation is _GET_ or + * _POST_. + * @param {number} [request.pageSize] + * Optional. The maximum number of operations to return. The service may + * return fewer than this value. If unspecified, at most 50 operations will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListApiOperations` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters (except page_size) provided to + * `ListApiOperations` must match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.apihub.v1.ApiOperation|ApiOperation}. + * 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 `listApiOperationsAsync()` + * 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. + */ + listApiOperations( + request?: protos.google.cloud.apihub.v1.IListApiOperationsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apihub.v1.IApiOperation[], + protos.google.cloud.apihub.v1.IListApiOperationsRequest | null, + protos.google.cloud.apihub.v1.IListApiOperationsResponse, + ] + >; + listApiOperations( + request: protos.google.cloud.apihub.v1.IListApiOperationsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.apihub.v1.IListApiOperationsRequest, + | protos.google.cloud.apihub.v1.IListApiOperationsResponse + | null + | undefined, + protos.google.cloud.apihub.v1.IApiOperation + > + ): void; + listApiOperations( + request: protos.google.cloud.apihub.v1.IListApiOperationsRequest, + callback: PaginationCallback< + protos.google.cloud.apihub.v1.IListApiOperationsRequest, + | protos.google.cloud.apihub.v1.IListApiOperationsResponse + | null + | undefined, + protos.google.cloud.apihub.v1.IApiOperation + > + ): void; + listApiOperations( + request?: protos.google.cloud.apihub.v1.IListApiOperationsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.apihub.v1.IListApiOperationsRequest, + | protos.google.cloud.apihub.v1.IListApiOperationsResponse + | null + | undefined, + protos.google.cloud.apihub.v1.IApiOperation + >, + callback?: PaginationCallback< + protos.google.cloud.apihub.v1.IListApiOperationsRequest, + | protos.google.cloud.apihub.v1.IListApiOperationsResponse + | null + | undefined, + protos.google.cloud.apihub.v1.IApiOperation + > + ): Promise< + [ + protos.google.cloud.apihub.v1.IApiOperation[], + protos.google.cloud.apihub.v1.IListApiOperationsRequest | null, + protos.google.cloud.apihub.v1.IListApiOperationsResponse, + ] + > | 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.listApiOperations(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent which owns this collection of operations i.e., the API + * version. Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}` + * @param {string} [request.filter] + * Optional. An expression that filters the list of ApiOperations. + * + * A filter expression consists of a field name, a comparison + * operator, and a value for filtering. The value must be a string or a + * boolean. The comparison operator must be one of: `<`, `>` or + * `=`. Filters are not case sensitive. + * + * The following fields in the `ApiOperation` are eligible for filtering: + * * `name` - The ApiOperation resource name. Allowed comparison + * operators: + * `=`. + * * `details.http_operation.path.path` - The http operation's complete path + * relative to server endpoint. Allowed comparison operators: `=`. + * * `details.http_operation.method` - The http operation method type. + * Allowed comparison operators: `=`. + * * `details.deprecated` - Indicates if the ApiOperation is deprecated. + * Allowed values are True / False indicating the deprycation status of the + * ApiOperation. Allowed comparison operators: `=`. + * * `create_time` - The time at which the ApiOperation was created. The + * value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] + * format. Allowed comparison operators: `>` and `<`. + * + * Expressions are combined with either `AND` logic operator or `OR` logical + * operator but not both of them together i.e. only one of the `AND` or `OR` + * operator can be used throughout the filter string and both the operators + * cannot be used together. No other logical operators are supported. At most + * three filter fields are allowed in the filter string and if provided + * more than that then `INVALID_ARGUMENT` error is returned by the API. + * + * Here are a few examples: + * + * * `details.deprecated = True` - The ApiOperation is deprecated. + * * `details.http_operation.method = GET AND create_time < + * \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - + * The method of the http operation of the ApiOperation is _GET_ and the + * spec was created before _2021-08-15 14:50:00 UTC_ and after _2021-08-10 + * 12:00:00 UTC_. + * * `details.http_operation.method = GET OR details.http_operation.method = + * POST`. - The http operation of the method of ApiOperation is _GET_ or + * _POST_. + * @param {number} [request.pageSize] + * Optional. The maximum number of operations to return. The service may + * return fewer than this value. If unspecified, at most 50 operations will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListApiOperations` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters (except page_size) provided to + * `ListApiOperations` must match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.apihub.v1.ApiOperation|ApiOperation} 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 `listApiOperationsAsync()` + * 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. + */ + listApiOperationsStream( + request?: protos.google.cloud.apihub.v1.IListApiOperationsRequest, + 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['listApiOperations']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listApiOperations.createStream( + this.innerApiCalls.listApiOperations as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listApiOperations`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent which owns this collection of operations i.e., the API + * version. Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}` + * @param {string} [request.filter] + * Optional. An expression that filters the list of ApiOperations. + * + * A filter expression consists of a field name, a comparison + * operator, and a value for filtering. The value must be a string or a + * boolean. The comparison operator must be one of: `<`, `>` or + * `=`. Filters are not case sensitive. + * + * The following fields in the `ApiOperation` are eligible for filtering: + * * `name` - The ApiOperation resource name. Allowed comparison + * operators: + * `=`. + * * `details.http_operation.path.path` - The http operation's complete path + * relative to server endpoint. Allowed comparison operators: `=`. + * * `details.http_operation.method` - The http operation method type. + * Allowed comparison operators: `=`. + * * `details.deprecated` - Indicates if the ApiOperation is deprecated. + * Allowed values are True / False indicating the deprycation status of the + * ApiOperation. Allowed comparison operators: `=`. + * * `create_time` - The time at which the ApiOperation was created. The + * value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] + * format. Allowed comparison operators: `>` and `<`. + * + * Expressions are combined with either `AND` logic operator or `OR` logical + * operator but not both of them together i.e. only one of the `AND` or `OR` + * operator can be used throughout the filter string and both the operators + * cannot be used together. No other logical operators are supported. At most + * three filter fields are allowed in the filter string and if provided + * more than that then `INVALID_ARGUMENT` error is returned by the API. + * + * Here are a few examples: + * + * * `details.deprecated = True` - The ApiOperation is deprecated. + * * `details.http_operation.method = GET AND create_time < + * \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - + * The method of the http operation of the ApiOperation is _GET_ and the + * spec was created before _2021-08-15 14:50:00 UTC_ and after _2021-08-10 + * 12:00:00 UTC_. + * * `details.http_operation.method = GET OR details.http_operation.method = + * POST`. - The http operation of the method of ApiOperation is _GET_ or + * _POST_. + * @param {number} [request.pageSize] + * Optional. The maximum number of operations to return. The service may + * return fewer than this value. If unspecified, at most 50 operations will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListApiOperations` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters (except page_size) provided to + * `ListApiOperations` must match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@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.apihub.v1.ApiOperation|ApiOperation}. 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/api_hub.list_api_operations.js + * region_tag:apihub_v1_generated_ApiHub_ListApiOperations_async + */ + listApiOperationsAsync( + request?: protos.google.cloud.apihub.v1.IListApiOperationsRequest, + 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['listApiOperations']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listApiOperations.asyncIterate( + this.innerApiCalls['listApiOperations'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * List deployment resources in the API hub. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of deployment resources. + * Format: `projects/{project}/locations/{location}` + * @param {string} [request.filter] + * Optional. An expression that filters the list of Deployments. + * + * A filter expression consists of a field name, a comparison + * operator, and a value for filtering. The value must be a string. The + * comparison operator must be one of: `<`, `>` or + * `=`. Filters are not case sensitive. + * + * The following fields in the `Deployments` are eligible for filtering: + * + * * `display_name` - The display name of the Deployment. Allowed + * comparison operators: `=`. + * * `create_time` - The time at which the Deployment was created. The + * value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] + * format. Allowed comparison operators: `>` and `<`. + * * `resource_uri` - A URI to the deployment resource. Allowed + * comparison operators: `=`. + * * `api_versions` - The API versions linked to this deployment. Allowed + * comparison operators: `:`. + * * `deployment_type.enum_values.values.id` - The allowed value id of the + * deployment_type attribute associated with the Deployment. Allowed + * comparison operators: `:`. + * * `deployment_type.enum_values.values.display_name` - The allowed value + * display name of the deployment_type attribute associated with the + * Deployment. Allowed comparison operators: `:`. + * * `slo.string_values.values` -The allowed string value of the slo + * attribute associated with the deployment. Allowed comparison + * operators: `:`. + * * `environment.enum_values.values.id` - The allowed value id of the + * environment attribute associated with the deployment. Allowed + * comparison operators: `:`. + * * `environment.enum_values.values.display_name` - The allowed value + * display name of the environment attribute associated with the deployment. + * Allowed comparison operators: `:`. + * + * Expressions are combined with either `AND` logic operator or `OR` logical + * operator but not both of them together i.e. only one of the `AND` or `OR` + * operator can be used throughout the filter string and both the operators + * cannot be used together. No other logical operators are supported. At most + * three filter fields are allowed in the filter string and if provided + * more than that then `INVALID_ARGUMENT` error is returned by the API. + * + * Here are a few examples: + * + * * `environment.enum_values.values.id: staging-id` - The allowed value id + * of the environment attribute associated with the Deployment is + * _staging-id_. + * * `environment.enum_values.values.display_name: \"Staging Deployment\"` - + * The allowed value display name of the environment attribute associated + * with the Deployment is `Staging Deployment`. + * * `environment.enum_values.values.id: production-id AND create_time < + * \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - + * The allowed value id of the environment attribute associated with the + * Deployment is _production-id_ and Deployment was created before + * _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_. + * * `environment.enum_values.values.id: production-id OR + * slo.string_values.values: \"99.99%\"` + * - The allowed value id of the environment attribute Deployment is + * _production-id_ or string value of the slo attribute is _99.99%_. + * @param {number} [request.pageSize] + * Optional. The maximum number of deployment resources to return. The service + * may return fewer than this value. If unspecified, at most 50 deployments + * will be returned. The maximum value is 1000; values above 1000 will be + * coerced to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListDeployments` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters (except page_size) provided to + * `ListDeployments` must match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.apihub.v1.Deployment|Deployment}. + * 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 `listDeploymentsAsync()` + * 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. + */ + listDeployments( + request?: protos.google.cloud.apihub.v1.IListDeploymentsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apihub.v1.IDeployment[], + protos.google.cloud.apihub.v1.IListDeploymentsRequest | null, + protos.google.cloud.apihub.v1.IListDeploymentsResponse, + ] + >; + listDeployments( + request: protos.google.cloud.apihub.v1.IListDeploymentsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.apihub.v1.IListDeploymentsRequest, + protos.google.cloud.apihub.v1.IListDeploymentsResponse | null | undefined, + protos.google.cloud.apihub.v1.IDeployment + > + ): void; + listDeployments( + request: protos.google.cloud.apihub.v1.IListDeploymentsRequest, + callback: PaginationCallback< + protos.google.cloud.apihub.v1.IListDeploymentsRequest, + protos.google.cloud.apihub.v1.IListDeploymentsResponse | null | undefined, + protos.google.cloud.apihub.v1.IDeployment + > + ): void; + listDeployments( + request?: protos.google.cloud.apihub.v1.IListDeploymentsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.apihub.v1.IListDeploymentsRequest, + | protos.google.cloud.apihub.v1.IListDeploymentsResponse + | null + | undefined, + protos.google.cloud.apihub.v1.IDeployment + >, + callback?: PaginationCallback< + protos.google.cloud.apihub.v1.IListDeploymentsRequest, + protos.google.cloud.apihub.v1.IListDeploymentsResponse | null | undefined, + protos.google.cloud.apihub.v1.IDeployment + > + ): Promise< + [ + protos.google.cloud.apihub.v1.IDeployment[], + protos.google.cloud.apihub.v1.IListDeploymentsRequest | null, + protos.google.cloud.apihub.v1.IListDeploymentsResponse, + ] + > | 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.listDeployments(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of deployment resources. + * Format: `projects/{project}/locations/{location}` + * @param {string} [request.filter] + * Optional. An expression that filters the list of Deployments. + * + * A filter expression consists of a field name, a comparison + * operator, and a value for filtering. The value must be a string. The + * comparison operator must be one of: `<`, `>` or + * `=`. Filters are not case sensitive. + * + * The following fields in the `Deployments` are eligible for filtering: + * + * * `display_name` - The display name of the Deployment. Allowed + * comparison operators: `=`. + * * `create_time` - The time at which the Deployment was created. The + * value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] + * format. Allowed comparison operators: `>` and `<`. + * * `resource_uri` - A URI to the deployment resource. Allowed + * comparison operators: `=`. + * * `api_versions` - The API versions linked to this deployment. Allowed + * comparison operators: `:`. + * * `deployment_type.enum_values.values.id` - The allowed value id of the + * deployment_type attribute associated with the Deployment. Allowed + * comparison operators: `:`. + * * `deployment_type.enum_values.values.display_name` - The allowed value + * display name of the deployment_type attribute associated with the + * Deployment. Allowed comparison operators: `:`. + * * `slo.string_values.values` -The allowed string value of the slo + * attribute associated with the deployment. Allowed comparison + * operators: `:`. + * * `environment.enum_values.values.id` - The allowed value id of the + * environment attribute associated with the deployment. Allowed + * comparison operators: `:`. + * * `environment.enum_values.values.display_name` - The allowed value + * display name of the environment attribute associated with the deployment. + * Allowed comparison operators: `:`. + * + * Expressions are combined with either `AND` logic operator or `OR` logical + * operator but not both of them together i.e. only one of the `AND` or `OR` + * operator can be used throughout the filter string and both the operators + * cannot be used together. No other logical operators are supported. At most + * three filter fields are allowed in the filter string and if provided + * more than that then `INVALID_ARGUMENT` error is returned by the API. + * + * Here are a few examples: + * + * * `environment.enum_values.values.id: staging-id` - The allowed value id + * of the environment attribute associated with the Deployment is + * _staging-id_. + * * `environment.enum_values.values.display_name: \"Staging Deployment\"` - + * The allowed value display name of the environment attribute associated + * with the Deployment is `Staging Deployment`. + * * `environment.enum_values.values.id: production-id AND create_time < + * \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - + * The allowed value id of the environment attribute associated with the + * Deployment is _production-id_ and Deployment was created before + * _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_. + * * `environment.enum_values.values.id: production-id OR + * slo.string_values.values: \"99.99%\"` + * - The allowed value id of the environment attribute Deployment is + * _production-id_ or string value of the slo attribute is _99.99%_. + * @param {number} [request.pageSize] + * Optional. The maximum number of deployment resources to return. The service + * may return fewer than this value. If unspecified, at most 50 deployments + * will be returned. The maximum value is 1000; values above 1000 will be + * coerced to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListDeployments` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters (except page_size) provided to + * `ListDeployments` must match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.apihub.v1.Deployment|Deployment} 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 `listDeploymentsAsync()` + * 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. + */ + listDeploymentsStream( + request?: protos.google.cloud.apihub.v1.IListDeploymentsRequest, + 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['listDeployments']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listDeployments.createStream( + this.innerApiCalls.listDeployments as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listDeployments`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of deployment resources. + * Format: `projects/{project}/locations/{location}` + * @param {string} [request.filter] + * Optional. An expression that filters the list of Deployments. + * + * A filter expression consists of a field name, a comparison + * operator, and a value for filtering. The value must be a string. The + * comparison operator must be one of: `<`, `>` or + * `=`. Filters are not case sensitive. + * + * The following fields in the `Deployments` are eligible for filtering: + * + * * `display_name` - The display name of the Deployment. Allowed + * comparison operators: `=`. + * * `create_time` - The time at which the Deployment was created. The + * value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] + * format. Allowed comparison operators: `>` and `<`. + * * `resource_uri` - A URI to the deployment resource. Allowed + * comparison operators: `=`. + * * `api_versions` - The API versions linked to this deployment. Allowed + * comparison operators: `:`. + * * `deployment_type.enum_values.values.id` - The allowed value id of the + * deployment_type attribute associated with the Deployment. Allowed + * comparison operators: `:`. + * * `deployment_type.enum_values.values.display_name` - The allowed value + * display name of the deployment_type attribute associated with the + * Deployment. Allowed comparison operators: `:`. + * * `slo.string_values.values` -The allowed string value of the slo + * attribute associated with the deployment. Allowed comparison + * operators: `:`. + * * `environment.enum_values.values.id` - The allowed value id of the + * environment attribute associated with the deployment. Allowed + * comparison operators: `:`. + * * `environment.enum_values.values.display_name` - The allowed value + * display name of the environment attribute associated with the deployment. + * Allowed comparison operators: `:`. + * + * Expressions are combined with either `AND` logic operator or `OR` logical + * operator but not both of them together i.e. only one of the `AND` or `OR` + * operator can be used throughout the filter string and both the operators + * cannot be used together. No other logical operators are supported. At most + * three filter fields are allowed in the filter string and if provided + * more than that then `INVALID_ARGUMENT` error is returned by the API. + * + * Here are a few examples: + * + * * `environment.enum_values.values.id: staging-id` - The allowed value id + * of the environment attribute associated with the Deployment is + * _staging-id_. + * * `environment.enum_values.values.display_name: \"Staging Deployment\"` - + * The allowed value display name of the environment attribute associated + * with the Deployment is `Staging Deployment`. + * * `environment.enum_values.values.id: production-id AND create_time < + * \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - + * The allowed value id of the environment attribute associated with the + * Deployment is _production-id_ and Deployment was created before + * _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_. + * * `environment.enum_values.values.id: production-id OR + * slo.string_values.values: \"99.99%\"` + * - The allowed value id of the environment attribute Deployment is + * _production-id_ or string value of the slo attribute is _99.99%_. + * @param {number} [request.pageSize] + * Optional. The maximum number of deployment resources to return. The service + * may return fewer than this value. If unspecified, at most 50 deployments + * will be returned. The maximum value is 1000; values above 1000 will be + * coerced to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListDeployments` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters (except page_size) provided to + * `ListDeployments` must match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@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.apihub.v1.Deployment|Deployment}. 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/api_hub.list_deployments.js + * region_tag:apihub_v1_generated_ApiHub_ListDeployments_async + */ + listDeploymentsAsync( + request?: protos.google.cloud.apihub.v1.IListDeploymentsRequest, + 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['listDeployments']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listDeployments.asyncIterate( + this.innerApiCalls['listDeployments'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * List all attributes. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource for Attribute. + * Format: `projects/{project}/locations/{location}` + * @param {string} [request.filter] + * Optional. An expression that filters the list of Attributes. + * + * A filter expression consists of a field name, a comparison + * operator, and a value for filtering. The value must be a string or a + * boolean. The comparison operator must be one of: `<`, `>` or + * `=`. Filters are not case sensitive. + * + * The following fields in the `Attribute` are eligible for filtering: + * + * * `display_name` - The display name of the Attribute. Allowed + * comparison operators: `=`. + * * `definition_type` - The definition type of the attribute. Allowed + * comparison operators: `=`. + * * `scope` - The scope of the attribute. Allowed comparison operators: + * `=`. + * * `data_type` - The type of the data of the attribute. Allowed + * comparison operators: `=`. + * * `mandatory` - Denotes whether the attribute is mandatory or not. + * Allowed comparison operators: `=`. + * * `create_time` - The time at which the Attribute was created. The + * value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] + * format. Allowed comparison operators: `>` and `<`. + * + * Expressions are combined with either `AND` logic operator or `OR` logical + * operator but not both of them together i.e. only one of the `AND` or `OR` + * operator can be used throughout the filter string and both the operators + * cannot be used together. No other logical operators are + * supported. At most three filter fields are allowed in the filter + * string and if provided more than that then `INVALID_ARGUMENT` error is + * returned by the API. + * + * Here are a few examples: + * + * * `display_name = production` - - The display name of the attribute is + * _production_. + * * `(display_name = production) AND (create_time < + * \"2021-08-15T14:50:00Z\") AND (create_time > \"2021-08-10T12:00:00Z\")` - + * The display name of the attribute is _production_ and the attribute was + * created before _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00 + * UTC_. + * * `display_name = production OR scope = api` - + * The attribute where the display name is _production_ or the scope is + * _api_. + * @param {number} [request.pageSize] + * Optional. The maximum number of attribute resources to return. The service + * may return fewer than this value. If unspecified, at most 50 attributes + * will be returned. The maximum value is 1000; values above 1000 will be + * coerced to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListAttributes` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListAttributes` must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.apihub.v1.Attribute|Attribute}. + * 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 `listAttributesAsync()` + * 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. + */ + listAttributes( + request?: protos.google.cloud.apihub.v1.IListAttributesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apihub.v1.IAttribute[], + protos.google.cloud.apihub.v1.IListAttributesRequest | null, + protos.google.cloud.apihub.v1.IListAttributesResponse, + ] + >; + listAttributes( + request: protos.google.cloud.apihub.v1.IListAttributesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.apihub.v1.IListAttributesRequest, + protos.google.cloud.apihub.v1.IListAttributesResponse | null | undefined, + protos.google.cloud.apihub.v1.IAttribute + > + ): void; + listAttributes( + request: protos.google.cloud.apihub.v1.IListAttributesRequest, + callback: PaginationCallback< + protos.google.cloud.apihub.v1.IListAttributesRequest, + protos.google.cloud.apihub.v1.IListAttributesResponse | null | undefined, + protos.google.cloud.apihub.v1.IAttribute + > + ): void; + listAttributes( + request?: protos.google.cloud.apihub.v1.IListAttributesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.apihub.v1.IListAttributesRequest, + | protos.google.cloud.apihub.v1.IListAttributesResponse + | null + | undefined, + protos.google.cloud.apihub.v1.IAttribute + >, + callback?: PaginationCallback< + protos.google.cloud.apihub.v1.IListAttributesRequest, + protos.google.cloud.apihub.v1.IListAttributesResponse | null | undefined, + protos.google.cloud.apihub.v1.IAttribute + > + ): Promise< + [ + protos.google.cloud.apihub.v1.IAttribute[], + protos.google.cloud.apihub.v1.IListAttributesRequest | null, + protos.google.cloud.apihub.v1.IListAttributesResponse, + ] + > | 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.listAttributes(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource for Attribute. + * Format: `projects/{project}/locations/{location}` + * @param {string} [request.filter] + * Optional. An expression that filters the list of Attributes. + * + * A filter expression consists of a field name, a comparison + * operator, and a value for filtering. The value must be a string or a + * boolean. The comparison operator must be one of: `<`, `>` or + * `=`. Filters are not case sensitive. + * + * The following fields in the `Attribute` are eligible for filtering: + * + * * `display_name` - The display name of the Attribute. Allowed + * comparison operators: `=`. + * * `definition_type` - The definition type of the attribute. Allowed + * comparison operators: `=`. + * * `scope` - The scope of the attribute. Allowed comparison operators: + * `=`. + * * `data_type` - The type of the data of the attribute. Allowed + * comparison operators: `=`. + * * `mandatory` - Denotes whether the attribute is mandatory or not. + * Allowed comparison operators: `=`. + * * `create_time` - The time at which the Attribute was created. The + * value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] + * format. Allowed comparison operators: `>` and `<`. + * + * Expressions are combined with either `AND` logic operator or `OR` logical + * operator but not both of them together i.e. only one of the `AND` or `OR` + * operator can be used throughout the filter string and both the operators + * cannot be used together. No other logical operators are + * supported. At most three filter fields are allowed in the filter + * string and if provided more than that then `INVALID_ARGUMENT` error is + * returned by the API. + * + * Here are a few examples: + * + * * `display_name = production` - - The display name of the attribute is + * _production_. + * * `(display_name = production) AND (create_time < + * \"2021-08-15T14:50:00Z\") AND (create_time > \"2021-08-10T12:00:00Z\")` - + * The display name of the attribute is _production_ and the attribute was + * created before _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00 + * UTC_. + * * `display_name = production OR scope = api` - + * The attribute where the display name is _production_ or the scope is + * _api_. + * @param {number} [request.pageSize] + * Optional. The maximum number of attribute resources to return. The service + * may return fewer than this value. If unspecified, at most 50 attributes + * will be returned. The maximum value is 1000; values above 1000 will be + * coerced to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListAttributes` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListAttributes` must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.apihub.v1.Attribute|Attribute} 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 `listAttributesAsync()` + * 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. + */ + listAttributesStream( + request?: protos.google.cloud.apihub.v1.IListAttributesRequest, + 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['listAttributes']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listAttributes.createStream( + this.innerApiCalls.listAttributes as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listAttributes`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource for Attribute. + * Format: `projects/{project}/locations/{location}` + * @param {string} [request.filter] + * Optional. An expression that filters the list of Attributes. + * + * A filter expression consists of a field name, a comparison + * operator, and a value for filtering. The value must be a string or a + * boolean. The comparison operator must be one of: `<`, `>` or + * `=`. Filters are not case sensitive. + * + * The following fields in the `Attribute` are eligible for filtering: + * + * * `display_name` - The display name of the Attribute. Allowed + * comparison operators: `=`. + * * `definition_type` - The definition type of the attribute. Allowed + * comparison operators: `=`. + * * `scope` - The scope of the attribute. Allowed comparison operators: + * `=`. + * * `data_type` - The type of the data of the attribute. Allowed + * comparison operators: `=`. + * * `mandatory` - Denotes whether the attribute is mandatory or not. + * Allowed comparison operators: `=`. + * * `create_time` - The time at which the Attribute was created. The + * value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] + * format. Allowed comparison operators: `>` and `<`. + * + * Expressions are combined with either `AND` logic operator or `OR` logical + * operator but not both of them together i.e. only one of the `AND` or `OR` + * operator can be used throughout the filter string and both the operators + * cannot be used together. No other logical operators are + * supported. At most three filter fields are allowed in the filter + * string and if provided more than that then `INVALID_ARGUMENT` error is + * returned by the API. + * + * Here are a few examples: + * + * * `display_name = production` - - The display name of the attribute is + * _production_. + * * `(display_name = production) AND (create_time < + * \"2021-08-15T14:50:00Z\") AND (create_time > \"2021-08-10T12:00:00Z\")` - + * The display name of the attribute is _production_ and the attribute was + * created before _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00 + * UTC_. + * * `display_name = production OR scope = api` - + * The attribute where the display name is _production_ or the scope is + * _api_. + * @param {number} [request.pageSize] + * Optional. The maximum number of attribute resources to return. The service + * may return fewer than this value. If unspecified, at most 50 attributes + * will be returned. The maximum value is 1000; values above 1000 will be + * coerced to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListAttributes` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListAttributes` must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@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.apihub.v1.Attribute|Attribute}. 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/api_hub.list_attributes.js + * region_tag:apihub_v1_generated_ApiHub_ListAttributes_async + */ + listAttributesAsync( + request?: protos.google.cloud.apihub.v1.IListAttributesRequest, + 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['listAttributes']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listAttributes.asyncIterate( + this.innerApiCalls['listAttributes'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Search across API-Hub resources. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.location + * Required. The resource name of the location which will be of the type + * `projects/{project_id}/locations/{location_id}`. This field is used to + * identify the instance of API-Hub in which resources should be searched. + * @param {string} request.query + * Required. The free text search query. This query can contain keywords which + * could be related to any detail of the API-Hub resources such display names, + * descriptions, attributes etc. + * @param {string} [request.filter] + * Optional. An expression that filters the list of search results. + * + * A filter expression consists of a field name, a comparison operator, + * and a value for filtering. The value must be a string, a number, or a + * boolean. The comparison operator must be `=`. Filters are not case + * sensitive. + * + * The following field names are eligible for filtering: + * * `resource_type` - The type of resource in the search results. + * Must be one of the following: `Api`, `ApiOperation`, `Deployment`, + * `Definition`, `Spec` or `Version`. This field can only be specified once + * in the filter. + * + * Here are is an example: + * + * * `resource_type = Api` - The resource_type is _Api_. + * @param {number} [request.pageSize] + * Optional. The maximum number of search results to return. The service may + * return fewer than this value. If unspecified at most 10 search results will + * be returned. If value is negative then `INVALID_ARGUMENT` error is + * returned. The maximum value is 25; values above 25 will be coerced to 25. + * While paginating, you can specify a new page size parameter for each page + * of search results to be listed. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous + * {@link protos.SearchResources|SearchResources} + * call. Specify this parameter to retrieve the next page of transactions. + * + * When paginating, you must specify the `page_token` parameter and all the + * other parameters except + * {@link protos.google.cloud.apihub.v1.SearchResourcesRequest.page_size|page_size} + * should be specified with the same value which was used in the previous + * call. If the other fields are set with a different value than the previous + * call then `INVALID_ARGUMENT` error is returned. + * @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.apihub.v1.SearchResult|SearchResult}. + * 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 `searchResourcesAsync()` + * 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. + */ + searchResources( + request?: protos.google.cloud.apihub.v1.ISearchResourcesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apihub.v1.ISearchResult[], + protos.google.cloud.apihub.v1.ISearchResourcesRequest | null, + protos.google.cloud.apihub.v1.ISearchResourcesResponse, + ] + >; + searchResources( + request: protos.google.cloud.apihub.v1.ISearchResourcesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.apihub.v1.ISearchResourcesRequest, + protos.google.cloud.apihub.v1.ISearchResourcesResponse | null | undefined, + protos.google.cloud.apihub.v1.ISearchResult + > + ): void; + searchResources( + request: protos.google.cloud.apihub.v1.ISearchResourcesRequest, + callback: PaginationCallback< + protos.google.cloud.apihub.v1.ISearchResourcesRequest, + protos.google.cloud.apihub.v1.ISearchResourcesResponse | null | undefined, + protos.google.cloud.apihub.v1.ISearchResult + > + ): void; + searchResources( + request?: protos.google.cloud.apihub.v1.ISearchResourcesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.apihub.v1.ISearchResourcesRequest, + | protos.google.cloud.apihub.v1.ISearchResourcesResponse + | null + | undefined, + protos.google.cloud.apihub.v1.ISearchResult + >, + callback?: PaginationCallback< + protos.google.cloud.apihub.v1.ISearchResourcesRequest, + protos.google.cloud.apihub.v1.ISearchResourcesResponse | null | undefined, + protos.google.cloud.apihub.v1.ISearchResult + > + ): Promise< + [ + protos.google.cloud.apihub.v1.ISearchResult[], + protos.google.cloud.apihub.v1.ISearchResourcesRequest | null, + protos.google.cloud.apihub.v1.ISearchResourcesResponse, + ] + > | 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({ + location: request.location ?? '', + }); + this.initialize(); + return this.innerApiCalls.searchResources(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.location + * Required. The resource name of the location which will be of the type + * `projects/{project_id}/locations/{location_id}`. This field is used to + * identify the instance of API-Hub in which resources should be searched. + * @param {string} request.query + * Required. The free text search query. This query can contain keywords which + * could be related to any detail of the API-Hub resources such display names, + * descriptions, attributes etc. + * @param {string} [request.filter] + * Optional. An expression that filters the list of search results. + * + * A filter expression consists of a field name, a comparison operator, + * and a value for filtering. The value must be a string, a number, or a + * boolean. The comparison operator must be `=`. Filters are not case + * sensitive. + * + * The following field names are eligible for filtering: + * * `resource_type` - The type of resource in the search results. + * Must be one of the following: `Api`, `ApiOperation`, `Deployment`, + * `Definition`, `Spec` or `Version`. This field can only be specified once + * in the filter. + * + * Here are is an example: + * + * * `resource_type = Api` - The resource_type is _Api_. + * @param {number} [request.pageSize] + * Optional. The maximum number of search results to return. The service may + * return fewer than this value. If unspecified at most 10 search results will + * be returned. If value is negative then `INVALID_ARGUMENT` error is + * returned. The maximum value is 25; values above 25 will be coerced to 25. + * While paginating, you can specify a new page size parameter for each page + * of search results to be listed. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous + * {@link protos.SearchResources|SearchResources} + * call. Specify this parameter to retrieve the next page of transactions. + * + * When paginating, you must specify the `page_token` parameter and all the + * other parameters except + * {@link protos.google.cloud.apihub.v1.SearchResourcesRequest.page_size|page_size} + * should be specified with the same value which was used in the previous + * call. If the other fields are set with a different value than the previous + * call then `INVALID_ARGUMENT` error is returned. + * @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.apihub.v1.SearchResult|SearchResult} 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 `searchResourcesAsync()` + * 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. + */ + searchResourcesStream( + request?: protos.google.cloud.apihub.v1.ISearchResourcesRequest, + 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({ + location: request.location ?? '', + }); + const defaultCallSettings = this._defaults['searchResources']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.searchResources.createStream( + this.innerApiCalls.searchResources as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `searchResources`, 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.location + * Required. The resource name of the location which will be of the type + * `projects/{project_id}/locations/{location_id}`. This field is used to + * identify the instance of API-Hub in which resources should be searched. + * @param {string} request.query + * Required. The free text search query. This query can contain keywords which + * could be related to any detail of the API-Hub resources such display names, + * descriptions, attributes etc. + * @param {string} [request.filter] + * Optional. An expression that filters the list of search results. + * + * A filter expression consists of a field name, a comparison operator, + * and a value for filtering. The value must be a string, a number, or a + * boolean. The comparison operator must be `=`. Filters are not case + * sensitive. + * + * The following field names are eligible for filtering: + * * `resource_type` - The type of resource in the search results. + * Must be one of the following: `Api`, `ApiOperation`, `Deployment`, + * `Definition`, `Spec` or `Version`. This field can only be specified once + * in the filter. + * + * Here are is an example: + * + * * `resource_type = Api` - The resource_type is _Api_. + * @param {number} [request.pageSize] + * Optional. The maximum number of search results to return. The service may + * return fewer than this value. If unspecified at most 10 search results will + * be returned. If value is negative then `INVALID_ARGUMENT` error is + * returned. The maximum value is 25; values above 25 will be coerced to 25. + * While paginating, you can specify a new page size parameter for each page + * of search results to be listed. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous + * {@link protos.SearchResources|SearchResources} + * call. Specify this parameter to retrieve the next page of transactions. + * + * When paginating, you must specify the `page_token` parameter and all the + * other parameters except + * {@link protos.google.cloud.apihub.v1.SearchResourcesRequest.page_size|page_size} + * should be specified with the same value which was used in the previous + * call. If the other fields are set with a different value than the previous + * call then `INVALID_ARGUMENT` error is returned. + * @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.apihub.v1.SearchResult|SearchResult}. 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/api_hub.search_resources.js + * region_tag:apihub_v1_generated_ApiHub_SearchResources_async + */ + searchResourcesAsync( + request?: protos.google.cloud.apihub.v1.ISearchResourcesRequest, + 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({ + location: request.location ?? '', + }); + const defaultCallSettings = this._defaults['searchResources']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.searchResources.asyncIterate( + this.innerApiCalls['searchResources'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * List External API resources in the API hub. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of External API resources. + * Format: `projects/{project}/locations/{location}` + * @param {number} [request.pageSize] + * Optional. The maximum number of External API resources to return. The + * service may return fewer than this value. If unspecified, at most 50 + * ExternalApis will be returned. The maximum value is 1000; values above 1000 + * will be coerced to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListExternalApis` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters (except page_size) provided to + * `ListExternalApis` must match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.apihub.v1.ExternalApi|ExternalApi}. + * 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 `listExternalApisAsync()` + * 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. + */ + listExternalApis( + request?: protos.google.cloud.apihub.v1.IListExternalApisRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apihub.v1.IExternalApi[], + protos.google.cloud.apihub.v1.IListExternalApisRequest | null, + protos.google.cloud.apihub.v1.IListExternalApisResponse, + ] + >; + listExternalApis( + request: protos.google.cloud.apihub.v1.IListExternalApisRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.apihub.v1.IListExternalApisRequest, + | protos.google.cloud.apihub.v1.IListExternalApisResponse + | null + | undefined, + protos.google.cloud.apihub.v1.IExternalApi + > + ): void; + listExternalApis( + request: protos.google.cloud.apihub.v1.IListExternalApisRequest, + callback: PaginationCallback< + protos.google.cloud.apihub.v1.IListExternalApisRequest, + | protos.google.cloud.apihub.v1.IListExternalApisResponse + | null + | undefined, + protos.google.cloud.apihub.v1.IExternalApi + > + ): void; + listExternalApis( + request?: protos.google.cloud.apihub.v1.IListExternalApisRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.apihub.v1.IListExternalApisRequest, + | protos.google.cloud.apihub.v1.IListExternalApisResponse + | null + | undefined, + protos.google.cloud.apihub.v1.IExternalApi + >, + callback?: PaginationCallback< + protos.google.cloud.apihub.v1.IListExternalApisRequest, + | protos.google.cloud.apihub.v1.IListExternalApisResponse + | null + | undefined, + protos.google.cloud.apihub.v1.IExternalApi + > + ): Promise< + [ + protos.google.cloud.apihub.v1.IExternalApi[], + protos.google.cloud.apihub.v1.IListExternalApisRequest | null, + protos.google.cloud.apihub.v1.IListExternalApisResponse, + ] + > | 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.listExternalApis(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of External API resources. + * Format: `projects/{project}/locations/{location}` + * @param {number} [request.pageSize] + * Optional. The maximum number of External API resources to return. The + * service may return fewer than this value. If unspecified, at most 50 + * ExternalApis will be returned. The maximum value is 1000; values above 1000 + * will be coerced to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListExternalApis` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters (except page_size) provided to + * `ListExternalApis` must match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.apihub.v1.ExternalApi|ExternalApi} 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 `listExternalApisAsync()` + * 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. + */ + listExternalApisStream( + request?: protos.google.cloud.apihub.v1.IListExternalApisRequest, + 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['listExternalApis']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listExternalApis.createStream( + this.innerApiCalls.listExternalApis as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listExternalApis`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of External API resources. + * Format: `projects/{project}/locations/{location}` + * @param {number} [request.pageSize] + * Optional. The maximum number of External API resources to return. The + * service may return fewer than this value. If unspecified, at most 50 + * ExternalApis will be returned. The maximum value is 1000; values above 1000 + * will be coerced to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListExternalApis` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters (except page_size) provided to + * `ListExternalApis` must match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@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.apihub.v1.ExternalApi|ExternalApi}. 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/api_hub.list_external_apis.js + * region_tag:apihub_v1_generated_ApiHub_ListExternalApis_async + */ + listExternalApisAsync( + request?: protos.google.cloud.apihub.v1.IListExternalApisRequest, + 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['listExternalApis']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listExternalApis.asyncIterate( + this.innerApiCalls['listExternalApis'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * 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); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified api resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @returns {string} Resource name string. + */ + apiPath(project: string, location: string, api: string) { + return this.pathTemplates.apiPathTemplate.render({ + project: project, + location: location, + api: api, + }); + } + + /** + * Parse the project from Api resource. + * + * @param {string} apiName + * A fully-qualified path representing Api resource. + * @returns {string} A string representing the project. + */ + matchProjectFromApiName(apiName: string) { + return this.pathTemplates.apiPathTemplate.match(apiName).project; + } + + /** + * Parse the location from Api resource. + * + * @param {string} apiName + * A fully-qualified path representing Api resource. + * @returns {string} A string representing the location. + */ + matchLocationFromApiName(apiName: string) { + return this.pathTemplates.apiPathTemplate.match(apiName).location; + } + + /** + * Parse the api from Api resource. + * + * @param {string} apiName + * A fully-qualified path representing Api resource. + * @returns {string} A string representing the api. + */ + matchApiFromApiName(apiName: string) { + return this.pathTemplates.apiPathTemplate.match(apiName).api; + } + + /** + * Return a fully-qualified apiHubInstance resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api_hub_instance + * @returns {string} Resource name string. + */ + apiHubInstancePath( + project: string, + location: string, + apiHubInstance: string + ) { + return this.pathTemplates.apiHubInstancePathTemplate.render({ + project: project, + location: location, + api_hub_instance: apiHubInstance, + }); + } + + /** + * Parse the project from ApiHubInstance resource. + * + * @param {string} apiHubInstanceName + * A fully-qualified path representing ApiHubInstance resource. + * @returns {string} A string representing the project. + */ + matchProjectFromApiHubInstanceName(apiHubInstanceName: string) { + return this.pathTemplates.apiHubInstancePathTemplate.match( + apiHubInstanceName + ).project; + } + + /** + * Parse the location from ApiHubInstance resource. + * + * @param {string} apiHubInstanceName + * A fully-qualified path representing ApiHubInstance resource. + * @returns {string} A string representing the location. + */ + matchLocationFromApiHubInstanceName(apiHubInstanceName: string) { + return this.pathTemplates.apiHubInstancePathTemplate.match( + apiHubInstanceName + ).location; + } + + /** + * Parse the api_hub_instance from ApiHubInstance resource. + * + * @param {string} apiHubInstanceName + * A fully-qualified path representing ApiHubInstance resource. + * @returns {string} A string representing the api_hub_instance. + */ + matchApiHubInstanceFromApiHubInstanceName(apiHubInstanceName: string) { + return this.pathTemplates.apiHubInstancePathTemplate.match( + apiHubInstanceName + ).api_hub_instance; + } + + /** + * Return a fully-qualified apiOperation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @param {string} version + * @param {string} operation + * @returns {string} Resource name string. + */ + apiOperationPath( + project: string, + location: string, + api: string, + version: string, + operation: string + ) { + return this.pathTemplates.apiOperationPathTemplate.render({ + project: project, + location: location, + api: api, + version: version, + operation: operation, + }); + } + + /** + * Parse the project from ApiOperation resource. + * + * @param {string} apiOperationName + * A fully-qualified path representing ApiOperation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromApiOperationName(apiOperationName: string) { + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName) + .project; + } + + /** + * Parse the location from ApiOperation resource. + * + * @param {string} apiOperationName + * A fully-qualified path representing ApiOperation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromApiOperationName(apiOperationName: string) { + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName) + .location; + } + + /** + * Parse the api from ApiOperation resource. + * + * @param {string} apiOperationName + * A fully-qualified path representing ApiOperation resource. + * @returns {string} A string representing the api. + */ + matchApiFromApiOperationName(apiOperationName: string) { + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName) + .api; + } + + /** + * Parse the version from ApiOperation resource. + * + * @param {string} apiOperationName + * A fully-qualified path representing ApiOperation resource. + * @returns {string} A string representing the version. + */ + matchVersionFromApiOperationName(apiOperationName: string) { + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName) + .version; + } + + /** + * Parse the operation from ApiOperation resource. + * + * @param {string} apiOperationName + * A fully-qualified path representing ApiOperation resource. + * @returns {string} A string representing the operation. + */ + matchOperationFromApiOperationName(apiOperationName: string) { + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName) + .operation; + } + + /** + * Return a fully-qualified attribute resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} attribute + * @returns {string} Resource name string. + */ + attributePath(project: string, location: string, attribute: string) { + return this.pathTemplates.attributePathTemplate.render({ + project: project, + location: location, + attribute: attribute, + }); + } + + /** + * Parse the project from Attribute resource. + * + * @param {string} attributeName + * A fully-qualified path representing Attribute resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAttributeName(attributeName: string) { + return this.pathTemplates.attributePathTemplate.match(attributeName) + .project; + } + + /** + * Parse the location from Attribute resource. + * + * @param {string} attributeName + * A fully-qualified path representing Attribute resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAttributeName(attributeName: string) { + return this.pathTemplates.attributePathTemplate.match(attributeName) + .location; + } + + /** + * Parse the attribute from Attribute resource. + * + * @param {string} attributeName + * A fully-qualified path representing Attribute resource. + * @returns {string} A string representing the attribute. + */ + matchAttributeFromAttributeName(attributeName: string) { + return this.pathTemplates.attributePathTemplate.match(attributeName) + .attribute; + } + + /** + * Return a fully-qualified definition resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @param {string} version + * @param {string} definition + * @returns {string} Resource name string. + */ + definitionPath( + project: string, + location: string, + api: string, + version: string, + definition: string + ) { + return this.pathTemplates.definitionPathTemplate.render({ + project: project, + location: location, + api: api, + version: version, + definition: definition, + }); + } + + /** + * Parse the project from Definition resource. + * + * @param {string} definitionName + * A fully-qualified path representing Definition resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDefinitionName(definitionName: string) { + return this.pathTemplates.definitionPathTemplate.match(definitionName) + .project; + } + + /** + * Parse the location from Definition resource. + * + * @param {string} definitionName + * A fully-qualified path representing Definition resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDefinitionName(definitionName: string) { + return this.pathTemplates.definitionPathTemplate.match(definitionName) + .location; + } + + /** + * Parse the api from Definition resource. + * + * @param {string} definitionName + * A fully-qualified path representing Definition resource. + * @returns {string} A string representing the api. + */ + matchApiFromDefinitionName(definitionName: string) { + return this.pathTemplates.definitionPathTemplate.match(definitionName).api; + } + + /** + * Parse the version from Definition resource. + * + * @param {string} definitionName + * A fully-qualified path representing Definition resource. + * @returns {string} A string representing the version. + */ + matchVersionFromDefinitionName(definitionName: string) { + return this.pathTemplates.definitionPathTemplate.match(definitionName) + .version; + } + + /** + * Parse the definition from Definition resource. + * + * @param {string} definitionName + * A fully-qualified path representing Definition resource. + * @returns {string} A string representing the definition. + */ + matchDefinitionFromDefinitionName(definitionName: string) { + return this.pathTemplates.definitionPathTemplate.match(definitionName) + .definition; + } + + /** + * Return a fully-qualified dependency resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dependency + * @returns {string} Resource name string. + */ + dependencyPath(project: string, location: string, dependency: string) { + return this.pathTemplates.dependencyPathTemplate.render({ + project: project, + location: location, + dependency: dependency, + }); + } + + /** + * Parse the project from Dependency resource. + * + * @param {string} dependencyName + * A fully-qualified path representing Dependency resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDependencyName(dependencyName: string) { + return this.pathTemplates.dependencyPathTemplate.match(dependencyName) + .project; + } + + /** + * Parse the location from Dependency resource. + * + * @param {string} dependencyName + * A fully-qualified path representing Dependency resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDependencyName(dependencyName: string) { + return this.pathTemplates.dependencyPathTemplate.match(dependencyName) + .location; + } + + /** + * Parse the dependency from Dependency resource. + * + * @param {string} dependencyName + * A fully-qualified path representing Dependency resource. + * @returns {string} A string representing the dependency. + */ + matchDependencyFromDependencyName(dependencyName: string) { + return this.pathTemplates.dependencyPathTemplate.match(dependencyName) + .dependency; + } + + /** + * Return a fully-qualified deployment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} deployment + * @returns {string} Resource name string. + */ + deploymentPath(project: string, location: string, deployment: string) { + return this.pathTemplates.deploymentPathTemplate.render({ + project: project, + location: location, + deployment: deployment, + }); + } + + /** + * Parse the project from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .project; + } + + /** + * Parse the location from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .location; + } + + /** + * Parse the deployment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the deployment. + */ + matchDeploymentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .deployment; + } + + /** + * Return a fully-qualified externalApi resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} external_api + * @returns {string} Resource name string. + */ + externalApiPath(project: string, location: string, externalApi: string) { + return this.pathTemplates.externalApiPathTemplate.render({ + project: project, + location: location, + external_api: externalApi, + }); + } + + /** + * Parse the project from ExternalApi resource. + * + * @param {string} externalApiName + * A fully-qualified path representing ExternalApi resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExternalApiName(externalApiName: string) { + return this.pathTemplates.externalApiPathTemplate.match(externalApiName) + .project; + } + + /** + * Parse the location from ExternalApi resource. + * + * @param {string} externalApiName + * A fully-qualified path representing ExternalApi resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExternalApiName(externalApiName: string) { + return this.pathTemplates.externalApiPathTemplate.match(externalApiName) + .location; + } + + /** + * Parse the external_api from ExternalApi resource. + * + * @param {string} externalApiName + * A fully-qualified path representing ExternalApi resource. + * @returns {string} A string representing the external_api. + */ + matchExternalApiFromExternalApiName(externalApiName: string) { + return this.pathTemplates.externalApiPathTemplate.match(externalApiName) + .external_api; + } + + /** + * Return a fully-qualified hostProjectRegistration resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} host_project_registration + * @returns {string} Resource name string. + */ + hostProjectRegistrationPath( + project: string, + location: string, + hostProjectRegistration: string + ) { + return this.pathTemplates.hostProjectRegistrationPathTemplate.render({ + project: project, + location: location, + host_project_registration: hostProjectRegistration, + }); + } + + /** + * Parse the project from HostProjectRegistration resource. + * + * @param {string} hostProjectRegistrationName + * A fully-qualified path representing HostProjectRegistration resource. + * @returns {string} A string representing the project. + */ + matchProjectFromHostProjectRegistrationName( + hostProjectRegistrationName: string + ) { + return this.pathTemplates.hostProjectRegistrationPathTemplate.match( + hostProjectRegistrationName + ).project; + } + + /** + * Parse the location from HostProjectRegistration resource. + * + * @param {string} hostProjectRegistrationName + * A fully-qualified path representing HostProjectRegistration resource. + * @returns {string} A string representing the location. + */ + matchLocationFromHostProjectRegistrationName( + hostProjectRegistrationName: string + ) { + return this.pathTemplates.hostProjectRegistrationPathTemplate.match( + hostProjectRegistrationName + ).location; + } + + /** + * Parse the host_project_registration from HostProjectRegistration resource. + * + * @param {string} hostProjectRegistrationName + * A fully-qualified path representing HostProjectRegistration resource. + * @returns {string} A string representing the host_project_registration. + */ + matchHostProjectRegistrationFromHostProjectRegistrationName( + hostProjectRegistrationName: string + ) { + return this.pathTemplates.hostProjectRegistrationPathTemplate.match( + hostProjectRegistrationName + ).host_project_registration; + } + + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project: string, location: string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + + /** + * Return a fully-qualified plugin resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} plugin + * @returns {string} Resource name string. + */ + pluginPath(project: string, location: string, plugin: string) { + return this.pathTemplates.pluginPathTemplate.render({ + project: project, + location: location, + plugin: plugin, + }); + } + + /** + * Parse the project from Plugin resource. + * + * @param {string} pluginName + * A fully-qualified path representing Plugin resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPluginName(pluginName: string) { + return this.pathTemplates.pluginPathTemplate.match(pluginName).project; + } + + /** + * Parse the location from Plugin resource. + * + * @param {string} pluginName + * A fully-qualified path representing Plugin resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPluginName(pluginName: string) { + return this.pathTemplates.pluginPathTemplate.match(pluginName).location; + } + + /** + * Parse the plugin from Plugin resource. + * + * @param {string} pluginName + * A fully-qualified path representing Plugin resource. + * @returns {string} A string representing the plugin. + */ + matchPluginFromPluginName(pluginName: string) { + return this.pathTemplates.pluginPathTemplate.match(pluginName).plugin; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project: string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified runtimeProjectAttachment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} runtime_project_attachment + * @returns {string} Resource name string. + */ + runtimeProjectAttachmentPath( + project: string, + location: string, + runtimeProjectAttachment: string + ) { + return this.pathTemplates.runtimeProjectAttachmentPathTemplate.render({ + project: project, + location: location, + runtime_project_attachment: runtimeProjectAttachment, + }); + } + + /** + * Parse the project from RuntimeProjectAttachment resource. + * + * @param {string} runtimeProjectAttachmentName + * A fully-qualified path representing RuntimeProjectAttachment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRuntimeProjectAttachmentName( + runtimeProjectAttachmentName: string + ) { + return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match( + runtimeProjectAttachmentName + ).project; + } + + /** + * Parse the location from RuntimeProjectAttachment resource. + * + * @param {string} runtimeProjectAttachmentName + * A fully-qualified path representing RuntimeProjectAttachment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRuntimeProjectAttachmentName( + runtimeProjectAttachmentName: string + ) { + return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match( + runtimeProjectAttachmentName + ).location; + } + + /** + * Parse the runtime_project_attachment from RuntimeProjectAttachment resource. + * + * @param {string} runtimeProjectAttachmentName + * A fully-qualified path representing RuntimeProjectAttachment resource. + * @returns {string} A string representing the runtime_project_attachment. + */ + matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName( + runtimeProjectAttachmentName: string + ) { + return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match( + runtimeProjectAttachmentName + ).runtime_project_attachment; + } + + /** + * Return a fully-qualified spec resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @param {string} version + * @param {string} spec + * @returns {string} Resource name string. + */ + specPath( + project: string, + location: string, + api: string, + version: string, + spec: string + ) { + return this.pathTemplates.specPathTemplate.render({ + project: project, + location: location, + api: api, + version: version, + spec: spec, + }); + } + + /** + * Parse the project from Spec resource. + * + * @param {string} specName + * A fully-qualified path representing Spec resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSpecName(specName: string) { + return this.pathTemplates.specPathTemplate.match(specName).project; + } + + /** + * Parse the location from Spec resource. + * + * @param {string} specName + * A fully-qualified path representing Spec resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSpecName(specName: string) { + return this.pathTemplates.specPathTemplate.match(specName).location; + } + + /** + * Parse the api from Spec resource. + * + * @param {string} specName + * A fully-qualified path representing Spec resource. + * @returns {string} A string representing the api. + */ + matchApiFromSpecName(specName: string) { + return this.pathTemplates.specPathTemplate.match(specName).api; + } + + /** + * Parse the version from Spec resource. + * + * @param {string} specName + * A fully-qualified path representing Spec resource. + * @returns {string} A string representing the version. + */ + matchVersionFromSpecName(specName: string) { + return this.pathTemplates.specPathTemplate.match(specName).version; + } + + /** + * Parse the spec from Spec resource. + * + * @param {string} specName + * A fully-qualified path representing Spec resource. + * @returns {string} A string representing the spec. + */ + matchSpecFromSpecName(specName: string) { + return this.pathTemplates.specPathTemplate.match(specName).spec; + } + + /** + * Return a fully-qualified styleGuide resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} plugin + * @returns {string} Resource name string. + */ + styleGuidePath(project: string, location: string, plugin: string) { + return this.pathTemplates.styleGuidePathTemplate.render({ + project: project, + location: location, + plugin: plugin, + }); + } + + /** + * Parse the project from StyleGuide resource. + * + * @param {string} styleGuideName + * A fully-qualified path representing StyleGuide resource. + * @returns {string} A string representing the project. + */ + matchProjectFromStyleGuideName(styleGuideName: string) { + return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName) + .project; + } + + /** + * Parse the location from StyleGuide resource. + * + * @param {string} styleGuideName + * A fully-qualified path representing StyleGuide resource. + * @returns {string} A string representing the location. + */ + matchLocationFromStyleGuideName(styleGuideName: string) { + return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName) + .location; + } + + /** + * Parse the plugin from StyleGuide resource. + * + * @param {string} styleGuideName + * A fully-qualified path representing StyleGuide resource. + * @returns {string} A string representing the plugin. + */ + matchPluginFromStyleGuideName(styleGuideName: string) { + return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName) + .plugin; + } + + /** + * Return a fully-qualified version resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @param {string} version + * @returns {string} Resource name string. + */ + versionPath(project: string, location: string, api: string, version: string) { + return this.pathTemplates.versionPathTemplate.render({ + project: project, + location: location, + api: api, + version: version, + }); + } + + /** + * Parse the project from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the project. + */ + matchProjectFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).project; + } + + /** + * Parse the location from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the location. + */ + matchLocationFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).location; + } + + /** + * Parse the api from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the api. + */ + matchApiFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).api; + } + + /** + * Parse the version from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the version. + */ + matchVersionFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).version; + } + + /** + * 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.apiHubStub && !this._terminated) { + return this.apiHubStub.then(stub => { + this._terminated = true; + stub.close(); + this.locationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_client_config.json b/packages/google-cloud-apihub/src/v1/api_hub_client_config.json similarity index 100% rename from owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_client_config.json rename to packages/google-cloud-apihub/src/v1/api_hub_client_config.json diff --git a/owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_dependencies_client.ts b/packages/google-cloud-apihub/src/v1/api_hub_dependencies_client.ts similarity index 58% rename from owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_dependencies_client.ts rename to packages/google-cloud-apihub/src/v1/api_hub_dependencies_client.ts index 01b79b2c0c7..9dda80c20e9 100644 --- a/owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_dependencies_client.ts +++ b/packages/google-cloud-apihub/src/v1/api_hub_dependencies_client.ts @@ -18,7 +18,16 @@ /* global window */ import type * as gax from 'google-gax'; -import type {Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback, GaxCall, LocationsClient, LocationProtos} from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, + PaginationCallback, + GaxCall, + LocationsClient, + LocationProtos, +} from 'google-gax'; import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); @@ -99,20 +108,41 @@ export class ApiHubDependenciesClient { * const client = new ApiHubDependenciesClient({fallback: true}, gax); * ``` */ - constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { // Ensure that options include all the required fields. const staticMembers = this.constructor as typeof ApiHubDependenciesClient; - if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { - throw new Error('Please set either universe_domain or universeDomain, but not both.'); + if ( + opts?.universe_domain && + opts?.universeDomain && + opts?.universe_domain !== opts?.universeDomain + ) { + throw new Error( + 'Please set either universe_domain or universeDomain, but not both.' + ); } - const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; - this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; + this._universeDomain = + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; this._servicePath = 'apihub.' + this._universeDomain; - const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; - this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const servicePath = + opts?.servicePath || opts?.apiEndpoint || this._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'); + 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. @@ -138,7 +168,7 @@ export class ApiHubDependenciesClient { this._opts = opts; // Save the auth object to the client, for use by other methods. - this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; // Set useJWTAccessWithScope on the auth object. this.auth.useJWTAccessWithScope = true; @@ -154,13 +184,9 @@ export class ApiHubDependenciesClient { this._gaxGrpc, opts ); - // Determine the client header string. - const clientHeader = [ - `gax/${this._gaxModule.version}`, - `gapic/${version}`, - ]; + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; if (typeof process === 'object' && 'versions' in process) { clientHeader.push(`gl-node/${process.versions.node}`); } else { @@ -235,14 +261,20 @@ export class ApiHubDependenciesClient { // (e.g. 50 results at a time, with tokens to get subsequent // pages). Denote the keys used for pagination and results. this.descriptors.page = { - listDependencies: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'dependencies') + listDependencies: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'dependencies' + ), }; // Put together the default options sent with requests. this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.apihub.v1.ApiHubDependencies', gapicConfig as gax.ClientConfig, - opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); + 'google.cloud.apihub.v1.ApiHubDependencies', + 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 @@ -273,32 +305,41 @@ export class ApiHubDependenciesClient { // Put together the "service stub" for // google.cloud.apihub.v1.ApiHubDependencies. this.apiHubDependenciesStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.apihub.v1.ApiHubDependencies') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.apihub.v1.ApiHubDependencies' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.cloud.apihub.v1.ApiHubDependencies, - this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; + 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 apiHubDependenciesStubMethods = - ['createDependency', 'getDependency', 'updateDependency', 'deleteDependency', 'listDependencies']; + const apiHubDependenciesStubMethods = [ + 'createDependency', + 'getDependency', + 'updateDependency', + 'deleteDependency', + 'listDependencies', + ]; for (const methodName of apiHubDependenciesStubMethods) { const callPromise = this.apiHubDependenciesStub.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) => () => { + stub => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { throw err; - }); + } + ); - const descriptor = - this.descriptors.page[methodName] || - undefined; + const descriptor = this.descriptors.page[methodName] || undefined; const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], @@ -318,8 +359,14 @@ export class ApiHubDependenciesClient { * @returns {string} The DNS address for this service. */ static get servicePath() { - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static servicePath is deprecated, please use the instance method instead.', + 'DeprecationWarning' + ); } return 'apihub.googleapis.com'; } @@ -330,8 +377,14 @@ export class ApiHubDependenciesClient { * @returns {string} The DNS address for this service. */ static get apiEndpoint() { - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static apiEndpoint is deprecated, please use the instance method instead.', + 'DeprecationWarning' + ); } return 'apihub.googleapis.com'; } @@ -362,9 +415,7 @@ export class ApiHubDependenciesClient { * @returns {string[]} List of default scopes. */ static get scopes() { - return [ - 'https://www.googleapis.com/auth/cloud-platform' - ]; + return ['https://www.googleapis.com/auth/cloud-platform']; } getProjectId(): Promise; @@ -373,8 +424,9 @@ export class ApiHubDependenciesClient { * 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 { + getProjectId( + callback?: Callback + ): Promise | void { if (callback) { this.auth.getProjectId(callback); return; @@ -385,512 +437,585 @@ export class ApiHubDependenciesClient { // ------------------- // -- Service calls -- // ------------------- -/** - * Create a dependency between two entities in the API hub. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource for the dependency resource. - * Format: `projects/{project}/locations/{location}` - * @param {string} [request.dependencyId] - * Optional. The ID to use for the dependency resource, which will become the - * final component of the dependency's resource name. This field is optional. - * * If provided, the same will be used. The service will throw an error if - * duplicate id is provided by the client. - * * If not provided, a system generated id will be used. - * - * This value should be 4-500 characters, and valid characters - * are `{@link protos.A-Z|a-z}[0-9]-_`. - * @param {google.cloud.apihub.v1.Dependency} request.dependency - * Required. The dependency resource to create. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.apihub.v1.Dependency|Dependency}. - * 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/api_hub_dependencies.create_dependency.js - * region_tag:apihub_v1_generated_ApiHubDependencies_CreateDependency_async - */ + /** + * Create a dependency between two entities in the API hub. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource for the dependency resource. + * Format: `projects/{project}/locations/{location}` + * @param {string} [request.dependencyId] + * Optional. The ID to use for the dependency resource, which will become the + * final component of the dependency's resource name. This field is optional. + * * If provided, the same will be used. The service will throw an error if + * duplicate id is provided by the client. + * * If not provided, a system generated id will be used. + * + * This value should be 4-500 characters, and valid characters + * are `{@link protos.A-Z|a-z}[0-9]-_`. + * @param {google.cloud.apihub.v1.Dependency} request.dependency + * Required. The dependency resource to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.apihub.v1.Dependency|Dependency}. + * 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/api_hub_dependencies.create_dependency.js + * region_tag:apihub_v1_generated_ApiHubDependencies_CreateDependency_async + */ createDependency( - request?: protos.google.cloud.apihub.v1.ICreateDependencyRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apihub.v1.IDependency, - protos.google.cloud.apihub.v1.ICreateDependencyRequest|undefined, {}|undefined - ]>; + request?: protos.google.cloud.apihub.v1.ICreateDependencyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apihub.v1.IDependency, + protos.google.cloud.apihub.v1.ICreateDependencyRequest | undefined, + {} | undefined, + ] + >; createDependency( - request: protos.google.cloud.apihub.v1.ICreateDependencyRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.apihub.v1.IDependency, - protos.google.cloud.apihub.v1.ICreateDependencyRequest|null|undefined, - {}|null|undefined>): void; + request: protos.google.cloud.apihub.v1.ICreateDependencyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.IDependency, + protos.google.cloud.apihub.v1.ICreateDependencyRequest | null | undefined, + {} | null | undefined + > + ): void; createDependency( - request: protos.google.cloud.apihub.v1.ICreateDependencyRequest, - callback: Callback< - protos.google.cloud.apihub.v1.IDependency, - protos.google.cloud.apihub.v1.ICreateDependencyRequest|null|undefined, - {}|null|undefined>): void; + request: protos.google.cloud.apihub.v1.ICreateDependencyRequest, + callback: Callback< + protos.google.cloud.apihub.v1.IDependency, + protos.google.cloud.apihub.v1.ICreateDependencyRequest | null | undefined, + {} | null | undefined + > + ): void; createDependency( - request?: protos.google.cloud.apihub.v1.ICreateDependencyRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.apihub.v1.IDependency, - protos.google.cloud.apihub.v1.ICreateDependencyRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< + request?: protos.google.cloud.apihub.v1.ICreateDependencyRequest, + optionsOrCallback?: + | CallOptions + | Callback< protos.google.cloud.apihub.v1.IDependency, - protos.google.cloud.apihub.v1.ICreateDependencyRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.apihub.v1.IDependency, - protos.google.cloud.apihub.v1.ICreateDependencyRequest|undefined, {}|undefined - ]>|void { + | protos.google.cloud.apihub.v1.ICreateDependencyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.apihub.v1.IDependency, + protos.google.cloud.apihub.v1.ICreateDependencyRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.apihub.v1.IDependency, + protos.google.cloud.apihub.v1.ICreateDependencyRequest | undefined, + {} | undefined, + ] + > | void { request = request || {}; let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } - else { + } 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 ?? '', - }); + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); this.initialize(); return this.innerApiCalls.createDependency(request, options, callback); } -/** - * Get details about a dependency resource in the API hub. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the dependency resource to retrieve. - * Format: `projects/{project}/locations/{location}/dependencies/{dependency}` - * @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.apihub.v1.Dependency|Dependency}. - * 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/api_hub_dependencies.get_dependency.js - * region_tag:apihub_v1_generated_ApiHubDependencies_GetDependency_async - */ + /** + * Get details about a dependency resource in the API hub. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the dependency resource to retrieve. + * Format: `projects/{project}/locations/{location}/dependencies/{dependency}` + * @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.apihub.v1.Dependency|Dependency}. + * 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/api_hub_dependencies.get_dependency.js + * region_tag:apihub_v1_generated_ApiHubDependencies_GetDependency_async + */ getDependency( - request?: protos.google.cloud.apihub.v1.IGetDependencyRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apihub.v1.IDependency, - protos.google.cloud.apihub.v1.IGetDependencyRequest|undefined, {}|undefined - ]>; + request?: protos.google.cloud.apihub.v1.IGetDependencyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apihub.v1.IDependency, + protos.google.cloud.apihub.v1.IGetDependencyRequest | undefined, + {} | undefined, + ] + >; getDependency( - request: protos.google.cloud.apihub.v1.IGetDependencyRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.apihub.v1.IDependency, - protos.google.cloud.apihub.v1.IGetDependencyRequest|null|undefined, - {}|null|undefined>): void; + request: protos.google.cloud.apihub.v1.IGetDependencyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.IDependency, + protos.google.cloud.apihub.v1.IGetDependencyRequest | null | undefined, + {} | null | undefined + > + ): void; getDependency( - request: protos.google.cloud.apihub.v1.IGetDependencyRequest, - callback: Callback< - protos.google.cloud.apihub.v1.IDependency, - protos.google.cloud.apihub.v1.IGetDependencyRequest|null|undefined, - {}|null|undefined>): void; + request: protos.google.cloud.apihub.v1.IGetDependencyRequest, + callback: Callback< + protos.google.cloud.apihub.v1.IDependency, + protos.google.cloud.apihub.v1.IGetDependencyRequest | null | undefined, + {} | null | undefined + > + ): void; getDependency( - request?: protos.google.cloud.apihub.v1.IGetDependencyRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.apihub.v1.IDependency, - protos.google.cloud.apihub.v1.IGetDependencyRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< + request?: protos.google.cloud.apihub.v1.IGetDependencyRequest, + optionsOrCallback?: + | CallOptions + | Callback< protos.google.cloud.apihub.v1.IDependency, - protos.google.cloud.apihub.v1.IGetDependencyRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.apihub.v1.IDependency, - protos.google.cloud.apihub.v1.IGetDependencyRequest|undefined, {}|undefined - ]>|void { + | protos.google.cloud.apihub.v1.IGetDependencyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.apihub.v1.IDependency, + protos.google.cloud.apihub.v1.IGetDependencyRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.apihub.v1.IDependency, + protos.google.cloud.apihub.v1.IGetDependencyRequest | undefined, + {} | undefined, + ] + > | void { request = request || {}; let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } - else { + } 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 ?? '', - }); + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); this.initialize(); return this.innerApiCalls.getDependency(request, options, callback); } -/** - * Update a dependency based on the - * {@link protos.google.cloud.apihub.v1.UpdateDependencyRequest.update_mask|update_mask} - * provided in the request. - * - * The following fields in the {@link protos.google.cloud.apihub.v1.Dependency|dependency} - * can be updated: - * * {@link protos.google.cloud.apihub.v1.Dependency.description|description} - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.apihub.v1.Dependency} request.dependency - * Required. The dependency resource to update. - * - * The dependency's `name` field is used to identify the dependency to update. - * Format: `projects/{project}/locations/{location}/dependencies/{dependency}` - * @param {google.protobuf.FieldMask} request.updateMask - * Required. The list of fields to update. - * @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.apihub.v1.Dependency|Dependency}. - * 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/api_hub_dependencies.update_dependency.js - * region_tag:apihub_v1_generated_ApiHubDependencies_UpdateDependency_async - */ + /** + * Update a dependency based on the + * {@link protos.google.cloud.apihub.v1.UpdateDependencyRequest.update_mask|update_mask} + * provided in the request. + * + * The following fields in the {@link protos.google.cloud.apihub.v1.Dependency|dependency} + * can be updated: + * * {@link protos.google.cloud.apihub.v1.Dependency.description|description} + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.apihub.v1.Dependency} request.dependency + * Required. The dependency resource to update. + * + * The dependency's `name` field is used to identify the dependency to update. + * Format: `projects/{project}/locations/{location}/dependencies/{dependency}` + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The list of fields to update. + * @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.apihub.v1.Dependency|Dependency}. + * 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/api_hub_dependencies.update_dependency.js + * region_tag:apihub_v1_generated_ApiHubDependencies_UpdateDependency_async + */ updateDependency( - request?: protos.google.cloud.apihub.v1.IUpdateDependencyRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apihub.v1.IDependency, - protos.google.cloud.apihub.v1.IUpdateDependencyRequest|undefined, {}|undefined - ]>; + request?: protos.google.cloud.apihub.v1.IUpdateDependencyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apihub.v1.IDependency, + protos.google.cloud.apihub.v1.IUpdateDependencyRequest | undefined, + {} | undefined, + ] + >; updateDependency( - request: protos.google.cloud.apihub.v1.IUpdateDependencyRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.apihub.v1.IDependency, - protos.google.cloud.apihub.v1.IUpdateDependencyRequest|null|undefined, - {}|null|undefined>): void; + request: protos.google.cloud.apihub.v1.IUpdateDependencyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.IDependency, + protos.google.cloud.apihub.v1.IUpdateDependencyRequest | null | undefined, + {} | null | undefined + > + ): void; updateDependency( - request: protos.google.cloud.apihub.v1.IUpdateDependencyRequest, - callback: Callback< - protos.google.cloud.apihub.v1.IDependency, - protos.google.cloud.apihub.v1.IUpdateDependencyRequest|null|undefined, - {}|null|undefined>): void; + request: protos.google.cloud.apihub.v1.IUpdateDependencyRequest, + callback: Callback< + protos.google.cloud.apihub.v1.IDependency, + protos.google.cloud.apihub.v1.IUpdateDependencyRequest | null | undefined, + {} | null | undefined + > + ): void; updateDependency( - request?: protos.google.cloud.apihub.v1.IUpdateDependencyRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.apihub.v1.IDependency, - protos.google.cloud.apihub.v1.IUpdateDependencyRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< + request?: protos.google.cloud.apihub.v1.IUpdateDependencyRequest, + optionsOrCallback?: + | CallOptions + | Callback< protos.google.cloud.apihub.v1.IDependency, - protos.google.cloud.apihub.v1.IUpdateDependencyRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.apihub.v1.IDependency, - protos.google.cloud.apihub.v1.IUpdateDependencyRequest|undefined, {}|undefined - ]>|void { + | protos.google.cloud.apihub.v1.IUpdateDependencyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.apihub.v1.IDependency, + protos.google.cloud.apihub.v1.IUpdateDependencyRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.apihub.v1.IDependency, + protos.google.cloud.apihub.v1.IUpdateDependencyRequest | undefined, + {} | undefined, + ] + > | void { request = request || {}; let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } - else { + } 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({ - 'dependency.name': request.dependency!.name ?? '', - }); + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + 'dependency.name': request.dependency!.name ?? '', + }); this.initialize(); return this.innerApiCalls.updateDependency(request, options, callback); } -/** - * Delete the dependency resource. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the dependency resource to delete. - * Format: `projects/{project}/locations/{location}/dependencies/{dependency}` - * @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.protobuf.Empty|Empty}. - * 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/api_hub_dependencies.delete_dependency.js - * region_tag:apihub_v1_generated_ApiHubDependencies_DeleteDependency_async - */ + /** + * Delete the dependency resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the dependency resource to delete. + * Format: `projects/{project}/locations/{location}/dependencies/{dependency}` + * @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.protobuf.Empty|Empty}. + * 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/api_hub_dependencies.delete_dependency.js + * region_tag:apihub_v1_generated_ApiHubDependencies_DeleteDependency_async + */ deleteDependency( - request?: protos.google.cloud.apihub.v1.IDeleteDependencyRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.IDeleteDependencyRequest|undefined, {}|undefined - ]>; + request?: protos.google.cloud.apihub.v1.IDeleteDependencyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteDependencyRequest | undefined, + {} | undefined, + ] + >; deleteDependency( - request: protos.google.cloud.apihub.v1.IDeleteDependencyRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.IDeleteDependencyRequest|null|undefined, - {}|null|undefined>): void; + request: protos.google.cloud.apihub.v1.IDeleteDependencyRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteDependencyRequest | null | undefined, + {} | null | undefined + > + ): void; deleteDependency( - request: protos.google.cloud.apihub.v1.IDeleteDependencyRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.IDeleteDependencyRequest|null|undefined, - {}|null|undefined>): void; + request: protos.google.cloud.apihub.v1.IDeleteDependencyRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteDependencyRequest | null | undefined, + {} | null | undefined + > + ): void; deleteDependency( - request?: protos.google.cloud.apihub.v1.IDeleteDependencyRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.IDeleteDependencyRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< + request?: protos.google.cloud.apihub.v1.IDeleteDependencyRequest, + optionsOrCallback?: + | CallOptions + | Callback< protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.IDeleteDependencyRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.IDeleteDependencyRequest|undefined, {}|undefined - ]>|void { + | protos.google.cloud.apihub.v1.IDeleteDependencyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteDependencyRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteDependencyRequest | undefined, + {} | undefined, + ] + > | void { request = request || {}; let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } - else { + } 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 ?? '', - }); + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); this.initialize(); return this.innerApiCalls.deleteDependency(request, options, callback); } - /** - * List dependencies based on the provided filter and pagination parameters. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent which owns this collection of dependency resources. - * Format: `projects/{project}/locations/{location}` - * @param {string} [request.filter] - * Optional. An expression that filters the list of Dependencies. - * - * A filter expression consists of a field name, a comparison operator, and - * a value for filtering. The value must be a string. Allowed comparison - * operator is `=`. Filters are not case sensitive. - * - * The following fields in the `Dependency` are eligible for filtering: - * - * * `consumer.operation_resource_name` - The operation resource name for - * the consumer entity involved in a dependency. Allowed comparison - * operators: `=`. - * * `consumer.external_api_resource_name` - The external api resource name - * for the consumer entity involved in a dependency. Allowed comparison - * operators: `=`. - * * `supplier.operation_resource_name` - The operation resource name for - * the supplier entity involved in a dependency. Allowed comparison - * operators: `=`. - * * `supplier.external_api_resource_name` - The external api resource name - * for the supplier entity involved in a dependency. Allowed comparison - * operators: `=`. - * - * Expressions are combined with either `AND` logic operator or `OR` logical - * operator but not both of them together i.e. only one of the `AND` or `OR` - * operator can be used throughout the filter string and both the operators - * cannot be used together. No other logical operators are supported. At most - * three filter fields are allowed in the filter string and if provided - * more than that then `INVALID_ARGUMENT` error is returned by the API. - * - * For example, `consumer.operation_resource_name = - * \"projects/p1/locations/global/apis/a1/versions/v1/operations/o1\" OR - * supplier.operation_resource_name = - * \"projects/p1/locations/global/apis/a1/versions/v1/operations/o1\"` - The - * dependencies with either consumer or supplier operation resource name as - * _projects/p1/locations/global/apis/a1/versions/v1/operations/o1_. - * @param {number} [request.pageSize] - * Optional. The maximum number of dependency resources to return. The service - * may return fewer than this value. If unspecified, at most 50 dependencies - * will be returned. The maximum value is 1000; values above 1000 will be - * coerced to 1000. - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous `ListDependencies` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to `ListDependencies` must - * match the call that provided the page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.cloud.apihub.v1.Dependency|Dependency}. - * 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 `listDependenciesAsync()` - * 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. - */ + /** + * List dependencies based on the provided filter and pagination parameters. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent which owns this collection of dependency resources. + * Format: `projects/{project}/locations/{location}` + * @param {string} [request.filter] + * Optional. An expression that filters the list of Dependencies. + * + * A filter expression consists of a field name, a comparison operator, and + * a value for filtering. The value must be a string. Allowed comparison + * operator is `=`. Filters are not case sensitive. + * + * The following fields in the `Dependency` are eligible for filtering: + * + * * `consumer.operation_resource_name` - The operation resource name for + * the consumer entity involved in a dependency. Allowed comparison + * operators: `=`. + * * `consumer.external_api_resource_name` - The external api resource name + * for the consumer entity involved in a dependency. Allowed comparison + * operators: `=`. + * * `supplier.operation_resource_name` - The operation resource name for + * the supplier entity involved in a dependency. Allowed comparison + * operators: `=`. + * * `supplier.external_api_resource_name` - The external api resource name + * for the supplier entity involved in a dependency. Allowed comparison + * operators: `=`. + * + * Expressions are combined with either `AND` logic operator or `OR` logical + * operator but not both of them together i.e. only one of the `AND` or `OR` + * operator can be used throughout the filter string and both the operators + * cannot be used together. No other logical operators are supported. At most + * three filter fields are allowed in the filter string and if provided + * more than that then `INVALID_ARGUMENT` error is returned by the API. + * + * For example, `consumer.operation_resource_name = + * \"projects/p1/locations/global/apis/a1/versions/v1/operations/o1\" OR + * supplier.operation_resource_name = + * \"projects/p1/locations/global/apis/a1/versions/v1/operations/o1\"` - The + * dependencies with either consumer or supplier operation resource name as + * _projects/p1/locations/global/apis/a1/versions/v1/operations/o1_. + * @param {number} [request.pageSize] + * Optional. The maximum number of dependency resources to return. The service + * may return fewer than this value. If unspecified, at most 50 dependencies + * will be returned. The maximum value is 1000; values above 1000 will be + * coerced to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListDependencies` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListDependencies` must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.apihub.v1.Dependency|Dependency}. + * 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 `listDependenciesAsync()` + * 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. + */ listDependencies( - request?: protos.google.cloud.apihub.v1.IListDependenciesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apihub.v1.IDependency[], - protos.google.cloud.apihub.v1.IListDependenciesRequest|null, - protos.google.cloud.apihub.v1.IListDependenciesResponse - ]>; + request?: protos.google.cloud.apihub.v1.IListDependenciesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apihub.v1.IDependency[], + protos.google.cloud.apihub.v1.IListDependenciesRequest | null, + protos.google.cloud.apihub.v1.IListDependenciesResponse, + ] + >; listDependencies( - request: protos.google.cloud.apihub.v1.IListDependenciesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.apihub.v1.IListDependenciesRequest, - protos.google.cloud.apihub.v1.IListDependenciesResponse|null|undefined, - protos.google.cloud.apihub.v1.IDependency>): void; + request: protos.google.cloud.apihub.v1.IListDependenciesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.apihub.v1.IListDependenciesRequest, + | protos.google.cloud.apihub.v1.IListDependenciesResponse + | null + | undefined, + protos.google.cloud.apihub.v1.IDependency + > + ): void; listDependencies( - request: protos.google.cloud.apihub.v1.IListDependenciesRequest, - callback: PaginationCallback< - protos.google.cloud.apihub.v1.IListDependenciesRequest, - protos.google.cloud.apihub.v1.IListDependenciesResponse|null|undefined, - protos.google.cloud.apihub.v1.IDependency>): void; + request: protos.google.cloud.apihub.v1.IListDependenciesRequest, + callback: PaginationCallback< + protos.google.cloud.apihub.v1.IListDependenciesRequest, + | protos.google.cloud.apihub.v1.IListDependenciesResponse + | null + | undefined, + protos.google.cloud.apihub.v1.IDependency + > + ): void; listDependencies( - request?: protos.google.cloud.apihub.v1.IListDependenciesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.apihub.v1.IListDependenciesRequest, - protos.google.cloud.apihub.v1.IListDependenciesResponse|null|undefined, - protos.google.cloud.apihub.v1.IDependency>, - callback?: PaginationCallback< + request?: protos.google.cloud.apihub.v1.IListDependenciesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< protos.google.cloud.apihub.v1.IListDependenciesRequest, - protos.google.cloud.apihub.v1.IListDependenciesResponse|null|undefined, - protos.google.cloud.apihub.v1.IDependency>): - Promise<[ - protos.google.cloud.apihub.v1.IDependency[], - protos.google.cloud.apihub.v1.IListDependenciesRequest|null, - protos.google.cloud.apihub.v1.IListDependenciesResponse - ]>|void { + | protos.google.cloud.apihub.v1.IListDependenciesResponse + | null + | undefined, + protos.google.cloud.apihub.v1.IDependency + >, + callback?: PaginationCallback< + protos.google.cloud.apihub.v1.IListDependenciesRequest, + | protos.google.cloud.apihub.v1.IListDependenciesResponse + | null + | undefined, + protos.google.cloud.apihub.v1.IDependency + > + ): Promise< + [ + protos.google.cloud.apihub.v1.IDependency[], + protos.google.cloud.apihub.v1.IListDependenciesRequest | null, + protos.google.cloud.apihub.v1.IListDependenciesResponse, + ] + > | void { request = request || {}; let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } - else { + } 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 ?? '', - }); + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); this.initialize(); return this.innerApiCalls.listDependencies(request, options, callback); } -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent which owns this collection of dependency resources. - * Format: `projects/{project}/locations/{location}` - * @param {string} [request.filter] - * Optional. An expression that filters the list of Dependencies. - * - * A filter expression consists of a field name, a comparison operator, and - * a value for filtering. The value must be a string. Allowed comparison - * operator is `=`. Filters are not case sensitive. - * - * The following fields in the `Dependency` are eligible for filtering: - * - * * `consumer.operation_resource_name` - The operation resource name for - * the consumer entity involved in a dependency. Allowed comparison - * operators: `=`. - * * `consumer.external_api_resource_name` - The external api resource name - * for the consumer entity involved in a dependency. Allowed comparison - * operators: `=`. - * * `supplier.operation_resource_name` - The operation resource name for - * the supplier entity involved in a dependency. Allowed comparison - * operators: `=`. - * * `supplier.external_api_resource_name` - The external api resource name - * for the supplier entity involved in a dependency. Allowed comparison - * operators: `=`. - * - * Expressions are combined with either `AND` logic operator or `OR` logical - * operator but not both of them together i.e. only one of the `AND` or `OR` - * operator can be used throughout the filter string and both the operators - * cannot be used together. No other logical operators are supported. At most - * three filter fields are allowed in the filter string and if provided - * more than that then `INVALID_ARGUMENT` error is returned by the API. - * - * For example, `consumer.operation_resource_name = - * \"projects/p1/locations/global/apis/a1/versions/v1/operations/o1\" OR - * supplier.operation_resource_name = - * \"projects/p1/locations/global/apis/a1/versions/v1/operations/o1\"` - The - * dependencies with either consumer or supplier operation resource name as - * _projects/p1/locations/global/apis/a1/versions/v1/operations/o1_. - * @param {number} [request.pageSize] - * Optional. The maximum number of dependency resources to return. The service - * may return fewer than this value. If unspecified, at most 50 dependencies - * will be returned. The maximum value is 1000; values above 1000 will be - * coerced to 1000. - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous `ListDependencies` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to `ListDependencies` must - * match the call that provided the page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.cloud.apihub.v1.Dependency|Dependency} 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 `listDependenciesAsync()` - * 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. - */ + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent which owns this collection of dependency resources. + * Format: `projects/{project}/locations/{location}` + * @param {string} [request.filter] + * Optional. An expression that filters the list of Dependencies. + * + * A filter expression consists of a field name, a comparison operator, and + * a value for filtering. The value must be a string. Allowed comparison + * operator is `=`. Filters are not case sensitive. + * + * The following fields in the `Dependency` are eligible for filtering: + * + * * `consumer.operation_resource_name` - The operation resource name for + * the consumer entity involved in a dependency. Allowed comparison + * operators: `=`. + * * `consumer.external_api_resource_name` - The external api resource name + * for the consumer entity involved in a dependency. Allowed comparison + * operators: `=`. + * * `supplier.operation_resource_name` - The operation resource name for + * the supplier entity involved in a dependency. Allowed comparison + * operators: `=`. + * * `supplier.external_api_resource_name` - The external api resource name + * for the supplier entity involved in a dependency. Allowed comparison + * operators: `=`. + * + * Expressions are combined with either `AND` logic operator or `OR` logical + * operator but not both of them together i.e. only one of the `AND` or `OR` + * operator can be used throughout the filter string and both the operators + * cannot be used together. No other logical operators are supported. At most + * three filter fields are allowed in the filter string and if provided + * more than that then `INVALID_ARGUMENT` error is returned by the API. + * + * For example, `consumer.operation_resource_name = + * \"projects/p1/locations/global/apis/a1/versions/v1/operations/o1\" OR + * supplier.operation_resource_name = + * \"projects/p1/locations/global/apis/a1/versions/v1/operations/o1\"` - The + * dependencies with either consumer or supplier operation resource name as + * _projects/p1/locations/global/apis/a1/versions/v1/operations/o1_. + * @param {number} [request.pageSize] + * Optional. The maximum number of dependency resources to return. The service + * may return fewer than this value. If unspecified, at most 50 dependencies + * will be returned. The maximum value is 1000; values above 1000 will be + * coerced to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListDependencies` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListDependencies` must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.apihub.v1.Dependency|Dependency} 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 `listDependenciesAsync()` + * 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. + */ listDependenciesStream( - request?: protos.google.cloud.apihub.v1.IListDependenciesRequest, - options?: CallOptions): - Transform{ + request?: protos.google.cloud.apihub.v1.IListDependenciesRequest, + 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 ?? '', - }); + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); const defaultCallSettings = this._defaults['listDependencies']; const callSettings = defaultCallSettings.merge(options); this.initialize(); @@ -901,86 +1026,85 @@ export class ApiHubDependenciesClient { ); } -/** - * Equivalent to `listDependencies`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent which owns this collection of dependency resources. - * Format: `projects/{project}/locations/{location}` - * @param {string} [request.filter] - * Optional. An expression that filters the list of Dependencies. - * - * A filter expression consists of a field name, a comparison operator, and - * a value for filtering. The value must be a string. Allowed comparison - * operator is `=`. Filters are not case sensitive. - * - * The following fields in the `Dependency` are eligible for filtering: - * - * * `consumer.operation_resource_name` - The operation resource name for - * the consumer entity involved in a dependency. Allowed comparison - * operators: `=`. - * * `consumer.external_api_resource_name` - The external api resource name - * for the consumer entity involved in a dependency. Allowed comparison - * operators: `=`. - * * `supplier.operation_resource_name` - The operation resource name for - * the supplier entity involved in a dependency. Allowed comparison - * operators: `=`. - * * `supplier.external_api_resource_name` - The external api resource name - * for the supplier entity involved in a dependency. Allowed comparison - * operators: `=`. - * - * Expressions are combined with either `AND` logic operator or `OR` logical - * operator but not both of them together i.e. only one of the `AND` or `OR` - * operator can be used throughout the filter string and both the operators - * cannot be used together. No other logical operators are supported. At most - * three filter fields are allowed in the filter string and if provided - * more than that then `INVALID_ARGUMENT` error is returned by the API. - * - * For example, `consumer.operation_resource_name = - * \"projects/p1/locations/global/apis/a1/versions/v1/operations/o1\" OR - * supplier.operation_resource_name = - * \"projects/p1/locations/global/apis/a1/versions/v1/operations/o1\"` - The - * dependencies with either consumer or supplier operation resource name as - * _projects/p1/locations/global/apis/a1/versions/v1/operations/o1_. - * @param {number} [request.pageSize] - * Optional. The maximum number of dependency resources to return. The service - * may return fewer than this value. If unspecified, at most 50 dependencies - * will be returned. The maximum value is 1000; values above 1000 will be - * coerced to 1000. - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous `ListDependencies` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to `ListDependencies` must - * match the call that provided the page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@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.apihub.v1.Dependency|Dependency}. 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/api_hub_dependencies.list_dependencies.js - * region_tag:apihub_v1_generated_ApiHubDependencies_ListDependencies_async - */ + /** + * Equivalent to `listDependencies`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent which owns this collection of dependency resources. + * Format: `projects/{project}/locations/{location}` + * @param {string} [request.filter] + * Optional. An expression that filters the list of Dependencies. + * + * A filter expression consists of a field name, a comparison operator, and + * a value for filtering. The value must be a string. Allowed comparison + * operator is `=`. Filters are not case sensitive. + * + * The following fields in the `Dependency` are eligible for filtering: + * + * * `consumer.operation_resource_name` - The operation resource name for + * the consumer entity involved in a dependency. Allowed comparison + * operators: `=`. + * * `consumer.external_api_resource_name` - The external api resource name + * for the consumer entity involved in a dependency. Allowed comparison + * operators: `=`. + * * `supplier.operation_resource_name` - The operation resource name for + * the supplier entity involved in a dependency. Allowed comparison + * operators: `=`. + * * `supplier.external_api_resource_name` - The external api resource name + * for the supplier entity involved in a dependency. Allowed comparison + * operators: `=`. + * + * Expressions are combined with either `AND` logic operator or `OR` logical + * operator but not both of them together i.e. only one of the `AND` or `OR` + * operator can be used throughout the filter string and both the operators + * cannot be used together. No other logical operators are supported. At most + * three filter fields are allowed in the filter string and if provided + * more than that then `INVALID_ARGUMENT` error is returned by the API. + * + * For example, `consumer.operation_resource_name = + * \"projects/p1/locations/global/apis/a1/versions/v1/operations/o1\" OR + * supplier.operation_resource_name = + * \"projects/p1/locations/global/apis/a1/versions/v1/operations/o1\"` - The + * dependencies with either consumer or supplier operation resource name as + * _projects/p1/locations/global/apis/a1/versions/v1/operations/o1_. + * @param {number} [request.pageSize] + * Optional. The maximum number of dependency resources to return. The service + * may return fewer than this value. If unspecified, at most 50 dependencies + * will be returned. The maximum value is 1000; values above 1000 will be + * coerced to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListDependencies` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListDependencies` must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@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.apihub.v1.Dependency|Dependency}. 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/api_hub_dependencies.list_dependencies.js + * region_tag:apihub_v1_generated_ApiHubDependencies_ListDependencies_async + */ listDependenciesAsync( - request?: protos.google.cloud.apihub.v1.IListDependenciesRequest, - options?: CallOptions): - AsyncIterable{ + request?: protos.google.cloud.apihub.v1.IListDependenciesRequest, + 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 ?? '', - }); + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); const defaultCallSettings = this._defaults['listDependencies']; const callSettings = defaultCallSettings.merge(options); this.initialize(); @@ -990,7 +1114,7 @@ export class ApiHubDependenciesClient { callSettings ) as AsyncIterable; } -/** + /** * Gets information about a location. * * @param {Object} request @@ -1030,7 +1154,7 @@ export class ApiHubDependenciesClient { 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. @@ -1080,7 +1204,7 @@ export class ApiHubDependenciesClient { * @param {string} api * @returns {string} Resource name string. */ - apiPath(project:string,location:string,api:string) { + apiPath(project: string, location: string, api: string) { return this.pathTemplates.apiPathTemplate.render({ project: project, location: location, @@ -1129,7 +1253,11 @@ export class ApiHubDependenciesClient { * @param {string} api_hub_instance * @returns {string} Resource name string. */ - apiHubInstancePath(project:string,location:string,apiHubInstance:string) { + apiHubInstancePath( + project: string, + location: string, + apiHubInstance: string + ) { return this.pathTemplates.apiHubInstancePathTemplate.render({ project: project, location: location, @@ -1145,7 +1273,9 @@ export class ApiHubDependenciesClient { * @returns {string} A string representing the project. */ matchProjectFromApiHubInstanceName(apiHubInstanceName: string) { - return this.pathTemplates.apiHubInstancePathTemplate.match(apiHubInstanceName).project; + return this.pathTemplates.apiHubInstancePathTemplate.match( + apiHubInstanceName + ).project; } /** @@ -1156,7 +1286,9 @@ export class ApiHubDependenciesClient { * @returns {string} A string representing the location. */ matchLocationFromApiHubInstanceName(apiHubInstanceName: string) { - return this.pathTemplates.apiHubInstancePathTemplate.match(apiHubInstanceName).location; + return this.pathTemplates.apiHubInstancePathTemplate.match( + apiHubInstanceName + ).location; } /** @@ -1167,7 +1299,9 @@ export class ApiHubDependenciesClient { * @returns {string} A string representing the api_hub_instance. */ matchApiHubInstanceFromApiHubInstanceName(apiHubInstanceName: string) { - return this.pathTemplates.apiHubInstancePathTemplate.match(apiHubInstanceName).api_hub_instance; + return this.pathTemplates.apiHubInstancePathTemplate.match( + apiHubInstanceName + ).api_hub_instance; } /** @@ -1180,7 +1314,13 @@ export class ApiHubDependenciesClient { * @param {string} operation * @returns {string} Resource name string. */ - apiOperationPath(project:string,location:string,api:string,version:string,operation:string) { + apiOperationPath( + project: string, + location: string, + api: string, + version: string, + operation: string + ) { return this.pathTemplates.apiOperationPathTemplate.render({ project: project, location: location, @@ -1198,7 +1338,8 @@ export class ApiHubDependenciesClient { * @returns {string} A string representing the project. */ matchProjectFromApiOperationName(apiOperationName: string) { - return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).project; + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName) + .project; } /** @@ -1209,7 +1350,8 @@ export class ApiHubDependenciesClient { * @returns {string} A string representing the location. */ matchLocationFromApiOperationName(apiOperationName: string) { - return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).location; + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName) + .location; } /** @@ -1220,7 +1362,8 @@ export class ApiHubDependenciesClient { * @returns {string} A string representing the api. */ matchApiFromApiOperationName(apiOperationName: string) { - return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).api; + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName) + .api; } /** @@ -1231,7 +1374,8 @@ export class ApiHubDependenciesClient { * @returns {string} A string representing the version. */ matchVersionFromApiOperationName(apiOperationName: string) { - return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).version; + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName) + .version; } /** @@ -1242,7 +1386,8 @@ export class ApiHubDependenciesClient { * @returns {string} A string representing the operation. */ matchOperationFromApiOperationName(apiOperationName: string) { - return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).operation; + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName) + .operation; } /** @@ -1253,7 +1398,7 @@ export class ApiHubDependenciesClient { * @param {string} attribute * @returns {string} Resource name string. */ - attributePath(project:string,location:string,attribute:string) { + attributePath(project: string, location: string, attribute: string) { return this.pathTemplates.attributePathTemplate.render({ project: project, location: location, @@ -1269,7 +1414,8 @@ export class ApiHubDependenciesClient { * @returns {string} A string representing the project. */ matchProjectFromAttributeName(attributeName: string) { - return this.pathTemplates.attributePathTemplate.match(attributeName).project; + return this.pathTemplates.attributePathTemplate.match(attributeName) + .project; } /** @@ -1280,7 +1426,8 @@ export class ApiHubDependenciesClient { * @returns {string} A string representing the location. */ matchLocationFromAttributeName(attributeName: string) { - return this.pathTemplates.attributePathTemplate.match(attributeName).location; + return this.pathTemplates.attributePathTemplate.match(attributeName) + .location; } /** @@ -1291,7 +1438,8 @@ export class ApiHubDependenciesClient { * @returns {string} A string representing the attribute. */ matchAttributeFromAttributeName(attributeName: string) { - return this.pathTemplates.attributePathTemplate.match(attributeName).attribute; + return this.pathTemplates.attributePathTemplate.match(attributeName) + .attribute; } /** @@ -1304,7 +1452,13 @@ export class ApiHubDependenciesClient { * @param {string} definition * @returns {string} Resource name string. */ - definitionPath(project:string,location:string,api:string,version:string,definition:string) { + definitionPath( + project: string, + location: string, + api: string, + version: string, + definition: string + ) { return this.pathTemplates.definitionPathTemplate.render({ project: project, location: location, @@ -1322,7 +1476,8 @@ export class ApiHubDependenciesClient { * @returns {string} A string representing the project. */ matchProjectFromDefinitionName(definitionName: string) { - return this.pathTemplates.definitionPathTemplate.match(definitionName).project; + return this.pathTemplates.definitionPathTemplate.match(definitionName) + .project; } /** @@ -1333,7 +1488,8 @@ export class ApiHubDependenciesClient { * @returns {string} A string representing the location. */ matchLocationFromDefinitionName(definitionName: string) { - return this.pathTemplates.definitionPathTemplate.match(definitionName).location; + return this.pathTemplates.definitionPathTemplate.match(definitionName) + .location; } /** @@ -1355,7 +1511,8 @@ export class ApiHubDependenciesClient { * @returns {string} A string representing the version. */ matchVersionFromDefinitionName(definitionName: string) { - return this.pathTemplates.definitionPathTemplate.match(definitionName).version; + return this.pathTemplates.definitionPathTemplate.match(definitionName) + .version; } /** @@ -1366,7 +1523,8 @@ export class ApiHubDependenciesClient { * @returns {string} A string representing the definition. */ matchDefinitionFromDefinitionName(definitionName: string) { - return this.pathTemplates.definitionPathTemplate.match(definitionName).definition; + return this.pathTemplates.definitionPathTemplate.match(definitionName) + .definition; } /** @@ -1377,7 +1535,7 @@ export class ApiHubDependenciesClient { * @param {string} dependency * @returns {string} Resource name string. */ - dependencyPath(project:string,location:string,dependency:string) { + dependencyPath(project: string, location: string, dependency: string) { return this.pathTemplates.dependencyPathTemplate.render({ project: project, location: location, @@ -1393,7 +1551,8 @@ export class ApiHubDependenciesClient { * @returns {string} A string representing the project. */ matchProjectFromDependencyName(dependencyName: string) { - return this.pathTemplates.dependencyPathTemplate.match(dependencyName).project; + return this.pathTemplates.dependencyPathTemplate.match(dependencyName) + .project; } /** @@ -1404,7 +1563,8 @@ export class ApiHubDependenciesClient { * @returns {string} A string representing the location. */ matchLocationFromDependencyName(dependencyName: string) { - return this.pathTemplates.dependencyPathTemplate.match(dependencyName).location; + return this.pathTemplates.dependencyPathTemplate.match(dependencyName) + .location; } /** @@ -1415,7 +1575,8 @@ export class ApiHubDependenciesClient { * @returns {string} A string representing the dependency. */ matchDependencyFromDependencyName(dependencyName: string) { - return this.pathTemplates.dependencyPathTemplate.match(dependencyName).dependency; + return this.pathTemplates.dependencyPathTemplate.match(dependencyName) + .dependency; } /** @@ -1426,7 +1587,7 @@ export class ApiHubDependenciesClient { * @param {string} deployment * @returns {string} Resource name string. */ - deploymentPath(project:string,location:string,deployment:string) { + deploymentPath(project: string, location: string, deployment: string) { return this.pathTemplates.deploymentPathTemplate.render({ project: project, location: location, @@ -1442,7 +1603,8 @@ export class ApiHubDependenciesClient { * @returns {string} A string representing the project. */ matchProjectFromDeploymentName(deploymentName: string) { - return this.pathTemplates.deploymentPathTemplate.match(deploymentName).project; + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .project; } /** @@ -1453,7 +1615,8 @@ export class ApiHubDependenciesClient { * @returns {string} A string representing the location. */ matchLocationFromDeploymentName(deploymentName: string) { - return this.pathTemplates.deploymentPathTemplate.match(deploymentName).location; + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .location; } /** @@ -1464,7 +1627,8 @@ export class ApiHubDependenciesClient { * @returns {string} A string representing the deployment. */ matchDeploymentFromDeploymentName(deploymentName: string) { - return this.pathTemplates.deploymentPathTemplate.match(deploymentName).deployment; + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .deployment; } /** @@ -1475,7 +1639,7 @@ export class ApiHubDependenciesClient { * @param {string} external_api * @returns {string} Resource name string. */ - externalApiPath(project:string,location:string,externalApi:string) { + externalApiPath(project: string, location: string, externalApi: string) { return this.pathTemplates.externalApiPathTemplate.render({ project: project, location: location, @@ -1491,7 +1655,8 @@ export class ApiHubDependenciesClient { * @returns {string} A string representing the project. */ matchProjectFromExternalApiName(externalApiName: string) { - return this.pathTemplates.externalApiPathTemplate.match(externalApiName).project; + return this.pathTemplates.externalApiPathTemplate.match(externalApiName) + .project; } /** @@ -1502,7 +1667,8 @@ export class ApiHubDependenciesClient { * @returns {string} A string representing the location. */ matchLocationFromExternalApiName(externalApiName: string) { - return this.pathTemplates.externalApiPathTemplate.match(externalApiName).location; + return this.pathTemplates.externalApiPathTemplate.match(externalApiName) + .location; } /** @@ -1513,7 +1679,8 @@ export class ApiHubDependenciesClient { * @returns {string} A string representing the external_api. */ matchExternalApiFromExternalApiName(externalApiName: string) { - return this.pathTemplates.externalApiPathTemplate.match(externalApiName).external_api; + return this.pathTemplates.externalApiPathTemplate.match(externalApiName) + .external_api; } /** @@ -1524,7 +1691,11 @@ export class ApiHubDependenciesClient { * @param {string} host_project_registration * @returns {string} Resource name string. */ - hostProjectRegistrationPath(project:string,location:string,hostProjectRegistration:string) { + hostProjectRegistrationPath( + project: string, + location: string, + hostProjectRegistration: string + ) { return this.pathTemplates.hostProjectRegistrationPathTemplate.render({ project: project, location: location, @@ -1539,8 +1710,12 @@ export class ApiHubDependenciesClient { * A fully-qualified path representing HostProjectRegistration resource. * @returns {string} A string representing the project. */ - matchProjectFromHostProjectRegistrationName(hostProjectRegistrationName: string) { - return this.pathTemplates.hostProjectRegistrationPathTemplate.match(hostProjectRegistrationName).project; + matchProjectFromHostProjectRegistrationName( + hostProjectRegistrationName: string + ) { + return this.pathTemplates.hostProjectRegistrationPathTemplate.match( + hostProjectRegistrationName + ).project; } /** @@ -1550,8 +1725,12 @@ export class ApiHubDependenciesClient { * A fully-qualified path representing HostProjectRegistration resource. * @returns {string} A string representing the location. */ - matchLocationFromHostProjectRegistrationName(hostProjectRegistrationName: string) { - return this.pathTemplates.hostProjectRegistrationPathTemplate.match(hostProjectRegistrationName).location; + matchLocationFromHostProjectRegistrationName( + hostProjectRegistrationName: string + ) { + return this.pathTemplates.hostProjectRegistrationPathTemplate.match( + hostProjectRegistrationName + ).location; } /** @@ -1561,8 +1740,12 @@ export class ApiHubDependenciesClient { * A fully-qualified path representing HostProjectRegistration resource. * @returns {string} A string representing the host_project_registration. */ - matchHostProjectRegistrationFromHostProjectRegistrationName(hostProjectRegistrationName: string) { - return this.pathTemplates.hostProjectRegistrationPathTemplate.match(hostProjectRegistrationName).host_project_registration; + matchHostProjectRegistrationFromHostProjectRegistrationName( + hostProjectRegistrationName: string + ) { + return this.pathTemplates.hostProjectRegistrationPathTemplate.match( + hostProjectRegistrationName + ).host_project_registration; } /** @@ -1572,7 +1755,7 @@ export class ApiHubDependenciesClient { * @param {string} location * @returns {string} Resource name string. */ - locationPath(project:string,location:string) { + locationPath(project: string, location: string) { return this.pathTemplates.locationPathTemplate.render({ project: project, location: location, @@ -1609,7 +1792,7 @@ export class ApiHubDependenciesClient { * @param {string} plugin * @returns {string} Resource name string. */ - pluginPath(project:string,location:string,plugin:string) { + pluginPath(project: string, location: string, plugin: string) { return this.pathTemplates.pluginPathTemplate.render({ project: project, location: location, @@ -1656,7 +1839,7 @@ export class ApiHubDependenciesClient { * @param {string} project * @returns {string} Resource name string. */ - projectPath(project:string) { + projectPath(project: string) { return this.pathTemplates.projectPathTemplate.render({ project: project, }); @@ -1681,7 +1864,11 @@ export class ApiHubDependenciesClient { * @param {string} runtime_project_attachment * @returns {string} Resource name string. */ - runtimeProjectAttachmentPath(project:string,location:string,runtimeProjectAttachment:string) { + runtimeProjectAttachmentPath( + project: string, + location: string, + runtimeProjectAttachment: string + ) { return this.pathTemplates.runtimeProjectAttachmentPathTemplate.render({ project: project, location: location, @@ -1696,8 +1883,12 @@ export class ApiHubDependenciesClient { * A fully-qualified path representing RuntimeProjectAttachment resource. * @returns {string} A string representing the project. */ - matchProjectFromRuntimeProjectAttachmentName(runtimeProjectAttachmentName: string) { - return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match(runtimeProjectAttachmentName).project; + matchProjectFromRuntimeProjectAttachmentName( + runtimeProjectAttachmentName: string + ) { + return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match( + runtimeProjectAttachmentName + ).project; } /** @@ -1707,8 +1898,12 @@ export class ApiHubDependenciesClient { * A fully-qualified path representing RuntimeProjectAttachment resource. * @returns {string} A string representing the location. */ - matchLocationFromRuntimeProjectAttachmentName(runtimeProjectAttachmentName: string) { - return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match(runtimeProjectAttachmentName).location; + matchLocationFromRuntimeProjectAttachmentName( + runtimeProjectAttachmentName: string + ) { + return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match( + runtimeProjectAttachmentName + ).location; } /** @@ -1718,8 +1913,12 @@ export class ApiHubDependenciesClient { * A fully-qualified path representing RuntimeProjectAttachment resource. * @returns {string} A string representing the runtime_project_attachment. */ - matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName(runtimeProjectAttachmentName: string) { - return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match(runtimeProjectAttachmentName).runtime_project_attachment; + matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName( + runtimeProjectAttachmentName: string + ) { + return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match( + runtimeProjectAttachmentName + ).runtime_project_attachment; } /** @@ -1732,7 +1931,13 @@ export class ApiHubDependenciesClient { * @param {string} spec * @returns {string} Resource name string. */ - specPath(project:string,location:string,api:string,version:string,spec:string) { + specPath( + project: string, + location: string, + api: string, + version: string, + spec: string + ) { return this.pathTemplates.specPathTemplate.render({ project: project, location: location, @@ -1805,7 +2010,7 @@ export class ApiHubDependenciesClient { * @param {string} plugin * @returns {string} Resource name string. */ - styleGuidePath(project:string,location:string,plugin:string) { + styleGuidePath(project: string, location: string, plugin: string) { return this.pathTemplates.styleGuidePathTemplate.render({ project: project, location: location, @@ -1821,7 +2026,8 @@ export class ApiHubDependenciesClient { * @returns {string} A string representing the project. */ matchProjectFromStyleGuideName(styleGuideName: string) { - return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName).project; + return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName) + .project; } /** @@ -1832,7 +2038,8 @@ export class ApiHubDependenciesClient { * @returns {string} A string representing the location. */ matchLocationFromStyleGuideName(styleGuideName: string) { - return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName).location; + return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName) + .location; } /** @@ -1843,7 +2050,8 @@ export class ApiHubDependenciesClient { * @returns {string} A string representing the plugin. */ matchPluginFromStyleGuideName(styleGuideName: string) { - return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName).plugin; + return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName) + .plugin; } /** @@ -1855,7 +2063,7 @@ export class ApiHubDependenciesClient { * @param {string} version * @returns {string} Resource name string. */ - versionPath(project:string,location:string,api:string,version:string) { + versionPath(project: string, location: string, api: string, version: string) { return this.pathTemplates.versionPathTemplate.render({ project: project, location: location, diff --git a/owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_dependencies_client_config.json b/packages/google-cloud-apihub/src/v1/api_hub_dependencies_client_config.json similarity index 100% rename from owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_dependencies_client_config.json rename to packages/google-cloud-apihub/src/v1/api_hub_dependencies_client_config.json diff --git a/owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_dependencies_proto_list.json b/packages/google-cloud-apihub/src/v1/api_hub_dependencies_proto_list.json similarity index 100% rename from owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_dependencies_proto_list.json rename to packages/google-cloud-apihub/src/v1/api_hub_dependencies_proto_list.json diff --git a/owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_plugin_client.ts b/packages/google-cloud-apihub/src/v1/api_hub_plugin_client.ts similarity index 74% rename from owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_plugin_client.ts rename to packages/google-cloud-apihub/src/v1/api_hub_plugin_client.ts index 68e24ef3c3a..fdbc7e544ef 100644 --- a/owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_plugin_client.ts +++ b/packages/google-cloud-apihub/src/v1/api_hub_plugin_client.ts @@ -18,7 +18,14 @@ /* global window */ import type * as gax from 'google-gax'; -import type {Callback, CallOptions, Descriptors, ClientOptions, LocationsClient, LocationProtos} from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, + LocationsClient, + LocationProtos, +} from 'google-gax'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); @@ -98,20 +105,41 @@ export class ApiHubPluginClient { * const client = new ApiHubPluginClient({fallback: true}, gax); * ``` */ - constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { // Ensure that options include all the required fields. const staticMembers = this.constructor as typeof ApiHubPluginClient; - if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { - throw new Error('Please set either universe_domain or universeDomain, but not both.'); + if ( + opts?.universe_domain && + opts?.universeDomain && + opts?.universe_domain !== opts?.universeDomain + ) { + throw new Error( + 'Please set either universe_domain or universeDomain, but not both.' + ); } - const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; - this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; + this._universeDomain = + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; this._servicePath = 'apihub.' + this._universeDomain; - const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; - this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const servicePath = + opts?.servicePath || opts?.apiEndpoint || this._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'); + 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. @@ -137,7 +165,7 @@ export class ApiHubPluginClient { this._opts = opts; // Save the auth object to the client, for use by other methods. - this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; // Set useJWTAccessWithScope on the auth object. this.auth.useJWTAccessWithScope = true; @@ -153,13 +181,9 @@ export class ApiHubPluginClient { this._gaxGrpc, opts ); - // Determine the client header string. - const clientHeader = [ - `gax/${this._gaxModule.version}`, - `gapic/${version}`, - ]; + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; if (typeof process === 'object' && 'versions' in process) { clientHeader.push(`gl-node/${process.versions.node}`); } else { @@ -226,8 +250,11 @@ export class ApiHubPluginClient { // Put together the default options sent with requests. this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.apihub.v1.ApiHubPlugin', gapicConfig as gax.ClientConfig, - opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); + 'google.cloud.apihub.v1.ApiHubPlugin', + 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 @@ -258,31 +285,39 @@ export class ApiHubPluginClient { // Put together the "service stub" for // google.cloud.apihub.v1.ApiHubPlugin. this.apiHubPluginStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.apihub.v1.ApiHubPlugin') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.apihub.v1.ApiHubPlugin' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.cloud.apihub.v1.ApiHubPlugin, - this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; + 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 apiHubPluginStubMethods = - ['getPlugin', 'enablePlugin', 'disablePlugin']; + const apiHubPluginStubMethods = [ + 'getPlugin', + 'enablePlugin', + 'disablePlugin', + ]; for (const methodName of apiHubPluginStubMethods) { const callPromise = this.apiHubPluginStub.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) => () => { + stub => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { throw err; - }); + } + ); - const descriptor = - undefined; + const descriptor = undefined; const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], @@ -302,8 +337,14 @@ export class ApiHubPluginClient { * @returns {string} The DNS address for this service. */ static get servicePath() { - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static servicePath is deprecated, please use the instance method instead.', + 'DeprecationWarning' + ); } return 'apihub.googleapis.com'; } @@ -314,8 +355,14 @@ export class ApiHubPluginClient { * @returns {string} The DNS address for this service. */ static get apiEndpoint() { - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static apiEndpoint is deprecated, please use the instance method instead.', + 'DeprecationWarning' + ); } return 'apihub.googleapis.com'; } @@ -346,9 +393,7 @@ export class ApiHubPluginClient { * @returns {string[]} List of default scopes. */ static get scopes() { - return [ - 'https://www.googleapis.com/auth/cloud-platform' - ]; + return ['https://www.googleapis.com/auth/cloud-platform']; } getProjectId(): Promise; @@ -357,8 +402,9 @@ export class ApiHubPluginClient { * 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 { + getProjectId( + callback?: Callback + ): Promise | void { if (callback) { this.auth.getProjectId(callback); return; @@ -369,223 +415,261 @@ export class ApiHubPluginClient { // ------------------- // -- Service calls -- // ------------------- -/** - * Get details about an API Hub plugin. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the plugin to retrieve. - * Format: `projects/{project}/locations/{location}/plugins/{plugin}`. - * @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.apihub.v1.Plugin|Plugin}. - * 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/api_hub_plugin.get_plugin.js - * region_tag:apihub_v1_generated_ApiHubPlugin_GetPlugin_async - */ + /** + * Get details about an API Hub plugin. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the plugin to retrieve. + * Format: `projects/{project}/locations/{location}/plugins/{plugin}`. + * @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.apihub.v1.Plugin|Plugin}. + * 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/api_hub_plugin.get_plugin.js + * region_tag:apihub_v1_generated_ApiHubPlugin_GetPlugin_async + */ getPlugin( - request?: protos.google.cloud.apihub.v1.IGetPluginRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apihub.v1.IPlugin, - protos.google.cloud.apihub.v1.IGetPluginRequest|undefined, {}|undefined - ]>; + request?: protos.google.cloud.apihub.v1.IGetPluginRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apihub.v1.IPlugin, + protos.google.cloud.apihub.v1.IGetPluginRequest | undefined, + {} | undefined, + ] + >; getPlugin( - request: protos.google.cloud.apihub.v1.IGetPluginRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.apihub.v1.IPlugin, - protos.google.cloud.apihub.v1.IGetPluginRequest|null|undefined, - {}|null|undefined>): void; + request: protos.google.cloud.apihub.v1.IGetPluginRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.IPlugin, + protos.google.cloud.apihub.v1.IGetPluginRequest | null | undefined, + {} | null | undefined + > + ): void; getPlugin( - request: protos.google.cloud.apihub.v1.IGetPluginRequest, - callback: Callback< - protos.google.cloud.apihub.v1.IPlugin, - protos.google.cloud.apihub.v1.IGetPluginRequest|null|undefined, - {}|null|undefined>): void; + request: protos.google.cloud.apihub.v1.IGetPluginRequest, + callback: Callback< + protos.google.cloud.apihub.v1.IPlugin, + protos.google.cloud.apihub.v1.IGetPluginRequest | null | undefined, + {} | null | undefined + > + ): void; getPlugin( - request?: protos.google.cloud.apihub.v1.IGetPluginRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.apihub.v1.IPlugin, - protos.google.cloud.apihub.v1.IGetPluginRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< + request?: protos.google.cloud.apihub.v1.IGetPluginRequest, + optionsOrCallback?: + | CallOptions + | Callback< protos.google.cloud.apihub.v1.IPlugin, - protos.google.cloud.apihub.v1.IGetPluginRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.apihub.v1.IPlugin, - protos.google.cloud.apihub.v1.IGetPluginRequest|undefined, {}|undefined - ]>|void { + protos.google.cloud.apihub.v1.IGetPluginRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.apihub.v1.IPlugin, + protos.google.cloud.apihub.v1.IGetPluginRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.apihub.v1.IPlugin, + protos.google.cloud.apihub.v1.IGetPluginRequest | undefined, + {} | undefined, + ] + > | void { request = request || {}; let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } - else { + } 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 ?? '', - }); + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); this.initialize(); return this.innerApiCalls.getPlugin(request, options, callback); } -/** - * Enables a plugin. - * The `state` of the plugin after enabling is `ENABLED` - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the plugin to enable. - * Format: `projects/{project}/locations/{location}/plugins/{plugin}`. - * @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.apihub.v1.Plugin|Plugin}. - * 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/api_hub_plugin.enable_plugin.js - * region_tag:apihub_v1_generated_ApiHubPlugin_EnablePlugin_async - */ + /** + * Enables a plugin. + * The `state` of the plugin after enabling is `ENABLED` + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the plugin to enable. + * Format: `projects/{project}/locations/{location}/plugins/{plugin}`. + * @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.apihub.v1.Plugin|Plugin}. + * 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/api_hub_plugin.enable_plugin.js + * region_tag:apihub_v1_generated_ApiHubPlugin_EnablePlugin_async + */ enablePlugin( - request?: protos.google.cloud.apihub.v1.IEnablePluginRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apihub.v1.IPlugin, - protos.google.cloud.apihub.v1.IEnablePluginRequest|undefined, {}|undefined - ]>; + request?: protos.google.cloud.apihub.v1.IEnablePluginRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apihub.v1.IPlugin, + protos.google.cloud.apihub.v1.IEnablePluginRequest | undefined, + {} | undefined, + ] + >; enablePlugin( - request: protos.google.cloud.apihub.v1.IEnablePluginRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.apihub.v1.IPlugin, - protos.google.cloud.apihub.v1.IEnablePluginRequest|null|undefined, - {}|null|undefined>): void; + request: protos.google.cloud.apihub.v1.IEnablePluginRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.IPlugin, + protos.google.cloud.apihub.v1.IEnablePluginRequest | null | undefined, + {} | null | undefined + > + ): void; enablePlugin( - request: protos.google.cloud.apihub.v1.IEnablePluginRequest, - callback: Callback< - protos.google.cloud.apihub.v1.IPlugin, - protos.google.cloud.apihub.v1.IEnablePluginRequest|null|undefined, - {}|null|undefined>): void; + request: protos.google.cloud.apihub.v1.IEnablePluginRequest, + callback: Callback< + protos.google.cloud.apihub.v1.IPlugin, + protos.google.cloud.apihub.v1.IEnablePluginRequest | null | undefined, + {} | null | undefined + > + ): void; enablePlugin( - request?: protos.google.cloud.apihub.v1.IEnablePluginRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.apihub.v1.IPlugin, - protos.google.cloud.apihub.v1.IEnablePluginRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< + request?: protos.google.cloud.apihub.v1.IEnablePluginRequest, + optionsOrCallback?: + | CallOptions + | Callback< protos.google.cloud.apihub.v1.IPlugin, - protos.google.cloud.apihub.v1.IEnablePluginRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.apihub.v1.IPlugin, - protos.google.cloud.apihub.v1.IEnablePluginRequest|undefined, {}|undefined - ]>|void { + protos.google.cloud.apihub.v1.IEnablePluginRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.apihub.v1.IPlugin, + protos.google.cloud.apihub.v1.IEnablePluginRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.apihub.v1.IPlugin, + protos.google.cloud.apihub.v1.IEnablePluginRequest | undefined, + {} | undefined, + ] + > | void { request = request || {}; let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } - else { + } 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 ?? '', - }); + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); this.initialize(); return this.innerApiCalls.enablePlugin(request, options, callback); } -/** - * Disables a plugin. - * The `state` of the plugin after disabling is `DISABLED` - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the plugin to disable. - * Format: `projects/{project}/locations/{location}/plugins/{plugin}`. - * @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.apihub.v1.Plugin|Plugin}. - * 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/api_hub_plugin.disable_plugin.js - * region_tag:apihub_v1_generated_ApiHubPlugin_DisablePlugin_async - */ + /** + * Disables a plugin. + * The `state` of the plugin after disabling is `DISABLED` + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the plugin to disable. + * Format: `projects/{project}/locations/{location}/plugins/{plugin}`. + * @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.apihub.v1.Plugin|Plugin}. + * 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/api_hub_plugin.disable_plugin.js + * region_tag:apihub_v1_generated_ApiHubPlugin_DisablePlugin_async + */ disablePlugin( - request?: protos.google.cloud.apihub.v1.IDisablePluginRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apihub.v1.IPlugin, - protos.google.cloud.apihub.v1.IDisablePluginRequest|undefined, {}|undefined - ]>; + request?: protos.google.cloud.apihub.v1.IDisablePluginRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apihub.v1.IPlugin, + protos.google.cloud.apihub.v1.IDisablePluginRequest | undefined, + {} | undefined, + ] + >; disablePlugin( - request: protos.google.cloud.apihub.v1.IDisablePluginRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.apihub.v1.IPlugin, - protos.google.cloud.apihub.v1.IDisablePluginRequest|null|undefined, - {}|null|undefined>): void; + request: protos.google.cloud.apihub.v1.IDisablePluginRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.IPlugin, + protos.google.cloud.apihub.v1.IDisablePluginRequest | null | undefined, + {} | null | undefined + > + ): void; disablePlugin( - request: protos.google.cloud.apihub.v1.IDisablePluginRequest, - callback: Callback< - protos.google.cloud.apihub.v1.IPlugin, - protos.google.cloud.apihub.v1.IDisablePluginRequest|null|undefined, - {}|null|undefined>): void; + request: protos.google.cloud.apihub.v1.IDisablePluginRequest, + callback: Callback< + protos.google.cloud.apihub.v1.IPlugin, + protos.google.cloud.apihub.v1.IDisablePluginRequest | null | undefined, + {} | null | undefined + > + ): void; disablePlugin( - request?: protos.google.cloud.apihub.v1.IDisablePluginRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.apihub.v1.IPlugin, - protos.google.cloud.apihub.v1.IDisablePluginRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< + request?: protos.google.cloud.apihub.v1.IDisablePluginRequest, + optionsOrCallback?: + | CallOptions + | Callback< protos.google.cloud.apihub.v1.IPlugin, - protos.google.cloud.apihub.v1.IDisablePluginRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.apihub.v1.IPlugin, - protos.google.cloud.apihub.v1.IDisablePluginRequest|undefined, {}|undefined - ]>|void { + | protos.google.cloud.apihub.v1.IDisablePluginRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.apihub.v1.IPlugin, + protos.google.cloud.apihub.v1.IDisablePluginRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.apihub.v1.IPlugin, + protos.google.cloud.apihub.v1.IDisablePluginRequest | undefined, + {} | undefined, + ] + > | void { request = request || {}; let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } - else { + } 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 ?? '', - }); + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); this.initialize(); return this.innerApiCalls.disablePlugin(request, options, callback); } -/** + /** * Gets information about a location. * * @param {Object} request @@ -625,7 +709,7 @@ export class ApiHubPluginClient { 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. @@ -675,7 +759,7 @@ export class ApiHubPluginClient { * @param {string} api * @returns {string} Resource name string. */ - apiPath(project:string,location:string,api:string) { + apiPath(project: string, location: string, api: string) { return this.pathTemplates.apiPathTemplate.render({ project: project, location: location, @@ -724,7 +808,11 @@ export class ApiHubPluginClient { * @param {string} api_hub_instance * @returns {string} Resource name string. */ - apiHubInstancePath(project:string,location:string,apiHubInstance:string) { + apiHubInstancePath( + project: string, + location: string, + apiHubInstance: string + ) { return this.pathTemplates.apiHubInstancePathTemplate.render({ project: project, location: location, @@ -740,7 +828,9 @@ export class ApiHubPluginClient { * @returns {string} A string representing the project. */ matchProjectFromApiHubInstanceName(apiHubInstanceName: string) { - return this.pathTemplates.apiHubInstancePathTemplate.match(apiHubInstanceName).project; + return this.pathTemplates.apiHubInstancePathTemplate.match( + apiHubInstanceName + ).project; } /** @@ -751,7 +841,9 @@ export class ApiHubPluginClient { * @returns {string} A string representing the location. */ matchLocationFromApiHubInstanceName(apiHubInstanceName: string) { - return this.pathTemplates.apiHubInstancePathTemplate.match(apiHubInstanceName).location; + return this.pathTemplates.apiHubInstancePathTemplate.match( + apiHubInstanceName + ).location; } /** @@ -762,7 +854,9 @@ export class ApiHubPluginClient { * @returns {string} A string representing the api_hub_instance. */ matchApiHubInstanceFromApiHubInstanceName(apiHubInstanceName: string) { - return this.pathTemplates.apiHubInstancePathTemplate.match(apiHubInstanceName).api_hub_instance; + return this.pathTemplates.apiHubInstancePathTemplate.match( + apiHubInstanceName + ).api_hub_instance; } /** @@ -775,7 +869,13 @@ export class ApiHubPluginClient { * @param {string} operation * @returns {string} Resource name string. */ - apiOperationPath(project:string,location:string,api:string,version:string,operation:string) { + apiOperationPath( + project: string, + location: string, + api: string, + version: string, + operation: string + ) { return this.pathTemplates.apiOperationPathTemplate.render({ project: project, location: location, @@ -793,7 +893,8 @@ export class ApiHubPluginClient { * @returns {string} A string representing the project. */ matchProjectFromApiOperationName(apiOperationName: string) { - return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).project; + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName) + .project; } /** @@ -804,7 +905,8 @@ export class ApiHubPluginClient { * @returns {string} A string representing the location. */ matchLocationFromApiOperationName(apiOperationName: string) { - return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).location; + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName) + .location; } /** @@ -815,7 +917,8 @@ export class ApiHubPluginClient { * @returns {string} A string representing the api. */ matchApiFromApiOperationName(apiOperationName: string) { - return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).api; + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName) + .api; } /** @@ -826,7 +929,8 @@ export class ApiHubPluginClient { * @returns {string} A string representing the version. */ matchVersionFromApiOperationName(apiOperationName: string) { - return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).version; + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName) + .version; } /** @@ -837,7 +941,8 @@ export class ApiHubPluginClient { * @returns {string} A string representing the operation. */ matchOperationFromApiOperationName(apiOperationName: string) { - return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).operation; + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName) + .operation; } /** @@ -848,7 +953,7 @@ export class ApiHubPluginClient { * @param {string} attribute * @returns {string} Resource name string. */ - attributePath(project:string,location:string,attribute:string) { + attributePath(project: string, location: string, attribute: string) { return this.pathTemplates.attributePathTemplate.render({ project: project, location: location, @@ -864,7 +969,8 @@ export class ApiHubPluginClient { * @returns {string} A string representing the project. */ matchProjectFromAttributeName(attributeName: string) { - return this.pathTemplates.attributePathTemplate.match(attributeName).project; + return this.pathTemplates.attributePathTemplate.match(attributeName) + .project; } /** @@ -875,7 +981,8 @@ export class ApiHubPluginClient { * @returns {string} A string representing the location. */ matchLocationFromAttributeName(attributeName: string) { - return this.pathTemplates.attributePathTemplate.match(attributeName).location; + return this.pathTemplates.attributePathTemplate.match(attributeName) + .location; } /** @@ -886,7 +993,8 @@ export class ApiHubPluginClient { * @returns {string} A string representing the attribute. */ matchAttributeFromAttributeName(attributeName: string) { - return this.pathTemplates.attributePathTemplate.match(attributeName).attribute; + return this.pathTemplates.attributePathTemplate.match(attributeName) + .attribute; } /** @@ -899,7 +1007,13 @@ export class ApiHubPluginClient { * @param {string} definition * @returns {string} Resource name string. */ - definitionPath(project:string,location:string,api:string,version:string,definition:string) { + definitionPath( + project: string, + location: string, + api: string, + version: string, + definition: string + ) { return this.pathTemplates.definitionPathTemplate.render({ project: project, location: location, @@ -917,7 +1031,8 @@ export class ApiHubPluginClient { * @returns {string} A string representing the project. */ matchProjectFromDefinitionName(definitionName: string) { - return this.pathTemplates.definitionPathTemplate.match(definitionName).project; + return this.pathTemplates.definitionPathTemplate.match(definitionName) + .project; } /** @@ -928,7 +1043,8 @@ export class ApiHubPluginClient { * @returns {string} A string representing the location. */ matchLocationFromDefinitionName(definitionName: string) { - return this.pathTemplates.definitionPathTemplate.match(definitionName).location; + return this.pathTemplates.definitionPathTemplate.match(definitionName) + .location; } /** @@ -950,7 +1066,8 @@ export class ApiHubPluginClient { * @returns {string} A string representing the version. */ matchVersionFromDefinitionName(definitionName: string) { - return this.pathTemplates.definitionPathTemplate.match(definitionName).version; + return this.pathTemplates.definitionPathTemplate.match(definitionName) + .version; } /** @@ -961,7 +1078,8 @@ export class ApiHubPluginClient { * @returns {string} A string representing the definition. */ matchDefinitionFromDefinitionName(definitionName: string) { - return this.pathTemplates.definitionPathTemplate.match(definitionName).definition; + return this.pathTemplates.definitionPathTemplate.match(definitionName) + .definition; } /** @@ -972,7 +1090,7 @@ export class ApiHubPluginClient { * @param {string} dependency * @returns {string} Resource name string. */ - dependencyPath(project:string,location:string,dependency:string) { + dependencyPath(project: string, location: string, dependency: string) { return this.pathTemplates.dependencyPathTemplate.render({ project: project, location: location, @@ -988,7 +1106,8 @@ export class ApiHubPluginClient { * @returns {string} A string representing the project. */ matchProjectFromDependencyName(dependencyName: string) { - return this.pathTemplates.dependencyPathTemplate.match(dependencyName).project; + return this.pathTemplates.dependencyPathTemplate.match(dependencyName) + .project; } /** @@ -999,7 +1118,8 @@ export class ApiHubPluginClient { * @returns {string} A string representing the location. */ matchLocationFromDependencyName(dependencyName: string) { - return this.pathTemplates.dependencyPathTemplate.match(dependencyName).location; + return this.pathTemplates.dependencyPathTemplate.match(dependencyName) + .location; } /** @@ -1010,7 +1130,8 @@ export class ApiHubPluginClient { * @returns {string} A string representing the dependency. */ matchDependencyFromDependencyName(dependencyName: string) { - return this.pathTemplates.dependencyPathTemplate.match(dependencyName).dependency; + return this.pathTemplates.dependencyPathTemplate.match(dependencyName) + .dependency; } /** @@ -1021,7 +1142,7 @@ export class ApiHubPluginClient { * @param {string} deployment * @returns {string} Resource name string. */ - deploymentPath(project:string,location:string,deployment:string) { + deploymentPath(project: string, location: string, deployment: string) { return this.pathTemplates.deploymentPathTemplate.render({ project: project, location: location, @@ -1037,7 +1158,8 @@ export class ApiHubPluginClient { * @returns {string} A string representing the project. */ matchProjectFromDeploymentName(deploymentName: string) { - return this.pathTemplates.deploymentPathTemplate.match(deploymentName).project; + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .project; } /** @@ -1048,7 +1170,8 @@ export class ApiHubPluginClient { * @returns {string} A string representing the location. */ matchLocationFromDeploymentName(deploymentName: string) { - return this.pathTemplates.deploymentPathTemplate.match(deploymentName).location; + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .location; } /** @@ -1059,7 +1182,8 @@ export class ApiHubPluginClient { * @returns {string} A string representing the deployment. */ matchDeploymentFromDeploymentName(deploymentName: string) { - return this.pathTemplates.deploymentPathTemplate.match(deploymentName).deployment; + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .deployment; } /** @@ -1070,7 +1194,7 @@ export class ApiHubPluginClient { * @param {string} external_api * @returns {string} Resource name string. */ - externalApiPath(project:string,location:string,externalApi:string) { + externalApiPath(project: string, location: string, externalApi: string) { return this.pathTemplates.externalApiPathTemplate.render({ project: project, location: location, @@ -1086,7 +1210,8 @@ export class ApiHubPluginClient { * @returns {string} A string representing the project. */ matchProjectFromExternalApiName(externalApiName: string) { - return this.pathTemplates.externalApiPathTemplate.match(externalApiName).project; + return this.pathTemplates.externalApiPathTemplate.match(externalApiName) + .project; } /** @@ -1097,7 +1222,8 @@ export class ApiHubPluginClient { * @returns {string} A string representing the location. */ matchLocationFromExternalApiName(externalApiName: string) { - return this.pathTemplates.externalApiPathTemplate.match(externalApiName).location; + return this.pathTemplates.externalApiPathTemplate.match(externalApiName) + .location; } /** @@ -1108,7 +1234,8 @@ export class ApiHubPluginClient { * @returns {string} A string representing the external_api. */ matchExternalApiFromExternalApiName(externalApiName: string) { - return this.pathTemplates.externalApiPathTemplate.match(externalApiName).external_api; + return this.pathTemplates.externalApiPathTemplate.match(externalApiName) + .external_api; } /** @@ -1119,7 +1246,11 @@ export class ApiHubPluginClient { * @param {string} host_project_registration * @returns {string} Resource name string. */ - hostProjectRegistrationPath(project:string,location:string,hostProjectRegistration:string) { + hostProjectRegistrationPath( + project: string, + location: string, + hostProjectRegistration: string + ) { return this.pathTemplates.hostProjectRegistrationPathTemplate.render({ project: project, location: location, @@ -1134,8 +1265,12 @@ export class ApiHubPluginClient { * A fully-qualified path representing HostProjectRegistration resource. * @returns {string} A string representing the project. */ - matchProjectFromHostProjectRegistrationName(hostProjectRegistrationName: string) { - return this.pathTemplates.hostProjectRegistrationPathTemplate.match(hostProjectRegistrationName).project; + matchProjectFromHostProjectRegistrationName( + hostProjectRegistrationName: string + ) { + return this.pathTemplates.hostProjectRegistrationPathTemplate.match( + hostProjectRegistrationName + ).project; } /** @@ -1145,8 +1280,12 @@ export class ApiHubPluginClient { * A fully-qualified path representing HostProjectRegistration resource. * @returns {string} A string representing the location. */ - matchLocationFromHostProjectRegistrationName(hostProjectRegistrationName: string) { - return this.pathTemplates.hostProjectRegistrationPathTemplate.match(hostProjectRegistrationName).location; + matchLocationFromHostProjectRegistrationName( + hostProjectRegistrationName: string + ) { + return this.pathTemplates.hostProjectRegistrationPathTemplate.match( + hostProjectRegistrationName + ).location; } /** @@ -1156,8 +1295,12 @@ export class ApiHubPluginClient { * A fully-qualified path representing HostProjectRegistration resource. * @returns {string} A string representing the host_project_registration. */ - matchHostProjectRegistrationFromHostProjectRegistrationName(hostProjectRegistrationName: string) { - return this.pathTemplates.hostProjectRegistrationPathTemplate.match(hostProjectRegistrationName).host_project_registration; + matchHostProjectRegistrationFromHostProjectRegistrationName( + hostProjectRegistrationName: string + ) { + return this.pathTemplates.hostProjectRegistrationPathTemplate.match( + hostProjectRegistrationName + ).host_project_registration; } /** @@ -1168,7 +1311,7 @@ export class ApiHubPluginClient { * @param {string} plugin * @returns {string} Resource name string. */ - pluginPath(project:string,location:string,plugin:string) { + pluginPath(project: string, location: string, plugin: string) { return this.pathTemplates.pluginPathTemplate.render({ project: project, location: location, @@ -1217,7 +1360,11 @@ export class ApiHubPluginClient { * @param {string} runtime_project_attachment * @returns {string} Resource name string. */ - runtimeProjectAttachmentPath(project:string,location:string,runtimeProjectAttachment:string) { + runtimeProjectAttachmentPath( + project: string, + location: string, + runtimeProjectAttachment: string + ) { return this.pathTemplates.runtimeProjectAttachmentPathTemplate.render({ project: project, location: location, @@ -1232,8 +1379,12 @@ export class ApiHubPluginClient { * A fully-qualified path representing RuntimeProjectAttachment resource. * @returns {string} A string representing the project. */ - matchProjectFromRuntimeProjectAttachmentName(runtimeProjectAttachmentName: string) { - return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match(runtimeProjectAttachmentName).project; + matchProjectFromRuntimeProjectAttachmentName( + runtimeProjectAttachmentName: string + ) { + return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match( + runtimeProjectAttachmentName + ).project; } /** @@ -1243,8 +1394,12 @@ export class ApiHubPluginClient { * A fully-qualified path representing RuntimeProjectAttachment resource. * @returns {string} A string representing the location. */ - matchLocationFromRuntimeProjectAttachmentName(runtimeProjectAttachmentName: string) { - return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match(runtimeProjectAttachmentName).location; + matchLocationFromRuntimeProjectAttachmentName( + runtimeProjectAttachmentName: string + ) { + return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match( + runtimeProjectAttachmentName + ).location; } /** @@ -1254,8 +1409,12 @@ export class ApiHubPluginClient { * A fully-qualified path representing RuntimeProjectAttachment resource. * @returns {string} A string representing the runtime_project_attachment. */ - matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName(runtimeProjectAttachmentName: string) { - return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match(runtimeProjectAttachmentName).runtime_project_attachment; + matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName( + runtimeProjectAttachmentName: string + ) { + return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match( + runtimeProjectAttachmentName + ).runtime_project_attachment; } /** @@ -1268,7 +1427,13 @@ export class ApiHubPluginClient { * @param {string} spec * @returns {string} Resource name string. */ - specPath(project:string,location:string,api:string,version:string,spec:string) { + specPath( + project: string, + location: string, + api: string, + version: string, + spec: string + ) { return this.pathTemplates.specPathTemplate.render({ project: project, location: location, @@ -1341,7 +1506,7 @@ export class ApiHubPluginClient { * @param {string} plugin * @returns {string} Resource name string. */ - styleGuidePath(project:string,location:string,plugin:string) { + styleGuidePath(project: string, location: string, plugin: string) { return this.pathTemplates.styleGuidePathTemplate.render({ project: project, location: location, @@ -1357,7 +1522,8 @@ export class ApiHubPluginClient { * @returns {string} A string representing the project. */ matchProjectFromStyleGuideName(styleGuideName: string) { - return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName).project; + return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName) + .project; } /** @@ -1368,7 +1534,8 @@ export class ApiHubPluginClient { * @returns {string} A string representing the location. */ matchLocationFromStyleGuideName(styleGuideName: string) { - return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName).location; + return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName) + .location; } /** @@ -1379,7 +1546,8 @@ export class ApiHubPluginClient { * @returns {string} A string representing the plugin. */ matchPluginFromStyleGuideName(styleGuideName: string) { - return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName).plugin; + return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName) + .plugin; } /** @@ -1391,7 +1559,7 @@ export class ApiHubPluginClient { * @param {string} version * @returns {string} Resource name string. */ - versionPath(project:string,location:string,api:string,version:string) { + versionPath(project: string, location: string, api: string, version: string) { return this.pathTemplates.versionPathTemplate.render({ project: project, location: location, diff --git a/owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_plugin_client_config.json b/packages/google-cloud-apihub/src/v1/api_hub_plugin_client_config.json similarity index 100% rename from owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_plugin_client_config.json rename to packages/google-cloud-apihub/src/v1/api_hub_plugin_client_config.json diff --git a/owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_plugin_proto_list.json b/packages/google-cloud-apihub/src/v1/api_hub_plugin_proto_list.json similarity index 100% rename from owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_plugin_proto_list.json rename to packages/google-cloud-apihub/src/v1/api_hub_plugin_proto_list.json diff --git a/owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_proto_list.json b/packages/google-cloud-apihub/src/v1/api_hub_proto_list.json similarity index 100% rename from owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_proto_list.json rename to packages/google-cloud-apihub/src/v1/api_hub_proto_list.json diff --git a/owl-bot-staging/google-cloud-apihub/v1/src/v1/gapic_metadata.json b/packages/google-cloud-apihub/src/v1/gapic_metadata.json similarity index 100% rename from owl-bot-staging/google-cloud-apihub/v1/src/v1/gapic_metadata.json rename to packages/google-cloud-apihub/src/v1/gapic_metadata.json diff --git a/owl-bot-staging/google-cloud-apihub/v1/src/v1/host_project_registration_service_client.ts b/packages/google-cloud-apihub/src/v1/host_project_registration_service_client.ts similarity index 64% rename from owl-bot-staging/google-cloud-apihub/v1/src/v1/host_project_registration_service_client.ts rename to packages/google-cloud-apihub/src/v1/host_project_registration_service_client.ts index 5fe744da278..d8f6732c15f 100644 --- a/owl-bot-staging/google-cloud-apihub/v1/src/v1/host_project_registration_service_client.ts +++ b/packages/google-cloud-apihub/src/v1/host_project_registration_service_client.ts @@ -18,7 +18,16 @@ /* global window */ import type * as gax from 'google-gax'; -import type {Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback, GaxCall, LocationsClient, LocationProtos} from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, + PaginationCallback, + GaxCall, + LocationsClient, + LocationProtos, +} from 'google-gax'; import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); @@ -98,20 +107,42 @@ export class HostProjectRegistrationServiceClient { * const client = new HostProjectRegistrationServiceClient({fallback: true}, gax); * ``` */ - constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { // Ensure that options include all the required fields. - const staticMembers = this.constructor as typeof HostProjectRegistrationServiceClient; - if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { - throw new Error('Please set either universe_domain or universeDomain, but not both.'); + const staticMembers = this + .constructor as typeof HostProjectRegistrationServiceClient; + if ( + opts?.universe_domain && + opts?.universeDomain && + opts?.universe_domain !== opts?.universeDomain + ) { + throw new Error( + 'Please set either universe_domain or universeDomain, but not both.' + ); } - const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; - this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; + this._universeDomain = + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; this._servicePath = 'apihub.' + this._universeDomain; - const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; - this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const servicePath = + opts?.servicePath || opts?.apiEndpoint || this._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'); + 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. @@ -137,7 +168,7 @@ export class HostProjectRegistrationServiceClient { this._opts = opts; // Save the auth object to the client, for use by other methods. - this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; // Set useJWTAccessWithScope on the auth object. this.auth.useJWTAccessWithScope = true; @@ -153,13 +184,9 @@ export class HostProjectRegistrationServiceClient { this._gaxGrpc, opts ); - // Determine the client header string. - const clientHeader = [ - `gax/${this._gaxModule.version}`, - `gapic/${version}`, - ]; + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; if (typeof process === 'object' && 'versions' in process) { clientHeader.push(`gl-node/${process.versions.node}`); } else { @@ -234,14 +261,20 @@ export class HostProjectRegistrationServiceClient { // (e.g. 50 results at a time, with tokens to get subsequent // pages). Denote the keys used for pagination and results. this.descriptors.page = { - listHostProjectRegistrations: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'hostProjectRegistrations') + listHostProjectRegistrations: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'hostProjectRegistrations' + ), }; // Put together the default options sent with requests. this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.apihub.v1.HostProjectRegistrationService', gapicConfig as gax.ClientConfig, - opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); + 'google.cloud.apihub.v1.HostProjectRegistrationService', + 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 @@ -272,32 +305,40 @@ export class HostProjectRegistrationServiceClient { // Put together the "service stub" for // google.cloud.apihub.v1.HostProjectRegistrationService. this.hostProjectRegistrationServiceStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.apihub.v1.HostProjectRegistrationService') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.apihub.v1.HostProjectRegistrationService, - this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.apihub.v1.HostProjectRegistrationService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.apihub.v1 + .HostProjectRegistrationService, + 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 hostProjectRegistrationServiceStubMethods = - ['createHostProjectRegistration', 'getHostProjectRegistration', 'listHostProjectRegistrations']; + const hostProjectRegistrationServiceStubMethods = [ + 'createHostProjectRegistration', + 'getHostProjectRegistration', + 'listHostProjectRegistrations', + ]; for (const methodName of hostProjectRegistrationServiceStubMethods) { const callPromise = this.hostProjectRegistrationServiceStub.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) => () => { + stub => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { throw err; - }); + } + ); - const descriptor = - this.descriptors.page[methodName] || - undefined; + const descriptor = this.descriptors.page[methodName] || undefined; const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], @@ -317,8 +358,14 @@ export class HostProjectRegistrationServiceClient { * @returns {string} The DNS address for this service. */ static get servicePath() { - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static servicePath is deprecated, please use the instance method instead.', + 'DeprecationWarning' + ); } return 'apihub.googleapis.com'; } @@ -329,8 +376,14 @@ export class HostProjectRegistrationServiceClient { * @returns {string} The DNS address for this service. */ static get apiEndpoint() { - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static apiEndpoint is deprecated, please use the instance method instead.', + 'DeprecationWarning' + ); } return 'apihub.googleapis.com'; } @@ -361,9 +414,7 @@ export class HostProjectRegistrationServiceClient { * @returns {string[]} List of default scopes. */ static get scopes() { - return [ - 'https://www.googleapis.com/auth/cloud-platform' - ]; + return ['https://www.googleapis.com/auth/cloud-platform']; } getProjectId(): Promise; @@ -372,8 +423,9 @@ export class HostProjectRegistrationServiceClient { * 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 { + getProjectId( + callback?: Callback + ): Promise | void { if (callback) { this.auth.getProjectId(callback); return; @@ -384,332 +436,413 @@ export class HostProjectRegistrationServiceClient { // ------------------- // -- Service calls -- // ------------------- -/** - * Create a host project registration. - * A Google cloud project can be registered as a host project if it is not - * attached as a runtime project to another host project. - * A project can be registered as a host project only once. Subsequent - * register calls for the same project will fail. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource for the host project. - * Format: `projects/{project}/locations/{location}` - * @param {string} request.hostProjectRegistrationId - * Required. The ID to use for the Host Project Registration, which will - * become the final component of the host project registration's resource - * name. The ID must be the same as the Google cloud project specified in the - * host_project_registration.gcp_project field. - * @param {google.cloud.apihub.v1.HostProjectRegistration} request.hostProjectRegistration - * Required. The host project registration to register. - * @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.apihub.v1.HostProjectRegistration|HostProjectRegistration}. - * 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/host_project_registration_service.create_host_project_registration.js - * region_tag:apihub_v1_generated_HostProjectRegistrationService_CreateHostProjectRegistration_async - */ + /** + * Create a host project registration. + * A Google cloud project can be registered as a host project if it is not + * attached as a runtime project to another host project. + * A project can be registered as a host project only once. Subsequent + * register calls for the same project will fail. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource for the host project. + * Format: `projects/{project}/locations/{location}` + * @param {string} request.hostProjectRegistrationId + * Required. The ID to use for the Host Project Registration, which will + * become the final component of the host project registration's resource + * name. The ID must be the same as the Google cloud project specified in the + * host_project_registration.gcp_project field. + * @param {google.cloud.apihub.v1.HostProjectRegistration} request.hostProjectRegistration + * Required. The host project registration to register. + * @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.apihub.v1.HostProjectRegistration|HostProjectRegistration}. + * 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/host_project_registration_service.create_host_project_registration.js + * region_tag:apihub_v1_generated_HostProjectRegistrationService_CreateHostProjectRegistration_async + */ createHostProjectRegistration( - request?: protos.google.cloud.apihub.v1.ICreateHostProjectRegistrationRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apihub.v1.IHostProjectRegistration, - protos.google.cloud.apihub.v1.ICreateHostProjectRegistrationRequest|undefined, {}|undefined - ]>; + request?: protos.google.cloud.apihub.v1.ICreateHostProjectRegistrationRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apihub.v1.IHostProjectRegistration, + ( + | protos.google.cloud.apihub.v1.ICreateHostProjectRegistrationRequest + | undefined + ), + {} | undefined, + ] + >; createHostProjectRegistration( - request: protos.google.cloud.apihub.v1.ICreateHostProjectRegistrationRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.apihub.v1.IHostProjectRegistration, - protos.google.cloud.apihub.v1.ICreateHostProjectRegistrationRequest|null|undefined, - {}|null|undefined>): void; + request: protos.google.cloud.apihub.v1.ICreateHostProjectRegistrationRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.IHostProjectRegistration, + | protos.google.cloud.apihub.v1.ICreateHostProjectRegistrationRequest + | null + | undefined, + {} | null | undefined + > + ): void; createHostProjectRegistration( - request: protos.google.cloud.apihub.v1.ICreateHostProjectRegistrationRequest, - callback: Callback< - protos.google.cloud.apihub.v1.IHostProjectRegistration, - protos.google.cloud.apihub.v1.ICreateHostProjectRegistrationRequest|null|undefined, - {}|null|undefined>): void; + request: protos.google.cloud.apihub.v1.ICreateHostProjectRegistrationRequest, + callback: Callback< + protos.google.cloud.apihub.v1.IHostProjectRegistration, + | protos.google.cloud.apihub.v1.ICreateHostProjectRegistrationRequest + | null + | undefined, + {} | null | undefined + > + ): void; createHostProjectRegistration( - request?: protos.google.cloud.apihub.v1.ICreateHostProjectRegistrationRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.apihub.v1.IHostProjectRegistration, - protos.google.cloud.apihub.v1.ICreateHostProjectRegistrationRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< + request?: protos.google.cloud.apihub.v1.ICreateHostProjectRegistrationRequest, + optionsOrCallback?: + | CallOptions + | Callback< protos.google.cloud.apihub.v1.IHostProjectRegistration, - protos.google.cloud.apihub.v1.ICreateHostProjectRegistrationRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.apihub.v1.IHostProjectRegistration, - protos.google.cloud.apihub.v1.ICreateHostProjectRegistrationRequest|undefined, {}|undefined - ]>|void { + | protos.google.cloud.apihub.v1.ICreateHostProjectRegistrationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.apihub.v1.IHostProjectRegistration, + | protos.google.cloud.apihub.v1.ICreateHostProjectRegistrationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.apihub.v1.IHostProjectRegistration, + ( + | protos.google.cloud.apihub.v1.ICreateHostProjectRegistrationRequest + | undefined + ), + {} | undefined, + ] + > | void { request = request || {}; let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } - else { + } 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 ?? '', - }); + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); this.initialize(); - return this.innerApiCalls.createHostProjectRegistration(request, options, callback); + return this.innerApiCalls.createHostProjectRegistration( + request, + options, + callback + ); } -/** - * Get a host project registration. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Host project registration resource name. - * projects/{project}/locations/{location}/hostProjectRegistrations/{host_project_registration_id} - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.apihub.v1.HostProjectRegistration|HostProjectRegistration}. - * 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/host_project_registration_service.get_host_project_registration.js - * region_tag:apihub_v1_generated_HostProjectRegistrationService_GetHostProjectRegistration_async - */ + /** + * Get a host project registration. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Host project registration resource name. + * projects/{project}/locations/{location}/hostProjectRegistrations/{host_project_registration_id} + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.apihub.v1.HostProjectRegistration|HostProjectRegistration}. + * 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/host_project_registration_service.get_host_project_registration.js + * region_tag:apihub_v1_generated_HostProjectRegistrationService_GetHostProjectRegistration_async + */ getHostProjectRegistration( - request?: protos.google.cloud.apihub.v1.IGetHostProjectRegistrationRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apihub.v1.IHostProjectRegistration, - protos.google.cloud.apihub.v1.IGetHostProjectRegistrationRequest|undefined, {}|undefined - ]>; + request?: protos.google.cloud.apihub.v1.IGetHostProjectRegistrationRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apihub.v1.IHostProjectRegistration, + ( + | protos.google.cloud.apihub.v1.IGetHostProjectRegistrationRequest + | undefined + ), + {} | undefined, + ] + >; getHostProjectRegistration( - request: protos.google.cloud.apihub.v1.IGetHostProjectRegistrationRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.apihub.v1.IHostProjectRegistration, - protos.google.cloud.apihub.v1.IGetHostProjectRegistrationRequest|null|undefined, - {}|null|undefined>): void; + request: protos.google.cloud.apihub.v1.IGetHostProjectRegistrationRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.IHostProjectRegistration, + | protos.google.cloud.apihub.v1.IGetHostProjectRegistrationRequest + | null + | undefined, + {} | null | undefined + > + ): void; getHostProjectRegistration( - request: protos.google.cloud.apihub.v1.IGetHostProjectRegistrationRequest, - callback: Callback< - protos.google.cloud.apihub.v1.IHostProjectRegistration, - protos.google.cloud.apihub.v1.IGetHostProjectRegistrationRequest|null|undefined, - {}|null|undefined>): void; + request: protos.google.cloud.apihub.v1.IGetHostProjectRegistrationRequest, + callback: Callback< + protos.google.cloud.apihub.v1.IHostProjectRegistration, + | protos.google.cloud.apihub.v1.IGetHostProjectRegistrationRequest + | null + | undefined, + {} | null | undefined + > + ): void; getHostProjectRegistration( - request?: protos.google.cloud.apihub.v1.IGetHostProjectRegistrationRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.apihub.v1.IHostProjectRegistration, - protos.google.cloud.apihub.v1.IGetHostProjectRegistrationRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< + request?: protos.google.cloud.apihub.v1.IGetHostProjectRegistrationRequest, + optionsOrCallback?: + | CallOptions + | Callback< protos.google.cloud.apihub.v1.IHostProjectRegistration, - protos.google.cloud.apihub.v1.IGetHostProjectRegistrationRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.apihub.v1.IHostProjectRegistration, - protos.google.cloud.apihub.v1.IGetHostProjectRegistrationRequest|undefined, {}|undefined - ]>|void { + | protos.google.cloud.apihub.v1.IGetHostProjectRegistrationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.apihub.v1.IHostProjectRegistration, + | protos.google.cloud.apihub.v1.IGetHostProjectRegistrationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.apihub.v1.IHostProjectRegistration, + ( + | protos.google.cloud.apihub.v1.IGetHostProjectRegistrationRequest + | undefined + ), + {} | undefined, + ] + > | void { request = request || {}; let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } - else { + } 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 ?? '', - }); + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); this.initialize(); - return this.innerApiCalls.getHostProjectRegistration(request, options, callback); - } - - /** - * Lists host project registrations. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent, which owns this collection of host projects. - * Format: `projects/* /locations/*` - * @param {number} [request.pageSize] - * Optional. The maximum number of host project registrations to return. The - * service may return fewer than this value. If unspecified, at most 50 host - * project registrations will be returned. The maximum value is 1000; values - * above 1000 will be coerced to 1000. - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous - * `ListHostProjectRegistrations` call. Provide this to retrieve the - * subsequent page. - * - * When paginating, all other parameters (except page_size) provided to - * `ListHostProjectRegistrations` must match the call that provided the page - * token. - * @param {string} [request.filter] - * Optional. An expression that filters the list of HostProjectRegistrations. - * - * A filter expression consists of a field name, a comparison - * operator, and a value for filtering. The value must be a string. All - * standard operators as documented at https://google.aip.dev/160 are - * supported. - * - * The following fields in the `HostProjectRegistration` are eligible for - * filtering: - * - * * `name` - The name of the HostProjectRegistration. - * * `create_time` - The time at which the HostProjectRegistration was - * created. The value should be in the - * (RFC3339)[https://tools.ietf.org/html/rfc3339] format. - * * `gcp_project` - The Google cloud project associated with the - * HostProjectRegistration. - * @param {string} [request.orderBy] - * Optional. Hint for how to order the results. - * @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.apihub.v1.HostProjectRegistration|HostProjectRegistration}. - * 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 `listHostProjectRegistrationsAsync()` - * 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. - */ + return this.innerApiCalls.getHostProjectRegistration( + request, + options, + callback + ); + } + + /** + * Lists host project registrations. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of host projects. + * Format: `projects/* /locations/*` + * @param {number} [request.pageSize] + * Optional. The maximum number of host project registrations to return. The + * service may return fewer than this value. If unspecified, at most 50 host + * project registrations will be returned. The maximum value is 1000; values + * above 1000 will be coerced to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous + * `ListHostProjectRegistrations` call. Provide this to retrieve the + * subsequent page. + * + * When paginating, all other parameters (except page_size) provided to + * `ListHostProjectRegistrations` must match the call that provided the page + * token. + * @param {string} [request.filter] + * Optional. An expression that filters the list of HostProjectRegistrations. + * + * A filter expression consists of a field name, a comparison + * operator, and a value for filtering. The value must be a string. All + * standard operators as documented at https://google.aip.dev/160 are + * supported. + * + * The following fields in the `HostProjectRegistration` are eligible for + * filtering: + * + * * `name` - The name of the HostProjectRegistration. + * * `create_time` - The time at which the HostProjectRegistration was + * created. The value should be in the + * (RFC3339)[https://tools.ietf.org/html/rfc3339] format. + * * `gcp_project` - The Google cloud project associated with the + * HostProjectRegistration. + * @param {string} [request.orderBy] + * Optional. Hint for how to order the results. + * @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.apihub.v1.HostProjectRegistration|HostProjectRegistration}. + * 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 `listHostProjectRegistrationsAsync()` + * 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. + */ listHostProjectRegistrations( - request?: protos.google.cloud.apihub.v1.IListHostProjectRegistrationsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apihub.v1.IHostProjectRegistration[], - protos.google.cloud.apihub.v1.IListHostProjectRegistrationsRequest|null, - protos.google.cloud.apihub.v1.IListHostProjectRegistrationsResponse - ]>; + request?: protos.google.cloud.apihub.v1.IListHostProjectRegistrationsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apihub.v1.IHostProjectRegistration[], + protos.google.cloud.apihub.v1.IListHostProjectRegistrationsRequest | null, + protos.google.cloud.apihub.v1.IListHostProjectRegistrationsResponse, + ] + >; listHostProjectRegistrations( - request: protos.google.cloud.apihub.v1.IListHostProjectRegistrationsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.apihub.v1.IListHostProjectRegistrationsRequest, - protos.google.cloud.apihub.v1.IListHostProjectRegistrationsResponse|null|undefined, - protos.google.cloud.apihub.v1.IHostProjectRegistration>): void; + request: protos.google.cloud.apihub.v1.IListHostProjectRegistrationsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.apihub.v1.IListHostProjectRegistrationsRequest, + | protos.google.cloud.apihub.v1.IListHostProjectRegistrationsResponse + | null + | undefined, + protos.google.cloud.apihub.v1.IHostProjectRegistration + > + ): void; listHostProjectRegistrations( - request: protos.google.cloud.apihub.v1.IListHostProjectRegistrationsRequest, - callback: PaginationCallback< - protos.google.cloud.apihub.v1.IListHostProjectRegistrationsRequest, - protos.google.cloud.apihub.v1.IListHostProjectRegistrationsResponse|null|undefined, - protos.google.cloud.apihub.v1.IHostProjectRegistration>): void; + request: protos.google.cloud.apihub.v1.IListHostProjectRegistrationsRequest, + callback: PaginationCallback< + protos.google.cloud.apihub.v1.IListHostProjectRegistrationsRequest, + | protos.google.cloud.apihub.v1.IListHostProjectRegistrationsResponse + | null + | undefined, + protos.google.cloud.apihub.v1.IHostProjectRegistration + > + ): void; listHostProjectRegistrations( - request?: protos.google.cloud.apihub.v1.IListHostProjectRegistrationsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.apihub.v1.IListHostProjectRegistrationsRequest, - protos.google.cloud.apihub.v1.IListHostProjectRegistrationsResponse|null|undefined, - protos.google.cloud.apihub.v1.IHostProjectRegistration>, - callback?: PaginationCallback< + request?: protos.google.cloud.apihub.v1.IListHostProjectRegistrationsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< protos.google.cloud.apihub.v1.IListHostProjectRegistrationsRequest, - protos.google.cloud.apihub.v1.IListHostProjectRegistrationsResponse|null|undefined, - protos.google.cloud.apihub.v1.IHostProjectRegistration>): - Promise<[ - protos.google.cloud.apihub.v1.IHostProjectRegistration[], - protos.google.cloud.apihub.v1.IListHostProjectRegistrationsRequest|null, - protos.google.cloud.apihub.v1.IListHostProjectRegistrationsResponse - ]>|void { + | protos.google.cloud.apihub.v1.IListHostProjectRegistrationsResponse + | null + | undefined, + protos.google.cloud.apihub.v1.IHostProjectRegistration + >, + callback?: PaginationCallback< + protos.google.cloud.apihub.v1.IListHostProjectRegistrationsRequest, + | protos.google.cloud.apihub.v1.IListHostProjectRegistrationsResponse + | null + | undefined, + protos.google.cloud.apihub.v1.IHostProjectRegistration + > + ): Promise< + [ + protos.google.cloud.apihub.v1.IHostProjectRegistration[], + protos.google.cloud.apihub.v1.IListHostProjectRegistrationsRequest | null, + protos.google.cloud.apihub.v1.IListHostProjectRegistrationsResponse, + ] + > | void { request = request || {}; let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } - else { + } 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 ?? '', - }); + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); this.initialize(); - return this.innerApiCalls.listHostProjectRegistrations(request, options, callback); + return this.innerApiCalls.listHostProjectRegistrations( + request, + options, + callback + ); } -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent, which owns this collection of host projects. - * Format: `projects/* /locations/*` - * @param {number} [request.pageSize] - * Optional. The maximum number of host project registrations to return. The - * service may return fewer than this value. If unspecified, at most 50 host - * project registrations will be returned. The maximum value is 1000; values - * above 1000 will be coerced to 1000. - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous - * `ListHostProjectRegistrations` call. Provide this to retrieve the - * subsequent page. - * - * When paginating, all other parameters (except page_size) provided to - * `ListHostProjectRegistrations` must match the call that provided the page - * token. - * @param {string} [request.filter] - * Optional. An expression that filters the list of HostProjectRegistrations. - * - * A filter expression consists of a field name, a comparison - * operator, and a value for filtering. The value must be a string. All - * standard operators as documented at https://google.aip.dev/160 are - * supported. - * - * The following fields in the `HostProjectRegistration` are eligible for - * filtering: - * - * * `name` - The name of the HostProjectRegistration. - * * `create_time` - The time at which the HostProjectRegistration was - * created. The value should be in the - * (RFC3339)[https://tools.ietf.org/html/rfc3339] format. - * * `gcp_project` - The Google cloud project associated with the - * HostProjectRegistration. - * @param {string} [request.orderBy] - * Optional. Hint for how to order the results. - * @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.apihub.v1.HostProjectRegistration|HostProjectRegistration} 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 `listHostProjectRegistrationsAsync()` - * 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. - */ + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of host projects. + * Format: `projects/* /locations/*` + * @param {number} [request.pageSize] + * Optional. The maximum number of host project registrations to return. The + * service may return fewer than this value. If unspecified, at most 50 host + * project registrations will be returned. The maximum value is 1000; values + * above 1000 will be coerced to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous + * `ListHostProjectRegistrations` call. Provide this to retrieve the + * subsequent page. + * + * When paginating, all other parameters (except page_size) provided to + * `ListHostProjectRegistrations` must match the call that provided the page + * token. + * @param {string} [request.filter] + * Optional. An expression that filters the list of HostProjectRegistrations. + * + * A filter expression consists of a field name, a comparison + * operator, and a value for filtering. The value must be a string. All + * standard operators as documented at https://google.aip.dev/160 are + * supported. + * + * The following fields in the `HostProjectRegistration` are eligible for + * filtering: + * + * * `name` - The name of the HostProjectRegistration. + * * `create_time` - The time at which the HostProjectRegistration was + * created. The value should be in the + * (RFC3339)[https://tools.ietf.org/html/rfc3339] format. + * * `gcp_project` - The Google cloud project associated with the + * HostProjectRegistration. + * @param {string} [request.orderBy] + * Optional. Hint for how to order the results. + * @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.apihub.v1.HostProjectRegistration|HostProjectRegistration} 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 `listHostProjectRegistrationsAsync()` + * 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. + */ listHostProjectRegistrationsStream( - request?: protos.google.cloud.apihub.v1.IListHostProjectRegistrationsRequest, - options?: CallOptions): - Transform{ + request?: protos.google.cloud.apihub.v1.IListHostProjectRegistrationsRequest, + 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 ?? '', - }); + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); const defaultCallSettings = this._defaults['listHostProjectRegistrations']; const callSettings = defaultCallSettings.merge(options); this.initialize(); @@ -720,72 +853,71 @@ export class HostProjectRegistrationServiceClient { ); } -/** - * Equivalent to `listHostProjectRegistrations`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent, which owns this collection of host projects. - * Format: `projects/* /locations/*` - * @param {number} [request.pageSize] - * Optional. The maximum number of host project registrations to return. The - * service may return fewer than this value. If unspecified, at most 50 host - * project registrations will be returned. The maximum value is 1000; values - * above 1000 will be coerced to 1000. - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous - * `ListHostProjectRegistrations` call. Provide this to retrieve the - * subsequent page. - * - * When paginating, all other parameters (except page_size) provided to - * `ListHostProjectRegistrations` must match the call that provided the page - * token. - * @param {string} [request.filter] - * Optional. An expression that filters the list of HostProjectRegistrations. - * - * A filter expression consists of a field name, a comparison - * operator, and a value for filtering. The value must be a string. All - * standard operators as documented at https://google.aip.dev/160 are - * supported. - * - * The following fields in the `HostProjectRegistration` are eligible for - * filtering: - * - * * `name` - The name of the HostProjectRegistration. - * * `create_time` - The time at which the HostProjectRegistration was - * created. The value should be in the - * (RFC3339)[https://tools.ietf.org/html/rfc3339] format. - * * `gcp_project` - The Google cloud project associated with the - * HostProjectRegistration. - * @param {string} [request.orderBy] - * Optional. Hint for how to order the results. - * @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.apihub.v1.HostProjectRegistration|HostProjectRegistration}. 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/host_project_registration_service.list_host_project_registrations.js - * region_tag:apihub_v1_generated_HostProjectRegistrationService_ListHostProjectRegistrations_async - */ + /** + * Equivalent to `listHostProjectRegistrations`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of host projects. + * Format: `projects/* /locations/*` + * @param {number} [request.pageSize] + * Optional. The maximum number of host project registrations to return. The + * service may return fewer than this value. If unspecified, at most 50 host + * project registrations will be returned. The maximum value is 1000; values + * above 1000 will be coerced to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous + * `ListHostProjectRegistrations` call. Provide this to retrieve the + * subsequent page. + * + * When paginating, all other parameters (except page_size) provided to + * `ListHostProjectRegistrations` must match the call that provided the page + * token. + * @param {string} [request.filter] + * Optional. An expression that filters the list of HostProjectRegistrations. + * + * A filter expression consists of a field name, a comparison + * operator, and a value for filtering. The value must be a string. All + * standard operators as documented at https://google.aip.dev/160 are + * supported. + * + * The following fields in the `HostProjectRegistration` are eligible for + * filtering: + * + * * `name` - The name of the HostProjectRegistration. + * * `create_time` - The time at which the HostProjectRegistration was + * created. The value should be in the + * (RFC3339)[https://tools.ietf.org/html/rfc3339] format. + * * `gcp_project` - The Google cloud project associated with the + * HostProjectRegistration. + * @param {string} [request.orderBy] + * Optional. Hint for how to order the results. + * @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.apihub.v1.HostProjectRegistration|HostProjectRegistration}. 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/host_project_registration_service.list_host_project_registrations.js + * region_tag:apihub_v1_generated_HostProjectRegistrationService_ListHostProjectRegistrations_async + */ listHostProjectRegistrationsAsync( - request?: protos.google.cloud.apihub.v1.IListHostProjectRegistrationsRequest, - options?: CallOptions): - AsyncIterable{ + request?: protos.google.cloud.apihub.v1.IListHostProjectRegistrationsRequest, + 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 ?? '', - }); + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); const defaultCallSettings = this._defaults['listHostProjectRegistrations']; const callSettings = defaultCallSettings.merge(options); this.initialize(); @@ -795,7 +927,7 @@ export class HostProjectRegistrationServiceClient { callSettings ) as AsyncIterable; } -/** + /** * Gets information about a location. * * @param {Object} request @@ -835,7 +967,7 @@ export class HostProjectRegistrationServiceClient { 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. @@ -885,7 +1017,7 @@ export class HostProjectRegistrationServiceClient { * @param {string} api * @returns {string} Resource name string. */ - apiPath(project:string,location:string,api:string) { + apiPath(project: string, location: string, api: string) { return this.pathTemplates.apiPathTemplate.render({ project: project, location: location, @@ -934,7 +1066,11 @@ export class HostProjectRegistrationServiceClient { * @param {string} api_hub_instance * @returns {string} Resource name string. */ - apiHubInstancePath(project:string,location:string,apiHubInstance:string) { + apiHubInstancePath( + project: string, + location: string, + apiHubInstance: string + ) { return this.pathTemplates.apiHubInstancePathTemplate.render({ project: project, location: location, @@ -950,7 +1086,9 @@ export class HostProjectRegistrationServiceClient { * @returns {string} A string representing the project. */ matchProjectFromApiHubInstanceName(apiHubInstanceName: string) { - return this.pathTemplates.apiHubInstancePathTemplate.match(apiHubInstanceName).project; + return this.pathTemplates.apiHubInstancePathTemplate.match( + apiHubInstanceName + ).project; } /** @@ -961,7 +1099,9 @@ export class HostProjectRegistrationServiceClient { * @returns {string} A string representing the location. */ matchLocationFromApiHubInstanceName(apiHubInstanceName: string) { - return this.pathTemplates.apiHubInstancePathTemplate.match(apiHubInstanceName).location; + return this.pathTemplates.apiHubInstancePathTemplate.match( + apiHubInstanceName + ).location; } /** @@ -972,7 +1112,9 @@ export class HostProjectRegistrationServiceClient { * @returns {string} A string representing the api_hub_instance. */ matchApiHubInstanceFromApiHubInstanceName(apiHubInstanceName: string) { - return this.pathTemplates.apiHubInstancePathTemplate.match(apiHubInstanceName).api_hub_instance; + return this.pathTemplates.apiHubInstancePathTemplate.match( + apiHubInstanceName + ).api_hub_instance; } /** @@ -985,7 +1127,13 @@ export class HostProjectRegistrationServiceClient { * @param {string} operation * @returns {string} Resource name string. */ - apiOperationPath(project:string,location:string,api:string,version:string,operation:string) { + apiOperationPath( + project: string, + location: string, + api: string, + version: string, + operation: string + ) { return this.pathTemplates.apiOperationPathTemplate.render({ project: project, location: location, @@ -1003,7 +1151,8 @@ export class HostProjectRegistrationServiceClient { * @returns {string} A string representing the project. */ matchProjectFromApiOperationName(apiOperationName: string) { - return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).project; + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName) + .project; } /** @@ -1014,7 +1163,8 @@ export class HostProjectRegistrationServiceClient { * @returns {string} A string representing the location. */ matchLocationFromApiOperationName(apiOperationName: string) { - return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).location; + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName) + .location; } /** @@ -1025,7 +1175,8 @@ export class HostProjectRegistrationServiceClient { * @returns {string} A string representing the api. */ matchApiFromApiOperationName(apiOperationName: string) { - return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).api; + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName) + .api; } /** @@ -1036,7 +1187,8 @@ export class HostProjectRegistrationServiceClient { * @returns {string} A string representing the version. */ matchVersionFromApiOperationName(apiOperationName: string) { - return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).version; + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName) + .version; } /** @@ -1047,7 +1199,8 @@ export class HostProjectRegistrationServiceClient { * @returns {string} A string representing the operation. */ matchOperationFromApiOperationName(apiOperationName: string) { - return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).operation; + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName) + .operation; } /** @@ -1058,7 +1211,7 @@ export class HostProjectRegistrationServiceClient { * @param {string} attribute * @returns {string} Resource name string. */ - attributePath(project:string,location:string,attribute:string) { + attributePath(project: string, location: string, attribute: string) { return this.pathTemplates.attributePathTemplate.render({ project: project, location: location, @@ -1074,7 +1227,8 @@ export class HostProjectRegistrationServiceClient { * @returns {string} A string representing the project. */ matchProjectFromAttributeName(attributeName: string) { - return this.pathTemplates.attributePathTemplate.match(attributeName).project; + return this.pathTemplates.attributePathTemplate.match(attributeName) + .project; } /** @@ -1085,7 +1239,8 @@ export class HostProjectRegistrationServiceClient { * @returns {string} A string representing the location. */ matchLocationFromAttributeName(attributeName: string) { - return this.pathTemplates.attributePathTemplate.match(attributeName).location; + return this.pathTemplates.attributePathTemplate.match(attributeName) + .location; } /** @@ -1096,7 +1251,8 @@ export class HostProjectRegistrationServiceClient { * @returns {string} A string representing the attribute. */ matchAttributeFromAttributeName(attributeName: string) { - return this.pathTemplates.attributePathTemplate.match(attributeName).attribute; + return this.pathTemplates.attributePathTemplate.match(attributeName) + .attribute; } /** @@ -1109,7 +1265,13 @@ export class HostProjectRegistrationServiceClient { * @param {string} definition * @returns {string} Resource name string. */ - definitionPath(project:string,location:string,api:string,version:string,definition:string) { + definitionPath( + project: string, + location: string, + api: string, + version: string, + definition: string + ) { return this.pathTemplates.definitionPathTemplate.render({ project: project, location: location, @@ -1127,7 +1289,8 @@ export class HostProjectRegistrationServiceClient { * @returns {string} A string representing the project. */ matchProjectFromDefinitionName(definitionName: string) { - return this.pathTemplates.definitionPathTemplate.match(definitionName).project; + return this.pathTemplates.definitionPathTemplate.match(definitionName) + .project; } /** @@ -1138,7 +1301,8 @@ export class HostProjectRegistrationServiceClient { * @returns {string} A string representing the location. */ matchLocationFromDefinitionName(definitionName: string) { - return this.pathTemplates.definitionPathTemplate.match(definitionName).location; + return this.pathTemplates.definitionPathTemplate.match(definitionName) + .location; } /** @@ -1160,7 +1324,8 @@ export class HostProjectRegistrationServiceClient { * @returns {string} A string representing the version. */ matchVersionFromDefinitionName(definitionName: string) { - return this.pathTemplates.definitionPathTemplate.match(definitionName).version; + return this.pathTemplates.definitionPathTemplate.match(definitionName) + .version; } /** @@ -1171,7 +1336,8 @@ export class HostProjectRegistrationServiceClient { * @returns {string} A string representing the definition. */ matchDefinitionFromDefinitionName(definitionName: string) { - return this.pathTemplates.definitionPathTemplate.match(definitionName).definition; + return this.pathTemplates.definitionPathTemplate.match(definitionName) + .definition; } /** @@ -1182,7 +1348,7 @@ export class HostProjectRegistrationServiceClient { * @param {string} dependency * @returns {string} Resource name string. */ - dependencyPath(project:string,location:string,dependency:string) { + dependencyPath(project: string, location: string, dependency: string) { return this.pathTemplates.dependencyPathTemplate.render({ project: project, location: location, @@ -1198,7 +1364,8 @@ export class HostProjectRegistrationServiceClient { * @returns {string} A string representing the project. */ matchProjectFromDependencyName(dependencyName: string) { - return this.pathTemplates.dependencyPathTemplate.match(dependencyName).project; + return this.pathTemplates.dependencyPathTemplate.match(dependencyName) + .project; } /** @@ -1209,7 +1376,8 @@ export class HostProjectRegistrationServiceClient { * @returns {string} A string representing the location. */ matchLocationFromDependencyName(dependencyName: string) { - return this.pathTemplates.dependencyPathTemplate.match(dependencyName).location; + return this.pathTemplates.dependencyPathTemplate.match(dependencyName) + .location; } /** @@ -1220,7 +1388,8 @@ export class HostProjectRegistrationServiceClient { * @returns {string} A string representing the dependency. */ matchDependencyFromDependencyName(dependencyName: string) { - return this.pathTemplates.dependencyPathTemplate.match(dependencyName).dependency; + return this.pathTemplates.dependencyPathTemplate.match(dependencyName) + .dependency; } /** @@ -1231,7 +1400,7 @@ export class HostProjectRegistrationServiceClient { * @param {string} deployment * @returns {string} Resource name string. */ - deploymentPath(project:string,location:string,deployment:string) { + deploymentPath(project: string, location: string, deployment: string) { return this.pathTemplates.deploymentPathTemplate.render({ project: project, location: location, @@ -1247,7 +1416,8 @@ export class HostProjectRegistrationServiceClient { * @returns {string} A string representing the project. */ matchProjectFromDeploymentName(deploymentName: string) { - return this.pathTemplates.deploymentPathTemplate.match(deploymentName).project; + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .project; } /** @@ -1258,7 +1428,8 @@ export class HostProjectRegistrationServiceClient { * @returns {string} A string representing the location. */ matchLocationFromDeploymentName(deploymentName: string) { - return this.pathTemplates.deploymentPathTemplate.match(deploymentName).location; + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .location; } /** @@ -1269,7 +1440,8 @@ export class HostProjectRegistrationServiceClient { * @returns {string} A string representing the deployment. */ matchDeploymentFromDeploymentName(deploymentName: string) { - return this.pathTemplates.deploymentPathTemplate.match(deploymentName).deployment; + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .deployment; } /** @@ -1280,7 +1452,7 @@ export class HostProjectRegistrationServiceClient { * @param {string} external_api * @returns {string} Resource name string. */ - externalApiPath(project:string,location:string,externalApi:string) { + externalApiPath(project: string, location: string, externalApi: string) { return this.pathTemplates.externalApiPathTemplate.render({ project: project, location: location, @@ -1296,7 +1468,8 @@ export class HostProjectRegistrationServiceClient { * @returns {string} A string representing the project. */ matchProjectFromExternalApiName(externalApiName: string) { - return this.pathTemplates.externalApiPathTemplate.match(externalApiName).project; + return this.pathTemplates.externalApiPathTemplate.match(externalApiName) + .project; } /** @@ -1307,7 +1480,8 @@ export class HostProjectRegistrationServiceClient { * @returns {string} A string representing the location. */ matchLocationFromExternalApiName(externalApiName: string) { - return this.pathTemplates.externalApiPathTemplate.match(externalApiName).location; + return this.pathTemplates.externalApiPathTemplate.match(externalApiName) + .location; } /** @@ -1318,7 +1492,8 @@ export class HostProjectRegistrationServiceClient { * @returns {string} A string representing the external_api. */ matchExternalApiFromExternalApiName(externalApiName: string) { - return this.pathTemplates.externalApiPathTemplate.match(externalApiName).external_api; + return this.pathTemplates.externalApiPathTemplate.match(externalApiName) + .external_api; } /** @@ -1329,7 +1504,11 @@ export class HostProjectRegistrationServiceClient { * @param {string} host_project_registration * @returns {string} Resource name string. */ - hostProjectRegistrationPath(project:string,location:string,hostProjectRegistration:string) { + hostProjectRegistrationPath( + project: string, + location: string, + hostProjectRegistration: string + ) { return this.pathTemplates.hostProjectRegistrationPathTemplate.render({ project: project, location: location, @@ -1344,8 +1523,12 @@ export class HostProjectRegistrationServiceClient { * A fully-qualified path representing HostProjectRegistration resource. * @returns {string} A string representing the project. */ - matchProjectFromHostProjectRegistrationName(hostProjectRegistrationName: string) { - return this.pathTemplates.hostProjectRegistrationPathTemplate.match(hostProjectRegistrationName).project; + matchProjectFromHostProjectRegistrationName( + hostProjectRegistrationName: string + ) { + return this.pathTemplates.hostProjectRegistrationPathTemplate.match( + hostProjectRegistrationName + ).project; } /** @@ -1355,8 +1538,12 @@ export class HostProjectRegistrationServiceClient { * A fully-qualified path representing HostProjectRegistration resource. * @returns {string} A string representing the location. */ - matchLocationFromHostProjectRegistrationName(hostProjectRegistrationName: string) { - return this.pathTemplates.hostProjectRegistrationPathTemplate.match(hostProjectRegistrationName).location; + matchLocationFromHostProjectRegistrationName( + hostProjectRegistrationName: string + ) { + return this.pathTemplates.hostProjectRegistrationPathTemplate.match( + hostProjectRegistrationName + ).location; } /** @@ -1366,8 +1553,12 @@ export class HostProjectRegistrationServiceClient { * A fully-qualified path representing HostProjectRegistration resource. * @returns {string} A string representing the host_project_registration. */ - matchHostProjectRegistrationFromHostProjectRegistrationName(hostProjectRegistrationName: string) { - return this.pathTemplates.hostProjectRegistrationPathTemplate.match(hostProjectRegistrationName).host_project_registration; + matchHostProjectRegistrationFromHostProjectRegistrationName( + hostProjectRegistrationName: string + ) { + return this.pathTemplates.hostProjectRegistrationPathTemplate.match( + hostProjectRegistrationName + ).host_project_registration; } /** @@ -1377,7 +1568,7 @@ export class HostProjectRegistrationServiceClient { * @param {string} location * @returns {string} Resource name string. */ - locationPath(project:string,location:string) { + locationPath(project: string, location: string) { return this.pathTemplates.locationPathTemplate.render({ project: project, location: location, @@ -1414,7 +1605,7 @@ export class HostProjectRegistrationServiceClient { * @param {string} plugin * @returns {string} Resource name string. */ - pluginPath(project:string,location:string,plugin:string) { + pluginPath(project: string, location: string, plugin: string) { return this.pathTemplates.pluginPathTemplate.render({ project: project, location: location, @@ -1461,7 +1652,7 @@ export class HostProjectRegistrationServiceClient { * @param {string} project * @returns {string} Resource name string. */ - projectPath(project:string) { + projectPath(project: string) { return this.pathTemplates.projectPathTemplate.render({ project: project, }); @@ -1486,7 +1677,11 @@ export class HostProjectRegistrationServiceClient { * @param {string} runtime_project_attachment * @returns {string} Resource name string. */ - runtimeProjectAttachmentPath(project:string,location:string,runtimeProjectAttachment:string) { + runtimeProjectAttachmentPath( + project: string, + location: string, + runtimeProjectAttachment: string + ) { return this.pathTemplates.runtimeProjectAttachmentPathTemplate.render({ project: project, location: location, @@ -1501,8 +1696,12 @@ export class HostProjectRegistrationServiceClient { * A fully-qualified path representing RuntimeProjectAttachment resource. * @returns {string} A string representing the project. */ - matchProjectFromRuntimeProjectAttachmentName(runtimeProjectAttachmentName: string) { - return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match(runtimeProjectAttachmentName).project; + matchProjectFromRuntimeProjectAttachmentName( + runtimeProjectAttachmentName: string + ) { + return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match( + runtimeProjectAttachmentName + ).project; } /** @@ -1512,8 +1711,12 @@ export class HostProjectRegistrationServiceClient { * A fully-qualified path representing RuntimeProjectAttachment resource. * @returns {string} A string representing the location. */ - matchLocationFromRuntimeProjectAttachmentName(runtimeProjectAttachmentName: string) { - return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match(runtimeProjectAttachmentName).location; + matchLocationFromRuntimeProjectAttachmentName( + runtimeProjectAttachmentName: string + ) { + return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match( + runtimeProjectAttachmentName + ).location; } /** @@ -1523,8 +1726,12 @@ export class HostProjectRegistrationServiceClient { * A fully-qualified path representing RuntimeProjectAttachment resource. * @returns {string} A string representing the runtime_project_attachment. */ - matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName(runtimeProjectAttachmentName: string) { - return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match(runtimeProjectAttachmentName).runtime_project_attachment; + matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName( + runtimeProjectAttachmentName: string + ) { + return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match( + runtimeProjectAttachmentName + ).runtime_project_attachment; } /** @@ -1537,7 +1744,13 @@ export class HostProjectRegistrationServiceClient { * @param {string} spec * @returns {string} Resource name string. */ - specPath(project:string,location:string,api:string,version:string,spec:string) { + specPath( + project: string, + location: string, + api: string, + version: string, + spec: string + ) { return this.pathTemplates.specPathTemplate.render({ project: project, location: location, @@ -1610,7 +1823,7 @@ export class HostProjectRegistrationServiceClient { * @param {string} plugin * @returns {string} Resource name string. */ - styleGuidePath(project:string,location:string,plugin:string) { + styleGuidePath(project: string, location: string, plugin: string) { return this.pathTemplates.styleGuidePathTemplate.render({ project: project, location: location, @@ -1626,7 +1839,8 @@ export class HostProjectRegistrationServiceClient { * @returns {string} A string representing the project. */ matchProjectFromStyleGuideName(styleGuideName: string) { - return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName).project; + return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName) + .project; } /** @@ -1637,7 +1851,8 @@ export class HostProjectRegistrationServiceClient { * @returns {string} A string representing the location. */ matchLocationFromStyleGuideName(styleGuideName: string) { - return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName).location; + return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName) + .location; } /** @@ -1648,7 +1863,8 @@ export class HostProjectRegistrationServiceClient { * @returns {string} A string representing the plugin. */ matchPluginFromStyleGuideName(styleGuideName: string) { - return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName).plugin; + return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName) + .plugin; } /** @@ -1660,7 +1876,7 @@ export class HostProjectRegistrationServiceClient { * @param {string} version * @returns {string} Resource name string. */ - versionPath(project:string,location:string,api:string,version:string) { + versionPath(project: string, location: string, api: string, version: string) { return this.pathTemplates.versionPathTemplate.render({ project: project, location: location, diff --git a/owl-bot-staging/google-cloud-apihub/v1/src/v1/host_project_registration_service_client_config.json b/packages/google-cloud-apihub/src/v1/host_project_registration_service_client_config.json similarity index 100% rename from owl-bot-staging/google-cloud-apihub/v1/src/v1/host_project_registration_service_client_config.json rename to packages/google-cloud-apihub/src/v1/host_project_registration_service_client_config.json diff --git a/owl-bot-staging/google-cloud-apihub/v1/src/v1/host_project_registration_service_proto_list.json b/packages/google-cloud-apihub/src/v1/host_project_registration_service_proto_list.json similarity index 100% rename from owl-bot-staging/google-cloud-apihub/v1/src/v1/host_project_registration_service_proto_list.json rename to packages/google-cloud-apihub/src/v1/host_project_registration_service_proto_list.json diff --git a/owl-bot-staging/google-cloud-apihub/v1/src/v1/index.ts b/packages/google-cloud-apihub/src/v1/index.ts similarity index 100% rename from owl-bot-staging/google-cloud-apihub/v1/src/v1/index.ts rename to packages/google-cloud-apihub/src/v1/index.ts diff --git a/owl-bot-staging/google-cloud-apihub/v1/src/v1/linting_service_client.ts b/packages/google-cloud-apihub/src/v1/linting_service_client.ts similarity index 71% rename from owl-bot-staging/google-cloud-apihub/v1/src/v1/linting_service_client.ts rename to packages/google-cloud-apihub/src/v1/linting_service_client.ts index ec938777704..a2fe507ff9d 100644 --- a/owl-bot-staging/google-cloud-apihub/v1/src/v1/linting_service_client.ts +++ b/packages/google-cloud-apihub/src/v1/linting_service_client.ts @@ -18,7 +18,14 @@ /* global window */ import type * as gax from 'google-gax'; -import type {Callback, CallOptions, Descriptors, ClientOptions, LocationsClient, LocationProtos} from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, + LocationsClient, + LocationProtos, +} from 'google-gax'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); @@ -98,20 +105,41 @@ export class LintingServiceClient { * const client = new LintingServiceClient({fallback: true}, gax); * ``` */ - constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { // Ensure that options include all the required fields. const staticMembers = this.constructor as typeof LintingServiceClient; - if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { - throw new Error('Please set either universe_domain or universeDomain, but not both.'); + if ( + opts?.universe_domain && + opts?.universeDomain && + opts?.universe_domain !== opts?.universeDomain + ) { + throw new Error( + 'Please set either universe_domain or universeDomain, but not both.' + ); } - const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; - this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; + this._universeDomain = + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; this._servicePath = 'apihub.' + this._universeDomain; - const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; - this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const servicePath = + opts?.servicePath || opts?.apiEndpoint || this._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'); + 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. @@ -137,7 +165,7 @@ export class LintingServiceClient { this._opts = opts; // Save the auth object to the client, for use by other methods. - this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; // Set useJWTAccessWithScope on the auth object. this.auth.useJWTAccessWithScope = true; @@ -153,13 +181,9 @@ export class LintingServiceClient { this._gaxGrpc, opts ); - // Determine the client header string. - const clientHeader = [ - `gax/${this._gaxModule.version}`, - `gapic/${version}`, - ]; + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; if (typeof process === 'object' && 'versions' in process) { clientHeader.push(`gl-node/${process.versions.node}`); } else { @@ -226,8 +250,11 @@ export class LintingServiceClient { // Put together the default options sent with requests. this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.apihub.v1.LintingService', gapicConfig as gax.ClientConfig, - opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); + 'google.cloud.apihub.v1.LintingService', + 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 @@ -258,31 +285,40 @@ export class LintingServiceClient { // Put together the "service stub" for // google.cloud.apihub.v1.LintingService. this.lintingServiceStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.apihub.v1.LintingService') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.apihub.v1.LintingService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.cloud.apihub.v1.LintingService, - this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; + 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 lintingServiceStubMethods = - ['getStyleGuide', 'updateStyleGuide', 'getStyleGuideContents', 'lintSpec']; + const lintingServiceStubMethods = [ + 'getStyleGuide', + 'updateStyleGuide', + 'getStyleGuideContents', + 'lintSpec', + ]; for (const methodName of lintingServiceStubMethods) { const callPromise = this.lintingServiceStub.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) => () => { + stub => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { throw err; - }); + } + ); - const descriptor = - undefined; + const descriptor = undefined; const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], @@ -302,8 +338,14 @@ export class LintingServiceClient { * @returns {string} The DNS address for this service. */ static get servicePath() { - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static servicePath is deprecated, please use the instance method instead.', + 'DeprecationWarning' + ); } return 'apihub.googleapis.com'; } @@ -314,8 +356,14 @@ export class LintingServiceClient { * @returns {string} The DNS address for this service. */ static get apiEndpoint() { - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static apiEndpoint is deprecated, please use the instance method instead.', + 'DeprecationWarning' + ); } return 'apihub.googleapis.com'; } @@ -346,9 +394,7 @@ export class LintingServiceClient { * @returns {string[]} List of default scopes. */ static get scopes() { - return [ - 'https://www.googleapis.com/auth/cloud-platform' - ]; + return ['https://www.googleapis.com/auth/cloud-platform']; } getProjectId(): Promise; @@ -357,8 +403,9 @@ export class LintingServiceClient { * 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 { + getProjectId( + callback?: Callback + ): Promise | void { if (callback) { this.auth.getProjectId(callback); return; @@ -369,299 +416,359 @@ export class LintingServiceClient { // ------------------- // -- Service calls -- // ------------------- -/** - * Get the style guide being used for linting. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the spec to retrieve. - * Format: - * `projects/{project}/locations/{location}/plugins/{plugin}/styleGuide`. - * @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.apihub.v1.StyleGuide|StyleGuide}. - * 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/linting_service.get_style_guide.js - * region_tag:apihub_v1_generated_LintingService_GetStyleGuide_async - */ + /** + * Get the style guide being used for linting. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the spec to retrieve. + * Format: + * `projects/{project}/locations/{location}/plugins/{plugin}/styleGuide`. + * @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.apihub.v1.StyleGuide|StyleGuide}. + * 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/linting_service.get_style_guide.js + * region_tag:apihub_v1_generated_LintingService_GetStyleGuide_async + */ getStyleGuide( - request?: protos.google.cloud.apihub.v1.IGetStyleGuideRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apihub.v1.IStyleGuide, - protos.google.cloud.apihub.v1.IGetStyleGuideRequest|undefined, {}|undefined - ]>; + request?: protos.google.cloud.apihub.v1.IGetStyleGuideRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apihub.v1.IStyleGuide, + protos.google.cloud.apihub.v1.IGetStyleGuideRequest | undefined, + {} | undefined, + ] + >; getStyleGuide( - request: protos.google.cloud.apihub.v1.IGetStyleGuideRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.apihub.v1.IStyleGuide, - protos.google.cloud.apihub.v1.IGetStyleGuideRequest|null|undefined, - {}|null|undefined>): void; + request: protos.google.cloud.apihub.v1.IGetStyleGuideRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.IStyleGuide, + protos.google.cloud.apihub.v1.IGetStyleGuideRequest | null | undefined, + {} | null | undefined + > + ): void; getStyleGuide( - request: protos.google.cloud.apihub.v1.IGetStyleGuideRequest, - callback: Callback< - protos.google.cloud.apihub.v1.IStyleGuide, - protos.google.cloud.apihub.v1.IGetStyleGuideRequest|null|undefined, - {}|null|undefined>): void; + request: protos.google.cloud.apihub.v1.IGetStyleGuideRequest, + callback: Callback< + protos.google.cloud.apihub.v1.IStyleGuide, + protos.google.cloud.apihub.v1.IGetStyleGuideRequest | null | undefined, + {} | null | undefined + > + ): void; getStyleGuide( - request?: protos.google.cloud.apihub.v1.IGetStyleGuideRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.apihub.v1.IStyleGuide, - protos.google.cloud.apihub.v1.IGetStyleGuideRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< + request?: protos.google.cloud.apihub.v1.IGetStyleGuideRequest, + optionsOrCallback?: + | CallOptions + | Callback< protos.google.cloud.apihub.v1.IStyleGuide, - protos.google.cloud.apihub.v1.IGetStyleGuideRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.apihub.v1.IStyleGuide, - protos.google.cloud.apihub.v1.IGetStyleGuideRequest|undefined, {}|undefined - ]>|void { + | protos.google.cloud.apihub.v1.IGetStyleGuideRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.apihub.v1.IStyleGuide, + protos.google.cloud.apihub.v1.IGetStyleGuideRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.apihub.v1.IStyleGuide, + protos.google.cloud.apihub.v1.IGetStyleGuideRequest | undefined, + {} | undefined, + ] + > | void { request = request || {}; let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } - else { + } 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 ?? '', - }); + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); this.initialize(); return this.innerApiCalls.getStyleGuide(request, options, callback); } -/** - * Update the styleGuide to be used for liniting in by API hub. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.apihub.v1.StyleGuide} request.styleGuide - * Required. The Style guide resource to update. - * @param {google.protobuf.FieldMask} [request.updateMask] - * Optional. The list of fields to update. - * @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.apihub.v1.StyleGuide|StyleGuide}. - * 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/linting_service.update_style_guide.js - * region_tag:apihub_v1_generated_LintingService_UpdateStyleGuide_async - */ + /** + * Update the styleGuide to be used for liniting in by API hub. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.apihub.v1.StyleGuide} request.styleGuide + * Required. The Style guide resource to update. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. The list of fields to update. + * @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.apihub.v1.StyleGuide|StyleGuide}. + * 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/linting_service.update_style_guide.js + * region_tag:apihub_v1_generated_LintingService_UpdateStyleGuide_async + */ updateStyleGuide( - request?: protos.google.cloud.apihub.v1.IUpdateStyleGuideRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apihub.v1.IStyleGuide, - protos.google.cloud.apihub.v1.IUpdateStyleGuideRequest|undefined, {}|undefined - ]>; + request?: protos.google.cloud.apihub.v1.IUpdateStyleGuideRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apihub.v1.IStyleGuide, + protos.google.cloud.apihub.v1.IUpdateStyleGuideRequest | undefined, + {} | undefined, + ] + >; updateStyleGuide( - request: protos.google.cloud.apihub.v1.IUpdateStyleGuideRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.apihub.v1.IStyleGuide, - protos.google.cloud.apihub.v1.IUpdateStyleGuideRequest|null|undefined, - {}|null|undefined>): void; + request: protos.google.cloud.apihub.v1.IUpdateStyleGuideRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.IStyleGuide, + protos.google.cloud.apihub.v1.IUpdateStyleGuideRequest | null | undefined, + {} | null | undefined + > + ): void; updateStyleGuide( - request: protos.google.cloud.apihub.v1.IUpdateStyleGuideRequest, - callback: Callback< - protos.google.cloud.apihub.v1.IStyleGuide, - protos.google.cloud.apihub.v1.IUpdateStyleGuideRequest|null|undefined, - {}|null|undefined>): void; + request: protos.google.cloud.apihub.v1.IUpdateStyleGuideRequest, + callback: Callback< + protos.google.cloud.apihub.v1.IStyleGuide, + protos.google.cloud.apihub.v1.IUpdateStyleGuideRequest | null | undefined, + {} | null | undefined + > + ): void; updateStyleGuide( - request?: protos.google.cloud.apihub.v1.IUpdateStyleGuideRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.apihub.v1.IStyleGuide, - protos.google.cloud.apihub.v1.IUpdateStyleGuideRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< + request?: protos.google.cloud.apihub.v1.IUpdateStyleGuideRequest, + optionsOrCallback?: + | CallOptions + | Callback< protos.google.cloud.apihub.v1.IStyleGuide, - protos.google.cloud.apihub.v1.IUpdateStyleGuideRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.apihub.v1.IStyleGuide, - protos.google.cloud.apihub.v1.IUpdateStyleGuideRequest|undefined, {}|undefined - ]>|void { + | protos.google.cloud.apihub.v1.IUpdateStyleGuideRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.apihub.v1.IStyleGuide, + protos.google.cloud.apihub.v1.IUpdateStyleGuideRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.apihub.v1.IStyleGuide, + protos.google.cloud.apihub.v1.IUpdateStyleGuideRequest | undefined, + {} | undefined, + ] + > | void { request = request || {}; let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } - else { + } 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({ - 'style_guide.name': request.styleGuide!.name ?? '', - }); + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + 'style_guide.name': request.styleGuide!.name ?? '', + }); this.initialize(); return this.innerApiCalls.updateStyleGuide(request, options, callback); } -/** - * Get the contents of the style guide. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the StyleGuide whose contents need to be retrieved. - * There is exactly one style guide resource per project per location. - * The expected format is - * `projects/{project}/locations/{location}/plugins/{plugin}/styleGuide`. - * @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.apihub.v1.StyleGuideContents|StyleGuideContents}. - * 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/linting_service.get_style_guide_contents.js - * region_tag:apihub_v1_generated_LintingService_GetStyleGuideContents_async - */ + /** + * Get the contents of the style guide. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the StyleGuide whose contents need to be retrieved. + * There is exactly one style guide resource per project per location. + * The expected format is + * `projects/{project}/locations/{location}/plugins/{plugin}/styleGuide`. + * @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.apihub.v1.StyleGuideContents|StyleGuideContents}. + * 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/linting_service.get_style_guide_contents.js + * region_tag:apihub_v1_generated_LintingService_GetStyleGuideContents_async + */ getStyleGuideContents( - request?: protos.google.cloud.apihub.v1.IGetStyleGuideContentsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apihub.v1.IStyleGuideContents, - protos.google.cloud.apihub.v1.IGetStyleGuideContentsRequest|undefined, {}|undefined - ]>; + request?: protos.google.cloud.apihub.v1.IGetStyleGuideContentsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apihub.v1.IStyleGuideContents, + protos.google.cloud.apihub.v1.IGetStyleGuideContentsRequest | undefined, + {} | undefined, + ] + >; getStyleGuideContents( - request: protos.google.cloud.apihub.v1.IGetStyleGuideContentsRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.apihub.v1.IStyleGuideContents, - protos.google.cloud.apihub.v1.IGetStyleGuideContentsRequest|null|undefined, - {}|null|undefined>): void; + request: protos.google.cloud.apihub.v1.IGetStyleGuideContentsRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.IStyleGuideContents, + | protos.google.cloud.apihub.v1.IGetStyleGuideContentsRequest + | null + | undefined, + {} | null | undefined + > + ): void; getStyleGuideContents( - request: protos.google.cloud.apihub.v1.IGetStyleGuideContentsRequest, - callback: Callback< - protos.google.cloud.apihub.v1.IStyleGuideContents, - protos.google.cloud.apihub.v1.IGetStyleGuideContentsRequest|null|undefined, - {}|null|undefined>): void; + request: protos.google.cloud.apihub.v1.IGetStyleGuideContentsRequest, + callback: Callback< + protos.google.cloud.apihub.v1.IStyleGuideContents, + | protos.google.cloud.apihub.v1.IGetStyleGuideContentsRequest + | null + | undefined, + {} | null | undefined + > + ): void; getStyleGuideContents( - request?: protos.google.cloud.apihub.v1.IGetStyleGuideContentsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.apihub.v1.IStyleGuideContents, - protos.google.cloud.apihub.v1.IGetStyleGuideContentsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< + request?: protos.google.cloud.apihub.v1.IGetStyleGuideContentsRequest, + optionsOrCallback?: + | CallOptions + | Callback< protos.google.cloud.apihub.v1.IStyleGuideContents, - protos.google.cloud.apihub.v1.IGetStyleGuideContentsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.apihub.v1.IStyleGuideContents, - protos.google.cloud.apihub.v1.IGetStyleGuideContentsRequest|undefined, {}|undefined - ]>|void { + | protos.google.cloud.apihub.v1.IGetStyleGuideContentsRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.apihub.v1.IStyleGuideContents, + | protos.google.cloud.apihub.v1.IGetStyleGuideContentsRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.apihub.v1.IStyleGuideContents, + protos.google.cloud.apihub.v1.IGetStyleGuideContentsRequest | undefined, + {} | undefined, + ] + > | void { request = request || {}; let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } - else { + } 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 ?? '', - }); + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); this.initialize(); return this.innerApiCalls.getStyleGuideContents(request, options, callback); } -/** - * Lints the requested spec and updates the corresponding API Spec with the - * lint response. This lint response will be available in all subsequent - * Get and List Spec calls to Core service. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the spec to be linted. - * Format: - * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}` - * @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.protobuf.Empty|Empty}. - * 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/linting_service.lint_spec.js - * region_tag:apihub_v1_generated_LintingService_LintSpec_async - */ + /** + * Lints the requested spec and updates the corresponding API Spec with the + * lint response. This lint response will be available in all subsequent + * Get and List Spec calls to Core service. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the spec to be linted. + * Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}` + * @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.protobuf.Empty|Empty}. + * 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/linting_service.lint_spec.js + * region_tag:apihub_v1_generated_LintingService_LintSpec_async + */ lintSpec( - request?: protos.google.cloud.apihub.v1.ILintSpecRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.ILintSpecRequest|undefined, {}|undefined - ]>; + request?: protos.google.cloud.apihub.v1.ILintSpecRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.ILintSpecRequest | undefined, + {} | undefined, + ] + >; lintSpec( - request: protos.google.cloud.apihub.v1.ILintSpecRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.ILintSpecRequest|null|undefined, - {}|null|undefined>): void; + request: protos.google.cloud.apihub.v1.ILintSpecRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.ILintSpecRequest | null | undefined, + {} | null | undefined + > + ): void; lintSpec( - request: protos.google.cloud.apihub.v1.ILintSpecRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.ILintSpecRequest|null|undefined, - {}|null|undefined>): void; + request: protos.google.cloud.apihub.v1.ILintSpecRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.ILintSpecRequest | null | undefined, + {} | null | undefined + > + ): void; lintSpec( - request?: protos.google.cloud.apihub.v1.ILintSpecRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.ILintSpecRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< + request?: protos.google.cloud.apihub.v1.ILintSpecRequest, + optionsOrCallback?: + | CallOptions + | Callback< protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.ILintSpecRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.ILintSpecRequest|undefined, {}|undefined - ]>|void { + protos.google.cloud.apihub.v1.ILintSpecRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.ILintSpecRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.ILintSpecRequest | undefined, + {} | undefined, + ] + > | void { request = request || {}; let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } - else { + } 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 ?? '', - }); + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); this.initialize(); return this.innerApiCalls.lintSpec(request, options, callback); } -/** + /** * Gets information about a location. * * @param {Object} request @@ -701,7 +808,7 @@ export class LintingServiceClient { 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. @@ -751,7 +858,7 @@ export class LintingServiceClient { * @param {string} api * @returns {string} Resource name string. */ - apiPath(project:string,location:string,api:string) { + apiPath(project: string, location: string, api: string) { return this.pathTemplates.apiPathTemplate.render({ project: project, location: location, @@ -800,7 +907,11 @@ export class LintingServiceClient { * @param {string} api_hub_instance * @returns {string} Resource name string. */ - apiHubInstancePath(project:string,location:string,apiHubInstance:string) { + apiHubInstancePath( + project: string, + location: string, + apiHubInstance: string + ) { return this.pathTemplates.apiHubInstancePathTemplate.render({ project: project, location: location, @@ -816,7 +927,9 @@ export class LintingServiceClient { * @returns {string} A string representing the project. */ matchProjectFromApiHubInstanceName(apiHubInstanceName: string) { - return this.pathTemplates.apiHubInstancePathTemplate.match(apiHubInstanceName).project; + return this.pathTemplates.apiHubInstancePathTemplate.match( + apiHubInstanceName + ).project; } /** @@ -827,7 +940,9 @@ export class LintingServiceClient { * @returns {string} A string representing the location. */ matchLocationFromApiHubInstanceName(apiHubInstanceName: string) { - return this.pathTemplates.apiHubInstancePathTemplate.match(apiHubInstanceName).location; + return this.pathTemplates.apiHubInstancePathTemplate.match( + apiHubInstanceName + ).location; } /** @@ -838,7 +953,9 @@ export class LintingServiceClient { * @returns {string} A string representing the api_hub_instance. */ matchApiHubInstanceFromApiHubInstanceName(apiHubInstanceName: string) { - return this.pathTemplates.apiHubInstancePathTemplate.match(apiHubInstanceName).api_hub_instance; + return this.pathTemplates.apiHubInstancePathTemplate.match( + apiHubInstanceName + ).api_hub_instance; } /** @@ -851,7 +968,13 @@ export class LintingServiceClient { * @param {string} operation * @returns {string} Resource name string. */ - apiOperationPath(project:string,location:string,api:string,version:string,operation:string) { + apiOperationPath( + project: string, + location: string, + api: string, + version: string, + operation: string + ) { return this.pathTemplates.apiOperationPathTemplate.render({ project: project, location: location, @@ -869,7 +992,8 @@ export class LintingServiceClient { * @returns {string} A string representing the project. */ matchProjectFromApiOperationName(apiOperationName: string) { - return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).project; + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName) + .project; } /** @@ -880,7 +1004,8 @@ export class LintingServiceClient { * @returns {string} A string representing the location. */ matchLocationFromApiOperationName(apiOperationName: string) { - return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).location; + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName) + .location; } /** @@ -891,7 +1016,8 @@ export class LintingServiceClient { * @returns {string} A string representing the api. */ matchApiFromApiOperationName(apiOperationName: string) { - return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).api; + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName) + .api; } /** @@ -902,7 +1028,8 @@ export class LintingServiceClient { * @returns {string} A string representing the version. */ matchVersionFromApiOperationName(apiOperationName: string) { - return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).version; + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName) + .version; } /** @@ -913,7 +1040,8 @@ export class LintingServiceClient { * @returns {string} A string representing the operation. */ matchOperationFromApiOperationName(apiOperationName: string) { - return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).operation; + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName) + .operation; } /** @@ -924,7 +1052,7 @@ export class LintingServiceClient { * @param {string} attribute * @returns {string} Resource name string. */ - attributePath(project:string,location:string,attribute:string) { + attributePath(project: string, location: string, attribute: string) { return this.pathTemplates.attributePathTemplate.render({ project: project, location: location, @@ -940,7 +1068,8 @@ export class LintingServiceClient { * @returns {string} A string representing the project. */ matchProjectFromAttributeName(attributeName: string) { - return this.pathTemplates.attributePathTemplate.match(attributeName).project; + return this.pathTemplates.attributePathTemplate.match(attributeName) + .project; } /** @@ -951,7 +1080,8 @@ export class LintingServiceClient { * @returns {string} A string representing the location. */ matchLocationFromAttributeName(attributeName: string) { - return this.pathTemplates.attributePathTemplate.match(attributeName).location; + return this.pathTemplates.attributePathTemplate.match(attributeName) + .location; } /** @@ -962,7 +1092,8 @@ export class LintingServiceClient { * @returns {string} A string representing the attribute. */ matchAttributeFromAttributeName(attributeName: string) { - return this.pathTemplates.attributePathTemplate.match(attributeName).attribute; + return this.pathTemplates.attributePathTemplate.match(attributeName) + .attribute; } /** @@ -975,7 +1106,13 @@ export class LintingServiceClient { * @param {string} definition * @returns {string} Resource name string. */ - definitionPath(project:string,location:string,api:string,version:string,definition:string) { + definitionPath( + project: string, + location: string, + api: string, + version: string, + definition: string + ) { return this.pathTemplates.definitionPathTemplate.render({ project: project, location: location, @@ -993,7 +1130,8 @@ export class LintingServiceClient { * @returns {string} A string representing the project. */ matchProjectFromDefinitionName(definitionName: string) { - return this.pathTemplates.definitionPathTemplate.match(definitionName).project; + return this.pathTemplates.definitionPathTemplate.match(definitionName) + .project; } /** @@ -1004,7 +1142,8 @@ export class LintingServiceClient { * @returns {string} A string representing the location. */ matchLocationFromDefinitionName(definitionName: string) { - return this.pathTemplates.definitionPathTemplate.match(definitionName).location; + return this.pathTemplates.definitionPathTemplate.match(definitionName) + .location; } /** @@ -1026,7 +1165,8 @@ export class LintingServiceClient { * @returns {string} A string representing the version. */ matchVersionFromDefinitionName(definitionName: string) { - return this.pathTemplates.definitionPathTemplate.match(definitionName).version; + return this.pathTemplates.definitionPathTemplate.match(definitionName) + .version; } /** @@ -1037,7 +1177,8 @@ export class LintingServiceClient { * @returns {string} A string representing the definition. */ matchDefinitionFromDefinitionName(definitionName: string) { - return this.pathTemplates.definitionPathTemplate.match(definitionName).definition; + return this.pathTemplates.definitionPathTemplate.match(definitionName) + .definition; } /** @@ -1048,7 +1189,7 @@ export class LintingServiceClient { * @param {string} dependency * @returns {string} Resource name string. */ - dependencyPath(project:string,location:string,dependency:string) { + dependencyPath(project: string, location: string, dependency: string) { return this.pathTemplates.dependencyPathTemplate.render({ project: project, location: location, @@ -1064,7 +1205,8 @@ export class LintingServiceClient { * @returns {string} A string representing the project. */ matchProjectFromDependencyName(dependencyName: string) { - return this.pathTemplates.dependencyPathTemplate.match(dependencyName).project; + return this.pathTemplates.dependencyPathTemplate.match(dependencyName) + .project; } /** @@ -1075,7 +1217,8 @@ export class LintingServiceClient { * @returns {string} A string representing the location. */ matchLocationFromDependencyName(dependencyName: string) { - return this.pathTemplates.dependencyPathTemplate.match(dependencyName).location; + return this.pathTemplates.dependencyPathTemplate.match(dependencyName) + .location; } /** @@ -1086,7 +1229,8 @@ export class LintingServiceClient { * @returns {string} A string representing the dependency. */ matchDependencyFromDependencyName(dependencyName: string) { - return this.pathTemplates.dependencyPathTemplate.match(dependencyName).dependency; + return this.pathTemplates.dependencyPathTemplate.match(dependencyName) + .dependency; } /** @@ -1097,7 +1241,7 @@ export class LintingServiceClient { * @param {string} deployment * @returns {string} Resource name string. */ - deploymentPath(project:string,location:string,deployment:string) { + deploymentPath(project: string, location: string, deployment: string) { return this.pathTemplates.deploymentPathTemplate.render({ project: project, location: location, @@ -1113,7 +1257,8 @@ export class LintingServiceClient { * @returns {string} A string representing the project. */ matchProjectFromDeploymentName(deploymentName: string) { - return this.pathTemplates.deploymentPathTemplate.match(deploymentName).project; + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .project; } /** @@ -1124,7 +1269,8 @@ export class LintingServiceClient { * @returns {string} A string representing the location. */ matchLocationFromDeploymentName(deploymentName: string) { - return this.pathTemplates.deploymentPathTemplate.match(deploymentName).location; + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .location; } /** @@ -1135,7 +1281,8 @@ export class LintingServiceClient { * @returns {string} A string representing the deployment. */ matchDeploymentFromDeploymentName(deploymentName: string) { - return this.pathTemplates.deploymentPathTemplate.match(deploymentName).deployment; + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .deployment; } /** @@ -1146,7 +1293,7 @@ export class LintingServiceClient { * @param {string} external_api * @returns {string} Resource name string. */ - externalApiPath(project:string,location:string,externalApi:string) { + externalApiPath(project: string, location: string, externalApi: string) { return this.pathTemplates.externalApiPathTemplate.render({ project: project, location: location, @@ -1162,7 +1309,8 @@ export class LintingServiceClient { * @returns {string} A string representing the project. */ matchProjectFromExternalApiName(externalApiName: string) { - return this.pathTemplates.externalApiPathTemplate.match(externalApiName).project; + return this.pathTemplates.externalApiPathTemplate.match(externalApiName) + .project; } /** @@ -1173,7 +1321,8 @@ export class LintingServiceClient { * @returns {string} A string representing the location. */ matchLocationFromExternalApiName(externalApiName: string) { - return this.pathTemplates.externalApiPathTemplate.match(externalApiName).location; + return this.pathTemplates.externalApiPathTemplate.match(externalApiName) + .location; } /** @@ -1184,7 +1333,8 @@ export class LintingServiceClient { * @returns {string} A string representing the external_api. */ matchExternalApiFromExternalApiName(externalApiName: string) { - return this.pathTemplates.externalApiPathTemplate.match(externalApiName).external_api; + return this.pathTemplates.externalApiPathTemplate.match(externalApiName) + .external_api; } /** @@ -1195,7 +1345,11 @@ export class LintingServiceClient { * @param {string} host_project_registration * @returns {string} Resource name string. */ - hostProjectRegistrationPath(project:string,location:string,hostProjectRegistration:string) { + hostProjectRegistrationPath( + project: string, + location: string, + hostProjectRegistration: string + ) { return this.pathTemplates.hostProjectRegistrationPathTemplate.render({ project: project, location: location, @@ -1210,8 +1364,12 @@ export class LintingServiceClient { * A fully-qualified path representing HostProjectRegistration resource. * @returns {string} A string representing the project. */ - matchProjectFromHostProjectRegistrationName(hostProjectRegistrationName: string) { - return this.pathTemplates.hostProjectRegistrationPathTemplate.match(hostProjectRegistrationName).project; + matchProjectFromHostProjectRegistrationName( + hostProjectRegistrationName: string + ) { + return this.pathTemplates.hostProjectRegistrationPathTemplate.match( + hostProjectRegistrationName + ).project; } /** @@ -1221,8 +1379,12 @@ export class LintingServiceClient { * A fully-qualified path representing HostProjectRegistration resource. * @returns {string} A string representing the location. */ - matchLocationFromHostProjectRegistrationName(hostProjectRegistrationName: string) { - return this.pathTemplates.hostProjectRegistrationPathTemplate.match(hostProjectRegistrationName).location; + matchLocationFromHostProjectRegistrationName( + hostProjectRegistrationName: string + ) { + return this.pathTemplates.hostProjectRegistrationPathTemplate.match( + hostProjectRegistrationName + ).location; } /** @@ -1232,8 +1394,12 @@ export class LintingServiceClient { * A fully-qualified path representing HostProjectRegistration resource. * @returns {string} A string representing the host_project_registration. */ - matchHostProjectRegistrationFromHostProjectRegistrationName(hostProjectRegistrationName: string) { - return this.pathTemplates.hostProjectRegistrationPathTemplate.match(hostProjectRegistrationName).host_project_registration; + matchHostProjectRegistrationFromHostProjectRegistrationName( + hostProjectRegistrationName: string + ) { + return this.pathTemplates.hostProjectRegistrationPathTemplate.match( + hostProjectRegistrationName + ).host_project_registration; } /** @@ -1244,7 +1410,7 @@ export class LintingServiceClient { * @param {string} plugin * @returns {string} Resource name string. */ - pluginPath(project:string,location:string,plugin:string) { + pluginPath(project: string, location: string, plugin: string) { return this.pathTemplates.pluginPathTemplate.render({ project: project, location: location, @@ -1293,7 +1459,11 @@ export class LintingServiceClient { * @param {string} runtime_project_attachment * @returns {string} Resource name string. */ - runtimeProjectAttachmentPath(project:string,location:string,runtimeProjectAttachment:string) { + runtimeProjectAttachmentPath( + project: string, + location: string, + runtimeProjectAttachment: string + ) { return this.pathTemplates.runtimeProjectAttachmentPathTemplate.render({ project: project, location: location, @@ -1308,8 +1478,12 @@ export class LintingServiceClient { * A fully-qualified path representing RuntimeProjectAttachment resource. * @returns {string} A string representing the project. */ - matchProjectFromRuntimeProjectAttachmentName(runtimeProjectAttachmentName: string) { - return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match(runtimeProjectAttachmentName).project; + matchProjectFromRuntimeProjectAttachmentName( + runtimeProjectAttachmentName: string + ) { + return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match( + runtimeProjectAttachmentName + ).project; } /** @@ -1319,8 +1493,12 @@ export class LintingServiceClient { * A fully-qualified path representing RuntimeProjectAttachment resource. * @returns {string} A string representing the location. */ - matchLocationFromRuntimeProjectAttachmentName(runtimeProjectAttachmentName: string) { - return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match(runtimeProjectAttachmentName).location; + matchLocationFromRuntimeProjectAttachmentName( + runtimeProjectAttachmentName: string + ) { + return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match( + runtimeProjectAttachmentName + ).location; } /** @@ -1330,8 +1508,12 @@ export class LintingServiceClient { * A fully-qualified path representing RuntimeProjectAttachment resource. * @returns {string} A string representing the runtime_project_attachment. */ - matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName(runtimeProjectAttachmentName: string) { - return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match(runtimeProjectAttachmentName).runtime_project_attachment; + matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName( + runtimeProjectAttachmentName: string + ) { + return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match( + runtimeProjectAttachmentName + ).runtime_project_attachment; } /** @@ -1344,7 +1526,13 @@ export class LintingServiceClient { * @param {string} spec * @returns {string} Resource name string. */ - specPath(project:string,location:string,api:string,version:string,spec:string) { + specPath( + project: string, + location: string, + api: string, + version: string, + spec: string + ) { return this.pathTemplates.specPathTemplate.render({ project: project, location: location, @@ -1417,7 +1605,7 @@ export class LintingServiceClient { * @param {string} plugin * @returns {string} Resource name string. */ - styleGuidePath(project:string,location:string,plugin:string) { + styleGuidePath(project: string, location: string, plugin: string) { return this.pathTemplates.styleGuidePathTemplate.render({ project: project, location: location, @@ -1433,7 +1621,8 @@ export class LintingServiceClient { * @returns {string} A string representing the project. */ matchProjectFromStyleGuideName(styleGuideName: string) { - return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName).project; + return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName) + .project; } /** @@ -1444,7 +1633,8 @@ export class LintingServiceClient { * @returns {string} A string representing the location. */ matchLocationFromStyleGuideName(styleGuideName: string) { - return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName).location; + return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName) + .location; } /** @@ -1455,7 +1645,8 @@ export class LintingServiceClient { * @returns {string} A string representing the plugin. */ matchPluginFromStyleGuideName(styleGuideName: string) { - return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName).plugin; + return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName) + .plugin; } /** @@ -1467,7 +1658,7 @@ export class LintingServiceClient { * @param {string} version * @returns {string} Resource name string. */ - versionPath(project:string,location:string,api:string,version:string) { + versionPath(project: string, location: string, api: string, version: string) { return this.pathTemplates.versionPathTemplate.render({ project: project, location: location, diff --git a/owl-bot-staging/google-cloud-apihub/v1/src/v1/linting_service_client_config.json b/packages/google-cloud-apihub/src/v1/linting_service_client_config.json similarity index 100% rename from owl-bot-staging/google-cloud-apihub/v1/src/v1/linting_service_client_config.json rename to packages/google-cloud-apihub/src/v1/linting_service_client_config.json diff --git a/owl-bot-staging/google-cloud-apihub/v1/src/v1/linting_service_proto_list.json b/packages/google-cloud-apihub/src/v1/linting_service_proto_list.json similarity index 100% rename from owl-bot-staging/google-cloud-apihub/v1/src/v1/linting_service_proto_list.json rename to packages/google-cloud-apihub/src/v1/linting_service_proto_list.json diff --git a/owl-bot-staging/google-cloud-apihub/v1/src/v1/provisioning_client.ts b/packages/google-cloud-apihub/src/v1/provisioning_client.ts similarity index 73% rename from owl-bot-staging/google-cloud-apihub/v1/src/v1/provisioning_client.ts rename to packages/google-cloud-apihub/src/v1/provisioning_client.ts index 70fb4cf145f..3df543eb37d 100644 --- a/owl-bot-staging/google-cloud-apihub/v1/src/v1/provisioning_client.ts +++ b/packages/google-cloud-apihub/src/v1/provisioning_client.ts @@ -18,7 +18,16 @@ /* global window */ import type * as gax from 'google-gax'; -import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, LocationsClient, LocationProtos} from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, + GrpcClientOptions, + LROperation, + LocationsClient, + LocationProtos, +} from 'google-gax'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); @@ -99,20 +108,41 @@ export class ProvisioningClient { * const client = new ProvisioningClient({fallback: true}, gax); * ``` */ - constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { // Ensure that options include all the required fields. const staticMembers = this.constructor as typeof ProvisioningClient; - if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { - throw new Error('Please set either universe_domain or universeDomain, but not both.'); + if ( + opts?.universe_domain && + opts?.universeDomain && + opts?.universe_domain !== opts?.universeDomain + ) { + throw new Error( + 'Please set either universe_domain or universeDomain, but not both.' + ); } - const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; - this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; + this._universeDomain = + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; this._servicePath = 'apihub.' + this._universeDomain; - const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; - this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const servicePath = + opts?.servicePath || opts?.apiEndpoint || this._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'); + 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. @@ -138,7 +168,7 @@ export class ProvisioningClient { this._opts = opts; // Save the auth object to the client, for use by other methods. - this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; // Set useJWTAccessWithScope on the auth object. this.auth.useJWTAccessWithScope = true; @@ -154,13 +184,9 @@ export class ProvisioningClient { this._gaxGrpc, opts ); - // Determine the client header string. - const clientHeader = [ - `gax/${this._gaxModule.version}`, - `gapic/${version}`, - ]; + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; if (typeof process === 'object' && 'versions' in process) { clientHeader.push(`gl-node/${process.versions.node}`); } else { @@ -237,29 +263,63 @@ export class ProvisioningClient { // rather than holding a request open. const lroOptions: GrpcClientOptions = { auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined + 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.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',}]; + 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.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); + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); const createApiHubInstanceResponse = protoFilesRoot.lookup( - '.google.cloud.apihub.v1.ApiHubInstance') as gax.protobuf.Type; + '.google.cloud.apihub.v1.ApiHubInstance' + ) as gax.protobuf.Type; const createApiHubInstanceMetadata = protoFilesRoot.lookup( - '.google.cloud.apihub.v1.OperationMetadata') as gax.protobuf.Type; + '.google.cloud.apihub.v1.OperationMetadata' + ) as gax.protobuf.Type; this.descriptors.longrunning = { createApiHubInstance: new this._gaxModule.LongrunningDescriptor( this.operationsClient, createApiHubInstanceResponse.decode.bind(createApiHubInstanceResponse), - createApiHubInstanceMetadata.decode.bind(createApiHubInstanceMetadata)) + createApiHubInstanceMetadata.decode.bind(createApiHubInstanceMetadata) + ), }; // Put together the default options sent with requests. this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.apihub.v1.Provisioning', gapicConfig as gax.ClientConfig, - opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); + 'google.cloud.apihub.v1.Provisioning', + 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 @@ -290,32 +350,39 @@ export class ProvisioningClient { // Put together the "service stub" for // google.cloud.apihub.v1.Provisioning. this.provisioningStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.apihub.v1.Provisioning') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.apihub.v1.Provisioning' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.cloud.apihub.v1.Provisioning, - this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; + 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 provisioningStubMethods = - ['createApiHubInstance', 'getApiHubInstance', 'lookupApiHubInstance']; + const provisioningStubMethods = [ + 'createApiHubInstance', + 'getApiHubInstance', + 'lookupApiHubInstance', + ]; for (const methodName of provisioningStubMethods) { const callPromise = this.provisioningStub.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) => () => { + 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.longrunning[methodName] || - undefined; + const descriptor = this.descriptors.longrunning[methodName] || undefined; const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], @@ -335,8 +402,14 @@ export class ProvisioningClient { * @returns {string} The DNS address for this service. */ static get servicePath() { - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static servicePath is deprecated, please use the instance method instead.', + 'DeprecationWarning' + ); } return 'apihub.googleapis.com'; } @@ -347,8 +420,14 @@ export class ProvisioningClient { * @returns {string} The DNS address for this service. */ static get apiEndpoint() { - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static apiEndpoint is deprecated, please use the instance method instead.', + 'DeprecationWarning' + ); } return 'apihub.googleapis.com'; } @@ -379,9 +458,7 @@ export class ProvisioningClient { * @returns {string[]} List of default scopes. */ static get scopes() { - return [ - 'https://www.googleapis.com/auth/cloud-platform' - ]; + return ['https://www.googleapis.com/auth/cloud-platform']; } getProjectId(): Promise; @@ -390,8 +467,9 @@ export class ProvisioningClient { * 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 { + getProjectId( + callback?: Callback + ): Promise | void { if (callback) { this.auth.getProjectId(callback); return; @@ -402,253 +480,340 @@ export class ProvisioningClient { // ------------------- // -- Service calls -- // ------------------- -/** - * Gets details of a single API Hub instance. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the Api Hub instance to retrieve. - * Format: - * `projects/{project}/locations/{location}/apiHubInstances/{apiHubInstance}`. - * @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.apihub.v1.ApiHubInstance|ApiHubInstance}. - * 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/provisioning.get_api_hub_instance.js - * region_tag:apihub_v1_generated_Provisioning_GetApiHubInstance_async - */ + /** + * Gets details of a single API Hub instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the Api Hub instance to retrieve. + * Format: + * `projects/{project}/locations/{location}/apiHubInstances/{apiHubInstance}`. + * @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.apihub.v1.ApiHubInstance|ApiHubInstance}. + * 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/provisioning.get_api_hub_instance.js + * region_tag:apihub_v1_generated_Provisioning_GetApiHubInstance_async + */ getApiHubInstance( - request?: protos.google.cloud.apihub.v1.IGetApiHubInstanceRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apihub.v1.IApiHubInstance, - protos.google.cloud.apihub.v1.IGetApiHubInstanceRequest|undefined, {}|undefined - ]>; + request?: protos.google.cloud.apihub.v1.IGetApiHubInstanceRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apihub.v1.IApiHubInstance, + protos.google.cloud.apihub.v1.IGetApiHubInstanceRequest | undefined, + {} | undefined, + ] + >; getApiHubInstance( - request: protos.google.cloud.apihub.v1.IGetApiHubInstanceRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.apihub.v1.IApiHubInstance, - protos.google.cloud.apihub.v1.IGetApiHubInstanceRequest|null|undefined, - {}|null|undefined>): void; + request: protos.google.cloud.apihub.v1.IGetApiHubInstanceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.IApiHubInstance, + | protos.google.cloud.apihub.v1.IGetApiHubInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): void; getApiHubInstance( - request: protos.google.cloud.apihub.v1.IGetApiHubInstanceRequest, - callback: Callback< - protos.google.cloud.apihub.v1.IApiHubInstance, - protos.google.cloud.apihub.v1.IGetApiHubInstanceRequest|null|undefined, - {}|null|undefined>): void; + request: protos.google.cloud.apihub.v1.IGetApiHubInstanceRequest, + callback: Callback< + protos.google.cloud.apihub.v1.IApiHubInstance, + | protos.google.cloud.apihub.v1.IGetApiHubInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): void; getApiHubInstance( - request?: protos.google.cloud.apihub.v1.IGetApiHubInstanceRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.apihub.v1.IApiHubInstance, - protos.google.cloud.apihub.v1.IGetApiHubInstanceRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< + request?: protos.google.cloud.apihub.v1.IGetApiHubInstanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< protos.google.cloud.apihub.v1.IApiHubInstance, - protos.google.cloud.apihub.v1.IGetApiHubInstanceRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.apihub.v1.IApiHubInstance, - protos.google.cloud.apihub.v1.IGetApiHubInstanceRequest|undefined, {}|undefined - ]>|void { + | protos.google.cloud.apihub.v1.IGetApiHubInstanceRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.apihub.v1.IApiHubInstance, + | protos.google.cloud.apihub.v1.IGetApiHubInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.apihub.v1.IApiHubInstance, + protos.google.cloud.apihub.v1.IGetApiHubInstanceRequest | undefined, + {} | undefined, + ] + > | void { request = request || {}; let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } - else { + } 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 ?? '', - }); + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); this.initialize(); return this.innerApiCalls.getApiHubInstance(request, options, callback); } -/** - * Looks up an Api Hub instance in a given GCP project. There will always be - * only one Api Hub instance for a GCP project across all locations. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. There will always be only one Api Hub instance for a GCP project - * across all locations. - * The parent resource for the Api Hub instance resource. - * Format: `projects/{project}/locations/{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 protos.google.cloud.apihub.v1.LookupApiHubInstanceResponse|LookupApiHubInstanceResponse}. - * 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/provisioning.lookup_api_hub_instance.js - * region_tag:apihub_v1_generated_Provisioning_LookupApiHubInstance_async - */ + /** + * Looks up an Api Hub instance in a given GCP project. There will always be + * only one Api Hub instance for a GCP project across all locations. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. There will always be only one Api Hub instance for a GCP project + * across all locations. + * The parent resource for the Api Hub instance resource. + * Format: `projects/{project}/locations/{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 protos.google.cloud.apihub.v1.LookupApiHubInstanceResponse|LookupApiHubInstanceResponse}. + * 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/provisioning.lookup_api_hub_instance.js + * region_tag:apihub_v1_generated_Provisioning_LookupApiHubInstance_async + */ lookupApiHubInstance( - request?: protos.google.cloud.apihub.v1.ILookupApiHubInstanceRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apihub.v1.ILookupApiHubInstanceResponse, - protos.google.cloud.apihub.v1.ILookupApiHubInstanceRequest|undefined, {}|undefined - ]>; + request?: protos.google.cloud.apihub.v1.ILookupApiHubInstanceRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apihub.v1.ILookupApiHubInstanceResponse, + protos.google.cloud.apihub.v1.ILookupApiHubInstanceRequest | undefined, + {} | undefined, + ] + >; lookupApiHubInstance( - request: protos.google.cloud.apihub.v1.ILookupApiHubInstanceRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.apihub.v1.ILookupApiHubInstanceResponse, - protos.google.cloud.apihub.v1.ILookupApiHubInstanceRequest|null|undefined, - {}|null|undefined>): void; + request: protos.google.cloud.apihub.v1.ILookupApiHubInstanceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.ILookupApiHubInstanceResponse, + | protos.google.cloud.apihub.v1.ILookupApiHubInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): void; lookupApiHubInstance( - request: protos.google.cloud.apihub.v1.ILookupApiHubInstanceRequest, - callback: Callback< - protos.google.cloud.apihub.v1.ILookupApiHubInstanceResponse, - protos.google.cloud.apihub.v1.ILookupApiHubInstanceRequest|null|undefined, - {}|null|undefined>): void; + request: protos.google.cloud.apihub.v1.ILookupApiHubInstanceRequest, + callback: Callback< + protos.google.cloud.apihub.v1.ILookupApiHubInstanceResponse, + | protos.google.cloud.apihub.v1.ILookupApiHubInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): void; lookupApiHubInstance( - request?: protos.google.cloud.apihub.v1.ILookupApiHubInstanceRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.apihub.v1.ILookupApiHubInstanceResponse, - protos.google.cloud.apihub.v1.ILookupApiHubInstanceRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< + request?: protos.google.cloud.apihub.v1.ILookupApiHubInstanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< protos.google.cloud.apihub.v1.ILookupApiHubInstanceResponse, - protos.google.cloud.apihub.v1.ILookupApiHubInstanceRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.apihub.v1.ILookupApiHubInstanceResponse, - protos.google.cloud.apihub.v1.ILookupApiHubInstanceRequest|undefined, {}|undefined - ]>|void { + | protos.google.cloud.apihub.v1.ILookupApiHubInstanceRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.apihub.v1.ILookupApiHubInstanceResponse, + | protos.google.cloud.apihub.v1.ILookupApiHubInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.apihub.v1.ILookupApiHubInstanceResponse, + protos.google.cloud.apihub.v1.ILookupApiHubInstanceRequest | undefined, + {} | undefined, + ] + > | void { request = request || {}; let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } - else { + } 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 ?? '', - }); + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); this.initialize(); return this.innerApiCalls.lookupApiHubInstance(request, options, callback); } -/** - * Provisions instance resources for the API Hub. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource for the Api Hub instance resource. - * Format: `projects/{project}/locations/{location}` - * @param {string} [request.apiHubInstanceId] - * Optional. Identifier to assign to the Api Hub instance. Must be unique - * within scope of the parent resource. If the field is not provided, system - * generated id will be used. - * - * This value should be 4-40 characters, and valid characters - * are `/{@link protos.A-Z|a-z}[0-9]-_/`. - * @param {google.cloud.apihub.v1.ApiHubInstance} request.apiHubInstance - * Required. The ApiHub instance. - * @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/provisioning.create_api_hub_instance.js - * region_tag:apihub_v1_generated_Provisioning_CreateApiHubInstance_async - */ + /** + * Provisions instance resources for the API Hub. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource for the Api Hub instance resource. + * Format: `projects/{project}/locations/{location}` + * @param {string} [request.apiHubInstanceId] + * Optional. Identifier to assign to the Api Hub instance. Must be unique + * within scope of the parent resource. If the field is not provided, system + * generated id will be used. + * + * This value should be 4-40 characters, and valid characters + * are `/{@link protos.A-Z|a-z}[0-9]-_/`. + * @param {google.cloud.apihub.v1.ApiHubInstance} request.apiHubInstance + * Required. The ApiHub instance. + * @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/provisioning.create_api_hub_instance.js + * region_tag:apihub_v1_generated_Provisioning_CreateApiHubInstance_async + */ createApiHubInstance( - request?: protos.google.cloud.apihub.v1.ICreateApiHubInstanceRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; + request?: protos.google.cloud.apihub.v1.ICreateApiHubInstanceRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.apihub.v1.IApiHubInstance, + protos.google.cloud.apihub.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; createApiHubInstance( - request: protos.google.cloud.apihub.v1.ICreateApiHubInstanceRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; + request: protos.google.cloud.apihub.v1.ICreateApiHubInstanceRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.apihub.v1.IApiHubInstance, + protos.google.cloud.apihub.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; createApiHubInstance( - request: protos.google.cloud.apihub.v1.ICreateApiHubInstanceRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; + request: protos.google.cloud.apihub.v1.ICreateApiHubInstanceRequest, + callback: Callback< + LROperation< + protos.google.cloud.apihub.v1.IApiHubInstance, + protos.google.cloud.apihub.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; createApiHubInstance( - request?: protos.google.cloud.apihub.v1.ICreateApiHubInstanceRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { + request?: protos.google.cloud.apihub.v1.ICreateApiHubInstanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.apihub.v1.IApiHubInstance, + protos.google.cloud.apihub.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.apihub.v1.IApiHubInstance, + protos.google.cloud.apihub.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.apihub.v1.IApiHubInstance, + protos.google.cloud.apihub.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { request = request || {}; let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } - else { + } 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 ?? '', - }); + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); this.initialize(); return this.innerApiCalls.createApiHubInstance(request, options, callback); } -/** - * Check the status of the long running operation returned by `createApiHubInstance()`. - * @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/provisioning.create_api_hub_instance.js - * region_tag:apihub_v1_generated_Provisioning_CreateApiHubInstance_async - */ - async checkCreateApiHubInstanceProgress(name: string): Promise>{ - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + /** + * Check the status of the long running operation returned by `createApiHubInstance()`. + * @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/provisioning.create_api_hub_instance.js + * region_tag:apihub_v1_generated_Provisioning_CreateApiHubInstance_async + */ + async checkCreateApiHubInstanceProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.apihub.v1.ApiHubInstance, + protos.google.cloud.apihub.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.createApiHubInstance, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.createApiHubInstance, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.apihub.v1.ApiHubInstance, + protos.google.cloud.apihub.v1.OperationMetadata + >; } -/** + /** * Gets information about a location. * * @param {Object} request @@ -688,7 +853,7 @@ export class ProvisioningClient { 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. @@ -726,7 +891,7 @@ export class ProvisioningClient { 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. @@ -840,7 +1005,7 @@ export class ProvisioningClient { * await client.cancelOperation({name: ''}); * ``` */ - cancelOperation( + cancelOperation( request: protos.google.longrunning.CancelOperationRequest, options?: | gax.CallOptions @@ -913,7 +1078,7 @@ export class ProvisioningClient { * @param {string} api * @returns {string} Resource name string. */ - apiPath(project:string,location:string,api:string) { + apiPath(project: string, location: string, api: string) { return this.pathTemplates.apiPathTemplate.render({ project: project, location: location, @@ -962,7 +1127,11 @@ export class ProvisioningClient { * @param {string} api_hub_instance * @returns {string} Resource name string. */ - apiHubInstancePath(project:string,location:string,apiHubInstance:string) { + apiHubInstancePath( + project: string, + location: string, + apiHubInstance: string + ) { return this.pathTemplates.apiHubInstancePathTemplate.render({ project: project, location: location, @@ -978,7 +1147,9 @@ export class ProvisioningClient { * @returns {string} A string representing the project. */ matchProjectFromApiHubInstanceName(apiHubInstanceName: string) { - return this.pathTemplates.apiHubInstancePathTemplate.match(apiHubInstanceName).project; + return this.pathTemplates.apiHubInstancePathTemplate.match( + apiHubInstanceName + ).project; } /** @@ -989,7 +1160,9 @@ export class ProvisioningClient { * @returns {string} A string representing the location. */ matchLocationFromApiHubInstanceName(apiHubInstanceName: string) { - return this.pathTemplates.apiHubInstancePathTemplate.match(apiHubInstanceName).location; + return this.pathTemplates.apiHubInstancePathTemplate.match( + apiHubInstanceName + ).location; } /** @@ -1000,7 +1173,9 @@ export class ProvisioningClient { * @returns {string} A string representing the api_hub_instance. */ matchApiHubInstanceFromApiHubInstanceName(apiHubInstanceName: string) { - return this.pathTemplates.apiHubInstancePathTemplate.match(apiHubInstanceName).api_hub_instance; + return this.pathTemplates.apiHubInstancePathTemplate.match( + apiHubInstanceName + ).api_hub_instance; } /** @@ -1013,7 +1188,13 @@ export class ProvisioningClient { * @param {string} operation * @returns {string} Resource name string. */ - apiOperationPath(project:string,location:string,api:string,version:string,operation:string) { + apiOperationPath( + project: string, + location: string, + api: string, + version: string, + operation: string + ) { return this.pathTemplates.apiOperationPathTemplate.render({ project: project, location: location, @@ -1031,7 +1212,8 @@ export class ProvisioningClient { * @returns {string} A string representing the project. */ matchProjectFromApiOperationName(apiOperationName: string) { - return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).project; + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName) + .project; } /** @@ -1042,7 +1224,8 @@ export class ProvisioningClient { * @returns {string} A string representing the location. */ matchLocationFromApiOperationName(apiOperationName: string) { - return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).location; + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName) + .location; } /** @@ -1053,7 +1236,8 @@ export class ProvisioningClient { * @returns {string} A string representing the api. */ matchApiFromApiOperationName(apiOperationName: string) { - return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).api; + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName) + .api; } /** @@ -1064,7 +1248,8 @@ export class ProvisioningClient { * @returns {string} A string representing the version. */ matchVersionFromApiOperationName(apiOperationName: string) { - return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).version; + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName) + .version; } /** @@ -1075,7 +1260,8 @@ export class ProvisioningClient { * @returns {string} A string representing the operation. */ matchOperationFromApiOperationName(apiOperationName: string) { - return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).operation; + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName) + .operation; } /** @@ -1086,7 +1272,7 @@ export class ProvisioningClient { * @param {string} attribute * @returns {string} Resource name string. */ - attributePath(project:string,location:string,attribute:string) { + attributePath(project: string, location: string, attribute: string) { return this.pathTemplates.attributePathTemplate.render({ project: project, location: location, @@ -1102,7 +1288,8 @@ export class ProvisioningClient { * @returns {string} A string representing the project. */ matchProjectFromAttributeName(attributeName: string) { - return this.pathTemplates.attributePathTemplate.match(attributeName).project; + return this.pathTemplates.attributePathTemplate.match(attributeName) + .project; } /** @@ -1113,7 +1300,8 @@ export class ProvisioningClient { * @returns {string} A string representing the location. */ matchLocationFromAttributeName(attributeName: string) { - return this.pathTemplates.attributePathTemplate.match(attributeName).location; + return this.pathTemplates.attributePathTemplate.match(attributeName) + .location; } /** @@ -1124,7 +1312,8 @@ export class ProvisioningClient { * @returns {string} A string representing the attribute. */ matchAttributeFromAttributeName(attributeName: string) { - return this.pathTemplates.attributePathTemplate.match(attributeName).attribute; + return this.pathTemplates.attributePathTemplate.match(attributeName) + .attribute; } /** @@ -1137,7 +1326,13 @@ export class ProvisioningClient { * @param {string} definition * @returns {string} Resource name string. */ - definitionPath(project:string,location:string,api:string,version:string,definition:string) { + definitionPath( + project: string, + location: string, + api: string, + version: string, + definition: string + ) { return this.pathTemplates.definitionPathTemplate.render({ project: project, location: location, @@ -1155,7 +1350,8 @@ export class ProvisioningClient { * @returns {string} A string representing the project. */ matchProjectFromDefinitionName(definitionName: string) { - return this.pathTemplates.definitionPathTemplate.match(definitionName).project; + return this.pathTemplates.definitionPathTemplate.match(definitionName) + .project; } /** @@ -1166,7 +1362,8 @@ export class ProvisioningClient { * @returns {string} A string representing the location. */ matchLocationFromDefinitionName(definitionName: string) { - return this.pathTemplates.definitionPathTemplate.match(definitionName).location; + return this.pathTemplates.definitionPathTemplate.match(definitionName) + .location; } /** @@ -1188,7 +1385,8 @@ export class ProvisioningClient { * @returns {string} A string representing the version. */ matchVersionFromDefinitionName(definitionName: string) { - return this.pathTemplates.definitionPathTemplate.match(definitionName).version; + return this.pathTemplates.definitionPathTemplate.match(definitionName) + .version; } /** @@ -1199,7 +1397,8 @@ export class ProvisioningClient { * @returns {string} A string representing the definition. */ matchDefinitionFromDefinitionName(definitionName: string) { - return this.pathTemplates.definitionPathTemplate.match(definitionName).definition; + return this.pathTemplates.definitionPathTemplate.match(definitionName) + .definition; } /** @@ -1210,7 +1409,7 @@ export class ProvisioningClient { * @param {string} dependency * @returns {string} Resource name string. */ - dependencyPath(project:string,location:string,dependency:string) { + dependencyPath(project: string, location: string, dependency: string) { return this.pathTemplates.dependencyPathTemplate.render({ project: project, location: location, @@ -1226,7 +1425,8 @@ export class ProvisioningClient { * @returns {string} A string representing the project. */ matchProjectFromDependencyName(dependencyName: string) { - return this.pathTemplates.dependencyPathTemplate.match(dependencyName).project; + return this.pathTemplates.dependencyPathTemplate.match(dependencyName) + .project; } /** @@ -1237,7 +1437,8 @@ export class ProvisioningClient { * @returns {string} A string representing the location. */ matchLocationFromDependencyName(dependencyName: string) { - return this.pathTemplates.dependencyPathTemplate.match(dependencyName).location; + return this.pathTemplates.dependencyPathTemplate.match(dependencyName) + .location; } /** @@ -1248,7 +1449,8 @@ export class ProvisioningClient { * @returns {string} A string representing the dependency. */ matchDependencyFromDependencyName(dependencyName: string) { - return this.pathTemplates.dependencyPathTemplate.match(dependencyName).dependency; + return this.pathTemplates.dependencyPathTemplate.match(dependencyName) + .dependency; } /** @@ -1259,7 +1461,7 @@ export class ProvisioningClient { * @param {string} deployment * @returns {string} Resource name string. */ - deploymentPath(project:string,location:string,deployment:string) { + deploymentPath(project: string, location: string, deployment: string) { return this.pathTemplates.deploymentPathTemplate.render({ project: project, location: location, @@ -1275,7 +1477,8 @@ export class ProvisioningClient { * @returns {string} A string representing the project. */ matchProjectFromDeploymentName(deploymentName: string) { - return this.pathTemplates.deploymentPathTemplate.match(deploymentName).project; + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .project; } /** @@ -1286,7 +1489,8 @@ export class ProvisioningClient { * @returns {string} A string representing the location. */ matchLocationFromDeploymentName(deploymentName: string) { - return this.pathTemplates.deploymentPathTemplate.match(deploymentName).location; + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .location; } /** @@ -1297,7 +1501,8 @@ export class ProvisioningClient { * @returns {string} A string representing the deployment. */ matchDeploymentFromDeploymentName(deploymentName: string) { - return this.pathTemplates.deploymentPathTemplate.match(deploymentName).deployment; + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .deployment; } /** @@ -1308,7 +1513,7 @@ export class ProvisioningClient { * @param {string} external_api * @returns {string} Resource name string. */ - externalApiPath(project:string,location:string,externalApi:string) { + externalApiPath(project: string, location: string, externalApi: string) { return this.pathTemplates.externalApiPathTemplate.render({ project: project, location: location, @@ -1324,7 +1529,8 @@ export class ProvisioningClient { * @returns {string} A string representing the project. */ matchProjectFromExternalApiName(externalApiName: string) { - return this.pathTemplates.externalApiPathTemplate.match(externalApiName).project; + return this.pathTemplates.externalApiPathTemplate.match(externalApiName) + .project; } /** @@ -1335,7 +1541,8 @@ export class ProvisioningClient { * @returns {string} A string representing the location. */ matchLocationFromExternalApiName(externalApiName: string) { - return this.pathTemplates.externalApiPathTemplate.match(externalApiName).location; + return this.pathTemplates.externalApiPathTemplate.match(externalApiName) + .location; } /** @@ -1346,7 +1553,8 @@ export class ProvisioningClient { * @returns {string} A string representing the external_api. */ matchExternalApiFromExternalApiName(externalApiName: string) { - return this.pathTemplates.externalApiPathTemplate.match(externalApiName).external_api; + return this.pathTemplates.externalApiPathTemplate.match(externalApiName) + .external_api; } /** @@ -1357,7 +1565,11 @@ export class ProvisioningClient { * @param {string} host_project_registration * @returns {string} Resource name string. */ - hostProjectRegistrationPath(project:string,location:string,hostProjectRegistration:string) { + hostProjectRegistrationPath( + project: string, + location: string, + hostProjectRegistration: string + ) { return this.pathTemplates.hostProjectRegistrationPathTemplate.render({ project: project, location: location, @@ -1372,8 +1584,12 @@ export class ProvisioningClient { * A fully-qualified path representing HostProjectRegistration resource. * @returns {string} A string representing the project. */ - matchProjectFromHostProjectRegistrationName(hostProjectRegistrationName: string) { - return this.pathTemplates.hostProjectRegistrationPathTemplate.match(hostProjectRegistrationName).project; + matchProjectFromHostProjectRegistrationName( + hostProjectRegistrationName: string + ) { + return this.pathTemplates.hostProjectRegistrationPathTemplate.match( + hostProjectRegistrationName + ).project; } /** @@ -1383,8 +1599,12 @@ export class ProvisioningClient { * A fully-qualified path representing HostProjectRegistration resource. * @returns {string} A string representing the location. */ - matchLocationFromHostProjectRegistrationName(hostProjectRegistrationName: string) { - return this.pathTemplates.hostProjectRegistrationPathTemplate.match(hostProjectRegistrationName).location; + matchLocationFromHostProjectRegistrationName( + hostProjectRegistrationName: string + ) { + return this.pathTemplates.hostProjectRegistrationPathTemplate.match( + hostProjectRegistrationName + ).location; } /** @@ -1394,8 +1614,12 @@ export class ProvisioningClient { * A fully-qualified path representing HostProjectRegistration resource. * @returns {string} A string representing the host_project_registration. */ - matchHostProjectRegistrationFromHostProjectRegistrationName(hostProjectRegistrationName: string) { - return this.pathTemplates.hostProjectRegistrationPathTemplate.match(hostProjectRegistrationName).host_project_registration; + matchHostProjectRegistrationFromHostProjectRegistrationName( + hostProjectRegistrationName: string + ) { + return this.pathTemplates.hostProjectRegistrationPathTemplate.match( + hostProjectRegistrationName + ).host_project_registration; } /** @@ -1405,7 +1629,7 @@ export class ProvisioningClient { * @param {string} location * @returns {string} Resource name string. */ - locationPath(project:string,location:string) { + locationPath(project: string, location: string) { return this.pathTemplates.locationPathTemplate.render({ project: project, location: location, @@ -1442,7 +1666,7 @@ export class ProvisioningClient { * @param {string} plugin * @returns {string} Resource name string. */ - pluginPath(project:string,location:string,plugin:string) { + pluginPath(project: string, location: string, plugin: string) { return this.pathTemplates.pluginPathTemplate.render({ project: project, location: location, @@ -1489,7 +1713,7 @@ export class ProvisioningClient { * @param {string} project * @returns {string} Resource name string. */ - projectPath(project:string) { + projectPath(project: string) { return this.pathTemplates.projectPathTemplate.render({ project: project, }); @@ -1514,7 +1738,11 @@ export class ProvisioningClient { * @param {string} runtime_project_attachment * @returns {string} Resource name string. */ - runtimeProjectAttachmentPath(project:string,location:string,runtimeProjectAttachment:string) { + runtimeProjectAttachmentPath( + project: string, + location: string, + runtimeProjectAttachment: string + ) { return this.pathTemplates.runtimeProjectAttachmentPathTemplate.render({ project: project, location: location, @@ -1529,8 +1757,12 @@ export class ProvisioningClient { * A fully-qualified path representing RuntimeProjectAttachment resource. * @returns {string} A string representing the project. */ - matchProjectFromRuntimeProjectAttachmentName(runtimeProjectAttachmentName: string) { - return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match(runtimeProjectAttachmentName).project; + matchProjectFromRuntimeProjectAttachmentName( + runtimeProjectAttachmentName: string + ) { + return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match( + runtimeProjectAttachmentName + ).project; } /** @@ -1540,8 +1772,12 @@ export class ProvisioningClient { * A fully-qualified path representing RuntimeProjectAttachment resource. * @returns {string} A string representing the location. */ - matchLocationFromRuntimeProjectAttachmentName(runtimeProjectAttachmentName: string) { - return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match(runtimeProjectAttachmentName).location; + matchLocationFromRuntimeProjectAttachmentName( + runtimeProjectAttachmentName: string + ) { + return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match( + runtimeProjectAttachmentName + ).location; } /** @@ -1551,8 +1787,12 @@ export class ProvisioningClient { * A fully-qualified path representing RuntimeProjectAttachment resource. * @returns {string} A string representing the runtime_project_attachment. */ - matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName(runtimeProjectAttachmentName: string) { - return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match(runtimeProjectAttachmentName).runtime_project_attachment; + matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName( + runtimeProjectAttachmentName: string + ) { + return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match( + runtimeProjectAttachmentName + ).runtime_project_attachment; } /** @@ -1565,7 +1805,13 @@ export class ProvisioningClient { * @param {string} spec * @returns {string} Resource name string. */ - specPath(project:string,location:string,api:string,version:string,spec:string) { + specPath( + project: string, + location: string, + api: string, + version: string, + spec: string + ) { return this.pathTemplates.specPathTemplate.render({ project: project, location: location, @@ -1638,7 +1884,7 @@ export class ProvisioningClient { * @param {string} plugin * @returns {string} Resource name string. */ - styleGuidePath(project:string,location:string,plugin:string) { + styleGuidePath(project: string, location: string, plugin: string) { return this.pathTemplates.styleGuidePathTemplate.render({ project: project, location: location, @@ -1654,7 +1900,8 @@ export class ProvisioningClient { * @returns {string} A string representing the project. */ matchProjectFromStyleGuideName(styleGuideName: string) { - return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName).project; + return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName) + .project; } /** @@ -1665,7 +1912,8 @@ export class ProvisioningClient { * @returns {string} A string representing the location. */ matchLocationFromStyleGuideName(styleGuideName: string) { - return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName).location; + return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName) + .location; } /** @@ -1676,7 +1924,8 @@ export class ProvisioningClient { * @returns {string} A string representing the plugin. */ matchPluginFromStyleGuideName(styleGuideName: string) { - return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName).plugin; + return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName) + .plugin; } /** @@ -1688,7 +1937,7 @@ export class ProvisioningClient { * @param {string} version * @returns {string} Resource name string. */ - versionPath(project:string,location:string,api:string,version:string) { + versionPath(project: string, location: string, api: string, version: string) { return this.pathTemplates.versionPathTemplate.render({ project: project, location: location, diff --git a/owl-bot-staging/google-cloud-apihub/v1/src/v1/provisioning_client_config.json b/packages/google-cloud-apihub/src/v1/provisioning_client_config.json similarity index 100% rename from owl-bot-staging/google-cloud-apihub/v1/src/v1/provisioning_client_config.json rename to packages/google-cloud-apihub/src/v1/provisioning_client_config.json diff --git a/owl-bot-staging/google-cloud-apihub/v1/src/v1/provisioning_proto_list.json b/packages/google-cloud-apihub/src/v1/provisioning_proto_list.json similarity index 100% rename from owl-bot-staging/google-cloud-apihub/v1/src/v1/provisioning_proto_list.json rename to packages/google-cloud-apihub/src/v1/provisioning_proto_list.json diff --git a/owl-bot-staging/google-cloud-apihub/v1/src/v1/runtime_project_attachment_service_client.ts b/packages/google-cloud-apihub/src/v1/runtime_project_attachment_service_client.ts similarity index 59% rename from owl-bot-staging/google-cloud-apihub/v1/src/v1/runtime_project_attachment_service_client.ts rename to packages/google-cloud-apihub/src/v1/runtime_project_attachment_service_client.ts index 7e322743733..c69ef2da2c5 100644 --- a/owl-bot-staging/google-cloud-apihub/v1/src/v1/runtime_project_attachment_service_client.ts +++ b/packages/google-cloud-apihub/src/v1/runtime_project_attachment_service_client.ts @@ -18,7 +18,16 @@ /* global window */ import type * as gax from 'google-gax'; -import type {Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback, GaxCall, LocationsClient, LocationProtos} from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, + PaginationCallback, + GaxCall, + LocationsClient, + LocationProtos, +} from 'google-gax'; import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); @@ -98,20 +107,42 @@ export class RuntimeProjectAttachmentServiceClient { * const client = new RuntimeProjectAttachmentServiceClient({fallback: true}, gax); * ``` */ - constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { // Ensure that options include all the required fields. - const staticMembers = this.constructor as typeof RuntimeProjectAttachmentServiceClient; - if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { - throw new Error('Please set either universe_domain or universeDomain, but not both.'); + const staticMembers = this + .constructor as typeof RuntimeProjectAttachmentServiceClient; + if ( + opts?.universe_domain && + opts?.universeDomain && + opts?.universe_domain !== opts?.universeDomain + ) { + throw new Error( + 'Please set either universe_domain or universeDomain, but not both.' + ); } - const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; - this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; + this._universeDomain = + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; this._servicePath = 'apihub.' + this._universeDomain; - const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; - this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const servicePath = + opts?.servicePath || opts?.apiEndpoint || this._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'); + 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. @@ -137,7 +168,7 @@ export class RuntimeProjectAttachmentServiceClient { this._opts = opts; // Save the auth object to the client, for use by other methods. - this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; // Set useJWTAccessWithScope on the auth object. this.auth.useJWTAccessWithScope = true; @@ -153,13 +184,9 @@ export class RuntimeProjectAttachmentServiceClient { this._gaxGrpc, opts ); - // Determine the client header string. - const clientHeader = [ - `gax/${this._gaxModule.version}`, - `gapic/${version}`, - ]; + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; if (typeof process === 'object' && 'versions' in process) { clientHeader.push(`gl-node/${process.versions.node}`); } else { @@ -234,14 +261,20 @@ export class RuntimeProjectAttachmentServiceClient { // (e.g. 50 results at a time, with tokens to get subsequent // pages). Denote the keys used for pagination and results. this.descriptors.page = { - listRuntimeProjectAttachments: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'runtimeProjectAttachments') + listRuntimeProjectAttachments: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'runtimeProjectAttachments' + ), }; // Put together the default options sent with requests. this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.apihub.v1.RuntimeProjectAttachmentService', gapicConfig as gax.ClientConfig, - opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); + 'google.cloud.apihub.v1.RuntimeProjectAttachmentService', + 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 @@ -272,32 +305,42 @@ export class RuntimeProjectAttachmentServiceClient { // Put together the "service stub" for // google.cloud.apihub.v1.RuntimeProjectAttachmentService. this.runtimeProjectAttachmentServiceStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.apihub.v1.RuntimeProjectAttachmentService') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.apihub.v1.RuntimeProjectAttachmentService, - this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.apihub.v1.RuntimeProjectAttachmentService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.apihub.v1 + .RuntimeProjectAttachmentService, + 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 runtimeProjectAttachmentServiceStubMethods = - ['createRuntimeProjectAttachment', 'getRuntimeProjectAttachment', 'listRuntimeProjectAttachments', 'deleteRuntimeProjectAttachment', 'lookupRuntimeProjectAttachment']; + const runtimeProjectAttachmentServiceStubMethods = [ + 'createRuntimeProjectAttachment', + 'getRuntimeProjectAttachment', + 'listRuntimeProjectAttachments', + 'deleteRuntimeProjectAttachment', + 'lookupRuntimeProjectAttachment', + ]; for (const methodName of runtimeProjectAttachmentServiceStubMethods) { const callPromise = this.runtimeProjectAttachmentServiceStub.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) => () => { + stub => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { throw err; - }); + } + ); - const descriptor = - this.descriptors.page[methodName] || - undefined; + const descriptor = this.descriptors.page[methodName] || undefined; const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], @@ -317,8 +360,14 @@ export class RuntimeProjectAttachmentServiceClient { * @returns {string} The DNS address for this service. */ static get servicePath() { - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static servicePath is deprecated, please use the instance method instead.', + 'DeprecationWarning' + ); } return 'apihub.googleapis.com'; } @@ -329,8 +378,14 @@ export class RuntimeProjectAttachmentServiceClient { * @returns {string} The DNS address for this service. */ static get apiEndpoint() { - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static apiEndpoint is deprecated, please use the instance method instead.', + 'DeprecationWarning' + ); } return 'apihub.googleapis.com'; } @@ -361,9 +416,7 @@ export class RuntimeProjectAttachmentServiceClient { * @returns {string[]} List of default scopes. */ static get scopes() { - return [ - 'https://www.googleapis.com/auth/cloud-platform' - ]; + return ['https://www.googleapis.com/auth/cloud-platform']; } getProjectId(): Promise; @@ -372,8 +425,9 @@ export class RuntimeProjectAttachmentServiceClient { * 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 { + getProjectId( + callback?: Callback + ): Promise | void { if (callback) { this.auth.getProjectId(callback); return; @@ -384,475 +438,616 @@ export class RuntimeProjectAttachmentServiceClient { // ------------------- // -- Service calls -- // ------------------- -/** - * Attaches a runtime project to the host project. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource for the Runtime Project Attachment. - * Format: `projects/{project}/locations/{location}` - * @param {string} request.runtimeProjectAttachmentId - * Required. The ID to use for the Runtime Project Attachment, which will - * become the final component of the Runtime Project Attachment's name. The ID - * must be the same as the project ID of the Google cloud project specified in - * the runtime_project_attachment.runtime_project field. - * @param {google.cloud.apihub.v1.RuntimeProjectAttachment} request.runtimeProjectAttachment - * Required. The Runtime Project Attachment to create. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.apihub.v1.RuntimeProjectAttachment|RuntimeProjectAttachment}. - * 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/runtime_project_attachment_service.create_runtime_project_attachment.js - * region_tag:apihub_v1_generated_RuntimeProjectAttachmentService_CreateRuntimeProjectAttachment_async - */ + /** + * Attaches a runtime project to the host project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource for the Runtime Project Attachment. + * Format: `projects/{project}/locations/{location}` + * @param {string} request.runtimeProjectAttachmentId + * Required. The ID to use for the Runtime Project Attachment, which will + * become the final component of the Runtime Project Attachment's name. The ID + * must be the same as the project ID of the Google cloud project specified in + * the runtime_project_attachment.runtime_project field. + * @param {google.cloud.apihub.v1.RuntimeProjectAttachment} request.runtimeProjectAttachment + * Required. The Runtime Project Attachment to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.apihub.v1.RuntimeProjectAttachment|RuntimeProjectAttachment}. + * 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/runtime_project_attachment_service.create_runtime_project_attachment.js + * region_tag:apihub_v1_generated_RuntimeProjectAttachmentService_CreateRuntimeProjectAttachment_async + */ createRuntimeProjectAttachment( - request?: protos.google.cloud.apihub.v1.ICreateRuntimeProjectAttachmentRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apihub.v1.IRuntimeProjectAttachment, - protos.google.cloud.apihub.v1.ICreateRuntimeProjectAttachmentRequest|undefined, {}|undefined - ]>; + request?: protos.google.cloud.apihub.v1.ICreateRuntimeProjectAttachmentRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apihub.v1.IRuntimeProjectAttachment, + ( + | protos.google.cloud.apihub.v1.ICreateRuntimeProjectAttachmentRequest + | undefined + ), + {} | undefined, + ] + >; createRuntimeProjectAttachment( - request: protos.google.cloud.apihub.v1.ICreateRuntimeProjectAttachmentRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.apihub.v1.IRuntimeProjectAttachment, - protos.google.cloud.apihub.v1.ICreateRuntimeProjectAttachmentRequest|null|undefined, - {}|null|undefined>): void; + request: protos.google.cloud.apihub.v1.ICreateRuntimeProjectAttachmentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.IRuntimeProjectAttachment, + | protos.google.cloud.apihub.v1.ICreateRuntimeProjectAttachmentRequest + | null + | undefined, + {} | null | undefined + > + ): void; createRuntimeProjectAttachment( - request: protos.google.cloud.apihub.v1.ICreateRuntimeProjectAttachmentRequest, - callback: Callback< - protos.google.cloud.apihub.v1.IRuntimeProjectAttachment, - protos.google.cloud.apihub.v1.ICreateRuntimeProjectAttachmentRequest|null|undefined, - {}|null|undefined>): void; + request: protos.google.cloud.apihub.v1.ICreateRuntimeProjectAttachmentRequest, + callback: Callback< + protos.google.cloud.apihub.v1.IRuntimeProjectAttachment, + | protos.google.cloud.apihub.v1.ICreateRuntimeProjectAttachmentRequest + | null + | undefined, + {} | null | undefined + > + ): void; createRuntimeProjectAttachment( - request?: protos.google.cloud.apihub.v1.ICreateRuntimeProjectAttachmentRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.apihub.v1.IRuntimeProjectAttachment, - protos.google.cloud.apihub.v1.ICreateRuntimeProjectAttachmentRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< + request?: protos.google.cloud.apihub.v1.ICreateRuntimeProjectAttachmentRequest, + optionsOrCallback?: + | CallOptions + | Callback< protos.google.cloud.apihub.v1.IRuntimeProjectAttachment, - protos.google.cloud.apihub.v1.ICreateRuntimeProjectAttachmentRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.apihub.v1.IRuntimeProjectAttachment, - protos.google.cloud.apihub.v1.ICreateRuntimeProjectAttachmentRequest|undefined, {}|undefined - ]>|void { + | protos.google.cloud.apihub.v1.ICreateRuntimeProjectAttachmentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.apihub.v1.IRuntimeProjectAttachment, + | protos.google.cloud.apihub.v1.ICreateRuntimeProjectAttachmentRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.apihub.v1.IRuntimeProjectAttachment, + ( + | protos.google.cloud.apihub.v1.ICreateRuntimeProjectAttachmentRequest + | undefined + ), + {} | undefined, + ] + > | void { request = request || {}; let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } - else { + } 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 ?? '', - }); + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); this.initialize(); - return this.innerApiCalls.createRuntimeProjectAttachment(request, options, callback); + return this.innerApiCalls.createRuntimeProjectAttachment( + request, + options, + callback + ); } -/** - * Gets a runtime project attachment. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the API resource to retrieve. - * Format: - * `projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}` - * @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.apihub.v1.RuntimeProjectAttachment|RuntimeProjectAttachment}. - * 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/runtime_project_attachment_service.get_runtime_project_attachment.js - * region_tag:apihub_v1_generated_RuntimeProjectAttachmentService_GetRuntimeProjectAttachment_async - */ + /** + * Gets a runtime project attachment. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the API resource to retrieve. + * Format: + * `projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}` + * @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.apihub.v1.RuntimeProjectAttachment|RuntimeProjectAttachment}. + * 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/runtime_project_attachment_service.get_runtime_project_attachment.js + * region_tag:apihub_v1_generated_RuntimeProjectAttachmentService_GetRuntimeProjectAttachment_async + */ getRuntimeProjectAttachment( - request?: protos.google.cloud.apihub.v1.IGetRuntimeProjectAttachmentRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apihub.v1.IRuntimeProjectAttachment, - protos.google.cloud.apihub.v1.IGetRuntimeProjectAttachmentRequest|undefined, {}|undefined - ]>; + request?: protos.google.cloud.apihub.v1.IGetRuntimeProjectAttachmentRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apihub.v1.IRuntimeProjectAttachment, + ( + | protos.google.cloud.apihub.v1.IGetRuntimeProjectAttachmentRequest + | undefined + ), + {} | undefined, + ] + >; getRuntimeProjectAttachment( - request: protos.google.cloud.apihub.v1.IGetRuntimeProjectAttachmentRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.apihub.v1.IRuntimeProjectAttachment, - protos.google.cloud.apihub.v1.IGetRuntimeProjectAttachmentRequest|null|undefined, - {}|null|undefined>): void; + request: protos.google.cloud.apihub.v1.IGetRuntimeProjectAttachmentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.IRuntimeProjectAttachment, + | protos.google.cloud.apihub.v1.IGetRuntimeProjectAttachmentRequest + | null + | undefined, + {} | null | undefined + > + ): void; getRuntimeProjectAttachment( - request: protos.google.cloud.apihub.v1.IGetRuntimeProjectAttachmentRequest, - callback: Callback< - protos.google.cloud.apihub.v1.IRuntimeProjectAttachment, - protos.google.cloud.apihub.v1.IGetRuntimeProjectAttachmentRequest|null|undefined, - {}|null|undefined>): void; + request: protos.google.cloud.apihub.v1.IGetRuntimeProjectAttachmentRequest, + callback: Callback< + protos.google.cloud.apihub.v1.IRuntimeProjectAttachment, + | protos.google.cloud.apihub.v1.IGetRuntimeProjectAttachmentRequest + | null + | undefined, + {} | null | undefined + > + ): void; getRuntimeProjectAttachment( - request?: protos.google.cloud.apihub.v1.IGetRuntimeProjectAttachmentRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.apihub.v1.IRuntimeProjectAttachment, - protos.google.cloud.apihub.v1.IGetRuntimeProjectAttachmentRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< + request?: protos.google.cloud.apihub.v1.IGetRuntimeProjectAttachmentRequest, + optionsOrCallback?: + | CallOptions + | Callback< protos.google.cloud.apihub.v1.IRuntimeProjectAttachment, - protos.google.cloud.apihub.v1.IGetRuntimeProjectAttachmentRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.apihub.v1.IRuntimeProjectAttachment, - protos.google.cloud.apihub.v1.IGetRuntimeProjectAttachmentRequest|undefined, {}|undefined - ]>|void { + | protos.google.cloud.apihub.v1.IGetRuntimeProjectAttachmentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.apihub.v1.IRuntimeProjectAttachment, + | protos.google.cloud.apihub.v1.IGetRuntimeProjectAttachmentRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.apihub.v1.IRuntimeProjectAttachment, + ( + | protos.google.cloud.apihub.v1.IGetRuntimeProjectAttachmentRequest + | undefined + ), + {} | undefined, + ] + > | void { request = request || {}; let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } - else { + } 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 ?? '', - }); + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); this.initialize(); - return this.innerApiCalls.getRuntimeProjectAttachment(request, options, callback); + return this.innerApiCalls.getRuntimeProjectAttachment( + request, + options, + callback + ); } -/** - * Delete a runtime project attachment in the API Hub. This call will detach - * the runtime project from the host project. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the Runtime Project Attachment to delete. - * Format: - * `projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}` - * @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.protobuf.Empty|Empty}. - * 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/runtime_project_attachment_service.delete_runtime_project_attachment.js - * region_tag:apihub_v1_generated_RuntimeProjectAttachmentService_DeleteRuntimeProjectAttachment_async - */ + /** + * Delete a runtime project attachment in the API Hub. This call will detach + * the runtime project from the host project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the Runtime Project Attachment to delete. + * Format: + * `projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}` + * @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.protobuf.Empty|Empty}. + * 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/runtime_project_attachment_service.delete_runtime_project_attachment.js + * region_tag:apihub_v1_generated_RuntimeProjectAttachmentService_DeleteRuntimeProjectAttachment_async + */ deleteRuntimeProjectAttachment( - request?: protos.google.cloud.apihub.v1.IDeleteRuntimeProjectAttachmentRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.IDeleteRuntimeProjectAttachmentRequest|undefined, {}|undefined - ]>; + request?: protos.google.cloud.apihub.v1.IDeleteRuntimeProjectAttachmentRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.apihub.v1.IDeleteRuntimeProjectAttachmentRequest + | undefined + ), + {} | undefined, + ] + >; deleteRuntimeProjectAttachment( - request: protos.google.cloud.apihub.v1.IDeleteRuntimeProjectAttachmentRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.IDeleteRuntimeProjectAttachmentRequest|null|undefined, - {}|null|undefined>): void; + request: protos.google.cloud.apihub.v1.IDeleteRuntimeProjectAttachmentRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.apihub.v1.IDeleteRuntimeProjectAttachmentRequest + | null + | undefined, + {} | null | undefined + > + ): void; deleteRuntimeProjectAttachment( - request: protos.google.cloud.apihub.v1.IDeleteRuntimeProjectAttachmentRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.IDeleteRuntimeProjectAttachmentRequest|null|undefined, - {}|null|undefined>): void; + request: protos.google.cloud.apihub.v1.IDeleteRuntimeProjectAttachmentRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.apihub.v1.IDeleteRuntimeProjectAttachmentRequest + | null + | undefined, + {} | null | undefined + > + ): void; deleteRuntimeProjectAttachment( - request?: protos.google.cloud.apihub.v1.IDeleteRuntimeProjectAttachmentRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.IDeleteRuntimeProjectAttachmentRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< + request?: protos.google.cloud.apihub.v1.IDeleteRuntimeProjectAttachmentRequest, + optionsOrCallback?: + | CallOptions + | Callback< protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.IDeleteRuntimeProjectAttachmentRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.IDeleteRuntimeProjectAttachmentRequest|undefined, {}|undefined - ]>|void { + | protos.google.cloud.apihub.v1.IDeleteRuntimeProjectAttachmentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.apihub.v1.IDeleteRuntimeProjectAttachmentRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.apihub.v1.IDeleteRuntimeProjectAttachmentRequest + | undefined + ), + {} | undefined, + ] + > | void { request = request || {}; let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } - else { + } 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 ?? '', - }); + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); this.initialize(); - return this.innerApiCalls.deleteRuntimeProjectAttachment(request, options, callback); + return this.innerApiCalls.deleteRuntimeProjectAttachment( + request, + options, + callback + ); } -/** - * Look up a runtime project attachment. This API can be called in the context - * of any project. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Runtime project ID to look up runtime project attachment for. - * Lookup happens across all regions. Expected format: - * `projects/{project}/locations/{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 protos.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse|LookupRuntimeProjectAttachmentResponse}. - * 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/runtime_project_attachment_service.lookup_runtime_project_attachment.js - * region_tag:apihub_v1_generated_RuntimeProjectAttachmentService_LookupRuntimeProjectAttachment_async - */ + /** + * Look up a runtime project attachment. This API can be called in the context + * of any project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Runtime project ID to look up runtime project attachment for. + * Lookup happens across all regions. Expected format: + * `projects/{project}/locations/{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 protos.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse|LookupRuntimeProjectAttachmentResponse}. + * 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/runtime_project_attachment_service.lookup_runtime_project_attachment.js + * region_tag:apihub_v1_generated_RuntimeProjectAttachmentService_LookupRuntimeProjectAttachment_async + */ lookupRuntimeProjectAttachment( - request?: protos.google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentResponse, - protos.google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentRequest|undefined, {}|undefined - ]>; + request?: protos.google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentResponse, + ( + | protos.google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentRequest + | undefined + ), + {} | undefined, + ] + >; lookupRuntimeProjectAttachment( - request: protos.google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentResponse, - protos.google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentRequest|null|undefined, - {}|null|undefined>): void; + request: protos.google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentResponse, + | protos.google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentRequest + | null + | undefined, + {} | null | undefined + > + ): void; lookupRuntimeProjectAttachment( - request: protos.google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentRequest, - callback: Callback< - protos.google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentResponse, - protos.google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentRequest|null|undefined, - {}|null|undefined>): void; + request: protos.google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentRequest, + callback: Callback< + protos.google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentResponse, + | protos.google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentRequest + | null + | undefined, + {} | null | undefined + > + ): void; lookupRuntimeProjectAttachment( - request?: protos.google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentResponse, - protos.google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< + request?: protos.google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentRequest, + optionsOrCallback?: + | CallOptions + | Callback< protos.google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentResponse, - protos.google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentResponse, - protos.google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentRequest|undefined, {}|undefined - ]>|void { + | protos.google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentResponse, + | protos.google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentResponse, + ( + | protos.google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentRequest + | undefined + ), + {} | undefined, + ] + > | void { request = request || {}; let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } - else { + } 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 ?? '', - }); + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); this.initialize(); - return this.innerApiCalls.lookupRuntimeProjectAttachment(request, options, callback); - } - - /** - * List runtime projects attached to the host project. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent, which owns this collection of runtime project - * attachments. Format: `projects/{project}/locations/{location}` - * @param {number} [request.pageSize] - * Optional. The maximum number of runtime project attachments to return. The - * service may return fewer than this value. If unspecified, at most 50 - * runtime project attachments will be returned. The maximum value is 1000; - * values above 1000 will be coerced to 1000. - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous - * `ListRuntimeProjectAttachments` call. Provide this to retrieve the - * subsequent page. - * - * When paginating, all other parameters (except page_size) provided to - * `ListRuntimeProjectAttachments` must match the call that provided the page - * token. - * @param {string} [request.filter] - * Optional. An expression that filters the list of RuntimeProjectAttachments. - * - * A filter expression consists of a field name, a comparison - * operator, and a value for filtering. The value must be a string. All - * standard operators as documented at https://google.aip.dev/160 are - * supported. - * - * The following fields in the `RuntimeProjectAttachment` are eligible for - * filtering: - * - * * `name` - The name of the RuntimeProjectAttachment. - * * `create_time` - The time at which the RuntimeProjectAttachment was - * created. The value should be in the - * (RFC3339)[https://tools.ietf.org/html/rfc3339] format. - * * `runtime_project` - The Google cloud project associated with the - * RuntimeProjectAttachment. - * @param {string} [request.orderBy] - * Optional. Hint for how to order the results. - * @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.apihub.v1.RuntimeProjectAttachment|RuntimeProjectAttachment}. - * 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 `listRuntimeProjectAttachmentsAsync()` - * 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. - */ + return this.innerApiCalls.lookupRuntimeProjectAttachment( + request, + options, + callback + ); + } + + /** + * List runtime projects attached to the host project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of runtime project + * attachments. Format: `projects/{project}/locations/{location}` + * @param {number} [request.pageSize] + * Optional. The maximum number of runtime project attachments to return. The + * service may return fewer than this value. If unspecified, at most 50 + * runtime project attachments will be returned. The maximum value is 1000; + * values above 1000 will be coerced to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous + * `ListRuntimeProjectAttachments` call. Provide this to retrieve the + * subsequent page. + * + * When paginating, all other parameters (except page_size) provided to + * `ListRuntimeProjectAttachments` must match the call that provided the page + * token. + * @param {string} [request.filter] + * Optional. An expression that filters the list of RuntimeProjectAttachments. + * + * A filter expression consists of a field name, a comparison + * operator, and a value for filtering. The value must be a string. All + * standard operators as documented at https://google.aip.dev/160 are + * supported. + * + * The following fields in the `RuntimeProjectAttachment` are eligible for + * filtering: + * + * * `name` - The name of the RuntimeProjectAttachment. + * * `create_time` - The time at which the RuntimeProjectAttachment was + * created. The value should be in the + * (RFC3339)[https://tools.ietf.org/html/rfc3339] format. + * * `runtime_project` - The Google cloud project associated with the + * RuntimeProjectAttachment. + * @param {string} [request.orderBy] + * Optional. Hint for how to order the results. + * @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.apihub.v1.RuntimeProjectAttachment|RuntimeProjectAttachment}. + * 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 `listRuntimeProjectAttachmentsAsync()` + * 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. + */ listRuntimeProjectAttachments( - request?: protos.google.cloud.apihub.v1.IListRuntimeProjectAttachmentsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apihub.v1.IRuntimeProjectAttachment[], - protos.google.cloud.apihub.v1.IListRuntimeProjectAttachmentsRequest|null, - protos.google.cloud.apihub.v1.IListRuntimeProjectAttachmentsResponse - ]>; + request?: protos.google.cloud.apihub.v1.IListRuntimeProjectAttachmentsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apihub.v1.IRuntimeProjectAttachment[], + protos.google.cloud.apihub.v1.IListRuntimeProjectAttachmentsRequest | null, + protos.google.cloud.apihub.v1.IListRuntimeProjectAttachmentsResponse, + ] + >; listRuntimeProjectAttachments( - request: protos.google.cloud.apihub.v1.IListRuntimeProjectAttachmentsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.apihub.v1.IListRuntimeProjectAttachmentsRequest, - protos.google.cloud.apihub.v1.IListRuntimeProjectAttachmentsResponse|null|undefined, - protos.google.cloud.apihub.v1.IRuntimeProjectAttachment>): void; + request: protos.google.cloud.apihub.v1.IListRuntimeProjectAttachmentsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.apihub.v1.IListRuntimeProjectAttachmentsRequest, + | protos.google.cloud.apihub.v1.IListRuntimeProjectAttachmentsResponse + | null + | undefined, + protos.google.cloud.apihub.v1.IRuntimeProjectAttachment + > + ): void; listRuntimeProjectAttachments( - request: protos.google.cloud.apihub.v1.IListRuntimeProjectAttachmentsRequest, - callback: PaginationCallback< - protos.google.cloud.apihub.v1.IListRuntimeProjectAttachmentsRequest, - protos.google.cloud.apihub.v1.IListRuntimeProjectAttachmentsResponse|null|undefined, - protos.google.cloud.apihub.v1.IRuntimeProjectAttachment>): void; + request: protos.google.cloud.apihub.v1.IListRuntimeProjectAttachmentsRequest, + callback: PaginationCallback< + protos.google.cloud.apihub.v1.IListRuntimeProjectAttachmentsRequest, + | protos.google.cloud.apihub.v1.IListRuntimeProjectAttachmentsResponse + | null + | undefined, + protos.google.cloud.apihub.v1.IRuntimeProjectAttachment + > + ): void; listRuntimeProjectAttachments( - request?: protos.google.cloud.apihub.v1.IListRuntimeProjectAttachmentsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< + request?: protos.google.cloud.apihub.v1.IListRuntimeProjectAttachmentsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< protos.google.cloud.apihub.v1.IListRuntimeProjectAttachmentsRequest, - protos.google.cloud.apihub.v1.IListRuntimeProjectAttachmentsResponse|null|undefined, - protos.google.cloud.apihub.v1.IRuntimeProjectAttachment>, - callback?: PaginationCallback< - protos.google.cloud.apihub.v1.IListRuntimeProjectAttachmentsRequest, - protos.google.cloud.apihub.v1.IListRuntimeProjectAttachmentsResponse|null|undefined, - protos.google.cloud.apihub.v1.IRuntimeProjectAttachment>): - Promise<[ - protos.google.cloud.apihub.v1.IRuntimeProjectAttachment[], - protos.google.cloud.apihub.v1.IListRuntimeProjectAttachmentsRequest|null, - protos.google.cloud.apihub.v1.IListRuntimeProjectAttachmentsResponse - ]>|void { + | protos.google.cloud.apihub.v1.IListRuntimeProjectAttachmentsResponse + | null + | undefined, + protos.google.cloud.apihub.v1.IRuntimeProjectAttachment + >, + callback?: PaginationCallback< + protos.google.cloud.apihub.v1.IListRuntimeProjectAttachmentsRequest, + | protos.google.cloud.apihub.v1.IListRuntimeProjectAttachmentsResponse + | null + | undefined, + protos.google.cloud.apihub.v1.IRuntimeProjectAttachment + > + ): Promise< + [ + protos.google.cloud.apihub.v1.IRuntimeProjectAttachment[], + protos.google.cloud.apihub.v1.IListRuntimeProjectAttachmentsRequest | null, + protos.google.cloud.apihub.v1.IListRuntimeProjectAttachmentsResponse, + ] + > | void { request = request || {}; let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } - else { + } 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 ?? '', - }); + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); this.initialize(); - return this.innerApiCalls.listRuntimeProjectAttachments(request, options, callback); + return this.innerApiCalls.listRuntimeProjectAttachments( + request, + options, + callback + ); } -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent, which owns this collection of runtime project - * attachments. Format: `projects/{project}/locations/{location}` - * @param {number} [request.pageSize] - * Optional. The maximum number of runtime project attachments to return. The - * service may return fewer than this value. If unspecified, at most 50 - * runtime project attachments will be returned. The maximum value is 1000; - * values above 1000 will be coerced to 1000. - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous - * `ListRuntimeProjectAttachments` call. Provide this to retrieve the - * subsequent page. - * - * When paginating, all other parameters (except page_size) provided to - * `ListRuntimeProjectAttachments` must match the call that provided the page - * token. - * @param {string} [request.filter] - * Optional. An expression that filters the list of RuntimeProjectAttachments. - * - * A filter expression consists of a field name, a comparison - * operator, and a value for filtering. The value must be a string. All - * standard operators as documented at https://google.aip.dev/160 are - * supported. - * - * The following fields in the `RuntimeProjectAttachment` are eligible for - * filtering: - * - * * `name` - The name of the RuntimeProjectAttachment. - * * `create_time` - The time at which the RuntimeProjectAttachment was - * created. The value should be in the - * (RFC3339)[https://tools.ietf.org/html/rfc3339] format. - * * `runtime_project` - The Google cloud project associated with the - * RuntimeProjectAttachment. - * @param {string} [request.orderBy] - * Optional. Hint for how to order the results. - * @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.apihub.v1.RuntimeProjectAttachment|RuntimeProjectAttachment} 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 `listRuntimeProjectAttachmentsAsync()` - * 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. - */ + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of runtime project + * attachments. Format: `projects/{project}/locations/{location}` + * @param {number} [request.pageSize] + * Optional. The maximum number of runtime project attachments to return. The + * service may return fewer than this value. If unspecified, at most 50 + * runtime project attachments will be returned. The maximum value is 1000; + * values above 1000 will be coerced to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous + * `ListRuntimeProjectAttachments` call. Provide this to retrieve the + * subsequent page. + * + * When paginating, all other parameters (except page_size) provided to + * `ListRuntimeProjectAttachments` must match the call that provided the page + * token. + * @param {string} [request.filter] + * Optional. An expression that filters the list of RuntimeProjectAttachments. + * + * A filter expression consists of a field name, a comparison + * operator, and a value for filtering. The value must be a string. All + * standard operators as documented at https://google.aip.dev/160 are + * supported. + * + * The following fields in the `RuntimeProjectAttachment` are eligible for + * filtering: + * + * * `name` - The name of the RuntimeProjectAttachment. + * * `create_time` - The time at which the RuntimeProjectAttachment was + * created. The value should be in the + * (RFC3339)[https://tools.ietf.org/html/rfc3339] format. + * * `runtime_project` - The Google cloud project associated with the + * RuntimeProjectAttachment. + * @param {string} [request.orderBy] + * Optional. Hint for how to order the results. + * @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.apihub.v1.RuntimeProjectAttachment|RuntimeProjectAttachment} 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 `listRuntimeProjectAttachmentsAsync()` + * 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. + */ listRuntimeProjectAttachmentsStream( - request?: protos.google.cloud.apihub.v1.IListRuntimeProjectAttachmentsRequest, - options?: CallOptions): - Transform{ + request?: protos.google.cloud.apihub.v1.IListRuntimeProjectAttachmentsRequest, + 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 ?? '', - }); + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); const defaultCallSettings = this._defaults['listRuntimeProjectAttachments']; const callSettings = defaultCallSettings.merge(options); this.initialize(); @@ -863,72 +1058,71 @@ export class RuntimeProjectAttachmentServiceClient { ); } -/** - * Equivalent to `listRuntimeProjectAttachments`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent, which owns this collection of runtime project - * attachments. Format: `projects/{project}/locations/{location}` - * @param {number} [request.pageSize] - * Optional. The maximum number of runtime project attachments to return. The - * service may return fewer than this value. If unspecified, at most 50 - * runtime project attachments will be returned. The maximum value is 1000; - * values above 1000 will be coerced to 1000. - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous - * `ListRuntimeProjectAttachments` call. Provide this to retrieve the - * subsequent page. - * - * When paginating, all other parameters (except page_size) provided to - * `ListRuntimeProjectAttachments` must match the call that provided the page - * token. - * @param {string} [request.filter] - * Optional. An expression that filters the list of RuntimeProjectAttachments. - * - * A filter expression consists of a field name, a comparison - * operator, and a value for filtering. The value must be a string. All - * standard operators as documented at https://google.aip.dev/160 are - * supported. - * - * The following fields in the `RuntimeProjectAttachment` are eligible for - * filtering: - * - * * `name` - The name of the RuntimeProjectAttachment. - * * `create_time` - The time at which the RuntimeProjectAttachment was - * created. The value should be in the - * (RFC3339)[https://tools.ietf.org/html/rfc3339] format. - * * `runtime_project` - The Google cloud project associated with the - * RuntimeProjectAttachment. - * @param {string} [request.orderBy] - * Optional. Hint for how to order the results. - * @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.apihub.v1.RuntimeProjectAttachment|RuntimeProjectAttachment}. 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/runtime_project_attachment_service.list_runtime_project_attachments.js - * region_tag:apihub_v1_generated_RuntimeProjectAttachmentService_ListRuntimeProjectAttachments_async - */ + /** + * Equivalent to `listRuntimeProjectAttachments`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of runtime project + * attachments. Format: `projects/{project}/locations/{location}` + * @param {number} [request.pageSize] + * Optional. The maximum number of runtime project attachments to return. The + * service may return fewer than this value. If unspecified, at most 50 + * runtime project attachments will be returned. The maximum value is 1000; + * values above 1000 will be coerced to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous + * `ListRuntimeProjectAttachments` call. Provide this to retrieve the + * subsequent page. + * + * When paginating, all other parameters (except page_size) provided to + * `ListRuntimeProjectAttachments` must match the call that provided the page + * token. + * @param {string} [request.filter] + * Optional. An expression that filters the list of RuntimeProjectAttachments. + * + * A filter expression consists of a field name, a comparison + * operator, and a value for filtering. The value must be a string. All + * standard operators as documented at https://google.aip.dev/160 are + * supported. + * + * The following fields in the `RuntimeProjectAttachment` are eligible for + * filtering: + * + * * `name` - The name of the RuntimeProjectAttachment. + * * `create_time` - The time at which the RuntimeProjectAttachment was + * created. The value should be in the + * (RFC3339)[https://tools.ietf.org/html/rfc3339] format. + * * `runtime_project` - The Google cloud project associated with the + * RuntimeProjectAttachment. + * @param {string} [request.orderBy] + * Optional. Hint for how to order the results. + * @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.apihub.v1.RuntimeProjectAttachment|RuntimeProjectAttachment}. 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/runtime_project_attachment_service.list_runtime_project_attachments.js + * region_tag:apihub_v1_generated_RuntimeProjectAttachmentService_ListRuntimeProjectAttachments_async + */ listRuntimeProjectAttachmentsAsync( - request?: protos.google.cloud.apihub.v1.IListRuntimeProjectAttachmentsRequest, - options?: CallOptions): - AsyncIterable{ + request?: protos.google.cloud.apihub.v1.IListRuntimeProjectAttachmentsRequest, + 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 ?? '', - }); + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); const defaultCallSettings = this._defaults['listRuntimeProjectAttachments']; const callSettings = defaultCallSettings.merge(options); this.initialize(); @@ -938,7 +1132,7 @@ export class RuntimeProjectAttachmentServiceClient { callSettings ) as AsyncIterable; } -/** + /** * Gets information about a location. * * @param {Object} request @@ -978,7 +1172,7 @@ export class RuntimeProjectAttachmentServiceClient { 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. @@ -1028,7 +1222,7 @@ export class RuntimeProjectAttachmentServiceClient { * @param {string} api * @returns {string} Resource name string. */ - apiPath(project:string,location:string,api:string) { + apiPath(project: string, location: string, api: string) { return this.pathTemplates.apiPathTemplate.render({ project: project, location: location, @@ -1077,7 +1271,11 @@ export class RuntimeProjectAttachmentServiceClient { * @param {string} api_hub_instance * @returns {string} Resource name string. */ - apiHubInstancePath(project:string,location:string,apiHubInstance:string) { + apiHubInstancePath( + project: string, + location: string, + apiHubInstance: string + ) { return this.pathTemplates.apiHubInstancePathTemplate.render({ project: project, location: location, @@ -1093,7 +1291,9 @@ export class RuntimeProjectAttachmentServiceClient { * @returns {string} A string representing the project. */ matchProjectFromApiHubInstanceName(apiHubInstanceName: string) { - return this.pathTemplates.apiHubInstancePathTemplate.match(apiHubInstanceName).project; + return this.pathTemplates.apiHubInstancePathTemplate.match( + apiHubInstanceName + ).project; } /** @@ -1104,7 +1304,9 @@ export class RuntimeProjectAttachmentServiceClient { * @returns {string} A string representing the location. */ matchLocationFromApiHubInstanceName(apiHubInstanceName: string) { - return this.pathTemplates.apiHubInstancePathTemplate.match(apiHubInstanceName).location; + return this.pathTemplates.apiHubInstancePathTemplate.match( + apiHubInstanceName + ).location; } /** @@ -1115,7 +1317,9 @@ export class RuntimeProjectAttachmentServiceClient { * @returns {string} A string representing the api_hub_instance. */ matchApiHubInstanceFromApiHubInstanceName(apiHubInstanceName: string) { - return this.pathTemplates.apiHubInstancePathTemplate.match(apiHubInstanceName).api_hub_instance; + return this.pathTemplates.apiHubInstancePathTemplate.match( + apiHubInstanceName + ).api_hub_instance; } /** @@ -1128,7 +1332,13 @@ export class RuntimeProjectAttachmentServiceClient { * @param {string} operation * @returns {string} Resource name string. */ - apiOperationPath(project:string,location:string,api:string,version:string,operation:string) { + apiOperationPath( + project: string, + location: string, + api: string, + version: string, + operation: string + ) { return this.pathTemplates.apiOperationPathTemplate.render({ project: project, location: location, @@ -1146,7 +1356,8 @@ export class RuntimeProjectAttachmentServiceClient { * @returns {string} A string representing the project. */ matchProjectFromApiOperationName(apiOperationName: string) { - return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).project; + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName) + .project; } /** @@ -1157,7 +1368,8 @@ export class RuntimeProjectAttachmentServiceClient { * @returns {string} A string representing the location. */ matchLocationFromApiOperationName(apiOperationName: string) { - return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).location; + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName) + .location; } /** @@ -1168,7 +1380,8 @@ export class RuntimeProjectAttachmentServiceClient { * @returns {string} A string representing the api. */ matchApiFromApiOperationName(apiOperationName: string) { - return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).api; + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName) + .api; } /** @@ -1179,7 +1392,8 @@ export class RuntimeProjectAttachmentServiceClient { * @returns {string} A string representing the version. */ matchVersionFromApiOperationName(apiOperationName: string) { - return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).version; + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName) + .version; } /** @@ -1190,7 +1404,8 @@ export class RuntimeProjectAttachmentServiceClient { * @returns {string} A string representing the operation. */ matchOperationFromApiOperationName(apiOperationName: string) { - return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).operation; + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName) + .operation; } /** @@ -1201,7 +1416,7 @@ export class RuntimeProjectAttachmentServiceClient { * @param {string} attribute * @returns {string} Resource name string. */ - attributePath(project:string,location:string,attribute:string) { + attributePath(project: string, location: string, attribute: string) { return this.pathTemplates.attributePathTemplate.render({ project: project, location: location, @@ -1217,7 +1432,8 @@ export class RuntimeProjectAttachmentServiceClient { * @returns {string} A string representing the project. */ matchProjectFromAttributeName(attributeName: string) { - return this.pathTemplates.attributePathTemplate.match(attributeName).project; + return this.pathTemplates.attributePathTemplate.match(attributeName) + .project; } /** @@ -1228,7 +1444,8 @@ export class RuntimeProjectAttachmentServiceClient { * @returns {string} A string representing the location. */ matchLocationFromAttributeName(attributeName: string) { - return this.pathTemplates.attributePathTemplate.match(attributeName).location; + return this.pathTemplates.attributePathTemplate.match(attributeName) + .location; } /** @@ -1239,7 +1456,8 @@ export class RuntimeProjectAttachmentServiceClient { * @returns {string} A string representing the attribute. */ matchAttributeFromAttributeName(attributeName: string) { - return this.pathTemplates.attributePathTemplate.match(attributeName).attribute; + return this.pathTemplates.attributePathTemplate.match(attributeName) + .attribute; } /** @@ -1252,7 +1470,13 @@ export class RuntimeProjectAttachmentServiceClient { * @param {string} definition * @returns {string} Resource name string. */ - definitionPath(project:string,location:string,api:string,version:string,definition:string) { + definitionPath( + project: string, + location: string, + api: string, + version: string, + definition: string + ) { return this.pathTemplates.definitionPathTemplate.render({ project: project, location: location, @@ -1270,7 +1494,8 @@ export class RuntimeProjectAttachmentServiceClient { * @returns {string} A string representing the project. */ matchProjectFromDefinitionName(definitionName: string) { - return this.pathTemplates.definitionPathTemplate.match(definitionName).project; + return this.pathTemplates.definitionPathTemplate.match(definitionName) + .project; } /** @@ -1281,7 +1506,8 @@ export class RuntimeProjectAttachmentServiceClient { * @returns {string} A string representing the location. */ matchLocationFromDefinitionName(definitionName: string) { - return this.pathTemplates.definitionPathTemplate.match(definitionName).location; + return this.pathTemplates.definitionPathTemplate.match(definitionName) + .location; } /** @@ -1303,7 +1529,8 @@ export class RuntimeProjectAttachmentServiceClient { * @returns {string} A string representing the version. */ matchVersionFromDefinitionName(definitionName: string) { - return this.pathTemplates.definitionPathTemplate.match(definitionName).version; + return this.pathTemplates.definitionPathTemplate.match(definitionName) + .version; } /** @@ -1314,7 +1541,8 @@ export class RuntimeProjectAttachmentServiceClient { * @returns {string} A string representing the definition. */ matchDefinitionFromDefinitionName(definitionName: string) { - return this.pathTemplates.definitionPathTemplate.match(definitionName).definition; + return this.pathTemplates.definitionPathTemplate.match(definitionName) + .definition; } /** @@ -1325,7 +1553,7 @@ export class RuntimeProjectAttachmentServiceClient { * @param {string} dependency * @returns {string} Resource name string. */ - dependencyPath(project:string,location:string,dependency:string) { + dependencyPath(project: string, location: string, dependency: string) { return this.pathTemplates.dependencyPathTemplate.render({ project: project, location: location, @@ -1341,7 +1569,8 @@ export class RuntimeProjectAttachmentServiceClient { * @returns {string} A string representing the project. */ matchProjectFromDependencyName(dependencyName: string) { - return this.pathTemplates.dependencyPathTemplate.match(dependencyName).project; + return this.pathTemplates.dependencyPathTemplate.match(dependencyName) + .project; } /** @@ -1352,7 +1581,8 @@ export class RuntimeProjectAttachmentServiceClient { * @returns {string} A string representing the location. */ matchLocationFromDependencyName(dependencyName: string) { - return this.pathTemplates.dependencyPathTemplate.match(dependencyName).location; + return this.pathTemplates.dependencyPathTemplate.match(dependencyName) + .location; } /** @@ -1363,7 +1593,8 @@ export class RuntimeProjectAttachmentServiceClient { * @returns {string} A string representing the dependency. */ matchDependencyFromDependencyName(dependencyName: string) { - return this.pathTemplates.dependencyPathTemplate.match(dependencyName).dependency; + return this.pathTemplates.dependencyPathTemplate.match(dependencyName) + .dependency; } /** @@ -1374,7 +1605,7 @@ export class RuntimeProjectAttachmentServiceClient { * @param {string} deployment * @returns {string} Resource name string. */ - deploymentPath(project:string,location:string,deployment:string) { + deploymentPath(project: string, location: string, deployment: string) { return this.pathTemplates.deploymentPathTemplate.render({ project: project, location: location, @@ -1390,7 +1621,8 @@ export class RuntimeProjectAttachmentServiceClient { * @returns {string} A string representing the project. */ matchProjectFromDeploymentName(deploymentName: string) { - return this.pathTemplates.deploymentPathTemplate.match(deploymentName).project; + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .project; } /** @@ -1401,7 +1633,8 @@ export class RuntimeProjectAttachmentServiceClient { * @returns {string} A string representing the location. */ matchLocationFromDeploymentName(deploymentName: string) { - return this.pathTemplates.deploymentPathTemplate.match(deploymentName).location; + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .location; } /** @@ -1412,7 +1645,8 @@ export class RuntimeProjectAttachmentServiceClient { * @returns {string} A string representing the deployment. */ matchDeploymentFromDeploymentName(deploymentName: string) { - return this.pathTemplates.deploymentPathTemplate.match(deploymentName).deployment; + return this.pathTemplates.deploymentPathTemplate.match(deploymentName) + .deployment; } /** @@ -1423,7 +1657,7 @@ export class RuntimeProjectAttachmentServiceClient { * @param {string} external_api * @returns {string} Resource name string. */ - externalApiPath(project:string,location:string,externalApi:string) { + externalApiPath(project: string, location: string, externalApi: string) { return this.pathTemplates.externalApiPathTemplate.render({ project: project, location: location, @@ -1439,7 +1673,8 @@ export class RuntimeProjectAttachmentServiceClient { * @returns {string} A string representing the project. */ matchProjectFromExternalApiName(externalApiName: string) { - return this.pathTemplates.externalApiPathTemplate.match(externalApiName).project; + return this.pathTemplates.externalApiPathTemplate.match(externalApiName) + .project; } /** @@ -1450,7 +1685,8 @@ export class RuntimeProjectAttachmentServiceClient { * @returns {string} A string representing the location. */ matchLocationFromExternalApiName(externalApiName: string) { - return this.pathTemplates.externalApiPathTemplate.match(externalApiName).location; + return this.pathTemplates.externalApiPathTemplate.match(externalApiName) + .location; } /** @@ -1461,7 +1697,8 @@ export class RuntimeProjectAttachmentServiceClient { * @returns {string} A string representing the external_api. */ matchExternalApiFromExternalApiName(externalApiName: string) { - return this.pathTemplates.externalApiPathTemplate.match(externalApiName).external_api; + return this.pathTemplates.externalApiPathTemplate.match(externalApiName) + .external_api; } /** @@ -1472,7 +1709,11 @@ export class RuntimeProjectAttachmentServiceClient { * @param {string} host_project_registration * @returns {string} Resource name string. */ - hostProjectRegistrationPath(project:string,location:string,hostProjectRegistration:string) { + hostProjectRegistrationPath( + project: string, + location: string, + hostProjectRegistration: string + ) { return this.pathTemplates.hostProjectRegistrationPathTemplate.render({ project: project, location: location, @@ -1487,8 +1728,12 @@ export class RuntimeProjectAttachmentServiceClient { * A fully-qualified path representing HostProjectRegistration resource. * @returns {string} A string representing the project. */ - matchProjectFromHostProjectRegistrationName(hostProjectRegistrationName: string) { - return this.pathTemplates.hostProjectRegistrationPathTemplate.match(hostProjectRegistrationName).project; + matchProjectFromHostProjectRegistrationName( + hostProjectRegistrationName: string + ) { + return this.pathTemplates.hostProjectRegistrationPathTemplate.match( + hostProjectRegistrationName + ).project; } /** @@ -1498,8 +1743,12 @@ export class RuntimeProjectAttachmentServiceClient { * A fully-qualified path representing HostProjectRegistration resource. * @returns {string} A string representing the location. */ - matchLocationFromHostProjectRegistrationName(hostProjectRegistrationName: string) { - return this.pathTemplates.hostProjectRegistrationPathTemplate.match(hostProjectRegistrationName).location; + matchLocationFromHostProjectRegistrationName( + hostProjectRegistrationName: string + ) { + return this.pathTemplates.hostProjectRegistrationPathTemplate.match( + hostProjectRegistrationName + ).location; } /** @@ -1509,8 +1758,12 @@ export class RuntimeProjectAttachmentServiceClient { * A fully-qualified path representing HostProjectRegistration resource. * @returns {string} A string representing the host_project_registration. */ - matchHostProjectRegistrationFromHostProjectRegistrationName(hostProjectRegistrationName: string) { - return this.pathTemplates.hostProjectRegistrationPathTemplate.match(hostProjectRegistrationName).host_project_registration; + matchHostProjectRegistrationFromHostProjectRegistrationName( + hostProjectRegistrationName: string + ) { + return this.pathTemplates.hostProjectRegistrationPathTemplate.match( + hostProjectRegistrationName + ).host_project_registration; } /** @@ -1520,7 +1773,7 @@ export class RuntimeProjectAttachmentServiceClient { * @param {string} location * @returns {string} Resource name string. */ - locationPath(project:string,location:string) { + locationPath(project: string, location: string) { return this.pathTemplates.locationPathTemplate.render({ project: project, location: location, @@ -1557,7 +1810,7 @@ export class RuntimeProjectAttachmentServiceClient { * @param {string} plugin * @returns {string} Resource name string. */ - pluginPath(project:string,location:string,plugin:string) { + pluginPath(project: string, location: string, plugin: string) { return this.pathTemplates.pluginPathTemplate.render({ project: project, location: location, @@ -1604,7 +1857,7 @@ export class RuntimeProjectAttachmentServiceClient { * @param {string} project * @returns {string} Resource name string. */ - projectPath(project:string) { + projectPath(project: string) { return this.pathTemplates.projectPathTemplate.render({ project: project, }); @@ -1629,7 +1882,11 @@ export class RuntimeProjectAttachmentServiceClient { * @param {string} runtime_project_attachment * @returns {string} Resource name string. */ - runtimeProjectAttachmentPath(project:string,location:string,runtimeProjectAttachment:string) { + runtimeProjectAttachmentPath( + project: string, + location: string, + runtimeProjectAttachment: string + ) { return this.pathTemplates.runtimeProjectAttachmentPathTemplate.render({ project: project, location: location, @@ -1644,8 +1901,12 @@ export class RuntimeProjectAttachmentServiceClient { * A fully-qualified path representing RuntimeProjectAttachment resource. * @returns {string} A string representing the project. */ - matchProjectFromRuntimeProjectAttachmentName(runtimeProjectAttachmentName: string) { - return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match(runtimeProjectAttachmentName).project; + matchProjectFromRuntimeProjectAttachmentName( + runtimeProjectAttachmentName: string + ) { + return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match( + runtimeProjectAttachmentName + ).project; } /** @@ -1655,8 +1916,12 @@ export class RuntimeProjectAttachmentServiceClient { * A fully-qualified path representing RuntimeProjectAttachment resource. * @returns {string} A string representing the location. */ - matchLocationFromRuntimeProjectAttachmentName(runtimeProjectAttachmentName: string) { - return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match(runtimeProjectAttachmentName).location; + matchLocationFromRuntimeProjectAttachmentName( + runtimeProjectAttachmentName: string + ) { + return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match( + runtimeProjectAttachmentName + ).location; } /** @@ -1666,8 +1931,12 @@ export class RuntimeProjectAttachmentServiceClient { * A fully-qualified path representing RuntimeProjectAttachment resource. * @returns {string} A string representing the runtime_project_attachment. */ - matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName(runtimeProjectAttachmentName: string) { - return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match(runtimeProjectAttachmentName).runtime_project_attachment; + matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName( + runtimeProjectAttachmentName: string + ) { + return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match( + runtimeProjectAttachmentName + ).runtime_project_attachment; } /** @@ -1680,7 +1949,13 @@ export class RuntimeProjectAttachmentServiceClient { * @param {string} spec * @returns {string} Resource name string. */ - specPath(project:string,location:string,api:string,version:string,spec:string) { + specPath( + project: string, + location: string, + api: string, + version: string, + spec: string + ) { return this.pathTemplates.specPathTemplate.render({ project: project, location: location, @@ -1753,7 +2028,7 @@ export class RuntimeProjectAttachmentServiceClient { * @param {string} plugin * @returns {string} Resource name string. */ - styleGuidePath(project:string,location:string,plugin:string) { + styleGuidePath(project: string, location: string, plugin: string) { return this.pathTemplates.styleGuidePathTemplate.render({ project: project, location: location, @@ -1769,7 +2044,8 @@ export class RuntimeProjectAttachmentServiceClient { * @returns {string} A string representing the project. */ matchProjectFromStyleGuideName(styleGuideName: string) { - return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName).project; + return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName) + .project; } /** @@ -1780,7 +2056,8 @@ export class RuntimeProjectAttachmentServiceClient { * @returns {string} A string representing the location. */ matchLocationFromStyleGuideName(styleGuideName: string) { - return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName).location; + return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName) + .location; } /** @@ -1791,7 +2068,8 @@ export class RuntimeProjectAttachmentServiceClient { * @returns {string} A string representing the plugin. */ matchPluginFromStyleGuideName(styleGuideName: string) { - return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName).plugin; + return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName) + .plugin; } /** @@ -1803,7 +2081,7 @@ export class RuntimeProjectAttachmentServiceClient { * @param {string} version * @returns {string} Resource name string. */ - versionPath(project:string,location:string,api:string,version:string) { + versionPath(project: string, location: string, api: string, version: string) { return this.pathTemplates.versionPathTemplate.render({ project: project, location: location, diff --git a/owl-bot-staging/google-cloud-apihub/v1/src/v1/runtime_project_attachment_service_client_config.json b/packages/google-cloud-apihub/src/v1/runtime_project_attachment_service_client_config.json similarity index 100% rename from owl-bot-staging/google-cloud-apihub/v1/src/v1/runtime_project_attachment_service_client_config.json rename to packages/google-cloud-apihub/src/v1/runtime_project_attachment_service_client_config.json diff --git a/owl-bot-staging/google-cloud-apihub/v1/src/v1/runtime_project_attachment_service_proto_list.json b/packages/google-cloud-apihub/src/v1/runtime_project_attachment_service_proto_list.json similarity index 100% rename from owl-bot-staging/google-cloud-apihub/v1/src/v1/runtime_project_attachment_service_proto_list.json rename to packages/google-cloud-apihub/src/v1/runtime_project_attachment_service_proto_list.json diff --git a/owl-bot-staging/google-cloud-apihub/v1/system-test/fixtures/sample/src/index.js b/packages/google-cloud-apihub/system-test/fixtures/sample/src/index.js similarity index 85% rename from owl-bot-staging/google-cloud-apihub/v1/system-test/fixtures/sample/src/index.js rename to packages/google-cloud-apihub/system-test/fixtures/sample/src/index.js index f0e98e48ab9..28c00137a4e 100644 --- a/owl-bot-staging/google-cloud-apihub/v1/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-apihub/system-test/fixtures/sample/src/index.js @@ -16,7 +16,6 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** - /* eslint-disable node/no-missing-require, no-unused-vars */ const apihub = require('@google-cloud/apihub'); @@ -24,10 +23,12 @@ function main() { const apiHubClient = new apihub.ApiHubClient(); const apiHubDependenciesClient = new apihub.ApiHubDependenciesClient(); const apiHubPluginClient = new apihub.ApiHubPluginClient(); - const hostProjectRegistrationServiceClient = new apihub.HostProjectRegistrationServiceClient(); + const hostProjectRegistrationServiceClient = + new apihub.HostProjectRegistrationServiceClient(); const lintingServiceClient = new apihub.LintingServiceClient(); const provisioningClient = new apihub.ProvisioningClient(); - const runtimeProjectAttachmentServiceClient = new apihub.RuntimeProjectAttachmentServiceClient(); + const runtimeProjectAttachmentServiceClient = + new apihub.RuntimeProjectAttachmentServiceClient(); } main(); diff --git a/owl-bot-staging/google-cloud-apihub/v1/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-apihub/system-test/fixtures/sample/src/index.ts similarity index 72% rename from owl-bot-staging/google-cloud-apihub/v1/system-test/fixtures/sample/src/index.ts rename to packages/google-cloud-apihub/system-test/fixtures/sample/src/index.ts index 15cbcb831c6..82a110ef103 100644 --- a/owl-bot-staging/google-cloud-apihub/v1/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-apihub/system-test/fixtures/sample/src/index.ts @@ -16,7 +16,15 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** -import {ApiHubClient, ApiHubDependenciesClient, ApiHubPluginClient, HostProjectRegistrationServiceClient, LintingServiceClient, ProvisioningClient, RuntimeProjectAttachmentServiceClient} from '@google-cloud/apihub'; +import { + ApiHubClient, + ApiHubDependenciesClient, + ApiHubPluginClient, + HostProjectRegistrationServiceClient, + LintingServiceClient, + ProvisioningClient, + RuntimeProjectAttachmentServiceClient, +} from '@google-cloud/apihub'; // check that the client class type name can be used function doStuffWithApiHubClient(client: ApiHubClient) { @@ -28,7 +36,9 @@ function doStuffWithApiHubDependenciesClient(client: ApiHubDependenciesClient) { function doStuffWithApiHubPluginClient(client: ApiHubPluginClient) { client.close(); } -function doStuffWithHostProjectRegistrationServiceClient(client: HostProjectRegistrationServiceClient) { +function doStuffWithHostProjectRegistrationServiceClient( + client: HostProjectRegistrationServiceClient +) { client.close(); } function doStuffWithLintingServiceClient(client: LintingServiceClient) { @@ -37,7 +47,9 @@ function doStuffWithLintingServiceClient(client: LintingServiceClient) { function doStuffWithProvisioningClient(client: ProvisioningClient) { client.close(); } -function doStuffWithRuntimeProjectAttachmentServiceClient(client: RuntimeProjectAttachmentServiceClient) { +function doStuffWithRuntimeProjectAttachmentServiceClient( + client: RuntimeProjectAttachmentServiceClient +) { client.close(); } @@ -52,8 +64,11 @@ function main() { const apiHubPluginClient = new ApiHubPluginClient(); doStuffWithApiHubPluginClient(apiHubPluginClient); // check that the client instance can be created - const hostProjectRegistrationServiceClient = new HostProjectRegistrationServiceClient(); - doStuffWithHostProjectRegistrationServiceClient(hostProjectRegistrationServiceClient); + const hostProjectRegistrationServiceClient = + new HostProjectRegistrationServiceClient(); + doStuffWithHostProjectRegistrationServiceClient( + hostProjectRegistrationServiceClient + ); // check that the client instance can be created const lintingServiceClient = new LintingServiceClient(); doStuffWithLintingServiceClient(lintingServiceClient); @@ -61,8 +76,11 @@ function main() { const provisioningClient = new ProvisioningClient(); doStuffWithProvisioningClient(provisioningClient); // check that the client instance can be created - const runtimeProjectAttachmentServiceClient = new RuntimeProjectAttachmentServiceClient(); - doStuffWithRuntimeProjectAttachmentServiceClient(runtimeProjectAttachmentServiceClient); + const runtimeProjectAttachmentServiceClient = + new RuntimeProjectAttachmentServiceClient(); + doStuffWithRuntimeProjectAttachmentServiceClient( + runtimeProjectAttachmentServiceClient + ); } main(); diff --git a/owl-bot-staging/google-cloud-apihub/v1/system-test/install.ts b/packages/google-cloud-apihub/system-test/install.ts similarity index 81% rename from owl-bot-staging/google-cloud-apihub/v1/system-test/install.ts rename to packages/google-cloud-apihub/system-test/install.ts index fd5bfdc71d5..83b83f332c3 100644 --- a/owl-bot-staging/google-cloud-apihub/v1/system-test/install.ts +++ b/packages/google-cloud-apihub/system-test/install.ts @@ -21,29 +21,31 @@ import {readFileSync} from 'fs'; import {describe, it} from 'mocha'; describe('📦 pack-n-play test', () => { - - it('TypeScript code', async function() { + 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() - } + ts: readFileSync( + './system-test/fixtures/sample/src/index.ts' + ).toString(), + }, }; await packNTest(options); }); - it('JavaScript code', async function() { + 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() - } + ts: readFileSync( + './system-test/fixtures/sample/src/index.js' + ).toString(), + }, }; await packNTest(options); }); - }); diff --git a/packages/google-cloud-apihub/test/gapic_api_hub_dependencies_v1.ts b/packages/google-cloud-apihub/test/gapic_api_hub_dependencies_v1.ts new file mode 100644 index 00000000000..ae748ad1921 --- /dev/null +++ b/packages/google-cloud-apihub/test/gapic_api_hub_dependencies_v1.ts @@ -0,0 +1,2436 @@ +// Copyright 2024 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 apihubdependenciesModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, 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 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.ApiHubDependenciesClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'apihub.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, 'googleapis.com'); + }); + + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = + apihubdependenciesModule.v1.ApiHubDependenciesClient.servicePath; + assert.strictEqual(servicePath, 'apihub.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = + apihubdependenciesModule.v1.ApiHubDependenciesClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'apihub.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + universeDomain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'apihub.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + universe_domain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'apihub.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = + new apihubdependenciesModule.v1.ApiHubDependenciesClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'apihub.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = + new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'apihub.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { + new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + universe_domain: 'example.com', + universeDomain: 'example.net', + }); + }); + }); + + it('has port', () => { + const port = apihubdependenciesModule.v1.ApiHubDependenciesClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.apiHubDependenciesStub, undefined); + await client.initialize(); + assert(client.apiHubDependenciesStub); + }); + + it('has close method for the initialized client', done => { + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.apiHubDependenciesStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.apiHubDependenciesStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + 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 apihubdependenciesModule.v1.ApiHubDependenciesClient({ + 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('createDependency', () => { + it('invokes createDependency without error', async () => { + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateDependencyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.CreateDependencyRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Dependency() + ); + client.innerApiCalls.createDependency = stubSimpleCall(expectedResponse); + const [response] = await client.createDependency(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createDependency as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createDependency as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createDependency without error using callback', async () => { + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateDependencyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.CreateDependencyRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Dependency() + ); + client.innerApiCalls.createDependency = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createDependency( + request, + ( + err?: Error | null, + result?: protos.google.cloud.apihub.v1.IDependency | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createDependency as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createDependency as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createDependency with error', async () => { + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateDependencyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.CreateDependencyRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createDependency = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.createDependency(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createDependency as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createDependency as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createDependency with closed client', async () => { + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateDependencyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.CreateDependencyRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createDependency(request), expectedError); + }); + }); + + describe('getDependency', () => { + it('invokes getDependency without error', async () => { + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetDependencyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.GetDependencyRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Dependency() + ); + client.innerApiCalls.getDependency = stubSimpleCall(expectedResponse); + const [response] = await client.getDependency(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getDependency as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getDependency as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDependency without error using callback', async () => { + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetDependencyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.GetDependencyRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Dependency() + ); + client.innerApiCalls.getDependency = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getDependency( + request, + ( + err?: Error | null, + result?: protos.google.cloud.apihub.v1.IDependency | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getDependency as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getDependency as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDependency with error', async () => { + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetDependencyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.GetDependencyRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getDependency = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getDependency(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getDependency as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getDependency as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDependency with closed client', async () => { + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetDependencyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.GetDependencyRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getDependency(request), expectedError); + }); + }); + + describe('updateDependency', () => { + it('invokes updateDependency without error', async () => { + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.UpdateDependencyRequest() + ); + request.dependency ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.UpdateDependencyRequest', + ['dependency', 'name'] + ); + request.dependency.name = defaultValue1; + const expectedHeaderRequestParams = `dependency.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Dependency() + ); + client.innerApiCalls.updateDependency = stubSimpleCall(expectedResponse); + const [response] = await client.updateDependency(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateDependency as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateDependency as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDependency without error using callback', async () => { + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.UpdateDependencyRequest() + ); + request.dependency ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.UpdateDependencyRequest', + ['dependency', 'name'] + ); + request.dependency.name = defaultValue1; + const expectedHeaderRequestParams = `dependency.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Dependency() + ); + client.innerApiCalls.updateDependency = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateDependency( + request, + ( + err?: Error | null, + result?: protos.google.cloud.apihub.v1.IDependency | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateDependency as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateDependency as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDependency with error', async () => { + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.UpdateDependencyRequest() + ); + request.dependency ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.UpdateDependencyRequest', + ['dependency', 'name'] + ); + request.dependency.name = defaultValue1; + const expectedHeaderRequestParams = `dependency.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateDependency = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateDependency(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateDependency as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateDependency as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDependency with closed client', async () => { + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.UpdateDependencyRequest() + ); + request.dependency ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.UpdateDependencyRequest', + ['dependency', 'name'] + ); + request.dependency.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateDependency(request), expectedError); + }); + }); + + describe('deleteDependency', () => { + it('invokes deleteDependency without error', async () => { + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DeleteDependencyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.DeleteDependencyRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteDependency = stubSimpleCall(expectedResponse); + const [response] = await client.deleteDependency(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteDependency as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteDependency as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteDependency without error using callback', async () => { + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DeleteDependencyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.DeleteDependencyRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteDependency = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteDependency( + request, + ( + err?: Error | null, + result?: protos.google.protobuf.IEmpty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteDependency as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteDependency as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteDependency with error', async () => { + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DeleteDependencyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.DeleteDependencyRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteDependency = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteDependency(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteDependency as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteDependency as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteDependency with closed client', async () => { + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DeleteDependencyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.DeleteDependencyRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteDependency(request), expectedError); + }); + }); + + describe('listDependencies', () => { + it('invokes listDependencies without error', async () => { + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListDependenciesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.ListDependenciesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.Dependency()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Dependency()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Dependency()), + ]; + client.innerApiCalls.listDependencies = stubSimpleCall(expectedResponse); + const [response] = await client.listDependencies(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listDependencies as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDependencies as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDependencies without error using callback', async () => { + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListDependenciesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.ListDependenciesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.Dependency()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Dependency()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Dependency()), + ]; + client.innerApiCalls.listDependencies = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listDependencies( + request, + ( + err?: Error | null, + result?: protos.google.cloud.apihub.v1.IDependency[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listDependencies as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDependencies as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDependencies with error', async () => { + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListDependenciesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.ListDependenciesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listDependencies = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listDependencies(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listDependencies as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDependencies as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDependenciesStream without error', async () => { + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListDependenciesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.ListDependenciesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.Dependency()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Dependency()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Dependency()), + ]; + client.descriptors.page.listDependencies.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listDependenciesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.apihub.v1.Dependency[] = []; + stream.on( + 'data', + (response: protos.google.cloud.apihub.v1.Dependency) => { + 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.listDependencies.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listDependencies, request) + ); + assert( + (client.descriptors.page.listDependencies.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + + it('invokes listDependenciesStream with error', async () => { + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListDependenciesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.ListDependenciesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listDependencies.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listDependenciesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.apihub.v1.Dependency[] = []; + stream.on( + 'data', + (response: protos.google.cloud.apihub.v1.Dependency) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listDependencies.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listDependencies, request) + ); + assert( + (client.descriptors.page.listDependencies.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + + it('uses async iteration with listDependencies without error', async () => { + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListDependenciesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.ListDependenciesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.Dependency()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Dependency()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Dependency()), + ]; + client.descriptors.page.listDependencies.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.apihub.v1.IDependency[] = []; + const iterable = client.listDependenciesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listDependencies.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listDependencies.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + + it('uses async iteration with listDependencies with error', async () => { + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListDependenciesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.ListDependenciesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listDependencies.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listDependenciesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.apihub.v1.IDependency[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listDependencies.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listDependencies.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + 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 apihubdependenciesModule.v1.ApiHubDependenciesClient({ + 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 apihubdependenciesModule.v1.ApiHubDependenciesClient({ + 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 apihubdependenciesModule.v1.ApiHubDependenciesClient({ + 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 apihubdependenciesModule.v1.ApiHubDependenciesClient({ + 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('Path templates', () => { + describe('api', () => { + const fakePath = '/rendered/path/api'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + api: 'apiValue', + }; + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.apiPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.apiPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('apiPath', () => { + const result = client.apiPath( + 'projectValue', + 'locationValue', + 'apiValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.apiPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromApiName', () => { + const result = client.matchProjectFromApiName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.apiPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromApiName', () => { + const result = client.matchLocationFromApiName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.apiPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchApiFromApiName', () => { + const result = client.matchApiFromApiName(fakePath); + assert.strictEqual(result, 'apiValue'); + assert( + (client.pathTemplates.apiPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('apiHubInstance', () => { + const fakePath = '/rendered/path/apiHubInstance'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + api_hub_instance: 'apiHubInstanceValue', + }; + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.apiHubInstancePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.apiHubInstancePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('apiHubInstancePath', () => { + const result = client.apiHubInstancePath( + 'projectValue', + 'locationValue', + 'apiHubInstanceValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.apiHubInstancePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromApiHubInstanceName', () => { + const result = client.matchProjectFromApiHubInstanceName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromApiHubInstanceName', () => { + const result = client.matchLocationFromApiHubInstanceName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchApiHubInstanceFromApiHubInstanceName', () => { + const result = + client.matchApiHubInstanceFromApiHubInstanceName(fakePath); + assert.strictEqual(result, 'apiHubInstanceValue'); + assert( + (client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('apiOperation', () => { + const fakePath = '/rendered/path/apiOperation'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + api: 'apiValue', + version: 'versionValue', + operation: 'operationValue', + }; + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.apiOperationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.apiOperationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('apiOperationPath', () => { + const result = client.apiOperationPath( + 'projectValue', + 'locationValue', + 'apiValue', + 'versionValue', + 'operationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.apiOperationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromApiOperationName', () => { + const result = client.matchProjectFromApiOperationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromApiOperationName', () => { + const result = client.matchLocationFromApiOperationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchApiFromApiOperationName', () => { + const result = client.matchApiFromApiOperationName(fakePath); + assert.strictEqual(result, 'apiValue'); + assert( + (client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchVersionFromApiOperationName', () => { + const result = client.matchVersionFromApiOperationName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchOperationFromApiOperationName', () => { + const result = client.matchOperationFromApiOperationName(fakePath); + assert.strictEqual(result, 'operationValue'); + assert( + (client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('attribute', () => { + const fakePath = '/rendered/path/attribute'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + attribute: 'attributeValue', + }; + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.attributePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.attributePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('attributePath', () => { + const result = client.attributePath( + 'projectValue', + 'locationValue', + 'attributeValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.attributePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromAttributeName', () => { + const result = client.matchProjectFromAttributeName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.attributePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromAttributeName', () => { + const result = client.matchLocationFromAttributeName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.attributePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAttributeFromAttributeName', () => { + const result = client.matchAttributeFromAttributeName(fakePath); + assert.strictEqual(result, 'attributeValue'); + assert( + (client.pathTemplates.attributePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('definition', () => { + const fakePath = '/rendered/path/definition'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + api: 'apiValue', + version: 'versionValue', + definition: 'definitionValue', + }; + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.definitionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.definitionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('definitionPath', () => { + const result = client.definitionPath( + 'projectValue', + 'locationValue', + 'apiValue', + 'versionValue', + 'definitionValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.definitionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromDefinitionName', () => { + const result = client.matchProjectFromDefinitionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromDefinitionName', () => { + const result = client.matchLocationFromDefinitionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchApiFromDefinitionName', () => { + const result = client.matchApiFromDefinitionName(fakePath); + assert.strictEqual(result, 'apiValue'); + assert( + (client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchVersionFromDefinitionName', () => { + const result = client.matchVersionFromDefinitionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDefinitionFromDefinitionName', () => { + const result = client.matchDefinitionFromDefinitionName(fakePath); + assert.strictEqual(result, 'definitionValue'); + assert( + (client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('dependency', () => { + const fakePath = '/rendered/path/dependency'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + dependency: 'dependencyValue', + }; + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dependencyPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.dependencyPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('dependencyPath', () => { + const result = client.dependencyPath( + 'projectValue', + 'locationValue', + 'dependencyValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.dependencyPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromDependencyName', () => { + const result = client.matchProjectFromDependencyName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.dependencyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromDependencyName', () => { + const result = client.matchLocationFromDependencyName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.dependencyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDependencyFromDependencyName', () => { + const result = client.matchDependencyFromDependencyName(fakePath); + assert.strictEqual(result, 'dependencyValue'); + assert( + (client.pathTemplates.dependencyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('deployment', () => { + const fakePath = '/rendered/path/deployment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + deployment: 'deploymentValue', + }; + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.deploymentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.deploymentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('deploymentPath', () => { + const result = client.deploymentPath( + 'projectValue', + 'locationValue', + 'deploymentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.deploymentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromDeploymentName', () => { + const result = client.matchProjectFromDeploymentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromDeploymentName', () => { + const result = client.matchLocationFromDeploymentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDeploymentFromDeploymentName', () => { + const result = client.matchDeploymentFromDeploymentName(fakePath); + assert.strictEqual(result, 'deploymentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('externalApi', () => { + const fakePath = '/rendered/path/externalApi'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + external_api: 'externalApiValue', + }; + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.externalApiPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.externalApiPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('externalApiPath', () => { + const result = client.externalApiPath( + 'projectValue', + 'locationValue', + 'externalApiValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.externalApiPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromExternalApiName', () => { + const result = client.matchProjectFromExternalApiName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.externalApiPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromExternalApiName', () => { + const result = client.matchLocationFromExternalApiName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.externalApiPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchExternalApiFromExternalApiName', () => { + const result = client.matchExternalApiFromExternalApiName(fakePath); + assert.strictEqual(result, 'externalApiValue'); + assert( + (client.pathTemplates.externalApiPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('hostProjectRegistration', () => { + const fakePath = '/rendered/path/hostProjectRegistration'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + host_project_registration: 'hostProjectRegistrationValue', + }; + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.hostProjectRegistrationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.hostProjectRegistrationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('hostProjectRegistrationPath', () => { + const result = client.hostProjectRegistrationPath( + 'projectValue', + 'locationValue', + 'hostProjectRegistrationValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.hostProjectRegistrationPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromHostProjectRegistrationName', () => { + const result = + client.matchProjectFromHostProjectRegistrationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.hostProjectRegistrationPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromHostProjectRegistrationName', () => { + const result = + client.matchLocationFromHostProjectRegistrationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.hostProjectRegistrationPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchHostProjectRegistrationFromHostProjectRegistrationName', () => { + const result = + client.matchHostProjectRegistrationFromHostProjectRegistrationName( + fakePath + ); + assert.strictEqual(result, 'hostProjectRegistrationValue'); + assert( + ( + client.pathTemplates.hostProjectRegistrationPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('location', () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.locationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.locationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath('projectValue', 'locationValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('plugin', () => { + const fakePath = '/rendered/path/plugin'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + plugin: 'pluginValue', + }; + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.pluginPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.pluginPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('pluginPath', () => { + const result = client.pluginPath( + 'projectValue', + 'locationValue', + 'pluginValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.pluginPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromPluginName', () => { + const result = client.matchProjectFromPluginName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.pluginPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromPluginName', () => { + const result = client.matchLocationFromPluginName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.pluginPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchPluginFromPluginName', () => { + const result = client.matchPluginFromPluginName(fakePath); + assert.strictEqual(result, 'pluginValue'); + assert( + (client.pathTemplates.pluginPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('project', () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('runtimeProjectAttachment', () => { + const fakePath = '/rendered/path/runtimeProjectAttachment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + runtime_project_attachment: 'runtimeProjectAttachmentValue', + }; + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.runtimeProjectAttachmentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.runtimeProjectAttachmentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('runtimeProjectAttachmentPath', () => { + const result = client.runtimeProjectAttachmentPath( + 'projectValue', + 'locationValue', + 'runtimeProjectAttachmentValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.runtimeProjectAttachmentPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRuntimeProjectAttachmentName', () => { + const result = + client.matchProjectFromRuntimeProjectAttachmentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.runtimeProjectAttachmentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromRuntimeProjectAttachmentName', () => { + const result = + client.matchLocationFromRuntimeProjectAttachmentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.runtimeProjectAttachmentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName', () => { + const result = + client.matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName( + fakePath + ); + assert.strictEqual(result, 'runtimeProjectAttachmentValue'); + assert( + ( + client.pathTemplates.runtimeProjectAttachmentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('spec', () => { + const fakePath = '/rendered/path/spec'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + api: 'apiValue', + version: 'versionValue', + spec: 'specValue', + }; + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.specPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.specPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('specPath', () => { + const result = client.specPath( + 'projectValue', + 'locationValue', + 'apiValue', + 'versionValue', + 'specValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.specPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromSpecName', () => { + const result = client.matchProjectFromSpecName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromSpecName', () => { + const result = client.matchLocationFromSpecName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchApiFromSpecName', () => { + const result = client.matchApiFromSpecName(fakePath); + assert.strictEqual(result, 'apiValue'); + assert( + (client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchVersionFromSpecName', () => { + const result = client.matchVersionFromSpecName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSpecFromSpecName', () => { + const result = client.matchSpecFromSpecName(fakePath); + assert.strictEqual(result, 'specValue'); + assert( + (client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('styleGuide', () => { + const fakePath = '/rendered/path/styleGuide'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + plugin: 'pluginValue', + }; + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.styleGuidePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.styleGuidePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('styleGuidePath', () => { + const result = client.styleGuidePath( + 'projectValue', + 'locationValue', + 'pluginValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.styleGuidePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromStyleGuideName', () => { + const result = client.matchProjectFromStyleGuideName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.styleGuidePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromStyleGuideName', () => { + const result = client.matchLocationFromStyleGuideName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.styleGuidePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchPluginFromStyleGuideName', () => { + const result = client.matchPluginFromStyleGuideName(fakePath); + assert.strictEqual(result, 'pluginValue'); + assert( + (client.pathTemplates.styleGuidePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('version', () => { + const fakePath = '/rendered/path/version'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + api: 'apiValue', + version: 'versionValue', + }; + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.versionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.versionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('versionPath', () => { + const result = client.versionPath( + 'projectValue', + 'locationValue', + 'apiValue', + 'versionValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.versionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromVersionName', () => { + const result = client.matchProjectFromVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromVersionName', () => { + const result = client.matchLocationFromVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchApiFromVersionName', () => { + const result = client.matchApiFromVersionName(fakePath); + assert.strictEqual(result, 'apiValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchVersionFromVersionName', () => { + const result = client.matchVersionFromVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-apihub/test/gapic_api_hub_plugin_v1.ts b/packages/google-cloud-apihub/test/gapic_api_hub_plugin_v1.ts new file mode 100644 index 00000000000..d0a92b2fa23 --- /dev/null +++ b/packages/google-cloud-apihub/test/gapic_api_hub_plugin_v1.ts @@ -0,0 +1,1869 @@ +// Copyright 2024 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 apihubpluginModule from '../src'; + +import {protobuf, 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 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.ApiHubPluginClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new apihubpluginModule.v1.ApiHubPluginClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'apihub.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new apihubpluginModule.v1.ApiHubPluginClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, 'googleapis.com'); + }); + + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = + apihubpluginModule.v1.ApiHubPluginClient.servicePath; + assert.strictEqual(servicePath, 'apihub.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = + apihubpluginModule.v1.ApiHubPluginClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'apihub.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new apihubpluginModule.v1.ApiHubPluginClient({ + universeDomain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'apihub.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new apihubpluginModule.v1.ApiHubPluginClient({ + universe_domain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'apihub.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new apihubpluginModule.v1.ApiHubPluginClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'apihub.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new apihubpluginModule.v1.ApiHubPluginClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'apihub.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { + new apihubpluginModule.v1.ApiHubPluginClient({ + universe_domain: 'example.com', + universeDomain: 'example.net', + }); + }); + }); + + it('has port', () => { + const port = apihubpluginModule.v1.ApiHubPluginClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new apihubpluginModule.v1.ApiHubPluginClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new apihubpluginModule.v1.ApiHubPluginClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new apihubpluginModule.v1.ApiHubPluginClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.apiHubPluginStub, undefined); + await client.initialize(); + assert(client.apiHubPluginStub); + }); + + it('has close method for the initialized client', done => { + const client = new apihubpluginModule.v1.ApiHubPluginClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.apiHubPluginStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new apihubpluginModule.v1.ApiHubPluginClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.apiHubPluginStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new apihubpluginModule.v1.ApiHubPluginClient({ + 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 apihubpluginModule.v1.ApiHubPluginClient({ + 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('getPlugin', () => { + it('invokes getPlugin without error', async () => { + const client = new apihubpluginModule.v1.ApiHubPluginClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetPluginRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.GetPluginRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Plugin() + ); + client.innerApiCalls.getPlugin = stubSimpleCall(expectedResponse); + const [response] = await client.getPlugin(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getPlugin as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getPlugin as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getPlugin without error using callback', async () => { + const client = new apihubpluginModule.v1.ApiHubPluginClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetPluginRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.GetPluginRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Plugin() + ); + client.innerApiCalls.getPlugin = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getPlugin( + request, + ( + err?: Error | null, + result?: protos.google.cloud.apihub.v1.IPlugin | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getPlugin as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getPlugin as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getPlugin with error', async () => { + const client = new apihubpluginModule.v1.ApiHubPluginClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetPluginRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.GetPluginRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getPlugin = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getPlugin(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getPlugin as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getPlugin as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getPlugin with closed client', async () => { + const client = new apihubpluginModule.v1.ApiHubPluginClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetPluginRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.GetPluginRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getPlugin(request), expectedError); + }); + }); + + describe('enablePlugin', () => { + it('invokes enablePlugin without error', async () => { + const client = new apihubpluginModule.v1.ApiHubPluginClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.EnablePluginRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.EnablePluginRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Plugin() + ); + client.innerApiCalls.enablePlugin = stubSimpleCall(expectedResponse); + const [response] = await client.enablePlugin(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.enablePlugin as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.enablePlugin as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes enablePlugin without error using callback', async () => { + const client = new apihubpluginModule.v1.ApiHubPluginClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.EnablePluginRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.EnablePluginRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Plugin() + ); + client.innerApiCalls.enablePlugin = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.enablePlugin( + request, + ( + err?: Error | null, + result?: protos.google.cloud.apihub.v1.IPlugin | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.enablePlugin as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.enablePlugin as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes enablePlugin with error', async () => { + const client = new apihubpluginModule.v1.ApiHubPluginClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.EnablePluginRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.EnablePluginRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.enablePlugin = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.enablePlugin(request), expectedError); + const actualRequest = ( + client.innerApiCalls.enablePlugin as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.enablePlugin as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes enablePlugin with closed client', async () => { + const client = new apihubpluginModule.v1.ApiHubPluginClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.EnablePluginRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.EnablePluginRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.enablePlugin(request), expectedError); + }); + }); + + describe('disablePlugin', () => { + it('invokes disablePlugin without error', async () => { + const client = new apihubpluginModule.v1.ApiHubPluginClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DisablePluginRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.DisablePluginRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Plugin() + ); + client.innerApiCalls.disablePlugin = stubSimpleCall(expectedResponse); + const [response] = await client.disablePlugin(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.disablePlugin as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.disablePlugin as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes disablePlugin without error using callback', async () => { + const client = new apihubpluginModule.v1.ApiHubPluginClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DisablePluginRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.DisablePluginRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Plugin() + ); + client.innerApiCalls.disablePlugin = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.disablePlugin( + request, + ( + err?: Error | null, + result?: protos.google.cloud.apihub.v1.IPlugin | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.disablePlugin as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.disablePlugin as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes disablePlugin with error', async () => { + const client = new apihubpluginModule.v1.ApiHubPluginClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DisablePluginRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.DisablePluginRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.disablePlugin = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.disablePlugin(request), expectedError); + const actualRequest = ( + client.innerApiCalls.disablePlugin as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.disablePlugin as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes disablePlugin with closed client', async () => { + const client = new apihubpluginModule.v1.ApiHubPluginClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DisablePluginRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.DisablePluginRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.disablePlugin(request), expectedError); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new apihubpluginModule.v1.ApiHubPluginClient({ + 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 apihubpluginModule.v1.ApiHubPluginClient({ + 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 apihubpluginModule.v1.ApiHubPluginClient({ + 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 apihubpluginModule.v1.ApiHubPluginClient({ + 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 apihubpluginModule.v1.ApiHubPluginClient({ + 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('Path templates', () => { + describe('api', () => { + const fakePath = '/rendered/path/api'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + api: 'apiValue', + }; + const client = new apihubpluginModule.v1.ApiHubPluginClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.apiPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.apiPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('apiPath', () => { + const result = client.apiPath( + 'projectValue', + 'locationValue', + 'apiValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.apiPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromApiName', () => { + const result = client.matchProjectFromApiName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.apiPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromApiName', () => { + const result = client.matchLocationFromApiName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.apiPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchApiFromApiName', () => { + const result = client.matchApiFromApiName(fakePath); + assert.strictEqual(result, 'apiValue'); + assert( + (client.pathTemplates.apiPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('apiHubInstance', () => { + const fakePath = '/rendered/path/apiHubInstance'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + api_hub_instance: 'apiHubInstanceValue', + }; + const client = new apihubpluginModule.v1.ApiHubPluginClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.apiHubInstancePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.apiHubInstancePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('apiHubInstancePath', () => { + const result = client.apiHubInstancePath( + 'projectValue', + 'locationValue', + 'apiHubInstanceValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.apiHubInstancePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromApiHubInstanceName', () => { + const result = client.matchProjectFromApiHubInstanceName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromApiHubInstanceName', () => { + const result = client.matchLocationFromApiHubInstanceName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchApiHubInstanceFromApiHubInstanceName', () => { + const result = + client.matchApiHubInstanceFromApiHubInstanceName(fakePath); + assert.strictEqual(result, 'apiHubInstanceValue'); + assert( + (client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('apiOperation', () => { + const fakePath = '/rendered/path/apiOperation'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + api: 'apiValue', + version: 'versionValue', + operation: 'operationValue', + }; + const client = new apihubpluginModule.v1.ApiHubPluginClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.apiOperationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.apiOperationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('apiOperationPath', () => { + const result = client.apiOperationPath( + 'projectValue', + 'locationValue', + 'apiValue', + 'versionValue', + 'operationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.apiOperationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromApiOperationName', () => { + const result = client.matchProjectFromApiOperationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromApiOperationName', () => { + const result = client.matchLocationFromApiOperationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchApiFromApiOperationName', () => { + const result = client.matchApiFromApiOperationName(fakePath); + assert.strictEqual(result, 'apiValue'); + assert( + (client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchVersionFromApiOperationName', () => { + const result = client.matchVersionFromApiOperationName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchOperationFromApiOperationName', () => { + const result = client.matchOperationFromApiOperationName(fakePath); + assert.strictEqual(result, 'operationValue'); + assert( + (client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('attribute', () => { + const fakePath = '/rendered/path/attribute'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + attribute: 'attributeValue', + }; + const client = new apihubpluginModule.v1.ApiHubPluginClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.attributePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.attributePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('attributePath', () => { + const result = client.attributePath( + 'projectValue', + 'locationValue', + 'attributeValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.attributePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromAttributeName', () => { + const result = client.matchProjectFromAttributeName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.attributePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromAttributeName', () => { + const result = client.matchLocationFromAttributeName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.attributePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAttributeFromAttributeName', () => { + const result = client.matchAttributeFromAttributeName(fakePath); + assert.strictEqual(result, 'attributeValue'); + assert( + (client.pathTemplates.attributePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('definition', () => { + const fakePath = '/rendered/path/definition'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + api: 'apiValue', + version: 'versionValue', + definition: 'definitionValue', + }; + const client = new apihubpluginModule.v1.ApiHubPluginClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.definitionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.definitionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('definitionPath', () => { + const result = client.definitionPath( + 'projectValue', + 'locationValue', + 'apiValue', + 'versionValue', + 'definitionValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.definitionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromDefinitionName', () => { + const result = client.matchProjectFromDefinitionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromDefinitionName', () => { + const result = client.matchLocationFromDefinitionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchApiFromDefinitionName', () => { + const result = client.matchApiFromDefinitionName(fakePath); + assert.strictEqual(result, 'apiValue'); + assert( + (client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchVersionFromDefinitionName', () => { + const result = client.matchVersionFromDefinitionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDefinitionFromDefinitionName', () => { + const result = client.matchDefinitionFromDefinitionName(fakePath); + assert.strictEqual(result, 'definitionValue'); + assert( + (client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('dependency', () => { + const fakePath = '/rendered/path/dependency'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + dependency: 'dependencyValue', + }; + const client = new apihubpluginModule.v1.ApiHubPluginClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dependencyPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.dependencyPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('dependencyPath', () => { + const result = client.dependencyPath( + 'projectValue', + 'locationValue', + 'dependencyValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.dependencyPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromDependencyName', () => { + const result = client.matchProjectFromDependencyName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.dependencyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromDependencyName', () => { + const result = client.matchLocationFromDependencyName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.dependencyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDependencyFromDependencyName', () => { + const result = client.matchDependencyFromDependencyName(fakePath); + assert.strictEqual(result, 'dependencyValue'); + assert( + (client.pathTemplates.dependencyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('deployment', () => { + const fakePath = '/rendered/path/deployment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + deployment: 'deploymentValue', + }; + const client = new apihubpluginModule.v1.ApiHubPluginClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.deploymentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.deploymentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('deploymentPath', () => { + const result = client.deploymentPath( + 'projectValue', + 'locationValue', + 'deploymentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.deploymentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromDeploymentName', () => { + const result = client.matchProjectFromDeploymentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromDeploymentName', () => { + const result = client.matchLocationFromDeploymentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDeploymentFromDeploymentName', () => { + const result = client.matchDeploymentFromDeploymentName(fakePath); + assert.strictEqual(result, 'deploymentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('externalApi', () => { + const fakePath = '/rendered/path/externalApi'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + external_api: 'externalApiValue', + }; + const client = new apihubpluginModule.v1.ApiHubPluginClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.externalApiPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.externalApiPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('externalApiPath', () => { + const result = client.externalApiPath( + 'projectValue', + 'locationValue', + 'externalApiValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.externalApiPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromExternalApiName', () => { + const result = client.matchProjectFromExternalApiName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.externalApiPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromExternalApiName', () => { + const result = client.matchLocationFromExternalApiName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.externalApiPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchExternalApiFromExternalApiName', () => { + const result = client.matchExternalApiFromExternalApiName(fakePath); + assert.strictEqual(result, 'externalApiValue'); + assert( + (client.pathTemplates.externalApiPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('hostProjectRegistration', () => { + const fakePath = '/rendered/path/hostProjectRegistration'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + host_project_registration: 'hostProjectRegistrationValue', + }; + const client = new apihubpluginModule.v1.ApiHubPluginClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.hostProjectRegistrationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.hostProjectRegistrationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('hostProjectRegistrationPath', () => { + const result = client.hostProjectRegistrationPath( + 'projectValue', + 'locationValue', + 'hostProjectRegistrationValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.hostProjectRegistrationPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromHostProjectRegistrationName', () => { + const result = + client.matchProjectFromHostProjectRegistrationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.hostProjectRegistrationPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromHostProjectRegistrationName', () => { + const result = + client.matchLocationFromHostProjectRegistrationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.hostProjectRegistrationPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchHostProjectRegistrationFromHostProjectRegistrationName', () => { + const result = + client.matchHostProjectRegistrationFromHostProjectRegistrationName( + fakePath + ); + assert.strictEqual(result, 'hostProjectRegistrationValue'); + assert( + ( + client.pathTemplates.hostProjectRegistrationPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('plugin', () => { + const fakePath = '/rendered/path/plugin'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + plugin: 'pluginValue', + }; + const client = new apihubpluginModule.v1.ApiHubPluginClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.pluginPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.pluginPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('pluginPath', () => { + const result = client.pluginPath( + 'projectValue', + 'locationValue', + 'pluginValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.pluginPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromPluginName', () => { + const result = client.matchProjectFromPluginName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.pluginPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromPluginName', () => { + const result = client.matchLocationFromPluginName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.pluginPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchPluginFromPluginName', () => { + const result = client.matchPluginFromPluginName(fakePath); + assert.strictEqual(result, 'pluginValue'); + assert( + (client.pathTemplates.pluginPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('runtimeProjectAttachment', () => { + const fakePath = '/rendered/path/runtimeProjectAttachment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + runtime_project_attachment: 'runtimeProjectAttachmentValue', + }; + const client = new apihubpluginModule.v1.ApiHubPluginClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.runtimeProjectAttachmentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.runtimeProjectAttachmentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('runtimeProjectAttachmentPath', () => { + const result = client.runtimeProjectAttachmentPath( + 'projectValue', + 'locationValue', + 'runtimeProjectAttachmentValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.runtimeProjectAttachmentPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRuntimeProjectAttachmentName', () => { + const result = + client.matchProjectFromRuntimeProjectAttachmentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.runtimeProjectAttachmentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromRuntimeProjectAttachmentName', () => { + const result = + client.matchLocationFromRuntimeProjectAttachmentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.runtimeProjectAttachmentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName', () => { + const result = + client.matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName( + fakePath + ); + assert.strictEqual(result, 'runtimeProjectAttachmentValue'); + assert( + ( + client.pathTemplates.runtimeProjectAttachmentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('spec', () => { + const fakePath = '/rendered/path/spec'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + api: 'apiValue', + version: 'versionValue', + spec: 'specValue', + }; + const client = new apihubpluginModule.v1.ApiHubPluginClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.specPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.specPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('specPath', () => { + const result = client.specPath( + 'projectValue', + 'locationValue', + 'apiValue', + 'versionValue', + 'specValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.specPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromSpecName', () => { + const result = client.matchProjectFromSpecName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromSpecName', () => { + const result = client.matchLocationFromSpecName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchApiFromSpecName', () => { + const result = client.matchApiFromSpecName(fakePath); + assert.strictEqual(result, 'apiValue'); + assert( + (client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchVersionFromSpecName', () => { + const result = client.matchVersionFromSpecName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSpecFromSpecName', () => { + const result = client.matchSpecFromSpecName(fakePath); + assert.strictEqual(result, 'specValue'); + assert( + (client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('styleGuide', () => { + const fakePath = '/rendered/path/styleGuide'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + plugin: 'pluginValue', + }; + const client = new apihubpluginModule.v1.ApiHubPluginClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.styleGuidePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.styleGuidePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('styleGuidePath', () => { + const result = client.styleGuidePath( + 'projectValue', + 'locationValue', + 'pluginValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.styleGuidePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromStyleGuideName', () => { + const result = client.matchProjectFromStyleGuideName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.styleGuidePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromStyleGuideName', () => { + const result = client.matchLocationFromStyleGuideName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.styleGuidePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchPluginFromStyleGuideName', () => { + const result = client.matchPluginFromStyleGuideName(fakePath); + assert.strictEqual(result, 'pluginValue'); + assert( + (client.pathTemplates.styleGuidePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('version', () => { + const fakePath = '/rendered/path/version'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + api: 'apiValue', + version: 'versionValue', + }; + const client = new apihubpluginModule.v1.ApiHubPluginClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.versionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.versionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('versionPath', () => { + const result = client.versionPath( + 'projectValue', + 'locationValue', + 'apiValue', + 'versionValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.versionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromVersionName', () => { + const result = client.matchProjectFromVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromVersionName', () => { + const result = client.matchLocationFromVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchApiFromVersionName', () => { + const result = client.matchApiFromVersionName(fakePath); + assert.strictEqual(result, 'apiValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchVersionFromVersionName', () => { + const result = client.matchVersionFromVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-apihub/test/gapic_api_hub_v1.ts b/packages/google-cloud-apihub/test/gapic_api_hub_v1.ts new file mode 100644 index 00000000000..45e66ae29e2 --- /dev/null +++ b/packages/google-cloud-apihub/test/gapic_api_hub_v1.ts @@ -0,0 +1,7516 @@ +// Copyright 2024 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 apihubModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, 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 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.ApiHubClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new apihubModule.v1.ApiHubClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'apihub.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new apihubModule.v1.ApiHubClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, 'googleapis.com'); + }); + + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = apihubModule.v1.ApiHubClient.servicePath; + assert.strictEqual(servicePath, 'apihub.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = apihubModule.v1.ApiHubClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'apihub.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new apihubModule.v1.ApiHubClient({ + universeDomain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'apihub.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new apihubModule.v1.ApiHubClient({ + universe_domain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'apihub.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new apihubModule.v1.ApiHubClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'apihub.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new apihubModule.v1.ApiHubClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'apihub.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { + new apihubModule.v1.ApiHubClient({ + universe_domain: 'example.com', + universeDomain: 'example.net', + }); + }); + }); + + it('has port', () => { + const port = apihubModule.v1.ApiHubClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new apihubModule.v1.ApiHubClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new apihubModule.v1.ApiHubClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.apiHubStub, undefined); + await client.initialize(); + assert(client.apiHubStub); + }); + + it('has close method for the initialized client', done => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.apiHubStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.apiHubStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new apihubModule.v1.ApiHubClient({ + 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 apihubModule.v1.ApiHubClient({ + 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('createApi', () => { + it('invokes createApi without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateApiRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.CreateApiRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Api() + ); + client.innerApiCalls.createApi = stubSimpleCall(expectedResponse); + const [response] = await client.createApi(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createApi as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createApi as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createApi without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateApiRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.CreateApiRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Api() + ); + client.innerApiCalls.createApi = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createApi( + request, + ( + err?: Error | null, + result?: protos.google.cloud.apihub.v1.IApi | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createApi as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createApi as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createApi with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateApiRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.CreateApiRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createApi = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createApi(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createApi as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createApi as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createApi with closed client', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateApiRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.CreateApiRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createApi(request), expectedError); + }); + }); + + describe('getApi', () => { + it('invokes getApi without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetApiRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.GetApiRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Api() + ); + client.innerApiCalls.getApi = stubSimpleCall(expectedResponse); + const [response] = await client.getApi(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getApi as SinonStub).getCall( + 0 + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getApi as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getApi without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetApiRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.GetApiRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Api() + ); + client.innerApiCalls.getApi = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getApi( + request, + ( + err?: Error | null, + result?: protos.google.cloud.apihub.v1.IApi | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getApi as SinonStub).getCall( + 0 + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getApi as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getApi with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetApiRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.GetApiRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getApi = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getApi(request), expectedError); + const actualRequest = (client.innerApiCalls.getApi as SinonStub).getCall( + 0 + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getApi as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getApi with closed client', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetApiRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.GetApiRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getApi(request), expectedError); + }); + }); + + describe('updateApi', () => { + it('invokes updateApi without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.UpdateApiRequest() + ); + request.api ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.UpdateApiRequest', + ['api', 'name'] + ); + request.api.name = defaultValue1; + const expectedHeaderRequestParams = `api.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Api() + ); + client.innerApiCalls.updateApi = stubSimpleCall(expectedResponse); + const [response] = await client.updateApi(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateApi as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateApi as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateApi without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.UpdateApiRequest() + ); + request.api ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.UpdateApiRequest', + ['api', 'name'] + ); + request.api.name = defaultValue1; + const expectedHeaderRequestParams = `api.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Api() + ); + client.innerApiCalls.updateApi = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateApi( + request, + ( + err?: Error | null, + result?: protos.google.cloud.apihub.v1.IApi | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateApi as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateApi as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateApi with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.UpdateApiRequest() + ); + request.api ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.UpdateApiRequest', + ['api', 'name'] + ); + request.api.name = defaultValue1; + const expectedHeaderRequestParams = `api.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateApi = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateApi(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateApi as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateApi as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateApi with closed client', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.UpdateApiRequest() + ); + request.api ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.UpdateApiRequest', + ['api', 'name'] + ); + request.api.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateApi(request), expectedError); + }); + }); + + describe('deleteApi', () => { + it('invokes deleteApi without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DeleteApiRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.DeleteApiRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteApi = stubSimpleCall(expectedResponse); + const [response] = await client.deleteApi(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteApi as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteApi as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteApi without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DeleteApiRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.DeleteApiRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteApi = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteApi( + request, + ( + err?: Error | null, + result?: protos.google.protobuf.IEmpty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteApi as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteApi as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteApi with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DeleteApiRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.DeleteApiRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteApi = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteApi(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteApi as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteApi as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteApi with closed client', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DeleteApiRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.DeleteApiRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteApi(request), expectedError); + }); + }); + + describe('createVersion', () => { + it('invokes createVersion without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateVersionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.CreateVersionRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Version() + ); + client.innerApiCalls.createVersion = stubSimpleCall(expectedResponse); + const [response] = await client.createVersion(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createVersion without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateVersionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.CreateVersionRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Version() + ); + client.innerApiCalls.createVersion = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createVersion( + request, + ( + err?: Error | null, + result?: protos.google.cloud.apihub.v1.IVersion | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createVersion with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateVersionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.CreateVersionRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createVersion = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.createVersion(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createVersion with closed client', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateVersionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.CreateVersionRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createVersion(request), expectedError); + }); + }); + + describe('getVersion', () => { + it('invokes getVersion without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetVersionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.GetVersionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Version() + ); + client.innerApiCalls.getVersion = stubSimpleCall(expectedResponse); + const [response] = await client.getVersion(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getVersion without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetVersionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.GetVersionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Version() + ); + client.innerApiCalls.getVersion = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getVersion( + request, + ( + err?: Error | null, + result?: protos.google.cloud.apihub.v1.IVersion | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getVersion with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetVersionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.GetVersionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getVersion = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getVersion(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getVersion with closed client', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetVersionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.GetVersionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getVersion(request), expectedError); + }); + }); + + describe('updateVersion', () => { + it('invokes updateVersion without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.UpdateVersionRequest() + ); + request.version ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.UpdateVersionRequest', + ['version', 'name'] + ); + request.version.name = defaultValue1; + const expectedHeaderRequestParams = `version.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Version() + ); + client.innerApiCalls.updateVersion = stubSimpleCall(expectedResponse); + const [response] = await client.updateVersion(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateVersion without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.UpdateVersionRequest() + ); + request.version ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.UpdateVersionRequest', + ['version', 'name'] + ); + request.version.name = defaultValue1; + const expectedHeaderRequestParams = `version.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Version() + ); + client.innerApiCalls.updateVersion = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateVersion( + request, + ( + err?: Error | null, + result?: protos.google.cloud.apihub.v1.IVersion | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateVersion with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.UpdateVersionRequest() + ); + request.version ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.UpdateVersionRequest', + ['version', 'name'] + ); + request.version.name = defaultValue1; + const expectedHeaderRequestParams = `version.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateVersion = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateVersion(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateVersion with closed client', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.UpdateVersionRequest() + ); + request.version ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.UpdateVersionRequest', + ['version', 'name'] + ); + request.version.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateVersion(request), expectedError); + }); + }); + + describe('deleteVersion', () => { + it('invokes deleteVersion without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DeleteVersionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.DeleteVersionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteVersion = stubSimpleCall(expectedResponse); + const [response] = await client.deleteVersion(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteVersion without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DeleteVersionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.DeleteVersionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteVersion = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteVersion( + request, + ( + err?: Error | null, + result?: protos.google.protobuf.IEmpty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteVersion with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DeleteVersionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.DeleteVersionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteVersion = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteVersion(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteVersion with closed client', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DeleteVersionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.DeleteVersionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteVersion(request), expectedError); + }); + }); + + describe('createSpec', () => { + it('invokes createSpec without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateSpecRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.CreateSpecRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Spec() + ); + client.innerApiCalls.createSpec = stubSimpleCall(expectedResponse); + const [response] = await client.createSpec(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createSpec as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createSpec as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSpec without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateSpecRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.CreateSpecRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Spec() + ); + client.innerApiCalls.createSpec = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createSpec( + request, + ( + err?: Error | null, + result?: protos.google.cloud.apihub.v1.ISpec | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createSpec as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createSpec as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSpec with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateSpecRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.CreateSpecRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createSpec = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.createSpec(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createSpec as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createSpec as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSpec with closed client', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateSpecRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.CreateSpecRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createSpec(request), expectedError); + }); + }); + + describe('getSpec', () => { + it('invokes getSpec without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetSpecRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.GetSpecRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Spec() + ); + client.innerApiCalls.getSpec = stubSimpleCall(expectedResponse); + const [response] = await client.getSpec(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getSpec as SinonStub).getCall( + 0 + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSpec as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSpec without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetSpecRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.GetSpecRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Spec() + ); + client.innerApiCalls.getSpec = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getSpec( + request, + ( + err?: Error | null, + result?: protos.google.cloud.apihub.v1.ISpec | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getSpec as SinonStub).getCall( + 0 + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSpec as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSpec with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetSpecRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.GetSpecRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getSpec = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getSpec(request), expectedError); + const actualRequest = (client.innerApiCalls.getSpec as SinonStub).getCall( + 0 + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSpec as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSpec with closed client', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetSpecRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.GetSpecRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getSpec(request), expectedError); + }); + }); + + describe('getSpecContents', () => { + it('invokes getSpecContents without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetSpecContentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.GetSpecContentsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.SpecContents() + ); + client.innerApiCalls.getSpecContents = stubSimpleCall(expectedResponse); + const [response] = await client.getSpecContents(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getSpecContents as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSpecContents as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSpecContents without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetSpecContentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.GetSpecContentsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.SpecContents() + ); + client.innerApiCalls.getSpecContents = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getSpecContents( + request, + ( + err?: Error | null, + result?: protos.google.cloud.apihub.v1.ISpecContents | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getSpecContents as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSpecContents as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSpecContents with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetSpecContentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.GetSpecContentsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getSpecContents = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getSpecContents(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getSpecContents as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSpecContents as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSpecContents with closed client', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetSpecContentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.GetSpecContentsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getSpecContents(request), expectedError); + }); + }); + + describe('updateSpec', () => { + it('invokes updateSpec without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.UpdateSpecRequest() + ); + request.spec ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.UpdateSpecRequest', + ['spec', 'name'] + ); + request.spec.name = defaultValue1; + const expectedHeaderRequestParams = `spec.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Spec() + ); + client.innerApiCalls.updateSpec = stubSimpleCall(expectedResponse); + const [response] = await client.updateSpec(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateSpec as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSpec as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSpec without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.UpdateSpecRequest() + ); + request.spec ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.UpdateSpecRequest', + ['spec', 'name'] + ); + request.spec.name = defaultValue1; + const expectedHeaderRequestParams = `spec.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Spec() + ); + client.innerApiCalls.updateSpec = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateSpec( + request, + ( + err?: Error | null, + result?: protos.google.cloud.apihub.v1.ISpec | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateSpec as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSpec as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSpec with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.UpdateSpecRequest() + ); + request.spec ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.UpdateSpecRequest', + ['spec', 'name'] + ); + request.spec.name = defaultValue1; + const expectedHeaderRequestParams = `spec.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateSpec = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateSpec(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateSpec as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSpec as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSpec with closed client', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.UpdateSpecRequest() + ); + request.spec ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.UpdateSpecRequest', + ['spec', 'name'] + ); + request.spec.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateSpec(request), expectedError); + }); + }); + + describe('deleteSpec', () => { + it('invokes deleteSpec without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DeleteSpecRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.DeleteSpecRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteSpec = stubSimpleCall(expectedResponse); + const [response] = await client.deleteSpec(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteSpec as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteSpec as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSpec without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DeleteSpecRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.DeleteSpecRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteSpec = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteSpec( + request, + ( + err?: Error | null, + result?: protos.google.protobuf.IEmpty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteSpec as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteSpec as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSpec with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DeleteSpecRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.DeleteSpecRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteSpec = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteSpec(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteSpec as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteSpec as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSpec with closed client', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DeleteSpecRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.DeleteSpecRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteSpec(request), expectedError); + }); + }); + + describe('getApiOperation', () => { + it('invokes getApiOperation without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetApiOperationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.GetApiOperationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.ApiOperation() + ); + client.innerApiCalls.getApiOperation = stubSimpleCall(expectedResponse); + const [response] = await client.getApiOperation(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getApiOperation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getApiOperation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getApiOperation without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetApiOperationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.GetApiOperationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.ApiOperation() + ); + client.innerApiCalls.getApiOperation = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getApiOperation( + request, + ( + err?: Error | null, + result?: protos.google.cloud.apihub.v1.IApiOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getApiOperation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getApiOperation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getApiOperation with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetApiOperationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.GetApiOperationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getApiOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getApiOperation(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getApiOperation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getApiOperation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getApiOperation with closed client', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetApiOperationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.GetApiOperationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getApiOperation(request), expectedError); + }); + }); + + describe('getDefinition', () => { + it('invokes getDefinition without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetDefinitionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.GetDefinitionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Definition() + ); + client.innerApiCalls.getDefinition = stubSimpleCall(expectedResponse); + const [response] = await client.getDefinition(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getDefinition as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getDefinition as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDefinition without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetDefinitionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.GetDefinitionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Definition() + ); + client.innerApiCalls.getDefinition = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getDefinition( + request, + ( + err?: Error | null, + result?: protos.google.cloud.apihub.v1.IDefinition | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getDefinition as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getDefinition as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDefinition with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetDefinitionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.GetDefinitionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getDefinition = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getDefinition(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getDefinition as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getDefinition as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDefinition with closed client', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetDefinitionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.GetDefinitionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getDefinition(request), expectedError); + }); + }); + + describe('createDeployment', () => { + it('invokes createDeployment without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateDeploymentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.CreateDeploymentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Deployment() + ); + client.innerApiCalls.createDeployment = stubSimpleCall(expectedResponse); + const [response] = await client.createDeployment(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createDeployment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createDeployment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createDeployment without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateDeploymentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.CreateDeploymentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Deployment() + ); + client.innerApiCalls.createDeployment = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createDeployment( + request, + ( + err?: Error | null, + result?: protos.google.cloud.apihub.v1.IDeployment | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createDeployment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createDeployment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createDeployment with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateDeploymentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.CreateDeploymentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createDeployment = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.createDeployment(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createDeployment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createDeployment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createDeployment with closed client', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateDeploymentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.CreateDeploymentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createDeployment(request), expectedError); + }); + }); + + describe('getDeployment', () => { + it('invokes getDeployment without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetDeploymentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.GetDeploymentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Deployment() + ); + client.innerApiCalls.getDeployment = stubSimpleCall(expectedResponse); + const [response] = await client.getDeployment(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getDeployment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getDeployment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDeployment without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetDeploymentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.GetDeploymentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Deployment() + ); + client.innerApiCalls.getDeployment = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getDeployment( + request, + ( + err?: Error | null, + result?: protos.google.cloud.apihub.v1.IDeployment | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getDeployment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getDeployment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDeployment with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetDeploymentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.GetDeploymentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getDeployment = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getDeployment(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getDeployment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getDeployment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDeployment with closed client', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetDeploymentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.GetDeploymentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getDeployment(request), expectedError); + }); + }); + + describe('updateDeployment', () => { + it('invokes updateDeployment without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.UpdateDeploymentRequest() + ); + request.deployment ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.UpdateDeploymentRequest', + ['deployment', 'name'] + ); + request.deployment.name = defaultValue1; + const expectedHeaderRequestParams = `deployment.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Deployment() + ); + client.innerApiCalls.updateDeployment = stubSimpleCall(expectedResponse); + const [response] = await client.updateDeployment(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateDeployment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateDeployment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDeployment without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.UpdateDeploymentRequest() + ); + request.deployment ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.UpdateDeploymentRequest', + ['deployment', 'name'] + ); + request.deployment.name = defaultValue1; + const expectedHeaderRequestParams = `deployment.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Deployment() + ); + client.innerApiCalls.updateDeployment = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateDeployment( + request, + ( + err?: Error | null, + result?: protos.google.cloud.apihub.v1.IDeployment | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateDeployment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateDeployment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDeployment with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.UpdateDeploymentRequest() + ); + request.deployment ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.UpdateDeploymentRequest', + ['deployment', 'name'] + ); + request.deployment.name = defaultValue1; + const expectedHeaderRequestParams = `deployment.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateDeployment = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateDeployment(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateDeployment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateDeployment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDeployment with closed client', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.UpdateDeploymentRequest() + ); + request.deployment ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.UpdateDeploymentRequest', + ['deployment', 'name'] + ); + request.deployment.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateDeployment(request), expectedError); + }); + }); + + describe('deleteDeployment', () => { + it('invokes deleteDeployment without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DeleteDeploymentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.DeleteDeploymentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteDeployment = stubSimpleCall(expectedResponse); + const [response] = await client.deleteDeployment(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteDeployment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteDeployment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteDeployment without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DeleteDeploymentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.DeleteDeploymentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteDeployment = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteDeployment( + request, + ( + err?: Error | null, + result?: protos.google.protobuf.IEmpty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteDeployment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteDeployment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteDeployment with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DeleteDeploymentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.DeleteDeploymentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteDeployment = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteDeployment(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteDeployment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteDeployment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteDeployment with closed client', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DeleteDeploymentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.DeleteDeploymentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteDeployment(request), expectedError); + }); + }); + + describe('createAttribute', () => { + it('invokes createAttribute without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateAttributeRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.CreateAttributeRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Attribute() + ); + client.innerApiCalls.createAttribute = stubSimpleCall(expectedResponse); + const [response] = await client.createAttribute(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createAttribute as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createAttribute as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createAttribute without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateAttributeRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.CreateAttributeRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Attribute() + ); + client.innerApiCalls.createAttribute = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createAttribute( + request, + ( + err?: Error | null, + result?: protos.google.cloud.apihub.v1.IAttribute | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createAttribute as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createAttribute as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createAttribute with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateAttributeRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.CreateAttributeRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createAttribute = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.createAttribute(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createAttribute as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createAttribute as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createAttribute with closed client', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateAttributeRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.CreateAttributeRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createAttribute(request), expectedError); + }); + }); + + describe('getAttribute', () => { + it('invokes getAttribute without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetAttributeRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.GetAttributeRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Attribute() + ); + client.innerApiCalls.getAttribute = stubSimpleCall(expectedResponse); + const [response] = await client.getAttribute(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getAttribute as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getAttribute as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAttribute without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetAttributeRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.GetAttributeRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Attribute() + ); + client.innerApiCalls.getAttribute = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getAttribute( + request, + ( + err?: Error | null, + result?: protos.google.cloud.apihub.v1.IAttribute | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getAttribute as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getAttribute as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAttribute with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetAttributeRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.GetAttributeRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getAttribute = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getAttribute(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getAttribute as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getAttribute as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAttribute with closed client', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetAttributeRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.GetAttributeRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getAttribute(request), expectedError); + }); + }); + + describe('updateAttribute', () => { + it('invokes updateAttribute without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.UpdateAttributeRequest() + ); + request.attribute ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.UpdateAttributeRequest', + ['attribute', 'name'] + ); + request.attribute.name = defaultValue1; + const expectedHeaderRequestParams = `attribute.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Attribute() + ); + client.innerApiCalls.updateAttribute = stubSimpleCall(expectedResponse); + const [response] = await client.updateAttribute(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateAttribute as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateAttribute as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateAttribute without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.UpdateAttributeRequest() + ); + request.attribute ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.UpdateAttributeRequest', + ['attribute', 'name'] + ); + request.attribute.name = defaultValue1; + const expectedHeaderRequestParams = `attribute.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Attribute() + ); + client.innerApiCalls.updateAttribute = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateAttribute( + request, + ( + err?: Error | null, + result?: protos.google.cloud.apihub.v1.IAttribute | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateAttribute as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateAttribute as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateAttribute with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.UpdateAttributeRequest() + ); + request.attribute ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.UpdateAttributeRequest', + ['attribute', 'name'] + ); + request.attribute.name = defaultValue1; + const expectedHeaderRequestParams = `attribute.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateAttribute = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateAttribute(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateAttribute as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateAttribute as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateAttribute with closed client', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.UpdateAttributeRequest() + ); + request.attribute ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.UpdateAttributeRequest', + ['attribute', 'name'] + ); + request.attribute.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateAttribute(request), expectedError); + }); + }); + + describe('deleteAttribute', () => { + it('invokes deleteAttribute without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DeleteAttributeRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.DeleteAttributeRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteAttribute = stubSimpleCall(expectedResponse); + const [response] = await client.deleteAttribute(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteAttribute as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteAttribute as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteAttribute without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DeleteAttributeRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.DeleteAttributeRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteAttribute = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteAttribute( + request, + ( + err?: Error | null, + result?: protos.google.protobuf.IEmpty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteAttribute as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteAttribute as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteAttribute with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DeleteAttributeRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.DeleteAttributeRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteAttribute = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteAttribute(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteAttribute as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteAttribute as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteAttribute with closed client', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DeleteAttributeRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.DeleteAttributeRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteAttribute(request), expectedError); + }); + }); + + describe('createExternalApi', () => { + it('invokes createExternalApi without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateExternalApiRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.CreateExternalApiRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.ExternalApi() + ); + client.innerApiCalls.createExternalApi = stubSimpleCall(expectedResponse); + const [response] = await client.createExternalApi(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createExternalApi as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createExternalApi as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createExternalApi without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateExternalApiRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.CreateExternalApiRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.ExternalApi() + ); + client.innerApiCalls.createExternalApi = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createExternalApi( + request, + ( + err?: Error | null, + result?: protos.google.cloud.apihub.v1.IExternalApi | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createExternalApi as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createExternalApi as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createExternalApi with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateExternalApiRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.CreateExternalApiRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createExternalApi = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.createExternalApi(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createExternalApi as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createExternalApi as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createExternalApi with closed client', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateExternalApiRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.CreateExternalApiRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createExternalApi(request), expectedError); + }); + }); + + describe('getExternalApi', () => { + it('invokes getExternalApi without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetExternalApiRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.GetExternalApiRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.ExternalApi() + ); + client.innerApiCalls.getExternalApi = stubSimpleCall(expectedResponse); + const [response] = await client.getExternalApi(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getExternalApi as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getExternalApi as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getExternalApi without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetExternalApiRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.GetExternalApiRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.ExternalApi() + ); + client.innerApiCalls.getExternalApi = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getExternalApi( + request, + ( + err?: Error | null, + result?: protos.google.cloud.apihub.v1.IExternalApi | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getExternalApi as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getExternalApi as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getExternalApi with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetExternalApiRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.GetExternalApiRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getExternalApi = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getExternalApi(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getExternalApi as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getExternalApi as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getExternalApi with closed client', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetExternalApiRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.GetExternalApiRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getExternalApi(request), expectedError); + }); + }); + + describe('updateExternalApi', () => { + it('invokes updateExternalApi without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.UpdateExternalApiRequest() + ); + request.externalApi ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.UpdateExternalApiRequest', + ['externalApi', 'name'] + ); + request.externalApi.name = defaultValue1; + const expectedHeaderRequestParams = `external_api.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.ExternalApi() + ); + client.innerApiCalls.updateExternalApi = stubSimpleCall(expectedResponse); + const [response] = await client.updateExternalApi(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateExternalApi as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateExternalApi as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateExternalApi without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.UpdateExternalApiRequest() + ); + request.externalApi ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.UpdateExternalApiRequest', + ['externalApi', 'name'] + ); + request.externalApi.name = defaultValue1; + const expectedHeaderRequestParams = `external_api.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.ExternalApi() + ); + client.innerApiCalls.updateExternalApi = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateExternalApi( + request, + ( + err?: Error | null, + result?: protos.google.cloud.apihub.v1.IExternalApi | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateExternalApi as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateExternalApi as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateExternalApi with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.UpdateExternalApiRequest() + ); + request.externalApi ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.UpdateExternalApiRequest', + ['externalApi', 'name'] + ); + request.externalApi.name = defaultValue1; + const expectedHeaderRequestParams = `external_api.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateExternalApi = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateExternalApi(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateExternalApi as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateExternalApi as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateExternalApi with closed client', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.UpdateExternalApiRequest() + ); + request.externalApi ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.UpdateExternalApiRequest', + ['externalApi', 'name'] + ); + request.externalApi.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateExternalApi(request), expectedError); + }); + }); + + describe('deleteExternalApi', () => { + it('invokes deleteExternalApi without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DeleteExternalApiRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.DeleteExternalApiRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteExternalApi = stubSimpleCall(expectedResponse); + const [response] = await client.deleteExternalApi(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteExternalApi as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteExternalApi as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteExternalApi without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DeleteExternalApiRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.DeleteExternalApiRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteExternalApi = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteExternalApi( + request, + ( + err?: Error | null, + result?: protos.google.protobuf.IEmpty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteExternalApi as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteExternalApi as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteExternalApi with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DeleteExternalApiRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.DeleteExternalApiRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteExternalApi = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteExternalApi(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteExternalApi as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteExternalApi as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteExternalApi with closed client', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DeleteExternalApiRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.DeleteExternalApiRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteExternalApi(request), expectedError); + }); + }); + + describe('listApis', () => { + it('invokes listApis without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListApisRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.ListApisRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.Api()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Api()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Api()), + ]; + client.innerApiCalls.listApis = stubSimpleCall(expectedResponse); + const [response] = await client.listApis(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listApis as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listApis as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listApis without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListApisRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.ListApisRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.Api()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Api()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Api()), + ]; + client.innerApiCalls.listApis = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listApis( + request, + ( + err?: Error | null, + result?: protos.google.cloud.apihub.v1.IApi[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listApis as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listApis as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listApis with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListApisRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.ListApisRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listApis = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listApis(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listApis as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listApis as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listApisStream without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListApisRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.ListApisRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.Api()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Api()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Api()), + ]; + client.descriptors.page.listApis.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listApisStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.apihub.v1.Api[] = []; + stream.on('data', (response: protos.google.cloud.apihub.v1.Api) => { + 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.listApis.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listApis, request) + ); + assert( + (client.descriptors.page.listApis.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + + it('invokes listApisStream with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListApisRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.ListApisRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listApis.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listApisStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.apihub.v1.Api[] = []; + stream.on('data', (response: protos.google.cloud.apihub.v1.Api) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listApis.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listApis, request) + ); + assert( + (client.descriptors.page.listApis.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + + it('uses async iteration with listApis without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListApisRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.ListApisRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.Api()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Api()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Api()), + ]; + client.descriptors.page.listApis.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.apihub.v1.IApi[] = []; + const iterable = client.listApisAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listApis.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert( + (client.descriptors.page.listApis.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + + it('uses async iteration with listApis with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListApisRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.ListApisRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listApis.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listApisAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.apihub.v1.IApi[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listApis.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert( + (client.descriptors.page.listApis.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + }); + + describe('listVersions', () => { + it('invokes listVersions without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListVersionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.ListVersionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.Version()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Version()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Version()), + ]; + client.innerApiCalls.listVersions = stubSimpleCall(expectedResponse); + const [response] = await client.listVersions(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listVersions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listVersions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listVersions without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListVersionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.ListVersionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.Version()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Version()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Version()), + ]; + client.innerApiCalls.listVersions = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listVersions( + request, + ( + err?: Error | null, + result?: protos.google.cloud.apihub.v1.IVersion[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listVersions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listVersions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listVersions with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListVersionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.ListVersionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listVersions = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listVersions(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listVersions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listVersions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listVersionsStream without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListVersionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.ListVersionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.Version()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Version()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Version()), + ]; + client.descriptors.page.listVersions.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listVersionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.apihub.v1.Version[] = []; + stream.on('data', (response: protos.google.cloud.apihub.v1.Version) => { + 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.listVersions.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listVersions, request) + ); + assert( + (client.descriptors.page.listVersions.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + + it('invokes listVersionsStream with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListVersionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.ListVersionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listVersions.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listVersionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.apihub.v1.Version[] = []; + stream.on('data', (response: protos.google.cloud.apihub.v1.Version) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listVersions.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listVersions, request) + ); + assert( + (client.descriptors.page.listVersions.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + + it('uses async iteration with listVersions without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListVersionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.ListVersionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.Version()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Version()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Version()), + ]; + client.descriptors.page.listVersions.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.apihub.v1.IVersion[] = []; + const iterable = client.listVersionsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listVersions.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listVersions.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + + it('uses async iteration with listVersions with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListVersionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.ListVersionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listVersions.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listVersionsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.apihub.v1.IVersion[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listVersions.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listVersions.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + }); + + describe('listSpecs', () => { + it('invokes listSpecs without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListSpecsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.ListSpecsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.Spec()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Spec()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Spec()), + ]; + client.innerApiCalls.listSpecs = stubSimpleCall(expectedResponse); + const [response] = await client.listSpecs(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listSpecs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSpecs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSpecs without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListSpecsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.ListSpecsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.Spec()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Spec()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Spec()), + ]; + client.innerApiCalls.listSpecs = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listSpecs( + request, + ( + err?: Error | null, + result?: protos.google.cloud.apihub.v1.ISpec[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listSpecs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSpecs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSpecs with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListSpecsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.ListSpecsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listSpecs = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listSpecs(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listSpecs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSpecs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSpecsStream without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListSpecsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.ListSpecsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.Spec()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Spec()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Spec()), + ]; + client.descriptors.page.listSpecs.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listSpecsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.apihub.v1.Spec[] = []; + stream.on('data', (response: protos.google.cloud.apihub.v1.Spec) => { + 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.listSpecs.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listSpecs, request) + ); + assert( + (client.descriptors.page.listSpecs.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + + it('invokes listSpecsStream with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListSpecsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.ListSpecsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listSpecs.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listSpecsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.apihub.v1.Spec[] = []; + stream.on('data', (response: protos.google.cloud.apihub.v1.Spec) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listSpecs.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listSpecs, request) + ); + assert( + (client.descriptors.page.listSpecs.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + + it('uses async iteration with listSpecs without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListSpecsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.ListSpecsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.Spec()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Spec()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Spec()), + ]; + client.descriptors.page.listSpecs.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.apihub.v1.ISpec[] = []; + const iterable = client.listSpecsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listSpecs.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert( + (client.descriptors.page.listSpecs.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + + it('uses async iteration with listSpecs with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListSpecsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.ListSpecsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listSpecs.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listSpecsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.apihub.v1.ISpec[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listSpecs.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert( + (client.descriptors.page.listSpecs.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + }); + + describe('listApiOperations', () => { + it('invokes listApiOperations without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListApiOperationsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.ListApiOperationsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.ApiOperation()), + generateSampleMessage(new protos.google.cloud.apihub.v1.ApiOperation()), + generateSampleMessage(new protos.google.cloud.apihub.v1.ApiOperation()), + ]; + client.innerApiCalls.listApiOperations = stubSimpleCall(expectedResponse); + const [response] = await client.listApiOperations(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listApiOperations as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listApiOperations as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listApiOperations without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListApiOperationsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.ListApiOperationsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.ApiOperation()), + generateSampleMessage(new protos.google.cloud.apihub.v1.ApiOperation()), + generateSampleMessage(new protos.google.cloud.apihub.v1.ApiOperation()), + ]; + client.innerApiCalls.listApiOperations = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listApiOperations( + request, + ( + err?: Error | null, + result?: protos.google.cloud.apihub.v1.IApiOperation[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listApiOperations as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listApiOperations as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listApiOperations with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListApiOperationsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.ListApiOperationsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listApiOperations = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listApiOperations(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listApiOperations as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listApiOperations as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listApiOperationsStream without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListApiOperationsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.ListApiOperationsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.ApiOperation()), + generateSampleMessage(new protos.google.cloud.apihub.v1.ApiOperation()), + generateSampleMessage(new protos.google.cloud.apihub.v1.ApiOperation()), + ]; + client.descriptors.page.listApiOperations.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listApiOperationsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.apihub.v1.ApiOperation[] = []; + stream.on( + 'data', + (response: protos.google.cloud.apihub.v1.ApiOperation) => { + 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.listApiOperations.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listApiOperations, request) + ); + assert( + (client.descriptors.page.listApiOperations.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + + it('invokes listApiOperationsStream with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListApiOperationsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.ListApiOperationsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listApiOperations.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listApiOperationsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.apihub.v1.ApiOperation[] = []; + stream.on( + 'data', + (response: protos.google.cloud.apihub.v1.ApiOperation) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listApiOperations.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listApiOperations, request) + ); + assert( + (client.descriptors.page.listApiOperations.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + + it('uses async iteration with listApiOperations without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListApiOperationsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.ListApiOperationsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.ApiOperation()), + generateSampleMessage(new protos.google.cloud.apihub.v1.ApiOperation()), + generateSampleMessage(new protos.google.cloud.apihub.v1.ApiOperation()), + ]; + client.descriptors.page.listApiOperations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.apihub.v1.IApiOperation[] = []; + const iterable = client.listApiOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listApiOperations.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listApiOperations.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + + it('uses async iteration with listApiOperations with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListApiOperationsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.ListApiOperationsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listApiOperations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listApiOperationsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.apihub.v1.IApiOperation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listApiOperations.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listApiOperations.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + }); + + describe('listDeployments', () => { + it('invokes listDeployments without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListDeploymentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.ListDeploymentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.Deployment()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Deployment()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Deployment()), + ]; + client.innerApiCalls.listDeployments = stubSimpleCall(expectedResponse); + const [response] = await client.listDeployments(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listDeployments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDeployments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDeployments without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListDeploymentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.ListDeploymentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.Deployment()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Deployment()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Deployment()), + ]; + client.innerApiCalls.listDeployments = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listDeployments( + request, + ( + err?: Error | null, + result?: protos.google.cloud.apihub.v1.IDeployment[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listDeployments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDeployments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDeployments with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListDeploymentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.ListDeploymentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listDeployments = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listDeployments(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listDeployments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDeployments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDeploymentsStream without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListDeploymentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.ListDeploymentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.Deployment()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Deployment()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Deployment()), + ]; + client.descriptors.page.listDeployments.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listDeploymentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.apihub.v1.Deployment[] = []; + stream.on( + 'data', + (response: protos.google.cloud.apihub.v1.Deployment) => { + 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.listDeployments.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listDeployments, request) + ); + assert( + (client.descriptors.page.listDeployments.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + + it('invokes listDeploymentsStream with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListDeploymentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.ListDeploymentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listDeployments.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listDeploymentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.apihub.v1.Deployment[] = []; + stream.on( + 'data', + (response: protos.google.cloud.apihub.v1.Deployment) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listDeployments.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listDeployments, request) + ); + assert( + (client.descriptors.page.listDeployments.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + + it('uses async iteration with listDeployments without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListDeploymentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.ListDeploymentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.Deployment()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Deployment()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Deployment()), + ]; + client.descriptors.page.listDeployments.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.apihub.v1.IDeployment[] = []; + const iterable = client.listDeploymentsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listDeployments.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listDeployments.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + + it('uses async iteration with listDeployments with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListDeploymentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.ListDeploymentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listDeployments.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listDeploymentsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.apihub.v1.IDeployment[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listDeployments.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listDeployments.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + }); + + describe('listAttributes', () => { + it('invokes listAttributes without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListAttributesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.ListAttributesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.Attribute()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Attribute()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Attribute()), + ]; + client.innerApiCalls.listAttributes = stubSimpleCall(expectedResponse); + const [response] = await client.listAttributes(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listAttributes as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listAttributes as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAttributes without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListAttributesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.ListAttributesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.Attribute()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Attribute()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Attribute()), + ]; + client.innerApiCalls.listAttributes = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listAttributes( + request, + ( + err?: Error | null, + result?: protos.google.cloud.apihub.v1.IAttribute[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listAttributes as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listAttributes as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAttributes with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListAttributesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.ListAttributesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listAttributes = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listAttributes(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listAttributes as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listAttributes as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAttributesStream without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListAttributesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.ListAttributesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.Attribute()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Attribute()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Attribute()), + ]; + client.descriptors.page.listAttributes.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listAttributesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.apihub.v1.Attribute[] = []; + stream.on( + 'data', + (response: protos.google.cloud.apihub.v1.Attribute) => { + 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.listAttributes.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listAttributes, request) + ); + assert( + (client.descriptors.page.listAttributes.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + + it('invokes listAttributesStream with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListAttributesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.ListAttributesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listAttributes.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listAttributesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.apihub.v1.Attribute[] = []; + stream.on( + 'data', + (response: protos.google.cloud.apihub.v1.Attribute) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listAttributes.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listAttributes, request) + ); + assert( + (client.descriptors.page.listAttributes.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + + it('uses async iteration with listAttributes without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListAttributesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.ListAttributesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.Attribute()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Attribute()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Attribute()), + ]; + client.descriptors.page.listAttributes.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.apihub.v1.IAttribute[] = []; + const iterable = client.listAttributesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listAttributes.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listAttributes.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + + it('uses async iteration with listAttributes with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListAttributesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.ListAttributesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listAttributes.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listAttributesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.apihub.v1.IAttribute[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listAttributes.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listAttributes.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + }); + + describe('searchResources', () => { + it('invokes searchResources without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.SearchResourcesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.SearchResourcesRequest', + ['location'] + ); + request.location = defaultValue1; + const expectedHeaderRequestParams = `location=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.SearchResult()), + generateSampleMessage(new protos.google.cloud.apihub.v1.SearchResult()), + generateSampleMessage(new protos.google.cloud.apihub.v1.SearchResult()), + ]; + client.innerApiCalls.searchResources = stubSimpleCall(expectedResponse); + const [response] = await client.searchResources(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.searchResources as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.searchResources as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes searchResources without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.SearchResourcesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.SearchResourcesRequest', + ['location'] + ); + request.location = defaultValue1; + const expectedHeaderRequestParams = `location=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.SearchResult()), + generateSampleMessage(new protos.google.cloud.apihub.v1.SearchResult()), + generateSampleMessage(new protos.google.cloud.apihub.v1.SearchResult()), + ]; + client.innerApiCalls.searchResources = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.searchResources( + request, + ( + err?: Error | null, + result?: protos.google.cloud.apihub.v1.ISearchResult[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.searchResources as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.searchResources as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes searchResources with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.SearchResourcesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.SearchResourcesRequest', + ['location'] + ); + request.location = defaultValue1; + const expectedHeaderRequestParams = `location=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.searchResources = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.searchResources(request), expectedError); + const actualRequest = ( + client.innerApiCalls.searchResources as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.searchResources as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes searchResourcesStream without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.SearchResourcesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.SearchResourcesRequest', + ['location'] + ); + request.location = defaultValue1; + const expectedHeaderRequestParams = `location=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.SearchResult()), + generateSampleMessage(new protos.google.cloud.apihub.v1.SearchResult()), + generateSampleMessage(new protos.google.cloud.apihub.v1.SearchResult()), + ]; + client.descriptors.page.searchResources.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.searchResourcesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.apihub.v1.SearchResult[] = []; + stream.on( + 'data', + (response: protos.google.cloud.apihub.v1.SearchResult) => { + 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.searchResources.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.searchResources, request) + ); + assert( + (client.descriptors.page.searchResources.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + + it('invokes searchResourcesStream with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.SearchResourcesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.SearchResourcesRequest', + ['location'] + ); + request.location = defaultValue1; + const expectedHeaderRequestParams = `location=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.searchResources.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.searchResourcesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.apihub.v1.SearchResult[] = []; + stream.on( + 'data', + (response: protos.google.cloud.apihub.v1.SearchResult) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.searchResources.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.searchResources, request) + ); + assert( + (client.descriptors.page.searchResources.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + + it('uses async iteration with searchResources without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.SearchResourcesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.SearchResourcesRequest', + ['location'] + ); + request.location = defaultValue1; + const expectedHeaderRequestParams = `location=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.SearchResult()), + generateSampleMessage(new protos.google.cloud.apihub.v1.SearchResult()), + generateSampleMessage(new protos.google.cloud.apihub.v1.SearchResult()), + ]; + client.descriptors.page.searchResources.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.apihub.v1.ISearchResult[] = []; + const iterable = client.searchResourcesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.searchResources.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.searchResources.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + + it('uses async iteration with searchResources with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.SearchResourcesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.SearchResourcesRequest', + ['location'] + ); + request.location = defaultValue1; + const expectedHeaderRequestParams = `location=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.searchResources.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.searchResourcesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.apihub.v1.ISearchResult[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.searchResources.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.searchResources.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + }); + + describe('listExternalApis', () => { + it('invokes listExternalApis without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListExternalApisRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.ListExternalApisRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.ExternalApi()), + generateSampleMessage(new protos.google.cloud.apihub.v1.ExternalApi()), + generateSampleMessage(new protos.google.cloud.apihub.v1.ExternalApi()), + ]; + client.innerApiCalls.listExternalApis = stubSimpleCall(expectedResponse); + const [response] = await client.listExternalApis(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listExternalApis as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listExternalApis as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listExternalApis without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListExternalApisRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.ListExternalApisRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.ExternalApi()), + generateSampleMessage(new protos.google.cloud.apihub.v1.ExternalApi()), + generateSampleMessage(new protos.google.cloud.apihub.v1.ExternalApi()), + ]; + client.innerApiCalls.listExternalApis = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listExternalApis( + request, + ( + err?: Error | null, + result?: protos.google.cloud.apihub.v1.IExternalApi[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listExternalApis as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listExternalApis as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listExternalApis with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListExternalApisRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.ListExternalApisRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listExternalApis = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listExternalApis(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listExternalApis as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listExternalApis as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listExternalApisStream without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListExternalApisRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.ListExternalApisRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.ExternalApi()), + generateSampleMessage(new protos.google.cloud.apihub.v1.ExternalApi()), + generateSampleMessage(new protos.google.cloud.apihub.v1.ExternalApi()), + ]; + client.descriptors.page.listExternalApis.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listExternalApisStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.apihub.v1.ExternalApi[] = []; + stream.on( + 'data', + (response: protos.google.cloud.apihub.v1.ExternalApi) => { + 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.listExternalApis.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listExternalApis, request) + ); + assert( + (client.descriptors.page.listExternalApis.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + + it('invokes listExternalApisStream with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListExternalApisRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.ListExternalApisRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listExternalApis.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listExternalApisStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.apihub.v1.ExternalApi[] = []; + stream.on( + 'data', + (response: protos.google.cloud.apihub.v1.ExternalApi) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listExternalApis.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listExternalApis, request) + ); + assert( + (client.descriptors.page.listExternalApis.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + + it('uses async iteration with listExternalApis without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListExternalApisRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.ListExternalApisRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.ExternalApi()), + generateSampleMessage(new protos.google.cloud.apihub.v1.ExternalApi()), + generateSampleMessage(new protos.google.cloud.apihub.v1.ExternalApi()), + ]; + client.descriptors.page.listExternalApis.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.apihub.v1.IExternalApi[] = []; + const iterable = client.listExternalApisAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listExternalApis.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listExternalApis.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + + it('uses async iteration with listExternalApis with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListExternalApisRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.ListExternalApisRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listExternalApis.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listExternalApisAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.apihub.v1.IExternalApi[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listExternalApis.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listExternalApis.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + 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 apihubModule.v1.ApiHubClient({ + 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 apihubModule.v1.ApiHubClient({ + 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 apihubModule.v1.ApiHubClient({ + 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 apihubModule.v1.ApiHubClient({ + 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('Path templates', () => { + describe('api', () => { + const fakePath = '/rendered/path/api'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + api: 'apiValue', + }; + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.apiPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.apiPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('apiPath', () => { + const result = client.apiPath( + 'projectValue', + 'locationValue', + 'apiValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.apiPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromApiName', () => { + const result = client.matchProjectFromApiName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.apiPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromApiName', () => { + const result = client.matchLocationFromApiName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.apiPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchApiFromApiName', () => { + const result = client.matchApiFromApiName(fakePath); + assert.strictEqual(result, 'apiValue'); + assert( + (client.pathTemplates.apiPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('apiHubInstance', () => { + const fakePath = '/rendered/path/apiHubInstance'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + api_hub_instance: 'apiHubInstanceValue', + }; + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.apiHubInstancePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.apiHubInstancePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('apiHubInstancePath', () => { + const result = client.apiHubInstancePath( + 'projectValue', + 'locationValue', + 'apiHubInstanceValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.apiHubInstancePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromApiHubInstanceName', () => { + const result = client.matchProjectFromApiHubInstanceName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromApiHubInstanceName', () => { + const result = client.matchLocationFromApiHubInstanceName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchApiHubInstanceFromApiHubInstanceName', () => { + const result = + client.matchApiHubInstanceFromApiHubInstanceName(fakePath); + assert.strictEqual(result, 'apiHubInstanceValue'); + assert( + (client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('apiOperation', () => { + const fakePath = '/rendered/path/apiOperation'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + api: 'apiValue', + version: 'versionValue', + operation: 'operationValue', + }; + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.apiOperationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.apiOperationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('apiOperationPath', () => { + const result = client.apiOperationPath( + 'projectValue', + 'locationValue', + 'apiValue', + 'versionValue', + 'operationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.apiOperationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromApiOperationName', () => { + const result = client.matchProjectFromApiOperationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromApiOperationName', () => { + const result = client.matchLocationFromApiOperationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchApiFromApiOperationName', () => { + const result = client.matchApiFromApiOperationName(fakePath); + assert.strictEqual(result, 'apiValue'); + assert( + (client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchVersionFromApiOperationName', () => { + const result = client.matchVersionFromApiOperationName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchOperationFromApiOperationName', () => { + const result = client.matchOperationFromApiOperationName(fakePath); + assert.strictEqual(result, 'operationValue'); + assert( + (client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('attribute', () => { + const fakePath = '/rendered/path/attribute'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + attribute: 'attributeValue', + }; + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.attributePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.attributePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('attributePath', () => { + const result = client.attributePath( + 'projectValue', + 'locationValue', + 'attributeValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.attributePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromAttributeName', () => { + const result = client.matchProjectFromAttributeName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.attributePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromAttributeName', () => { + const result = client.matchLocationFromAttributeName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.attributePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAttributeFromAttributeName', () => { + const result = client.matchAttributeFromAttributeName(fakePath); + assert.strictEqual(result, 'attributeValue'); + assert( + (client.pathTemplates.attributePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('definition', () => { + const fakePath = '/rendered/path/definition'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + api: 'apiValue', + version: 'versionValue', + definition: 'definitionValue', + }; + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.definitionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.definitionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('definitionPath', () => { + const result = client.definitionPath( + 'projectValue', + 'locationValue', + 'apiValue', + 'versionValue', + 'definitionValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.definitionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromDefinitionName', () => { + const result = client.matchProjectFromDefinitionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromDefinitionName', () => { + const result = client.matchLocationFromDefinitionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchApiFromDefinitionName', () => { + const result = client.matchApiFromDefinitionName(fakePath); + assert.strictEqual(result, 'apiValue'); + assert( + (client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchVersionFromDefinitionName', () => { + const result = client.matchVersionFromDefinitionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDefinitionFromDefinitionName', () => { + const result = client.matchDefinitionFromDefinitionName(fakePath); + assert.strictEqual(result, 'definitionValue'); + assert( + (client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('dependency', () => { + const fakePath = '/rendered/path/dependency'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + dependency: 'dependencyValue', + }; + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dependencyPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.dependencyPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('dependencyPath', () => { + const result = client.dependencyPath( + 'projectValue', + 'locationValue', + 'dependencyValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.dependencyPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromDependencyName', () => { + const result = client.matchProjectFromDependencyName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.dependencyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromDependencyName', () => { + const result = client.matchLocationFromDependencyName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.dependencyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDependencyFromDependencyName', () => { + const result = client.matchDependencyFromDependencyName(fakePath); + assert.strictEqual(result, 'dependencyValue'); + assert( + (client.pathTemplates.dependencyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('deployment', () => { + const fakePath = '/rendered/path/deployment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + deployment: 'deploymentValue', + }; + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.deploymentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.deploymentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('deploymentPath', () => { + const result = client.deploymentPath( + 'projectValue', + 'locationValue', + 'deploymentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.deploymentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromDeploymentName', () => { + const result = client.matchProjectFromDeploymentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromDeploymentName', () => { + const result = client.matchLocationFromDeploymentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDeploymentFromDeploymentName', () => { + const result = client.matchDeploymentFromDeploymentName(fakePath); + assert.strictEqual(result, 'deploymentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('externalApi', () => { + const fakePath = '/rendered/path/externalApi'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + external_api: 'externalApiValue', + }; + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.externalApiPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.externalApiPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('externalApiPath', () => { + const result = client.externalApiPath( + 'projectValue', + 'locationValue', + 'externalApiValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.externalApiPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromExternalApiName', () => { + const result = client.matchProjectFromExternalApiName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.externalApiPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromExternalApiName', () => { + const result = client.matchLocationFromExternalApiName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.externalApiPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchExternalApiFromExternalApiName', () => { + const result = client.matchExternalApiFromExternalApiName(fakePath); + assert.strictEqual(result, 'externalApiValue'); + assert( + (client.pathTemplates.externalApiPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('hostProjectRegistration', () => { + const fakePath = '/rendered/path/hostProjectRegistration'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + host_project_registration: 'hostProjectRegistrationValue', + }; + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.hostProjectRegistrationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.hostProjectRegistrationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('hostProjectRegistrationPath', () => { + const result = client.hostProjectRegistrationPath( + 'projectValue', + 'locationValue', + 'hostProjectRegistrationValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.hostProjectRegistrationPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromHostProjectRegistrationName', () => { + const result = + client.matchProjectFromHostProjectRegistrationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.hostProjectRegistrationPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromHostProjectRegistrationName', () => { + const result = + client.matchLocationFromHostProjectRegistrationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.hostProjectRegistrationPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchHostProjectRegistrationFromHostProjectRegistrationName', () => { + const result = + client.matchHostProjectRegistrationFromHostProjectRegistrationName( + fakePath + ); + assert.strictEqual(result, 'hostProjectRegistrationValue'); + assert( + ( + client.pathTemplates.hostProjectRegistrationPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('location', () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.locationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.locationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath('projectValue', 'locationValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('plugin', () => { + const fakePath = '/rendered/path/plugin'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + plugin: 'pluginValue', + }; + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.pluginPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.pluginPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('pluginPath', () => { + const result = client.pluginPath( + 'projectValue', + 'locationValue', + 'pluginValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.pluginPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromPluginName', () => { + const result = client.matchProjectFromPluginName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.pluginPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromPluginName', () => { + const result = client.matchLocationFromPluginName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.pluginPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchPluginFromPluginName', () => { + const result = client.matchPluginFromPluginName(fakePath); + assert.strictEqual(result, 'pluginValue'); + assert( + (client.pathTemplates.pluginPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('project', () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('runtimeProjectAttachment', () => { + const fakePath = '/rendered/path/runtimeProjectAttachment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + runtime_project_attachment: 'runtimeProjectAttachmentValue', + }; + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.runtimeProjectAttachmentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.runtimeProjectAttachmentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('runtimeProjectAttachmentPath', () => { + const result = client.runtimeProjectAttachmentPath( + 'projectValue', + 'locationValue', + 'runtimeProjectAttachmentValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.runtimeProjectAttachmentPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRuntimeProjectAttachmentName', () => { + const result = + client.matchProjectFromRuntimeProjectAttachmentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.runtimeProjectAttachmentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromRuntimeProjectAttachmentName', () => { + const result = + client.matchLocationFromRuntimeProjectAttachmentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.runtimeProjectAttachmentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName', () => { + const result = + client.matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName( + fakePath + ); + assert.strictEqual(result, 'runtimeProjectAttachmentValue'); + assert( + ( + client.pathTemplates.runtimeProjectAttachmentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('spec', () => { + const fakePath = '/rendered/path/spec'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + api: 'apiValue', + version: 'versionValue', + spec: 'specValue', + }; + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.specPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.specPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('specPath', () => { + const result = client.specPath( + 'projectValue', + 'locationValue', + 'apiValue', + 'versionValue', + 'specValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.specPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromSpecName', () => { + const result = client.matchProjectFromSpecName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromSpecName', () => { + const result = client.matchLocationFromSpecName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchApiFromSpecName', () => { + const result = client.matchApiFromSpecName(fakePath); + assert.strictEqual(result, 'apiValue'); + assert( + (client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchVersionFromSpecName', () => { + const result = client.matchVersionFromSpecName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSpecFromSpecName', () => { + const result = client.matchSpecFromSpecName(fakePath); + assert.strictEqual(result, 'specValue'); + assert( + (client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('styleGuide', () => { + const fakePath = '/rendered/path/styleGuide'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + plugin: 'pluginValue', + }; + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.styleGuidePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.styleGuidePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('styleGuidePath', () => { + const result = client.styleGuidePath( + 'projectValue', + 'locationValue', + 'pluginValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.styleGuidePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromStyleGuideName', () => { + const result = client.matchProjectFromStyleGuideName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.styleGuidePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromStyleGuideName', () => { + const result = client.matchLocationFromStyleGuideName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.styleGuidePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchPluginFromStyleGuideName', () => { + const result = client.matchPluginFromStyleGuideName(fakePath); + assert.strictEqual(result, 'pluginValue'); + assert( + (client.pathTemplates.styleGuidePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('version', () => { + const fakePath = '/rendered/path/version'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + api: 'apiValue', + version: 'versionValue', + }; + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.versionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.versionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('versionPath', () => { + const result = client.versionPath( + 'projectValue', + 'locationValue', + 'apiValue', + 'versionValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.versionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromVersionName', () => { + const result = client.matchProjectFromVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromVersionName', () => { + const result = client.matchLocationFromVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchApiFromVersionName', () => { + const result = client.matchApiFromVersionName(fakePath); + assert.strictEqual(result, 'apiValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchVersionFromVersionName', () => { + const result = client.matchVersionFromVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-apihub/test/gapic_host_project_registration_service_v1.ts b/packages/google-cloud-apihub/test/gapic_host_project_registration_service_v1.ts new file mode 100644 index 00000000000..a7ef4f96b49 --- /dev/null +++ b/packages/google-cloud-apihub/test/gapic_host_project_registration_service_v1.ts @@ -0,0 +1,2380 @@ +// Copyright 2024 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 hostprojectregistrationserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, 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 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.HostProjectRegistrationServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = + new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'apihub.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = + new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, 'googleapis.com'); + }); + + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = + hostprojectregistrationserviceModule.v1 + .HostProjectRegistrationServiceClient.servicePath; + assert.strictEqual(servicePath, 'apihub.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = + hostprojectregistrationserviceModule.v1 + .HostProjectRegistrationServiceClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'apihub.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = + new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient( + {universeDomain: 'example.com'} + ); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'apihub.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = + new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient( + {universe_domain: 'example.com'} + ); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'apihub.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = + new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'apihub.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = + new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient( + {universeDomain: 'configured.example.com'} + ); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'apihub.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { + new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient( + {universe_domain: 'example.com', universeDomain: 'example.net'} + ); + }); + }); + + it('has port', () => { + const port = + hostprojectregistrationserviceModule.v1 + .HostProjectRegistrationServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = + new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = + new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient( + { + fallback: true, + } + ); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = + new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + assert.strictEqual(client.hostProjectRegistrationServiceStub, undefined); + await client.initialize(); + assert(client.hostProjectRegistrationServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = + new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + assert(client.hostProjectRegistrationServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = + new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + assert.strictEqual(client.hostProjectRegistrationServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient( + { + 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 hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient( + { + 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('createHostProjectRegistration', () => { + it('invokes createHostProjectRegistration without error', async () => { + const client = + new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateHostProjectRegistrationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.CreateHostProjectRegistrationRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.HostProjectRegistration() + ); + client.innerApiCalls.createHostProjectRegistration = + stubSimpleCall(expectedResponse); + const [response] = await client.createHostProjectRegistration(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createHostProjectRegistration as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createHostProjectRegistration as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createHostProjectRegistration without error using callback', async () => { + const client = + new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateHostProjectRegistrationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.CreateHostProjectRegistrationRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.HostProjectRegistration() + ); + client.innerApiCalls.createHostProjectRegistration = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createHostProjectRegistration( + request, + ( + err?: Error | null, + result?: protos.google.cloud.apihub.v1.IHostProjectRegistration | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createHostProjectRegistration as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createHostProjectRegistration as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createHostProjectRegistration with error', async () => { + const client = + new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateHostProjectRegistrationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.CreateHostProjectRegistrationRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createHostProjectRegistration = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.createHostProjectRegistration(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.createHostProjectRegistration as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createHostProjectRegistration as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createHostProjectRegistration with closed client', async () => { + const client = + new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateHostProjectRegistrationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.CreateHostProjectRegistrationRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.createHostProjectRegistration(request), + expectedError + ); + }); + }); + + describe('getHostProjectRegistration', () => { + it('invokes getHostProjectRegistration without error', async () => { + const client = + new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetHostProjectRegistrationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.GetHostProjectRegistrationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.HostProjectRegistration() + ); + client.innerApiCalls.getHostProjectRegistration = + stubSimpleCall(expectedResponse); + const [response] = await client.getHostProjectRegistration(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getHostProjectRegistration as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getHostProjectRegistration as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getHostProjectRegistration without error using callback', async () => { + const client = + new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetHostProjectRegistrationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.GetHostProjectRegistrationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.HostProjectRegistration() + ); + client.innerApiCalls.getHostProjectRegistration = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getHostProjectRegistration( + request, + ( + err?: Error | null, + result?: protos.google.cloud.apihub.v1.IHostProjectRegistration | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getHostProjectRegistration as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getHostProjectRegistration as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getHostProjectRegistration with error', async () => { + const client = + new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetHostProjectRegistrationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.GetHostProjectRegistrationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getHostProjectRegistration = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.getHostProjectRegistration(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.getHostProjectRegistration as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getHostProjectRegistration as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getHostProjectRegistration with closed client', async () => { + const client = + new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetHostProjectRegistrationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.GetHostProjectRegistrationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.getHostProjectRegistration(request), + expectedError + ); + }); + }); + + describe('listHostProjectRegistrations', () => { + it('invokes listHostProjectRegistrations without error', async () => { + const client = + new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.apihub.v1.HostProjectRegistration() + ), + generateSampleMessage( + new protos.google.cloud.apihub.v1.HostProjectRegistration() + ), + generateSampleMessage( + new protos.google.cloud.apihub.v1.HostProjectRegistration() + ), + ]; + client.innerApiCalls.listHostProjectRegistrations = + stubSimpleCall(expectedResponse); + const [response] = await client.listHostProjectRegistrations(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listHostProjectRegistrations as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listHostProjectRegistrations as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listHostProjectRegistrations without error using callback', async () => { + const client = + new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.apihub.v1.HostProjectRegistration() + ), + generateSampleMessage( + new protos.google.cloud.apihub.v1.HostProjectRegistration() + ), + generateSampleMessage( + new protos.google.cloud.apihub.v1.HostProjectRegistration() + ), + ]; + client.innerApiCalls.listHostProjectRegistrations = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listHostProjectRegistrations( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.apihub.v1.IHostProjectRegistration[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listHostProjectRegistrations as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listHostProjectRegistrations as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listHostProjectRegistrations with error', async () => { + const client = + new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listHostProjectRegistrations = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.listHostProjectRegistrations(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.listHostProjectRegistrations as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listHostProjectRegistrations as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listHostProjectRegistrationsStream without error', async () => { + const client = + new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.apihub.v1.HostProjectRegistration() + ), + generateSampleMessage( + new protos.google.cloud.apihub.v1.HostProjectRegistration() + ), + generateSampleMessage( + new protos.google.cloud.apihub.v1.HostProjectRegistration() + ), + ]; + client.descriptors.page.listHostProjectRegistrations.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listHostProjectRegistrationsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.apihub.v1.HostProjectRegistration[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.apihub.v1.HostProjectRegistration) => { + 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.listHostProjectRegistrations + .createStream as SinonStub + ) + .getCall(0) + .calledWith( + client.innerApiCalls.listHostProjectRegistrations, + request + ) + ); + assert( + ( + client.descriptors.page.listHostProjectRegistrations + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listHostProjectRegistrationsStream with error', async () => { + const client = + new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listHostProjectRegistrations.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listHostProjectRegistrationsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.apihub.v1.HostProjectRegistration[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.apihub.v1.HostProjectRegistration) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + ( + client.descriptors.page.listHostProjectRegistrations + .createStream as SinonStub + ) + .getCall(0) + .calledWith( + client.innerApiCalls.listHostProjectRegistrations, + request + ) + ); + assert( + ( + client.descriptors.page.listHostProjectRegistrations + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listHostProjectRegistrations without error', async () => { + const client = + new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.apihub.v1.HostProjectRegistration() + ), + generateSampleMessage( + new protos.google.cloud.apihub.v1.HostProjectRegistration() + ), + generateSampleMessage( + new protos.google.cloud.apihub.v1.HostProjectRegistration() + ), + ]; + client.descriptors.page.listHostProjectRegistrations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.apihub.v1.IHostProjectRegistration[] = + []; + const iterable = client.listHostProjectRegistrationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listHostProjectRegistrations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listHostProjectRegistrations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listHostProjectRegistrations with error', async () => { + const client = + new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listHostProjectRegistrations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listHostProjectRegistrationsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.apihub.v1.IHostProjectRegistration[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listHostProjectRegistrations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listHostProjectRegistrations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = + new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient( + { + 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 hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient( + { + 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 hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient( + { + 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 hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient( + { + 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 hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient( + { + 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('Path templates', () => { + describe('api', () => { + const fakePath = '/rendered/path/api'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + api: 'apiValue', + }; + const client = + new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.apiPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.apiPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('apiPath', () => { + const result = client.apiPath( + 'projectValue', + 'locationValue', + 'apiValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.apiPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromApiName', () => { + const result = client.matchProjectFromApiName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.apiPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromApiName', () => { + const result = client.matchLocationFromApiName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.apiPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchApiFromApiName', () => { + const result = client.matchApiFromApiName(fakePath); + assert.strictEqual(result, 'apiValue'); + assert( + (client.pathTemplates.apiPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('apiHubInstance', () => { + const fakePath = '/rendered/path/apiHubInstance'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + api_hub_instance: 'apiHubInstanceValue', + }; + const client = + new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.apiHubInstancePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.apiHubInstancePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('apiHubInstancePath', () => { + const result = client.apiHubInstancePath( + 'projectValue', + 'locationValue', + 'apiHubInstanceValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.apiHubInstancePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromApiHubInstanceName', () => { + const result = client.matchProjectFromApiHubInstanceName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromApiHubInstanceName', () => { + const result = client.matchLocationFromApiHubInstanceName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchApiHubInstanceFromApiHubInstanceName', () => { + const result = + client.matchApiHubInstanceFromApiHubInstanceName(fakePath); + assert.strictEqual(result, 'apiHubInstanceValue'); + assert( + (client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('apiOperation', () => { + const fakePath = '/rendered/path/apiOperation'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + api: 'apiValue', + version: 'versionValue', + operation: 'operationValue', + }; + const client = + new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.apiOperationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.apiOperationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('apiOperationPath', () => { + const result = client.apiOperationPath( + 'projectValue', + 'locationValue', + 'apiValue', + 'versionValue', + 'operationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.apiOperationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromApiOperationName', () => { + const result = client.matchProjectFromApiOperationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromApiOperationName', () => { + const result = client.matchLocationFromApiOperationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchApiFromApiOperationName', () => { + const result = client.matchApiFromApiOperationName(fakePath); + assert.strictEqual(result, 'apiValue'); + assert( + (client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchVersionFromApiOperationName', () => { + const result = client.matchVersionFromApiOperationName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchOperationFromApiOperationName', () => { + const result = client.matchOperationFromApiOperationName(fakePath); + assert.strictEqual(result, 'operationValue'); + assert( + (client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('attribute', () => { + const fakePath = '/rendered/path/attribute'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + attribute: 'attributeValue', + }; + const client = + new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.attributePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.attributePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('attributePath', () => { + const result = client.attributePath( + 'projectValue', + 'locationValue', + 'attributeValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.attributePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromAttributeName', () => { + const result = client.matchProjectFromAttributeName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.attributePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromAttributeName', () => { + const result = client.matchLocationFromAttributeName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.attributePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAttributeFromAttributeName', () => { + const result = client.matchAttributeFromAttributeName(fakePath); + assert.strictEqual(result, 'attributeValue'); + assert( + (client.pathTemplates.attributePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('definition', () => { + const fakePath = '/rendered/path/definition'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + api: 'apiValue', + version: 'versionValue', + definition: 'definitionValue', + }; + const client = + new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.definitionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.definitionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('definitionPath', () => { + const result = client.definitionPath( + 'projectValue', + 'locationValue', + 'apiValue', + 'versionValue', + 'definitionValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.definitionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromDefinitionName', () => { + const result = client.matchProjectFromDefinitionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromDefinitionName', () => { + const result = client.matchLocationFromDefinitionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchApiFromDefinitionName', () => { + const result = client.matchApiFromDefinitionName(fakePath); + assert.strictEqual(result, 'apiValue'); + assert( + (client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchVersionFromDefinitionName', () => { + const result = client.matchVersionFromDefinitionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDefinitionFromDefinitionName', () => { + const result = client.matchDefinitionFromDefinitionName(fakePath); + assert.strictEqual(result, 'definitionValue'); + assert( + (client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('dependency', () => { + const fakePath = '/rendered/path/dependency'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + dependency: 'dependencyValue', + }; + const client = + new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.dependencyPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.dependencyPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('dependencyPath', () => { + const result = client.dependencyPath( + 'projectValue', + 'locationValue', + 'dependencyValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.dependencyPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromDependencyName', () => { + const result = client.matchProjectFromDependencyName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.dependencyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromDependencyName', () => { + const result = client.matchLocationFromDependencyName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.dependencyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDependencyFromDependencyName', () => { + const result = client.matchDependencyFromDependencyName(fakePath); + assert.strictEqual(result, 'dependencyValue'); + assert( + (client.pathTemplates.dependencyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('deployment', () => { + const fakePath = '/rendered/path/deployment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + deployment: 'deploymentValue', + }; + const client = + new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.deploymentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.deploymentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('deploymentPath', () => { + const result = client.deploymentPath( + 'projectValue', + 'locationValue', + 'deploymentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.deploymentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromDeploymentName', () => { + const result = client.matchProjectFromDeploymentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromDeploymentName', () => { + const result = client.matchLocationFromDeploymentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDeploymentFromDeploymentName', () => { + const result = client.matchDeploymentFromDeploymentName(fakePath); + assert.strictEqual(result, 'deploymentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('externalApi', () => { + const fakePath = '/rendered/path/externalApi'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + external_api: 'externalApiValue', + }; + const client = + new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.externalApiPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.externalApiPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('externalApiPath', () => { + const result = client.externalApiPath( + 'projectValue', + 'locationValue', + 'externalApiValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.externalApiPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromExternalApiName', () => { + const result = client.matchProjectFromExternalApiName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.externalApiPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromExternalApiName', () => { + const result = client.matchLocationFromExternalApiName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.externalApiPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchExternalApiFromExternalApiName', () => { + const result = client.matchExternalApiFromExternalApiName(fakePath); + assert.strictEqual(result, 'externalApiValue'); + assert( + (client.pathTemplates.externalApiPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('hostProjectRegistration', () => { + const fakePath = '/rendered/path/hostProjectRegistration'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + host_project_registration: 'hostProjectRegistrationValue', + }; + const client = + new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.hostProjectRegistrationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.hostProjectRegistrationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('hostProjectRegistrationPath', () => { + const result = client.hostProjectRegistrationPath( + 'projectValue', + 'locationValue', + 'hostProjectRegistrationValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.hostProjectRegistrationPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromHostProjectRegistrationName', () => { + const result = + client.matchProjectFromHostProjectRegistrationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.hostProjectRegistrationPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromHostProjectRegistrationName', () => { + const result = + client.matchLocationFromHostProjectRegistrationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.hostProjectRegistrationPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchHostProjectRegistrationFromHostProjectRegistrationName', () => { + const result = + client.matchHostProjectRegistrationFromHostProjectRegistrationName( + fakePath + ); + assert.strictEqual(result, 'hostProjectRegistrationValue'); + assert( + ( + client.pathTemplates.hostProjectRegistrationPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('location', () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = + new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.locationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.locationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath('projectValue', 'locationValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('plugin', () => { + const fakePath = '/rendered/path/plugin'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + plugin: 'pluginValue', + }; + const client = + new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.pluginPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.pluginPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('pluginPath', () => { + const result = client.pluginPath( + 'projectValue', + 'locationValue', + 'pluginValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.pluginPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromPluginName', () => { + const result = client.matchProjectFromPluginName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.pluginPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromPluginName', () => { + const result = client.matchLocationFromPluginName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.pluginPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchPluginFromPluginName', () => { + const result = client.matchPluginFromPluginName(fakePath); + assert.strictEqual(result, 'pluginValue'); + assert( + (client.pathTemplates.pluginPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('project', () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = + new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.projectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('runtimeProjectAttachment', () => { + const fakePath = '/rendered/path/runtimeProjectAttachment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + runtime_project_attachment: 'runtimeProjectAttachmentValue', + }; + const client = + new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.runtimeProjectAttachmentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.runtimeProjectAttachmentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('runtimeProjectAttachmentPath', () => { + const result = client.runtimeProjectAttachmentPath( + 'projectValue', + 'locationValue', + 'runtimeProjectAttachmentValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.runtimeProjectAttachmentPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRuntimeProjectAttachmentName', () => { + const result = + client.matchProjectFromRuntimeProjectAttachmentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.runtimeProjectAttachmentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromRuntimeProjectAttachmentName', () => { + const result = + client.matchLocationFromRuntimeProjectAttachmentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.runtimeProjectAttachmentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName', () => { + const result = + client.matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName( + fakePath + ); + assert.strictEqual(result, 'runtimeProjectAttachmentValue'); + assert( + ( + client.pathTemplates.runtimeProjectAttachmentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('spec', () => { + const fakePath = '/rendered/path/spec'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + api: 'apiValue', + version: 'versionValue', + spec: 'specValue', + }; + const client = + new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.specPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.specPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('specPath', () => { + const result = client.specPath( + 'projectValue', + 'locationValue', + 'apiValue', + 'versionValue', + 'specValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.specPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromSpecName', () => { + const result = client.matchProjectFromSpecName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromSpecName', () => { + const result = client.matchLocationFromSpecName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchApiFromSpecName', () => { + const result = client.matchApiFromSpecName(fakePath); + assert.strictEqual(result, 'apiValue'); + assert( + (client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchVersionFromSpecName', () => { + const result = client.matchVersionFromSpecName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSpecFromSpecName', () => { + const result = client.matchSpecFromSpecName(fakePath); + assert.strictEqual(result, 'specValue'); + assert( + (client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('styleGuide', () => { + const fakePath = '/rendered/path/styleGuide'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + plugin: 'pluginValue', + }; + const client = + new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.styleGuidePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.styleGuidePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('styleGuidePath', () => { + const result = client.styleGuidePath( + 'projectValue', + 'locationValue', + 'pluginValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.styleGuidePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromStyleGuideName', () => { + const result = client.matchProjectFromStyleGuideName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.styleGuidePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromStyleGuideName', () => { + const result = client.matchLocationFromStyleGuideName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.styleGuidePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchPluginFromStyleGuideName', () => { + const result = client.matchPluginFromStyleGuideName(fakePath); + assert.strictEqual(result, 'pluginValue'); + assert( + (client.pathTemplates.styleGuidePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('version', () => { + const fakePath = '/rendered/path/version'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + api: 'apiValue', + version: 'versionValue', + }; + const client = + new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.versionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.versionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('versionPath', () => { + const result = client.versionPath( + 'projectValue', + 'locationValue', + 'apiValue', + 'versionValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.versionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromVersionName', () => { + const result = client.matchProjectFromVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromVersionName', () => { + const result = client.matchLocationFromVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchApiFromVersionName', () => { + const result = client.matchApiFromVersionName(fakePath); + assert.strictEqual(result, 'apiValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchVersionFromVersionName', () => { + const result = client.matchVersionFromVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-apihub/test/gapic_linting_service_v1.ts b/packages/google-cloud-apihub/test/gapic_linting_service_v1.ts new file mode 100644 index 00000000000..2088a3bdd4c --- /dev/null +++ b/packages/google-cloud-apihub/test/gapic_linting_service_v1.ts @@ -0,0 +1,2010 @@ +// Copyright 2024 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 lintingserviceModule from '../src'; + +import {protobuf, 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 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.LintingServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new lintingserviceModule.v1.LintingServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'apihub.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new lintingserviceModule.v1.LintingServiceClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, 'googleapis.com'); + }); + + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = + lintingserviceModule.v1.LintingServiceClient.servicePath; + assert.strictEqual(servicePath, 'apihub.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = + lintingserviceModule.v1.LintingServiceClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'apihub.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new lintingserviceModule.v1.LintingServiceClient({ + universeDomain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'apihub.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new lintingserviceModule.v1.LintingServiceClient({ + universe_domain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'apihub.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new lintingserviceModule.v1.LintingServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'apihub.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new lintingserviceModule.v1.LintingServiceClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'apihub.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { + new lintingserviceModule.v1.LintingServiceClient({ + universe_domain: 'example.com', + universeDomain: 'example.net', + }); + }); + }); + + it('has port', () => { + const port = lintingserviceModule.v1.LintingServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new lintingserviceModule.v1.LintingServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new lintingserviceModule.v1.LintingServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new lintingserviceModule.v1.LintingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.lintingServiceStub, undefined); + await client.initialize(); + assert(client.lintingServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new lintingserviceModule.v1.LintingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.lintingServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new lintingserviceModule.v1.LintingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.lintingServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new lintingserviceModule.v1.LintingServiceClient({ + 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 lintingserviceModule.v1.LintingServiceClient({ + 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('getStyleGuide', () => { + it('invokes getStyleGuide without error', async () => { + const client = new lintingserviceModule.v1.LintingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetStyleGuideRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.GetStyleGuideRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.StyleGuide() + ); + client.innerApiCalls.getStyleGuide = stubSimpleCall(expectedResponse); + const [response] = await client.getStyleGuide(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getStyleGuide as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getStyleGuide as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getStyleGuide without error using callback', async () => { + const client = new lintingserviceModule.v1.LintingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetStyleGuideRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.GetStyleGuideRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.StyleGuide() + ); + client.innerApiCalls.getStyleGuide = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getStyleGuide( + request, + ( + err?: Error | null, + result?: protos.google.cloud.apihub.v1.IStyleGuide | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getStyleGuide as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getStyleGuide as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getStyleGuide with error', async () => { + const client = new lintingserviceModule.v1.LintingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetStyleGuideRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.GetStyleGuideRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getStyleGuide = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getStyleGuide(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getStyleGuide as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getStyleGuide as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getStyleGuide with closed client', async () => { + const client = new lintingserviceModule.v1.LintingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetStyleGuideRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.GetStyleGuideRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getStyleGuide(request), expectedError); + }); + }); + + describe('updateStyleGuide', () => { + it('invokes updateStyleGuide without error', async () => { + const client = new lintingserviceModule.v1.LintingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.UpdateStyleGuideRequest() + ); + request.styleGuide ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.UpdateStyleGuideRequest', + ['styleGuide', 'name'] + ); + request.styleGuide.name = defaultValue1; + const expectedHeaderRequestParams = `style_guide.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.StyleGuide() + ); + client.innerApiCalls.updateStyleGuide = stubSimpleCall(expectedResponse); + const [response] = await client.updateStyleGuide(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateStyleGuide as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateStyleGuide as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateStyleGuide without error using callback', async () => { + const client = new lintingserviceModule.v1.LintingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.UpdateStyleGuideRequest() + ); + request.styleGuide ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.UpdateStyleGuideRequest', + ['styleGuide', 'name'] + ); + request.styleGuide.name = defaultValue1; + const expectedHeaderRequestParams = `style_guide.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.StyleGuide() + ); + client.innerApiCalls.updateStyleGuide = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateStyleGuide( + request, + ( + err?: Error | null, + result?: protos.google.cloud.apihub.v1.IStyleGuide | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateStyleGuide as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateStyleGuide as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateStyleGuide with error', async () => { + const client = new lintingserviceModule.v1.LintingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.UpdateStyleGuideRequest() + ); + request.styleGuide ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.UpdateStyleGuideRequest', + ['styleGuide', 'name'] + ); + request.styleGuide.name = defaultValue1; + const expectedHeaderRequestParams = `style_guide.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateStyleGuide = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateStyleGuide(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateStyleGuide as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateStyleGuide as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateStyleGuide with closed client', async () => { + const client = new lintingserviceModule.v1.LintingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.UpdateStyleGuideRequest() + ); + request.styleGuide ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.UpdateStyleGuideRequest', + ['styleGuide', 'name'] + ); + request.styleGuide.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateStyleGuide(request), expectedError); + }); + }); + + describe('getStyleGuideContents', () => { + it('invokes getStyleGuideContents without error', async () => { + const client = new lintingserviceModule.v1.LintingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetStyleGuideContentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.GetStyleGuideContentsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.StyleGuideContents() + ); + client.innerApiCalls.getStyleGuideContents = + stubSimpleCall(expectedResponse); + const [response] = await client.getStyleGuideContents(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getStyleGuideContents as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getStyleGuideContents as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getStyleGuideContents without error using callback', async () => { + const client = new lintingserviceModule.v1.LintingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetStyleGuideContentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.GetStyleGuideContentsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.StyleGuideContents() + ); + client.innerApiCalls.getStyleGuideContents = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getStyleGuideContents( + request, + ( + err?: Error | null, + result?: protos.google.cloud.apihub.v1.IStyleGuideContents | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getStyleGuideContents as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getStyleGuideContents as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getStyleGuideContents with error', async () => { + const client = new lintingserviceModule.v1.LintingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetStyleGuideContentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.GetStyleGuideContentsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getStyleGuideContents = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.getStyleGuideContents(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.getStyleGuideContents as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getStyleGuideContents as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getStyleGuideContents with closed client', async () => { + const client = new lintingserviceModule.v1.LintingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetStyleGuideContentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.GetStyleGuideContentsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.getStyleGuideContents(request), + expectedError + ); + }); + }); + + describe('lintSpec', () => { + it('invokes lintSpec without error', async () => { + const client = new lintingserviceModule.v1.LintingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.LintSpecRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.LintSpecRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.lintSpec = stubSimpleCall(expectedResponse); + const [response] = await client.lintSpec(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.lintSpec as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.lintSpec as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes lintSpec without error using callback', async () => { + const client = new lintingserviceModule.v1.LintingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.LintSpecRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.LintSpecRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.lintSpec = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.lintSpec( + request, + ( + err?: Error | null, + result?: protos.google.protobuf.IEmpty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.lintSpec as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.lintSpec as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes lintSpec with error', async () => { + const client = new lintingserviceModule.v1.LintingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.LintSpecRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.LintSpecRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.lintSpec = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.lintSpec(request), expectedError); + const actualRequest = ( + client.innerApiCalls.lintSpec as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.lintSpec as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes lintSpec with closed client', async () => { + const client = new lintingserviceModule.v1.LintingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.LintSpecRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.LintSpecRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.lintSpec(request), expectedError); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new lintingserviceModule.v1.LintingServiceClient({ + 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 lintingserviceModule.v1.LintingServiceClient({ + 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 lintingserviceModule.v1.LintingServiceClient({ + 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 lintingserviceModule.v1.LintingServiceClient({ + 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 lintingserviceModule.v1.LintingServiceClient({ + 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('Path templates', () => { + describe('api', () => { + const fakePath = '/rendered/path/api'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + api: 'apiValue', + }; + const client = new lintingserviceModule.v1.LintingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.apiPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.apiPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('apiPath', () => { + const result = client.apiPath( + 'projectValue', + 'locationValue', + 'apiValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.apiPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromApiName', () => { + const result = client.matchProjectFromApiName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.apiPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromApiName', () => { + const result = client.matchLocationFromApiName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.apiPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchApiFromApiName', () => { + const result = client.matchApiFromApiName(fakePath); + assert.strictEqual(result, 'apiValue'); + assert( + (client.pathTemplates.apiPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('apiHubInstance', () => { + const fakePath = '/rendered/path/apiHubInstance'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + api_hub_instance: 'apiHubInstanceValue', + }; + const client = new lintingserviceModule.v1.LintingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.apiHubInstancePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.apiHubInstancePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('apiHubInstancePath', () => { + const result = client.apiHubInstancePath( + 'projectValue', + 'locationValue', + 'apiHubInstanceValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.apiHubInstancePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromApiHubInstanceName', () => { + const result = client.matchProjectFromApiHubInstanceName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromApiHubInstanceName', () => { + const result = client.matchLocationFromApiHubInstanceName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchApiHubInstanceFromApiHubInstanceName', () => { + const result = + client.matchApiHubInstanceFromApiHubInstanceName(fakePath); + assert.strictEqual(result, 'apiHubInstanceValue'); + assert( + (client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('apiOperation', () => { + const fakePath = '/rendered/path/apiOperation'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + api: 'apiValue', + version: 'versionValue', + operation: 'operationValue', + }; + const client = new lintingserviceModule.v1.LintingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.apiOperationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.apiOperationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('apiOperationPath', () => { + const result = client.apiOperationPath( + 'projectValue', + 'locationValue', + 'apiValue', + 'versionValue', + 'operationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.apiOperationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromApiOperationName', () => { + const result = client.matchProjectFromApiOperationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromApiOperationName', () => { + const result = client.matchLocationFromApiOperationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchApiFromApiOperationName', () => { + const result = client.matchApiFromApiOperationName(fakePath); + assert.strictEqual(result, 'apiValue'); + assert( + (client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchVersionFromApiOperationName', () => { + const result = client.matchVersionFromApiOperationName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchOperationFromApiOperationName', () => { + const result = client.matchOperationFromApiOperationName(fakePath); + assert.strictEqual(result, 'operationValue'); + assert( + (client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('attribute', () => { + const fakePath = '/rendered/path/attribute'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + attribute: 'attributeValue', + }; + const client = new lintingserviceModule.v1.LintingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.attributePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.attributePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('attributePath', () => { + const result = client.attributePath( + 'projectValue', + 'locationValue', + 'attributeValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.attributePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromAttributeName', () => { + const result = client.matchProjectFromAttributeName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.attributePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromAttributeName', () => { + const result = client.matchLocationFromAttributeName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.attributePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAttributeFromAttributeName', () => { + const result = client.matchAttributeFromAttributeName(fakePath); + assert.strictEqual(result, 'attributeValue'); + assert( + (client.pathTemplates.attributePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('definition', () => { + const fakePath = '/rendered/path/definition'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + api: 'apiValue', + version: 'versionValue', + definition: 'definitionValue', + }; + const client = new lintingserviceModule.v1.LintingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.definitionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.definitionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('definitionPath', () => { + const result = client.definitionPath( + 'projectValue', + 'locationValue', + 'apiValue', + 'versionValue', + 'definitionValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.definitionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromDefinitionName', () => { + const result = client.matchProjectFromDefinitionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromDefinitionName', () => { + const result = client.matchLocationFromDefinitionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchApiFromDefinitionName', () => { + const result = client.matchApiFromDefinitionName(fakePath); + assert.strictEqual(result, 'apiValue'); + assert( + (client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchVersionFromDefinitionName', () => { + const result = client.matchVersionFromDefinitionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDefinitionFromDefinitionName', () => { + const result = client.matchDefinitionFromDefinitionName(fakePath); + assert.strictEqual(result, 'definitionValue'); + assert( + (client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('dependency', () => { + const fakePath = '/rendered/path/dependency'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + dependency: 'dependencyValue', + }; + const client = new lintingserviceModule.v1.LintingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dependencyPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.dependencyPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('dependencyPath', () => { + const result = client.dependencyPath( + 'projectValue', + 'locationValue', + 'dependencyValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.dependencyPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromDependencyName', () => { + const result = client.matchProjectFromDependencyName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.dependencyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromDependencyName', () => { + const result = client.matchLocationFromDependencyName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.dependencyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDependencyFromDependencyName', () => { + const result = client.matchDependencyFromDependencyName(fakePath); + assert.strictEqual(result, 'dependencyValue'); + assert( + (client.pathTemplates.dependencyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('deployment', () => { + const fakePath = '/rendered/path/deployment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + deployment: 'deploymentValue', + }; + const client = new lintingserviceModule.v1.LintingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.deploymentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.deploymentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('deploymentPath', () => { + const result = client.deploymentPath( + 'projectValue', + 'locationValue', + 'deploymentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.deploymentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromDeploymentName', () => { + const result = client.matchProjectFromDeploymentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromDeploymentName', () => { + const result = client.matchLocationFromDeploymentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDeploymentFromDeploymentName', () => { + const result = client.matchDeploymentFromDeploymentName(fakePath); + assert.strictEqual(result, 'deploymentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('externalApi', () => { + const fakePath = '/rendered/path/externalApi'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + external_api: 'externalApiValue', + }; + const client = new lintingserviceModule.v1.LintingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.externalApiPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.externalApiPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('externalApiPath', () => { + const result = client.externalApiPath( + 'projectValue', + 'locationValue', + 'externalApiValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.externalApiPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromExternalApiName', () => { + const result = client.matchProjectFromExternalApiName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.externalApiPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromExternalApiName', () => { + const result = client.matchLocationFromExternalApiName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.externalApiPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchExternalApiFromExternalApiName', () => { + const result = client.matchExternalApiFromExternalApiName(fakePath); + assert.strictEqual(result, 'externalApiValue'); + assert( + (client.pathTemplates.externalApiPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('hostProjectRegistration', () => { + const fakePath = '/rendered/path/hostProjectRegistration'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + host_project_registration: 'hostProjectRegistrationValue', + }; + const client = new lintingserviceModule.v1.LintingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.hostProjectRegistrationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.hostProjectRegistrationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('hostProjectRegistrationPath', () => { + const result = client.hostProjectRegistrationPath( + 'projectValue', + 'locationValue', + 'hostProjectRegistrationValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.hostProjectRegistrationPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromHostProjectRegistrationName', () => { + const result = + client.matchProjectFromHostProjectRegistrationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.hostProjectRegistrationPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromHostProjectRegistrationName', () => { + const result = + client.matchLocationFromHostProjectRegistrationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.hostProjectRegistrationPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchHostProjectRegistrationFromHostProjectRegistrationName', () => { + const result = + client.matchHostProjectRegistrationFromHostProjectRegistrationName( + fakePath + ); + assert.strictEqual(result, 'hostProjectRegistrationValue'); + assert( + ( + client.pathTemplates.hostProjectRegistrationPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('plugin', () => { + const fakePath = '/rendered/path/plugin'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + plugin: 'pluginValue', + }; + const client = new lintingserviceModule.v1.LintingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.pluginPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.pluginPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('pluginPath', () => { + const result = client.pluginPath( + 'projectValue', + 'locationValue', + 'pluginValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.pluginPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromPluginName', () => { + const result = client.matchProjectFromPluginName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.pluginPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromPluginName', () => { + const result = client.matchLocationFromPluginName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.pluginPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchPluginFromPluginName', () => { + const result = client.matchPluginFromPluginName(fakePath); + assert.strictEqual(result, 'pluginValue'); + assert( + (client.pathTemplates.pluginPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('runtimeProjectAttachment', () => { + const fakePath = '/rendered/path/runtimeProjectAttachment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + runtime_project_attachment: 'runtimeProjectAttachmentValue', + }; + const client = new lintingserviceModule.v1.LintingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.runtimeProjectAttachmentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.runtimeProjectAttachmentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('runtimeProjectAttachmentPath', () => { + const result = client.runtimeProjectAttachmentPath( + 'projectValue', + 'locationValue', + 'runtimeProjectAttachmentValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.runtimeProjectAttachmentPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRuntimeProjectAttachmentName', () => { + const result = + client.matchProjectFromRuntimeProjectAttachmentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.runtimeProjectAttachmentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromRuntimeProjectAttachmentName', () => { + const result = + client.matchLocationFromRuntimeProjectAttachmentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.runtimeProjectAttachmentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName', () => { + const result = + client.matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName( + fakePath + ); + assert.strictEqual(result, 'runtimeProjectAttachmentValue'); + assert( + ( + client.pathTemplates.runtimeProjectAttachmentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('spec', () => { + const fakePath = '/rendered/path/spec'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + api: 'apiValue', + version: 'versionValue', + spec: 'specValue', + }; + const client = new lintingserviceModule.v1.LintingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.specPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.specPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('specPath', () => { + const result = client.specPath( + 'projectValue', + 'locationValue', + 'apiValue', + 'versionValue', + 'specValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.specPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromSpecName', () => { + const result = client.matchProjectFromSpecName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromSpecName', () => { + const result = client.matchLocationFromSpecName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchApiFromSpecName', () => { + const result = client.matchApiFromSpecName(fakePath); + assert.strictEqual(result, 'apiValue'); + assert( + (client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchVersionFromSpecName', () => { + const result = client.matchVersionFromSpecName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSpecFromSpecName', () => { + const result = client.matchSpecFromSpecName(fakePath); + assert.strictEqual(result, 'specValue'); + assert( + (client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('styleGuide', () => { + const fakePath = '/rendered/path/styleGuide'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + plugin: 'pluginValue', + }; + const client = new lintingserviceModule.v1.LintingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.styleGuidePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.styleGuidePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('styleGuidePath', () => { + const result = client.styleGuidePath( + 'projectValue', + 'locationValue', + 'pluginValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.styleGuidePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromStyleGuideName', () => { + const result = client.matchProjectFromStyleGuideName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.styleGuidePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromStyleGuideName', () => { + const result = client.matchLocationFromStyleGuideName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.styleGuidePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchPluginFromStyleGuideName', () => { + const result = client.matchPluginFromStyleGuideName(fakePath); + assert.strictEqual(result, 'pluginValue'); + assert( + (client.pathTemplates.styleGuidePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('version', () => { + const fakePath = '/rendered/path/version'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + api: 'apiValue', + version: 'versionValue', + }; + const client = new lintingserviceModule.v1.LintingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.versionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.versionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('versionPath', () => { + const result = client.versionPath( + 'projectValue', + 'locationValue', + 'apiValue', + 'versionValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.versionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromVersionName', () => { + const result = client.matchProjectFromVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromVersionName', () => { + const result = client.matchLocationFromVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchApiFromVersionName', () => { + const result = client.matchApiFromVersionName(fakePath); + assert.strictEqual(result, 'apiValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchVersionFromVersionName', () => { + const result = client.matchVersionFromVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-apihub/test/gapic_provisioning_v1.ts b/packages/google-cloud-apihub/test/gapic_provisioning_v1.ts new file mode 100644 index 00000000000..b1aa6b16e94 --- /dev/null +++ b/packages/google-cloud-apihub/test/gapic_provisioning_v1.ts @@ -0,0 +1,2366 @@ +// Copyright 2024 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 provisioningModule from '../src'; + +import { + protobuf, + LROperation, + operationsProtos, + 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 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.ProvisioningClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new provisioningModule.v1.ProvisioningClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'apihub.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new provisioningModule.v1.ProvisioningClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, 'googleapis.com'); + }); + + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = + provisioningModule.v1.ProvisioningClient.servicePath; + assert.strictEqual(servicePath, 'apihub.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = + provisioningModule.v1.ProvisioningClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'apihub.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new provisioningModule.v1.ProvisioningClient({ + universeDomain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'apihub.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new provisioningModule.v1.ProvisioningClient({ + universe_domain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'apihub.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new provisioningModule.v1.ProvisioningClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'apihub.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new provisioningModule.v1.ProvisioningClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'apihub.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { + new provisioningModule.v1.ProvisioningClient({ + universe_domain: 'example.com', + universeDomain: 'example.net', + }); + }); + }); + + it('has port', () => { + const port = provisioningModule.v1.ProvisioningClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new provisioningModule.v1.ProvisioningClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new provisioningModule.v1.ProvisioningClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.provisioningStub, undefined); + await client.initialize(); + assert(client.provisioningStub); + }); + + it('has close method for the initialized client', done => { + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.provisioningStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.provisioningStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new provisioningModule.v1.ProvisioningClient({ + 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 provisioningModule.v1.ProvisioningClient({ + 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('getApiHubInstance', () => { + it('invokes getApiHubInstance without error', async () => { + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetApiHubInstanceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.GetApiHubInstanceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.ApiHubInstance() + ); + client.innerApiCalls.getApiHubInstance = stubSimpleCall(expectedResponse); + const [response] = await client.getApiHubInstance(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getApiHubInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getApiHubInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getApiHubInstance without error using callback', async () => { + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetApiHubInstanceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.GetApiHubInstanceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.ApiHubInstance() + ); + client.innerApiCalls.getApiHubInstance = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getApiHubInstance( + request, + ( + err?: Error | null, + result?: protos.google.cloud.apihub.v1.IApiHubInstance | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getApiHubInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getApiHubInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getApiHubInstance with error', async () => { + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetApiHubInstanceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.GetApiHubInstanceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getApiHubInstance = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getApiHubInstance(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getApiHubInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getApiHubInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getApiHubInstance with closed client', async () => { + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetApiHubInstanceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.GetApiHubInstanceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getApiHubInstance(request), expectedError); + }); + }); + + describe('lookupApiHubInstance', () => { + it('invokes lookupApiHubInstance without error', async () => { + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.LookupApiHubInstanceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.LookupApiHubInstanceRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.LookupApiHubInstanceResponse() + ); + client.innerApiCalls.lookupApiHubInstance = + stubSimpleCall(expectedResponse); + const [response] = await client.lookupApiHubInstance(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.lookupApiHubInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.lookupApiHubInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes lookupApiHubInstance without error using callback', async () => { + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.LookupApiHubInstanceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.LookupApiHubInstanceRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.LookupApiHubInstanceResponse() + ); + client.innerApiCalls.lookupApiHubInstance = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.lookupApiHubInstance( + request, + ( + err?: Error | null, + result?: protos.google.cloud.apihub.v1.ILookupApiHubInstanceResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.lookupApiHubInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.lookupApiHubInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes lookupApiHubInstance with error', async () => { + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.LookupApiHubInstanceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.LookupApiHubInstanceRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.lookupApiHubInstance = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.lookupApiHubInstance(request), expectedError); + const actualRequest = ( + client.innerApiCalls.lookupApiHubInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.lookupApiHubInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes lookupApiHubInstance with closed client', async () => { + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.LookupApiHubInstanceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.LookupApiHubInstanceRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.lookupApiHubInstance(request), expectedError); + }); + }); + + describe('createApiHubInstance', () => { + it('invokes createApiHubInstance without error', async () => { + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateApiHubInstanceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.CreateApiHubInstanceRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createApiHubInstance = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createApiHubInstance(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createApiHubInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createApiHubInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createApiHubInstance without error using callback', async () => { + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateApiHubInstanceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.CreateApiHubInstanceRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createApiHubInstance = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createApiHubInstance( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.apihub.v1.IApiHubInstance, + protos.google.cloud.apihub.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.apihub.v1.IApiHubInstance, + protos.google.cloud.apihub.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createApiHubInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createApiHubInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createApiHubInstance with call error', async () => { + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateApiHubInstanceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.CreateApiHubInstanceRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createApiHubInstance = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.createApiHubInstance(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createApiHubInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createApiHubInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createApiHubInstance with LRO error', async () => { + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateApiHubInstanceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.CreateApiHubInstanceRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createApiHubInstance = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createApiHubInstance(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createApiHubInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createApiHubInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateApiHubInstanceProgress without error', async () => { + const client = new provisioningModule.v1.ProvisioningClient({ + 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.checkCreateApiHubInstanceProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateApiHubInstanceProgress with error', async () => { + const client = new provisioningModule.v1.ProvisioningClient({ + 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.checkCreateApiHubInstanceProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new provisioningModule.v1.ProvisioningClient({ + 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 provisioningModule.v1.ProvisioningClient({ + 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 provisioningModule.v1.ProvisioningClient({ + 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 provisioningModule.v1.ProvisioningClient({ + 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 provisioningModule.v1.ProvisioningClient({ + 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 provisioningModule.v1.ProvisioningClient({ + 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 provisioningModule.v1.ProvisioningClient({ + 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 provisioningModule.v1.ProvisioningClient({ + 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 provisioningModule.v1.ProvisioningClient({ + 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 provisioningModule.v1.ProvisioningClient({ + 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 provisioningModule.v1.ProvisioningClient({ + 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 provisioningModule.v1.ProvisioningClient({ + 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 provisioningModule.v1.ProvisioningClient({ + 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 provisioningModule.v1.ProvisioningClient({ + 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 provisioningModule.v1.ProvisioningClient({ + 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 provisioningModule.v1.ProvisioningClient({ + 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('api', () => { + const fakePath = '/rendered/path/api'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + api: 'apiValue', + }; + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.apiPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.apiPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('apiPath', () => { + const result = client.apiPath( + 'projectValue', + 'locationValue', + 'apiValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.apiPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromApiName', () => { + const result = client.matchProjectFromApiName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.apiPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromApiName', () => { + const result = client.matchLocationFromApiName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.apiPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchApiFromApiName', () => { + const result = client.matchApiFromApiName(fakePath); + assert.strictEqual(result, 'apiValue'); + assert( + (client.pathTemplates.apiPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('apiHubInstance', () => { + const fakePath = '/rendered/path/apiHubInstance'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + api_hub_instance: 'apiHubInstanceValue', + }; + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.apiHubInstancePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.apiHubInstancePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('apiHubInstancePath', () => { + const result = client.apiHubInstancePath( + 'projectValue', + 'locationValue', + 'apiHubInstanceValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.apiHubInstancePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromApiHubInstanceName', () => { + const result = client.matchProjectFromApiHubInstanceName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromApiHubInstanceName', () => { + const result = client.matchLocationFromApiHubInstanceName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchApiHubInstanceFromApiHubInstanceName', () => { + const result = + client.matchApiHubInstanceFromApiHubInstanceName(fakePath); + assert.strictEqual(result, 'apiHubInstanceValue'); + assert( + (client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('apiOperation', () => { + const fakePath = '/rendered/path/apiOperation'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + api: 'apiValue', + version: 'versionValue', + operation: 'operationValue', + }; + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.apiOperationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.apiOperationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('apiOperationPath', () => { + const result = client.apiOperationPath( + 'projectValue', + 'locationValue', + 'apiValue', + 'versionValue', + 'operationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.apiOperationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromApiOperationName', () => { + const result = client.matchProjectFromApiOperationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromApiOperationName', () => { + const result = client.matchLocationFromApiOperationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchApiFromApiOperationName', () => { + const result = client.matchApiFromApiOperationName(fakePath); + assert.strictEqual(result, 'apiValue'); + assert( + (client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchVersionFromApiOperationName', () => { + const result = client.matchVersionFromApiOperationName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchOperationFromApiOperationName', () => { + const result = client.matchOperationFromApiOperationName(fakePath); + assert.strictEqual(result, 'operationValue'); + assert( + (client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('attribute', () => { + const fakePath = '/rendered/path/attribute'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + attribute: 'attributeValue', + }; + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.attributePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.attributePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('attributePath', () => { + const result = client.attributePath( + 'projectValue', + 'locationValue', + 'attributeValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.attributePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromAttributeName', () => { + const result = client.matchProjectFromAttributeName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.attributePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromAttributeName', () => { + const result = client.matchLocationFromAttributeName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.attributePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAttributeFromAttributeName', () => { + const result = client.matchAttributeFromAttributeName(fakePath); + assert.strictEqual(result, 'attributeValue'); + assert( + (client.pathTemplates.attributePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('definition', () => { + const fakePath = '/rendered/path/definition'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + api: 'apiValue', + version: 'versionValue', + definition: 'definitionValue', + }; + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.definitionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.definitionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('definitionPath', () => { + const result = client.definitionPath( + 'projectValue', + 'locationValue', + 'apiValue', + 'versionValue', + 'definitionValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.definitionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromDefinitionName', () => { + const result = client.matchProjectFromDefinitionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromDefinitionName', () => { + const result = client.matchLocationFromDefinitionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchApiFromDefinitionName', () => { + const result = client.matchApiFromDefinitionName(fakePath); + assert.strictEqual(result, 'apiValue'); + assert( + (client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchVersionFromDefinitionName', () => { + const result = client.matchVersionFromDefinitionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDefinitionFromDefinitionName', () => { + const result = client.matchDefinitionFromDefinitionName(fakePath); + assert.strictEqual(result, 'definitionValue'); + assert( + (client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('dependency', () => { + const fakePath = '/rendered/path/dependency'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + dependency: 'dependencyValue', + }; + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dependencyPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.dependencyPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('dependencyPath', () => { + const result = client.dependencyPath( + 'projectValue', + 'locationValue', + 'dependencyValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.dependencyPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromDependencyName', () => { + const result = client.matchProjectFromDependencyName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.dependencyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromDependencyName', () => { + const result = client.matchLocationFromDependencyName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.dependencyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDependencyFromDependencyName', () => { + const result = client.matchDependencyFromDependencyName(fakePath); + assert.strictEqual(result, 'dependencyValue'); + assert( + (client.pathTemplates.dependencyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('deployment', () => { + const fakePath = '/rendered/path/deployment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + deployment: 'deploymentValue', + }; + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.deploymentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.deploymentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('deploymentPath', () => { + const result = client.deploymentPath( + 'projectValue', + 'locationValue', + 'deploymentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.deploymentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromDeploymentName', () => { + const result = client.matchProjectFromDeploymentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromDeploymentName', () => { + const result = client.matchLocationFromDeploymentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDeploymentFromDeploymentName', () => { + const result = client.matchDeploymentFromDeploymentName(fakePath); + assert.strictEqual(result, 'deploymentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('externalApi', () => { + const fakePath = '/rendered/path/externalApi'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + external_api: 'externalApiValue', + }; + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.externalApiPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.externalApiPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('externalApiPath', () => { + const result = client.externalApiPath( + 'projectValue', + 'locationValue', + 'externalApiValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.externalApiPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromExternalApiName', () => { + const result = client.matchProjectFromExternalApiName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.externalApiPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromExternalApiName', () => { + const result = client.matchLocationFromExternalApiName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.externalApiPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchExternalApiFromExternalApiName', () => { + const result = client.matchExternalApiFromExternalApiName(fakePath); + assert.strictEqual(result, 'externalApiValue'); + assert( + (client.pathTemplates.externalApiPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('hostProjectRegistration', () => { + const fakePath = '/rendered/path/hostProjectRegistration'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + host_project_registration: 'hostProjectRegistrationValue', + }; + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.hostProjectRegistrationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.hostProjectRegistrationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('hostProjectRegistrationPath', () => { + const result = client.hostProjectRegistrationPath( + 'projectValue', + 'locationValue', + 'hostProjectRegistrationValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.hostProjectRegistrationPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromHostProjectRegistrationName', () => { + const result = + client.matchProjectFromHostProjectRegistrationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.hostProjectRegistrationPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromHostProjectRegistrationName', () => { + const result = + client.matchLocationFromHostProjectRegistrationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.hostProjectRegistrationPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchHostProjectRegistrationFromHostProjectRegistrationName', () => { + const result = + client.matchHostProjectRegistrationFromHostProjectRegistrationName( + fakePath + ); + assert.strictEqual(result, 'hostProjectRegistrationValue'); + assert( + ( + client.pathTemplates.hostProjectRegistrationPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('location', () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.locationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.locationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath('projectValue', 'locationValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('plugin', () => { + const fakePath = '/rendered/path/plugin'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + plugin: 'pluginValue', + }; + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.pluginPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.pluginPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('pluginPath', () => { + const result = client.pluginPath( + 'projectValue', + 'locationValue', + 'pluginValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.pluginPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromPluginName', () => { + const result = client.matchProjectFromPluginName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.pluginPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromPluginName', () => { + const result = client.matchLocationFromPluginName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.pluginPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchPluginFromPluginName', () => { + const result = client.matchPluginFromPluginName(fakePath); + assert.strictEqual(result, 'pluginValue'); + assert( + (client.pathTemplates.pluginPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('project', () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('runtimeProjectAttachment', () => { + const fakePath = '/rendered/path/runtimeProjectAttachment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + runtime_project_attachment: 'runtimeProjectAttachmentValue', + }; + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.runtimeProjectAttachmentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.runtimeProjectAttachmentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('runtimeProjectAttachmentPath', () => { + const result = client.runtimeProjectAttachmentPath( + 'projectValue', + 'locationValue', + 'runtimeProjectAttachmentValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.runtimeProjectAttachmentPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRuntimeProjectAttachmentName', () => { + const result = + client.matchProjectFromRuntimeProjectAttachmentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.runtimeProjectAttachmentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromRuntimeProjectAttachmentName', () => { + const result = + client.matchLocationFromRuntimeProjectAttachmentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.runtimeProjectAttachmentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName', () => { + const result = + client.matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName( + fakePath + ); + assert.strictEqual(result, 'runtimeProjectAttachmentValue'); + assert( + ( + client.pathTemplates.runtimeProjectAttachmentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('spec', () => { + const fakePath = '/rendered/path/spec'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + api: 'apiValue', + version: 'versionValue', + spec: 'specValue', + }; + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.specPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.specPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('specPath', () => { + const result = client.specPath( + 'projectValue', + 'locationValue', + 'apiValue', + 'versionValue', + 'specValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.specPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromSpecName', () => { + const result = client.matchProjectFromSpecName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromSpecName', () => { + const result = client.matchLocationFromSpecName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchApiFromSpecName', () => { + const result = client.matchApiFromSpecName(fakePath); + assert.strictEqual(result, 'apiValue'); + assert( + (client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchVersionFromSpecName', () => { + const result = client.matchVersionFromSpecName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSpecFromSpecName', () => { + const result = client.matchSpecFromSpecName(fakePath); + assert.strictEqual(result, 'specValue'); + assert( + (client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('styleGuide', () => { + const fakePath = '/rendered/path/styleGuide'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + plugin: 'pluginValue', + }; + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.styleGuidePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.styleGuidePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('styleGuidePath', () => { + const result = client.styleGuidePath( + 'projectValue', + 'locationValue', + 'pluginValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.styleGuidePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromStyleGuideName', () => { + const result = client.matchProjectFromStyleGuideName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.styleGuidePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromStyleGuideName', () => { + const result = client.matchLocationFromStyleGuideName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.styleGuidePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchPluginFromStyleGuideName', () => { + const result = client.matchPluginFromStyleGuideName(fakePath); + assert.strictEqual(result, 'pluginValue'); + assert( + (client.pathTemplates.styleGuidePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('version', () => { + const fakePath = '/rendered/path/version'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + api: 'apiValue', + version: 'versionValue', + }; + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.versionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.versionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('versionPath', () => { + const result = client.versionPath( + 'projectValue', + 'locationValue', + 'apiValue', + 'versionValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.versionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromVersionName', () => { + const result = client.matchProjectFromVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromVersionName', () => { + const result = client.matchLocationFromVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchApiFromVersionName', () => { + const result = client.matchApiFromVersionName(fakePath); + assert.strictEqual(result, 'apiValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchVersionFromVersionName', () => { + const result = client.matchVersionFromVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-apihub/test/gapic_runtime_project_attachment_service_v1.ts b/packages/google-cloud-apihub/test/gapic_runtime_project_attachment_service_v1.ts new file mode 100644 index 00000000000..6044652b764 --- /dev/null +++ b/packages/google-cloud-apihub/test/gapic_runtime_project_attachment_service_v1.ts @@ -0,0 +1,2682 @@ +// Copyright 2024 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 runtimeprojectattachmentserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, 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 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.RuntimeProjectAttachmentServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = + new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'apihub.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = + new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, 'googleapis.com'); + }); + + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = + runtimeprojectattachmentserviceModule.v1 + .RuntimeProjectAttachmentServiceClient.servicePath; + assert.strictEqual(servicePath, 'apihub.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = + runtimeprojectattachmentserviceModule.v1 + .RuntimeProjectAttachmentServiceClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'apihub.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = + new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient( + {universeDomain: 'example.com'} + ); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'apihub.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = + new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient( + {universe_domain: 'example.com'} + ); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'apihub.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = + new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'apihub.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = + new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient( + {universeDomain: 'configured.example.com'} + ); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'apihub.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { + new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient( + {universe_domain: 'example.com', universeDomain: 'example.net'} + ); + }); + }); + + it('has port', () => { + const port = + runtimeprojectattachmentserviceModule.v1 + .RuntimeProjectAttachmentServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = + new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = + new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient( + { + fallback: true, + } + ); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = + new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + assert.strictEqual(client.runtimeProjectAttachmentServiceStub, undefined); + await client.initialize(); + assert(client.runtimeProjectAttachmentServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = + new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + assert(client.runtimeProjectAttachmentServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = + new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + assert.strictEqual(client.runtimeProjectAttachmentServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient( + { + 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 runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient( + { + 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('createRuntimeProjectAttachment', () => { + it('invokes createRuntimeProjectAttachment without error', async () => { + const client = + new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.RuntimeProjectAttachment() + ); + client.innerApiCalls.createRuntimeProjectAttachment = + stubSimpleCall(expectedResponse); + const [response] = await client.createRuntimeProjectAttachment(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createRuntimeProjectAttachment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createRuntimeProjectAttachment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createRuntimeProjectAttachment without error using callback', async () => { + const client = + new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.RuntimeProjectAttachment() + ); + client.innerApiCalls.createRuntimeProjectAttachment = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createRuntimeProjectAttachment( + request, + ( + err?: Error | null, + result?: protos.google.cloud.apihub.v1.IRuntimeProjectAttachment | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createRuntimeProjectAttachment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createRuntimeProjectAttachment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createRuntimeProjectAttachment with error', async () => { + const client = + new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createRuntimeProjectAttachment = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.createRuntimeProjectAttachment(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.createRuntimeProjectAttachment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createRuntimeProjectAttachment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createRuntimeProjectAttachment with closed client', async () => { + const client = + new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.createRuntimeProjectAttachment(request), + expectedError + ); + }); + }); + + describe('getRuntimeProjectAttachment', () => { + it('invokes getRuntimeProjectAttachment without error', async () => { + const client = + new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.RuntimeProjectAttachment() + ); + client.innerApiCalls.getRuntimeProjectAttachment = + stubSimpleCall(expectedResponse); + const [response] = await client.getRuntimeProjectAttachment(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getRuntimeProjectAttachment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getRuntimeProjectAttachment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getRuntimeProjectAttachment without error using callback', async () => { + const client = + new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.RuntimeProjectAttachment() + ); + client.innerApiCalls.getRuntimeProjectAttachment = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getRuntimeProjectAttachment( + request, + ( + err?: Error | null, + result?: protos.google.cloud.apihub.v1.IRuntimeProjectAttachment | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getRuntimeProjectAttachment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getRuntimeProjectAttachment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getRuntimeProjectAttachment with error', async () => { + const client = + new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getRuntimeProjectAttachment = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.getRuntimeProjectAttachment(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.getRuntimeProjectAttachment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getRuntimeProjectAttachment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getRuntimeProjectAttachment with closed client', async () => { + const client = + new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.getRuntimeProjectAttachment(request), + expectedError + ); + }); + }); + + describe('deleteRuntimeProjectAttachment', () => { + it('invokes deleteRuntimeProjectAttachment without error', async () => { + const client = + new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteRuntimeProjectAttachment = + stubSimpleCall(expectedResponse); + const [response] = await client.deleteRuntimeProjectAttachment(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteRuntimeProjectAttachment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteRuntimeProjectAttachment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteRuntimeProjectAttachment without error using callback', async () => { + const client = + new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteRuntimeProjectAttachment = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteRuntimeProjectAttachment( + request, + ( + err?: Error | null, + result?: protos.google.protobuf.IEmpty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteRuntimeProjectAttachment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteRuntimeProjectAttachment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteRuntimeProjectAttachment with error', async () => { + const client = + new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteRuntimeProjectAttachment = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.deleteRuntimeProjectAttachment(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.deleteRuntimeProjectAttachment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteRuntimeProjectAttachment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteRuntimeProjectAttachment with closed client', async () => { + const client = + new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.deleteRuntimeProjectAttachment(request), + expectedError + ); + }); + }); + + describe('lookupRuntimeProjectAttachment', () => { + it('invokes lookupRuntimeProjectAttachment without error', async () => { + const client = + new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse() + ); + client.innerApiCalls.lookupRuntimeProjectAttachment = + stubSimpleCall(expectedResponse); + const [response] = await client.lookupRuntimeProjectAttachment(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.lookupRuntimeProjectAttachment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.lookupRuntimeProjectAttachment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes lookupRuntimeProjectAttachment without error using callback', async () => { + const client = + new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse() + ); + client.innerApiCalls.lookupRuntimeProjectAttachment = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.lookupRuntimeProjectAttachment( + request, + ( + err?: Error | null, + result?: protos.google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.lookupRuntimeProjectAttachment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.lookupRuntimeProjectAttachment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes lookupRuntimeProjectAttachment with error', async () => { + const client = + new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.lookupRuntimeProjectAttachment = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.lookupRuntimeProjectAttachment(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.lookupRuntimeProjectAttachment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.lookupRuntimeProjectAttachment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes lookupRuntimeProjectAttachment with closed client', async () => { + const client = + new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.lookupRuntimeProjectAttachment(request), + expectedError + ); + }); + }); + + describe('listRuntimeProjectAttachments', () => { + it('invokes listRuntimeProjectAttachments without error', async () => { + const client = + new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.apihub.v1.RuntimeProjectAttachment() + ), + generateSampleMessage( + new protos.google.cloud.apihub.v1.RuntimeProjectAttachment() + ), + generateSampleMessage( + new protos.google.cloud.apihub.v1.RuntimeProjectAttachment() + ), + ]; + client.innerApiCalls.listRuntimeProjectAttachments = + stubSimpleCall(expectedResponse); + const [response] = await client.listRuntimeProjectAttachments(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listRuntimeProjectAttachments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listRuntimeProjectAttachments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listRuntimeProjectAttachments without error using callback', async () => { + const client = + new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.apihub.v1.RuntimeProjectAttachment() + ), + generateSampleMessage( + new protos.google.cloud.apihub.v1.RuntimeProjectAttachment() + ), + generateSampleMessage( + new protos.google.cloud.apihub.v1.RuntimeProjectAttachment() + ), + ]; + client.innerApiCalls.listRuntimeProjectAttachments = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listRuntimeProjectAttachments( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.apihub.v1.IRuntimeProjectAttachment[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listRuntimeProjectAttachments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listRuntimeProjectAttachments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listRuntimeProjectAttachments with error', async () => { + const client = + new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listRuntimeProjectAttachments = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.listRuntimeProjectAttachments(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.listRuntimeProjectAttachments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listRuntimeProjectAttachments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listRuntimeProjectAttachmentsStream without error', async () => { + const client = + new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.apihub.v1.RuntimeProjectAttachment() + ), + generateSampleMessage( + new protos.google.cloud.apihub.v1.RuntimeProjectAttachment() + ), + generateSampleMessage( + new protos.google.cloud.apihub.v1.RuntimeProjectAttachment() + ), + ]; + client.descriptors.page.listRuntimeProjectAttachments.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listRuntimeProjectAttachmentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.apihub.v1.RuntimeProjectAttachment[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.apihub.v1.RuntimeProjectAttachment + ) => { + 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.listRuntimeProjectAttachments + .createStream as SinonStub + ) + .getCall(0) + .calledWith( + client.innerApiCalls.listRuntimeProjectAttachments, + request + ) + ); + assert( + ( + client.descriptors.page.listRuntimeProjectAttachments + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listRuntimeProjectAttachmentsStream with error', async () => { + const client = + new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listRuntimeProjectAttachments.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listRuntimeProjectAttachmentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.apihub.v1.RuntimeProjectAttachment[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.apihub.v1.RuntimeProjectAttachment + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + ( + client.descriptors.page.listRuntimeProjectAttachments + .createStream as SinonStub + ) + .getCall(0) + .calledWith( + client.innerApiCalls.listRuntimeProjectAttachments, + request + ) + ); + assert( + ( + client.descriptors.page.listRuntimeProjectAttachments + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listRuntimeProjectAttachments without error', async () => { + const client = + new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.apihub.v1.RuntimeProjectAttachment() + ), + generateSampleMessage( + new protos.google.cloud.apihub.v1.RuntimeProjectAttachment() + ), + generateSampleMessage( + new protos.google.cloud.apihub.v1.RuntimeProjectAttachment() + ), + ]; + client.descriptors.page.listRuntimeProjectAttachments.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.apihub.v1.IRuntimeProjectAttachment[] = + []; + const iterable = client.listRuntimeProjectAttachmentsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listRuntimeProjectAttachments + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listRuntimeProjectAttachments + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listRuntimeProjectAttachments with error', async () => { + const client = + new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listRuntimeProjectAttachments.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listRuntimeProjectAttachmentsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.apihub.v1.IRuntimeProjectAttachment[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listRuntimeProjectAttachments + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listRuntimeProjectAttachments + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = + new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient( + { + 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 runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient( + { + 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 runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient( + { + 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 runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient( + { + 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 runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient( + { + 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('Path templates', () => { + describe('api', () => { + const fakePath = '/rendered/path/api'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + api: 'apiValue', + }; + const client = + new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.apiPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.apiPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('apiPath', () => { + const result = client.apiPath( + 'projectValue', + 'locationValue', + 'apiValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.apiPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromApiName', () => { + const result = client.matchProjectFromApiName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.apiPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromApiName', () => { + const result = client.matchLocationFromApiName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.apiPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchApiFromApiName', () => { + const result = client.matchApiFromApiName(fakePath); + assert.strictEqual(result, 'apiValue'); + assert( + (client.pathTemplates.apiPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('apiHubInstance', () => { + const fakePath = '/rendered/path/apiHubInstance'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + api_hub_instance: 'apiHubInstanceValue', + }; + const client = + new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.apiHubInstancePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.apiHubInstancePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('apiHubInstancePath', () => { + const result = client.apiHubInstancePath( + 'projectValue', + 'locationValue', + 'apiHubInstanceValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.apiHubInstancePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromApiHubInstanceName', () => { + const result = client.matchProjectFromApiHubInstanceName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromApiHubInstanceName', () => { + const result = client.matchLocationFromApiHubInstanceName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchApiHubInstanceFromApiHubInstanceName', () => { + const result = + client.matchApiHubInstanceFromApiHubInstanceName(fakePath); + assert.strictEqual(result, 'apiHubInstanceValue'); + assert( + (client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('apiOperation', () => { + const fakePath = '/rendered/path/apiOperation'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + api: 'apiValue', + version: 'versionValue', + operation: 'operationValue', + }; + const client = + new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.apiOperationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.apiOperationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('apiOperationPath', () => { + const result = client.apiOperationPath( + 'projectValue', + 'locationValue', + 'apiValue', + 'versionValue', + 'operationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.apiOperationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromApiOperationName', () => { + const result = client.matchProjectFromApiOperationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromApiOperationName', () => { + const result = client.matchLocationFromApiOperationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchApiFromApiOperationName', () => { + const result = client.matchApiFromApiOperationName(fakePath); + assert.strictEqual(result, 'apiValue'); + assert( + (client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchVersionFromApiOperationName', () => { + const result = client.matchVersionFromApiOperationName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchOperationFromApiOperationName', () => { + const result = client.matchOperationFromApiOperationName(fakePath); + assert.strictEqual(result, 'operationValue'); + assert( + (client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('attribute', () => { + const fakePath = '/rendered/path/attribute'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + attribute: 'attributeValue', + }; + const client = + new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.attributePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.attributePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('attributePath', () => { + const result = client.attributePath( + 'projectValue', + 'locationValue', + 'attributeValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.attributePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromAttributeName', () => { + const result = client.matchProjectFromAttributeName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.attributePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromAttributeName', () => { + const result = client.matchLocationFromAttributeName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.attributePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAttributeFromAttributeName', () => { + const result = client.matchAttributeFromAttributeName(fakePath); + assert.strictEqual(result, 'attributeValue'); + assert( + (client.pathTemplates.attributePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('definition', () => { + const fakePath = '/rendered/path/definition'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + api: 'apiValue', + version: 'versionValue', + definition: 'definitionValue', + }; + const client = + new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.definitionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.definitionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('definitionPath', () => { + const result = client.definitionPath( + 'projectValue', + 'locationValue', + 'apiValue', + 'versionValue', + 'definitionValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.definitionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromDefinitionName', () => { + const result = client.matchProjectFromDefinitionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromDefinitionName', () => { + const result = client.matchLocationFromDefinitionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchApiFromDefinitionName', () => { + const result = client.matchApiFromDefinitionName(fakePath); + assert.strictEqual(result, 'apiValue'); + assert( + (client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchVersionFromDefinitionName', () => { + const result = client.matchVersionFromDefinitionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDefinitionFromDefinitionName', () => { + const result = client.matchDefinitionFromDefinitionName(fakePath); + assert.strictEqual(result, 'definitionValue'); + assert( + (client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('dependency', () => { + const fakePath = '/rendered/path/dependency'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + dependency: 'dependencyValue', + }; + const client = + new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.dependencyPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.dependencyPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('dependencyPath', () => { + const result = client.dependencyPath( + 'projectValue', + 'locationValue', + 'dependencyValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.dependencyPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromDependencyName', () => { + const result = client.matchProjectFromDependencyName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.dependencyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromDependencyName', () => { + const result = client.matchLocationFromDependencyName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.dependencyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDependencyFromDependencyName', () => { + const result = client.matchDependencyFromDependencyName(fakePath); + assert.strictEqual(result, 'dependencyValue'); + assert( + (client.pathTemplates.dependencyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('deployment', () => { + const fakePath = '/rendered/path/deployment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + deployment: 'deploymentValue', + }; + const client = + new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.deploymentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.deploymentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('deploymentPath', () => { + const result = client.deploymentPath( + 'projectValue', + 'locationValue', + 'deploymentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.deploymentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromDeploymentName', () => { + const result = client.matchProjectFromDeploymentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromDeploymentName', () => { + const result = client.matchLocationFromDeploymentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDeploymentFromDeploymentName', () => { + const result = client.matchDeploymentFromDeploymentName(fakePath); + assert.strictEqual(result, 'deploymentValue'); + assert( + (client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('externalApi', () => { + const fakePath = '/rendered/path/externalApi'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + external_api: 'externalApiValue', + }; + const client = + new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.externalApiPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.externalApiPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('externalApiPath', () => { + const result = client.externalApiPath( + 'projectValue', + 'locationValue', + 'externalApiValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.externalApiPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromExternalApiName', () => { + const result = client.matchProjectFromExternalApiName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.externalApiPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromExternalApiName', () => { + const result = client.matchLocationFromExternalApiName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.externalApiPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchExternalApiFromExternalApiName', () => { + const result = client.matchExternalApiFromExternalApiName(fakePath); + assert.strictEqual(result, 'externalApiValue'); + assert( + (client.pathTemplates.externalApiPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('hostProjectRegistration', () => { + const fakePath = '/rendered/path/hostProjectRegistration'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + host_project_registration: 'hostProjectRegistrationValue', + }; + const client = + new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.hostProjectRegistrationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.hostProjectRegistrationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('hostProjectRegistrationPath', () => { + const result = client.hostProjectRegistrationPath( + 'projectValue', + 'locationValue', + 'hostProjectRegistrationValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.hostProjectRegistrationPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromHostProjectRegistrationName', () => { + const result = + client.matchProjectFromHostProjectRegistrationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.hostProjectRegistrationPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromHostProjectRegistrationName', () => { + const result = + client.matchLocationFromHostProjectRegistrationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.hostProjectRegistrationPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchHostProjectRegistrationFromHostProjectRegistrationName', () => { + const result = + client.matchHostProjectRegistrationFromHostProjectRegistrationName( + fakePath + ); + assert.strictEqual(result, 'hostProjectRegistrationValue'); + assert( + ( + client.pathTemplates.hostProjectRegistrationPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('location', () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = + new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.locationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.locationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath('projectValue', 'locationValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('plugin', () => { + const fakePath = '/rendered/path/plugin'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + plugin: 'pluginValue', + }; + const client = + new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.pluginPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.pluginPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('pluginPath', () => { + const result = client.pluginPath( + 'projectValue', + 'locationValue', + 'pluginValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.pluginPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromPluginName', () => { + const result = client.matchProjectFromPluginName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.pluginPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromPluginName', () => { + const result = client.matchLocationFromPluginName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.pluginPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchPluginFromPluginName', () => { + const result = client.matchPluginFromPluginName(fakePath); + assert.strictEqual(result, 'pluginValue'); + assert( + (client.pathTemplates.pluginPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('project', () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = + new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.projectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('runtimeProjectAttachment', () => { + const fakePath = '/rendered/path/runtimeProjectAttachment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + runtime_project_attachment: 'runtimeProjectAttachmentValue', + }; + const client = + new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.runtimeProjectAttachmentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.runtimeProjectAttachmentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('runtimeProjectAttachmentPath', () => { + const result = client.runtimeProjectAttachmentPath( + 'projectValue', + 'locationValue', + 'runtimeProjectAttachmentValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.runtimeProjectAttachmentPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRuntimeProjectAttachmentName', () => { + const result = + client.matchProjectFromRuntimeProjectAttachmentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.runtimeProjectAttachmentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromRuntimeProjectAttachmentName', () => { + const result = + client.matchLocationFromRuntimeProjectAttachmentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.runtimeProjectAttachmentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName', () => { + const result = + client.matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName( + fakePath + ); + assert.strictEqual(result, 'runtimeProjectAttachmentValue'); + assert( + ( + client.pathTemplates.runtimeProjectAttachmentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('spec', () => { + const fakePath = '/rendered/path/spec'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + api: 'apiValue', + version: 'versionValue', + spec: 'specValue', + }; + const client = + new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.specPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.specPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('specPath', () => { + const result = client.specPath( + 'projectValue', + 'locationValue', + 'apiValue', + 'versionValue', + 'specValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.specPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromSpecName', () => { + const result = client.matchProjectFromSpecName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromSpecName', () => { + const result = client.matchLocationFromSpecName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchApiFromSpecName', () => { + const result = client.matchApiFromSpecName(fakePath); + assert.strictEqual(result, 'apiValue'); + assert( + (client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchVersionFromSpecName', () => { + const result = client.matchVersionFromSpecName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSpecFromSpecName', () => { + const result = client.matchSpecFromSpecName(fakePath); + assert.strictEqual(result, 'specValue'); + assert( + (client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('styleGuide', () => { + const fakePath = '/rendered/path/styleGuide'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + plugin: 'pluginValue', + }; + const client = + new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.styleGuidePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.styleGuidePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('styleGuidePath', () => { + const result = client.styleGuidePath( + 'projectValue', + 'locationValue', + 'pluginValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.styleGuidePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromStyleGuideName', () => { + const result = client.matchProjectFromStyleGuideName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.styleGuidePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromStyleGuideName', () => { + const result = client.matchLocationFromStyleGuideName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.styleGuidePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchPluginFromStyleGuideName', () => { + const result = client.matchPluginFromStyleGuideName(fakePath); + assert.strictEqual(result, 'pluginValue'); + assert( + (client.pathTemplates.styleGuidePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('version', () => { + const fakePath = '/rendered/path/version'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + api: 'apiValue', + version: 'versionValue', + }; + const client = + new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.versionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.versionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('versionPath', () => { + const result = client.versionPath( + 'projectValue', + 'locationValue', + 'apiValue', + 'versionValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.versionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromVersionName', () => { + const result = client.matchProjectFromVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromVersionName', () => { + const result = client.matchLocationFromVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchApiFromVersionName', () => { + const result = client.matchApiFromVersionName(fakePath); + assert.strictEqual(result, 'apiValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchVersionFromVersionName', () => { + const result = client.matchVersionFromVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-apihub/v1/tsconfig.json b/packages/google-cloud-apihub/tsconfig.json similarity index 100% rename from owl-bot-staging/google-cloud-apihub/v1/tsconfig.json rename to packages/google-cloud-apihub/tsconfig.json diff --git a/owl-bot-staging/google-cloud-apihub/v1/webpack.config.js b/packages/google-cloud-apihub/webpack.config.js similarity index 89% rename from owl-bot-staging/google-cloud-apihub/v1/webpack.config.js rename to packages/google-cloud-apihub/webpack.config.js index 6b83a6f3e3f..cd2f9a00f55 100644 --- a/owl-bot-staging/google-cloud-apihub/v1/webpack.config.js +++ b/packages/google-cloud-apihub/webpack.config.js @@ -36,27 +36,27 @@ module.exports = { { test: /\.tsx?$/, use: 'ts-loader', - exclude: /node_modules/ + exclude: /node_modules/, }, { test: /node_modules[\\/]@grpc[\\/]grpc-js/, - use: 'null-loader' + use: 'null-loader', }, { test: /node_modules[\\/]grpc/, - use: 'null-loader' + use: 'null-loader', }, { test: /node_modules[\\/]retry-request/, - use: 'null-loader' + use: 'null-loader', }, { test: /node_modules[\\/]https?-proxy-agent/, - use: 'null-loader' + use: 'null-loader', }, { test: /node_modules[\\/]gtoken/, - use: 'null-loader' + use: 'null-loader', }, ], }, diff --git a/release-please-config.json b/release-please-config.json index 0f54013bc9b..6620216f2c6 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -189,7 +189,8 @@ "packages/google-cloud-privilegedaccessmanager": {}, "packages/google-shopping-merchant-products": {}, "packages/google-shopping-merchant-accounts": {}, - "packages/google-cloud-gdchardwaremanagement": {} + "packages/google-cloud-gdchardwaremanagement": {}, + "packages/google-cloud-apihub": {} }, "plugins": [ { From d69e2e2f7c7cabf6f43f3531e5b08f8e20438a15 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Thu, 15 Aug 2024 21:29:15 +0000 Subject: [PATCH 05/11] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20?= =?UTF-8?q?post-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- packages/google-cloud-apihub/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-apihub/README.md b/packages/google-cloud-apihub/README.md index 03e179643c0..37fc57a5575 100644 --- a/packages/google-cloud-apihub/README.md +++ b/packages/google-cloud-apihub/README.md @@ -78,7 +78,7 @@ npm install @google-cloud/apihub * * `display_name` - The display name of the Deployment. Allowed * comparison operators: `=`. * * `create_time` - The time at which the Deployment was created. The - * value should be in the (RFC3339)https://tools.ietf.org/html/rfc3339 + * value should be in the (RFC3339)https://tools.ietf.org/html/rfc3339 * format. Allowed comparison operators: `>` and `<`. * * `resource_uri` - A URI to the deployment resource. Allowed * comparison operators: `=`. @@ -153,7 +153,7 @@ async function callListDeployments() { // Run request const iterable = apihubClient.listDeploymentsAsync(request); for await (const response of iterable) { - console.log(response); + console.log(response); } } From 4436ab9588710ca67c9b66fd8b2e74b1166c9306 Mon Sep 17 00:00:00 2001 From: sofisl <55454395+sofisl@users.noreply.github.com> Date: Thu, 15 Aug 2024 14:47:22 -0700 Subject: [PATCH 06/11] Update quickstart.js --- packages/google-cloud-apihub/samples/test/quickstart.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-apihub/samples/test/quickstart.js b/packages/google-cloud-apihub/samples/test/quickstart.js index 7633db2256c..897da26988a 100644 --- a/packages/google-cloud-apihub/samples/test/quickstart.js +++ b/packages/google-cloud-apihub/samples/test/quickstart.js @@ -18,9 +18,8 @@ const assert = require('assert'); const path = require('path'); const cp = require('child_process'); const {describe, it, before} = require('mocha'); -const {RuntimeProjectAttachmentServiceClient} = - require('@google-cloud/apihub').v1; -const apihubClient = new RuntimeProjectAttachmentServiceClient(); +const {ApiHubClient} = require('@google-cloud/apihub').v1; +const apihubClient = new ApiHubClient(); const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); From 45e0dea7198a892958bef6d6a4d338e9dc56caee Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Wed, 4 Sep 2024 21:34:45 +0000 Subject: [PATCH 07/11] Owl Bot copied code from https://github.com/googleapis/googleapis-gen/commit/1a53efd4034f12bd453c36f1f3b9dbaf01695cf5 --- .../google-cloud-apihub/v1/.eslintignore | 7 + .../google-cloud-apihub/v1/.eslintrc.json | 3 + .../google-cloud-apihub/v1/.gitignore | 14 + .../google-cloud-apihub/v1/.jsdoc.js | 55 + .../google-cloud-apihub/v1/.mocharc.js | 33 + .../google-cloud-apihub/v1/.prettierrc.js | 22 + .../google-cloud-apihub/v1/README.md | 1 + .../google-cloud-apihub/v1/package.json | 64 + .../cloud/apihub/v1/apihub_service.proto | 1836 + .../cloud/apihub/v1/common_fields.proto | 1297 + .../host_project_registration_service.proto | 207 + .../cloud/apihub/v1/linting_service.proto | 159 + .../cloud/apihub/v1/plugin_service.proto | 148 + .../apihub/v1/provisioning_service.proto | 136 + .../runtime_project_attachment_service.proto | 261 + .../google-cloud-apihub/v1/protos/protos.d.ts | 21434 +++++++ .../google-cloud-apihub/v1/protos/protos.js | 53441 ++++++++++++++++ .../google-cloud-apihub/v1/protos/protos.json | 6321 ++ .../generated/v1/api_hub.create_api.js | 77 + .../generated/v1/api_hub.create_attribute.js | 78 + .../generated/v1/api_hub.create_deployment.js | 78 + .../v1/api_hub.create_external_api.js | 79 + .../generated/v1/api_hub.create_spec.js | 79 + .../generated/v1/api_hub.create_version.js | 77 + .../generated/v1/api_hub.delete_api.js | 67 + .../generated/v1/api_hub.delete_attribute.js | 63 + .../generated/v1/api_hub.delete_deployment.js | 62 + .../v1/api_hub.delete_external_api.js | 63 + .../generated/v1/api_hub.delete_spec.js | 63 + .../generated/v1/api_hub.delete_version.js | 68 + .../samples/generated/v1/api_hub.get_api.js | 62 + .../generated/v1/api_hub.get_api_operation.js | 63 + .../generated/v1/api_hub.get_attribute.js | 63 + .../generated/v1/api_hub.get_definition.js | 63 + .../generated/v1/api_hub.get_deployment.js | 62 + .../generated/v1/api_hub.get_external_api.js | 63 + .../samples/generated/v1/api_hub.get_spec.js | 63 + .../generated/v1/api_hub.get_spec_contents.js | 63 + .../generated/v1/api_hub.get_version.js | 63 + .../v1/api_hub.list_api_operations.js | 117 + .../samples/generated/v1/api_hub.list_apis.js | 146 + .../generated/v1/api_hub.list_attributes.js | 118 + .../generated/v1/api_hub.list_deployments.js | 133 + .../v1/api_hub.list_external_apis.js | 78 + .../generated/v1/api_hub.list_specs.js | 127 + .../generated/v1/api_hub.list_versions.js | 134 + .../generated/v1/api_hub.search_resources.js | 108 + .../generated/v1/api_hub.update_api.js | 69 + .../generated/v1/api_hub.update_attribute.js | 69 + .../generated/v1/api_hub.update_deployment.js | 69 + .../v1/api_hub.update_external_api.js | 69 + .../generated/v1/api_hub.update_spec.js | 69 + .../generated/v1/api_hub.update_version.js | 69 + .../api_hub_dependencies.create_dependency.js | 77 + .../api_hub_dependencies.delete_dependency.js | 62 + .../v1/api_hub_dependencies.get_dependency.js | 62 + .../api_hub_dependencies.list_dependencies.js | 110 + .../api_hub_dependencies.update_dependency.js | 68 + .../v1/api_hub_plugin.disable_plugin.js | 62 + .../v1/api_hub_plugin.enable_plugin.js | 62 + .../generated/v1/api_hub_plugin.get_plugin.js | 62 + ...ervice.create_host_project_registration.js | 75 + ...n_service.get_host_project_registration.js | 62 + ...service.list_host_project_registrations.js | 100 + .../v1/linting_service.get_style_guide.js | 63 + ...inting_service.get_style_guide_contents.js | 64 + .../generated/v1/linting_service.lint_spec.js | 63 + .../v1/linting_service.update_style_guide.js | 65 + .../provisioning.create_api_hub_instance.js | 76 + .../v1/provisioning.get_api_hub_instance.js | 63 + .../provisioning.lookup_api_hub_instance.js | 64 + ...rvice.create_runtime_project_attachment.js | 75 + ...rvice.delete_runtime_project_attachment.js | 63 + ..._service.get_runtime_project_attachment.js | 63 + ...ervice.list_runtime_project_attachments.js | 100 + ...rvice.lookup_runtime_project_attachment.js | 63 + ...ippet_metadata_google.cloud.apihub.v1.json | 2595 + .../google-cloud-apihub/v1/src/index.ts | 37 + .../v1/src/v1/api_hub_client.ts | 6157 ++ .../v1/src/v1/api_hub_client_config.json | 213 + .../v1/src/v1/api_hub_dependencies_client.ts | 1933 + .../api_hub_dependencies_client_config.json | 63 + .../v1/api_hub_dependencies_proto_list.json | 9 + .../v1/src/v1/api_hub_plugin_client.ts | 1469 + .../src/v1/api_hub_plugin_client_config.json | 53 + .../v1/src/v1/api_hub_plugin_proto_list.json | 9 + .../v1/src/v1/api_hub_proto_list.json | 9 + .../v1/src/v1/gapic_metadata.json | 731 + ...ost_project_registration_service_client.ts | 1738 + ...ct_registration_service_client_config.json | 53 + ...oject_registration_service_proto_list.json | 9 + .../google-cloud-apihub/v1/src/v1/index.ts | 25 + .../v1/src/v1/linting_service_client.ts | 1545 + .../src/v1/linting_service_client_config.json | 58 + .../v1/src/v1/linting_service_proto_list.json | 9 + .../v1/src/v1/provisioning_client.ts | 1767 + .../v1/src/v1/provisioning_client_config.json | 53 + .../v1/src/v1/provisioning_proto_list.json | 9 + ...ntime_project_attachment_service_client.ts | 1881 + ...ject_attachment_service_client_config.json | 63 + ...project_attachment_service_proto_list.json | 9 + .../system-test/fixtures/sample/src/index.js | 33 + .../system-test/fixtures/sample/src/index.ts | 68 + .../v1/system-test/install.ts | 49 + .../v1/test/gapic_api_hub_dependencies_v1.ts | 1890 + .../v1/test/gapic_api_hub_plugin_v1.ts | 1438 + .../v1/test/gapic_api_hub_v1.ts | 6109 ++ ...ic_host_project_registration_service_v1.ts | 1670 + .../v1/test/gapic_linting_service_v1.ts | 1550 + .../v1/test/gapic_provisioning_v1.ts | 1823 + ...c_runtime_project_attachment_service_v1.ts | 1886 + .../google-cloud-apihub/v1/tsconfig.json | 19 + .../google-cloud-apihub/v1/webpack.config.js | 64 + 113 files changed, 126953 insertions(+) create mode 100644 owl-bot-staging/google-cloud-apihub/v1/.eslintignore create mode 100644 owl-bot-staging/google-cloud-apihub/v1/.eslintrc.json create mode 100644 owl-bot-staging/google-cloud-apihub/v1/.gitignore create mode 100644 owl-bot-staging/google-cloud-apihub/v1/.jsdoc.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/.mocharc.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/.prettierrc.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/README.md create mode 100644 owl-bot-staging/google-cloud-apihub/v1/package.json create mode 100644 owl-bot-staging/google-cloud-apihub/v1/protos/google/cloud/apihub/v1/apihub_service.proto create mode 100644 owl-bot-staging/google-cloud-apihub/v1/protos/google/cloud/apihub/v1/common_fields.proto create mode 100644 owl-bot-staging/google-cloud-apihub/v1/protos/google/cloud/apihub/v1/host_project_registration_service.proto create mode 100644 owl-bot-staging/google-cloud-apihub/v1/protos/google/cloud/apihub/v1/linting_service.proto create mode 100644 owl-bot-staging/google-cloud-apihub/v1/protos/google/cloud/apihub/v1/plugin_service.proto create mode 100644 owl-bot-staging/google-cloud-apihub/v1/protos/google/cloud/apihub/v1/provisioning_service.proto create mode 100644 owl-bot-staging/google-cloud-apihub/v1/protos/google/cloud/apihub/v1/runtime_project_attachment_service.proto create mode 100644 owl-bot-staging/google-cloud-apihub/v1/protos/protos.d.ts create mode 100644 owl-bot-staging/google-cloud-apihub/v1/protos/protos.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/protos/protos.json create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.create_api.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.create_attribute.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.create_deployment.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.create_external_api.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.create_spec.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.create_version.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.delete_api.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.delete_attribute.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.delete_deployment.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.delete_external_api.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.delete_spec.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.delete_version.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_api.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_api_operation.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_attribute.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_definition.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_deployment.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_external_api.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_spec.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_spec_contents.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_version.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.list_api_operations.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.list_apis.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.list_attributes.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.list_deployments.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.list_external_apis.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.list_specs.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.list_versions.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.search_resources.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.update_api.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.update_attribute.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.update_deployment.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.update_external_api.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.update_spec.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.update_version.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_dependencies.create_dependency.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_dependencies.delete_dependency.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_dependencies.get_dependency.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_dependencies.list_dependencies.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_dependencies.update_dependency.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_plugin.disable_plugin.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_plugin.enable_plugin.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_plugin.get_plugin.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/host_project_registration_service.create_host_project_registration.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/host_project_registration_service.get_host_project_registration.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/host_project_registration_service.list_host_project_registrations.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/linting_service.get_style_guide.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/linting_service.get_style_guide_contents.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/linting_service.lint_spec.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/linting_service.update_style_guide.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/provisioning.create_api_hub_instance.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/provisioning.get_api_hub_instance.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/provisioning.lookup_api_hub_instance.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/runtime_project_attachment_service.create_runtime_project_attachment.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/runtime_project_attachment_service.delete_runtime_project_attachment.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/runtime_project_attachment_service.get_runtime_project_attachment.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/runtime_project_attachment_service.list_runtime_project_attachments.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/runtime_project_attachment_service.lookup_runtime_project_attachment.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/snippet_metadata_google.cloud.apihub.v1.json create mode 100644 owl-bot-staging/google-cloud-apihub/v1/src/index.ts create mode 100644 owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_client.ts create mode 100644 owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_client_config.json create mode 100644 owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_dependencies_client.ts create mode 100644 owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_dependencies_client_config.json create mode 100644 owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_dependencies_proto_list.json create mode 100644 owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_plugin_client.ts create mode 100644 owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_plugin_client_config.json create mode 100644 owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_plugin_proto_list.json create mode 100644 owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_proto_list.json create mode 100644 owl-bot-staging/google-cloud-apihub/v1/src/v1/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-apihub/v1/src/v1/host_project_registration_service_client.ts create mode 100644 owl-bot-staging/google-cloud-apihub/v1/src/v1/host_project_registration_service_client_config.json create mode 100644 owl-bot-staging/google-cloud-apihub/v1/src/v1/host_project_registration_service_proto_list.json create mode 100644 owl-bot-staging/google-cloud-apihub/v1/src/v1/index.ts create mode 100644 owl-bot-staging/google-cloud-apihub/v1/src/v1/linting_service_client.ts create mode 100644 owl-bot-staging/google-cloud-apihub/v1/src/v1/linting_service_client_config.json create mode 100644 owl-bot-staging/google-cloud-apihub/v1/src/v1/linting_service_proto_list.json create mode 100644 owl-bot-staging/google-cloud-apihub/v1/src/v1/provisioning_client.ts create mode 100644 owl-bot-staging/google-cloud-apihub/v1/src/v1/provisioning_client_config.json create mode 100644 owl-bot-staging/google-cloud-apihub/v1/src/v1/provisioning_proto_list.json create mode 100644 owl-bot-staging/google-cloud-apihub/v1/src/v1/runtime_project_attachment_service_client.ts create mode 100644 owl-bot-staging/google-cloud-apihub/v1/src/v1/runtime_project_attachment_service_client_config.json create mode 100644 owl-bot-staging/google-cloud-apihub/v1/src/v1/runtime_project_attachment_service_proto_list.json create mode 100644 owl-bot-staging/google-cloud-apihub/v1/system-test/fixtures/sample/src/index.js create mode 100644 owl-bot-staging/google-cloud-apihub/v1/system-test/fixtures/sample/src/index.ts create mode 100644 owl-bot-staging/google-cloud-apihub/v1/system-test/install.ts create mode 100644 owl-bot-staging/google-cloud-apihub/v1/test/gapic_api_hub_dependencies_v1.ts create mode 100644 owl-bot-staging/google-cloud-apihub/v1/test/gapic_api_hub_plugin_v1.ts create mode 100644 owl-bot-staging/google-cloud-apihub/v1/test/gapic_api_hub_v1.ts create mode 100644 owl-bot-staging/google-cloud-apihub/v1/test/gapic_host_project_registration_service_v1.ts create mode 100644 owl-bot-staging/google-cloud-apihub/v1/test/gapic_linting_service_v1.ts create mode 100644 owl-bot-staging/google-cloud-apihub/v1/test/gapic_provisioning_v1.ts create mode 100644 owl-bot-staging/google-cloud-apihub/v1/test/gapic_runtime_project_attachment_service_v1.ts create mode 100644 owl-bot-staging/google-cloud-apihub/v1/tsconfig.json create mode 100644 owl-bot-staging/google-cloud-apihub/v1/webpack.config.js diff --git a/owl-bot-staging/google-cloud-apihub/v1/.eslintignore b/owl-bot-staging/google-cloud-apihub/v1/.eslintignore new file mode 100644 index 00000000000..cfc348ec4d1 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/.coverage +build/ +docs/ +protos/ +system-test/ +samples/generated/ diff --git a/owl-bot-staging/google-cloud-apihub/v1/.eslintrc.json b/owl-bot-staging/google-cloud-apihub/v1/.eslintrc.json new file mode 100644 index 00000000000..78215349546 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/owl-bot-staging/google-cloud-apihub/v1/.gitignore b/owl-bot-staging/google-cloud-apihub/v1/.gitignore new file mode 100644 index 00000000000..d4f03a0df2e --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/.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/owl-bot-staging/google-cloud-apihub/v1/.jsdoc.js b/owl-bot-staging/google-cloud-apihub/v1/.jsdoc.js new file mode 100644 index 00000000000..267f9e6b16e --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/.jsdoc.js @@ -0,0 +1,55 @@ +// Copyright 2024 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 2024 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: '@google-cloud/apihub', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/owl-bot-staging/google-cloud-apihub/v1/.mocharc.js b/owl-bot-staging/google-cloud-apihub/v1/.mocharc.js new file mode 100644 index 00000000000..13b67c34edc --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/.mocharc.js @@ -0,0 +1,33 @@ +// Copyright 2024 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. ** + +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000 +} +if (process.env.MOCHA_THROW_DEPRECATION === 'false') { + delete config['throw-deprecation']; +} +if (process.env.MOCHA_REPORTER) { + config.reporter = process.env.MOCHA_REPORTER; +} +if (process.env.MOCHA_REPORTER_OUTPUT) { + config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; +} +module.exports = config diff --git a/owl-bot-staging/google-cloud-apihub/v1/.prettierrc.js b/owl-bot-staging/google-cloud-apihub/v1/.prettierrc.js new file mode 100644 index 00000000000..9a8fd690982 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/.prettierrc.js @@ -0,0 +1,22 @@ +// Copyright 2024 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. ** + + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/owl-bot-staging/google-cloud-apihub/v1/README.md b/owl-bot-staging/google-cloud-apihub/v1/README.md new file mode 100644 index 00000000000..dc4fd3e19f6 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/README.md @@ -0,0 +1 @@ +Apihub: Nodejs Client diff --git a/owl-bot-staging/google-cloud-apihub/v1/package.json b/owl-bot-staging/google-cloud-apihub/v1/package.json new file mode 100644 index 00000000000..92b7f5f827b --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/package.json @@ -0,0 +1,64 @@ +{ + "name": "@google-cloud/apihub", + "version": "0.1.0", + "description": "Apihub client for Node.js", + "repository": "googleapis/nodejs-apihub", + "license": "Apache-2.0", + "author": "Google LLC", + "main": "build/src/index.js", + "files": [ + "build/src", + "build/protos" + ], + "keywords": [ + "google apis client", + "google api client", + "google apis", + "google api", + "google", + "google cloud platform", + "google cloud", + "cloud", + "google apihub", + "apihub", + "api hub", + "api hub dependencies", + "api hub plugin", + "host project registration service", + "linting service", + "provisioning", + "runtime project attachment service" + ], + "scripts": { + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/ && minifyProtoJson", + "compile-protos": "compileProtos src", + "docs": "jsdoc -c .jsdoc.js", + "fix": "gts fix", + "lint": "gts check", + "prepare": "npm run compile-protos && npm run compile", + "system-test": "c8 mocha build/system-test", + "test": "c8 mocha build/test" + }, + "dependencies": { + "google-gax": "^4.3.4" + }, + "devDependencies": { + "@types/mocha": "^10.0.6", + "@types/node": "^20.12.12", + "@types/sinon": "^10.0.20", + "c8": "^9.1.0", + "gapic-tools": "^0.4.2", + "gts": "5.3.0", + "jsdoc": "^4.0.3", + "jsdoc-fresh": "^3.0.0", + "jsdoc-region-tag": "^3.0.0", + "mocha": "^10.4.0", + "pack-n-play": "^2.0.3", + "sinon": "^15.2.0", + "typescript": "5.1.6" + }, + "engines": { + "node": ">=v14" + } +} diff --git a/owl-bot-staging/google-cloud-apihub/v1/protos/google/cloud/apihub/v1/apihub_service.proto b/owl-bot-staging/google-cloud-apihub/v1/protos/google/cloud/apihub/v1/apihub_service.proto new file mode 100644 index 00000000000..bbc89cae32d --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/protos/google/cloud/apihub/v1/apihub_service.proto @@ -0,0 +1,1836 @@ +// Copyright 2024 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.apihub.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/apihub/v1/common_fields.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Cloud.ApiHub.V1"; +option go_package = "cloud.google.com/go/apihub/apiv1/apihubpb;apihubpb"; +option java_multiple_files = true; +option java_outer_classname = "ApiHubServiceProto"; +option java_package = "com.google.cloud.apihub.v1"; +option php_namespace = "Google\\Cloud\\ApiHub\\V1"; +option ruby_package = "Google::Cloud::ApiHub::V1"; + +// This service provides all methods related to the API hub. +service ApiHub { + option (google.api.default_host) = "apihub.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Create an API resource in the API hub. + // Once an API resource is created, versions can be added to it. + rpc CreateApi(CreateApiRequest) returns (Api) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/apis" + body: "api" + }; + option (google.api.method_signature) = "parent,api,api_id"; + } + + // Get API resource details including the API versions contained in it. + rpc GetApi(GetApiRequest) returns (Api) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/apis/*}" + }; + option (google.api.method_signature) = "name"; + } + + // List API resources in the API hub. + rpc ListApis(ListApisRequest) returns (ListApisResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/apis" + }; + option (google.api.method_signature) = "parent"; + } + + // Update an API resource in the API hub. The following fields in the + // [API][] can be updated: + // + // * [display_name][google.cloud.apihub.v1.Api.display_name] + // * [description][google.cloud.apihub.v1.Api.description] + // * [owner][google.cloud.apihub.v1.Api.owner] + // * [documentation][google.cloud.apihub.v1.Api.documentation] + // * [target_user][google.cloud.apihub.v1.Api.target_user] + // * [team][google.cloud.apihub.v1.Api.team] + // * [business_unit][google.cloud.apihub.v1.Api.business_unit] + // * [maturity_level][google.cloud.apihub.v1.Api.maturity_level] + // * [attributes][google.cloud.apihub.v1.Api.attributes] + // + // The + // [update_mask][google.cloud.apihub.v1.UpdateApiRequest.update_mask] + // should be used to specify the fields being updated. + // + // Updating the owner field requires complete owner message + // and updates both owner and email fields. + rpc UpdateApi(UpdateApiRequest) returns (Api) { + option (google.api.http) = { + patch: "/v1/{api.name=projects/*/locations/*/apis/*}" + body: "api" + }; + option (google.api.method_signature) = "api,update_mask"; + } + + // Delete an API resource in the API hub. API can only be deleted if all + // underlying versions are deleted. + rpc DeleteApi(DeleteApiRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/apis/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Create an API version for an API resource in the API hub. + rpc CreateVersion(CreateVersionRequest) returns (Version) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/apis/*}/versions" + body: "version" + }; + option (google.api.method_signature) = "parent,version,version_id"; + } + + // Get details about the API version of an API resource. This will include + // information about the specs and operations present in the API + // version as well as the deployments linked to it. + rpc GetVersion(GetVersionRequest) returns (Version) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/apis/*/versions/*}" + }; + option (google.api.method_signature) = "name"; + } + + // List API versions of an API resource in the API hub. + rpc ListVersions(ListVersionsRequest) returns (ListVersionsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/apis/*}/versions" + }; + option (google.api.method_signature) = "parent"; + } + + // Update API version. The following fields in the + // [version][google.cloud.apihub.v1.Version] can be updated currently: + // + // * [display_name][google.cloud.apihub.v1.Version.display_name] + // * [description][google.cloud.apihub.v1.Version.description] + // * [documentation][google.cloud.apihub.v1.Version.documentation] + // * [deployments][google.cloud.apihub.v1.Version.deployments] + // * [lifecycle][google.cloud.apihub.v1.Version.lifecycle] + // * [compliance][google.cloud.apihub.v1.Version.compliance] + // * [accreditation][google.cloud.apihub.v1.Version.accreditation] + // * [attributes][google.cloud.apihub.v1.Version.attributes] + // + // The + // [update_mask][google.cloud.apihub.v1.UpdateVersionRequest.update_mask] + // should be used to specify the fields being updated. + rpc UpdateVersion(UpdateVersionRequest) returns (Version) { + option (google.api.http) = { + patch: "/v1/{version.name=projects/*/locations/*/apis/*/versions/*}" + body: "version" + }; + option (google.api.method_signature) = "version,update_mask"; + } + + // Delete an API version. Version can only be deleted if all underlying specs, + // operations, definitions and linked deployments are deleted. + rpc DeleteVersion(DeleteVersionRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/apis/*/versions/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Add a spec to an API version in the API hub. + // Multiple specs can be added to an API version. + // Note, while adding a spec, at least one of `contents` or `source_uri` must + // be provided. If `contents` is provided, then `spec_type` must also be + // provided. + // + // On adding a spec with contents to the version, the operations present in it + // will be added to the version.Note that the file contents in the spec should + // be of the same type as defined in the + // `projects/{project}/locations/{location}/attributes/system-spec-type` + // attribute associated with spec resource. Note that specs of various types + // can be uploaded, however parsing of details is supported for OpenAPI spec + // currently. + // + // In order to access the information parsed from the spec, use the + // [GetSpec][google.cloud.apihub.v1.ApiHub.GetSpec] method. + // In order to access the raw contents for a particular spec, use the + // [GetSpecContents][google.cloud.apihub.v1.ApiHub.GetSpecContents] method. + // In order to access the operations parsed from the spec, use the + // [ListAPIOperations][google.cloud.apihub.v1.ApiHub.ListApiOperations] + // method. + rpc CreateSpec(CreateSpecRequest) returns (Spec) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/apis/*/versions/*}/specs" + body: "spec" + }; + option (google.api.method_signature) = "parent,spec,spec_id"; + } + + // Get details about the information parsed from a spec. + // Note that this method does not return the raw spec contents. + // Use [GetSpecContents][google.cloud.apihub.v1.ApiHub.GetSpecContents] method + // to retrieve the same. + rpc GetSpec(GetSpecRequest) returns (Spec) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Get spec contents. + rpc GetSpecContents(GetSpecContentsRequest) returns (SpecContents) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*}:contents" + }; + option (google.api.method_signature) = "name"; + } + + // List specs corresponding to a particular API resource. + rpc ListSpecs(ListSpecsRequest) returns (ListSpecsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/apis/*/versions/*}/specs" + }; + option (google.api.method_signature) = "parent"; + } + + // Update spec. The following fields in the + // [spec][google.cloud.apihub.v1.Spec] can be updated: + // + // * [display_name][google.cloud.apihub.v1.Spec.display_name] + // * [source_uri][google.cloud.apihub.v1.Spec.source_uri] + // * [lint_response][google.cloud.apihub.v1.Spec.lint_response] + // * [attributes][google.cloud.apihub.v1.Spec.attributes] + // * [contents][google.cloud.apihub.v1.Spec.contents] + // * [spec_type][google.cloud.apihub.v1.Spec.spec_type] + // + // In case of an OAS spec, updating spec contents can lead to: + // 1. Creation, deletion and update of operations. + // 2. Creation, deletion and update of definitions. + // 3. Update of other info parsed out from the new spec. + // + // In case of contents or source_uri being present in update mask, spec_type + // must also be present. Also, spec_type can not be present in update mask if + // contents or source_uri is not present. + // + // The + // [update_mask][google.cloud.apihub.v1.UpdateSpecRequest.update_mask] + // should be used to specify the fields being updated. + rpc UpdateSpec(UpdateSpecRequest) returns (Spec) { + option (google.api.http) = { + patch: "/v1/{spec.name=projects/*/locations/*/apis/*/versions/*/specs/*}" + body: "spec" + }; + option (google.api.method_signature) = "spec,update_mask"; + } + + // Delete a spec. + // Deleting a spec will also delete the associated operations from the + // version. + rpc DeleteSpec(DeleteSpecRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Get details about a particular operation in API version. + rpc GetApiOperation(GetApiOperationRequest) returns (ApiOperation) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/apis/*/versions/*/operations/*}" + }; + option (google.api.method_signature) = "name"; + } + + // List operations in an API version. + rpc ListApiOperations(ListApiOperationsRequest) + returns (ListApiOperationsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/apis/*/versions/*}/operations" + }; + option (google.api.method_signature) = "parent"; + } + + // Get details about a definition in an API version. + rpc GetDefinition(GetDefinitionRequest) returns (Definition) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/apis/*/versions/*/definitions/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Create a deployment resource in the API hub. + // Once a deployment resource is created, it can be associated with API + // versions. + rpc CreateDeployment(CreateDeploymentRequest) returns (Deployment) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/deployments" + body: "deployment" + }; + option (google.api.method_signature) = "parent,deployment,deployment_id"; + } + + // Get details about a deployment and the API versions linked to it. + rpc GetDeployment(GetDeploymentRequest) returns (Deployment) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/deployments/*}" + }; + option (google.api.method_signature) = "name"; + } + + // List deployment resources in the API hub. + rpc ListDeployments(ListDeploymentsRequest) + returns (ListDeploymentsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/deployments" + }; + option (google.api.method_signature) = "parent"; + } + + // Update a deployment resource in the API hub. The following fields in the + // [deployment resource][google.cloud.apihub.v1.Deployment] can be + // updated: + // + // * [display_name][google.cloud.apihub.v1.Deployment.display_name] + // * [description][google.cloud.apihub.v1.Deployment.description] + // * [documentation][google.cloud.apihub.v1.Deployment.documentation] + // * [deployment_type][google.cloud.apihub.v1.Deployment.deployment_type] + // * [resource_uri][google.cloud.apihub.v1.Deployment.resource_uri] + // * [endpoints][google.cloud.apihub.v1.Deployment.endpoints] + // * [slo][google.cloud.apihub.v1.Deployment.slo] + // * [environment][google.cloud.apihub.v1.Deployment.environment] + // * [attributes][google.cloud.apihub.v1.Deployment.attributes] + // + // The + // [update_mask][google.cloud.apihub.v1.UpdateDeploymentRequest.update_mask] + // should be used to specify the fields being updated. + rpc UpdateDeployment(UpdateDeploymentRequest) returns (Deployment) { + option (google.api.http) = { + patch: "/v1/{deployment.name=projects/*/locations/*/deployments/*}" + body: "deployment" + }; + option (google.api.method_signature) = "deployment,update_mask"; + } + + // Delete a deployment resource in the API hub. + rpc DeleteDeployment(DeleteDeploymentRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/deployments/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Create a user defined attribute. + // + // Certain pre defined attributes are already created by the API hub. These + // attributes will have type as `SYSTEM_DEFINED` and can be listed via + // [ListAttributes][google.cloud.apihub.v1.ApiHub.ListAttributes] method. + // Allowed values for the same can be updated via + // [UpdateAttribute][google.cloud.apihub.v1.ApiHub.UpdateAttribute] method. + rpc CreateAttribute(CreateAttributeRequest) returns (Attribute) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/attributes" + body: "attribute" + }; + option (google.api.method_signature) = "parent,attribute,attribute_id"; + } + + // Get details about the attribute. + rpc GetAttribute(GetAttributeRequest) returns (Attribute) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/attributes/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Update the attribute. The following fields in the + // [Attribute resource][google.cloud.apihub.v1.Attribute] can be updated: + // + // * [display_name][google.cloud.apihub.v1.Attribute.display_name] + // The display name can be updated for user defined attributes only. + // * [description][google.cloud.apihub.v1.Attribute.description] + // The description can be updated for user defined attributes only. + // * [allowed_values][google.cloud.apihub.v1.Attribute.allowed_values] + // To update the list of allowed values, clients need to use the fetched list + // of allowed values and add or remove values to or from the same list. + // The mutable allowed values can be updated for both user defined and System + // defined attributes. The immutable allowed values cannot be updated or + // deleted. The updated list of allowed values cannot be empty. If an allowed + // value that is already used by some resource's attribute is deleted, then + // the association between the resource and the attribute value will also be + // deleted. + // * [cardinality][google.cloud.apihub.v1.Attribute.cardinality] + // The cardinality can be updated for user defined attributes only. + // Cardinality can only be increased during an update. + // + // The + // [update_mask][google.cloud.apihub.v1.UpdateAttributeRequest.update_mask] + // should be used to specify the fields being updated. + rpc UpdateAttribute(UpdateAttributeRequest) returns (Attribute) { + option (google.api.http) = { + patch: "/v1/{attribute.name=projects/*/locations/*/attributes/*}" + body: "attribute" + }; + option (google.api.method_signature) = "attribute,update_mask"; + } + + // Delete an attribute. + // + // Note: System defined attributes cannot be deleted. All + // associations of the attribute being deleted with any API hub resource will + // also get deleted. + rpc DeleteAttribute(DeleteAttributeRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/attributes/*}" + }; + option (google.api.method_signature) = "name"; + } + + // List all attributes. + rpc ListAttributes(ListAttributesRequest) returns (ListAttributesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/attributes" + }; + option (google.api.method_signature) = "parent"; + } + + // Search across API-Hub resources. + rpc SearchResources(SearchResourcesRequest) + returns (SearchResourcesResponse) { + option (google.api.http) = { + post: "/v1/{location=projects/*/locations/*}:searchResources" + body: "*" + }; + option (google.api.method_signature) = "location,query"; + } + + // Create an External API resource in the API hub. + rpc CreateExternalApi(CreateExternalApiRequest) returns (ExternalApi) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/externalApis" + body: "external_api" + }; + option (google.api.method_signature) = + "parent,external_api,external_api_id"; + } + + // Get details about an External API resource in the API hub. + rpc GetExternalApi(GetExternalApiRequest) returns (ExternalApi) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/externalApis/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Update an External API resource in the API hub. The following fields can be + // updated: + // + // * [display_name][google.cloud.apihub.v1.ExternalApi.display_name] + // * [description][google.cloud.apihub.v1.ExternalApi.description] + // * [documentation][google.cloud.apihub.v1.ExternalApi.documentation] + // * [endpoints][google.cloud.apihub.v1.ExternalApi.endpoints] + // * [paths][google.cloud.apihub.v1.ExternalApi.paths] + // + // The + // [update_mask][google.cloud.apihub.v1.UpdateExternalApiRequest.update_mask] + // should be used to specify the fields being updated. + rpc UpdateExternalApi(UpdateExternalApiRequest) returns (ExternalApi) { + option (google.api.http) = { + patch: "/v1/{external_api.name=projects/*/locations/*/externalApis/*}" + body: "external_api" + }; + option (google.api.method_signature) = "external_api,update_mask"; + } + + // Delete an External API resource in the API hub. + rpc DeleteExternalApi(DeleteExternalApiRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/externalApis/*}" + }; + option (google.api.method_signature) = "name"; + } + + // List External API resources in the API hub. + rpc ListExternalApis(ListExternalApisRequest) + returns (ListExternalApisResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/externalApis" + }; + option (google.api.method_signature) = "parent"; + } +} + +// This service provides methods for various operations related to a +// [Dependency][google.cloud.apihub.v1.Dependency] in the API hub. +service ApiHubDependencies { + option (google.api.default_host) = "apihub.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Create a dependency between two entities in the API hub. + rpc CreateDependency(CreateDependencyRequest) returns (Dependency) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/dependencies" + body: "dependency" + }; + option (google.api.method_signature) = "parent,dependency,dependency_id"; + } + + // Get details about a dependency resource in the API hub. + rpc GetDependency(GetDependencyRequest) returns (Dependency) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/dependencies/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Update a dependency based on the + // [update_mask][google.cloud.apihub.v1.UpdateDependencyRequest.update_mask] + // provided in the request. + // + // The following fields in the [dependency][google.cloud.apihub.v1.Dependency] + // can be updated: + // * [description][google.cloud.apihub.v1.Dependency.description] + rpc UpdateDependency(UpdateDependencyRequest) returns (Dependency) { + option (google.api.http) = { + patch: "/v1/{dependency.name=projects/*/locations/*/dependencies/*}" + body: "dependency" + }; + option (google.api.method_signature) = "dependency,update_mask"; + } + + // Delete the dependency resource. + rpc DeleteDependency(DeleteDependencyRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/dependencies/*}" + }; + option (google.api.method_signature) = "name"; + } + + // List dependencies based on the provided filter and pagination parameters. + rpc ListDependencies(ListDependenciesRequest) + returns (ListDependenciesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/dependencies" + }; + option (google.api.method_signature) = "parent"; + } +} + +// The [CreateApi][google.cloud.apihub.v1.ApiHub.CreateApi] method's request. +message CreateApiRequest { + // Required. The parent resource for the API resource. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "apihub.googleapis.com/Api" + } + ]; + + // Optional. The ID to use for the API resource, which will become the final + // component of the API's resource name. This field is optional. + // + // * If provided, the same will be used. The service will throw an error if + // the specified id is already used by another API resource in the API hub. + // * If not provided, a system generated id will be used. + // + // This value should be 4-500 characters, and valid characters + // are /[a-z][A-Z][0-9]-_/. + string api_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The API resource to create. + Api api = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// The [GetApi][google.cloud.apihub.v1.ApiHub.GetApi] method's request. +message GetApiRequest { + // Required. The name of the API resource to retrieve. + // Format: `projects/{project}/locations/{location}/apis/{api}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "apihub.googleapis.com/Api" } + ]; +} + +// The [UpdateApi][google.cloud.apihub.v1.ApiHub.UpdateApi] method's request. +message UpdateApiRequest { + // Required. The API resource to update. + // + // The API resource's `name` field is used to identify the API resource to + // update. + // Format: `projects/{project}/locations/{location}/apis/{api}` + Api api = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The list of fields to update. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// The [DeleteApi][google.cloud.apihub.v1.ApiHub.DeleteApi] method's request. +message DeleteApiRequest { + // Required. The name of the API resource to delete. + // Format: `projects/{project}/locations/{location}/apis/{api}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "apihub.googleapis.com/Api" } + ]; + + // Optional. If set to true, any versions from this API will also be deleted. + // Otherwise, the request will only work if the API has no versions. + bool force = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// The [ListApis][google.cloud.apihub.v1.ApiHub.ListApis] method's request. +message ListApisRequest { + // Required. The parent, which owns this collection of API resources. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "apihub.googleapis.com/Api" + } + ]; + + // Optional. An expression that filters the list of ApiResources. + // + // A filter expression consists of a field name, a comparison + // operator, and a value for filtering. The value must be a string. The + // comparison operator must be one of: `<`, `>`, `:` or `=`. Filters are not + // case sensitive. + // + // The following fields in the `ApiResource` are eligible for filtering: + // + // * `owner.email` - The email of the team which owns the ApiResource. + // Allowed comparison operators: `=`. + // * `create_time` - The time at which the ApiResource was created. The + // value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] + // format. Allowed comparison operators: `>` and `<`. + // * `display_name` - The display name of the ApiResource. Allowed + // comparison operators: `=`. + // * `target_user.enum_values.values.id` - The allowed value id of the + // target users attribute associated with the ApiResource. Allowed + // comparison operator is `:`. + // * `target_user.enum_values.values.display_name` - The allowed value + // display name of the target users attribute associated with the + // ApiResource. Allowed comparison operator is `:`. + // * `team.enum_values.values.id` - The allowed value id of the team + // attribute associated with the ApiResource. Allowed comparison operator is + // `:`. + // * `team.enum_values.values.display_name` - The allowed value display name + // of the team attribute associated with the ApiResource. Allowed comparison + // operator is `:`. + // * `business_unit.enum_values.values.id` - The allowed value id of the + // business unit attribute associated with the ApiResource. Allowed + // comparison operator is `:`. + // * `business_unit.enum_values.values.display_name` - The allowed value + // display name of the business unit attribute associated with the + // ApiResource. Allowed comparison operator is `:`. + // * `maturity_level.enum_values.values.id` - The allowed value id of the + // maturity level attribute associated with the ApiResource. Allowed + // comparison operator is `:`. + // * `maturity_level.enum_values.values.display_name` - The allowed value + // display name of the maturity level attribute associated with the + // ApiResource. Allowed comparison operator is `:`. + // * `api_style.enum_values.values.id` - The allowed value id of the + // api style attribute associated with the ApiResource. Allowed + // comparison operator is `:`. + // * `api_style.enum_values.values.display_name` - The allowed value display + // name of the api style attribute associated with the ApiResource. Allowed + // comparison operator is `:`. + // + // Expressions are combined with either `AND` logic operator or `OR` logical + // operator but not both of them together i.e. only one of the `AND` or `OR` + // operator can be used throughout the filter string and both the operators + // cannot be used together. No other logical operators are supported. At most + // three filter fields are allowed in the filter string and if provided + // more than that then `INVALID_ARGUMENT` error is returned by the API. + // + // Here are a few examples: + // + // * `owner.email = \"apihub@google.com\"` - - The owner team email is + // _apihub@google.com_. + // * `owner.email = \"apihub@google.com\" AND create_time < + // \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - + // The owner team email is _apihub@google.com_ and the api was created + // before _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_. + // * `owner.email = \"apihub@google.com\" OR team.enum_values.values.id: + // apihub-team-id` - The filter string specifies the APIs where the owner + // team email is _apihub@google.com_ or the id of the allowed value + // associated with the team attribute is _apihub-team-id_. + // * `owner.email = \"apihub@google.com\" OR + // team.enum_values.values.display_name: ApiHub Team` - The filter string + // specifies the APIs where the owner team email is _apihub@google.com_ or + // the display name of the allowed value associated with the team attribute + // is `ApiHub Team`. + string filter = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The maximum number of API resources to return. The service may + // return fewer than this value. If unspecified, at most 50 Apis will be + // returned. The maximum value is 1000; values above 1000 will be coerced to + // 1000. + int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous `ListApis` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters (except page_size) provided to + // `ListApis` must match the call that provided the page token. + string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// The [ListApis][google.cloud.apihub.v1.ApiHub.ListApis] method's response. +message ListApisResponse { + // The API resources present in the API hub. + repeated Api apis = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// The [CreateVersion][google.cloud.apihub.v1.ApiHub.CreateVersion] method's +// request. +message CreateVersionRequest { + // Required. The parent resource for API version. + // Format: `projects/{project}/locations/{location}/apis/{api}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "apihub.googleapis.com/Api" } + ]; + + // Optional. The ID to use for the API version, which will become the final + // component of the version's resource name. This field is optional. + // + // * If provided, the same will be used. The service will throw an error if + // the specified id is already used by another version in the API resource. + // * If not provided, a system generated id will be used. + // + // This value should be 4-500 characters, and valid characters + // are /[a-z][A-Z][0-9]-_/. + string version_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The version to create. + Version version = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// The [GetVersion][google.cloud.apihub.v1.ApiHub.GetVersion] method's request. +message GetVersionRequest { + // Required. The name of the API version to retrieve. + // Format: + // `projects/{project}/locations/{location}/apis/{api}/versions/{version}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "apihub.googleapis.com/Version" } + ]; +} + +// The [UpdateVersion][google.cloud.apihub.v1.ApiHub.UpdateVersion] method's +// request. +message UpdateVersionRequest { + // Required. The API version to update. + // + // The version's `name` field is used to identify the API version to update. + // Format: + // `projects/{project}/locations/{location}/apis/{api}/versions/{version}` + Version version = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The list of fields to update. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// The [DeleteVersion][google.cloud.apihub.v1.ApiHub.DeleteVersion] method's +// request. +message DeleteVersionRequest { + // Required. The name of the version to delete. + // Format: + // `projects/{project}/locations/{location}/apis/{api}/versions/{version}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "apihub.googleapis.com/Version" } + ]; + + // Optional. If set to true, any specs from this version will also be deleted. + // Otherwise, the request will only work if the version has no specs. + bool force = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// The [ListVersions][google.cloud.apihub.v1.ApiHub.ListVersions] method's +// request. +message ListVersionsRequest { + // Required. The parent which owns this collection of API versions i.e., the + // API resource Format: `projects/{project}/locations/{location}/apis/{api}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "apihub.googleapis.com/Version" + } + ]; + + // Optional. An expression that filters the list of Versions. + // + // A filter expression consists of a field name, a comparison + // operator, and a value for filtering. The value must be a string, a + // number, or a boolean. The comparison operator must be one of: `<`, `>` or + // `=`. Filters are not case sensitive. + // + // The following fields in the `Version` are eligible for filtering: + // + // * `display_name` - The display name of the Version. Allowed + // comparison operators: `=`. + // * `create_time` - The time at which the Version was created. The + // value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] + // format. Allowed comparison operators: `>` and `<`. + // * `lifecycle.enum_values.values.id` - The allowed value id of the + // lifecycle attribute associated with the Version. Allowed comparison + // operators: `:`. + // * `lifecycle.enum_values.values.display_name` - The allowed value display + // name of the lifecycle attribute associated with the Version. Allowed + // comparison operators: `:`. + // * `compliance.enum_values.values.id` - The allowed value id of the + // compliances attribute associated with the Version. Allowed comparison + // operators: `:`. + // * `compliance.enum_values.values.display_name` - The allowed value + // display name of the compliances attribute associated with the Version. + // Allowed comparison operators: `:`. + // * `accreditation.enum_values.values.id` - The allowed value id of the + // accreditations attribute associated with the Version. Allowed + // comparison operators: `:`. + // * `accreditation.enum_values.values.display_name` - The allowed value + // display name of the accreditations attribute associated with the Version. + // Allowed comparison operators: `:`. + // + // Expressions are combined with either `AND` logic operator or `OR` logical + // operator but not both of them together i.e. only one of the `AND` or `OR` + // operator can be used throughout the filter string and both the operators + // cannot be used together. No other logical operators are + // supported. At most three filter fields are allowed in the filter + // string and if provided more than that then `INVALID_ARGUMENT` error is + // returned by the API. + // + // Here are a few examples: + // + // * `lifecycle.enum_values.values.id: preview-id` - The filter string + // specifies that the id of the allowed value associated with the lifecycle + // attribute of the Version is _preview-id_. + // * `lifecycle.enum_values.values.display_name: \"Preview Display Name\"` - + // The filter string specifies that the display name of the allowed value + // associated with the lifecycle attribute of the Version is `Preview + // Display Name`. + // * `lifecycle.enum_values.values.id: preview-id AND create_time < + // \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - + // The id of the allowed value associated with the lifecycle attribute of + // the Version is _preview-id_ and it was created before _2021-08-15 + // 14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_. + // * `compliance.enum_values.values.id: gdpr-id OR + // compliance.enum_values.values.id: pci-dss-id` + // - The id of the allowed value associated with the compliance attribute is + // _gdpr-id_ or _pci-dss-id_. + string filter = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The maximum number of versions to return. The service may return + // fewer than this value. If unspecified, at most 50 versions will be + // returned. The maximum value is 1000; values above 1000 will be coerced to + // 1000. + int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous `ListVersions` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters (except page_size) provided to + // `ListVersions` must match the call that provided the page token. + string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// The [ListVersions][google.cloud.apihub.v1.ApiHub.ListVersions] method's +// response. +message ListVersionsResponse { + // The versions corresponding to an API. + repeated Version versions = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// The [CreateSpec][google.cloud.apihub.v1.ApiHub.CreateSpec] method's request. +message CreateSpecRequest { + // Required. The parent resource for Spec. + // Format: + // `projects/{project}/locations/{location}/apis/{api}/versions/{version}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "apihub.googleapis.com/Version" } + ]; + + // Optional. The ID to use for the spec, which will become the final component + // of the spec's resource name. This field is optional. + // + // * If provided, the same will be used. The service will throw an error if + // the specified id is already used by another spec in the API + // resource. + // * If not provided, a system generated id will be used. + // + // This value should be 4-500 characters, and valid characters + // are /[a-z][A-Z][0-9]-_/. + string spec_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The spec to create. + Spec spec = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// The [GetSpec][google.cloud.apihub.v1.ApiHub.GetSpec] method's request. +message GetSpecRequest { + // Required. The name of the spec to retrieve. + // Format: + // `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "apihub.googleapis.com/Spec" } + ]; +} + +// The [UpdateSpec][google.cloud.apihub.v1.ApiHub.UpdateSpec] method's request. +message UpdateSpecRequest { + // Required. The spec to update. + // + // The spec's `name` field is used to identify the spec to + // update. Format: + // `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}` + Spec spec = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The list of fields to update. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// The [DeleteSpec][google.cloud.apihub.v1.ApiHub.DeleteSpec] method's request. +message DeleteSpecRequest { + // Required. The name of the spec to delete. + // Format: + // `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "apihub.googleapis.com/Spec" } + ]; +} + +// The [ListSpecs][ListSpecs] method's request. +message ListSpecsRequest { + // Required. The parent, which owns this collection of specs. + // Format: + // `projects/{project}/locations/{location}/apis/{api}/versions/{version}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "apihub.googleapis.com/Spec" + } + ]; + + // Optional. An expression that filters the list of Specs. + // + // A filter expression consists of a field name, a comparison + // operator, and a value for filtering. The value must be a string. The + // comparison operator must be one of: `<`, `>`, `:` or `=`. Filters are not + // case sensitive. + // + // The following fields in the `Spec` are eligible for filtering: + // + // * `display_name` - The display name of the Spec. Allowed comparison + // operators: `=`. + // * `create_time` - The time at which the Spec was created. The + // value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] + // format. Allowed comparison operators: `>` and `<`. + // * `spec_type.enum_values.values.id` - The allowed value id of the + // spec_type attribute associated with the Spec. Allowed comparison + // operators: `:`. + // * `spec_type.enum_values.values.display_name` - The allowed value display + // name of the spec_type attribute associated with the Spec. Allowed + // comparison operators: `:`. + // * `lint_response.json_values.values` - The json value of the + // lint_response attribute associated with the Spec. Allowed comparison + // operators: `:`. + // * `mime_type` - The MIME type of the Spec. Allowed comparison + // operators: `=`. + // + // Expressions are combined with either `AND` logic operator or `OR` logical + // operator but not both of them together i.e. only one of the `AND` or `OR` + // operator can be used throughout the filter string and both the operators + // cannot be used together. No other logical operators are + // supported. At most three filter fields are allowed in the filter + // string and if provided more than that then `INVALID_ARGUMENT` error is + // returned by the API. + // + // Here are a few examples: + // + // * `spec_type.enum_values.values.id: rest-id` - The filter + // string specifies that the id of the allowed value associated with the + // spec_type attribute is _rest-id_. + // * `spec_type.enum_values.values.display_name: \"Rest Display Name\"` - + // The filter string specifies that the display name of the allowed value + // associated with the spec_type attribute is `Rest Display Name`. + // * `spec_type.enum_values.values.id: grpc-id AND create_time < + // \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - + // The id of the allowed value associated with the spec_type attribute is + // _grpc-id_ and the spec was created before _2021-08-15 14:50:00 UTC_ and + // after _2021-08-10 12:00:00 UTC_. + // * `spec_type.enum_values.values.id: rest-id OR + // spec_type.enum_values.values.id: grpc-id` + // - The id of the allowed value associated with the spec_type attribute is + // _rest-id_ or _grpc-id_. + string filter = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The maximum number of specs to return. The service may return + // fewer than this value. If unspecified, at most 50 specs will be + // returned. The maximum value is 1000; values above 1000 will be coerced to + // 1000. + int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous `ListSpecs` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListSpecs` must + // match the call that provided the page token. + string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// The [ListSpecs][google.cloud.apihub.v1.ApiHub.ListSpecs] method's response. +message ListSpecsResponse { + // The specs corresponding to an API. + repeated Spec specs = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// The [GetSpecContents][google.cloud.apihub.v1.ApiHub.GetSpecContents] method's +// request. +message GetSpecContentsRequest { + // Required. The name of the spec whose contents need to be retrieved. + // Format: + // `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "apihub.googleapis.com/Spec" } + ]; +} + +// The [GetApiOperation][google.cloud.apihub.v1.ApiHub.GetApiOperation] method's +// request. +message GetApiOperationRequest { + // Required. The name of the operation to retrieve. + // Format: + // `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "apihub.googleapis.com/ApiOperation" + } + ]; +} + +// The [ListApiOperations][google.cloud.apihub.v1.ApiHub.ListApiOperations] +// method's request. +message ListApiOperationsRequest { + // Required. The parent which owns this collection of operations i.e., the API + // version. Format: + // `projects/{project}/locations/{location}/apis/{api}/versions/{version}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "apihub.googleapis.com/ApiOperation" + } + ]; + + // Optional. An expression that filters the list of ApiOperations. + // + // A filter expression consists of a field name, a comparison + // operator, and a value for filtering. The value must be a string or a + // boolean. The comparison operator must be one of: `<`, `>` or + // `=`. Filters are not case sensitive. + // + // The following fields in the `ApiOperation` are eligible for filtering: + // * `name` - The ApiOperation resource name. Allowed comparison + // operators: + // `=`. + // * `details.http_operation.path.path` - The http operation's complete path + // relative to server endpoint. Allowed comparison operators: `=`. + // * `details.http_operation.method` - The http operation method type. + // Allowed comparison operators: `=`. + // * `details.deprecated` - Indicates if the ApiOperation is deprecated. + // Allowed values are True / False indicating the deprycation status of the + // ApiOperation. Allowed comparison operators: `=`. + // * `create_time` - The time at which the ApiOperation was created. The + // value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] + // format. Allowed comparison operators: `>` and `<`. + // + // Expressions are combined with either `AND` logic operator or `OR` logical + // operator but not both of them together i.e. only one of the `AND` or `OR` + // operator can be used throughout the filter string and both the operators + // cannot be used together. No other logical operators are supported. At most + // three filter fields are allowed in the filter string and if provided + // more than that then `INVALID_ARGUMENT` error is returned by the API. + // + // Here are a few examples: + // + // * `details.deprecated = True` - The ApiOperation is deprecated. + // * `details.http_operation.method = GET AND create_time < + // \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - + // The method of the http operation of the ApiOperation is _GET_ and the + // spec was created before _2021-08-15 14:50:00 UTC_ and after _2021-08-10 + // 12:00:00 UTC_. + // * `details.http_operation.method = GET OR details.http_operation.method = + // POST`. - The http operation of the method of ApiOperation is _GET_ or + // _POST_. + string filter = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The maximum number of operations to return. The service may + // return fewer than this value. If unspecified, at most 50 operations will be + // returned. The maximum value is 1000; values above 1000 will be coerced to + // 1000. + int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous `ListApiOperations` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters (except page_size) provided to + // `ListApiOperations` must match the call that provided the page token. + string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// The [ListApiOperations][google.cloud.apihub.v1.ApiHub.ListApiOperations] +// method's response. +message ListApiOperationsResponse { + // The operations corresponding to an API version. + // Only following field will be populated in the response: name, + // spec, details.deprecated, details.http_operation.path.path, + // details.http_operation.method and details.documentation.external_uri. + repeated ApiOperation api_operations = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// The [GetDefinition][google.cloud.apihub.v1.ApiHub.GetDefinition] method's +// request. +message GetDefinitionRequest { + // Required. The name of the definition to retrieve. + // Format: + // `projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "apihub.googleapis.com/Definition" + } + ]; +} + +// The [CreateDeployment][google.cloud.apihub.v1.ApiHub.CreateDeployment] +// method's request. +message CreateDeploymentRequest { + // Required. The parent resource for the deployment resource. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "apihub.googleapis.com/Deployment" + } + ]; + + // Optional. The ID to use for the deployment resource, which will become the + // final component of the deployment's resource name. This field is optional. + // + // * If provided, the same will be used. The service will throw an error if + // the specified id is already used by another deployment resource in the API + // hub. + // * If not provided, a system generated id will be used. + // + // This value should be 4-500 characters, and valid characters + // are /[a-z][A-Z][0-9]-_/. + string deployment_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The deployment resource to create. + Deployment deployment = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// The [GetDeployment][google.cloud.apihub.v1.ApiHub.GetDeployment] method's +// request. +message GetDeploymentRequest { + // Required. The name of the deployment resource to retrieve. + // Format: `projects/{project}/locations/{location}/deployments/{deployment}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "apihub.googleapis.com/Deployment" + } + ]; +} + +// The [UpdateDeployment][google.cloud.apihub.v1.ApiHub.UpdateDeployment] +// method's request. +message UpdateDeploymentRequest { + // Required. The deployment resource to update. + // + // The deployment resource's `name` field is used to identify the deployment + // resource to update. + // Format: `projects/{project}/locations/{location}/deployments/{deployment}` + Deployment deployment = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The list of fields to update. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// The [DeleteDeployment][google.cloud.apihub.v1.ApiHub.DeleteDeployment] +// method's request. +message DeleteDeploymentRequest { + // Required. The name of the deployment resource to delete. + // Format: `projects/{project}/locations/{location}/deployments/{deployment}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "apihub.googleapis.com/Deployment" + } + ]; +} + +// The [ListDeployments][google.cloud.apihub.v1.ApiHub.ListDeployments] method's +// request. +message ListDeploymentsRequest { + // Required. The parent, which owns this collection of deployment resources. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "apihub.googleapis.com/Deployment" + } + ]; + + // Optional. An expression that filters the list of Deployments. + // + // A filter expression consists of a field name, a comparison + // operator, and a value for filtering. The value must be a string. The + // comparison operator must be one of: `<`, `>` or + // `=`. Filters are not case sensitive. + // + // The following fields in the `Deployments` are eligible for filtering: + // + // * `display_name` - The display name of the Deployment. Allowed + // comparison operators: `=`. + // * `create_time` - The time at which the Deployment was created. The + // value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] + // format. Allowed comparison operators: `>` and `<`. + // * `resource_uri` - A URI to the deployment resource. Allowed + // comparison operators: `=`. + // * `api_versions` - The API versions linked to this deployment. Allowed + // comparison operators: `:`. + // * `deployment_type.enum_values.values.id` - The allowed value id of the + // deployment_type attribute associated with the Deployment. Allowed + // comparison operators: `:`. + // * `deployment_type.enum_values.values.display_name` - The allowed value + // display name of the deployment_type attribute associated with the + // Deployment. Allowed comparison operators: `:`. + // * `slo.string_values.values` -The allowed string value of the slo + // attribute associated with the deployment. Allowed comparison + // operators: `:`. + // * `environment.enum_values.values.id` - The allowed value id of the + // environment attribute associated with the deployment. Allowed + // comparison operators: `:`. + // * `environment.enum_values.values.display_name` - The allowed value + // display name of the environment attribute associated with the deployment. + // Allowed comparison operators: `:`. + // + // Expressions are combined with either `AND` logic operator or `OR` logical + // operator but not both of them together i.e. only one of the `AND` or `OR` + // operator can be used throughout the filter string and both the operators + // cannot be used together. No other logical operators are supported. At most + // three filter fields are allowed in the filter string and if provided + // more than that then `INVALID_ARGUMENT` error is returned by the API. + // + // Here are a few examples: + // + // * `environment.enum_values.values.id: staging-id` - The allowed value id + // of the environment attribute associated with the Deployment is + // _staging-id_. + // * `environment.enum_values.values.display_name: \"Staging Deployment\"` - + // The allowed value display name of the environment attribute associated + // with the Deployment is `Staging Deployment`. + // * `environment.enum_values.values.id: production-id AND create_time < + // \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - + // The allowed value id of the environment attribute associated with the + // Deployment is _production-id_ and Deployment was created before + // _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_. + // * `environment.enum_values.values.id: production-id OR + // slo.string_values.values: \"99.99%\"` + // - The allowed value id of the environment attribute Deployment is + // _production-id_ or string value of the slo attribute is _99.99%_. + string filter = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The maximum number of deployment resources to return. The service + // may return fewer than this value. If unspecified, at most 50 deployments + // will be returned. The maximum value is 1000; values above 1000 will be + // coerced to 1000. + int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous `ListDeployments` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters (except page_size) provided to + // `ListDeployments` must match the call that provided the page token. + string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// The [ListDeployments][google.cloud.apihub.v1.ApiHub.ListDeployments] method's +// response. +message ListDeploymentsResponse { + // The deployment resources present in the API hub. + repeated Deployment deployments = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// The [CreateAttribute][google.cloud.apihub.v1.ApiHub.CreateAttribute] method's +// request. +message CreateAttributeRequest { + // Required. The parent resource for Attribute. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "apihub.googleapis.com/Attribute" + } + ]; + + // Optional. The ID to use for the attribute, which will become the final + // component of the attribute's resource name. This field is optional. + // + // * If provided, the same will be used. The service will throw an error if + // the specified id is already used by another attribute resource in the API + // hub. + // * If not provided, a system generated id will be used. + // + // This value should be 4-500 characters, and valid characters + // are /[a-z][A-Z][0-9]-_/. + string attribute_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The attribute to create. + Attribute attribute = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// The [GetAttribute][google.cloud.apihub.v1.ApiHub.GetAttribute] method's +// request. +message GetAttributeRequest { + // Required. The name of the attribute to retrieve. + // Format: + // `projects/{project}/locations/{location}/attributes/{attribute}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "apihub.googleapis.com/Attribute" + } + ]; +} + +// The [UpdateAttribute][google.cloud.apihub.v1.ApiHub.UpdateAttribute] method's +// request. +message UpdateAttributeRequest { + // Required. The attribute to update. + // + // The attribute's `name` field is used to identify the attribute to update. + // Format: + // `projects/{project}/locations/{location}/attributes/{attribute}` + Attribute attribute = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The list of fields to update. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// The [DeleteAttribute][google.cloud.apihub.v1.ApiHub.DeleteAttribute] method's +// request. +message DeleteAttributeRequest { + // Required. The name of the attribute to delete. + // Format: + // `projects/{project}/locations/{location}/attributes/{attribute}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "apihub.googleapis.com/Attribute" + } + ]; +} + +// The [ListAttributes][google.cloud.apihub.v1.ApiHub.ListAttributes] method's +// request. +message ListAttributesRequest { + // Required. The parent resource for Attribute. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "apihub.googleapis.com/Attribute" + } + ]; + + // Optional. An expression that filters the list of Attributes. + // + // A filter expression consists of a field name, a comparison + // operator, and a value for filtering. The value must be a string or a + // boolean. The comparison operator must be one of: `<`, `>` or + // `=`. Filters are not case sensitive. + // + // The following fields in the `Attribute` are eligible for filtering: + // + // * `display_name` - The display name of the Attribute. Allowed + // comparison operators: `=`. + // * `definition_type` - The definition type of the attribute. Allowed + // comparison operators: `=`. + // * `scope` - The scope of the attribute. Allowed comparison operators: + // `=`. + // * `data_type` - The type of the data of the attribute. Allowed + // comparison operators: `=`. + // * `mandatory` - Denotes whether the attribute is mandatory or not. + // Allowed comparison operators: `=`. + // * `create_time` - The time at which the Attribute was created. The + // value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] + // format. Allowed comparison operators: `>` and `<`. + // + // Expressions are combined with either `AND` logic operator or `OR` logical + // operator but not both of them together i.e. only one of the `AND` or `OR` + // operator can be used throughout the filter string and both the operators + // cannot be used together. No other logical operators are + // supported. At most three filter fields are allowed in the filter + // string and if provided more than that then `INVALID_ARGUMENT` error is + // returned by the API. + // + // Here are a few examples: + // + // * `display_name = production` - - The display name of the attribute is + // _production_. + // * `(display_name = production) AND (create_time < + // \"2021-08-15T14:50:00Z\") AND (create_time > \"2021-08-10T12:00:00Z\")` - + // The display name of the attribute is _production_ and the attribute was + // created before _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00 + // UTC_. + // * `display_name = production OR scope = api` - + // The attribute where the display name is _production_ or the scope is + // _api_. + string filter = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The maximum number of attribute resources to return. The service + // may return fewer than this value. If unspecified, at most 50 attributes + // will be returned. The maximum value is 1000; values above 1000 will be + // coerced to 1000. + int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous `ListAttributes` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListAttributes` must + // match the call that provided the page token. + string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// The [ListAttributes][google.cloud.apihub.v1.ApiHub.ListAttributes] method's +// response. +message ListAttributesResponse { + // The list of all attributes. + repeated Attribute attributes = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// The [SearchResources][google.cloud.apihub.v1.ApiHub.SearchResources] method's +// request. +message SearchResourcesRequest { + // Required. The resource name of the location which will be of the type + // `projects/{project_id}/locations/{location_id}`. This field is used to + // identify the instance of API-Hub in which resources should be searched. + string location = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. The free text search query. This query can contain keywords which + // could be related to any detail of the API-Hub resources such display names, + // descriptions, attributes etc. + string query = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An expression that filters the list of search results. + // + // A filter expression consists of a field name, a comparison operator, + // and a value for filtering. The value must be a string, a number, or a + // boolean. The comparison operator must be `=`. Filters are not case + // sensitive. + // + // The following field names are eligible for filtering: + // * `resource_type` - The type of resource in the search results. + // Must be one of the following: `Api`, `ApiOperation`, `Deployment`, + // `Definition`, `Spec` or `Version`. This field can only be specified once + // in the filter. + // + // Here are is an example: + // + // * `resource_type = Api` - The resource_type is _Api_. + string filter = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The maximum number of search results to return. The service may + // return fewer than this value. If unspecified at most 10 search results will + // be returned. If value is negative then `INVALID_ARGUMENT` error is + // returned. The maximum value is 25; values above 25 will be coerced to 25. + // While paginating, you can specify a new page size parameter for each page + // of search results to be listed. + int32 page_size = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous + // [SearchResources][SearchResources] + // call. Specify this parameter to retrieve the next page of transactions. + // + // When paginating, you must specify the `page_token` parameter and all the + // other parameters except + // [page_size][google.cloud.apihub.v1.SearchResourcesRequest.page_size] + // should be specified with the same value which was used in the previous + // call. If the other fields are set with a different value than the previous + // call then `INVALID_ARGUMENT` error is returned. + string page_token = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// ApiHubResource is one of the resources such as Api, Operation, Deployment, +// Definition, Spec and Version resources stored in API-Hub. +message ApiHubResource { + oneof resource { + // This represents Api resource in search results. Only name, display_name, + // description and owner fields are populated in search results. + Api api = 1; + + // This represents ApiOperation resource in search results. Only name, + // and description fields are populated in search results. + ApiOperation operation = 2; + + // This represents Deployment resource in search results. Only name, + // display_name and description fields are populated in search results. + Deployment deployment = 3; + + // This represents Spec resource in search results. Only name, + // display_name and description fields are populated in search results. + Spec spec = 4; + + // This represents Definition resource in search results. + // Only name field is populated in search results. + Definition definition = 5; + + // This represents Version resource in search results. Only name, + // display_name and description fields are populated in search results. + Version version = 6; + } +} + +// Represents the search results. +message SearchResult { + // This represents the ApiHubResource. + // Note: Only selected fields of the resources are populated in response. + ApiHubResource resource = 1; +} + +// Response for the +// [SearchResources][google.cloud.apihub.v1.ApiHub.SearchResources] method. +message SearchResourcesResponse { + // List of search results according to the filter and search query specified. + // The order of search results represents the ranking. + repeated SearchResult search_results = 1; + + // Pass this token in the + // [SearchResourcesRequest][google.cloud.apihub.v1.SearchResourcesRequest] + // to continue to list results. If all results have been returned, this field + // is an empty string or not present in the response. + string next_page_token = 2; +} + +// The +// [CreateDependency][google.cloud.apihub.v1.ApiHubDependencies.CreateDependency] +// method's request. +message CreateDependencyRequest { + // Required. The parent resource for the dependency resource. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "apihub.googleapis.com/Dependency" + } + ]; + + // Optional. The ID to use for the dependency resource, which will become the + // final component of the dependency's resource name. This field is optional. + // * If provided, the same will be used. The service will throw an error if + // duplicate id is provided by the client. + // * If not provided, a system generated id will be used. + // + // This value should be 4-500 characters, and valid characters + // are `[a-z][A-Z][0-9]-_`. + string dependency_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The dependency resource to create. + Dependency dependency = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// The [GetDependency][.ApiHubDependencies.GetDependency] +// method's request. +message GetDependencyRequest { + // Required. The name of the dependency resource to retrieve. + // Format: `projects/{project}/locations/{location}/dependencies/{dependency}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "apihub.googleapis.com/Dependency" + } + ]; +} + +// The +// [UpdateDependency][google.cloud.apihub.v1.ApiHubDependencies.UpdateDependency] +// method's request. +message UpdateDependencyRequest { + // Required. The dependency resource to update. + // + // The dependency's `name` field is used to identify the dependency to update. + // Format: `projects/{project}/locations/{location}/dependencies/{dependency}` + Dependency dependency = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The list of fields to update. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// The +// [DeleteDependency][google.cloud.apihub.v1.ApiHubDependencies.DeleteDependency] +// method's request. +message DeleteDependencyRequest { + // Required. The name of the dependency resource to delete. + // Format: `projects/{project}/locations/{location}/dependencies/{dependency}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "apihub.googleapis.com/Dependency" + } + ]; +} + +// The +// [ListDependencies][google.cloud.apihub.v1.ApiHubDependencies.ListDependencies] +// method's request. +message ListDependenciesRequest { + // Required. The parent which owns this collection of dependency resources. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "apihub.googleapis.com/Dependency" + } + ]; + + // Optional. An expression that filters the list of Dependencies. + // + // A filter expression consists of a field name, a comparison operator, and + // a value for filtering. The value must be a string. Allowed comparison + // operator is `=`. Filters are not case sensitive. + // + // The following fields in the `Dependency` are eligible for filtering: + // + // * `consumer.operation_resource_name` - The operation resource name for + // the consumer entity involved in a dependency. Allowed comparison + // operators: `=`. + // * `consumer.external_api_resource_name` - The external api resource name + // for the consumer entity involved in a dependency. Allowed comparison + // operators: `=`. + // * `supplier.operation_resource_name` - The operation resource name for + // the supplier entity involved in a dependency. Allowed comparison + // operators: `=`. + // * `supplier.external_api_resource_name` - The external api resource name + // for the supplier entity involved in a dependency. Allowed comparison + // operators: `=`. + // + // Expressions are combined with either `AND` logic operator or `OR` logical + // operator but not both of them together i.e. only one of the `AND` or `OR` + // operator can be used throughout the filter string and both the operators + // cannot be used together. No other logical operators are supported. At most + // three filter fields are allowed in the filter string and if provided + // more than that then `INVALID_ARGUMENT` error is returned by the API. + // + // For example, `consumer.operation_resource_name = + // \"projects/p1/locations/global/apis/a1/versions/v1/operations/o1\" OR + // supplier.operation_resource_name = + // \"projects/p1/locations/global/apis/a1/versions/v1/operations/o1\"` - The + // dependencies with either consumer or supplier operation resource name as + // _projects/p1/locations/global/apis/a1/versions/v1/operations/o1_. + string filter = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The maximum number of dependency resources to return. The service + // may return fewer than this value. If unspecified, at most 50 dependencies + // will be returned. The maximum value is 1000; values above 1000 will be + // coerced to 1000. + int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous `ListDependencies` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListDependencies` must + // match the call that provided the page token. + string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// The +// [ListDependencies][google.cloud.apihub.v1.ApiHubDependencies.ListDependencies] +// method's response. +message ListDependenciesResponse { + // The dependency resources present in the API hub. + // Only following field will be populated in the response: name. + repeated Dependency dependencies = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// The [CreateExternalApi][google.cloud.apihub.v1.ApiHub.CreateExternalApi] +// method's request. +message CreateExternalApiRequest { + // Required. The parent resource for the External API resource. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "apihub.googleapis.com/ExternalApi" + } + ]; + + // Optional. The ID to use for the External API resource, which will become + // the final component of the External API's resource name. This field is + // optional. + // + // * If provided, the same will be used. The service will throw an error if + // the specified id is already used by another External API resource in the + // API hub. + // * If not provided, a system generated id will be used. + // + // This value should be 4-500 characters, and valid characters + // are /[a-z][A-Z][0-9]-_/. + string external_api_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The External API resource to create. + ExternalApi external_api = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// The [GetExternalApi][google.cloud.apihub.v1.ApiHub.GetExternalApi] method's +// request. +message GetExternalApiRequest { + // Required. The name of the External API resource to retrieve. + // Format: + // `projects/{project}/locations/{location}/externalApis/{externalApi}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "apihub.googleapis.com/ExternalApi" + } + ]; +} + +// The [UpdateExternalApi][google.cloud.apihub.v1.ApiHub.UpdateExternalApi] +// method's request. +message UpdateExternalApiRequest { + // Required. The External API resource to update. + // + // The External API resource's `name` field is used to identify the External + // API resource to update. Format: + // `projects/{project}/locations/{location}/externalApis/{externalApi}` + ExternalApi external_api = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The list of fields to update. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// The [DeleteExternalApi][google.cloud.apihub.v1.ApiHub.DeleteExternalApi] +// method's request. +message DeleteExternalApiRequest { + // Required. The name of the External API resource to delete. + // Format: + // `projects/{project}/locations/{location}/externalApis/{externalApi}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "apihub.googleapis.com/ExternalApi" + } + ]; +} + +// The [ListExternalApis][google.cloud.apihub.v1.ApiHub.ListExternalApis] +// method's request. +message ListExternalApisRequest { + // Required. The parent, which owns this collection of External API resources. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "apihub.googleapis.com/ExternalApi" + } + ]; + + // Optional. The maximum number of External API resources to return. The + // service may return fewer than this value. If unspecified, at most 50 + // ExternalApis will be returned. The maximum value is 1000; values above 1000 + // will be coerced to 1000. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous `ListExternalApis` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters (except page_size) provided to + // `ListExternalApis` must match the call that provided the page token. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// The [ListExternalApis][google.cloud.apihub.v1.ApiHub.ListExternalApis] +// method's response. +message ListExternalApisResponse { + // The External API resources present in the API hub. + // Only following fields will be populated in the response: name, + // display_name, documentation.external_uri. + repeated ExternalApi external_apis = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} diff --git a/owl-bot-staging/google-cloud-apihub/v1/protos/google/cloud/apihub/v1/common_fields.proto b/owl-bot-staging/google-cloud-apihub/v1/protos/google/cloud/apihub/v1/common_fields.proto new file mode 100644 index 00000000000..9d1c87f19a1 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/protos/google/cloud/apihub/v1/common_fields.proto @@ -0,0 +1,1297 @@ +// Copyright 2024 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.apihub.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.ApiHub.V1"; +option go_package = "cloud.google.com/go/apihub/apiv1/apihubpb;apihubpb"; +option java_multiple_files = true; +option java_outer_classname = "CommonFieldsProto"; +option java_package = "com.google.cloud.apihub.v1"; +option php_namespace = "Google\\Cloud\\ApiHub\\V1"; +option ruby_package = "Google::Cloud::ApiHub::V1"; +option (google.api.resource_definition) = { + type: "aiplatform.googleapis.com/Extension" + pattern: "projects/{project}/locations/{location}/extensions/{extension}" +}; + +// Lint state represents success or failure for linting. +enum LintState { + // Lint state unspecified. + LINT_STATE_UNSPECIFIED = 0; + + // Linting was completed successfully. + LINT_STATE_SUCCESS = 1; + + // Linting encountered errors. + LINT_STATE_ERROR = 2; +} + +// Enumeration of linter types. +enum Linter { + // Linter type unspecified. + LINTER_UNSPECIFIED = 0; + + // Linter type spectral. + SPECTRAL = 1; + + // Linter type other. + OTHER = 2; +} + +// Severity of the issue. +enum Severity { + // Severity unspecified. + SEVERITY_UNSPECIFIED = 0; + + // Severity error. + SEVERITY_ERROR = 1; + + // Severity warning. + SEVERITY_WARNING = 2; + + // Severity info. + SEVERITY_INFO = 3; + + // Severity hint. + SEVERITY_HINT = 4; +} + +// An API resource in the API Hub. +message Api { + option (google.api.resource) = { + type: "apihub.googleapis.com/Api" + pattern: "projects/{project}/locations/{location}/apis/{api}" + plural: "apis" + singular: "api" + }; + + // Identifier. The name of the API resource in the API Hub. + // + // Format: + // `projects/{project}/locations/{location}/apis/{api}` + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Required. The display name of the API resource. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The description of the API resource. + string description = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The documentation for the API resource. + Documentation documentation = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Owner details for the API resource. + Owner owner = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The list of versions present in an API resource. + // Note: An API resource can be associated with more than 1 version. + // Format is + // `projects/{project}/locations/{location}/apis/{api}/versions/{version}` + repeated string versions = 6 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { type: "apihub.googleapis.com/Version" } + ]; + + // Output only. The time at which the API resource was created. + google.protobuf.Timestamp create_time = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which the API resource was last updated. + google.protobuf.Timestamp update_time = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The target users for the API. + // This maps to the following system defined attribute: + // `projects/{project}/locations/{location}/attributes/system-target-user` + // attribute. + // The number of values for this attribute will be based on the + // cardinality of the attribute. The same can be retrieved via GetAttribute + // API. All values should be from the list of allowed values defined for the + // attribute. + AttributeValues target_user = 9 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The team owning the API. + // This maps to the following system defined attribute: + // `projects/{project}/locations/{location}/attributes/system-team` + // attribute. + // The number of values for this attribute will be based on the + // cardinality of the attribute. The same can be retrieved via GetAttribute + // API. All values should be from the list of allowed values defined for the + // attribute. + AttributeValues team = 10 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The business unit owning the API. + // This maps to the following system defined attribute: + // `projects/{project}/locations/{location}/attributes/system-business-unit` + // attribute. + // The number of values for this attribute will be based on the + // cardinality of the attribute. The same can be retrieved via GetAttribute + // API. All values should be from the list of allowed values defined for the + // attribute. + AttributeValues business_unit = 11 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The maturity level of the API. + // This maps to the following system defined attribute: + // `projects/{project}/locations/{location}/attributes/system-maturity-level` + // attribute. + // The number of values for this attribute will be based on the + // cardinality of the attribute. The same can be retrieved via GetAttribute + // API. All values should be from the list of allowed values defined for the + // attribute. + AttributeValues maturity_level = 12 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The list of user defined attributes associated with the API + // resource. The key is the attribute name. It will be of the format: + // `projects/{project}/locations/{location}/attributes/{attribute}`. + // The value is the attribute values associated with the resource. + map attributes = 13 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The style of the API. + // This maps to the following system defined attribute: + // `projects/{project}/locations/{location}/attributes/system-api-style` + // attribute. + // The number of values for this attribute will be based on the + // cardinality of the attribute. The same can be retrieved via GetAttribute + // API. All values should be from the list of allowed values defined for the + // attribute. + AttributeValues api_style = 14 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The selected version for an API resource. + // This can be used when special handling is needed on client side for + // particular version of the API. Format is + // `projects/{project}/locations/{location}/apis/{api}/versions/{version}` + string selected_version = 15 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { type: "apihub.googleapis.com/Version" } + ]; +} + +// Represents a version of the API resource in API hub. This is also referred +// to as the API version. +message Version { + option (google.api.resource) = { + type: "apihub.googleapis.com/Version" + pattern: "projects/{project}/locations/{location}/apis/{api}/versions/{version}" + plural: "versions" + singular: "version" + }; + + // Identifier. The name of the version. + // + // Format: + // `projects/{project}/locations/{location}/apis/{api}/versions/{version}` + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Required. The display name of the version. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The description of the version. + string description = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The documentation of the version. + Documentation documentation = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The specs associated with this version. + // Note that an API version can be associated with multiple specs. + // Format is + // `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}` + repeated string specs = 5 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { type: "apihub.googleapis.com/Spec" } + ]; + + // Output only. The operations contained in the API version. + // These operations will be added to the version when a new spec is + // added or when an existing spec is updated. Format is + // `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}` + repeated string api_operations = 6 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "apihub.googleapis.com/ApiOperation" + } + ]; + + // Output only. The definitions contained in the API version. + // These definitions will be added to the version when a new spec is + // added or when an existing spec is updated. Format is + // `projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}` + repeated string definitions = 7 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "apihub.googleapis.com/Definition" + } + ]; + + // Optional. The deployments linked to this API version. + // Note: A particular API version could be deployed to multiple deployments + // (for dev deployment, UAT deployment, etc) + // Format is + // `projects/{project}/locations/{location}/deployments/{deployment}` + repeated string deployments = 8 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "apihub.googleapis.com/Deployment" + } + ]; + + // Output only. The time at which the version was created. + google.protobuf.Timestamp create_time = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which the version was last updated. + google.protobuf.Timestamp update_time = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The lifecycle of the API version. + // This maps to the following system defined attribute: + // `projects/{project}/locations/{location}/attributes/system-lifecycle` + // attribute. + // The number of values for this attribute will be based on the + // cardinality of the attribute. The same can be retrieved via GetAttribute + // API. All values should be from the list of allowed values defined for the + // attribute. + AttributeValues lifecycle = 11 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The compliance associated with the API version. + // This maps to the following system defined attribute: + // `projects/{project}/locations/{location}/attributes/system-compliance` + // attribute. + // The number of values for this attribute will be based on the + // cardinality of the attribute. The same can be retrieved via GetAttribute + // API. All values should be from the list of allowed values defined for the + // attribute. + AttributeValues compliance = 12 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The accreditations associated with the API version. + // This maps to the following system defined attribute: + // `projects/{project}/locations/{location}/attributes/system-accreditation` + // attribute. + // The number of values for this attribute will be based on the + // cardinality of the attribute. The same can be retrieved via GetAttribute + // API. All values should be from the list of allowed values defined for the + // attribute. + AttributeValues accreditation = 13 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The list of user defined attributes associated with the Version + // resource. The key is the attribute name. It will be of the format: + // `projects/{project}/locations/{location}/attributes/{attribute}`. + // The value is the attribute values associated with the resource. + map attributes = 14 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The selected deployment for a Version resource. + // This can be used when special handling is needed on client side for a + // particular deployment linked to the version. + // Format is + // `projects/{project}/locations/{location}/deployments/{deployment}` + string selected_deployment = 16 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "apihub.googleapis.com/Deployment" + } + ]; +} + +// Represents a spec associated with an API version in the API +// Hub. Note that specs of various types can be uploaded, however +// parsing of details is supported for OpenAPI spec currently. +message Spec { + option (google.api.resource) = { + type: "apihub.googleapis.com/Spec" + pattern: "projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}" + plural: "specs" + singular: "spec" + }; + + // Specifies the parsing mode for API specifications during creation and + // update. + // - `RELAXED`: Parsing errors in the specification content do not fail the + // API call. + // - `STRICT`: Parsing errors in the specification content result in failure + // of the API call. + // If not specified, defaults to `RELAXED`. + enum ParsingMode { + // Defaults to `RELAXED`. + PARSING_MODE_UNSPECIFIED = 0; + + // Parsing of the Spec on create and update is relaxed, meaning that + // parsing errors the spec contents will not fail the API call. + RELAXED = 1; + + // Parsing of the Spec on create and update is strict, meaning that + // parsing errors in the spec contents will fail the API call. + STRICT = 2; + } + + // Identifier. The name of the spec. + // + // Format: + // `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}` + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Required. The display name of the spec. + // This can contain the file name of the spec. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The type of spec. + // The value should be one of the allowed values defined for + // `projects/{project}/locations/{location}/attributes/system-spec-type` + // attribute. + // The number of values for this attribute will be based on the + // cardinality of the attribute. The same can be retrieved via GetAttribute + // API. + // + // Note, this field is mandatory if content is provided. + AttributeValues spec_type = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Input only. The contents of the uploaded spec. + SpecContents contents = 4 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.field_behavior) = INPUT_ONLY + ]; + + // Output only. Details parsed from the spec. + SpecDetails details = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The URI of the spec source in case file is uploaded + // from an external version control system. + string source_uri = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The time at which the spec was created. + google.protobuf.Timestamp create_time = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which the spec was last updated. + google.protobuf.Timestamp update_time = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The lint response for the spec. + LintResponse lint_response = 9 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The list of user defined attributes associated with the spec. + // The key is the attribute name. It will be of the format: + // `projects/{project}/locations/{location}/attributes/{attribute}`. + // The value is the attribute values associated with the resource. + map attributes = 10 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The documentation of the spec. + // For OpenAPI spec, this will be populated from `externalDocs` in OpenAPI + // spec. + Documentation documentation = 11 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Input only. Enum specifying the parsing mode for OpenAPI + // Specification (OAS) parsing. + ParsingMode parsing_mode = 12 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.field_behavior) = INPUT_ONLY + ]; +} + +// Details of the deployment where APIs are hosted. +// A deployment could represent an Apigee proxy, API gateway, other Google Cloud +// services or non-Google Cloud services as well. A deployment entity is a root +// level entity in the API hub and exists independent of any API. +message Deployment { + option (google.api.resource) = { + type: "apihub.googleapis.com/Deployment" + pattern: "projects/{project}/locations/{location}/deployments/{deployment}" + plural: "deployments" + singular: "deployment" + }; + + // Identifier. The name of the deployment. + // + // Format: + // `projects/{project}/locations/{location}/deployments/{deployment}` + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Required. The display name of the deployment. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The description of the deployment. + string description = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The documentation of the deployment. + Documentation documentation = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The type of deployment. + // This maps to the following system defined attribute: + // `projects/{project}/locations/{location}/attributes/system-deployment-type` + // attribute. + // The number of values for this attribute will be based on the + // cardinality of the attribute. The same can be retrieved via GetAttribute + // API. All values should be from the list of allowed values defined for the + // attribute. + AttributeValues deployment_type = 5 [(google.api.field_behavior) = REQUIRED]; + + // Required. A URI to the runtime resource. This URI can be used to manage the + // resource. For example, if the runtime resource is of type APIGEE_PROXY, + // then this field will contain the URI to the management UI of the proxy. + string resource_uri = 6 [(google.api.field_behavior) = REQUIRED]; + + // Required. The endpoints at which this deployment resource is listening for + // API requests. This could be a list of complete URIs, hostnames or an IP + // addresses. + repeated string endpoints = 7 [(google.api.field_behavior) = REQUIRED]; + + // Output only. The API versions linked to this deployment. + // Note: A particular deployment could be linked to multiple different API + // versions (of same or different APIs). + repeated string api_versions = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which the deployment was created. + google.protobuf.Timestamp create_time = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which the deployment was last updated. + google.protobuf.Timestamp update_time = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The SLO for this deployment. + // This maps to the following system defined attribute: + // `projects/{project}/locations/{location}/attributes/system-slo` + // attribute. + // The number of values for this attribute will be based on the + // cardinality of the attribute. The same can be retrieved via GetAttribute + // API. All values should be from the list of allowed values defined for the + // attribute. + AttributeValues slo = 11 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The environment mapping to this deployment. + // This maps to the following system defined attribute: + // `projects/{project}/locations/{location}/attributes/system-environment` + // attribute. + // The number of values for this attribute will be based on the + // cardinality of the attribute. The same can be retrieved via GetAttribute + // API. All values should be from the list of allowed values defined for the + // attribute. + AttributeValues environment = 12 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The list of user defined attributes associated with the + // deployment resource. The key is the attribute name. It will be of the + // format: `projects/{project}/locations/{location}/attributes/{attribute}`. + // The value is the attribute values associated with the resource. + map attributes = 13 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Represents an operation contained in an API version in the API Hub. +// An operation is added/updated/deleted in an API version when a new spec is +// added or an existing spec is updated/deleted in a version. +// Currently, an operation will be created only corresponding to OpenAPI spec as +// parsing is supported for OpenAPI spec. +message ApiOperation { + option (google.api.resource) = { + type: "apihub.googleapis.com/ApiOperation" + pattern: "projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}" + plural: "apiOperations" + singular: "apiOperation" + }; + + // Identifier. The name of the operation. + // + // Format: + // `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}` + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Output only. The name of the spec from where the operation was parsed. + // Format is + // `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}` + string spec = 2 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { type: "apihub.googleapis.com/Spec" } + ]; + + // Output only. Operation details. + OperationDetails details = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which the operation was created. + google.protobuf.Timestamp create_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which the operation was last updated. + google.protobuf.Timestamp update_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The list of user defined attributes associated with the API + // operation resource. The key is the attribute name. It will be of the + // format: `projects/{project}/locations/{location}/attributes/{attribute}`. + // The value is the attribute values associated with the resource. + map attributes = 6 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Represents a definition for example schema, request, response definitions +// contained in an API version. +// A definition is added/updated/deleted in an API version when a new spec is +// added or an existing spec is updated/deleted in a version. Currently, +// definition will be created only corresponding to OpenAPI spec as parsing is +// supported for OpenAPI spec. Also, within OpenAPI spec, only `schema` object +// is supported. +message Definition { + option (google.api.resource) = { + type: "apihub.googleapis.com/Definition" + pattern: "projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}" + plural: "definitions" + singular: "definition" + }; + + // Enumeration of definition types. + enum Type { + // Definition type unspecified. + TYPE_UNSPECIFIED = 0; + + // Definition type schema. + SCHEMA = 1; + } + + oneof value { + // Output only. The value of a schema definition. + Schema schema = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Identifier. The name of the definition. + // + // Format: + // `projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}` + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Output only. The name of the spec from where the definition was parsed. + // Format is + // `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}` + string spec = 2 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { type: "apihub.googleapis.com/Spec" } + ]; + + // Output only. The type of the definition. + Type type = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which the definition was created. + google.protobuf.Timestamp create_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which the definition was last updated. + google.protobuf.Timestamp update_time = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The list of user defined attributes associated with the + // definition resource. The key is the attribute name. It will be of the + // format: `projects/{project}/locations/{location}/attributes/{attribute}`. + // The value is the attribute values associated with the resource. + map attributes = 7 + [(google.api.field_behavior) = OPTIONAL]; +} + +// An attribute in the API Hub. +// An attribute is a name value pair which can be attached to different +// resources in the API hub based on the scope of the attribute. Attributes can +// either be pre-defined by the API Hub or created by users. +message Attribute { + option (google.api.resource) = { + type: "apihub.googleapis.com/Attribute" + pattern: "projects/{project}/locations/{location}/attributes/{attribute}" + plural: "attributes" + singular: "attribute" + }; + + // The value that can be assigned to the attribute when the data type is + // enum. + message AllowedValue { + // Required. The ID of the allowed value. + // * If provided, the same will be used. The service will throw an error if + // the specified id is already used by another allowed value in the same + // attribute resource. + // * If not provided, a system generated id derived from the display name + // will be used. In this case, the service will handle conflict resolution + // by adding a system generated suffix in case of duplicates. + // + // This value should be 4-63 characters, and valid characters + // are /[a-z][0-9]-/. + string id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The display name of the allowed value. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The detailed description of the allowed value. + string description = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. When set to true, the allowed value cannot be updated or + // deleted by the user. It can only be true for System defined attributes. + bool immutable = 4 [(google.api.field_behavior) = OPTIONAL]; + } + + // Enumeration of attribute definition types. + enum DefinitionType { + // Attribute definition type unspecified. + DEFINITION_TYPE_UNSPECIFIED = 0; + + // The attribute is predefined by the API Hub. Note that only the list of + // allowed values can be updated in this case via UpdateAttribute method. + SYSTEM_DEFINED = 1; + + // The attribute is defined by the user. + USER_DEFINED = 2; + } + + // Enumeration for the scope of the attribute representing the resource in the + // API Hub to which the attribute can be linked. + enum Scope { + // Scope Unspecified. + SCOPE_UNSPECIFIED = 0; + + // Attribute can be linked to an API. + API = 1; + + // Attribute can be linked to an API version. + VERSION = 2; + + // Attribute can be linked to a Spec. + SPEC = 3; + + // Attribute can be linked to an API Operation. + API_OPERATION = 4; + + // Attribute can be linked to a Deployment. + DEPLOYMENT = 5; + + // Attribute can be linked to a Dependency. + DEPENDENCY = 6; + + // Attribute can be linked to a definition. + DEFINITION = 7; + + // Attribute can be linked to a ExternalAPI. + EXTERNAL_API = 8; + + // Attribute can be linked to a Plugin. + PLUGIN = 9; + } + + // Enumeration of attribute's data type. + enum DataType { + // Attribute data type unspecified. + DATA_TYPE_UNSPECIFIED = 0; + + // Attribute's value is of type enum. + ENUM = 1; + + // Attribute's value is of type json. + JSON = 2; + + // Attribute's value is of type string. + STRING = 3; + } + + // Identifier. The name of the attribute in the API Hub. + // + // Format: + // `projects/{project}/locations/{location}/attributes/{attribute}` + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Required. The display name of the attribute. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The description of the attribute. + string description = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The definition type of the attribute. + DefinitionType definition_type = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The scope of the attribute. It represents the resource in the API + // Hub to which the attribute can be linked. + Scope scope = 5 [(google.api.field_behavior) = REQUIRED]; + + // Required. The type of the data of the attribute. + DataType data_type = 6 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The list of allowed values when the attribute value is of type + // enum. This is required when the data_type of the attribute is ENUM. The + // maximum number of allowed values of an attribute will be 1000. + repeated AllowedValue allowed_values = 7 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The maximum number of values that the attribute can have when + // associated with an API Hub resource. Cardinality 1 would represent a + // single-valued attribute. It must not be less than 1 or greater than 20. If + // not specified, the cardinality would be set to 1 by default and represent a + // single-valued attribute. + int32 cardinality = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. When mandatory is true, the attribute is mandatory for the + // resource specified in the scope. Only System defined attributes can be + // mandatory. + bool mandatory = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which the attribute was created. + google.protobuf.Timestamp create_time = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which the attribute was last updated. + google.protobuf.Timestamp update_time = 11 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// The spec contents. +message SpecContents { + // Required. The contents of the spec. + bytes contents = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The mime type of the content for example application/json, + // application/yaml, application/wsdl etc. + string mime_type = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// SpecDetails contains the details parsed from supported +// spec types. +message SpecDetails { + oneof details { + // Output only. Additional details apart from `OperationDetails` parsed from + // an OpenAPI spec. The OperationDetails parsed from the spec can be + // obtained by using + // [ListAPIOperations][google.cloud.apihub.v1.ApiHub.ListApiOperations] + // method. + OpenApiSpecDetails open_api_spec_details = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Output only. The description of the spec. + string description = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// OpenApiSpecDetails contains the details parsed from an OpenAPI spec in +// addition to the fields mentioned in +// [SpecDetails][google.cloud.apihub.v1.SpecDetails]. +message OpenApiSpecDetails { + // Enumeration of spec formats. + enum Format { + // SpecFile type unspecified. + FORMAT_UNSPECIFIED = 0; + + // OpenAPI Spec v2.0. + OPEN_API_SPEC_2_0 = 1; + + // OpenAPI Spec v3.0. + OPEN_API_SPEC_3_0 = 2; + + // OpenAPI Spec v3.1. + OPEN_API_SPEC_3_1 = 3; + } + + // Output only. The format of the spec. + Format format = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The version in the spec. + // This maps to `info.version` in OpenAPI spec. + string version = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Owner details for the spec. + // This maps to `info.contact` in OpenAPI spec. + Owner owner = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// The operation details parsed from the spec. +message OperationDetails { + oneof operation { + // The HTTP Operation. + HttpOperation http_operation = 4; + } + + // Output only. Description of the operation behavior. + // For OpenAPI spec, this will map to `operation.description` in the + // spec, in case description is empty, `operation.summary` will be used. + string description = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Additional external documentation for this operation. + // For OpenAPI spec, this will map to `operation.documentation` in the spec. + Documentation documentation = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. For OpenAPI spec, this will be set if `operation.deprecated`is + // marked as `true` in the spec. + bool deprecated = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// The HTTP Operation. +message HttpOperation { + // Enumeration of Method types. + enum Method { + // Method unspecified. + METHOD_UNSPECIFIED = 0; + + // Get Operation type. + GET = 1; + + // Put Operation type. + PUT = 2; + + // Post Operation type. + POST = 3; + + // Delete Operation type. + DELETE = 4; + + // Options Operation type. + OPTIONS = 5; + + // Head Operation type. + HEAD = 6; + + // Patch Operation type. + PATCH = 7; + + // Trace Operation type. + TRACE = 8; + } + + // Output only. The path details for the Operation. + Path path = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Operation method + Method method = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// The path details derived from the spec. +message Path { + // Output only. Complete path relative to server endpoint. + string path = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A short description for the path applicable to all operations. + string description = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// The schema details derived from the spec. Currently, this entity is supported +// for OpenAPI spec only. +// For OpenAPI spec, this maps to the schema defined in +// the `definitions` section for OpenAPI 2.0 version and in +// `components.schemas` section for OpenAPI 3.0 and 3.1 version. +message Schema { + // Output only. The display name of the schema. + // This will map to the name of the schema in the spec. + string display_name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The raw value of the schema definition corresponding to the + // schema name in the spec. + bytes raw_value = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Owner details. +message Owner { + // Optional. The name of the owner. + string display_name = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The email of the owner. + string email = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Documentation details. +message Documentation { + // Optional. The uri of the externally hosted documentation. + string external_uri = 1 [(google.api.field_behavior) = OPTIONAL]; +} + +// The attribute values associated with resource. +message AttributeValues { + // The attribute values of data type enum. + message EnumAttributeValues { + // Required. The attribute values in case attribute data type is enum. + repeated Attribute.AllowedValue values = 1 + [(google.api.field_behavior) = REQUIRED]; + } + + // The attribute values of data type string or JSON. + message StringAttributeValues { + // Required. The attribute values in case attribute data type is string or + // JSON. + repeated string values = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // The attribute values associated with the resource. + oneof Value { + // The attribute values associated with a resource in case attribute data + // type is enum. + EnumAttributeValues enum_values = 2; + + // The attribute values associated with a resource in case attribute data + // type is string. + StringAttributeValues string_values = 3; + + // The attribute values associated with a resource in case attribute data + // type is JSON. + StringAttributeValues json_values = 4; + } + + // Output only. The name of the attribute. + // Format: projects/{project}/locations/{location}/attributes/{attribute} + string attribute = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "apihub.googleapis.com/Attribute" + } + ]; +} + +// A dependency resource defined in the API hub describes a dependency directed +// from a consumer to a supplier entity. A dependency can be defined between two +// [Operations][google.cloud.apihub.v1.Operation] or between +// an [Operation][google.cloud.apihub.v1.Operation] and [External +// API][google.cloud.apihub.v1.ExternalApi]. +message Dependency { + option (google.api.resource) = { + type: "apihub.googleapis.com/Dependency" + pattern: "projects/{project}/locations/{location}/dependencies/{dependency}" + plural: "dependencies" + singular: "dependency" + }; + + // Possible states for a dependency. + enum State { + // Default value. This value is unused. + STATE_UNSPECIFIED = 0; + + // Dependency will be in a proposed state when it is newly identified by the + // API hub on its own. + PROPOSED = 1; + + // Dependency will be in a validated state when it is validated by the + // admin or manually created in the API hub. + VALIDATED = 2; + } + + // Possible modes of discovering the dependency. + enum DiscoveryMode { + // Default value. This value is unused. + DISCOVERY_MODE_UNSPECIFIED = 0; + + // Manual mode of discovery when the dependency is defined by the user. + MANUAL = 1; + } + + // Identifier. The name of the dependency in the API Hub. + // + // Format: `projects/{project}/locations/{location}/dependencies/{dependency}` + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Required. Immutable. The entity acting as the consumer in the dependency. + DependencyEntityReference consumer = 2 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.field_behavior) = REQUIRED + ]; + + // Required. Immutable. The entity acting as the supplier in the dependency. + DependencyEntityReference supplier = 3 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.field_behavior) = REQUIRED + ]; + + // Output only. State of the dependency. + State state = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Human readable description corresponding of the dependency. + string description = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Discovery mode of the dependency. + DiscoveryMode discovery_mode = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Error details of a dependency if the system has detected it + // internally. + DependencyErrorDetail error_detail = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which the dependency was created. + google.protobuf.Timestamp create_time = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which the dependency was last updated. + google.protobuf.Timestamp update_time = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The list of user defined attributes associated with the + // dependency resource. The key is the attribute name. It will be of the + // format: `projects/{project}/locations/{location}/attributes/{attribute}`. + // The value is the attribute values associated with the resource. + map attributes = 10 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Reference to an entity participating in a dependency. +message DependencyEntityReference { + // Required. Unique identifier for the participating entity. + oneof identifier { + // The resource name of an operation in the API Hub. + // + // Format: + // `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}` + string operation_resource_name = 2; + + // The resource name of an external API in the API Hub. + // + // Format: + // `projects/{project}/locations/{location}/externalApis/{external_api}` + string external_api_resource_name = 3; + } + + // Output only. Display name of the entity. + string display_name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Details describing error condition of a dependency. +message DependencyErrorDetail { + // Possible values representing an error in the dependency. + enum Error { + // Default value used for no error in the dependency. + ERROR_UNSPECIFIED = 0; + + // Supplier entity has been deleted. + SUPPLIER_NOT_FOUND = 1; + + // Supplier entity has been recreated. + SUPPLIER_RECREATED = 2; + } + + // Optional. Error in the dependency. + Error error = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Timestamp at which the error was found. + google.protobuf.Timestamp error_time = 2 + [(google.api.field_behavior) = OPTIONAL]; +} + +// LintResponse contains the response from the linter. +message LintResponse { + // Count of issues with a given severity. + message SummaryEntry { + // Required. Severity of the issue. + Severity severity = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Count of issues with the given severity. + int32 count = 2 [(google.api.field_behavior) = REQUIRED]; + } + + // Optional. Array of issues found in the analyzed document. + repeated Issue issues = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Summary of all issue types and counts for each severity level. + repeated SummaryEntry summary = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. Lint state represents success or failure for linting. + LintState state = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. Name of the linting application. + string source = 4 [(google.api.field_behavior) = REQUIRED]; + + // Required. Name of the linter used. + Linter linter = 5 [(google.api.field_behavior) = REQUIRED]; + + // Required. Timestamp when the linting response was generated. + google.protobuf.Timestamp create_time = 6 + [(google.api.field_behavior) = REQUIRED]; +} + +// Issue contains the details of a single issue found by the linter. +message Issue { + // Required. Rule code unique to each rule defined in linter. + string code = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. An array of strings indicating the location in the analyzed + // document where the rule was triggered. + repeated string path = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Human-readable message describing the issue found by the linter. + string message = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. Severity level of the rule violation. + Severity severity = 4 [(google.api.field_behavior) = REQUIRED]; + + // Required. Object describing where in the file the issue was found. + Range range = 5 [(google.api.field_behavior) = REQUIRED]; +} + +// Object describing where in the file the issue was found. +message Range { + // Required. Start of the issue. + Point start = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. End of the issue. + Point end = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Point within the file (line and character). +message Point { + // Required. Line number (zero-indexed). + int32 line = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Character position within the line (zero-indexed). + int32 character = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// 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 been cancelled successfully + // 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]; +} + +// An ApiHubInstance represents the instance resources of the API Hub. +// Currently, only one ApiHub instance is allowed for each project. +message ApiHubInstance { + option (google.api.resource) = { + type: "apihub.googleapis.com/ApiHubInstance" + pattern: "projects/{project}/locations/{location}/apiHubInstances/{api_hub_instance}" + plural: "apiHubInstances" + singular: "apiHubInstance" + }; + + // Available configurations to provision an ApiHub Instance. + message Config { + // Required. The Customer Managed Encryption Key (CMEK) used for data + // encryption. The CMEK name should follow the format of + // `projects/([^/]+)/locations/([^/]+)/keyRings/([^/]+)/cryptoKeys/([^/]+)`, + // where the location must match the instance location. + string cmek_key_name = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // State of the ApiHub Instance. + enum State { + // The default value. This value is used if the state is omitted. + STATE_UNSPECIFIED = 0; + + // The ApiHub instance has not been initialized or has been deleted. + INACTIVE = 1; + + // The ApiHub instance is being created. + CREATING = 2; + + // The ApiHub instance has been created and is ready for use. + ACTIVE = 3; + + // The ApiHub instance is being updated. + UPDATING = 4; + + // The ApiHub instance is being deleted. + DELETING = 5; + + // The ApiHub instance encountered an error during a state change. + FAILED = 6; + } + + // Identifier. Format: + // `projects/{project}/locations/{location}/apiHubInstances/{apiHubInstance}`. + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Output only. Creation timestamp. + google.protobuf.Timestamp create_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Last update timestamp. + google.protobuf.Timestamp update_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The current state of the ApiHub instance. + State state = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Extra information about ApiHub instance state. Currently the + // message would be populated when state is `FAILED`. + string state_message = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. Config of the ApiHub instance. + Config config = 6 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Instance 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 = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Description of the ApiHub instance. + string description = 8 [(google.api.field_behavior) = OPTIONAL]; +} + +// An external API represents an API being provided by external sources. This +// can be used to model third-party APIs and can be used to define dependencies. +message ExternalApi { + option (google.api.resource) = { + type: "apihub.googleapis.com/ExternalApi" + pattern: "projects/{project}/locations/{location}/externalApis/{external_api}" + plural: "externalApis" + singular: "externalApi" + }; + + // Identifier. Format: + // `projects/{project}/locations/{location}/externalApi/{externalApi}`. + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Required. Display name of the external API. Max length is 63 characters + // (Unicode Code Points). + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Description of the external API. Max length is 2000 characters + // (Unicode Code Points). + string description = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. List of endpoints on which this API is accessible. + repeated string endpoints = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. List of paths served by this API. + repeated string paths = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Documentation of the external API. + Documentation documentation = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The list of user defined attributes associated with the Version + // resource. The key is the attribute name. It will be of the format: + // `projects/{project}/locations/{location}/attributes/{attribute}`. + // The value is the attribute values associated with the resource. + map attributes = 7 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Creation timestamp. + google.protobuf.Timestamp create_time = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Last update timestamp. + google.protobuf.Timestamp update_time = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/owl-bot-staging/google-cloud-apihub/v1/protos/google/cloud/apihub/v1/host_project_registration_service.proto b/owl-bot-staging/google-cloud-apihub/v1/protos/google/cloud/apihub/v1/host_project_registration_service.proto new file mode 100644 index 00000000000..2f9f370c870 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/protos/google/cloud/apihub/v1/host_project_registration_service.proto @@ -0,0 +1,207 @@ +// Copyright 2024 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.apihub.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.ApiHub.V1"; +option go_package = "cloud.google.com/go/apihub/apiv1/apihubpb;apihubpb"; +option java_multiple_files = true; +option java_outer_classname = "HostProjectRegistrationServiceProto"; +option java_package = "com.google.cloud.apihub.v1"; +option php_namespace = "Google\\Cloud\\ApiHub\\V1"; +option ruby_package = "Google::Cloud::ApiHub::V1"; + +// This service is used for managing the host project registrations. +service HostProjectRegistrationService { + option (google.api.default_host) = "apihub.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Create a host project registration. + // A Google cloud project can be registered as a host project if it is not + // attached as a runtime project to another host project. + // A project can be registered as a host project only once. Subsequent + // register calls for the same project will fail. + rpc CreateHostProjectRegistration(CreateHostProjectRegistrationRequest) + returns (HostProjectRegistration) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/hostProjectRegistrations" + body: "host_project_registration" + }; + option (google.api.method_signature) = + "parent,host_project_registration,host_project_registration_id"; + } + + // Get a host project registration. + rpc GetHostProjectRegistration(GetHostProjectRegistrationRequest) + returns (HostProjectRegistration) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/hostProjectRegistrations/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists host project registrations. + rpc ListHostProjectRegistrations(ListHostProjectRegistrationsRequest) + returns (ListHostProjectRegistrationsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/hostProjectRegistrations" + }; + option (google.api.method_signature) = "parent"; + } +} + +// The +// [CreateHostProjectRegistration][google.cloud.apihub.v1.HostProjectRegistrationService.CreateHostProjectRegistration] +// method's request. +message CreateHostProjectRegistrationRequest { + // Required. The parent resource for the host project. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "apihub.googleapis.com/HostProjectRegistration" + } + ]; + + // Required. The ID to use for the Host Project Registration, which will + // become the final component of the host project registration's resource + // name. The ID must be the same as the Google cloud project specified in the + // host_project_registration.gcp_project field. + string host_project_registration_id = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Required. The host project registration to register. + HostProjectRegistration host_project_registration = 3 + [(google.api.field_behavior) = REQUIRED]; +} + +// The +// [GetHostProjectRegistration][google.cloud.apihub.v1.HostProjectRegistrationService.GetHostProjectRegistration] +// method's request. +message GetHostProjectRegistrationRequest { + // Required. Host project registration resource name. + // projects/{project}/locations/{location}/hostProjectRegistrations/{host_project_registration_id} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "apihub.googleapis.com/HostProjectRegistration" + } + ]; +} + +// The +// [ListHostProjectRegistrations][google.cloud.apihub.v1.HostProjectRegistrationService.ListHostProjectRegistrations] +// method's request. +message ListHostProjectRegistrationsRequest { + // Required. The parent, which owns this collection of host projects. + // Format: `projects/*/locations/*` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "apihub.googleapis.com/HostProjectRegistration" + } + ]; + + // Optional. The maximum number of host project registrations to return. The + // service may return fewer than this value. If unspecified, at most 50 host + // project registrations will be returned. The maximum value is 1000; values + // above 1000 will be coerced to 1000. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous + // `ListHostProjectRegistrations` call. Provide this to retrieve the + // subsequent page. + // + // When paginating, all other parameters (except page_size) provided to + // `ListHostProjectRegistrations` must match the call that provided the page + // token. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. An expression that filters the list of HostProjectRegistrations. + // + // A filter expression consists of a field name, a comparison + // operator, and a value for filtering. The value must be a string. All + // standard operators as documented at https://google.aip.dev/160 are + // supported. + // + // The following fields in the `HostProjectRegistration` are eligible for + // filtering: + // + // * `name` - The name of the HostProjectRegistration. + // * `create_time` - The time at which the HostProjectRegistration was + // created. The value should be in the + // (RFC3339)[https://tools.ietf.org/html/rfc3339] format. + // * `gcp_project` - The Google cloud project associated with the + // HostProjectRegistration. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Hint for how to order the results. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// The +// [ListHostProjectRegistrations][google.cloud.apihub.v1.HostProjectRegistrationService.ListHostProjectRegistrations] +// method's response. +message ListHostProjectRegistrationsResponse { + // The list of host project registrations. + repeated HostProjectRegistration host_project_registrations = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// Host project registration refers to the registration of a Google cloud +// project with Api Hub as a host project. This is the project where Api Hub is +// provisioned. It acts as the consumer project for the Api Hub instance +// provisioned. Multiple runtime projects can be attached to the host project +// and these attachments define the scope of Api Hub. +message HostProjectRegistration { + option (google.api.resource) = { + type: "apihub.googleapis.com/HostProjectRegistration" + pattern: "projects/{project}/locations/{location}/hostProjectRegistrations/{host_project_registration}" + plural: "hostProjectRegistrations" + singular: "hostProjectRegistration" + }; + + // Identifier. The name of the host project registration. + // Format: + // "projects/{project}/locations/{location}/hostProjectRegistrations/{host_project_registration}". + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Required. Immutable. Google cloud project name in the format: + // "projects/abc" or "projects/123". As input, project name with either + // project id or number are accepted. As output, this field will contain + // project number. + string gcp_project = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + // Output only. The time at which the host project registration was created. + google.protobuf.Timestamp create_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/owl-bot-staging/google-cloud-apihub/v1/protos/google/cloud/apihub/v1/linting_service.proto b/owl-bot-staging/google-cloud-apihub/v1/protos/google/cloud/apihub/v1/linting_service.proto new file mode 100644 index 00000000000..9001c551a40 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/protos/google/cloud/apihub/v1/linting_service.proto @@ -0,0 +1,159 @@ +// Copyright 2024 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.apihub.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/apihub/v1/common_fields.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Cloud.ApiHub.V1"; +option go_package = "cloud.google.com/go/apihub/apiv1/apihubpb;apihubpb"; +option java_multiple_files = true; +option java_outer_classname = "LintingServiceProto"; +option java_package = "com.google.cloud.apihub.v1"; +option php_namespace = "Google\\Cloud\\ApiHub\\V1"; +option ruby_package = "Google::Cloud::ApiHub::V1"; + +// This service provides all methods related to the 1p Linter. +service LintingService { + option (google.api.default_host) = "apihub.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Get the style guide being used for linting. + rpc GetStyleGuide(GetStyleGuideRequest) returns (StyleGuide) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/plugins/*/styleGuide}" + }; + option (google.api.method_signature) = "name"; + } + + // Update the styleGuide to be used for liniting in by API hub. + rpc UpdateStyleGuide(UpdateStyleGuideRequest) returns (StyleGuide) { + option (google.api.http) = { + patch: "/v1/{style_guide.name=projects/*/locations/*/plugins/*/styleGuide}" + body: "style_guide" + }; + option (google.api.method_signature) = "style_guide,update_mask"; + } + + // Get the contents of the style guide. + rpc GetStyleGuideContents(GetStyleGuideContentsRequest) + returns (StyleGuideContents) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/plugins/*/styleGuide}:contents" + }; + option (google.api.method_signature) = "name"; + } + + // Lints the requested spec and updates the corresponding API Spec with the + // lint response. This lint response will be available in all subsequent + // Get and List Spec calls to Core service. + rpc LintSpec(LintSpecRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*}:lint" + body: "*" + }; + } +} + +// The [GetStyleGuide][ApiHub.GetStyleGuide] method's request. +message GetStyleGuideRequest { + // Required. The name of the spec to retrieve. + // Format: + // `projects/{project}/locations/{location}/plugins/{plugin}/styleGuide`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "apihub.googleapis.com/StyleGuide" + } + ]; +} + +// The [UpdateStyleGuide][ApiHub.UpdateStyleGuide] method's request. +message UpdateStyleGuideRequest { + // Required. The Style guide resource to update. + StyleGuide style_guide = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The list of fields to update. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = OPTIONAL]; +} + +// The [GetStyleGuideContents][ApiHub.GetStyleGuideContents] method's request. +message GetStyleGuideContentsRequest { + // Required. The name of the StyleGuide whose contents need to be retrieved. + // There is exactly one style guide resource per project per location. + // The expected format is + // `projects/{project}/locations/{location}/plugins/{plugin}/styleGuide`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "apihub.googleapis.com/StyleGuide" + } + ]; +} + +// The [LintSpec][ApiHub.LintSpec] method's request. +message LintSpecRequest { + // Required. The name of the spec to be linted. + // Format: + // `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "apihub.googleapis.com/Spec" } + ]; +} + +// The style guide contents. +message StyleGuideContents { + // Required. The contents of the style guide. + bytes contents = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The mime type of the content. + string mime_type = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Represents a singleton style guide resource to be used for linting Open API +// specs. +message StyleGuide { + option (google.api.resource) = { + type: "apihub.googleapis.com/StyleGuide" + pattern: "projects/{project}/locations/{location}/plugins/{plugin}/styleGuide" + plural: "styleGuides" + singular: "styleGuide" + }; + + // Identifier. The name of the style guide. + // + // Format: + // `projects/{project}/locations/{location}/plugins/{plugin}/styleGuide` + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Required. Target linter for the style guide. + Linter linter = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Input only. The contents of the uploaded style guide. + StyleGuideContents contents = 3 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = INPUT_ONLY + ]; +} diff --git a/owl-bot-staging/google-cloud-apihub/v1/protos/google/cloud/apihub/v1/plugin_service.proto b/owl-bot-staging/google-cloud-apihub/v1/protos/google/cloud/apihub/v1/plugin_service.proto new file mode 100644 index 00000000000..233c0669af0 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/protos/google/cloud/apihub/v1/plugin_service.proto @@ -0,0 +1,148 @@ +// Copyright 2024 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.apihub.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/apihub/v1/common_fields.proto"; + +option csharp_namespace = "Google.Cloud.ApiHub.V1"; +option go_package = "cloud.google.com/go/apihub/apiv1/apihubpb;apihubpb"; +option java_multiple_files = true; +option java_outer_classname = "PluginServiceProto"; +option java_package = "com.google.cloud.apihub.v1"; +option php_namespace = "Google\\Cloud\\ApiHub\\V1"; +option ruby_package = "Google::Cloud::ApiHub::V1"; + +// This service is used for managing plugins inside the API Hub. +service ApiHubPlugin { + option (google.api.default_host) = "apihub.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Get details about an API Hub plugin. + rpc GetPlugin(GetPluginRequest) returns (Plugin) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/plugins/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Enables a plugin. + // The `state` of the plugin after enabling is `ENABLED` + rpc EnablePlugin(EnablePluginRequest) returns (Plugin) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/plugins/*}:enable" + body: "*" + }; + option (google.api.method_signature) = "name"; + } + + // Disables a plugin. + // The `state` of the plugin after disabling is `DISABLED` + rpc DisablePlugin(DisablePluginRequest) returns (Plugin) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/plugins/*}:disable" + body: "*" + }; + option (google.api.method_signature) = "name"; + } +} + +// A plugin resource in the API Hub. +message Plugin { + option (google.api.resource) = { + type: "apihub.googleapis.com/Plugin" + pattern: "projects/{project}/locations/{location}/plugins/{plugin}" + plural: "plugins" + singular: "plugin" + }; + + // Possible states a plugin can have. Note that this enum may receive new + // values in the future. Consumers are advised to always code against the + // enum values expecting new states can be added later on. + enum State { + // The default value. This value is used if the state is omitted. + STATE_UNSPECIFIED = 0; + + // The plugin is enabled. + ENABLED = 1; + + // The plugin is disabled. + DISABLED = 2; + } + + // Identifier. The name of the plugin. + // Format: `projects/{project}/locations/{location}/plugins/{plugin}` + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Required. The display name of the plugin. Max length is 50 characters + // (Unicode code points). + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The type of the API. + // This maps to the following system defined attribute: + // `projects/{project}/locations/{location}/attributes/system-plugin-type` + // attribute. + // The number of allowed values for this attribute will be based on the + // cardinality of the attribute. The same can be retrieved via GetAttribute + // API. All values should be from the list of allowed values defined for the + // attribute. + AttributeValues type = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The plugin description. Max length is 2000 characters (Unicode + // code points). + string description = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Represents the state of the plugin. + State state = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// The [GetPlugin][google.cloud.apihub.v1.ApiHubPlugin.GetPlugin] method's +// request. +message GetPluginRequest { + // Required. The name of the plugin to retrieve. + // Format: `projects/{project}/locations/{location}/plugins/{plugin}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "apihub.googleapis.com/Plugin" } + ]; +} + +// The [EnablePlugin][google.cloud.apihub.v1.ApiHubPlugin.EnablePlugin] method's +// request. +message EnablePluginRequest { + // Required. The name of the plugin to enable. + // Format: `projects/{project}/locations/{location}/plugins/{plugin}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "apihub.googleapis.com/Plugin" } + ]; +} + +// The [DisablePlugin][google.cloud.apihub.v1.ApiHubPlugin.DisablePlugin] +// method's request. +message DisablePluginRequest { + // Required. The name of the plugin to disable. + // Format: `projects/{project}/locations/{location}/plugins/{plugin}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "apihub.googleapis.com/Plugin" } + ]; +} diff --git a/owl-bot-staging/google-cloud-apihub/v1/protos/google/cloud/apihub/v1/provisioning_service.proto b/owl-bot-staging/google-cloud-apihub/v1/protos/google/cloud/apihub/v1/provisioning_service.proto new file mode 100644 index 00000000000..2bf39fab779 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/protos/google/cloud/apihub/v1/provisioning_service.proto @@ -0,0 +1,136 @@ +// Copyright 2024 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.apihub.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/apihub/v1/common_fields.proto"; +import "google/longrunning/operations.proto"; + +option csharp_namespace = "Google.Cloud.ApiHub.V1"; +option go_package = "cloud.google.com/go/apihub/apiv1/apihubpb;apihubpb"; +option java_multiple_files = true; +option java_outer_classname = "ProvisioningServiceProto"; +option java_package = "com.google.cloud.apihub.v1"; +option php_namespace = "Google\\Cloud\\ApiHub\\V1"; +option ruby_package = "Google::Cloud::ApiHub::V1"; + +// This service is used for managing the data plane provisioning of the API hub. +service Provisioning { + option (google.api.default_host) = "apihub.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Provisions instance resources for the API Hub. + rpc CreateApiHubInstance(CreateApiHubInstanceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/apiHubInstances" + body: "api_hub_instance" + }; + option (google.api.method_signature) = + "parent,api_hub_instance,api_hub_instance_id"; + option (google.longrunning.operation_info) = { + response_type: "ApiHubInstance" + metadata_type: "OperationMetadata" + }; + } + + // Gets details of a single API Hub instance. + rpc GetApiHubInstance(GetApiHubInstanceRequest) returns (ApiHubInstance) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/apiHubInstances/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Looks up an Api Hub instance in a given GCP project. There will always be + // only one Api Hub instance for a GCP project across all locations. + rpc LookupApiHubInstance(LookupApiHubInstanceRequest) + returns (LookupApiHubInstanceResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/apiHubInstances:lookup" + }; + option (google.api.method_signature) = "parent"; + } +} + +// The +// [CreateApiHubInstance][google.cloud.apihub.v1.Provisioning.CreateApiHubInstance] +// method's request. +message CreateApiHubInstanceRequest { + // Required. The parent resource for the Api Hub instance resource. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Optional. Identifier to assign to the Api Hub instance. Must be unique + // within scope of the parent resource. If the field is not provided, system + // generated id will be used. + // + // This value should be 4-40 characters, and valid characters + // are `/[a-z][A-Z][0-9]-_/`. + string api_hub_instance_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The ApiHub instance. + ApiHubInstance api_hub_instance = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// The +// [GetApiHubInstance][google.cloud.apihub.v1.Provisioning.GetApiHubInstance] +// method's request. +message GetApiHubInstanceRequest { + // Required. The name of the Api Hub instance to retrieve. + // Format: + // `projects/{project}/locations/{location}/apiHubInstances/{apiHubInstance}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "apihub.googleapis.com/ApiHubInstance" + } + ]; +} + +// The +// [LookupApiHubInstance][google.cloud.apihub.v1.Provisioning.LookupApiHubInstance] +// method's request. +message LookupApiHubInstanceRequest { + // Required. There will always be only one Api Hub instance for a GCP project + // across all locations. + // The parent resource for the Api Hub instance resource. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "apihub.googleapis.com/ApiHubInstance" + } + ]; +} + +// The +// [LookupApiHubInstance][google.cloud.apihub.v1.Provisioning.LookupApiHubInstance] +// method's response.` +message LookupApiHubInstanceResponse { + // API Hub instance for a project if it exists, empty otherwise. + ApiHubInstance api_hub_instance = 1; +} diff --git a/owl-bot-staging/google-cloud-apihub/v1/protos/google/cloud/apihub/v1/runtime_project_attachment_service.proto b/owl-bot-staging/google-cloud-apihub/v1/protos/google/cloud/apihub/v1/runtime_project_attachment_service.proto new file mode 100644 index 00000000000..71c361c028a --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/protos/google/cloud/apihub/v1/runtime_project_attachment_service.proto @@ -0,0 +1,261 @@ +// Copyright 2024 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.apihub.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.ApiHub.V1"; +option go_package = "cloud.google.com/go/apihub/apiv1/apihubpb;apihubpb"; +option java_multiple_files = true; +option java_outer_classname = "RuntimeProjectAttachmentServiceProto"; +option java_package = "com.google.cloud.apihub.v1"; +option php_namespace = "Google\\Cloud\\ApiHub\\V1"; +option ruby_package = "Google::Cloud::ApiHub::V1"; + +// This service is used for managing the runtime project attachments. +service RuntimeProjectAttachmentService { + option (google.api.default_host) = "apihub.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Attaches a runtime project to the host project. + rpc CreateRuntimeProjectAttachment(CreateRuntimeProjectAttachmentRequest) + returns (RuntimeProjectAttachment) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/runtimeProjectAttachments" + body: "runtime_project_attachment" + }; + option (google.api.method_signature) = + "parent,runtime_project_attachment,runtime_project_attachment_id"; + } + + // Gets a runtime project attachment. + rpc GetRuntimeProjectAttachment(GetRuntimeProjectAttachmentRequest) + returns (RuntimeProjectAttachment) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/runtimeProjectAttachments/*}" + }; + option (google.api.method_signature) = "name"; + } + + // List runtime projects attached to the host project. + rpc ListRuntimeProjectAttachments(ListRuntimeProjectAttachmentsRequest) + returns (ListRuntimeProjectAttachmentsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/runtimeProjectAttachments" + }; + option (google.api.method_signature) = "parent"; + } + + // Delete a runtime project attachment in the API Hub. This call will detach + // the runtime project from the host project. + rpc DeleteRuntimeProjectAttachment(DeleteRuntimeProjectAttachmentRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/runtimeProjectAttachments/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Look up a runtime project attachment. This API can be called in the context + // of any project. + rpc LookupRuntimeProjectAttachment(LookupRuntimeProjectAttachmentRequest) + returns (LookupRuntimeProjectAttachmentResponse) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*}:lookupRuntimeProjectAttachment" + }; + option (google.api.method_signature) = "name"; + } +} + +// The +// [CreateRuntimeProjectAttachment][google.cloud.apihub.v1.RuntimeProjectAttachmentService.CreateRuntimeProjectAttachment] +// method's request. +message CreateRuntimeProjectAttachmentRequest { + // Required. The parent resource for the Runtime Project Attachment. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "apihub.googleapis.com/RuntimeProjectAttachment" + } + ]; + + // Required. The ID to use for the Runtime Project Attachment, which will + // become the final component of the Runtime Project Attachment's name. The ID + // must be the same as the project ID of the Google cloud project specified in + // the runtime_project_attachment.runtime_project field. + string runtime_project_attachment_id = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Required. The Runtime Project Attachment to create. + RuntimeProjectAttachment runtime_project_attachment = 3 + [(google.api.field_behavior) = REQUIRED]; +} + +// The +// [GetRuntimeProjectAttachment][google.cloud.apihub.v1.RuntimeProjectAttachmentService.GetRuntimeProjectAttachment] +// method's request. +message GetRuntimeProjectAttachmentRequest { + // Required. The name of the API resource to retrieve. + // Format: + // `projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "apihub.googleapis.com/RuntimeProjectAttachment" + } + ]; +} + +// The +// [ListRuntimeProjectAttachments][google.cloud.apihub.v1.RuntimeProjectAttachmentService.ListRuntimeProjectAttachments] +// method's request. +message ListRuntimeProjectAttachmentsRequest { + // Required. The parent, which owns this collection of runtime project + // attachments. Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "apihub.googleapis.com/RuntimeProjectAttachment" + } + ]; + + // Optional. The maximum number of runtime project attachments to return. The + // service may return fewer than this value. If unspecified, at most 50 + // runtime project attachments will be returned. The maximum value is 1000; + // values above 1000 will be coerced to 1000. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous + // `ListRuntimeProjectAttachments` call. Provide this to retrieve the + // subsequent page. + // + // When paginating, all other parameters (except page_size) provided to + // `ListRuntimeProjectAttachments` must match the call that provided the page + // token. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. An expression that filters the list of RuntimeProjectAttachments. + // + // A filter expression consists of a field name, a comparison + // operator, and a value for filtering. The value must be a string. All + // standard operators as documented at https://google.aip.dev/160 are + // supported. + // + // The following fields in the `RuntimeProjectAttachment` are eligible for + // filtering: + // + // * `name` - The name of the RuntimeProjectAttachment. + // * `create_time` - The time at which the RuntimeProjectAttachment was + // created. The value should be in the + // (RFC3339)[https://tools.ietf.org/html/rfc3339] format. + // * `runtime_project` - The Google cloud project associated with the + // RuntimeProjectAttachment. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Hint for how to order the results. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// The +// [ListRuntimeProjectAttachments][google.cloud.apihub.v1.RuntimeProjectAttachmentService.ListRuntimeProjectAttachments] +// method's response. +message ListRuntimeProjectAttachmentsResponse { + // List of runtime project attachments. + repeated RuntimeProjectAttachment runtime_project_attachments = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// The +// [DeleteRuntimeProjectAttachment][google.cloud.apihub.v1.RuntimeProjectAttachmentService.DeleteRuntimeProjectAttachment] +// method's request. +message DeleteRuntimeProjectAttachmentRequest { + // Required. The name of the Runtime Project Attachment to delete. + // Format: + // `projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "apihub.googleapis.com/RuntimeProjectAttachment" + } + ]; +} + +// The +// [LookupRuntimeProjectAttachment][google.cloud.apihub.v1.RuntimeProjectAttachmentService.LookupRuntimeProjectAttachment] +// method's request. +message LookupRuntimeProjectAttachmentRequest { + // Required. Runtime project ID to look up runtime project attachment for. + // Lookup happens across all regions. Expected format: + // `projects/{project}/locations/{location}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; +} + +// The +// [ListRuntimeProjectAttachments][google.cloud.apihub.v1.RuntimeProjectAttachmentService.ListRuntimeProjectAttachments] +// method's response. +message LookupRuntimeProjectAttachmentResponse { + // Runtime project attachment for a project if exists, empty otherwise. + RuntimeProjectAttachment runtime_project_attachment = 1; +} + +// Runtime project attachment represents an attachment from the runtime project +// to the host project. Api Hub looks for deployments in the attached runtime +// projects and creates corresponding resources in Api Hub for the discovered +// deployments. +message RuntimeProjectAttachment { + option (google.api.resource) = { + type: "apihub.googleapis.com/RuntimeProjectAttachment" + pattern: "projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}" + plural: "runtimeProjectAttachments" + singular: "runtimeProjectAttachment" + }; + + // Identifier. The resource name of a runtime project attachment. Format: + // "projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}". + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Required. Immutable. Google cloud project name in the format: + // "projects/abc" or "projects/123". As input, project name with either + // project id or number are accepted. As output, this field will contain + // project number. + string runtime_project = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + // Output only. Create time. + google.protobuf.Timestamp create_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/owl-bot-staging/google-cloud-apihub/v1/protos/protos.d.ts b/owl-bot-staging/google-cloud-apihub/v1/protos/protos.d.ts new file mode 100644 index 00000000000..0ec6d0a3e62 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/protos/protos.d.ts @@ -0,0 +1,21434 @@ +// Copyright 2024 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 apihub. */ + namespace apihub { + + /** Namespace v1. */ + namespace v1 { + + /** Represents an ApiHub */ + class ApiHub extends $protobuf.rpc.Service { + + /** + * Constructs a new ApiHub 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 ApiHub 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): ApiHub; + + /** + * Calls CreateApi. + * @param request CreateApiRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Api + */ + public createApi(request: google.cloud.apihub.v1.ICreateApiRequest, callback: google.cloud.apihub.v1.ApiHub.CreateApiCallback): void; + + /** + * Calls CreateApi. + * @param request CreateApiRequest message or plain object + * @returns Promise + */ + public createApi(request: google.cloud.apihub.v1.ICreateApiRequest): Promise; + + /** + * Calls GetApi. + * @param request GetApiRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Api + */ + public getApi(request: google.cloud.apihub.v1.IGetApiRequest, callback: google.cloud.apihub.v1.ApiHub.GetApiCallback): void; + + /** + * Calls GetApi. + * @param request GetApiRequest message or plain object + * @returns Promise + */ + public getApi(request: google.cloud.apihub.v1.IGetApiRequest): Promise; + + /** + * Calls ListApis. + * @param request ListApisRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListApisResponse + */ + public listApis(request: google.cloud.apihub.v1.IListApisRequest, callback: google.cloud.apihub.v1.ApiHub.ListApisCallback): void; + + /** + * Calls ListApis. + * @param request ListApisRequest message or plain object + * @returns Promise + */ + public listApis(request: google.cloud.apihub.v1.IListApisRequest): Promise; + + /** + * Calls UpdateApi. + * @param request UpdateApiRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Api + */ + public updateApi(request: google.cloud.apihub.v1.IUpdateApiRequest, callback: google.cloud.apihub.v1.ApiHub.UpdateApiCallback): void; + + /** + * Calls UpdateApi. + * @param request UpdateApiRequest message or plain object + * @returns Promise + */ + public updateApi(request: google.cloud.apihub.v1.IUpdateApiRequest): Promise; + + /** + * Calls DeleteApi. + * @param request DeleteApiRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteApi(request: google.cloud.apihub.v1.IDeleteApiRequest, callback: google.cloud.apihub.v1.ApiHub.DeleteApiCallback): void; + + /** + * Calls DeleteApi. + * @param request DeleteApiRequest message or plain object + * @returns Promise + */ + public deleteApi(request: google.cloud.apihub.v1.IDeleteApiRequest): Promise; + + /** + * Calls CreateVersion. + * @param request CreateVersionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Version + */ + public createVersion(request: google.cloud.apihub.v1.ICreateVersionRequest, callback: google.cloud.apihub.v1.ApiHub.CreateVersionCallback): void; + + /** + * Calls CreateVersion. + * @param request CreateVersionRequest message or plain object + * @returns Promise + */ + public createVersion(request: google.cloud.apihub.v1.ICreateVersionRequest): Promise; + + /** + * Calls GetVersion. + * @param request GetVersionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Version + */ + public getVersion(request: google.cloud.apihub.v1.IGetVersionRequest, callback: google.cloud.apihub.v1.ApiHub.GetVersionCallback): void; + + /** + * Calls GetVersion. + * @param request GetVersionRequest message or plain object + * @returns Promise + */ + public getVersion(request: google.cloud.apihub.v1.IGetVersionRequest): Promise; + + /** + * Calls ListVersions. + * @param request ListVersionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListVersionsResponse + */ + public listVersions(request: google.cloud.apihub.v1.IListVersionsRequest, callback: google.cloud.apihub.v1.ApiHub.ListVersionsCallback): void; + + /** + * Calls ListVersions. + * @param request ListVersionsRequest message or plain object + * @returns Promise + */ + public listVersions(request: google.cloud.apihub.v1.IListVersionsRequest): Promise; + + /** + * Calls UpdateVersion. + * @param request UpdateVersionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Version + */ + public updateVersion(request: google.cloud.apihub.v1.IUpdateVersionRequest, callback: google.cloud.apihub.v1.ApiHub.UpdateVersionCallback): void; + + /** + * Calls UpdateVersion. + * @param request UpdateVersionRequest message or plain object + * @returns Promise + */ + public updateVersion(request: google.cloud.apihub.v1.IUpdateVersionRequest): Promise; + + /** + * Calls DeleteVersion. + * @param request DeleteVersionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteVersion(request: google.cloud.apihub.v1.IDeleteVersionRequest, callback: google.cloud.apihub.v1.ApiHub.DeleteVersionCallback): void; + + /** + * Calls DeleteVersion. + * @param request DeleteVersionRequest message or plain object + * @returns Promise + */ + public deleteVersion(request: google.cloud.apihub.v1.IDeleteVersionRequest): Promise; + + /** + * Calls CreateSpec. + * @param request CreateSpecRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Spec + */ + public createSpec(request: google.cloud.apihub.v1.ICreateSpecRequest, callback: google.cloud.apihub.v1.ApiHub.CreateSpecCallback): void; + + /** + * Calls CreateSpec. + * @param request CreateSpecRequest message or plain object + * @returns Promise + */ + public createSpec(request: google.cloud.apihub.v1.ICreateSpecRequest): Promise; + + /** + * Calls GetSpec. + * @param request GetSpecRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Spec + */ + public getSpec(request: google.cloud.apihub.v1.IGetSpecRequest, callback: google.cloud.apihub.v1.ApiHub.GetSpecCallback): void; + + /** + * Calls GetSpec. + * @param request GetSpecRequest message or plain object + * @returns Promise + */ + public getSpec(request: google.cloud.apihub.v1.IGetSpecRequest): Promise; + + /** + * Calls GetSpecContents. + * @param request GetSpecContentsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SpecContents + */ + public getSpecContents(request: google.cloud.apihub.v1.IGetSpecContentsRequest, callback: google.cloud.apihub.v1.ApiHub.GetSpecContentsCallback): void; + + /** + * Calls GetSpecContents. + * @param request GetSpecContentsRequest message or plain object + * @returns Promise + */ + public getSpecContents(request: google.cloud.apihub.v1.IGetSpecContentsRequest): Promise; + + /** + * Calls ListSpecs. + * @param request ListSpecsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListSpecsResponse + */ + public listSpecs(request: google.cloud.apihub.v1.IListSpecsRequest, callback: google.cloud.apihub.v1.ApiHub.ListSpecsCallback): void; + + /** + * Calls ListSpecs. + * @param request ListSpecsRequest message or plain object + * @returns Promise + */ + public listSpecs(request: google.cloud.apihub.v1.IListSpecsRequest): Promise; + + /** + * Calls UpdateSpec. + * @param request UpdateSpecRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Spec + */ + public updateSpec(request: google.cloud.apihub.v1.IUpdateSpecRequest, callback: google.cloud.apihub.v1.ApiHub.UpdateSpecCallback): void; + + /** + * Calls UpdateSpec. + * @param request UpdateSpecRequest message or plain object + * @returns Promise + */ + public updateSpec(request: google.cloud.apihub.v1.IUpdateSpecRequest): Promise; + + /** + * Calls DeleteSpec. + * @param request DeleteSpecRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteSpec(request: google.cloud.apihub.v1.IDeleteSpecRequest, callback: google.cloud.apihub.v1.ApiHub.DeleteSpecCallback): void; + + /** + * Calls DeleteSpec. + * @param request DeleteSpecRequest message or plain object + * @returns Promise + */ + public deleteSpec(request: google.cloud.apihub.v1.IDeleteSpecRequest): Promise; + + /** + * Calls GetApiOperation. + * @param request GetApiOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ApiOperation + */ + public getApiOperation(request: google.cloud.apihub.v1.IGetApiOperationRequest, callback: google.cloud.apihub.v1.ApiHub.GetApiOperationCallback): void; + + /** + * Calls GetApiOperation. + * @param request GetApiOperationRequest message or plain object + * @returns Promise + */ + public getApiOperation(request: google.cloud.apihub.v1.IGetApiOperationRequest): Promise; + + /** + * Calls ListApiOperations. + * @param request ListApiOperationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListApiOperationsResponse + */ + public listApiOperations(request: google.cloud.apihub.v1.IListApiOperationsRequest, callback: google.cloud.apihub.v1.ApiHub.ListApiOperationsCallback): void; + + /** + * Calls ListApiOperations. + * @param request ListApiOperationsRequest message or plain object + * @returns Promise + */ + public listApiOperations(request: google.cloud.apihub.v1.IListApiOperationsRequest): Promise; + + /** + * Calls GetDefinition. + * @param request GetDefinitionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Definition + */ + public getDefinition(request: google.cloud.apihub.v1.IGetDefinitionRequest, callback: google.cloud.apihub.v1.ApiHub.GetDefinitionCallback): void; + + /** + * Calls GetDefinition. + * @param request GetDefinitionRequest message or plain object + * @returns Promise + */ + public getDefinition(request: google.cloud.apihub.v1.IGetDefinitionRequest): Promise; + + /** + * Calls CreateDeployment. + * @param request CreateDeploymentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Deployment + */ + public createDeployment(request: google.cloud.apihub.v1.ICreateDeploymentRequest, callback: google.cloud.apihub.v1.ApiHub.CreateDeploymentCallback): void; + + /** + * Calls CreateDeployment. + * @param request CreateDeploymentRequest message or plain object + * @returns Promise + */ + public createDeployment(request: google.cloud.apihub.v1.ICreateDeploymentRequest): Promise; + + /** + * Calls GetDeployment. + * @param request GetDeploymentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Deployment + */ + public getDeployment(request: google.cloud.apihub.v1.IGetDeploymentRequest, callback: google.cloud.apihub.v1.ApiHub.GetDeploymentCallback): void; + + /** + * Calls GetDeployment. + * @param request GetDeploymentRequest message or plain object + * @returns Promise + */ + public getDeployment(request: google.cloud.apihub.v1.IGetDeploymentRequest): Promise; + + /** + * Calls ListDeployments. + * @param request ListDeploymentsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListDeploymentsResponse + */ + public listDeployments(request: google.cloud.apihub.v1.IListDeploymentsRequest, callback: google.cloud.apihub.v1.ApiHub.ListDeploymentsCallback): void; + + /** + * Calls ListDeployments. + * @param request ListDeploymentsRequest message or plain object + * @returns Promise + */ + public listDeployments(request: google.cloud.apihub.v1.IListDeploymentsRequest): Promise; + + /** + * Calls UpdateDeployment. + * @param request UpdateDeploymentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Deployment + */ + public updateDeployment(request: google.cloud.apihub.v1.IUpdateDeploymentRequest, callback: google.cloud.apihub.v1.ApiHub.UpdateDeploymentCallback): void; + + /** + * Calls UpdateDeployment. + * @param request UpdateDeploymentRequest message or plain object + * @returns Promise + */ + public updateDeployment(request: google.cloud.apihub.v1.IUpdateDeploymentRequest): Promise; + + /** + * Calls DeleteDeployment. + * @param request DeleteDeploymentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteDeployment(request: google.cloud.apihub.v1.IDeleteDeploymentRequest, callback: google.cloud.apihub.v1.ApiHub.DeleteDeploymentCallback): void; + + /** + * Calls DeleteDeployment. + * @param request DeleteDeploymentRequest message or plain object + * @returns Promise + */ + public deleteDeployment(request: google.cloud.apihub.v1.IDeleteDeploymentRequest): Promise; + + /** + * Calls CreateAttribute. + * @param request CreateAttributeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Attribute + */ + public createAttribute(request: google.cloud.apihub.v1.ICreateAttributeRequest, callback: google.cloud.apihub.v1.ApiHub.CreateAttributeCallback): void; + + /** + * Calls CreateAttribute. + * @param request CreateAttributeRequest message or plain object + * @returns Promise + */ + public createAttribute(request: google.cloud.apihub.v1.ICreateAttributeRequest): Promise; + + /** + * Calls GetAttribute. + * @param request GetAttributeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Attribute + */ + public getAttribute(request: google.cloud.apihub.v1.IGetAttributeRequest, callback: google.cloud.apihub.v1.ApiHub.GetAttributeCallback): void; + + /** + * Calls GetAttribute. + * @param request GetAttributeRequest message or plain object + * @returns Promise + */ + public getAttribute(request: google.cloud.apihub.v1.IGetAttributeRequest): Promise; + + /** + * Calls UpdateAttribute. + * @param request UpdateAttributeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Attribute + */ + public updateAttribute(request: google.cloud.apihub.v1.IUpdateAttributeRequest, callback: google.cloud.apihub.v1.ApiHub.UpdateAttributeCallback): void; + + /** + * Calls UpdateAttribute. + * @param request UpdateAttributeRequest message or plain object + * @returns Promise + */ + public updateAttribute(request: google.cloud.apihub.v1.IUpdateAttributeRequest): Promise; + + /** + * Calls DeleteAttribute. + * @param request DeleteAttributeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteAttribute(request: google.cloud.apihub.v1.IDeleteAttributeRequest, callback: google.cloud.apihub.v1.ApiHub.DeleteAttributeCallback): void; + + /** + * Calls DeleteAttribute. + * @param request DeleteAttributeRequest message or plain object + * @returns Promise + */ + public deleteAttribute(request: google.cloud.apihub.v1.IDeleteAttributeRequest): Promise; + + /** + * Calls ListAttributes. + * @param request ListAttributesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListAttributesResponse + */ + public listAttributes(request: google.cloud.apihub.v1.IListAttributesRequest, callback: google.cloud.apihub.v1.ApiHub.ListAttributesCallback): void; + + /** + * Calls ListAttributes. + * @param request ListAttributesRequest message or plain object + * @returns Promise + */ + public listAttributes(request: google.cloud.apihub.v1.IListAttributesRequest): Promise; + + /** + * Calls SearchResources. + * @param request SearchResourcesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SearchResourcesResponse + */ + public searchResources(request: google.cloud.apihub.v1.ISearchResourcesRequest, callback: google.cloud.apihub.v1.ApiHub.SearchResourcesCallback): void; + + /** + * Calls SearchResources. + * @param request SearchResourcesRequest message or plain object + * @returns Promise + */ + public searchResources(request: google.cloud.apihub.v1.ISearchResourcesRequest): Promise; + + /** + * Calls CreateExternalApi. + * @param request CreateExternalApiRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ExternalApi + */ + public createExternalApi(request: google.cloud.apihub.v1.ICreateExternalApiRequest, callback: google.cloud.apihub.v1.ApiHub.CreateExternalApiCallback): void; + + /** + * Calls CreateExternalApi. + * @param request CreateExternalApiRequest message or plain object + * @returns Promise + */ + public createExternalApi(request: google.cloud.apihub.v1.ICreateExternalApiRequest): Promise; + + /** + * Calls GetExternalApi. + * @param request GetExternalApiRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ExternalApi + */ + public getExternalApi(request: google.cloud.apihub.v1.IGetExternalApiRequest, callback: google.cloud.apihub.v1.ApiHub.GetExternalApiCallback): void; + + /** + * Calls GetExternalApi. + * @param request GetExternalApiRequest message or plain object + * @returns Promise + */ + public getExternalApi(request: google.cloud.apihub.v1.IGetExternalApiRequest): Promise; + + /** + * Calls UpdateExternalApi. + * @param request UpdateExternalApiRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ExternalApi + */ + public updateExternalApi(request: google.cloud.apihub.v1.IUpdateExternalApiRequest, callback: google.cloud.apihub.v1.ApiHub.UpdateExternalApiCallback): void; + + /** + * Calls UpdateExternalApi. + * @param request UpdateExternalApiRequest message or plain object + * @returns Promise + */ + public updateExternalApi(request: google.cloud.apihub.v1.IUpdateExternalApiRequest): Promise; + + /** + * Calls DeleteExternalApi. + * @param request DeleteExternalApiRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteExternalApi(request: google.cloud.apihub.v1.IDeleteExternalApiRequest, callback: google.cloud.apihub.v1.ApiHub.DeleteExternalApiCallback): void; + + /** + * Calls DeleteExternalApi. + * @param request DeleteExternalApiRequest message or plain object + * @returns Promise + */ + public deleteExternalApi(request: google.cloud.apihub.v1.IDeleteExternalApiRequest): Promise; + + /** + * Calls ListExternalApis. + * @param request ListExternalApisRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListExternalApisResponse + */ + public listExternalApis(request: google.cloud.apihub.v1.IListExternalApisRequest, callback: google.cloud.apihub.v1.ApiHub.ListExternalApisCallback): void; + + /** + * Calls ListExternalApis. + * @param request ListExternalApisRequest message or plain object + * @returns Promise + */ + public listExternalApis(request: google.cloud.apihub.v1.IListExternalApisRequest): Promise; + } + + namespace ApiHub { + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|createApi}. + * @param error Error, if any + * @param [response] Api + */ + type CreateApiCallback = (error: (Error|null), response?: google.cloud.apihub.v1.Api) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|getApi}. + * @param error Error, if any + * @param [response] Api + */ + type GetApiCallback = (error: (Error|null), response?: google.cloud.apihub.v1.Api) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|listApis}. + * @param error Error, if any + * @param [response] ListApisResponse + */ + type ListApisCallback = (error: (Error|null), response?: google.cloud.apihub.v1.ListApisResponse) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|updateApi}. + * @param error Error, if any + * @param [response] Api + */ + type UpdateApiCallback = (error: (Error|null), response?: google.cloud.apihub.v1.Api) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|deleteApi}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteApiCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|createVersion}. + * @param error Error, if any + * @param [response] Version + */ + type CreateVersionCallback = (error: (Error|null), response?: google.cloud.apihub.v1.Version) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|getVersion}. + * @param error Error, if any + * @param [response] Version + */ + type GetVersionCallback = (error: (Error|null), response?: google.cloud.apihub.v1.Version) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|listVersions}. + * @param error Error, if any + * @param [response] ListVersionsResponse + */ + type ListVersionsCallback = (error: (Error|null), response?: google.cloud.apihub.v1.ListVersionsResponse) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|updateVersion}. + * @param error Error, if any + * @param [response] Version + */ + type UpdateVersionCallback = (error: (Error|null), response?: google.cloud.apihub.v1.Version) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|deleteVersion}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteVersionCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|createSpec}. + * @param error Error, if any + * @param [response] Spec + */ + type CreateSpecCallback = (error: (Error|null), response?: google.cloud.apihub.v1.Spec) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|getSpec}. + * @param error Error, if any + * @param [response] Spec + */ + type GetSpecCallback = (error: (Error|null), response?: google.cloud.apihub.v1.Spec) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|getSpecContents}. + * @param error Error, if any + * @param [response] SpecContents + */ + type GetSpecContentsCallback = (error: (Error|null), response?: google.cloud.apihub.v1.SpecContents) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|listSpecs}. + * @param error Error, if any + * @param [response] ListSpecsResponse + */ + type ListSpecsCallback = (error: (Error|null), response?: google.cloud.apihub.v1.ListSpecsResponse) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|updateSpec}. + * @param error Error, if any + * @param [response] Spec + */ + type UpdateSpecCallback = (error: (Error|null), response?: google.cloud.apihub.v1.Spec) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|deleteSpec}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteSpecCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|getApiOperation}. + * @param error Error, if any + * @param [response] ApiOperation + */ + type GetApiOperationCallback = (error: (Error|null), response?: google.cloud.apihub.v1.ApiOperation) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|listApiOperations}. + * @param error Error, if any + * @param [response] ListApiOperationsResponse + */ + type ListApiOperationsCallback = (error: (Error|null), response?: google.cloud.apihub.v1.ListApiOperationsResponse) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|getDefinition}. + * @param error Error, if any + * @param [response] Definition + */ + type GetDefinitionCallback = (error: (Error|null), response?: google.cloud.apihub.v1.Definition) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|createDeployment}. + * @param error Error, if any + * @param [response] Deployment + */ + type CreateDeploymentCallback = (error: (Error|null), response?: google.cloud.apihub.v1.Deployment) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|getDeployment}. + * @param error Error, if any + * @param [response] Deployment + */ + type GetDeploymentCallback = (error: (Error|null), response?: google.cloud.apihub.v1.Deployment) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|listDeployments}. + * @param error Error, if any + * @param [response] ListDeploymentsResponse + */ + type ListDeploymentsCallback = (error: (Error|null), response?: google.cloud.apihub.v1.ListDeploymentsResponse) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|updateDeployment}. + * @param error Error, if any + * @param [response] Deployment + */ + type UpdateDeploymentCallback = (error: (Error|null), response?: google.cloud.apihub.v1.Deployment) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|deleteDeployment}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteDeploymentCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|createAttribute}. + * @param error Error, if any + * @param [response] Attribute + */ + type CreateAttributeCallback = (error: (Error|null), response?: google.cloud.apihub.v1.Attribute) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|getAttribute}. + * @param error Error, if any + * @param [response] Attribute + */ + type GetAttributeCallback = (error: (Error|null), response?: google.cloud.apihub.v1.Attribute) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|updateAttribute}. + * @param error Error, if any + * @param [response] Attribute + */ + type UpdateAttributeCallback = (error: (Error|null), response?: google.cloud.apihub.v1.Attribute) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|deleteAttribute}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteAttributeCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|listAttributes}. + * @param error Error, if any + * @param [response] ListAttributesResponse + */ + type ListAttributesCallback = (error: (Error|null), response?: google.cloud.apihub.v1.ListAttributesResponse) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|searchResources}. + * @param error Error, if any + * @param [response] SearchResourcesResponse + */ + type SearchResourcesCallback = (error: (Error|null), response?: google.cloud.apihub.v1.SearchResourcesResponse) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|createExternalApi}. + * @param error Error, if any + * @param [response] ExternalApi + */ + type CreateExternalApiCallback = (error: (Error|null), response?: google.cloud.apihub.v1.ExternalApi) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|getExternalApi}. + * @param error Error, if any + * @param [response] ExternalApi + */ + type GetExternalApiCallback = (error: (Error|null), response?: google.cloud.apihub.v1.ExternalApi) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|updateExternalApi}. + * @param error Error, if any + * @param [response] ExternalApi + */ + type UpdateExternalApiCallback = (error: (Error|null), response?: google.cloud.apihub.v1.ExternalApi) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|deleteExternalApi}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteExternalApiCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|listExternalApis}. + * @param error Error, if any + * @param [response] ListExternalApisResponse + */ + type ListExternalApisCallback = (error: (Error|null), response?: google.cloud.apihub.v1.ListExternalApisResponse) => void; + } + + /** Represents an ApiHubDependencies */ + class ApiHubDependencies extends $protobuf.rpc.Service { + + /** + * Constructs a new ApiHubDependencies 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 ApiHubDependencies 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): ApiHubDependencies; + + /** + * Calls CreateDependency. + * @param request CreateDependencyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Dependency + */ + public createDependency(request: google.cloud.apihub.v1.ICreateDependencyRequest, callback: google.cloud.apihub.v1.ApiHubDependencies.CreateDependencyCallback): void; + + /** + * Calls CreateDependency. + * @param request CreateDependencyRequest message or plain object + * @returns Promise + */ + public createDependency(request: google.cloud.apihub.v1.ICreateDependencyRequest): Promise; + + /** + * Calls GetDependency. + * @param request GetDependencyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Dependency + */ + public getDependency(request: google.cloud.apihub.v1.IGetDependencyRequest, callback: google.cloud.apihub.v1.ApiHubDependencies.GetDependencyCallback): void; + + /** + * Calls GetDependency. + * @param request GetDependencyRequest message or plain object + * @returns Promise + */ + public getDependency(request: google.cloud.apihub.v1.IGetDependencyRequest): Promise; + + /** + * Calls UpdateDependency. + * @param request UpdateDependencyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Dependency + */ + public updateDependency(request: google.cloud.apihub.v1.IUpdateDependencyRequest, callback: google.cloud.apihub.v1.ApiHubDependencies.UpdateDependencyCallback): void; + + /** + * Calls UpdateDependency. + * @param request UpdateDependencyRequest message or plain object + * @returns Promise + */ + public updateDependency(request: google.cloud.apihub.v1.IUpdateDependencyRequest): Promise; + + /** + * Calls DeleteDependency. + * @param request DeleteDependencyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteDependency(request: google.cloud.apihub.v1.IDeleteDependencyRequest, callback: google.cloud.apihub.v1.ApiHubDependencies.DeleteDependencyCallback): void; + + /** + * Calls DeleteDependency. + * @param request DeleteDependencyRequest message or plain object + * @returns Promise + */ + public deleteDependency(request: google.cloud.apihub.v1.IDeleteDependencyRequest): Promise; + + /** + * Calls ListDependencies. + * @param request ListDependenciesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListDependenciesResponse + */ + public listDependencies(request: google.cloud.apihub.v1.IListDependenciesRequest, callback: google.cloud.apihub.v1.ApiHubDependencies.ListDependenciesCallback): void; + + /** + * Calls ListDependencies. + * @param request ListDependenciesRequest message or plain object + * @returns Promise + */ + public listDependencies(request: google.cloud.apihub.v1.IListDependenciesRequest): Promise; + } + + namespace ApiHubDependencies { + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHubDependencies|createDependency}. + * @param error Error, if any + * @param [response] Dependency + */ + type CreateDependencyCallback = (error: (Error|null), response?: google.cloud.apihub.v1.Dependency) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHubDependencies|getDependency}. + * @param error Error, if any + * @param [response] Dependency + */ + type GetDependencyCallback = (error: (Error|null), response?: google.cloud.apihub.v1.Dependency) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHubDependencies|updateDependency}. + * @param error Error, if any + * @param [response] Dependency + */ + type UpdateDependencyCallback = (error: (Error|null), response?: google.cloud.apihub.v1.Dependency) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHubDependencies|deleteDependency}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteDependencyCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHubDependencies|listDependencies}. + * @param error Error, if any + * @param [response] ListDependenciesResponse + */ + type ListDependenciesCallback = (error: (Error|null), response?: google.cloud.apihub.v1.ListDependenciesResponse) => void; + } + + /** Properties of a CreateApiRequest. */ + interface ICreateApiRequest { + + /** CreateApiRequest parent */ + parent?: (string|null); + + /** CreateApiRequest apiId */ + apiId?: (string|null); + + /** CreateApiRequest api */ + api?: (google.cloud.apihub.v1.IApi|null); + } + + /** Represents a CreateApiRequest. */ + class CreateApiRequest implements ICreateApiRequest { + + /** + * Constructs a new CreateApiRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.ICreateApiRequest); + + /** CreateApiRequest parent. */ + public parent: string; + + /** CreateApiRequest apiId. */ + public apiId: string; + + /** CreateApiRequest api. */ + public api?: (google.cloud.apihub.v1.IApi|null); + + /** + * Creates a new CreateApiRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateApiRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.ICreateApiRequest): google.cloud.apihub.v1.CreateApiRequest; + + /** + * Encodes the specified CreateApiRequest message. Does not implicitly {@link google.cloud.apihub.v1.CreateApiRequest.verify|verify} messages. + * @param message CreateApiRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.ICreateApiRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateApiRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.CreateApiRequest.verify|verify} messages. + * @param message CreateApiRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.ICreateApiRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateApiRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateApiRequest + * @throws {Error} If the payload is not 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.apihub.v1.CreateApiRequest; + + /** + * Decodes a CreateApiRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateApiRequest + * @throws {Error} If the payload 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.apihub.v1.CreateApiRequest; + + /** + * Verifies a CreateApiRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateApiRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateApiRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.CreateApiRequest; + + /** + * Creates a plain object from a CreateApiRequest message. Also converts values to other types if specified. + * @param message CreateApiRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.CreateApiRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateApiRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateApiRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetApiRequest. */ + interface IGetApiRequest { + + /** GetApiRequest name */ + name?: (string|null); + } + + /** Represents a GetApiRequest. */ + class GetApiRequest implements IGetApiRequest { + + /** + * Constructs a new GetApiRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IGetApiRequest); + + /** GetApiRequest name. */ + public name: string; + + /** + * Creates a new GetApiRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetApiRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.IGetApiRequest): google.cloud.apihub.v1.GetApiRequest; + + /** + * Encodes the specified GetApiRequest message. Does not implicitly {@link google.cloud.apihub.v1.GetApiRequest.verify|verify} messages. + * @param message GetApiRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IGetApiRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetApiRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.GetApiRequest.verify|verify} messages. + * @param message GetApiRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IGetApiRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetApiRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetApiRequest + * @throws {Error} If the payload is not 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.apihub.v1.GetApiRequest; + + /** + * Decodes a GetApiRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetApiRequest + * @throws {Error} If the payload 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.apihub.v1.GetApiRequest; + + /** + * Verifies a GetApiRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetApiRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetApiRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.GetApiRequest; + + /** + * Creates a plain object from a GetApiRequest message. Also converts values to other types if specified. + * @param message GetApiRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.GetApiRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetApiRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetApiRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateApiRequest. */ + interface IUpdateApiRequest { + + /** UpdateApiRequest api */ + api?: (google.cloud.apihub.v1.IApi|null); + + /** UpdateApiRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateApiRequest. */ + class UpdateApiRequest implements IUpdateApiRequest { + + /** + * Constructs a new UpdateApiRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IUpdateApiRequest); + + /** UpdateApiRequest api. */ + public api?: (google.cloud.apihub.v1.IApi|null); + + /** UpdateApiRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateApiRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateApiRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.IUpdateApiRequest): google.cloud.apihub.v1.UpdateApiRequest; + + /** + * Encodes the specified UpdateApiRequest message. Does not implicitly {@link google.cloud.apihub.v1.UpdateApiRequest.verify|verify} messages. + * @param message UpdateApiRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IUpdateApiRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateApiRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.UpdateApiRequest.verify|verify} messages. + * @param message UpdateApiRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IUpdateApiRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateApiRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateApiRequest + * @throws {Error} If the payload is not 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.apihub.v1.UpdateApiRequest; + + /** + * Decodes an UpdateApiRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateApiRequest + * @throws {Error} If the payload 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.apihub.v1.UpdateApiRequest; + + /** + * Verifies an UpdateApiRequest message. + * @param message Plain 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 UpdateApiRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateApiRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.UpdateApiRequest; + + /** + * Creates a plain object from an UpdateApiRequest message. Also converts values to other types if specified. + * @param message UpdateApiRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.UpdateApiRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateApiRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateApiRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteApiRequest. */ + interface IDeleteApiRequest { + + /** DeleteApiRequest name */ + name?: (string|null); + + /** DeleteApiRequest force */ + force?: (boolean|null); + } + + /** Represents a DeleteApiRequest. */ + class DeleteApiRequest implements IDeleteApiRequest { + + /** + * Constructs a new DeleteApiRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IDeleteApiRequest); + + /** DeleteApiRequest name. */ + public name: string; + + /** DeleteApiRequest force. */ + public force: boolean; + + /** + * Creates a new DeleteApiRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteApiRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.IDeleteApiRequest): google.cloud.apihub.v1.DeleteApiRequest; + + /** + * Encodes the specified DeleteApiRequest message. Does not implicitly {@link google.cloud.apihub.v1.DeleteApiRequest.verify|verify} messages. + * @param message DeleteApiRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IDeleteApiRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteApiRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.DeleteApiRequest.verify|verify} messages. + * @param message DeleteApiRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IDeleteApiRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteApiRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteApiRequest + * @throws {Error} If the payload is not 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.apihub.v1.DeleteApiRequest; + + /** + * Decodes a DeleteApiRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteApiRequest + * @throws {Error} If the payload 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.apihub.v1.DeleteApiRequest; + + /** + * Verifies a DeleteApiRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteApiRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteApiRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.DeleteApiRequest; + + /** + * Creates a plain object from a DeleteApiRequest message. Also converts values to other types if specified. + * @param message DeleteApiRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.DeleteApiRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteApiRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteApiRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListApisRequest. */ + interface IListApisRequest { + + /** ListApisRequest parent */ + parent?: (string|null); + + /** ListApisRequest filter */ + filter?: (string|null); + + /** ListApisRequest pageSize */ + pageSize?: (number|null); + + /** ListApisRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListApisRequest. */ + class ListApisRequest implements IListApisRequest { + + /** + * Constructs a new ListApisRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IListApisRequest); + + /** ListApisRequest parent. */ + public parent: string; + + /** ListApisRequest filter. */ + public filter: string; + + /** ListApisRequest pageSize. */ + public pageSize: number; + + /** ListApisRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListApisRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListApisRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.IListApisRequest): google.cloud.apihub.v1.ListApisRequest; + + /** + * Encodes the specified ListApisRequest message. Does not implicitly {@link google.cloud.apihub.v1.ListApisRequest.verify|verify} messages. + * @param message ListApisRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IListApisRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListApisRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListApisRequest.verify|verify} messages. + * @param message ListApisRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IListApisRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListApisRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListApisRequest + * @throws {Error} If the payload is not 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.apihub.v1.ListApisRequest; + + /** + * Decodes a ListApisRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListApisRequest + * @throws {Error} If the payload 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.apihub.v1.ListApisRequest; + + /** + * Verifies a ListApisRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListApisRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListApisRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.ListApisRequest; + + /** + * Creates a plain object from a ListApisRequest message. Also converts values to other types if specified. + * @param message ListApisRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.ListApisRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListApisRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListApisRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListApisResponse. */ + interface IListApisResponse { + + /** ListApisResponse apis */ + apis?: (google.cloud.apihub.v1.IApi[]|null); + + /** ListApisResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListApisResponse. */ + class ListApisResponse implements IListApisResponse { + + /** + * Constructs a new ListApisResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IListApisResponse); + + /** ListApisResponse apis. */ + public apis: google.cloud.apihub.v1.IApi[]; + + /** ListApisResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListApisResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListApisResponse instance + */ + public static create(properties?: google.cloud.apihub.v1.IListApisResponse): google.cloud.apihub.v1.ListApisResponse; + + /** + * Encodes the specified ListApisResponse message. Does not implicitly {@link google.cloud.apihub.v1.ListApisResponse.verify|verify} messages. + * @param message ListApisResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IListApisResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListApisResponse message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListApisResponse.verify|verify} messages. + * @param message ListApisResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IListApisResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListApisResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListApisResponse + * @throws {Error} If the payload is not 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.apihub.v1.ListApisResponse; + + /** + * Decodes a ListApisResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListApisResponse + * @throws {Error} If the payload 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.apihub.v1.ListApisResponse; + + /** + * Verifies a ListApisResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListApisResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListApisResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.ListApisResponse; + + /** + * Creates a plain object from a ListApisResponse message. Also converts values to other types if specified. + * @param message ListApisResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.ListApisResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListApisResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListApisResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateVersionRequest. */ + interface ICreateVersionRequest { + + /** CreateVersionRequest parent */ + parent?: (string|null); + + /** CreateVersionRequest versionId */ + versionId?: (string|null); + + /** CreateVersionRequest version */ + version?: (google.cloud.apihub.v1.IVersion|null); + } + + /** Represents a CreateVersionRequest. */ + class CreateVersionRequest implements ICreateVersionRequest { + + /** + * Constructs a new CreateVersionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.ICreateVersionRequest); + + /** CreateVersionRequest parent. */ + public parent: string; + + /** CreateVersionRequest versionId. */ + public versionId: string; + + /** CreateVersionRequest version. */ + public version?: (google.cloud.apihub.v1.IVersion|null); + + /** + * Creates a new CreateVersionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateVersionRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.ICreateVersionRequest): google.cloud.apihub.v1.CreateVersionRequest; + + /** + * Encodes the specified CreateVersionRequest message. Does not implicitly {@link google.cloud.apihub.v1.CreateVersionRequest.verify|verify} messages. + * @param message CreateVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.ICreateVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateVersionRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.CreateVersionRequest.verify|verify} messages. + * @param message CreateVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.ICreateVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateVersionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateVersionRequest + * @throws {Error} If the payload is not 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.apihub.v1.CreateVersionRequest; + + /** + * Decodes a CreateVersionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateVersionRequest + * @throws {Error} If the payload 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.apihub.v1.CreateVersionRequest; + + /** + * Verifies a CreateVersionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateVersionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateVersionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.CreateVersionRequest; + + /** + * Creates a plain object from a CreateVersionRequest message. Also converts values to other types if specified. + * @param message CreateVersionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.CreateVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateVersionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateVersionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetVersionRequest. */ + interface IGetVersionRequest { + + /** GetVersionRequest name */ + name?: (string|null); + } + + /** Represents a GetVersionRequest. */ + class GetVersionRequest implements IGetVersionRequest { + + /** + * Constructs a new GetVersionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IGetVersionRequest); + + /** GetVersionRequest name. */ + public name: string; + + /** + * Creates a new GetVersionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetVersionRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.IGetVersionRequest): google.cloud.apihub.v1.GetVersionRequest; + + /** + * Encodes the specified GetVersionRequest message. Does not implicitly {@link google.cloud.apihub.v1.GetVersionRequest.verify|verify} messages. + * @param message GetVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IGetVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetVersionRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.GetVersionRequest.verify|verify} messages. + * @param message GetVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IGetVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetVersionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetVersionRequest + * @throws {Error} If the payload is not 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.apihub.v1.GetVersionRequest; + + /** + * Decodes a GetVersionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetVersionRequest + * @throws {Error} If the payload 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.apihub.v1.GetVersionRequest; + + /** + * Verifies a GetVersionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetVersionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetVersionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.GetVersionRequest; + + /** + * Creates a plain object from a GetVersionRequest message. Also converts values to other types if specified. + * @param message GetVersionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.GetVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetVersionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetVersionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateVersionRequest. */ + interface IUpdateVersionRequest { + + /** UpdateVersionRequest version */ + version?: (google.cloud.apihub.v1.IVersion|null); + + /** UpdateVersionRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateVersionRequest. */ + class UpdateVersionRequest implements IUpdateVersionRequest { + + /** + * Constructs a new UpdateVersionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IUpdateVersionRequest); + + /** UpdateVersionRequest version. */ + public version?: (google.cloud.apihub.v1.IVersion|null); + + /** UpdateVersionRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateVersionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateVersionRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.IUpdateVersionRequest): google.cloud.apihub.v1.UpdateVersionRequest; + + /** + * Encodes the specified UpdateVersionRequest message. Does not implicitly {@link google.cloud.apihub.v1.UpdateVersionRequest.verify|verify} messages. + * @param message UpdateVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IUpdateVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateVersionRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.UpdateVersionRequest.verify|verify} messages. + * @param message UpdateVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IUpdateVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateVersionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateVersionRequest + * @throws {Error} If the payload is not 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.apihub.v1.UpdateVersionRequest; + + /** + * Decodes an UpdateVersionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateVersionRequest + * @throws {Error} If the payload 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.apihub.v1.UpdateVersionRequest; + + /** + * Verifies an UpdateVersionRequest message. + * @param message Plain 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 UpdateVersionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateVersionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.UpdateVersionRequest; + + /** + * Creates a plain object from an UpdateVersionRequest message. Also converts values to other types if specified. + * @param message UpdateVersionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.UpdateVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateVersionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateVersionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteVersionRequest. */ + interface IDeleteVersionRequest { + + /** DeleteVersionRequest name */ + name?: (string|null); + + /** DeleteVersionRequest force */ + force?: (boolean|null); + } + + /** Represents a DeleteVersionRequest. */ + class DeleteVersionRequest implements IDeleteVersionRequest { + + /** + * Constructs a new DeleteVersionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IDeleteVersionRequest); + + /** DeleteVersionRequest name. */ + public name: string; + + /** DeleteVersionRequest force. */ + public force: boolean; + + /** + * Creates a new DeleteVersionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteVersionRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.IDeleteVersionRequest): google.cloud.apihub.v1.DeleteVersionRequest; + + /** + * Encodes the specified DeleteVersionRequest message. Does not implicitly {@link google.cloud.apihub.v1.DeleteVersionRequest.verify|verify} messages. + * @param message DeleteVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IDeleteVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteVersionRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.DeleteVersionRequest.verify|verify} messages. + * @param message DeleteVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IDeleteVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteVersionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteVersionRequest + * @throws {Error} If the payload is not 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.apihub.v1.DeleteVersionRequest; + + /** + * Decodes a DeleteVersionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteVersionRequest + * @throws {Error} If the payload 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.apihub.v1.DeleteVersionRequest; + + /** + * Verifies a DeleteVersionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteVersionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteVersionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.DeleteVersionRequest; + + /** + * Creates a plain object from a DeleteVersionRequest message. Also converts values to other types if specified. + * @param message DeleteVersionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.DeleteVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteVersionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteVersionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListVersionsRequest. */ + interface IListVersionsRequest { + + /** ListVersionsRequest parent */ + parent?: (string|null); + + /** ListVersionsRequest filter */ + filter?: (string|null); + + /** ListVersionsRequest pageSize */ + pageSize?: (number|null); + + /** ListVersionsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListVersionsRequest. */ + class ListVersionsRequest implements IListVersionsRequest { + + /** + * Constructs a new ListVersionsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IListVersionsRequest); + + /** ListVersionsRequest parent. */ + public parent: string; + + /** ListVersionsRequest filter. */ + public filter: string; + + /** ListVersionsRequest pageSize. */ + public pageSize: number; + + /** ListVersionsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListVersionsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListVersionsRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.IListVersionsRequest): google.cloud.apihub.v1.ListVersionsRequest; + + /** + * Encodes the specified ListVersionsRequest message. Does not implicitly {@link google.cloud.apihub.v1.ListVersionsRequest.verify|verify} messages. + * @param message ListVersionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IListVersionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListVersionsRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListVersionsRequest.verify|verify} messages. + * @param message ListVersionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IListVersionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListVersionsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListVersionsRequest + * @throws {Error} If the payload is not 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.apihub.v1.ListVersionsRequest; + + /** + * Decodes a ListVersionsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListVersionsRequest + * @throws {Error} If the payload 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.apihub.v1.ListVersionsRequest; + + /** + * Verifies a ListVersionsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListVersionsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListVersionsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.ListVersionsRequest; + + /** + * Creates a plain object from a ListVersionsRequest message. Also converts values to other types if specified. + * @param message ListVersionsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.ListVersionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListVersionsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListVersionsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListVersionsResponse. */ + interface IListVersionsResponse { + + /** ListVersionsResponse versions */ + versions?: (google.cloud.apihub.v1.IVersion[]|null); + + /** ListVersionsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListVersionsResponse. */ + class ListVersionsResponse implements IListVersionsResponse { + + /** + * Constructs a new ListVersionsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IListVersionsResponse); + + /** ListVersionsResponse versions. */ + public versions: google.cloud.apihub.v1.IVersion[]; + + /** ListVersionsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListVersionsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListVersionsResponse instance + */ + public static create(properties?: google.cloud.apihub.v1.IListVersionsResponse): google.cloud.apihub.v1.ListVersionsResponse; + + /** + * Encodes the specified ListVersionsResponse message. Does not implicitly {@link google.cloud.apihub.v1.ListVersionsResponse.verify|verify} messages. + * @param message ListVersionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IListVersionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListVersionsResponse message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListVersionsResponse.verify|verify} messages. + * @param message ListVersionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IListVersionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListVersionsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListVersionsResponse + * @throws {Error} If the payload is not 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.apihub.v1.ListVersionsResponse; + + /** + * Decodes a ListVersionsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListVersionsResponse + * @throws {Error} If the payload 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.apihub.v1.ListVersionsResponse; + + /** + * Verifies a ListVersionsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListVersionsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListVersionsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.ListVersionsResponse; + + /** + * Creates a plain object from a ListVersionsResponse message. Also converts values to other types if specified. + * @param message ListVersionsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.ListVersionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListVersionsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListVersionsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateSpecRequest. */ + interface ICreateSpecRequest { + + /** CreateSpecRequest parent */ + parent?: (string|null); + + /** CreateSpecRequest specId */ + specId?: (string|null); + + /** CreateSpecRequest spec */ + spec?: (google.cloud.apihub.v1.ISpec|null); + } + + /** Represents a CreateSpecRequest. */ + class CreateSpecRequest implements ICreateSpecRequest { + + /** + * Constructs a new CreateSpecRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.ICreateSpecRequest); + + /** CreateSpecRequest parent. */ + public parent: string; + + /** CreateSpecRequest specId. */ + public specId: string; + + /** CreateSpecRequest spec. */ + public spec?: (google.cloud.apihub.v1.ISpec|null); + + /** + * Creates a new CreateSpecRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateSpecRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.ICreateSpecRequest): google.cloud.apihub.v1.CreateSpecRequest; + + /** + * Encodes the specified CreateSpecRequest message. Does not implicitly {@link google.cloud.apihub.v1.CreateSpecRequest.verify|verify} messages. + * @param message CreateSpecRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.ICreateSpecRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateSpecRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.CreateSpecRequest.verify|verify} messages. + * @param message CreateSpecRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.ICreateSpecRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateSpecRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateSpecRequest + * @throws {Error} If the payload is not 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.apihub.v1.CreateSpecRequest; + + /** + * Decodes a CreateSpecRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateSpecRequest + * @throws {Error} If the payload 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.apihub.v1.CreateSpecRequest; + + /** + * Verifies a CreateSpecRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateSpecRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateSpecRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.CreateSpecRequest; + + /** + * Creates a plain object from a CreateSpecRequest message. Also converts values to other types if specified. + * @param message CreateSpecRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.CreateSpecRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateSpecRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateSpecRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetSpecRequest. */ + interface IGetSpecRequest { + + /** GetSpecRequest name */ + name?: (string|null); + } + + /** Represents a GetSpecRequest. */ + class GetSpecRequest implements IGetSpecRequest { + + /** + * Constructs a new GetSpecRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IGetSpecRequest); + + /** GetSpecRequest name. */ + public name: string; + + /** + * Creates a new GetSpecRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetSpecRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.IGetSpecRequest): google.cloud.apihub.v1.GetSpecRequest; + + /** + * Encodes the specified GetSpecRequest message. Does not implicitly {@link google.cloud.apihub.v1.GetSpecRequest.verify|verify} messages. + * @param message GetSpecRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IGetSpecRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetSpecRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.GetSpecRequest.verify|verify} messages. + * @param message GetSpecRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IGetSpecRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetSpecRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetSpecRequest + * @throws {Error} If the payload is not 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.apihub.v1.GetSpecRequest; + + /** + * Decodes a GetSpecRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetSpecRequest + * @throws {Error} If the payload 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.apihub.v1.GetSpecRequest; + + /** + * Verifies a GetSpecRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetSpecRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetSpecRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.GetSpecRequest; + + /** + * Creates a plain object from a GetSpecRequest message. Also converts values to other types if specified. + * @param message GetSpecRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.GetSpecRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetSpecRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetSpecRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateSpecRequest. */ + interface IUpdateSpecRequest { + + /** UpdateSpecRequest spec */ + spec?: (google.cloud.apihub.v1.ISpec|null); + + /** UpdateSpecRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateSpecRequest. */ + class UpdateSpecRequest implements IUpdateSpecRequest { + + /** + * Constructs a new UpdateSpecRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IUpdateSpecRequest); + + /** UpdateSpecRequest spec. */ + public spec?: (google.cloud.apihub.v1.ISpec|null); + + /** UpdateSpecRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateSpecRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateSpecRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.IUpdateSpecRequest): google.cloud.apihub.v1.UpdateSpecRequest; + + /** + * Encodes the specified UpdateSpecRequest message. Does not implicitly {@link google.cloud.apihub.v1.UpdateSpecRequest.verify|verify} messages. + * @param message UpdateSpecRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IUpdateSpecRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateSpecRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.UpdateSpecRequest.verify|verify} messages. + * @param message UpdateSpecRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IUpdateSpecRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateSpecRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateSpecRequest + * @throws {Error} If the payload is not 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.apihub.v1.UpdateSpecRequest; + + /** + * Decodes an UpdateSpecRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateSpecRequest + * @throws {Error} If the payload 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.apihub.v1.UpdateSpecRequest; + + /** + * Verifies an UpdateSpecRequest message. + * @param message Plain 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 UpdateSpecRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateSpecRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.UpdateSpecRequest; + + /** + * Creates a plain object from an UpdateSpecRequest message. Also converts values to other types if specified. + * @param message UpdateSpecRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.UpdateSpecRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateSpecRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateSpecRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteSpecRequest. */ + interface IDeleteSpecRequest { + + /** DeleteSpecRequest name */ + name?: (string|null); + } + + /** Represents a DeleteSpecRequest. */ + class DeleteSpecRequest implements IDeleteSpecRequest { + + /** + * Constructs a new DeleteSpecRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IDeleteSpecRequest); + + /** DeleteSpecRequest name. */ + public name: string; + + /** + * Creates a new DeleteSpecRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteSpecRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.IDeleteSpecRequest): google.cloud.apihub.v1.DeleteSpecRequest; + + /** + * Encodes the specified DeleteSpecRequest message. Does not implicitly {@link google.cloud.apihub.v1.DeleteSpecRequest.verify|verify} messages. + * @param message DeleteSpecRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IDeleteSpecRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteSpecRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.DeleteSpecRequest.verify|verify} messages. + * @param message DeleteSpecRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IDeleteSpecRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteSpecRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteSpecRequest + * @throws {Error} If the payload is not 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.apihub.v1.DeleteSpecRequest; + + /** + * Decodes a DeleteSpecRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteSpecRequest + * @throws {Error} If the payload 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.apihub.v1.DeleteSpecRequest; + + /** + * Verifies a DeleteSpecRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteSpecRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteSpecRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.DeleteSpecRequest; + + /** + * Creates a plain object from a DeleteSpecRequest message. Also converts values to other types if specified. + * @param message DeleteSpecRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.DeleteSpecRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteSpecRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteSpecRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListSpecsRequest. */ + interface IListSpecsRequest { + + /** ListSpecsRequest parent */ + parent?: (string|null); + + /** ListSpecsRequest filter */ + filter?: (string|null); + + /** ListSpecsRequest pageSize */ + pageSize?: (number|null); + + /** ListSpecsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListSpecsRequest. */ + class ListSpecsRequest implements IListSpecsRequest { + + /** + * Constructs a new ListSpecsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IListSpecsRequest); + + /** ListSpecsRequest parent. */ + public parent: string; + + /** ListSpecsRequest filter. */ + public filter: string; + + /** ListSpecsRequest pageSize. */ + public pageSize: number; + + /** ListSpecsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListSpecsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSpecsRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.IListSpecsRequest): google.cloud.apihub.v1.ListSpecsRequest; + + /** + * Encodes the specified ListSpecsRequest message. Does not implicitly {@link google.cloud.apihub.v1.ListSpecsRequest.verify|verify} messages. + * @param message ListSpecsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IListSpecsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSpecsRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListSpecsRequest.verify|verify} messages. + * @param message ListSpecsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IListSpecsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSpecsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSpecsRequest + * @throws {Error} If the payload is not 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.apihub.v1.ListSpecsRequest; + + /** + * Decodes a ListSpecsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSpecsRequest + * @throws {Error} If the payload 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.apihub.v1.ListSpecsRequest; + + /** + * Verifies a ListSpecsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListSpecsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSpecsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.ListSpecsRequest; + + /** + * Creates a plain object from a ListSpecsRequest message. Also converts values to other types if specified. + * @param message ListSpecsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.ListSpecsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSpecsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSpecsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListSpecsResponse. */ + interface IListSpecsResponse { + + /** ListSpecsResponse specs */ + specs?: (google.cloud.apihub.v1.ISpec[]|null); + + /** ListSpecsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListSpecsResponse. */ + class ListSpecsResponse implements IListSpecsResponse { + + /** + * Constructs a new ListSpecsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IListSpecsResponse); + + /** ListSpecsResponse specs. */ + public specs: google.cloud.apihub.v1.ISpec[]; + + /** ListSpecsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListSpecsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSpecsResponse instance + */ + public static create(properties?: google.cloud.apihub.v1.IListSpecsResponse): google.cloud.apihub.v1.ListSpecsResponse; + + /** + * Encodes the specified ListSpecsResponse message. Does not implicitly {@link google.cloud.apihub.v1.ListSpecsResponse.verify|verify} messages. + * @param message ListSpecsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IListSpecsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSpecsResponse message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListSpecsResponse.verify|verify} messages. + * @param message ListSpecsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IListSpecsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSpecsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSpecsResponse + * @throws {Error} If the payload is not 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.apihub.v1.ListSpecsResponse; + + /** + * Decodes a ListSpecsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSpecsResponse + * @throws {Error} If the payload 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.apihub.v1.ListSpecsResponse; + + /** + * Verifies a ListSpecsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListSpecsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSpecsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.ListSpecsResponse; + + /** + * Creates a plain object from a ListSpecsResponse message. Also converts values to other types if specified. + * @param message ListSpecsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.ListSpecsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSpecsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSpecsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetSpecContentsRequest. */ + interface IGetSpecContentsRequest { + + /** GetSpecContentsRequest name */ + name?: (string|null); + } + + /** Represents a GetSpecContentsRequest. */ + class GetSpecContentsRequest implements IGetSpecContentsRequest { + + /** + * Constructs a new GetSpecContentsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IGetSpecContentsRequest); + + /** GetSpecContentsRequest name. */ + public name: string; + + /** + * Creates a new GetSpecContentsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetSpecContentsRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.IGetSpecContentsRequest): google.cloud.apihub.v1.GetSpecContentsRequest; + + /** + * Encodes the specified GetSpecContentsRequest message. Does not implicitly {@link google.cloud.apihub.v1.GetSpecContentsRequest.verify|verify} messages. + * @param message GetSpecContentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IGetSpecContentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetSpecContentsRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.GetSpecContentsRequest.verify|verify} messages. + * @param message GetSpecContentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IGetSpecContentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetSpecContentsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetSpecContentsRequest + * @throws {Error} If the payload is not 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.apihub.v1.GetSpecContentsRequest; + + /** + * Decodes a GetSpecContentsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetSpecContentsRequest + * @throws {Error} If the payload 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.apihub.v1.GetSpecContentsRequest; + + /** + * Verifies a GetSpecContentsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetSpecContentsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetSpecContentsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.GetSpecContentsRequest; + + /** + * Creates a plain object from a GetSpecContentsRequest message. Also converts values to other types if specified. + * @param message GetSpecContentsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.GetSpecContentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetSpecContentsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetSpecContentsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetApiOperationRequest. */ + interface IGetApiOperationRequest { + + /** GetApiOperationRequest name */ + name?: (string|null); + } + + /** Represents a GetApiOperationRequest. */ + class GetApiOperationRequest implements IGetApiOperationRequest { + + /** + * Constructs a new GetApiOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IGetApiOperationRequest); + + /** GetApiOperationRequest name. */ + public name: string; + + /** + * Creates a new GetApiOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetApiOperationRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.IGetApiOperationRequest): google.cloud.apihub.v1.GetApiOperationRequest; + + /** + * Encodes the specified GetApiOperationRequest message. Does not implicitly {@link google.cloud.apihub.v1.GetApiOperationRequest.verify|verify} messages. + * @param message GetApiOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IGetApiOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetApiOperationRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.GetApiOperationRequest.verify|verify} messages. + * @param message GetApiOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IGetApiOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetApiOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetApiOperationRequest + * @throws {Error} If the payload is not 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.apihub.v1.GetApiOperationRequest; + + /** + * Decodes a GetApiOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetApiOperationRequest + * @throws {Error} If the payload 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.apihub.v1.GetApiOperationRequest; + + /** + * Verifies a GetApiOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetApiOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetApiOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.GetApiOperationRequest; + + /** + * Creates a plain object from a GetApiOperationRequest message. Also converts values to other types if specified. + * @param message GetApiOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.GetApiOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetApiOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetApiOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListApiOperationsRequest. */ + interface IListApiOperationsRequest { + + /** ListApiOperationsRequest parent */ + parent?: (string|null); + + /** ListApiOperationsRequest filter */ + filter?: (string|null); + + /** ListApiOperationsRequest pageSize */ + pageSize?: (number|null); + + /** ListApiOperationsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListApiOperationsRequest. */ + class ListApiOperationsRequest implements IListApiOperationsRequest { + + /** + * Constructs a new ListApiOperationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IListApiOperationsRequest); + + /** ListApiOperationsRequest parent. */ + public parent: string; + + /** ListApiOperationsRequest filter. */ + public filter: string; + + /** ListApiOperationsRequest pageSize. */ + public pageSize: number; + + /** ListApiOperationsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListApiOperationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListApiOperationsRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.IListApiOperationsRequest): google.cloud.apihub.v1.ListApiOperationsRequest; + + /** + * Encodes the specified ListApiOperationsRequest message. Does not implicitly {@link google.cloud.apihub.v1.ListApiOperationsRequest.verify|verify} messages. + * @param message ListApiOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IListApiOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListApiOperationsRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListApiOperationsRequest.verify|verify} messages. + * @param message ListApiOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IListApiOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListApiOperationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListApiOperationsRequest + * @throws {Error} If the payload is not 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.apihub.v1.ListApiOperationsRequest; + + /** + * Decodes a ListApiOperationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListApiOperationsRequest + * @throws {Error} If the payload 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.apihub.v1.ListApiOperationsRequest; + + /** + * Verifies a ListApiOperationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListApiOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListApiOperationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.ListApiOperationsRequest; + + /** + * Creates a plain object from a ListApiOperationsRequest message. Also converts values to other types if specified. + * @param message ListApiOperationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.ListApiOperationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListApiOperationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListApiOperationsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListApiOperationsResponse. */ + interface IListApiOperationsResponse { + + /** ListApiOperationsResponse apiOperations */ + apiOperations?: (google.cloud.apihub.v1.IApiOperation[]|null); + + /** ListApiOperationsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListApiOperationsResponse. */ + class ListApiOperationsResponse implements IListApiOperationsResponse { + + /** + * Constructs a new ListApiOperationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IListApiOperationsResponse); + + /** ListApiOperationsResponse apiOperations. */ + public apiOperations: google.cloud.apihub.v1.IApiOperation[]; + + /** ListApiOperationsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListApiOperationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListApiOperationsResponse instance + */ + public static create(properties?: google.cloud.apihub.v1.IListApiOperationsResponse): google.cloud.apihub.v1.ListApiOperationsResponse; + + /** + * Encodes the specified ListApiOperationsResponse message. Does not implicitly {@link google.cloud.apihub.v1.ListApiOperationsResponse.verify|verify} messages. + * @param message ListApiOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IListApiOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListApiOperationsResponse message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListApiOperationsResponse.verify|verify} messages. + * @param message ListApiOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IListApiOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListApiOperationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListApiOperationsResponse + * @throws {Error} If the payload is not 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.apihub.v1.ListApiOperationsResponse; + + /** + * Decodes a ListApiOperationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListApiOperationsResponse + * @throws {Error} If the payload 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.apihub.v1.ListApiOperationsResponse; + + /** + * Verifies a ListApiOperationsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListApiOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListApiOperationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.ListApiOperationsResponse; + + /** + * Creates a plain object from a ListApiOperationsResponse message. Also converts values to other types if specified. + * @param message ListApiOperationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.ListApiOperationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListApiOperationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListApiOperationsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetDefinitionRequest. */ + interface IGetDefinitionRequest { + + /** GetDefinitionRequest name */ + name?: (string|null); + } + + /** Represents a GetDefinitionRequest. */ + class GetDefinitionRequest implements IGetDefinitionRequest { + + /** + * Constructs a new GetDefinitionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IGetDefinitionRequest); + + /** GetDefinitionRequest name. */ + public name: string; + + /** + * Creates a new GetDefinitionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetDefinitionRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.IGetDefinitionRequest): google.cloud.apihub.v1.GetDefinitionRequest; + + /** + * Encodes the specified GetDefinitionRequest message. Does not implicitly {@link google.cloud.apihub.v1.GetDefinitionRequest.verify|verify} messages. + * @param message GetDefinitionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IGetDefinitionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetDefinitionRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.GetDefinitionRequest.verify|verify} messages. + * @param message GetDefinitionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IGetDefinitionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetDefinitionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetDefinitionRequest + * @throws {Error} If the payload is not 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.apihub.v1.GetDefinitionRequest; + + /** + * Decodes a GetDefinitionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetDefinitionRequest + * @throws {Error} If the payload 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.apihub.v1.GetDefinitionRequest; + + /** + * Verifies a GetDefinitionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetDefinitionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetDefinitionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.GetDefinitionRequest; + + /** + * Creates a plain object from a GetDefinitionRequest message. Also converts values to other types if specified. + * @param message GetDefinitionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.GetDefinitionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetDefinitionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetDefinitionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateDeploymentRequest. */ + interface ICreateDeploymentRequest { + + /** CreateDeploymentRequest parent */ + parent?: (string|null); + + /** CreateDeploymentRequest deploymentId */ + deploymentId?: (string|null); + + /** CreateDeploymentRequest deployment */ + deployment?: (google.cloud.apihub.v1.IDeployment|null); + } + + /** Represents a CreateDeploymentRequest. */ + class CreateDeploymentRequest implements ICreateDeploymentRequest { + + /** + * Constructs a new CreateDeploymentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.ICreateDeploymentRequest); + + /** CreateDeploymentRequest parent. */ + public parent: string; + + /** CreateDeploymentRequest deploymentId. */ + public deploymentId: string; + + /** CreateDeploymentRequest deployment. */ + public deployment?: (google.cloud.apihub.v1.IDeployment|null); + + /** + * Creates a new CreateDeploymentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateDeploymentRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.ICreateDeploymentRequest): google.cloud.apihub.v1.CreateDeploymentRequest; + + /** + * Encodes the specified CreateDeploymentRequest message. Does not implicitly {@link google.cloud.apihub.v1.CreateDeploymentRequest.verify|verify} messages. + * @param message CreateDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.ICreateDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.CreateDeploymentRequest.verify|verify} messages. + * @param message CreateDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.ICreateDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateDeploymentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateDeploymentRequest + * @throws {Error} If the payload is not 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.apihub.v1.CreateDeploymentRequest; + + /** + * Decodes a CreateDeploymentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateDeploymentRequest + * @throws {Error} If the payload 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.apihub.v1.CreateDeploymentRequest; + + /** + * Verifies a CreateDeploymentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateDeploymentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.CreateDeploymentRequest; + + /** + * Creates a plain object from a CreateDeploymentRequest message. Also converts values to other types if specified. + * @param message CreateDeploymentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.CreateDeploymentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateDeploymentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateDeploymentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetDeploymentRequest. */ + interface IGetDeploymentRequest { + + /** GetDeploymentRequest name */ + name?: (string|null); + } + + /** Represents a GetDeploymentRequest. */ + class GetDeploymentRequest implements IGetDeploymentRequest { + + /** + * Constructs a new GetDeploymentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IGetDeploymentRequest); + + /** GetDeploymentRequest name. */ + public name: string; + + /** + * Creates a new GetDeploymentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetDeploymentRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.IGetDeploymentRequest): google.cloud.apihub.v1.GetDeploymentRequest; + + /** + * Encodes the specified GetDeploymentRequest message. Does not implicitly {@link google.cloud.apihub.v1.GetDeploymentRequest.verify|verify} messages. + * @param message GetDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IGetDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.GetDeploymentRequest.verify|verify} messages. + * @param message GetDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IGetDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetDeploymentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetDeploymentRequest + * @throws {Error} If the payload is not 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.apihub.v1.GetDeploymentRequest; + + /** + * Decodes a GetDeploymentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetDeploymentRequest + * @throws {Error} If the payload 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.apihub.v1.GetDeploymentRequest; + + /** + * Verifies a GetDeploymentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetDeploymentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.GetDeploymentRequest; + + /** + * Creates a plain object from a GetDeploymentRequest message. Also converts values to other types if specified. + * @param message GetDeploymentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.GetDeploymentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetDeploymentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetDeploymentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateDeploymentRequest. */ + interface IUpdateDeploymentRequest { + + /** UpdateDeploymentRequest deployment */ + deployment?: (google.cloud.apihub.v1.IDeployment|null); + + /** UpdateDeploymentRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateDeploymentRequest. */ + class UpdateDeploymentRequest implements IUpdateDeploymentRequest { + + /** + * Constructs a new UpdateDeploymentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IUpdateDeploymentRequest); + + /** UpdateDeploymentRequest deployment. */ + public deployment?: (google.cloud.apihub.v1.IDeployment|null); + + /** UpdateDeploymentRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateDeploymentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateDeploymentRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.IUpdateDeploymentRequest): google.cloud.apihub.v1.UpdateDeploymentRequest; + + /** + * Encodes the specified UpdateDeploymentRequest message. Does not implicitly {@link google.cloud.apihub.v1.UpdateDeploymentRequest.verify|verify} messages. + * @param message UpdateDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IUpdateDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.UpdateDeploymentRequest.verify|verify} messages. + * @param message UpdateDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IUpdateDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateDeploymentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateDeploymentRequest + * @throws {Error} If the payload is not 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.apihub.v1.UpdateDeploymentRequest; + + /** + * Decodes an UpdateDeploymentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateDeploymentRequest + * @throws {Error} If the payload 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.apihub.v1.UpdateDeploymentRequest; + + /** + * Verifies an UpdateDeploymentRequest message. + * @param message Plain 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 UpdateDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateDeploymentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.UpdateDeploymentRequest; + + /** + * Creates a plain object from an UpdateDeploymentRequest message. Also converts values to other types if specified. + * @param message UpdateDeploymentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.UpdateDeploymentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateDeploymentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateDeploymentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteDeploymentRequest. */ + interface IDeleteDeploymentRequest { + + /** DeleteDeploymentRequest name */ + name?: (string|null); + } + + /** Represents a DeleteDeploymentRequest. */ + class DeleteDeploymentRequest implements IDeleteDeploymentRequest { + + /** + * Constructs a new DeleteDeploymentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IDeleteDeploymentRequest); + + /** DeleteDeploymentRequest name. */ + public name: string; + + /** + * Creates a new DeleteDeploymentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteDeploymentRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.IDeleteDeploymentRequest): google.cloud.apihub.v1.DeleteDeploymentRequest; + + /** + * Encodes the specified DeleteDeploymentRequest message. Does not implicitly {@link google.cloud.apihub.v1.DeleteDeploymentRequest.verify|verify} messages. + * @param message DeleteDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IDeleteDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.DeleteDeploymentRequest.verify|verify} messages. + * @param message DeleteDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IDeleteDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteDeploymentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteDeploymentRequest + * @throws {Error} If the payload is not 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.apihub.v1.DeleteDeploymentRequest; + + /** + * Decodes a DeleteDeploymentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteDeploymentRequest + * @throws {Error} If the payload 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.apihub.v1.DeleteDeploymentRequest; + + /** + * Verifies a DeleteDeploymentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteDeploymentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.DeleteDeploymentRequest; + + /** + * Creates a plain object from a DeleteDeploymentRequest message. Also converts values to other types if specified. + * @param message DeleteDeploymentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.DeleteDeploymentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteDeploymentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteDeploymentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListDeploymentsRequest. */ + interface IListDeploymentsRequest { + + /** ListDeploymentsRequest parent */ + parent?: (string|null); + + /** ListDeploymentsRequest filter */ + filter?: (string|null); + + /** ListDeploymentsRequest pageSize */ + pageSize?: (number|null); + + /** ListDeploymentsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListDeploymentsRequest. */ + class ListDeploymentsRequest implements IListDeploymentsRequest { + + /** + * Constructs a new ListDeploymentsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IListDeploymentsRequest); + + /** ListDeploymentsRequest parent. */ + public parent: string; + + /** ListDeploymentsRequest filter. */ + public filter: string; + + /** ListDeploymentsRequest pageSize. */ + public pageSize: number; + + /** ListDeploymentsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListDeploymentsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDeploymentsRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.IListDeploymentsRequest): google.cloud.apihub.v1.ListDeploymentsRequest; + + /** + * Encodes the specified ListDeploymentsRequest message. Does not implicitly {@link google.cloud.apihub.v1.ListDeploymentsRequest.verify|verify} messages. + * @param message ListDeploymentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IListDeploymentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDeploymentsRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListDeploymentsRequest.verify|verify} messages. + * @param message ListDeploymentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IListDeploymentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDeploymentsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDeploymentsRequest + * @throws {Error} If the payload is not 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.apihub.v1.ListDeploymentsRequest; + + /** + * Decodes a ListDeploymentsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDeploymentsRequest + * @throws {Error} If the payload 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.apihub.v1.ListDeploymentsRequest; + + /** + * Verifies a ListDeploymentsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListDeploymentsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDeploymentsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.ListDeploymentsRequest; + + /** + * Creates a plain object from a ListDeploymentsRequest message. Also converts values to other types if specified. + * @param message ListDeploymentsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.ListDeploymentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDeploymentsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListDeploymentsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListDeploymentsResponse. */ + interface IListDeploymentsResponse { + + /** ListDeploymentsResponse deployments */ + deployments?: (google.cloud.apihub.v1.IDeployment[]|null); + + /** ListDeploymentsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListDeploymentsResponse. */ + class ListDeploymentsResponse implements IListDeploymentsResponse { + + /** + * Constructs a new ListDeploymentsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IListDeploymentsResponse); + + /** ListDeploymentsResponse deployments. */ + public deployments: google.cloud.apihub.v1.IDeployment[]; + + /** ListDeploymentsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListDeploymentsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDeploymentsResponse instance + */ + public static create(properties?: google.cloud.apihub.v1.IListDeploymentsResponse): google.cloud.apihub.v1.ListDeploymentsResponse; + + /** + * Encodes the specified ListDeploymentsResponse message. Does not implicitly {@link google.cloud.apihub.v1.ListDeploymentsResponse.verify|verify} messages. + * @param message ListDeploymentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IListDeploymentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDeploymentsResponse message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListDeploymentsResponse.verify|verify} messages. + * @param message ListDeploymentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IListDeploymentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDeploymentsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDeploymentsResponse + * @throws {Error} If the payload is not 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.apihub.v1.ListDeploymentsResponse; + + /** + * Decodes a ListDeploymentsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDeploymentsResponse + * @throws {Error} If the payload 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.apihub.v1.ListDeploymentsResponse; + + /** + * Verifies a ListDeploymentsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListDeploymentsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDeploymentsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.ListDeploymentsResponse; + + /** + * Creates a plain object from a ListDeploymentsResponse message. Also converts values to other types if specified. + * @param message ListDeploymentsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.ListDeploymentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDeploymentsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListDeploymentsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateAttributeRequest. */ + interface ICreateAttributeRequest { + + /** CreateAttributeRequest parent */ + parent?: (string|null); + + /** CreateAttributeRequest attributeId */ + attributeId?: (string|null); + + /** CreateAttributeRequest attribute */ + attribute?: (google.cloud.apihub.v1.IAttribute|null); + } + + /** Represents a CreateAttributeRequest. */ + class CreateAttributeRequest implements ICreateAttributeRequest { + + /** + * Constructs a new CreateAttributeRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.ICreateAttributeRequest); + + /** CreateAttributeRequest parent. */ + public parent: string; + + /** CreateAttributeRequest attributeId. */ + public attributeId: string; + + /** CreateAttributeRequest attribute. */ + public attribute?: (google.cloud.apihub.v1.IAttribute|null); + + /** + * Creates a new CreateAttributeRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateAttributeRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.ICreateAttributeRequest): google.cloud.apihub.v1.CreateAttributeRequest; + + /** + * Encodes the specified CreateAttributeRequest message. Does not implicitly {@link google.cloud.apihub.v1.CreateAttributeRequest.verify|verify} messages. + * @param message CreateAttributeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.ICreateAttributeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateAttributeRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.CreateAttributeRequest.verify|verify} messages. + * @param message CreateAttributeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.ICreateAttributeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateAttributeRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateAttributeRequest + * @throws {Error} If the payload is not 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.apihub.v1.CreateAttributeRequest; + + /** + * Decodes a CreateAttributeRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateAttributeRequest + * @throws {Error} If the payload 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.apihub.v1.CreateAttributeRequest; + + /** + * Verifies a CreateAttributeRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateAttributeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateAttributeRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.CreateAttributeRequest; + + /** + * Creates a plain object from a CreateAttributeRequest message. Also converts values to other types if specified. + * @param message CreateAttributeRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.CreateAttributeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateAttributeRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateAttributeRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetAttributeRequest. */ + interface IGetAttributeRequest { + + /** GetAttributeRequest name */ + name?: (string|null); + } + + /** Represents a GetAttributeRequest. */ + class GetAttributeRequest implements IGetAttributeRequest { + + /** + * Constructs a new GetAttributeRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IGetAttributeRequest); + + /** GetAttributeRequest name. */ + public name: string; + + /** + * Creates a new GetAttributeRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetAttributeRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.IGetAttributeRequest): google.cloud.apihub.v1.GetAttributeRequest; + + /** + * Encodes the specified GetAttributeRequest message. Does not implicitly {@link google.cloud.apihub.v1.GetAttributeRequest.verify|verify} messages. + * @param message GetAttributeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IGetAttributeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetAttributeRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.GetAttributeRequest.verify|verify} messages. + * @param message GetAttributeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IGetAttributeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetAttributeRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetAttributeRequest + * @throws {Error} If the payload is not 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.apihub.v1.GetAttributeRequest; + + /** + * Decodes a GetAttributeRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetAttributeRequest + * @throws {Error} If the payload 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.apihub.v1.GetAttributeRequest; + + /** + * Verifies a GetAttributeRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetAttributeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetAttributeRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.GetAttributeRequest; + + /** + * Creates a plain object from a GetAttributeRequest message. Also converts values to other types if specified. + * @param message GetAttributeRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.GetAttributeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetAttributeRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetAttributeRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateAttributeRequest. */ + interface IUpdateAttributeRequest { + + /** UpdateAttributeRequest attribute */ + attribute?: (google.cloud.apihub.v1.IAttribute|null); + + /** UpdateAttributeRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateAttributeRequest. */ + class UpdateAttributeRequest implements IUpdateAttributeRequest { + + /** + * Constructs a new UpdateAttributeRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IUpdateAttributeRequest); + + /** UpdateAttributeRequest attribute. */ + public attribute?: (google.cloud.apihub.v1.IAttribute|null); + + /** UpdateAttributeRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateAttributeRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateAttributeRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.IUpdateAttributeRequest): google.cloud.apihub.v1.UpdateAttributeRequest; + + /** + * Encodes the specified UpdateAttributeRequest message. Does not implicitly {@link google.cloud.apihub.v1.UpdateAttributeRequest.verify|verify} messages. + * @param message UpdateAttributeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IUpdateAttributeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateAttributeRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.UpdateAttributeRequest.verify|verify} messages. + * @param message UpdateAttributeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IUpdateAttributeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateAttributeRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateAttributeRequest + * @throws {Error} If the payload is not 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.apihub.v1.UpdateAttributeRequest; + + /** + * Decodes an UpdateAttributeRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateAttributeRequest + * @throws {Error} If the payload 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.apihub.v1.UpdateAttributeRequest; + + /** + * Verifies an UpdateAttributeRequest message. + * @param message Plain 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 UpdateAttributeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateAttributeRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.UpdateAttributeRequest; + + /** + * Creates a plain object from an UpdateAttributeRequest message. Also converts values to other types if specified. + * @param message UpdateAttributeRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.UpdateAttributeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateAttributeRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateAttributeRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteAttributeRequest. */ + interface IDeleteAttributeRequest { + + /** DeleteAttributeRequest name */ + name?: (string|null); + } + + /** Represents a DeleteAttributeRequest. */ + class DeleteAttributeRequest implements IDeleteAttributeRequest { + + /** + * Constructs a new DeleteAttributeRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IDeleteAttributeRequest); + + /** DeleteAttributeRequest name. */ + public name: string; + + /** + * Creates a new DeleteAttributeRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteAttributeRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.IDeleteAttributeRequest): google.cloud.apihub.v1.DeleteAttributeRequest; + + /** + * Encodes the specified DeleteAttributeRequest message. Does not implicitly {@link google.cloud.apihub.v1.DeleteAttributeRequest.verify|verify} messages. + * @param message DeleteAttributeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IDeleteAttributeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteAttributeRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.DeleteAttributeRequest.verify|verify} messages. + * @param message DeleteAttributeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IDeleteAttributeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteAttributeRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteAttributeRequest + * @throws {Error} If the payload is not 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.apihub.v1.DeleteAttributeRequest; + + /** + * Decodes a DeleteAttributeRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteAttributeRequest + * @throws {Error} If the payload 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.apihub.v1.DeleteAttributeRequest; + + /** + * Verifies a DeleteAttributeRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteAttributeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteAttributeRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.DeleteAttributeRequest; + + /** + * Creates a plain object from a DeleteAttributeRequest message. Also converts values to other types if specified. + * @param message DeleteAttributeRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.DeleteAttributeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteAttributeRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteAttributeRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListAttributesRequest. */ + interface IListAttributesRequest { + + /** ListAttributesRequest parent */ + parent?: (string|null); + + /** ListAttributesRequest filter */ + filter?: (string|null); + + /** ListAttributesRequest pageSize */ + pageSize?: (number|null); + + /** ListAttributesRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListAttributesRequest. */ + class ListAttributesRequest implements IListAttributesRequest { + + /** + * Constructs a new ListAttributesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IListAttributesRequest); + + /** ListAttributesRequest parent. */ + public parent: string; + + /** ListAttributesRequest filter. */ + public filter: string; + + /** ListAttributesRequest pageSize. */ + public pageSize: number; + + /** ListAttributesRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListAttributesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAttributesRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.IListAttributesRequest): google.cloud.apihub.v1.ListAttributesRequest; + + /** + * Encodes the specified ListAttributesRequest message. Does not implicitly {@link google.cloud.apihub.v1.ListAttributesRequest.verify|verify} messages. + * @param message ListAttributesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IListAttributesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAttributesRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListAttributesRequest.verify|verify} messages. + * @param message ListAttributesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IListAttributesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAttributesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAttributesRequest + * @throws {Error} If the payload is not 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.apihub.v1.ListAttributesRequest; + + /** + * Decodes a ListAttributesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAttributesRequest + * @throws {Error} If the payload 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.apihub.v1.ListAttributesRequest; + + /** + * Verifies a ListAttributesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListAttributesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAttributesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.ListAttributesRequest; + + /** + * Creates a plain object from a ListAttributesRequest message. Also converts values to other types if specified. + * @param message ListAttributesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.ListAttributesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAttributesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAttributesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListAttributesResponse. */ + interface IListAttributesResponse { + + /** ListAttributesResponse attributes */ + attributes?: (google.cloud.apihub.v1.IAttribute[]|null); + + /** ListAttributesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListAttributesResponse. */ + class ListAttributesResponse implements IListAttributesResponse { + + /** + * Constructs a new ListAttributesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IListAttributesResponse); + + /** ListAttributesResponse attributes. */ + public attributes: google.cloud.apihub.v1.IAttribute[]; + + /** ListAttributesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListAttributesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAttributesResponse instance + */ + public static create(properties?: google.cloud.apihub.v1.IListAttributesResponse): google.cloud.apihub.v1.ListAttributesResponse; + + /** + * Encodes the specified ListAttributesResponse message. Does not implicitly {@link google.cloud.apihub.v1.ListAttributesResponse.verify|verify} messages. + * @param message ListAttributesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IListAttributesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAttributesResponse message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListAttributesResponse.verify|verify} messages. + * @param message ListAttributesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IListAttributesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAttributesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAttributesResponse + * @throws {Error} If the payload is not 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.apihub.v1.ListAttributesResponse; + + /** + * Decodes a ListAttributesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAttributesResponse + * @throws {Error} If the payload 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.apihub.v1.ListAttributesResponse; + + /** + * Verifies a ListAttributesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListAttributesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAttributesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.ListAttributesResponse; + + /** + * Creates a plain object from a ListAttributesResponse message. Also converts values to other types if specified. + * @param message ListAttributesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.ListAttributesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAttributesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAttributesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SearchResourcesRequest. */ + interface ISearchResourcesRequest { + + /** SearchResourcesRequest location */ + location?: (string|null); + + /** SearchResourcesRequest query */ + query?: (string|null); + + /** SearchResourcesRequest filter */ + filter?: (string|null); + + /** SearchResourcesRequest pageSize */ + pageSize?: (number|null); + + /** SearchResourcesRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a SearchResourcesRequest. */ + class SearchResourcesRequest implements ISearchResourcesRequest { + + /** + * Constructs a new SearchResourcesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.ISearchResourcesRequest); + + /** SearchResourcesRequest location. */ + public location: string; + + /** SearchResourcesRequest query. */ + public query: string; + + /** SearchResourcesRequest filter. */ + public filter: string; + + /** SearchResourcesRequest pageSize. */ + public pageSize: number; + + /** SearchResourcesRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new SearchResourcesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SearchResourcesRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.ISearchResourcesRequest): google.cloud.apihub.v1.SearchResourcesRequest; + + /** + * Encodes the specified SearchResourcesRequest message. Does not implicitly {@link google.cloud.apihub.v1.SearchResourcesRequest.verify|verify} messages. + * @param message SearchResourcesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.ISearchResourcesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SearchResourcesRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.SearchResourcesRequest.verify|verify} messages. + * @param message SearchResourcesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.ISearchResourcesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SearchResourcesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SearchResourcesRequest + * @throws {Error} If the payload is not 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.apihub.v1.SearchResourcesRequest; + + /** + * Decodes a SearchResourcesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SearchResourcesRequest + * @throws {Error} If the payload 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.apihub.v1.SearchResourcesRequest; + + /** + * Verifies a SearchResourcesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SearchResourcesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SearchResourcesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.SearchResourcesRequest; + + /** + * Creates a plain object from a SearchResourcesRequest message. Also converts values to other types if specified. + * @param message SearchResourcesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.SearchResourcesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SearchResourcesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SearchResourcesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ApiHubResource. */ + interface IApiHubResource { + + /** ApiHubResource api */ + api?: (google.cloud.apihub.v1.IApi|null); + + /** ApiHubResource operation */ + operation?: (google.cloud.apihub.v1.IApiOperation|null); + + /** ApiHubResource deployment */ + deployment?: (google.cloud.apihub.v1.IDeployment|null); + + /** ApiHubResource spec */ + spec?: (google.cloud.apihub.v1.ISpec|null); + + /** ApiHubResource definition */ + definition?: (google.cloud.apihub.v1.IDefinition|null); + + /** ApiHubResource version */ + version?: (google.cloud.apihub.v1.IVersion|null); + } + + /** Represents an ApiHubResource. */ + class ApiHubResource implements IApiHubResource { + + /** + * Constructs a new ApiHubResource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IApiHubResource); + + /** ApiHubResource api. */ + public api?: (google.cloud.apihub.v1.IApi|null); + + /** ApiHubResource operation. */ + public operation?: (google.cloud.apihub.v1.IApiOperation|null); + + /** ApiHubResource deployment. */ + public deployment?: (google.cloud.apihub.v1.IDeployment|null); + + /** ApiHubResource spec. */ + public spec?: (google.cloud.apihub.v1.ISpec|null); + + /** ApiHubResource definition. */ + public definition?: (google.cloud.apihub.v1.IDefinition|null); + + /** ApiHubResource version. */ + public version?: (google.cloud.apihub.v1.IVersion|null); + + /** ApiHubResource resource. */ + public resource?: ("api"|"operation"|"deployment"|"spec"|"definition"|"version"); + + /** + * Creates a new ApiHubResource instance using the specified properties. + * @param [properties] Properties to set + * @returns ApiHubResource instance + */ + public static create(properties?: google.cloud.apihub.v1.IApiHubResource): google.cloud.apihub.v1.ApiHubResource; + + /** + * Encodes the specified ApiHubResource message. Does not implicitly {@link google.cloud.apihub.v1.ApiHubResource.verify|verify} messages. + * @param message ApiHubResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IApiHubResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ApiHubResource message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ApiHubResource.verify|verify} messages. + * @param message ApiHubResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IApiHubResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ApiHubResource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ApiHubResource + * @throws {Error} If the payload is not 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.apihub.v1.ApiHubResource; + + /** + * Decodes an ApiHubResource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ApiHubResource + * @throws {Error} If the payload 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.apihub.v1.ApiHubResource; + + /** + * Verifies an ApiHubResource message. + * @param message Plain 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 ApiHubResource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ApiHubResource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.ApiHubResource; + + /** + * Creates a plain object from an ApiHubResource message. Also converts values to other types if specified. + * @param message ApiHubResource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.ApiHubResource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ApiHubResource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ApiHubResource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SearchResult. */ + interface ISearchResult { + + /** SearchResult resource */ + resource?: (google.cloud.apihub.v1.IApiHubResource|null); + } + + /** Represents a SearchResult. */ + class SearchResult implements ISearchResult { + + /** + * Constructs a new SearchResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.ISearchResult); + + /** SearchResult resource. */ + public resource?: (google.cloud.apihub.v1.IApiHubResource|null); + + /** + * Creates a new SearchResult instance using the specified properties. + * @param [properties] Properties to set + * @returns SearchResult instance + */ + public static create(properties?: google.cloud.apihub.v1.ISearchResult): google.cloud.apihub.v1.SearchResult; + + /** + * Encodes the specified SearchResult message. Does not implicitly {@link google.cloud.apihub.v1.SearchResult.verify|verify} messages. + * @param message SearchResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.ISearchResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SearchResult message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.SearchResult.verify|verify} messages. + * @param message SearchResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.ISearchResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SearchResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SearchResult + * @throws {Error} If the payload is not 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.apihub.v1.SearchResult; + + /** + * Decodes a SearchResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SearchResult + * @throws {Error} If the payload 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.apihub.v1.SearchResult; + + /** + * Verifies a SearchResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SearchResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SearchResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.SearchResult; + + /** + * Creates a plain object from a SearchResult message. Also converts values to other types if specified. + * @param message SearchResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.SearchResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SearchResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SearchResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SearchResourcesResponse. */ + interface ISearchResourcesResponse { + + /** SearchResourcesResponse searchResults */ + searchResults?: (google.cloud.apihub.v1.ISearchResult[]|null); + + /** SearchResourcesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a SearchResourcesResponse. */ + class SearchResourcesResponse implements ISearchResourcesResponse { + + /** + * Constructs a new SearchResourcesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.ISearchResourcesResponse); + + /** SearchResourcesResponse searchResults. */ + public searchResults: google.cloud.apihub.v1.ISearchResult[]; + + /** SearchResourcesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new SearchResourcesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns SearchResourcesResponse instance + */ + public static create(properties?: google.cloud.apihub.v1.ISearchResourcesResponse): google.cloud.apihub.v1.SearchResourcesResponse; + + /** + * Encodes the specified SearchResourcesResponse message. Does not implicitly {@link google.cloud.apihub.v1.SearchResourcesResponse.verify|verify} messages. + * @param message SearchResourcesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.ISearchResourcesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SearchResourcesResponse message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.SearchResourcesResponse.verify|verify} messages. + * @param message SearchResourcesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.ISearchResourcesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SearchResourcesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SearchResourcesResponse + * @throws {Error} If the payload is not 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.apihub.v1.SearchResourcesResponse; + + /** + * Decodes a SearchResourcesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SearchResourcesResponse + * @throws {Error} If the payload 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.apihub.v1.SearchResourcesResponse; + + /** + * Verifies a SearchResourcesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SearchResourcesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SearchResourcesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.SearchResourcesResponse; + + /** + * Creates a plain object from a SearchResourcesResponse message. Also converts values to other types if specified. + * @param message SearchResourcesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.SearchResourcesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SearchResourcesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SearchResourcesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateDependencyRequest. */ + interface ICreateDependencyRequest { + + /** CreateDependencyRequest parent */ + parent?: (string|null); + + /** CreateDependencyRequest dependencyId */ + dependencyId?: (string|null); + + /** CreateDependencyRequest dependency */ + dependency?: (google.cloud.apihub.v1.IDependency|null); + } + + /** Represents a CreateDependencyRequest. */ + class CreateDependencyRequest implements ICreateDependencyRequest { + + /** + * Constructs a new CreateDependencyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.ICreateDependencyRequest); + + /** CreateDependencyRequest parent. */ + public parent: string; + + /** CreateDependencyRequest dependencyId. */ + public dependencyId: string; + + /** CreateDependencyRequest dependency. */ + public dependency?: (google.cloud.apihub.v1.IDependency|null); + + /** + * Creates a new CreateDependencyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateDependencyRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.ICreateDependencyRequest): google.cloud.apihub.v1.CreateDependencyRequest; + + /** + * Encodes the specified CreateDependencyRequest message. Does not implicitly {@link google.cloud.apihub.v1.CreateDependencyRequest.verify|verify} messages. + * @param message CreateDependencyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.ICreateDependencyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateDependencyRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.CreateDependencyRequest.verify|verify} messages. + * @param message CreateDependencyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.ICreateDependencyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateDependencyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateDependencyRequest + * @throws {Error} If the payload is not 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.apihub.v1.CreateDependencyRequest; + + /** + * Decodes a CreateDependencyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateDependencyRequest + * @throws {Error} If the payload 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.apihub.v1.CreateDependencyRequest; + + /** + * Verifies a CreateDependencyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateDependencyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateDependencyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.CreateDependencyRequest; + + /** + * Creates a plain object from a CreateDependencyRequest message. Also converts values to other types if specified. + * @param message CreateDependencyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.CreateDependencyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateDependencyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateDependencyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetDependencyRequest. */ + interface IGetDependencyRequest { + + /** GetDependencyRequest name */ + name?: (string|null); + } + + /** Represents a GetDependencyRequest. */ + class GetDependencyRequest implements IGetDependencyRequest { + + /** + * Constructs a new GetDependencyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IGetDependencyRequest); + + /** GetDependencyRequest name. */ + public name: string; + + /** + * Creates a new GetDependencyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetDependencyRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.IGetDependencyRequest): google.cloud.apihub.v1.GetDependencyRequest; + + /** + * Encodes the specified GetDependencyRequest message. Does not implicitly {@link google.cloud.apihub.v1.GetDependencyRequest.verify|verify} messages. + * @param message GetDependencyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IGetDependencyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetDependencyRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.GetDependencyRequest.verify|verify} messages. + * @param message GetDependencyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IGetDependencyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetDependencyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetDependencyRequest + * @throws {Error} If the payload is not 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.apihub.v1.GetDependencyRequest; + + /** + * Decodes a GetDependencyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetDependencyRequest + * @throws {Error} If the payload 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.apihub.v1.GetDependencyRequest; + + /** + * Verifies a GetDependencyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetDependencyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetDependencyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.GetDependencyRequest; + + /** + * Creates a plain object from a GetDependencyRequest message. Also converts values to other types if specified. + * @param message GetDependencyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.GetDependencyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetDependencyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetDependencyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateDependencyRequest. */ + interface IUpdateDependencyRequest { + + /** UpdateDependencyRequest dependency */ + dependency?: (google.cloud.apihub.v1.IDependency|null); + + /** UpdateDependencyRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateDependencyRequest. */ + class UpdateDependencyRequest implements IUpdateDependencyRequest { + + /** + * Constructs a new UpdateDependencyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IUpdateDependencyRequest); + + /** UpdateDependencyRequest dependency. */ + public dependency?: (google.cloud.apihub.v1.IDependency|null); + + /** UpdateDependencyRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateDependencyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateDependencyRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.IUpdateDependencyRequest): google.cloud.apihub.v1.UpdateDependencyRequest; + + /** + * Encodes the specified UpdateDependencyRequest message. Does not implicitly {@link google.cloud.apihub.v1.UpdateDependencyRequest.verify|verify} messages. + * @param message UpdateDependencyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IUpdateDependencyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateDependencyRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.UpdateDependencyRequest.verify|verify} messages. + * @param message UpdateDependencyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IUpdateDependencyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateDependencyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateDependencyRequest + * @throws {Error} If the payload is not 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.apihub.v1.UpdateDependencyRequest; + + /** + * Decodes an UpdateDependencyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateDependencyRequest + * @throws {Error} If the payload 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.apihub.v1.UpdateDependencyRequest; + + /** + * Verifies an UpdateDependencyRequest message. + * @param message Plain 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 UpdateDependencyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateDependencyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.UpdateDependencyRequest; + + /** + * Creates a plain object from an UpdateDependencyRequest message. Also converts values to other types if specified. + * @param message UpdateDependencyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.UpdateDependencyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateDependencyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateDependencyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteDependencyRequest. */ + interface IDeleteDependencyRequest { + + /** DeleteDependencyRequest name */ + name?: (string|null); + } + + /** Represents a DeleteDependencyRequest. */ + class DeleteDependencyRequest implements IDeleteDependencyRequest { + + /** + * Constructs a new DeleteDependencyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IDeleteDependencyRequest); + + /** DeleteDependencyRequest name. */ + public name: string; + + /** + * Creates a new DeleteDependencyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteDependencyRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.IDeleteDependencyRequest): google.cloud.apihub.v1.DeleteDependencyRequest; + + /** + * Encodes the specified DeleteDependencyRequest message. Does not implicitly {@link google.cloud.apihub.v1.DeleteDependencyRequest.verify|verify} messages. + * @param message DeleteDependencyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IDeleteDependencyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteDependencyRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.DeleteDependencyRequest.verify|verify} messages. + * @param message DeleteDependencyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IDeleteDependencyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteDependencyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteDependencyRequest + * @throws {Error} If the payload is not 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.apihub.v1.DeleteDependencyRequest; + + /** + * Decodes a DeleteDependencyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteDependencyRequest + * @throws {Error} If the payload 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.apihub.v1.DeleteDependencyRequest; + + /** + * Verifies a DeleteDependencyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteDependencyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteDependencyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.DeleteDependencyRequest; + + /** + * Creates a plain object from a DeleteDependencyRequest message. Also converts values to other types if specified. + * @param message DeleteDependencyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.DeleteDependencyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteDependencyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteDependencyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListDependenciesRequest. */ + interface IListDependenciesRequest { + + /** ListDependenciesRequest parent */ + parent?: (string|null); + + /** ListDependenciesRequest filter */ + filter?: (string|null); + + /** ListDependenciesRequest pageSize */ + pageSize?: (number|null); + + /** ListDependenciesRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListDependenciesRequest. */ + class ListDependenciesRequest implements IListDependenciesRequest { + + /** + * Constructs a new ListDependenciesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IListDependenciesRequest); + + /** ListDependenciesRequest parent. */ + public parent: string; + + /** ListDependenciesRequest filter. */ + public filter: string; + + /** ListDependenciesRequest pageSize. */ + public pageSize: number; + + /** ListDependenciesRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListDependenciesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDependenciesRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.IListDependenciesRequest): google.cloud.apihub.v1.ListDependenciesRequest; + + /** + * Encodes the specified ListDependenciesRequest message. Does not implicitly {@link google.cloud.apihub.v1.ListDependenciesRequest.verify|verify} messages. + * @param message ListDependenciesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IListDependenciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDependenciesRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListDependenciesRequest.verify|verify} messages. + * @param message ListDependenciesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IListDependenciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDependenciesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDependenciesRequest + * @throws {Error} If the payload is not 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.apihub.v1.ListDependenciesRequest; + + /** + * Decodes a ListDependenciesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDependenciesRequest + * @throws {Error} If the payload 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.apihub.v1.ListDependenciesRequest; + + /** + * Verifies a ListDependenciesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListDependenciesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDependenciesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.ListDependenciesRequest; + + /** + * Creates a plain object from a ListDependenciesRequest message. Also converts values to other types if specified. + * @param message ListDependenciesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.ListDependenciesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDependenciesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListDependenciesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListDependenciesResponse. */ + interface IListDependenciesResponse { + + /** ListDependenciesResponse dependencies */ + dependencies?: (google.cloud.apihub.v1.IDependency[]|null); + + /** ListDependenciesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListDependenciesResponse. */ + class ListDependenciesResponse implements IListDependenciesResponse { + + /** + * Constructs a new ListDependenciesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IListDependenciesResponse); + + /** ListDependenciesResponse dependencies. */ + public dependencies: google.cloud.apihub.v1.IDependency[]; + + /** ListDependenciesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListDependenciesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDependenciesResponse instance + */ + public static create(properties?: google.cloud.apihub.v1.IListDependenciesResponse): google.cloud.apihub.v1.ListDependenciesResponse; + + /** + * Encodes the specified ListDependenciesResponse message. Does not implicitly {@link google.cloud.apihub.v1.ListDependenciesResponse.verify|verify} messages. + * @param message ListDependenciesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IListDependenciesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDependenciesResponse message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListDependenciesResponse.verify|verify} messages. + * @param message ListDependenciesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IListDependenciesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDependenciesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDependenciesResponse + * @throws {Error} If the payload is not 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.apihub.v1.ListDependenciesResponse; + + /** + * Decodes a ListDependenciesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDependenciesResponse + * @throws {Error} If the payload 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.apihub.v1.ListDependenciesResponse; + + /** + * Verifies a ListDependenciesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListDependenciesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDependenciesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.ListDependenciesResponse; + + /** + * Creates a plain object from a ListDependenciesResponse message. Also converts values to other types if specified. + * @param message ListDependenciesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.ListDependenciesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDependenciesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListDependenciesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateExternalApiRequest. */ + interface ICreateExternalApiRequest { + + /** CreateExternalApiRequest parent */ + parent?: (string|null); + + /** CreateExternalApiRequest externalApiId */ + externalApiId?: (string|null); + + /** CreateExternalApiRequest externalApi */ + externalApi?: (google.cloud.apihub.v1.IExternalApi|null); + } + + /** Represents a CreateExternalApiRequest. */ + class CreateExternalApiRequest implements ICreateExternalApiRequest { + + /** + * Constructs a new CreateExternalApiRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.ICreateExternalApiRequest); + + /** CreateExternalApiRequest parent. */ + public parent: string; + + /** CreateExternalApiRequest externalApiId. */ + public externalApiId: string; + + /** CreateExternalApiRequest externalApi. */ + public externalApi?: (google.cloud.apihub.v1.IExternalApi|null); + + /** + * Creates a new CreateExternalApiRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateExternalApiRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.ICreateExternalApiRequest): google.cloud.apihub.v1.CreateExternalApiRequest; + + /** + * Encodes the specified CreateExternalApiRequest message. Does not implicitly {@link google.cloud.apihub.v1.CreateExternalApiRequest.verify|verify} messages. + * @param message CreateExternalApiRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.ICreateExternalApiRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateExternalApiRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.CreateExternalApiRequest.verify|verify} messages. + * @param message CreateExternalApiRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.ICreateExternalApiRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateExternalApiRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateExternalApiRequest + * @throws {Error} If the payload is not 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.apihub.v1.CreateExternalApiRequest; + + /** + * Decodes a CreateExternalApiRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateExternalApiRequest + * @throws {Error} If the payload 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.apihub.v1.CreateExternalApiRequest; + + /** + * Verifies a CreateExternalApiRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateExternalApiRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateExternalApiRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.CreateExternalApiRequest; + + /** + * Creates a plain object from a CreateExternalApiRequest message. Also converts values to other types if specified. + * @param message CreateExternalApiRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.CreateExternalApiRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateExternalApiRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateExternalApiRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetExternalApiRequest. */ + interface IGetExternalApiRequest { + + /** GetExternalApiRequest name */ + name?: (string|null); + } + + /** Represents a GetExternalApiRequest. */ + class GetExternalApiRequest implements IGetExternalApiRequest { + + /** + * Constructs a new GetExternalApiRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IGetExternalApiRequest); + + /** GetExternalApiRequest name. */ + public name: string; + + /** + * Creates a new GetExternalApiRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetExternalApiRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.IGetExternalApiRequest): google.cloud.apihub.v1.GetExternalApiRequest; + + /** + * Encodes the specified GetExternalApiRequest message. Does not implicitly {@link google.cloud.apihub.v1.GetExternalApiRequest.verify|verify} messages. + * @param message GetExternalApiRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IGetExternalApiRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetExternalApiRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.GetExternalApiRequest.verify|verify} messages. + * @param message GetExternalApiRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IGetExternalApiRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetExternalApiRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetExternalApiRequest + * @throws {Error} If the payload is not 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.apihub.v1.GetExternalApiRequest; + + /** + * Decodes a GetExternalApiRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetExternalApiRequest + * @throws {Error} If the payload 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.apihub.v1.GetExternalApiRequest; + + /** + * Verifies a GetExternalApiRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetExternalApiRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetExternalApiRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.GetExternalApiRequest; + + /** + * Creates a plain object from a GetExternalApiRequest message. Also converts values to other types if specified. + * @param message GetExternalApiRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.GetExternalApiRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetExternalApiRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetExternalApiRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateExternalApiRequest. */ + interface IUpdateExternalApiRequest { + + /** UpdateExternalApiRequest externalApi */ + externalApi?: (google.cloud.apihub.v1.IExternalApi|null); + + /** UpdateExternalApiRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateExternalApiRequest. */ + class UpdateExternalApiRequest implements IUpdateExternalApiRequest { + + /** + * Constructs a new UpdateExternalApiRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IUpdateExternalApiRequest); + + /** UpdateExternalApiRequest externalApi. */ + public externalApi?: (google.cloud.apihub.v1.IExternalApi|null); + + /** UpdateExternalApiRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateExternalApiRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateExternalApiRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.IUpdateExternalApiRequest): google.cloud.apihub.v1.UpdateExternalApiRequest; + + /** + * Encodes the specified UpdateExternalApiRequest message. Does not implicitly {@link google.cloud.apihub.v1.UpdateExternalApiRequest.verify|verify} messages. + * @param message UpdateExternalApiRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IUpdateExternalApiRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateExternalApiRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.UpdateExternalApiRequest.verify|verify} messages. + * @param message UpdateExternalApiRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IUpdateExternalApiRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateExternalApiRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateExternalApiRequest + * @throws {Error} If the payload is not 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.apihub.v1.UpdateExternalApiRequest; + + /** + * Decodes an UpdateExternalApiRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateExternalApiRequest + * @throws {Error} If the payload 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.apihub.v1.UpdateExternalApiRequest; + + /** + * Verifies an UpdateExternalApiRequest message. + * @param message Plain 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 UpdateExternalApiRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateExternalApiRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.UpdateExternalApiRequest; + + /** + * Creates a plain object from an UpdateExternalApiRequest message. Also converts values to other types if specified. + * @param message UpdateExternalApiRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.UpdateExternalApiRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateExternalApiRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateExternalApiRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteExternalApiRequest. */ + interface IDeleteExternalApiRequest { + + /** DeleteExternalApiRequest name */ + name?: (string|null); + } + + /** Represents a DeleteExternalApiRequest. */ + class DeleteExternalApiRequest implements IDeleteExternalApiRequest { + + /** + * Constructs a new DeleteExternalApiRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IDeleteExternalApiRequest); + + /** DeleteExternalApiRequest name. */ + public name: string; + + /** + * Creates a new DeleteExternalApiRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteExternalApiRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.IDeleteExternalApiRequest): google.cloud.apihub.v1.DeleteExternalApiRequest; + + /** + * Encodes the specified DeleteExternalApiRequest message. Does not implicitly {@link google.cloud.apihub.v1.DeleteExternalApiRequest.verify|verify} messages. + * @param message DeleteExternalApiRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IDeleteExternalApiRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteExternalApiRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.DeleteExternalApiRequest.verify|verify} messages. + * @param message DeleteExternalApiRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IDeleteExternalApiRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteExternalApiRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteExternalApiRequest + * @throws {Error} If the payload is not 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.apihub.v1.DeleteExternalApiRequest; + + /** + * Decodes a DeleteExternalApiRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteExternalApiRequest + * @throws {Error} If the payload 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.apihub.v1.DeleteExternalApiRequest; + + /** + * Verifies a DeleteExternalApiRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteExternalApiRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteExternalApiRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.DeleteExternalApiRequest; + + /** + * Creates a plain object from a DeleteExternalApiRequest message. Also converts values to other types if specified. + * @param message DeleteExternalApiRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.DeleteExternalApiRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteExternalApiRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteExternalApiRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListExternalApisRequest. */ + interface IListExternalApisRequest { + + /** ListExternalApisRequest parent */ + parent?: (string|null); + + /** ListExternalApisRequest pageSize */ + pageSize?: (number|null); + + /** ListExternalApisRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListExternalApisRequest. */ + class ListExternalApisRequest implements IListExternalApisRequest { + + /** + * Constructs a new ListExternalApisRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IListExternalApisRequest); + + /** ListExternalApisRequest parent. */ + public parent: string; + + /** ListExternalApisRequest pageSize. */ + public pageSize: number; + + /** ListExternalApisRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListExternalApisRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListExternalApisRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.IListExternalApisRequest): google.cloud.apihub.v1.ListExternalApisRequest; + + /** + * Encodes the specified ListExternalApisRequest message. Does not implicitly {@link google.cloud.apihub.v1.ListExternalApisRequest.verify|verify} messages. + * @param message ListExternalApisRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IListExternalApisRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListExternalApisRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListExternalApisRequest.verify|verify} messages. + * @param message ListExternalApisRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IListExternalApisRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListExternalApisRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListExternalApisRequest + * @throws {Error} If the payload is not 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.apihub.v1.ListExternalApisRequest; + + /** + * Decodes a ListExternalApisRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListExternalApisRequest + * @throws {Error} If the payload 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.apihub.v1.ListExternalApisRequest; + + /** + * Verifies a ListExternalApisRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListExternalApisRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListExternalApisRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.ListExternalApisRequest; + + /** + * Creates a plain object from a ListExternalApisRequest message. Also converts values to other types if specified. + * @param message ListExternalApisRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.ListExternalApisRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListExternalApisRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListExternalApisRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListExternalApisResponse. */ + interface IListExternalApisResponse { + + /** ListExternalApisResponse externalApis */ + externalApis?: (google.cloud.apihub.v1.IExternalApi[]|null); + + /** ListExternalApisResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListExternalApisResponse. */ + class ListExternalApisResponse implements IListExternalApisResponse { + + /** + * Constructs a new ListExternalApisResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IListExternalApisResponse); + + /** ListExternalApisResponse externalApis. */ + public externalApis: google.cloud.apihub.v1.IExternalApi[]; + + /** ListExternalApisResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListExternalApisResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListExternalApisResponse instance + */ + public static create(properties?: google.cloud.apihub.v1.IListExternalApisResponse): google.cloud.apihub.v1.ListExternalApisResponse; + + /** + * Encodes the specified ListExternalApisResponse message. Does not implicitly {@link google.cloud.apihub.v1.ListExternalApisResponse.verify|verify} messages. + * @param message ListExternalApisResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IListExternalApisResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListExternalApisResponse message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListExternalApisResponse.verify|verify} messages. + * @param message ListExternalApisResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IListExternalApisResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListExternalApisResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListExternalApisResponse + * @throws {Error} If the payload is not 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.apihub.v1.ListExternalApisResponse; + + /** + * Decodes a ListExternalApisResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListExternalApisResponse + * @throws {Error} If the payload 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.apihub.v1.ListExternalApisResponse; + + /** + * Verifies a ListExternalApisResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListExternalApisResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListExternalApisResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.ListExternalApisResponse; + + /** + * Creates a plain object from a ListExternalApisResponse message. Also converts values to other types if specified. + * @param message ListExternalApisResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.ListExternalApisResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListExternalApisResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListExternalApisResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** LintState enum. */ + enum LintState { + LINT_STATE_UNSPECIFIED = 0, + LINT_STATE_SUCCESS = 1, + LINT_STATE_ERROR = 2 + } + + /** Linter enum. */ + enum Linter { + LINTER_UNSPECIFIED = 0, + SPECTRAL = 1, + OTHER = 2 + } + + /** Severity enum. */ + enum Severity { + SEVERITY_UNSPECIFIED = 0, + SEVERITY_ERROR = 1, + SEVERITY_WARNING = 2, + SEVERITY_INFO = 3, + SEVERITY_HINT = 4 + } + + /** Properties of an Api. */ + interface IApi { + + /** Api name */ + name?: (string|null); + + /** Api displayName */ + displayName?: (string|null); + + /** Api description */ + description?: (string|null); + + /** Api documentation */ + documentation?: (google.cloud.apihub.v1.IDocumentation|null); + + /** Api owner */ + owner?: (google.cloud.apihub.v1.IOwner|null); + + /** Api versions */ + versions?: (string[]|null); + + /** Api createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Api updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Api targetUser */ + targetUser?: (google.cloud.apihub.v1.IAttributeValues|null); + + /** Api team */ + team?: (google.cloud.apihub.v1.IAttributeValues|null); + + /** Api businessUnit */ + businessUnit?: (google.cloud.apihub.v1.IAttributeValues|null); + + /** Api maturityLevel */ + maturityLevel?: (google.cloud.apihub.v1.IAttributeValues|null); + + /** Api attributes */ + attributes?: ({ [k: string]: google.cloud.apihub.v1.IAttributeValues }|null); + + /** Api apiStyle */ + apiStyle?: (google.cloud.apihub.v1.IAttributeValues|null); + + /** Api selectedVersion */ + selectedVersion?: (string|null); + } + + /** Represents an Api. */ + class Api implements IApi { + + /** + * Constructs a new Api. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IApi); + + /** Api name. */ + public name: string; + + /** Api displayName. */ + public displayName: string; + + /** Api description. */ + public description: string; + + /** Api documentation. */ + public documentation?: (google.cloud.apihub.v1.IDocumentation|null); + + /** Api owner. */ + public owner?: (google.cloud.apihub.v1.IOwner|null); + + /** Api versions. */ + public versions: string[]; + + /** Api createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Api updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Api targetUser. */ + public targetUser?: (google.cloud.apihub.v1.IAttributeValues|null); + + /** Api team. */ + public team?: (google.cloud.apihub.v1.IAttributeValues|null); + + /** Api businessUnit. */ + public businessUnit?: (google.cloud.apihub.v1.IAttributeValues|null); + + /** Api maturityLevel. */ + public maturityLevel?: (google.cloud.apihub.v1.IAttributeValues|null); + + /** Api attributes. */ + public attributes: { [k: string]: google.cloud.apihub.v1.IAttributeValues }; + + /** Api apiStyle. */ + public apiStyle?: (google.cloud.apihub.v1.IAttributeValues|null); + + /** Api selectedVersion. */ + public selectedVersion: string; + + /** + * Creates a new Api instance using the specified properties. + * @param [properties] Properties to set + * @returns Api instance + */ + public static create(properties?: google.cloud.apihub.v1.IApi): google.cloud.apihub.v1.Api; + + /** + * Encodes the specified Api message. Does not implicitly {@link google.cloud.apihub.v1.Api.verify|verify} messages. + * @param message Api message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IApi, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Api message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.Api.verify|verify} messages. + * @param message Api message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IApi, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Api message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Api + * @throws {Error} If the payload is not 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.apihub.v1.Api; + + /** + * Decodes an Api message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Api + * @throws {Error} If the payload 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.apihub.v1.Api; + + /** + * Verifies an Api message. + * @param message Plain 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 Api message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Api + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.Api; + + /** + * Creates a plain object from an Api message. Also converts values to other types if specified. + * @param message Api + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.Api, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Api to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Api + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Version. */ + interface IVersion { + + /** Version name */ + name?: (string|null); + + /** Version displayName */ + displayName?: (string|null); + + /** Version description */ + description?: (string|null); + + /** Version documentation */ + documentation?: (google.cloud.apihub.v1.IDocumentation|null); + + /** Version specs */ + specs?: (string[]|null); + + /** Version apiOperations */ + apiOperations?: (string[]|null); + + /** Version definitions */ + definitions?: (string[]|null); + + /** Version deployments */ + deployments?: (string[]|null); + + /** Version createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Version updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Version lifecycle */ + lifecycle?: (google.cloud.apihub.v1.IAttributeValues|null); + + /** Version compliance */ + compliance?: (google.cloud.apihub.v1.IAttributeValues|null); + + /** Version accreditation */ + accreditation?: (google.cloud.apihub.v1.IAttributeValues|null); + + /** Version attributes */ + attributes?: ({ [k: string]: google.cloud.apihub.v1.IAttributeValues }|null); + + /** Version selectedDeployment */ + selectedDeployment?: (string|null); + } + + /** Represents a Version. */ + class Version implements IVersion { + + /** + * Constructs a new Version. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IVersion); + + /** Version name. */ + public name: string; + + /** Version displayName. */ + public displayName: string; + + /** Version description. */ + public description: string; + + /** Version documentation. */ + public documentation?: (google.cloud.apihub.v1.IDocumentation|null); + + /** Version specs. */ + public specs: string[]; + + /** Version apiOperations. */ + public apiOperations: string[]; + + /** Version definitions. */ + public definitions: string[]; + + /** Version deployments. */ + public deployments: string[]; + + /** Version createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Version updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Version lifecycle. */ + public lifecycle?: (google.cloud.apihub.v1.IAttributeValues|null); + + /** Version compliance. */ + public compliance?: (google.cloud.apihub.v1.IAttributeValues|null); + + /** Version accreditation. */ + public accreditation?: (google.cloud.apihub.v1.IAttributeValues|null); + + /** Version attributes. */ + public attributes: { [k: string]: google.cloud.apihub.v1.IAttributeValues }; + + /** Version selectedDeployment. */ + public selectedDeployment: string; + + /** + * Creates a new Version instance using the specified properties. + * @param [properties] Properties to set + * @returns Version instance + */ + public static create(properties?: google.cloud.apihub.v1.IVersion): google.cloud.apihub.v1.Version; + + /** + * Encodes the specified Version message. Does not implicitly {@link google.cloud.apihub.v1.Version.verify|verify} messages. + * @param message Version message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IVersion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Version message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.Version.verify|verify} messages. + * @param message Version message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IVersion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Version message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Version + * @throws {Error} If the payload is not 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.apihub.v1.Version; + + /** + * Decodes a Version message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Version + * @throws {Error} If the payload 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.apihub.v1.Version; + + /** + * Verifies a Version message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Version message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Version + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.Version; + + /** + * Creates a plain object from a Version message. Also converts values to other types if specified. + * @param message Version + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.Version, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Version to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Version + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Spec. */ + interface ISpec { + + /** Spec name */ + name?: (string|null); + + /** Spec displayName */ + displayName?: (string|null); + + /** Spec specType */ + specType?: (google.cloud.apihub.v1.IAttributeValues|null); + + /** Spec contents */ + contents?: (google.cloud.apihub.v1.ISpecContents|null); + + /** Spec details */ + details?: (google.cloud.apihub.v1.ISpecDetails|null); + + /** Spec sourceUri */ + sourceUri?: (string|null); + + /** Spec createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Spec updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Spec lintResponse */ + lintResponse?: (google.cloud.apihub.v1.ILintResponse|null); + + /** Spec attributes */ + attributes?: ({ [k: string]: google.cloud.apihub.v1.IAttributeValues }|null); + + /** Spec documentation */ + documentation?: (google.cloud.apihub.v1.IDocumentation|null); + + /** Spec parsingMode */ + parsingMode?: (google.cloud.apihub.v1.Spec.ParsingMode|keyof typeof google.cloud.apihub.v1.Spec.ParsingMode|null); + } + + /** Represents a Spec. */ + class Spec implements ISpec { + + /** + * Constructs a new Spec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.ISpec); + + /** Spec name. */ + public name: string; + + /** Spec displayName. */ + public displayName: string; + + /** Spec specType. */ + public specType?: (google.cloud.apihub.v1.IAttributeValues|null); + + /** Spec contents. */ + public contents?: (google.cloud.apihub.v1.ISpecContents|null); + + /** Spec details. */ + public details?: (google.cloud.apihub.v1.ISpecDetails|null); + + /** Spec sourceUri. */ + public sourceUri: string; + + /** Spec createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Spec updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Spec lintResponse. */ + public lintResponse?: (google.cloud.apihub.v1.ILintResponse|null); + + /** Spec attributes. */ + public attributes: { [k: string]: google.cloud.apihub.v1.IAttributeValues }; + + /** Spec documentation. */ + public documentation?: (google.cloud.apihub.v1.IDocumentation|null); + + /** Spec parsingMode. */ + public parsingMode: (google.cloud.apihub.v1.Spec.ParsingMode|keyof typeof google.cloud.apihub.v1.Spec.ParsingMode); + + /** + * Creates a new Spec instance using the specified properties. + * @param [properties] Properties to set + * @returns Spec instance + */ + public static create(properties?: google.cloud.apihub.v1.ISpec): google.cloud.apihub.v1.Spec; + + /** + * Encodes the specified Spec message. Does not implicitly {@link google.cloud.apihub.v1.Spec.verify|verify} messages. + * @param message Spec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.ISpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Spec message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.Spec.verify|verify} messages. + * @param message Spec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.ISpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Spec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Spec + * @throws {Error} If the payload is not 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.apihub.v1.Spec; + + /** + * Decodes a Spec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Spec + * @throws {Error} If the payload 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.apihub.v1.Spec; + + /** + * Verifies a Spec message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Spec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Spec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.Spec; + + /** + * Creates a plain object from a Spec message. Also converts values to other types if specified. + * @param message Spec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.Spec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Spec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Spec + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Spec { + + /** ParsingMode enum. */ + enum ParsingMode { + PARSING_MODE_UNSPECIFIED = 0, + RELAXED = 1, + STRICT = 2 + } + } + + /** Properties of a Deployment. */ + interface IDeployment { + + /** Deployment name */ + name?: (string|null); + + /** Deployment displayName */ + displayName?: (string|null); + + /** Deployment description */ + description?: (string|null); + + /** Deployment documentation */ + documentation?: (google.cloud.apihub.v1.IDocumentation|null); + + /** Deployment deploymentType */ + deploymentType?: (google.cloud.apihub.v1.IAttributeValues|null); + + /** Deployment resourceUri */ + resourceUri?: (string|null); + + /** Deployment endpoints */ + endpoints?: (string[]|null); + + /** Deployment apiVersions */ + apiVersions?: (string[]|null); + + /** Deployment createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Deployment updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Deployment slo */ + slo?: (google.cloud.apihub.v1.IAttributeValues|null); + + /** Deployment environment */ + environment?: (google.cloud.apihub.v1.IAttributeValues|null); + + /** Deployment attributes */ + attributes?: ({ [k: string]: google.cloud.apihub.v1.IAttributeValues }|null); + } + + /** Represents a Deployment. */ + class Deployment implements IDeployment { + + /** + * Constructs a new Deployment. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IDeployment); + + /** Deployment name. */ + public name: string; + + /** Deployment displayName. */ + public displayName: string; + + /** Deployment description. */ + public description: string; + + /** Deployment documentation. */ + public documentation?: (google.cloud.apihub.v1.IDocumentation|null); + + /** Deployment deploymentType. */ + public deploymentType?: (google.cloud.apihub.v1.IAttributeValues|null); + + /** Deployment resourceUri. */ + public resourceUri: string; + + /** Deployment endpoints. */ + public endpoints: string[]; + + /** Deployment apiVersions. */ + public apiVersions: string[]; + + /** Deployment createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Deployment updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Deployment slo. */ + public slo?: (google.cloud.apihub.v1.IAttributeValues|null); + + /** Deployment environment. */ + public environment?: (google.cloud.apihub.v1.IAttributeValues|null); + + /** Deployment attributes. */ + public attributes: { [k: string]: google.cloud.apihub.v1.IAttributeValues }; + + /** + * Creates a new Deployment instance using the specified properties. + * @param [properties] Properties to set + * @returns Deployment instance + */ + public static create(properties?: google.cloud.apihub.v1.IDeployment): google.cloud.apihub.v1.Deployment; + + /** + * Encodes the specified Deployment message. Does not implicitly {@link google.cloud.apihub.v1.Deployment.verify|verify} messages. + * @param message Deployment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IDeployment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Deployment message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.Deployment.verify|verify} messages. + * @param message Deployment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IDeployment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Deployment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Deployment + * @throws {Error} If the payload is not 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.apihub.v1.Deployment; + + /** + * Decodes a Deployment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Deployment + * @throws {Error} If the payload 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.apihub.v1.Deployment; + + /** + * Verifies a Deployment message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Deployment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Deployment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.Deployment; + + /** + * Creates a plain object from a Deployment message. Also converts values to other types if specified. + * @param message Deployment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.Deployment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Deployment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Deployment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ApiOperation. */ + interface IApiOperation { + + /** ApiOperation name */ + name?: (string|null); + + /** ApiOperation spec */ + spec?: (string|null); + + /** ApiOperation details */ + details?: (google.cloud.apihub.v1.IOperationDetails|null); + + /** ApiOperation createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** ApiOperation updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** ApiOperation attributes */ + attributes?: ({ [k: string]: google.cloud.apihub.v1.IAttributeValues }|null); + } + + /** Represents an ApiOperation. */ + class ApiOperation implements IApiOperation { + + /** + * Constructs a new ApiOperation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IApiOperation); + + /** ApiOperation name. */ + public name: string; + + /** ApiOperation spec. */ + public spec: string; + + /** ApiOperation details. */ + public details?: (google.cloud.apihub.v1.IOperationDetails|null); + + /** ApiOperation createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** ApiOperation updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** ApiOperation attributes. */ + public attributes: { [k: string]: google.cloud.apihub.v1.IAttributeValues }; + + /** + * Creates a new ApiOperation instance using the specified properties. + * @param [properties] Properties to set + * @returns ApiOperation instance + */ + public static create(properties?: google.cloud.apihub.v1.IApiOperation): google.cloud.apihub.v1.ApiOperation; + + /** + * Encodes the specified ApiOperation message. Does not implicitly {@link google.cloud.apihub.v1.ApiOperation.verify|verify} messages. + * @param message ApiOperation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IApiOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ApiOperation message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ApiOperation.verify|verify} messages. + * @param message ApiOperation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IApiOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ApiOperation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ApiOperation + * @throws {Error} If the payload is not 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.apihub.v1.ApiOperation; + + /** + * Decodes an ApiOperation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ApiOperation + * @throws {Error} If the payload 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.apihub.v1.ApiOperation; + + /** + * Verifies an ApiOperation message. + * @param message Plain 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 ApiOperation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ApiOperation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.ApiOperation; + + /** + * Creates a plain object from an ApiOperation message. Also converts values to other types if specified. + * @param message ApiOperation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.ApiOperation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ApiOperation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ApiOperation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Definition. */ + interface IDefinition { + + /** Definition schema */ + schema?: (google.cloud.apihub.v1.ISchema|null); + + /** Definition name */ + name?: (string|null); + + /** Definition spec */ + spec?: (string|null); + + /** Definition type */ + type?: (google.cloud.apihub.v1.Definition.Type|keyof typeof google.cloud.apihub.v1.Definition.Type|null); + + /** Definition createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Definition updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Definition attributes */ + attributes?: ({ [k: string]: google.cloud.apihub.v1.IAttributeValues }|null); + } + + /** Represents a Definition. */ + class Definition implements IDefinition { + + /** + * Constructs a new Definition. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IDefinition); + + /** Definition schema. */ + public schema?: (google.cloud.apihub.v1.ISchema|null); + + /** Definition name. */ + public name: string; + + /** Definition spec. */ + public spec: string; + + /** Definition type. */ + public type: (google.cloud.apihub.v1.Definition.Type|keyof typeof google.cloud.apihub.v1.Definition.Type); + + /** Definition createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Definition updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Definition attributes. */ + public attributes: { [k: string]: google.cloud.apihub.v1.IAttributeValues }; + + /** Definition value. */ + public value?: "schema"; + + /** + * Creates a new Definition instance using the specified properties. + * @param [properties] Properties to set + * @returns Definition instance + */ + public static create(properties?: google.cloud.apihub.v1.IDefinition): google.cloud.apihub.v1.Definition; + + /** + * Encodes the specified Definition message. Does not implicitly {@link google.cloud.apihub.v1.Definition.verify|verify} messages. + * @param message Definition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IDefinition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Definition message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.Definition.verify|verify} messages. + * @param message Definition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IDefinition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Definition message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Definition + * @throws {Error} If the payload is not 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.apihub.v1.Definition; + + /** + * Decodes a Definition message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Definition + * @throws {Error} If the payload 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.apihub.v1.Definition; + + /** + * Verifies a Definition message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Definition message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Definition + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.Definition; + + /** + * Creates a plain object from a Definition message. Also converts values to other types if specified. + * @param message Definition + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.Definition, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Definition to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Definition + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Definition { + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + SCHEMA = 1 + } + } + + /** Properties of an Attribute. */ + interface IAttribute { + + /** Attribute name */ + name?: (string|null); + + /** Attribute displayName */ + displayName?: (string|null); + + /** Attribute description */ + description?: (string|null); + + /** Attribute definitionType */ + definitionType?: (google.cloud.apihub.v1.Attribute.DefinitionType|keyof typeof google.cloud.apihub.v1.Attribute.DefinitionType|null); + + /** Attribute scope */ + scope?: (google.cloud.apihub.v1.Attribute.Scope|keyof typeof google.cloud.apihub.v1.Attribute.Scope|null); + + /** Attribute dataType */ + dataType?: (google.cloud.apihub.v1.Attribute.DataType|keyof typeof google.cloud.apihub.v1.Attribute.DataType|null); + + /** Attribute allowedValues */ + allowedValues?: (google.cloud.apihub.v1.Attribute.IAllowedValue[]|null); + + /** Attribute cardinality */ + cardinality?: (number|null); + + /** Attribute mandatory */ + mandatory?: (boolean|null); + + /** Attribute createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Attribute updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents an Attribute. */ + class Attribute implements IAttribute { + + /** + * Constructs a new Attribute. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IAttribute); + + /** Attribute name. */ + public name: string; + + /** Attribute displayName. */ + public displayName: string; + + /** Attribute description. */ + public description: string; + + /** Attribute definitionType. */ + public definitionType: (google.cloud.apihub.v1.Attribute.DefinitionType|keyof typeof google.cloud.apihub.v1.Attribute.DefinitionType); + + /** Attribute scope. */ + public scope: (google.cloud.apihub.v1.Attribute.Scope|keyof typeof google.cloud.apihub.v1.Attribute.Scope); + + /** Attribute dataType. */ + public dataType: (google.cloud.apihub.v1.Attribute.DataType|keyof typeof google.cloud.apihub.v1.Attribute.DataType); + + /** Attribute allowedValues. */ + public allowedValues: google.cloud.apihub.v1.Attribute.IAllowedValue[]; + + /** Attribute cardinality. */ + public cardinality: number; + + /** Attribute mandatory. */ + public mandatory: boolean; + + /** Attribute createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Attribute updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new Attribute instance using the specified properties. + * @param [properties] Properties to set + * @returns Attribute instance + */ + public static create(properties?: google.cloud.apihub.v1.IAttribute): google.cloud.apihub.v1.Attribute; + + /** + * Encodes the specified Attribute message. Does not implicitly {@link google.cloud.apihub.v1.Attribute.verify|verify} messages. + * @param message Attribute message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IAttribute, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Attribute message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.Attribute.verify|verify} messages. + * @param message Attribute message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IAttribute, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Attribute message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Attribute + * @throws {Error} If the payload is not 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.apihub.v1.Attribute; + + /** + * Decodes an Attribute message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Attribute + * @throws {Error} If the payload 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.apihub.v1.Attribute; + + /** + * Verifies an Attribute message. + * @param message Plain 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 Attribute message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Attribute + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.Attribute; + + /** + * Creates a plain object from an Attribute message. Also converts values to other types if specified. + * @param message Attribute + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.Attribute, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Attribute to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Attribute + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Attribute { + + /** Properties of an AllowedValue. */ + interface IAllowedValue { + + /** AllowedValue id */ + id?: (string|null); + + /** AllowedValue displayName */ + displayName?: (string|null); + + /** AllowedValue description */ + description?: (string|null); + + /** AllowedValue immutable */ + immutable?: (boolean|null); + } + + /** Represents an AllowedValue. */ + class AllowedValue implements IAllowedValue { + + /** + * Constructs a new AllowedValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.Attribute.IAllowedValue); + + /** AllowedValue id. */ + public id: string; + + /** AllowedValue displayName. */ + public displayName: string; + + /** AllowedValue description. */ + public description: string; + + /** AllowedValue immutable. */ + public immutable: boolean; + + /** + * Creates a new AllowedValue instance using the specified properties. + * @param [properties] Properties to set + * @returns AllowedValue instance + */ + public static create(properties?: google.cloud.apihub.v1.Attribute.IAllowedValue): google.cloud.apihub.v1.Attribute.AllowedValue; + + /** + * Encodes the specified AllowedValue message. Does not implicitly {@link google.cloud.apihub.v1.Attribute.AllowedValue.verify|verify} messages. + * @param message AllowedValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.Attribute.IAllowedValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AllowedValue message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.Attribute.AllowedValue.verify|verify} messages. + * @param message AllowedValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.Attribute.IAllowedValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AllowedValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AllowedValue + * @throws {Error} If the payload is not 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.apihub.v1.Attribute.AllowedValue; + + /** + * Decodes an AllowedValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AllowedValue + * @throws {Error} If the payload 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.apihub.v1.Attribute.AllowedValue; + + /** + * Verifies an AllowedValue message. + * @param message Plain 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 AllowedValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AllowedValue + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.Attribute.AllowedValue; + + /** + * Creates a plain object from an AllowedValue message. Also converts values to other types if specified. + * @param message AllowedValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.Attribute.AllowedValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AllowedValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AllowedValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** DefinitionType enum. */ + enum DefinitionType { + DEFINITION_TYPE_UNSPECIFIED = 0, + SYSTEM_DEFINED = 1, + USER_DEFINED = 2 + } + + /** Scope enum. */ + enum Scope { + SCOPE_UNSPECIFIED = 0, + API = 1, + VERSION = 2, + SPEC = 3, + API_OPERATION = 4, + DEPLOYMENT = 5, + DEPENDENCY = 6, + DEFINITION = 7, + EXTERNAL_API = 8, + PLUGIN = 9 + } + + /** DataType enum. */ + enum DataType { + DATA_TYPE_UNSPECIFIED = 0, + ENUM = 1, + JSON = 2, + STRING = 3 + } + } + + /** Properties of a SpecContents. */ + interface ISpecContents { + + /** SpecContents contents */ + contents?: (Uint8Array|string|null); + + /** SpecContents mimeType */ + mimeType?: (string|null); + } + + /** Represents a SpecContents. */ + class SpecContents implements ISpecContents { + + /** + * Constructs a new SpecContents. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.ISpecContents); + + /** SpecContents contents. */ + public contents: (Uint8Array|string); + + /** SpecContents mimeType. */ + public mimeType: string; + + /** + * Creates a new SpecContents instance using the specified properties. + * @param [properties] Properties to set + * @returns SpecContents instance + */ + public static create(properties?: google.cloud.apihub.v1.ISpecContents): google.cloud.apihub.v1.SpecContents; + + /** + * Encodes the specified SpecContents message. Does not implicitly {@link google.cloud.apihub.v1.SpecContents.verify|verify} messages. + * @param message SpecContents message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.ISpecContents, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SpecContents message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.SpecContents.verify|verify} messages. + * @param message SpecContents message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.ISpecContents, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SpecContents message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SpecContents + * @throws {Error} If the payload is not 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.apihub.v1.SpecContents; + + /** + * Decodes a SpecContents message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SpecContents + * @throws {Error} If the payload 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.apihub.v1.SpecContents; + + /** + * Verifies a SpecContents message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SpecContents message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SpecContents + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.SpecContents; + + /** + * Creates a plain object from a SpecContents message. Also converts values to other types if specified. + * @param message SpecContents + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.SpecContents, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SpecContents to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SpecContents + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SpecDetails. */ + interface ISpecDetails { + + /** SpecDetails openApiSpecDetails */ + openApiSpecDetails?: (google.cloud.apihub.v1.IOpenApiSpecDetails|null); + + /** SpecDetails description */ + description?: (string|null); + } + + /** Represents a SpecDetails. */ + class SpecDetails implements ISpecDetails { + + /** + * Constructs a new SpecDetails. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.ISpecDetails); + + /** SpecDetails openApiSpecDetails. */ + public openApiSpecDetails?: (google.cloud.apihub.v1.IOpenApiSpecDetails|null); + + /** SpecDetails description. */ + public description: string; + + /** SpecDetails details. */ + public details?: "openApiSpecDetails"; + + /** + * Creates a new SpecDetails instance using the specified properties. + * @param [properties] Properties to set + * @returns SpecDetails instance + */ + public static create(properties?: google.cloud.apihub.v1.ISpecDetails): google.cloud.apihub.v1.SpecDetails; + + /** + * Encodes the specified SpecDetails message. Does not implicitly {@link google.cloud.apihub.v1.SpecDetails.verify|verify} messages. + * @param message SpecDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.ISpecDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SpecDetails message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.SpecDetails.verify|verify} messages. + * @param message SpecDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.ISpecDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SpecDetails message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SpecDetails + * @throws {Error} If the payload is not 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.apihub.v1.SpecDetails; + + /** + * Decodes a SpecDetails message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SpecDetails + * @throws {Error} If the payload 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.apihub.v1.SpecDetails; + + /** + * Verifies a SpecDetails message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SpecDetails message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SpecDetails + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.SpecDetails; + + /** + * Creates a plain object from a SpecDetails message. Also converts values to other types if specified. + * @param message SpecDetails + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.SpecDetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SpecDetails to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SpecDetails + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OpenApiSpecDetails. */ + interface IOpenApiSpecDetails { + + /** OpenApiSpecDetails format */ + format?: (google.cloud.apihub.v1.OpenApiSpecDetails.Format|keyof typeof google.cloud.apihub.v1.OpenApiSpecDetails.Format|null); + + /** OpenApiSpecDetails version */ + version?: (string|null); + + /** OpenApiSpecDetails owner */ + owner?: (google.cloud.apihub.v1.IOwner|null); + } + + /** Represents an OpenApiSpecDetails. */ + class OpenApiSpecDetails implements IOpenApiSpecDetails { + + /** + * Constructs a new OpenApiSpecDetails. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IOpenApiSpecDetails); + + /** OpenApiSpecDetails format. */ + public format: (google.cloud.apihub.v1.OpenApiSpecDetails.Format|keyof typeof google.cloud.apihub.v1.OpenApiSpecDetails.Format); + + /** OpenApiSpecDetails version. */ + public version: string; + + /** OpenApiSpecDetails owner. */ + public owner?: (google.cloud.apihub.v1.IOwner|null); + + /** + * Creates a new OpenApiSpecDetails instance using the specified properties. + * @param [properties] Properties to set + * @returns OpenApiSpecDetails instance + */ + public static create(properties?: google.cloud.apihub.v1.IOpenApiSpecDetails): google.cloud.apihub.v1.OpenApiSpecDetails; + + /** + * Encodes the specified OpenApiSpecDetails message. Does not implicitly {@link google.cloud.apihub.v1.OpenApiSpecDetails.verify|verify} messages. + * @param message OpenApiSpecDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IOpenApiSpecDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OpenApiSpecDetails message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.OpenApiSpecDetails.verify|verify} messages. + * @param message OpenApiSpecDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IOpenApiSpecDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OpenApiSpecDetails message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OpenApiSpecDetails + * @throws {Error} If the payload is not 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.apihub.v1.OpenApiSpecDetails; + + /** + * Decodes an OpenApiSpecDetails message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OpenApiSpecDetails + * @throws {Error} If the payload 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.apihub.v1.OpenApiSpecDetails; + + /** + * Verifies an OpenApiSpecDetails message. + * @param message Plain 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 OpenApiSpecDetails message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OpenApiSpecDetails + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.OpenApiSpecDetails; + + /** + * Creates a plain object from an OpenApiSpecDetails message. Also converts values to other types if specified. + * @param message OpenApiSpecDetails + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.OpenApiSpecDetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OpenApiSpecDetails to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OpenApiSpecDetails + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace OpenApiSpecDetails { + + /** Format enum. */ + enum Format { + FORMAT_UNSPECIFIED = 0, + OPEN_API_SPEC_2_0 = 1, + OPEN_API_SPEC_3_0 = 2, + OPEN_API_SPEC_3_1 = 3 + } + } + + /** Properties of an OperationDetails. */ + interface IOperationDetails { + + /** OperationDetails httpOperation */ + httpOperation?: (google.cloud.apihub.v1.IHttpOperation|null); + + /** OperationDetails description */ + description?: (string|null); + + /** OperationDetails documentation */ + documentation?: (google.cloud.apihub.v1.IDocumentation|null); + + /** OperationDetails deprecated */ + deprecated?: (boolean|null); + } + + /** Represents an OperationDetails. */ + class OperationDetails implements IOperationDetails { + + /** + * Constructs a new OperationDetails. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IOperationDetails); + + /** OperationDetails httpOperation. */ + public httpOperation?: (google.cloud.apihub.v1.IHttpOperation|null); + + /** OperationDetails description. */ + public description: string; + + /** OperationDetails documentation. */ + public documentation?: (google.cloud.apihub.v1.IDocumentation|null); + + /** OperationDetails deprecated. */ + public deprecated: boolean; + + /** OperationDetails operation. */ + public operation?: "httpOperation"; + + /** + * Creates a new OperationDetails instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationDetails instance + */ + public static create(properties?: google.cloud.apihub.v1.IOperationDetails): google.cloud.apihub.v1.OperationDetails; + + /** + * Encodes the specified OperationDetails message. Does not implicitly {@link google.cloud.apihub.v1.OperationDetails.verify|verify} messages. + * @param message OperationDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IOperationDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationDetails message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.OperationDetails.verify|verify} messages. + * @param message OperationDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IOperationDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationDetails message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationDetails + * @throws {Error} If the payload is not 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.apihub.v1.OperationDetails; + + /** + * Decodes an OperationDetails message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationDetails + * @throws {Error} If the payload 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.apihub.v1.OperationDetails; + + /** + * Verifies an OperationDetails message. + * @param message Plain 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 OperationDetails message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationDetails + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.OperationDetails; + + /** + * Creates a plain object from an OperationDetails message. Also converts values to other types if specified. + * @param message OperationDetails + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.OperationDetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationDetails to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OperationDetails + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a HttpOperation. */ + interface IHttpOperation { + + /** HttpOperation path */ + path?: (google.cloud.apihub.v1.IPath|null); + + /** HttpOperation method */ + method?: (google.cloud.apihub.v1.HttpOperation.Method|keyof typeof google.cloud.apihub.v1.HttpOperation.Method|null); + } + + /** Represents a HttpOperation. */ + class HttpOperation implements IHttpOperation { + + /** + * Constructs a new HttpOperation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IHttpOperation); + + /** HttpOperation path. */ + public path?: (google.cloud.apihub.v1.IPath|null); + + /** HttpOperation method. */ + public method: (google.cloud.apihub.v1.HttpOperation.Method|keyof typeof google.cloud.apihub.v1.HttpOperation.Method); + + /** + * Creates a new HttpOperation instance using the specified properties. + * @param [properties] Properties to set + * @returns HttpOperation instance + */ + public static create(properties?: google.cloud.apihub.v1.IHttpOperation): google.cloud.apihub.v1.HttpOperation; + + /** + * Encodes the specified HttpOperation message. Does not implicitly {@link google.cloud.apihub.v1.HttpOperation.verify|verify} messages. + * @param message HttpOperation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IHttpOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HttpOperation message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.HttpOperation.verify|verify} messages. + * @param message HttpOperation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IHttpOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HttpOperation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HttpOperation + * @throws {Error} If the payload is not 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.apihub.v1.HttpOperation; + + /** + * Decodes a HttpOperation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HttpOperation + * @throws {Error} If the payload 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.apihub.v1.HttpOperation; + + /** + * Verifies a HttpOperation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HttpOperation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HttpOperation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.HttpOperation; + + /** + * Creates a plain object from a HttpOperation message. Also converts values to other types if specified. + * @param message HttpOperation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.HttpOperation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HttpOperation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HttpOperation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace HttpOperation { + + /** Method enum. */ + enum Method { + METHOD_UNSPECIFIED = 0, + GET = 1, + PUT = 2, + POST = 3, + DELETE = 4, + OPTIONS = 5, + HEAD = 6, + PATCH = 7, + TRACE = 8 + } + } + + /** Properties of a Path. */ + interface IPath { + + /** Path path */ + path?: (string|null); + + /** Path description */ + description?: (string|null); + } + + /** Represents a Path. */ + class Path implements IPath { + + /** + * Constructs a new Path. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IPath); + + /** Path path. */ + public path: string; + + /** Path description. */ + public description: string; + + /** + * Creates a new Path instance using the specified properties. + * @param [properties] Properties to set + * @returns Path instance + */ + public static create(properties?: google.cloud.apihub.v1.IPath): google.cloud.apihub.v1.Path; + + /** + * Encodes the specified Path message. Does not implicitly {@link google.cloud.apihub.v1.Path.verify|verify} messages. + * @param message Path message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IPath, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Path message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.Path.verify|verify} messages. + * @param message Path message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IPath, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Path message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Path + * @throws {Error} If the payload is not 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.apihub.v1.Path; + + /** + * Decodes a Path message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Path + * @throws {Error} If the payload 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.apihub.v1.Path; + + /** + * Verifies a Path message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Path message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Path + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.Path; + + /** + * Creates a plain object from a Path message. Also converts values to other types if specified. + * @param message Path + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.Path, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Path to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Path + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Schema. */ + interface ISchema { + + /** Schema displayName */ + displayName?: (string|null); + + /** Schema rawValue */ + rawValue?: (Uint8Array|string|null); + } + + /** Represents a Schema. */ + class Schema implements ISchema { + + /** + * Constructs a new Schema. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.ISchema); + + /** Schema displayName. */ + public displayName: string; + + /** Schema rawValue. */ + public rawValue: (Uint8Array|string); + + /** + * Creates a new Schema instance using the specified properties. + * @param [properties] Properties to set + * @returns Schema instance + */ + public static create(properties?: google.cloud.apihub.v1.ISchema): google.cloud.apihub.v1.Schema; + + /** + * Encodes the specified Schema message. Does not implicitly {@link google.cloud.apihub.v1.Schema.verify|verify} messages. + * @param message Schema message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.ISchema, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Schema message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.Schema.verify|verify} messages. + * @param message Schema message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.ISchema, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Schema message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Schema + * @throws {Error} If the payload is not 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.apihub.v1.Schema; + + /** + * Decodes a Schema message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Schema + * @throws {Error} If the payload 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.apihub.v1.Schema; + + /** + * Verifies a Schema message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Schema message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Schema + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.Schema; + + /** + * Creates a plain object from a Schema message. Also converts values to other types if specified. + * @param message Schema + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.Schema, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Schema to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Schema + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Owner. */ + interface IOwner { + + /** Owner displayName */ + displayName?: (string|null); + + /** Owner email */ + email?: (string|null); + } + + /** Represents an Owner. */ + class Owner implements IOwner { + + /** + * Constructs a new Owner. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IOwner); + + /** Owner displayName. */ + public displayName: string; + + /** Owner email. */ + public email: string; + + /** + * Creates a new Owner instance using the specified properties. + * @param [properties] Properties to set + * @returns Owner instance + */ + public static create(properties?: google.cloud.apihub.v1.IOwner): google.cloud.apihub.v1.Owner; + + /** + * Encodes the specified Owner message. Does not implicitly {@link google.cloud.apihub.v1.Owner.verify|verify} messages. + * @param message Owner message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IOwner, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Owner message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.Owner.verify|verify} messages. + * @param message Owner message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IOwner, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Owner message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Owner + * @throws {Error} If the payload is not 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.apihub.v1.Owner; + + /** + * Decodes an Owner message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Owner + * @throws {Error} If the payload 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.apihub.v1.Owner; + + /** + * Verifies an Owner message. + * @param message Plain 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 Owner message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Owner + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.Owner; + + /** + * Creates a plain object from an Owner message. Also converts values to other types if specified. + * @param message Owner + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.Owner, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Owner to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Owner + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Documentation. */ + interface IDocumentation { + + /** Documentation externalUri */ + externalUri?: (string|null); + } + + /** Represents a Documentation. */ + class Documentation implements IDocumentation { + + /** + * Constructs a new Documentation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IDocumentation); + + /** Documentation externalUri. */ + public externalUri: string; + + /** + * Creates a new Documentation instance using the specified properties. + * @param [properties] Properties to set + * @returns Documentation instance + */ + public static create(properties?: google.cloud.apihub.v1.IDocumentation): google.cloud.apihub.v1.Documentation; + + /** + * Encodes the specified Documentation message. Does not implicitly {@link google.cloud.apihub.v1.Documentation.verify|verify} messages. + * @param message Documentation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IDocumentation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Documentation message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.Documentation.verify|verify} messages. + * @param message Documentation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IDocumentation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Documentation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Documentation + * @throws {Error} If the payload is not 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.apihub.v1.Documentation; + + /** + * Decodes a Documentation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Documentation + * @throws {Error} If the payload 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.apihub.v1.Documentation; + + /** + * Verifies a Documentation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Documentation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Documentation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.Documentation; + + /** + * Creates a plain object from a Documentation message. Also converts values to other types if specified. + * @param message Documentation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.Documentation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Documentation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Documentation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AttributeValues. */ + interface IAttributeValues { + + /** AttributeValues enumValues */ + enumValues?: (google.cloud.apihub.v1.AttributeValues.IEnumAttributeValues|null); + + /** AttributeValues stringValues */ + stringValues?: (google.cloud.apihub.v1.AttributeValues.IStringAttributeValues|null); + + /** AttributeValues jsonValues */ + jsonValues?: (google.cloud.apihub.v1.AttributeValues.IStringAttributeValues|null); + + /** AttributeValues attribute */ + attribute?: (string|null); + } + + /** Represents an AttributeValues. */ + class AttributeValues implements IAttributeValues { + + /** + * Constructs a new AttributeValues. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IAttributeValues); + + /** AttributeValues enumValues. */ + public enumValues?: (google.cloud.apihub.v1.AttributeValues.IEnumAttributeValues|null); + + /** AttributeValues stringValues. */ + public stringValues?: (google.cloud.apihub.v1.AttributeValues.IStringAttributeValues|null); + + /** AttributeValues jsonValues. */ + public jsonValues?: (google.cloud.apihub.v1.AttributeValues.IStringAttributeValues|null); + + /** AttributeValues attribute. */ + public attribute: string; + + /** AttributeValues Value. */ + public Value?: ("enumValues"|"stringValues"|"jsonValues"); + + /** + * Creates a new AttributeValues instance using the specified properties. + * @param [properties] Properties to set + * @returns AttributeValues instance + */ + public static create(properties?: google.cloud.apihub.v1.IAttributeValues): google.cloud.apihub.v1.AttributeValues; + + /** + * Encodes the specified AttributeValues message. Does not implicitly {@link google.cloud.apihub.v1.AttributeValues.verify|verify} messages. + * @param message AttributeValues message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IAttributeValues, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AttributeValues message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.AttributeValues.verify|verify} messages. + * @param message AttributeValues message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IAttributeValues, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AttributeValues message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AttributeValues + * @throws {Error} If the payload is not 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.apihub.v1.AttributeValues; + + /** + * Decodes an AttributeValues message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AttributeValues + * @throws {Error} If the payload 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.apihub.v1.AttributeValues; + + /** + * Verifies an AttributeValues message. + * @param message Plain 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 AttributeValues message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AttributeValues + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.AttributeValues; + + /** + * Creates a plain object from an AttributeValues message. Also converts values to other types if specified. + * @param message AttributeValues + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.AttributeValues, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AttributeValues to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AttributeValues + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AttributeValues { + + /** Properties of an EnumAttributeValues. */ + interface IEnumAttributeValues { + + /** EnumAttributeValues values */ + values?: (google.cloud.apihub.v1.Attribute.IAllowedValue[]|null); + } + + /** Represents an EnumAttributeValues. */ + class EnumAttributeValues implements IEnumAttributeValues { + + /** + * Constructs a new EnumAttributeValues. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.AttributeValues.IEnumAttributeValues); + + /** EnumAttributeValues values. */ + public values: google.cloud.apihub.v1.Attribute.IAllowedValue[]; + + /** + * Creates a new EnumAttributeValues instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumAttributeValues instance + */ + public static create(properties?: google.cloud.apihub.v1.AttributeValues.IEnumAttributeValues): google.cloud.apihub.v1.AttributeValues.EnumAttributeValues; + + /** + * Encodes the specified EnumAttributeValues message. Does not implicitly {@link google.cloud.apihub.v1.AttributeValues.EnumAttributeValues.verify|verify} messages. + * @param message EnumAttributeValues message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.AttributeValues.IEnumAttributeValues, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumAttributeValues message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.AttributeValues.EnumAttributeValues.verify|verify} messages. + * @param message EnumAttributeValues message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.AttributeValues.IEnumAttributeValues, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumAttributeValues message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumAttributeValues + * @throws {Error} If the payload is not 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.apihub.v1.AttributeValues.EnumAttributeValues; + + /** + * Decodes an EnumAttributeValues message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumAttributeValues + * @throws {Error} If the payload 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.apihub.v1.AttributeValues.EnumAttributeValues; + + /** + * Verifies an EnumAttributeValues message. + * @param message Plain 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 EnumAttributeValues message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumAttributeValues + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.AttributeValues.EnumAttributeValues; + + /** + * Creates a plain object from an EnumAttributeValues message. Also converts values to other types if specified. + * @param message EnumAttributeValues + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.AttributeValues.EnumAttributeValues, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumAttributeValues to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumAttributeValues + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StringAttributeValues. */ + interface IStringAttributeValues { + + /** StringAttributeValues values */ + values?: (string[]|null); + } + + /** Represents a StringAttributeValues. */ + class StringAttributeValues implements IStringAttributeValues { + + /** + * Constructs a new StringAttributeValues. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.AttributeValues.IStringAttributeValues); + + /** StringAttributeValues values. */ + public values: string[]; + + /** + * Creates a new StringAttributeValues instance using the specified properties. + * @param [properties] Properties to set + * @returns StringAttributeValues instance + */ + public static create(properties?: google.cloud.apihub.v1.AttributeValues.IStringAttributeValues): google.cloud.apihub.v1.AttributeValues.StringAttributeValues; + + /** + * Encodes the specified StringAttributeValues message. Does not implicitly {@link google.cloud.apihub.v1.AttributeValues.StringAttributeValues.verify|verify} messages. + * @param message StringAttributeValues message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.AttributeValues.IStringAttributeValues, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StringAttributeValues message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.AttributeValues.StringAttributeValues.verify|verify} messages. + * @param message StringAttributeValues message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.AttributeValues.IStringAttributeValues, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StringAttributeValues message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StringAttributeValues + * @throws {Error} If the payload is not 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.apihub.v1.AttributeValues.StringAttributeValues; + + /** + * Decodes a StringAttributeValues message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StringAttributeValues + * @throws {Error} If the payload 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.apihub.v1.AttributeValues.StringAttributeValues; + + /** + * Verifies a StringAttributeValues message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StringAttributeValues message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StringAttributeValues + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.AttributeValues.StringAttributeValues; + + /** + * Creates a plain object from a StringAttributeValues message. Also converts values to other types if specified. + * @param message StringAttributeValues + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.AttributeValues.StringAttributeValues, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StringAttributeValues to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StringAttributeValues + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a Dependency. */ + interface IDependency { + + /** Dependency name */ + name?: (string|null); + + /** Dependency consumer */ + consumer?: (google.cloud.apihub.v1.IDependencyEntityReference|null); + + /** Dependency supplier */ + supplier?: (google.cloud.apihub.v1.IDependencyEntityReference|null); + + /** Dependency state */ + state?: (google.cloud.apihub.v1.Dependency.State|keyof typeof google.cloud.apihub.v1.Dependency.State|null); + + /** Dependency description */ + description?: (string|null); + + /** Dependency discoveryMode */ + discoveryMode?: (google.cloud.apihub.v1.Dependency.DiscoveryMode|keyof typeof google.cloud.apihub.v1.Dependency.DiscoveryMode|null); + + /** Dependency errorDetail */ + errorDetail?: (google.cloud.apihub.v1.IDependencyErrorDetail|null); + + /** Dependency createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Dependency updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Dependency attributes */ + attributes?: ({ [k: string]: google.cloud.apihub.v1.IAttributeValues }|null); + } + + /** Represents a Dependency. */ + class Dependency implements IDependency { + + /** + * Constructs a new Dependency. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IDependency); + + /** Dependency name. */ + public name: string; + + /** Dependency consumer. */ + public consumer?: (google.cloud.apihub.v1.IDependencyEntityReference|null); + + /** Dependency supplier. */ + public supplier?: (google.cloud.apihub.v1.IDependencyEntityReference|null); + + /** Dependency state. */ + public state: (google.cloud.apihub.v1.Dependency.State|keyof typeof google.cloud.apihub.v1.Dependency.State); + + /** Dependency description. */ + public description: string; + + /** Dependency discoveryMode. */ + public discoveryMode: (google.cloud.apihub.v1.Dependency.DiscoveryMode|keyof typeof google.cloud.apihub.v1.Dependency.DiscoveryMode); + + /** Dependency errorDetail. */ + public errorDetail?: (google.cloud.apihub.v1.IDependencyErrorDetail|null); + + /** Dependency createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Dependency updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Dependency attributes. */ + public attributes: { [k: string]: google.cloud.apihub.v1.IAttributeValues }; + + /** + * Creates a new Dependency instance using the specified properties. + * @param [properties] Properties to set + * @returns Dependency instance + */ + public static create(properties?: google.cloud.apihub.v1.IDependency): google.cloud.apihub.v1.Dependency; + + /** + * Encodes the specified Dependency message. Does not implicitly {@link google.cloud.apihub.v1.Dependency.verify|verify} messages. + * @param message Dependency message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IDependency, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Dependency message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.Dependency.verify|verify} messages. + * @param message Dependency message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IDependency, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Dependency message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Dependency + * @throws {Error} If the payload is not 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.apihub.v1.Dependency; + + /** + * Decodes a Dependency message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Dependency + * @throws {Error} If the payload 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.apihub.v1.Dependency; + + /** + * Verifies a Dependency message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Dependency message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Dependency + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.Dependency; + + /** + * Creates a plain object from a Dependency message. Also converts values to other types if specified. + * @param message Dependency + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.Dependency, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Dependency to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Dependency + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Dependency { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + PROPOSED = 1, + VALIDATED = 2 + } + + /** DiscoveryMode enum. */ + enum DiscoveryMode { + DISCOVERY_MODE_UNSPECIFIED = 0, + MANUAL = 1 + } + } + + /** Properties of a DependencyEntityReference. */ + interface IDependencyEntityReference { + + /** DependencyEntityReference operationResourceName */ + operationResourceName?: (string|null); + + /** DependencyEntityReference externalApiResourceName */ + externalApiResourceName?: (string|null); + + /** DependencyEntityReference displayName */ + displayName?: (string|null); + } + + /** Represents a DependencyEntityReference. */ + class DependencyEntityReference implements IDependencyEntityReference { + + /** + * Constructs a new DependencyEntityReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IDependencyEntityReference); + + /** DependencyEntityReference operationResourceName. */ + public operationResourceName?: (string|null); + + /** DependencyEntityReference externalApiResourceName. */ + public externalApiResourceName?: (string|null); + + /** DependencyEntityReference displayName. */ + public displayName: string; + + /** DependencyEntityReference identifier. */ + public identifier?: ("operationResourceName"|"externalApiResourceName"); + + /** + * Creates a new DependencyEntityReference instance using the specified properties. + * @param [properties] Properties to set + * @returns DependencyEntityReference instance + */ + public static create(properties?: google.cloud.apihub.v1.IDependencyEntityReference): google.cloud.apihub.v1.DependencyEntityReference; + + /** + * Encodes the specified DependencyEntityReference message. Does not implicitly {@link google.cloud.apihub.v1.DependencyEntityReference.verify|verify} messages. + * @param message DependencyEntityReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IDependencyEntityReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DependencyEntityReference message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.DependencyEntityReference.verify|verify} messages. + * @param message DependencyEntityReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IDependencyEntityReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DependencyEntityReference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DependencyEntityReference + * @throws {Error} If the payload is not 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.apihub.v1.DependencyEntityReference; + + /** + * Decodes a DependencyEntityReference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DependencyEntityReference + * @throws {Error} If the payload 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.apihub.v1.DependencyEntityReference; + + /** + * Verifies a DependencyEntityReference message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DependencyEntityReference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DependencyEntityReference + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.DependencyEntityReference; + + /** + * Creates a plain object from a DependencyEntityReference message. Also converts values to other types if specified. + * @param message DependencyEntityReference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.DependencyEntityReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DependencyEntityReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DependencyEntityReference + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DependencyErrorDetail. */ + interface IDependencyErrorDetail { + + /** DependencyErrorDetail error */ + error?: (google.cloud.apihub.v1.DependencyErrorDetail.Error|keyof typeof google.cloud.apihub.v1.DependencyErrorDetail.Error|null); + + /** DependencyErrorDetail errorTime */ + errorTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a DependencyErrorDetail. */ + class DependencyErrorDetail implements IDependencyErrorDetail { + + /** + * Constructs a new DependencyErrorDetail. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IDependencyErrorDetail); + + /** DependencyErrorDetail error. */ + public error: (google.cloud.apihub.v1.DependencyErrorDetail.Error|keyof typeof google.cloud.apihub.v1.DependencyErrorDetail.Error); + + /** DependencyErrorDetail errorTime. */ + public errorTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new DependencyErrorDetail instance using the specified properties. + * @param [properties] Properties to set + * @returns DependencyErrorDetail instance + */ + public static create(properties?: google.cloud.apihub.v1.IDependencyErrorDetail): google.cloud.apihub.v1.DependencyErrorDetail; + + /** + * Encodes the specified DependencyErrorDetail message. Does not implicitly {@link google.cloud.apihub.v1.DependencyErrorDetail.verify|verify} messages. + * @param message DependencyErrorDetail message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IDependencyErrorDetail, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DependencyErrorDetail message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.DependencyErrorDetail.verify|verify} messages. + * @param message DependencyErrorDetail message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IDependencyErrorDetail, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DependencyErrorDetail message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DependencyErrorDetail + * @throws {Error} If the payload is not 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.apihub.v1.DependencyErrorDetail; + + /** + * Decodes a DependencyErrorDetail message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DependencyErrorDetail + * @throws {Error} If the payload 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.apihub.v1.DependencyErrorDetail; + + /** + * Verifies a DependencyErrorDetail message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DependencyErrorDetail message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DependencyErrorDetail + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.DependencyErrorDetail; + + /** + * Creates a plain object from a DependencyErrorDetail message. Also converts values to other types if specified. + * @param message DependencyErrorDetail + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.DependencyErrorDetail, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DependencyErrorDetail to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DependencyErrorDetail + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DependencyErrorDetail { + + /** Error enum. */ + enum Error { + ERROR_UNSPECIFIED = 0, + SUPPLIER_NOT_FOUND = 1, + SUPPLIER_RECREATED = 2 + } + } + + /** Properties of a LintResponse. */ + interface ILintResponse { + + /** LintResponse issues */ + issues?: (google.cloud.apihub.v1.IIssue[]|null); + + /** LintResponse summary */ + summary?: (google.cloud.apihub.v1.LintResponse.ISummaryEntry[]|null); + + /** LintResponse state */ + state?: (google.cloud.apihub.v1.LintState|keyof typeof google.cloud.apihub.v1.LintState|null); + + /** LintResponse source */ + source?: (string|null); + + /** LintResponse linter */ + linter?: (google.cloud.apihub.v1.Linter|keyof typeof google.cloud.apihub.v1.Linter|null); + + /** LintResponse createTime */ + createTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a LintResponse. */ + class LintResponse implements ILintResponse { + + /** + * Constructs a new LintResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.ILintResponse); + + /** LintResponse issues. */ + public issues: google.cloud.apihub.v1.IIssue[]; + + /** LintResponse summary. */ + public summary: google.cloud.apihub.v1.LintResponse.ISummaryEntry[]; + + /** LintResponse state. */ + public state: (google.cloud.apihub.v1.LintState|keyof typeof google.cloud.apihub.v1.LintState); + + /** LintResponse source. */ + public source: string; + + /** LintResponse linter. */ + public linter: (google.cloud.apihub.v1.Linter|keyof typeof google.cloud.apihub.v1.Linter); + + /** LintResponse createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new LintResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns LintResponse instance + */ + public static create(properties?: google.cloud.apihub.v1.ILintResponse): google.cloud.apihub.v1.LintResponse; + + /** + * Encodes the specified LintResponse message. Does not implicitly {@link google.cloud.apihub.v1.LintResponse.verify|verify} messages. + * @param message LintResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.ILintResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LintResponse message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.LintResponse.verify|verify} messages. + * @param message LintResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.ILintResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LintResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LintResponse + * @throws {Error} If the payload is not 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.apihub.v1.LintResponse; + + /** + * Decodes a LintResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LintResponse + * @throws {Error} If the payload 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.apihub.v1.LintResponse; + + /** + * Verifies a LintResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LintResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LintResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.LintResponse; + + /** + * Creates a plain object from a LintResponse message. Also converts values to other types if specified. + * @param message LintResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.LintResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LintResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LintResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace LintResponse { + + /** Properties of a SummaryEntry. */ + interface ISummaryEntry { + + /** SummaryEntry severity */ + severity?: (google.cloud.apihub.v1.Severity|keyof typeof google.cloud.apihub.v1.Severity|null); + + /** SummaryEntry count */ + count?: (number|null); + } + + /** Represents a SummaryEntry. */ + class SummaryEntry implements ISummaryEntry { + + /** + * Constructs a new SummaryEntry. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.LintResponse.ISummaryEntry); + + /** SummaryEntry severity. */ + public severity: (google.cloud.apihub.v1.Severity|keyof typeof google.cloud.apihub.v1.Severity); + + /** SummaryEntry count. */ + public count: number; + + /** + * Creates a new SummaryEntry instance using the specified properties. + * @param [properties] Properties to set + * @returns SummaryEntry instance + */ + public static create(properties?: google.cloud.apihub.v1.LintResponse.ISummaryEntry): google.cloud.apihub.v1.LintResponse.SummaryEntry; + + /** + * Encodes the specified SummaryEntry message. Does not implicitly {@link google.cloud.apihub.v1.LintResponse.SummaryEntry.verify|verify} messages. + * @param message SummaryEntry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.LintResponse.ISummaryEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SummaryEntry message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.LintResponse.SummaryEntry.verify|verify} messages. + * @param message SummaryEntry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.LintResponse.ISummaryEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SummaryEntry message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SummaryEntry + * @throws {Error} If the payload is not 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.apihub.v1.LintResponse.SummaryEntry; + + /** + * Decodes a SummaryEntry message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SummaryEntry + * @throws {Error} If the payload 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.apihub.v1.LintResponse.SummaryEntry; + + /** + * Verifies a SummaryEntry message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SummaryEntry message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SummaryEntry + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.LintResponse.SummaryEntry; + + /** + * Creates a plain object from a SummaryEntry message. Also converts values to other types if specified. + * @param message SummaryEntry + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.LintResponse.SummaryEntry, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SummaryEntry to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SummaryEntry + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an Issue. */ + interface IIssue { + + /** Issue code */ + code?: (string|null); + + /** Issue path */ + path?: (string[]|null); + + /** Issue message */ + message?: (string|null); + + /** Issue severity */ + severity?: (google.cloud.apihub.v1.Severity|keyof typeof google.cloud.apihub.v1.Severity|null); + + /** Issue range */ + range?: (google.cloud.apihub.v1.IRange|null); + } + + /** Represents an Issue. */ + class Issue implements IIssue { + + /** + * Constructs a new Issue. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IIssue); + + /** Issue code. */ + public code: string; + + /** Issue path. */ + public path: string[]; + + /** Issue message. */ + public message: string; + + /** Issue severity. */ + public severity: (google.cloud.apihub.v1.Severity|keyof typeof google.cloud.apihub.v1.Severity); + + /** Issue range. */ + public range?: (google.cloud.apihub.v1.IRange|null); + + /** + * Creates a new Issue instance using the specified properties. + * @param [properties] Properties to set + * @returns Issue instance + */ + public static create(properties?: google.cloud.apihub.v1.IIssue): google.cloud.apihub.v1.Issue; + + /** + * Encodes the specified Issue message. Does not implicitly {@link google.cloud.apihub.v1.Issue.verify|verify} messages. + * @param message Issue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IIssue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Issue message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.Issue.verify|verify} messages. + * @param message Issue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IIssue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Issue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Issue + * @throws {Error} If the payload is not 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.apihub.v1.Issue; + + /** + * Decodes an Issue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Issue + * @throws {Error} If the payload 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.apihub.v1.Issue; + + /** + * Verifies an Issue message. + * @param message Plain 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 Issue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Issue + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.Issue; + + /** + * Creates a plain object from an Issue message. Also converts values to other types if specified. + * @param message Issue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.Issue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Issue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Issue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Range. */ + interface IRange { + + /** Range start */ + start?: (google.cloud.apihub.v1.IPoint|null); + + /** Range end */ + end?: (google.cloud.apihub.v1.IPoint|null); + } + + /** Represents a Range. */ + class Range implements IRange { + + /** + * Constructs a new Range. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IRange); + + /** Range start. */ + public start?: (google.cloud.apihub.v1.IPoint|null); + + /** Range end. */ + public end?: (google.cloud.apihub.v1.IPoint|null); + + /** + * Creates a new Range instance using the specified properties. + * @param [properties] Properties to set + * @returns Range instance + */ + public static create(properties?: google.cloud.apihub.v1.IRange): google.cloud.apihub.v1.Range; + + /** + * Encodes the specified Range message. Does not implicitly {@link google.cloud.apihub.v1.Range.verify|verify} messages. + * @param message Range message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Range message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.Range.verify|verify} messages. + * @param message Range message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Range message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Range + * @throws {Error} If the payload is not 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.apihub.v1.Range; + + /** + * Decodes a Range message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Range + * @throws {Error} If the payload 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.apihub.v1.Range; + + /** + * Verifies a Range message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Range message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Range + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.Range; + + /** + * Creates a plain object from a Range message. Also converts values to other types if specified. + * @param message Range + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.Range, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Range to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Range + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Point. */ + interface IPoint { + + /** Point line */ + line?: (number|null); + + /** Point character */ + character?: (number|null); + } + + /** Represents a Point. */ + class Point implements IPoint { + + /** + * Constructs a new Point. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IPoint); + + /** Point line. */ + public line: number; + + /** Point character. */ + public character: number; + + /** + * Creates a new Point instance using the specified properties. + * @param [properties] Properties to set + * @returns Point instance + */ + public static create(properties?: google.cloud.apihub.v1.IPoint): google.cloud.apihub.v1.Point; + + /** + * Encodes the specified Point message. Does not implicitly {@link google.cloud.apihub.v1.Point.verify|verify} messages. + * @param message Point message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IPoint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Point message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.Point.verify|verify} messages. + * @param message Point message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IPoint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Point message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Point + * @throws {Error} If the payload is not 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.apihub.v1.Point; + + /** + * Decodes a Point message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Point + * @throws {Error} If the payload 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.apihub.v1.Point; + + /** + * Verifies a Point message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Point message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Point + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.Point; + + /** + * Creates a plain object from a Point message. Also converts values to other types if specified. + * @param message Point + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.Point, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Point to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Point + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** 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.apihub.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.apihub.v1.IOperationMetadata): google.cloud.apihub.v1.OperationMetadata; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.apihub.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.apihub.v1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.apihub.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.apihub.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.apihub.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.apihub.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.apihub.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.apihub.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 an ApiHubInstance. */ + interface IApiHubInstance { + + /** ApiHubInstance name */ + name?: (string|null); + + /** ApiHubInstance createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** ApiHubInstance updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** ApiHubInstance state */ + state?: (google.cloud.apihub.v1.ApiHubInstance.State|keyof typeof google.cloud.apihub.v1.ApiHubInstance.State|null); + + /** ApiHubInstance stateMessage */ + stateMessage?: (string|null); + + /** ApiHubInstance config */ + config?: (google.cloud.apihub.v1.ApiHubInstance.IConfig|null); + + /** ApiHubInstance labels */ + labels?: ({ [k: string]: string }|null); + + /** ApiHubInstance description */ + description?: (string|null); + } + + /** Represents an ApiHubInstance. */ + class ApiHubInstance implements IApiHubInstance { + + /** + * Constructs a new ApiHubInstance. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IApiHubInstance); + + /** ApiHubInstance name. */ + public name: string; + + /** ApiHubInstance createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** ApiHubInstance updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** ApiHubInstance state. */ + public state: (google.cloud.apihub.v1.ApiHubInstance.State|keyof typeof google.cloud.apihub.v1.ApiHubInstance.State); + + /** ApiHubInstance stateMessage. */ + public stateMessage: string; + + /** ApiHubInstance config. */ + public config?: (google.cloud.apihub.v1.ApiHubInstance.IConfig|null); + + /** ApiHubInstance labels. */ + public labels: { [k: string]: string }; + + /** ApiHubInstance description. */ + public description: string; + + /** + * Creates a new ApiHubInstance instance using the specified properties. + * @param [properties] Properties to set + * @returns ApiHubInstance instance + */ + public static create(properties?: google.cloud.apihub.v1.IApiHubInstance): google.cloud.apihub.v1.ApiHubInstance; + + /** + * Encodes the specified ApiHubInstance message. Does not implicitly {@link google.cloud.apihub.v1.ApiHubInstance.verify|verify} messages. + * @param message ApiHubInstance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IApiHubInstance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ApiHubInstance message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ApiHubInstance.verify|verify} messages. + * @param message ApiHubInstance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IApiHubInstance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ApiHubInstance message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ApiHubInstance + * @throws {Error} If the payload is not 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.apihub.v1.ApiHubInstance; + + /** + * Decodes an ApiHubInstance message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ApiHubInstance + * @throws {Error} If the payload 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.apihub.v1.ApiHubInstance; + + /** + * Verifies an ApiHubInstance message. + * @param message Plain 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 ApiHubInstance message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ApiHubInstance + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.ApiHubInstance; + + /** + * Creates a plain object from an ApiHubInstance message. Also converts values to other types if specified. + * @param message ApiHubInstance + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.ApiHubInstance, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ApiHubInstance to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ApiHubInstance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ApiHubInstance { + + /** Properties of a Config. */ + interface IConfig { + + /** Config cmekKeyName */ + cmekKeyName?: (string|null); + } + + /** Represents a Config. */ + class Config implements IConfig { + + /** + * Constructs a new Config. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.ApiHubInstance.IConfig); + + /** Config cmekKeyName. */ + public cmekKeyName: string; + + /** + * Creates a new Config instance using the specified properties. + * @param [properties] Properties to set + * @returns Config instance + */ + public static create(properties?: google.cloud.apihub.v1.ApiHubInstance.IConfig): google.cloud.apihub.v1.ApiHubInstance.Config; + + /** + * Encodes the specified Config message. Does not implicitly {@link google.cloud.apihub.v1.ApiHubInstance.Config.verify|verify} messages. + * @param message Config message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.ApiHubInstance.IConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Config message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ApiHubInstance.Config.verify|verify} messages. + * @param message Config message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.ApiHubInstance.IConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Config message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Config + * @throws {Error} If the payload is not 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.apihub.v1.ApiHubInstance.Config; + + /** + * Decodes a Config message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Config + * @throws {Error} If the payload 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.apihub.v1.ApiHubInstance.Config; + + /** + * Verifies a Config message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Config message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Config + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.ApiHubInstance.Config; + + /** + * Creates a plain object from a Config message. Also converts values to other types if specified. + * @param message Config + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.ApiHubInstance.Config, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Config to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Config + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + INACTIVE = 1, + CREATING = 2, + ACTIVE = 3, + UPDATING = 4, + DELETING = 5, + FAILED = 6 + } + } + + /** Properties of an ExternalApi. */ + interface IExternalApi { + + /** ExternalApi name */ + name?: (string|null); + + /** ExternalApi displayName */ + displayName?: (string|null); + + /** ExternalApi description */ + description?: (string|null); + + /** ExternalApi endpoints */ + endpoints?: (string[]|null); + + /** ExternalApi paths */ + paths?: (string[]|null); + + /** ExternalApi documentation */ + documentation?: (google.cloud.apihub.v1.IDocumentation|null); + + /** ExternalApi attributes */ + attributes?: ({ [k: string]: google.cloud.apihub.v1.IAttributeValues }|null); + + /** ExternalApi createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** ExternalApi updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents an ExternalApi. */ + class ExternalApi implements IExternalApi { + + /** + * Constructs a new ExternalApi. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IExternalApi); + + /** ExternalApi name. */ + public name: string; + + /** ExternalApi displayName. */ + public displayName: string; + + /** ExternalApi description. */ + public description: string; + + /** ExternalApi endpoints. */ + public endpoints: string[]; + + /** ExternalApi paths. */ + public paths: string[]; + + /** ExternalApi documentation. */ + public documentation?: (google.cloud.apihub.v1.IDocumentation|null); + + /** ExternalApi attributes. */ + public attributes: { [k: string]: google.cloud.apihub.v1.IAttributeValues }; + + /** ExternalApi createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** ExternalApi updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new ExternalApi instance using the specified properties. + * @param [properties] Properties to set + * @returns ExternalApi instance + */ + public static create(properties?: google.cloud.apihub.v1.IExternalApi): google.cloud.apihub.v1.ExternalApi; + + /** + * Encodes the specified ExternalApi message. Does not implicitly {@link google.cloud.apihub.v1.ExternalApi.verify|verify} messages. + * @param message ExternalApi message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IExternalApi, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExternalApi message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ExternalApi.verify|verify} messages. + * @param message ExternalApi message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IExternalApi, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExternalApi message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExternalApi + * @throws {Error} If the payload is not 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.apihub.v1.ExternalApi; + + /** + * Decodes an ExternalApi message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExternalApi + * @throws {Error} If the payload 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.apihub.v1.ExternalApi; + + /** + * Verifies an ExternalApi message. + * @param message Plain 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 ExternalApi message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExternalApi + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.ExternalApi; + + /** + * Creates a plain object from an ExternalApi message. Also converts values to other types if specified. + * @param message ExternalApi + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.ExternalApi, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExternalApi to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExternalApi + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a HostProjectRegistrationService */ + class HostProjectRegistrationService extends $protobuf.rpc.Service { + + /** + * Constructs a new HostProjectRegistrationService 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 HostProjectRegistrationService 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): HostProjectRegistrationService; + + /** + * Calls CreateHostProjectRegistration. + * @param request CreateHostProjectRegistrationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and HostProjectRegistration + */ + public createHostProjectRegistration(request: google.cloud.apihub.v1.ICreateHostProjectRegistrationRequest, callback: google.cloud.apihub.v1.HostProjectRegistrationService.CreateHostProjectRegistrationCallback): void; + + /** + * Calls CreateHostProjectRegistration. + * @param request CreateHostProjectRegistrationRequest message or plain object + * @returns Promise + */ + public createHostProjectRegistration(request: google.cloud.apihub.v1.ICreateHostProjectRegistrationRequest): Promise; + + /** + * Calls GetHostProjectRegistration. + * @param request GetHostProjectRegistrationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and HostProjectRegistration + */ + public getHostProjectRegistration(request: google.cloud.apihub.v1.IGetHostProjectRegistrationRequest, callback: google.cloud.apihub.v1.HostProjectRegistrationService.GetHostProjectRegistrationCallback): void; + + /** + * Calls GetHostProjectRegistration. + * @param request GetHostProjectRegistrationRequest message or plain object + * @returns Promise + */ + public getHostProjectRegistration(request: google.cloud.apihub.v1.IGetHostProjectRegistrationRequest): Promise; + + /** + * Calls ListHostProjectRegistrations. + * @param request ListHostProjectRegistrationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListHostProjectRegistrationsResponse + */ + public listHostProjectRegistrations(request: google.cloud.apihub.v1.IListHostProjectRegistrationsRequest, callback: google.cloud.apihub.v1.HostProjectRegistrationService.ListHostProjectRegistrationsCallback): void; + + /** + * Calls ListHostProjectRegistrations. + * @param request ListHostProjectRegistrationsRequest message or plain object + * @returns Promise + */ + public listHostProjectRegistrations(request: google.cloud.apihub.v1.IListHostProjectRegistrationsRequest): Promise; + } + + namespace HostProjectRegistrationService { + + /** + * Callback as used by {@link google.cloud.apihub.v1.HostProjectRegistrationService|createHostProjectRegistration}. + * @param error Error, if any + * @param [response] HostProjectRegistration + */ + type CreateHostProjectRegistrationCallback = (error: (Error|null), response?: google.cloud.apihub.v1.HostProjectRegistration) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.HostProjectRegistrationService|getHostProjectRegistration}. + * @param error Error, if any + * @param [response] HostProjectRegistration + */ + type GetHostProjectRegistrationCallback = (error: (Error|null), response?: google.cloud.apihub.v1.HostProjectRegistration) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.HostProjectRegistrationService|listHostProjectRegistrations}. + * @param error Error, if any + * @param [response] ListHostProjectRegistrationsResponse + */ + type ListHostProjectRegistrationsCallback = (error: (Error|null), response?: google.cloud.apihub.v1.ListHostProjectRegistrationsResponse) => void; + } + + /** Properties of a CreateHostProjectRegistrationRequest. */ + interface ICreateHostProjectRegistrationRequest { + + /** CreateHostProjectRegistrationRequest parent */ + parent?: (string|null); + + /** CreateHostProjectRegistrationRequest hostProjectRegistrationId */ + hostProjectRegistrationId?: (string|null); + + /** CreateHostProjectRegistrationRequest hostProjectRegistration */ + hostProjectRegistration?: (google.cloud.apihub.v1.IHostProjectRegistration|null); + } + + /** Represents a CreateHostProjectRegistrationRequest. */ + class CreateHostProjectRegistrationRequest implements ICreateHostProjectRegistrationRequest { + + /** + * Constructs a new CreateHostProjectRegistrationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.ICreateHostProjectRegistrationRequest); + + /** CreateHostProjectRegistrationRequest parent. */ + public parent: string; + + /** CreateHostProjectRegistrationRequest hostProjectRegistrationId. */ + public hostProjectRegistrationId: string; + + /** CreateHostProjectRegistrationRequest hostProjectRegistration. */ + public hostProjectRegistration?: (google.cloud.apihub.v1.IHostProjectRegistration|null); + + /** + * Creates a new CreateHostProjectRegistrationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateHostProjectRegistrationRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.ICreateHostProjectRegistrationRequest): google.cloud.apihub.v1.CreateHostProjectRegistrationRequest; + + /** + * Encodes the specified CreateHostProjectRegistrationRequest message. Does not implicitly {@link google.cloud.apihub.v1.CreateHostProjectRegistrationRequest.verify|verify} messages. + * @param message CreateHostProjectRegistrationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.ICreateHostProjectRegistrationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateHostProjectRegistrationRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.CreateHostProjectRegistrationRequest.verify|verify} messages. + * @param message CreateHostProjectRegistrationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.ICreateHostProjectRegistrationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateHostProjectRegistrationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateHostProjectRegistrationRequest + * @throws {Error} If the payload is not 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.apihub.v1.CreateHostProjectRegistrationRequest; + + /** + * Decodes a CreateHostProjectRegistrationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateHostProjectRegistrationRequest + * @throws {Error} If the payload 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.apihub.v1.CreateHostProjectRegistrationRequest; + + /** + * Verifies a CreateHostProjectRegistrationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateHostProjectRegistrationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateHostProjectRegistrationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.CreateHostProjectRegistrationRequest; + + /** + * Creates a plain object from a CreateHostProjectRegistrationRequest message. Also converts values to other types if specified. + * @param message CreateHostProjectRegistrationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.CreateHostProjectRegistrationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateHostProjectRegistrationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateHostProjectRegistrationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetHostProjectRegistrationRequest. */ + interface IGetHostProjectRegistrationRequest { + + /** GetHostProjectRegistrationRequest name */ + name?: (string|null); + } + + /** Represents a GetHostProjectRegistrationRequest. */ + class GetHostProjectRegistrationRequest implements IGetHostProjectRegistrationRequest { + + /** + * Constructs a new GetHostProjectRegistrationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IGetHostProjectRegistrationRequest); + + /** GetHostProjectRegistrationRequest name. */ + public name: string; + + /** + * Creates a new GetHostProjectRegistrationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetHostProjectRegistrationRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.IGetHostProjectRegistrationRequest): google.cloud.apihub.v1.GetHostProjectRegistrationRequest; + + /** + * Encodes the specified GetHostProjectRegistrationRequest message. Does not implicitly {@link google.cloud.apihub.v1.GetHostProjectRegistrationRequest.verify|verify} messages. + * @param message GetHostProjectRegistrationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IGetHostProjectRegistrationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetHostProjectRegistrationRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.GetHostProjectRegistrationRequest.verify|verify} messages. + * @param message GetHostProjectRegistrationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IGetHostProjectRegistrationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetHostProjectRegistrationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetHostProjectRegistrationRequest + * @throws {Error} If the payload is not 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.apihub.v1.GetHostProjectRegistrationRequest; + + /** + * Decodes a GetHostProjectRegistrationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetHostProjectRegistrationRequest + * @throws {Error} If the payload 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.apihub.v1.GetHostProjectRegistrationRequest; + + /** + * Verifies a GetHostProjectRegistrationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetHostProjectRegistrationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetHostProjectRegistrationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.GetHostProjectRegistrationRequest; + + /** + * Creates a plain object from a GetHostProjectRegistrationRequest message. Also converts values to other types if specified. + * @param message GetHostProjectRegistrationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.GetHostProjectRegistrationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetHostProjectRegistrationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetHostProjectRegistrationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListHostProjectRegistrationsRequest. */ + interface IListHostProjectRegistrationsRequest { + + /** ListHostProjectRegistrationsRequest parent */ + parent?: (string|null); + + /** ListHostProjectRegistrationsRequest pageSize */ + pageSize?: (number|null); + + /** ListHostProjectRegistrationsRequest pageToken */ + pageToken?: (string|null); + + /** ListHostProjectRegistrationsRequest filter */ + filter?: (string|null); + + /** ListHostProjectRegistrationsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListHostProjectRegistrationsRequest. */ + class ListHostProjectRegistrationsRequest implements IListHostProjectRegistrationsRequest { + + /** + * Constructs a new ListHostProjectRegistrationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IListHostProjectRegistrationsRequest); + + /** ListHostProjectRegistrationsRequest parent. */ + public parent: string; + + /** ListHostProjectRegistrationsRequest pageSize. */ + public pageSize: number; + + /** ListHostProjectRegistrationsRequest pageToken. */ + public pageToken: string; + + /** ListHostProjectRegistrationsRequest filter. */ + public filter: string; + + /** ListHostProjectRegistrationsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListHostProjectRegistrationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListHostProjectRegistrationsRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.IListHostProjectRegistrationsRequest): google.cloud.apihub.v1.ListHostProjectRegistrationsRequest; + + /** + * Encodes the specified ListHostProjectRegistrationsRequest message. Does not implicitly {@link google.cloud.apihub.v1.ListHostProjectRegistrationsRequest.verify|verify} messages. + * @param message ListHostProjectRegistrationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IListHostProjectRegistrationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListHostProjectRegistrationsRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListHostProjectRegistrationsRequest.verify|verify} messages. + * @param message ListHostProjectRegistrationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IListHostProjectRegistrationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListHostProjectRegistrationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListHostProjectRegistrationsRequest + * @throws {Error} If the payload is not 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.apihub.v1.ListHostProjectRegistrationsRequest; + + /** + * Decodes a ListHostProjectRegistrationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListHostProjectRegistrationsRequest + * @throws {Error} If the payload 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.apihub.v1.ListHostProjectRegistrationsRequest; + + /** + * Verifies a ListHostProjectRegistrationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListHostProjectRegistrationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListHostProjectRegistrationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.ListHostProjectRegistrationsRequest; + + /** + * Creates a plain object from a ListHostProjectRegistrationsRequest message. Also converts values to other types if specified. + * @param message ListHostProjectRegistrationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.ListHostProjectRegistrationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListHostProjectRegistrationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListHostProjectRegistrationsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListHostProjectRegistrationsResponse. */ + interface IListHostProjectRegistrationsResponse { + + /** ListHostProjectRegistrationsResponse hostProjectRegistrations */ + hostProjectRegistrations?: (google.cloud.apihub.v1.IHostProjectRegistration[]|null); + + /** ListHostProjectRegistrationsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListHostProjectRegistrationsResponse. */ + class ListHostProjectRegistrationsResponse implements IListHostProjectRegistrationsResponse { + + /** + * Constructs a new ListHostProjectRegistrationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IListHostProjectRegistrationsResponse); + + /** ListHostProjectRegistrationsResponse hostProjectRegistrations. */ + public hostProjectRegistrations: google.cloud.apihub.v1.IHostProjectRegistration[]; + + /** ListHostProjectRegistrationsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListHostProjectRegistrationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListHostProjectRegistrationsResponse instance + */ + public static create(properties?: google.cloud.apihub.v1.IListHostProjectRegistrationsResponse): google.cloud.apihub.v1.ListHostProjectRegistrationsResponse; + + /** + * Encodes the specified ListHostProjectRegistrationsResponse message. Does not implicitly {@link google.cloud.apihub.v1.ListHostProjectRegistrationsResponse.verify|verify} messages. + * @param message ListHostProjectRegistrationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IListHostProjectRegistrationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListHostProjectRegistrationsResponse message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListHostProjectRegistrationsResponse.verify|verify} messages. + * @param message ListHostProjectRegistrationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IListHostProjectRegistrationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListHostProjectRegistrationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListHostProjectRegistrationsResponse + * @throws {Error} If the payload is not 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.apihub.v1.ListHostProjectRegistrationsResponse; + + /** + * Decodes a ListHostProjectRegistrationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListHostProjectRegistrationsResponse + * @throws {Error} If the payload 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.apihub.v1.ListHostProjectRegistrationsResponse; + + /** + * Verifies a ListHostProjectRegistrationsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListHostProjectRegistrationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListHostProjectRegistrationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.ListHostProjectRegistrationsResponse; + + /** + * Creates a plain object from a ListHostProjectRegistrationsResponse message. Also converts values to other types if specified. + * @param message ListHostProjectRegistrationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.ListHostProjectRegistrationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListHostProjectRegistrationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListHostProjectRegistrationsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a HostProjectRegistration. */ + interface IHostProjectRegistration { + + /** HostProjectRegistration name */ + name?: (string|null); + + /** HostProjectRegistration gcpProject */ + gcpProject?: (string|null); + + /** HostProjectRegistration createTime */ + createTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a HostProjectRegistration. */ + class HostProjectRegistration implements IHostProjectRegistration { + + /** + * Constructs a new HostProjectRegistration. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IHostProjectRegistration); + + /** HostProjectRegistration name. */ + public name: string; + + /** HostProjectRegistration gcpProject. */ + public gcpProject: string; + + /** HostProjectRegistration createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new HostProjectRegistration instance using the specified properties. + * @param [properties] Properties to set + * @returns HostProjectRegistration instance + */ + public static create(properties?: google.cloud.apihub.v1.IHostProjectRegistration): google.cloud.apihub.v1.HostProjectRegistration; + + /** + * Encodes the specified HostProjectRegistration message. Does not implicitly {@link google.cloud.apihub.v1.HostProjectRegistration.verify|verify} messages. + * @param message HostProjectRegistration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IHostProjectRegistration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HostProjectRegistration message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.HostProjectRegistration.verify|verify} messages. + * @param message HostProjectRegistration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IHostProjectRegistration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HostProjectRegistration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HostProjectRegistration + * @throws {Error} If the payload is not 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.apihub.v1.HostProjectRegistration; + + /** + * Decodes a HostProjectRegistration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HostProjectRegistration + * @throws {Error} If the payload 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.apihub.v1.HostProjectRegistration; + + /** + * Verifies a HostProjectRegistration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HostProjectRegistration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HostProjectRegistration + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.HostProjectRegistration; + + /** + * Creates a plain object from a HostProjectRegistration message. Also converts values to other types if specified. + * @param message HostProjectRegistration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.HostProjectRegistration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HostProjectRegistration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HostProjectRegistration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a LintingService */ + class LintingService extends $protobuf.rpc.Service { + + /** + * Constructs a new LintingService 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 LintingService 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): LintingService; + + /** + * Calls GetStyleGuide. + * @param request GetStyleGuideRequest message or plain object + * @param callback Node-style callback called with the error, if any, and StyleGuide + */ + public getStyleGuide(request: google.cloud.apihub.v1.IGetStyleGuideRequest, callback: google.cloud.apihub.v1.LintingService.GetStyleGuideCallback): void; + + /** + * Calls GetStyleGuide. + * @param request GetStyleGuideRequest message or plain object + * @returns Promise + */ + public getStyleGuide(request: google.cloud.apihub.v1.IGetStyleGuideRequest): Promise; + + /** + * Calls UpdateStyleGuide. + * @param request UpdateStyleGuideRequest message or plain object + * @param callback Node-style callback called with the error, if any, and StyleGuide + */ + public updateStyleGuide(request: google.cloud.apihub.v1.IUpdateStyleGuideRequest, callback: google.cloud.apihub.v1.LintingService.UpdateStyleGuideCallback): void; + + /** + * Calls UpdateStyleGuide. + * @param request UpdateStyleGuideRequest message or plain object + * @returns Promise + */ + public updateStyleGuide(request: google.cloud.apihub.v1.IUpdateStyleGuideRequest): Promise; + + /** + * Calls GetStyleGuideContents. + * @param request GetStyleGuideContentsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and StyleGuideContents + */ + public getStyleGuideContents(request: google.cloud.apihub.v1.IGetStyleGuideContentsRequest, callback: google.cloud.apihub.v1.LintingService.GetStyleGuideContentsCallback): void; + + /** + * Calls GetStyleGuideContents. + * @param request GetStyleGuideContentsRequest message or plain object + * @returns Promise + */ + public getStyleGuideContents(request: google.cloud.apihub.v1.IGetStyleGuideContentsRequest): Promise; + + /** + * Calls LintSpec. + * @param request LintSpecRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public lintSpec(request: google.cloud.apihub.v1.ILintSpecRequest, callback: google.cloud.apihub.v1.LintingService.LintSpecCallback): void; + + /** + * Calls LintSpec. + * @param request LintSpecRequest message or plain object + * @returns Promise + */ + public lintSpec(request: google.cloud.apihub.v1.ILintSpecRequest): Promise; + } + + namespace LintingService { + + /** + * Callback as used by {@link google.cloud.apihub.v1.LintingService|getStyleGuide}. + * @param error Error, if any + * @param [response] StyleGuide + */ + type GetStyleGuideCallback = (error: (Error|null), response?: google.cloud.apihub.v1.StyleGuide) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.LintingService|updateStyleGuide}. + * @param error Error, if any + * @param [response] StyleGuide + */ + type UpdateStyleGuideCallback = (error: (Error|null), response?: google.cloud.apihub.v1.StyleGuide) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.LintingService|getStyleGuideContents}. + * @param error Error, if any + * @param [response] StyleGuideContents + */ + type GetStyleGuideContentsCallback = (error: (Error|null), response?: google.cloud.apihub.v1.StyleGuideContents) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.LintingService|lintSpec}. + * @param error Error, if any + * @param [response] Empty + */ + type LintSpecCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + } + + /** Properties of a GetStyleGuideRequest. */ + interface IGetStyleGuideRequest { + + /** GetStyleGuideRequest name */ + name?: (string|null); + } + + /** Represents a GetStyleGuideRequest. */ + class GetStyleGuideRequest implements IGetStyleGuideRequest { + + /** + * Constructs a new GetStyleGuideRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IGetStyleGuideRequest); + + /** GetStyleGuideRequest name. */ + public name: string; + + /** + * Creates a new GetStyleGuideRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetStyleGuideRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.IGetStyleGuideRequest): google.cloud.apihub.v1.GetStyleGuideRequest; + + /** + * Encodes the specified GetStyleGuideRequest message. Does not implicitly {@link google.cloud.apihub.v1.GetStyleGuideRequest.verify|verify} messages. + * @param message GetStyleGuideRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IGetStyleGuideRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetStyleGuideRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.GetStyleGuideRequest.verify|verify} messages. + * @param message GetStyleGuideRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IGetStyleGuideRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetStyleGuideRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetStyleGuideRequest + * @throws {Error} If the payload is not 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.apihub.v1.GetStyleGuideRequest; + + /** + * Decodes a GetStyleGuideRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetStyleGuideRequest + * @throws {Error} If the payload 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.apihub.v1.GetStyleGuideRequest; + + /** + * Verifies a GetStyleGuideRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetStyleGuideRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetStyleGuideRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.GetStyleGuideRequest; + + /** + * Creates a plain object from a GetStyleGuideRequest message. Also converts values to other types if specified. + * @param message GetStyleGuideRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.GetStyleGuideRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetStyleGuideRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetStyleGuideRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateStyleGuideRequest. */ + interface IUpdateStyleGuideRequest { + + /** UpdateStyleGuideRequest styleGuide */ + styleGuide?: (google.cloud.apihub.v1.IStyleGuide|null); + + /** UpdateStyleGuideRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateStyleGuideRequest. */ + class UpdateStyleGuideRequest implements IUpdateStyleGuideRequest { + + /** + * Constructs a new UpdateStyleGuideRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IUpdateStyleGuideRequest); + + /** UpdateStyleGuideRequest styleGuide. */ + public styleGuide?: (google.cloud.apihub.v1.IStyleGuide|null); + + /** UpdateStyleGuideRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateStyleGuideRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateStyleGuideRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.IUpdateStyleGuideRequest): google.cloud.apihub.v1.UpdateStyleGuideRequest; + + /** + * Encodes the specified UpdateStyleGuideRequest message. Does not implicitly {@link google.cloud.apihub.v1.UpdateStyleGuideRequest.verify|verify} messages. + * @param message UpdateStyleGuideRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IUpdateStyleGuideRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateStyleGuideRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.UpdateStyleGuideRequest.verify|verify} messages. + * @param message UpdateStyleGuideRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IUpdateStyleGuideRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateStyleGuideRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateStyleGuideRequest + * @throws {Error} If the payload is not 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.apihub.v1.UpdateStyleGuideRequest; + + /** + * Decodes an UpdateStyleGuideRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateStyleGuideRequest + * @throws {Error} If the payload 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.apihub.v1.UpdateStyleGuideRequest; + + /** + * Verifies an UpdateStyleGuideRequest message. + * @param message Plain 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 UpdateStyleGuideRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateStyleGuideRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.UpdateStyleGuideRequest; + + /** + * Creates a plain object from an UpdateStyleGuideRequest message. Also converts values to other types if specified. + * @param message UpdateStyleGuideRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.UpdateStyleGuideRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateStyleGuideRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateStyleGuideRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetStyleGuideContentsRequest. */ + interface IGetStyleGuideContentsRequest { + + /** GetStyleGuideContentsRequest name */ + name?: (string|null); + } + + /** Represents a GetStyleGuideContentsRequest. */ + class GetStyleGuideContentsRequest implements IGetStyleGuideContentsRequest { + + /** + * Constructs a new GetStyleGuideContentsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IGetStyleGuideContentsRequest); + + /** GetStyleGuideContentsRequest name. */ + public name: string; + + /** + * Creates a new GetStyleGuideContentsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetStyleGuideContentsRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.IGetStyleGuideContentsRequest): google.cloud.apihub.v1.GetStyleGuideContentsRequest; + + /** + * Encodes the specified GetStyleGuideContentsRequest message. Does not implicitly {@link google.cloud.apihub.v1.GetStyleGuideContentsRequest.verify|verify} messages. + * @param message GetStyleGuideContentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IGetStyleGuideContentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetStyleGuideContentsRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.GetStyleGuideContentsRequest.verify|verify} messages. + * @param message GetStyleGuideContentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IGetStyleGuideContentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetStyleGuideContentsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetStyleGuideContentsRequest + * @throws {Error} If the payload is not 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.apihub.v1.GetStyleGuideContentsRequest; + + /** + * Decodes a GetStyleGuideContentsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetStyleGuideContentsRequest + * @throws {Error} If the payload 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.apihub.v1.GetStyleGuideContentsRequest; + + /** + * Verifies a GetStyleGuideContentsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetStyleGuideContentsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetStyleGuideContentsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.GetStyleGuideContentsRequest; + + /** + * Creates a plain object from a GetStyleGuideContentsRequest message. Also converts values to other types if specified. + * @param message GetStyleGuideContentsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.GetStyleGuideContentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetStyleGuideContentsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetStyleGuideContentsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LintSpecRequest. */ + interface ILintSpecRequest { + + /** LintSpecRequest name */ + name?: (string|null); + } + + /** Represents a LintSpecRequest. */ + class LintSpecRequest implements ILintSpecRequest { + + /** + * Constructs a new LintSpecRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.ILintSpecRequest); + + /** LintSpecRequest name. */ + public name: string; + + /** + * Creates a new LintSpecRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns LintSpecRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.ILintSpecRequest): google.cloud.apihub.v1.LintSpecRequest; + + /** + * Encodes the specified LintSpecRequest message. Does not implicitly {@link google.cloud.apihub.v1.LintSpecRequest.verify|verify} messages. + * @param message LintSpecRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.ILintSpecRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LintSpecRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.LintSpecRequest.verify|verify} messages. + * @param message LintSpecRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.ILintSpecRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LintSpecRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LintSpecRequest + * @throws {Error} If the payload is not 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.apihub.v1.LintSpecRequest; + + /** + * Decodes a LintSpecRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LintSpecRequest + * @throws {Error} If the payload 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.apihub.v1.LintSpecRequest; + + /** + * Verifies a LintSpecRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LintSpecRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LintSpecRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.LintSpecRequest; + + /** + * Creates a plain object from a LintSpecRequest message. Also converts values to other types if specified. + * @param message LintSpecRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.LintSpecRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LintSpecRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LintSpecRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StyleGuideContents. */ + interface IStyleGuideContents { + + /** StyleGuideContents contents */ + contents?: (Uint8Array|string|null); + + /** StyleGuideContents mimeType */ + mimeType?: (string|null); + } + + /** Represents a StyleGuideContents. */ + class StyleGuideContents implements IStyleGuideContents { + + /** + * Constructs a new StyleGuideContents. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IStyleGuideContents); + + /** StyleGuideContents contents. */ + public contents: (Uint8Array|string); + + /** StyleGuideContents mimeType. */ + public mimeType: string; + + /** + * Creates a new StyleGuideContents instance using the specified properties. + * @param [properties] Properties to set + * @returns StyleGuideContents instance + */ + public static create(properties?: google.cloud.apihub.v1.IStyleGuideContents): google.cloud.apihub.v1.StyleGuideContents; + + /** + * Encodes the specified StyleGuideContents message. Does not implicitly {@link google.cloud.apihub.v1.StyleGuideContents.verify|verify} messages. + * @param message StyleGuideContents message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IStyleGuideContents, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StyleGuideContents message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.StyleGuideContents.verify|verify} messages. + * @param message StyleGuideContents message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IStyleGuideContents, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StyleGuideContents message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StyleGuideContents + * @throws {Error} If the payload is not 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.apihub.v1.StyleGuideContents; + + /** + * Decodes a StyleGuideContents message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StyleGuideContents + * @throws {Error} If the payload 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.apihub.v1.StyleGuideContents; + + /** + * Verifies a StyleGuideContents message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StyleGuideContents message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StyleGuideContents + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.StyleGuideContents; + + /** + * Creates a plain object from a StyleGuideContents message. Also converts values to other types if specified. + * @param message StyleGuideContents + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.StyleGuideContents, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StyleGuideContents to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StyleGuideContents + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StyleGuide. */ + interface IStyleGuide { + + /** StyleGuide name */ + name?: (string|null); + + /** StyleGuide linter */ + linter?: (google.cloud.apihub.v1.Linter|keyof typeof google.cloud.apihub.v1.Linter|null); + + /** StyleGuide contents */ + contents?: (google.cloud.apihub.v1.IStyleGuideContents|null); + } + + /** Represents a StyleGuide. */ + class StyleGuide implements IStyleGuide { + + /** + * Constructs a new StyleGuide. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IStyleGuide); + + /** StyleGuide name. */ + public name: string; + + /** StyleGuide linter. */ + public linter: (google.cloud.apihub.v1.Linter|keyof typeof google.cloud.apihub.v1.Linter); + + /** StyleGuide contents. */ + public contents?: (google.cloud.apihub.v1.IStyleGuideContents|null); + + /** + * Creates a new StyleGuide instance using the specified properties. + * @param [properties] Properties to set + * @returns StyleGuide instance + */ + public static create(properties?: google.cloud.apihub.v1.IStyleGuide): google.cloud.apihub.v1.StyleGuide; + + /** + * Encodes the specified StyleGuide message. Does not implicitly {@link google.cloud.apihub.v1.StyleGuide.verify|verify} messages. + * @param message StyleGuide message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IStyleGuide, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StyleGuide message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.StyleGuide.verify|verify} messages. + * @param message StyleGuide message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IStyleGuide, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StyleGuide message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StyleGuide + * @throws {Error} If the payload is not 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.apihub.v1.StyleGuide; + + /** + * Decodes a StyleGuide message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StyleGuide + * @throws {Error} If the payload 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.apihub.v1.StyleGuide; + + /** + * Verifies a StyleGuide message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StyleGuide message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StyleGuide + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.StyleGuide; + + /** + * Creates a plain object from a StyleGuide message. Also converts values to other types if specified. + * @param message StyleGuide + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.StyleGuide, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StyleGuide to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StyleGuide + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents an ApiHubPlugin */ + class ApiHubPlugin extends $protobuf.rpc.Service { + + /** + * Constructs a new ApiHubPlugin 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 ApiHubPlugin 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): ApiHubPlugin; + + /** + * Calls GetPlugin. + * @param request GetPluginRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Plugin + */ + public getPlugin(request: google.cloud.apihub.v1.IGetPluginRequest, callback: google.cloud.apihub.v1.ApiHubPlugin.GetPluginCallback): void; + + /** + * Calls GetPlugin. + * @param request GetPluginRequest message or plain object + * @returns Promise + */ + public getPlugin(request: google.cloud.apihub.v1.IGetPluginRequest): Promise; + + /** + * Calls EnablePlugin. + * @param request EnablePluginRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Plugin + */ + public enablePlugin(request: google.cloud.apihub.v1.IEnablePluginRequest, callback: google.cloud.apihub.v1.ApiHubPlugin.EnablePluginCallback): void; + + /** + * Calls EnablePlugin. + * @param request EnablePluginRequest message or plain object + * @returns Promise + */ + public enablePlugin(request: google.cloud.apihub.v1.IEnablePluginRequest): Promise; + + /** + * Calls DisablePlugin. + * @param request DisablePluginRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Plugin + */ + public disablePlugin(request: google.cloud.apihub.v1.IDisablePluginRequest, callback: google.cloud.apihub.v1.ApiHubPlugin.DisablePluginCallback): void; + + /** + * Calls DisablePlugin. + * @param request DisablePluginRequest message or plain object + * @returns Promise + */ + public disablePlugin(request: google.cloud.apihub.v1.IDisablePluginRequest): Promise; + } + + namespace ApiHubPlugin { + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHubPlugin|getPlugin}. + * @param error Error, if any + * @param [response] Plugin + */ + type GetPluginCallback = (error: (Error|null), response?: google.cloud.apihub.v1.Plugin) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHubPlugin|enablePlugin}. + * @param error Error, if any + * @param [response] Plugin + */ + type EnablePluginCallback = (error: (Error|null), response?: google.cloud.apihub.v1.Plugin) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHubPlugin|disablePlugin}. + * @param error Error, if any + * @param [response] Plugin + */ + type DisablePluginCallback = (error: (Error|null), response?: google.cloud.apihub.v1.Plugin) => void; + } + + /** Properties of a Plugin. */ + interface IPlugin { + + /** Plugin name */ + name?: (string|null); + + /** Plugin displayName */ + displayName?: (string|null); + + /** Plugin type */ + type?: (google.cloud.apihub.v1.IAttributeValues|null); + + /** Plugin description */ + description?: (string|null); + + /** Plugin state */ + state?: (google.cloud.apihub.v1.Plugin.State|keyof typeof google.cloud.apihub.v1.Plugin.State|null); + } + + /** Represents a Plugin. */ + class Plugin implements IPlugin { + + /** + * Constructs a new Plugin. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IPlugin); + + /** Plugin name. */ + public name: string; + + /** Plugin displayName. */ + public displayName: string; + + /** Plugin type. */ + public type?: (google.cloud.apihub.v1.IAttributeValues|null); + + /** Plugin description. */ + public description: string; + + /** Plugin state. */ + public state: (google.cloud.apihub.v1.Plugin.State|keyof typeof google.cloud.apihub.v1.Plugin.State); + + /** + * Creates a new Plugin instance using the specified properties. + * @param [properties] Properties to set + * @returns Plugin instance + */ + public static create(properties?: google.cloud.apihub.v1.IPlugin): google.cloud.apihub.v1.Plugin; + + /** + * Encodes the specified Plugin message. Does not implicitly {@link google.cloud.apihub.v1.Plugin.verify|verify} messages. + * @param message Plugin message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IPlugin, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Plugin message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.Plugin.verify|verify} messages. + * @param message Plugin message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IPlugin, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Plugin message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Plugin + * @throws {Error} If the payload is not 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.apihub.v1.Plugin; + + /** + * Decodes a Plugin message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Plugin + * @throws {Error} If the payload 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.apihub.v1.Plugin; + + /** + * Verifies a Plugin message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Plugin message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Plugin + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.Plugin; + + /** + * Creates a plain object from a Plugin message. Also converts values to other types if specified. + * @param message Plugin + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.Plugin, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Plugin to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Plugin + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Plugin { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + ENABLED = 1, + DISABLED = 2 + } + } + + /** Properties of a GetPluginRequest. */ + interface IGetPluginRequest { + + /** GetPluginRequest name */ + name?: (string|null); + } + + /** Represents a GetPluginRequest. */ + class GetPluginRequest implements IGetPluginRequest { + + /** + * Constructs a new GetPluginRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IGetPluginRequest); + + /** GetPluginRequest name. */ + public name: string; + + /** + * Creates a new GetPluginRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetPluginRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.IGetPluginRequest): google.cloud.apihub.v1.GetPluginRequest; + + /** + * Encodes the specified GetPluginRequest message. Does not implicitly {@link google.cloud.apihub.v1.GetPluginRequest.verify|verify} messages. + * @param message GetPluginRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IGetPluginRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetPluginRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.GetPluginRequest.verify|verify} messages. + * @param message GetPluginRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IGetPluginRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetPluginRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetPluginRequest + * @throws {Error} If the payload is not 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.apihub.v1.GetPluginRequest; + + /** + * Decodes a GetPluginRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetPluginRequest + * @throws {Error} If the payload 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.apihub.v1.GetPluginRequest; + + /** + * Verifies a GetPluginRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetPluginRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetPluginRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.GetPluginRequest; + + /** + * Creates a plain object from a GetPluginRequest message. Also converts values to other types if specified. + * @param message GetPluginRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.GetPluginRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetPluginRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetPluginRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnablePluginRequest. */ + interface IEnablePluginRequest { + + /** EnablePluginRequest name */ + name?: (string|null); + } + + /** Represents an EnablePluginRequest. */ + class EnablePluginRequest implements IEnablePluginRequest { + + /** + * Constructs a new EnablePluginRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IEnablePluginRequest); + + /** EnablePluginRequest name. */ + public name: string; + + /** + * Creates a new EnablePluginRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns EnablePluginRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.IEnablePluginRequest): google.cloud.apihub.v1.EnablePluginRequest; + + /** + * Encodes the specified EnablePluginRequest message. Does not implicitly {@link google.cloud.apihub.v1.EnablePluginRequest.verify|verify} messages. + * @param message EnablePluginRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IEnablePluginRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnablePluginRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.EnablePluginRequest.verify|verify} messages. + * @param message EnablePluginRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IEnablePluginRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnablePluginRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnablePluginRequest + * @throws {Error} If the payload is not 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.apihub.v1.EnablePluginRequest; + + /** + * Decodes an EnablePluginRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnablePluginRequest + * @throws {Error} If the payload 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.apihub.v1.EnablePluginRequest; + + /** + * Verifies an EnablePluginRequest message. + * @param message Plain 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 EnablePluginRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnablePluginRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.EnablePluginRequest; + + /** + * Creates a plain object from an EnablePluginRequest message. Also converts values to other types if specified. + * @param message EnablePluginRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.EnablePluginRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnablePluginRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnablePluginRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DisablePluginRequest. */ + interface IDisablePluginRequest { + + /** DisablePluginRequest name */ + name?: (string|null); + } + + /** Represents a DisablePluginRequest. */ + class DisablePluginRequest implements IDisablePluginRequest { + + /** + * Constructs a new DisablePluginRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IDisablePluginRequest); + + /** DisablePluginRequest name. */ + public name: string; + + /** + * Creates a new DisablePluginRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DisablePluginRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.IDisablePluginRequest): google.cloud.apihub.v1.DisablePluginRequest; + + /** + * Encodes the specified DisablePluginRequest message. Does not implicitly {@link google.cloud.apihub.v1.DisablePluginRequest.verify|verify} messages. + * @param message DisablePluginRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IDisablePluginRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DisablePluginRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.DisablePluginRequest.verify|verify} messages. + * @param message DisablePluginRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IDisablePluginRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DisablePluginRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DisablePluginRequest + * @throws {Error} If the payload is not 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.apihub.v1.DisablePluginRequest; + + /** + * Decodes a DisablePluginRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DisablePluginRequest + * @throws {Error} If the payload 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.apihub.v1.DisablePluginRequest; + + /** + * Verifies a DisablePluginRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DisablePluginRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DisablePluginRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.DisablePluginRequest; + + /** + * Creates a plain object from a DisablePluginRequest message. Also converts values to other types if specified. + * @param message DisablePluginRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.DisablePluginRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DisablePluginRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DisablePluginRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a Provisioning */ + class Provisioning extends $protobuf.rpc.Service { + + /** + * Constructs a new Provisioning 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 Provisioning 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): Provisioning; + + /** + * Calls CreateApiHubInstance. + * @param request CreateApiHubInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createApiHubInstance(request: google.cloud.apihub.v1.ICreateApiHubInstanceRequest, callback: google.cloud.apihub.v1.Provisioning.CreateApiHubInstanceCallback): void; + + /** + * Calls CreateApiHubInstance. + * @param request CreateApiHubInstanceRequest message or plain object + * @returns Promise + */ + public createApiHubInstance(request: google.cloud.apihub.v1.ICreateApiHubInstanceRequest): Promise; + + /** + * Calls GetApiHubInstance. + * @param request GetApiHubInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ApiHubInstance + */ + public getApiHubInstance(request: google.cloud.apihub.v1.IGetApiHubInstanceRequest, callback: google.cloud.apihub.v1.Provisioning.GetApiHubInstanceCallback): void; + + /** + * Calls GetApiHubInstance. + * @param request GetApiHubInstanceRequest message or plain object + * @returns Promise + */ + public getApiHubInstance(request: google.cloud.apihub.v1.IGetApiHubInstanceRequest): Promise; + + /** + * Calls LookupApiHubInstance. + * @param request LookupApiHubInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and LookupApiHubInstanceResponse + */ + public lookupApiHubInstance(request: google.cloud.apihub.v1.ILookupApiHubInstanceRequest, callback: google.cloud.apihub.v1.Provisioning.LookupApiHubInstanceCallback): void; + + /** + * Calls LookupApiHubInstance. + * @param request LookupApiHubInstanceRequest message or plain object + * @returns Promise + */ + public lookupApiHubInstance(request: google.cloud.apihub.v1.ILookupApiHubInstanceRequest): Promise; + } + + namespace Provisioning { + + /** + * Callback as used by {@link google.cloud.apihub.v1.Provisioning|createApiHubInstance}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateApiHubInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.Provisioning|getApiHubInstance}. + * @param error Error, if any + * @param [response] ApiHubInstance + */ + type GetApiHubInstanceCallback = (error: (Error|null), response?: google.cloud.apihub.v1.ApiHubInstance) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.Provisioning|lookupApiHubInstance}. + * @param error Error, if any + * @param [response] LookupApiHubInstanceResponse + */ + type LookupApiHubInstanceCallback = (error: (Error|null), response?: google.cloud.apihub.v1.LookupApiHubInstanceResponse) => void; + } + + /** Properties of a CreateApiHubInstanceRequest. */ + interface ICreateApiHubInstanceRequest { + + /** CreateApiHubInstanceRequest parent */ + parent?: (string|null); + + /** CreateApiHubInstanceRequest apiHubInstanceId */ + apiHubInstanceId?: (string|null); + + /** CreateApiHubInstanceRequest apiHubInstance */ + apiHubInstance?: (google.cloud.apihub.v1.IApiHubInstance|null); + } + + /** Represents a CreateApiHubInstanceRequest. */ + class CreateApiHubInstanceRequest implements ICreateApiHubInstanceRequest { + + /** + * Constructs a new CreateApiHubInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.ICreateApiHubInstanceRequest); + + /** CreateApiHubInstanceRequest parent. */ + public parent: string; + + /** CreateApiHubInstanceRequest apiHubInstanceId. */ + public apiHubInstanceId: string; + + /** CreateApiHubInstanceRequest apiHubInstance. */ + public apiHubInstance?: (google.cloud.apihub.v1.IApiHubInstance|null); + + /** + * Creates a new CreateApiHubInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateApiHubInstanceRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.ICreateApiHubInstanceRequest): google.cloud.apihub.v1.CreateApiHubInstanceRequest; + + /** + * Encodes the specified CreateApiHubInstanceRequest message. Does not implicitly {@link google.cloud.apihub.v1.CreateApiHubInstanceRequest.verify|verify} messages. + * @param message CreateApiHubInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.ICreateApiHubInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateApiHubInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.CreateApiHubInstanceRequest.verify|verify} messages. + * @param message CreateApiHubInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.ICreateApiHubInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateApiHubInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateApiHubInstanceRequest + * @throws {Error} If the payload is not 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.apihub.v1.CreateApiHubInstanceRequest; + + /** + * Decodes a CreateApiHubInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateApiHubInstanceRequest + * @throws {Error} If the payload 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.apihub.v1.CreateApiHubInstanceRequest; + + /** + * Verifies a CreateApiHubInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateApiHubInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateApiHubInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.CreateApiHubInstanceRequest; + + /** + * Creates a plain object from a CreateApiHubInstanceRequest message. Also converts values to other types if specified. + * @param message CreateApiHubInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.CreateApiHubInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateApiHubInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateApiHubInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetApiHubInstanceRequest. */ + interface IGetApiHubInstanceRequest { + + /** GetApiHubInstanceRequest name */ + name?: (string|null); + } + + /** Represents a GetApiHubInstanceRequest. */ + class GetApiHubInstanceRequest implements IGetApiHubInstanceRequest { + + /** + * Constructs a new GetApiHubInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IGetApiHubInstanceRequest); + + /** GetApiHubInstanceRequest name. */ + public name: string; + + /** + * Creates a new GetApiHubInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetApiHubInstanceRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.IGetApiHubInstanceRequest): google.cloud.apihub.v1.GetApiHubInstanceRequest; + + /** + * Encodes the specified GetApiHubInstanceRequest message. Does not implicitly {@link google.cloud.apihub.v1.GetApiHubInstanceRequest.verify|verify} messages. + * @param message GetApiHubInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IGetApiHubInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetApiHubInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.GetApiHubInstanceRequest.verify|verify} messages. + * @param message GetApiHubInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IGetApiHubInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetApiHubInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetApiHubInstanceRequest + * @throws {Error} If the payload is not 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.apihub.v1.GetApiHubInstanceRequest; + + /** + * Decodes a GetApiHubInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetApiHubInstanceRequest + * @throws {Error} If the payload 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.apihub.v1.GetApiHubInstanceRequest; + + /** + * Verifies a GetApiHubInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetApiHubInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetApiHubInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.GetApiHubInstanceRequest; + + /** + * Creates a plain object from a GetApiHubInstanceRequest message. Also converts values to other types if specified. + * @param message GetApiHubInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.GetApiHubInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetApiHubInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetApiHubInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LookupApiHubInstanceRequest. */ + interface ILookupApiHubInstanceRequest { + + /** LookupApiHubInstanceRequest parent */ + parent?: (string|null); + } + + /** Represents a LookupApiHubInstanceRequest. */ + class LookupApiHubInstanceRequest implements ILookupApiHubInstanceRequest { + + /** + * Constructs a new LookupApiHubInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.ILookupApiHubInstanceRequest); + + /** LookupApiHubInstanceRequest parent. */ + public parent: string; + + /** + * Creates a new LookupApiHubInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns LookupApiHubInstanceRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.ILookupApiHubInstanceRequest): google.cloud.apihub.v1.LookupApiHubInstanceRequest; + + /** + * Encodes the specified LookupApiHubInstanceRequest message. Does not implicitly {@link google.cloud.apihub.v1.LookupApiHubInstanceRequest.verify|verify} messages. + * @param message LookupApiHubInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.ILookupApiHubInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LookupApiHubInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.LookupApiHubInstanceRequest.verify|verify} messages. + * @param message LookupApiHubInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.ILookupApiHubInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LookupApiHubInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LookupApiHubInstanceRequest + * @throws {Error} If the payload is not 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.apihub.v1.LookupApiHubInstanceRequest; + + /** + * Decodes a LookupApiHubInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LookupApiHubInstanceRequest + * @throws {Error} If the payload 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.apihub.v1.LookupApiHubInstanceRequest; + + /** + * Verifies a LookupApiHubInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LookupApiHubInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LookupApiHubInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.LookupApiHubInstanceRequest; + + /** + * Creates a plain object from a LookupApiHubInstanceRequest message. Also converts values to other types if specified. + * @param message LookupApiHubInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.LookupApiHubInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LookupApiHubInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LookupApiHubInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LookupApiHubInstanceResponse. */ + interface ILookupApiHubInstanceResponse { + + /** LookupApiHubInstanceResponse apiHubInstance */ + apiHubInstance?: (google.cloud.apihub.v1.IApiHubInstance|null); + } + + /** Represents a LookupApiHubInstanceResponse. */ + class LookupApiHubInstanceResponse implements ILookupApiHubInstanceResponse { + + /** + * Constructs a new LookupApiHubInstanceResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.ILookupApiHubInstanceResponse); + + /** LookupApiHubInstanceResponse apiHubInstance. */ + public apiHubInstance?: (google.cloud.apihub.v1.IApiHubInstance|null); + + /** + * Creates a new LookupApiHubInstanceResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns LookupApiHubInstanceResponse instance + */ + public static create(properties?: google.cloud.apihub.v1.ILookupApiHubInstanceResponse): google.cloud.apihub.v1.LookupApiHubInstanceResponse; + + /** + * Encodes the specified LookupApiHubInstanceResponse message. Does not implicitly {@link google.cloud.apihub.v1.LookupApiHubInstanceResponse.verify|verify} messages. + * @param message LookupApiHubInstanceResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.ILookupApiHubInstanceResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LookupApiHubInstanceResponse message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.LookupApiHubInstanceResponse.verify|verify} messages. + * @param message LookupApiHubInstanceResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.ILookupApiHubInstanceResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LookupApiHubInstanceResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LookupApiHubInstanceResponse + * @throws {Error} If the payload is not 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.apihub.v1.LookupApiHubInstanceResponse; + + /** + * Decodes a LookupApiHubInstanceResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LookupApiHubInstanceResponse + * @throws {Error} If the payload 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.apihub.v1.LookupApiHubInstanceResponse; + + /** + * Verifies a LookupApiHubInstanceResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LookupApiHubInstanceResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LookupApiHubInstanceResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.LookupApiHubInstanceResponse; + + /** + * Creates a plain object from a LookupApiHubInstanceResponse message. Also converts values to other types if specified. + * @param message LookupApiHubInstanceResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.LookupApiHubInstanceResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LookupApiHubInstanceResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LookupApiHubInstanceResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a RuntimeProjectAttachmentService */ + class RuntimeProjectAttachmentService extends $protobuf.rpc.Service { + + /** + * Constructs a new RuntimeProjectAttachmentService 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 RuntimeProjectAttachmentService 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): RuntimeProjectAttachmentService; + + /** + * Calls CreateRuntimeProjectAttachment. + * @param request CreateRuntimeProjectAttachmentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and RuntimeProjectAttachment + */ + public createRuntimeProjectAttachment(request: google.cloud.apihub.v1.ICreateRuntimeProjectAttachmentRequest, callback: google.cloud.apihub.v1.RuntimeProjectAttachmentService.CreateRuntimeProjectAttachmentCallback): void; + + /** + * Calls CreateRuntimeProjectAttachment. + * @param request CreateRuntimeProjectAttachmentRequest message or plain object + * @returns Promise + */ + public createRuntimeProjectAttachment(request: google.cloud.apihub.v1.ICreateRuntimeProjectAttachmentRequest): Promise; + + /** + * Calls GetRuntimeProjectAttachment. + * @param request GetRuntimeProjectAttachmentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and RuntimeProjectAttachment + */ + public getRuntimeProjectAttachment(request: google.cloud.apihub.v1.IGetRuntimeProjectAttachmentRequest, callback: google.cloud.apihub.v1.RuntimeProjectAttachmentService.GetRuntimeProjectAttachmentCallback): void; + + /** + * Calls GetRuntimeProjectAttachment. + * @param request GetRuntimeProjectAttachmentRequest message or plain object + * @returns Promise + */ + public getRuntimeProjectAttachment(request: google.cloud.apihub.v1.IGetRuntimeProjectAttachmentRequest): Promise; + + /** + * Calls ListRuntimeProjectAttachments. + * @param request ListRuntimeProjectAttachmentsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListRuntimeProjectAttachmentsResponse + */ + public listRuntimeProjectAttachments(request: google.cloud.apihub.v1.IListRuntimeProjectAttachmentsRequest, callback: google.cloud.apihub.v1.RuntimeProjectAttachmentService.ListRuntimeProjectAttachmentsCallback): void; + + /** + * Calls ListRuntimeProjectAttachments. + * @param request ListRuntimeProjectAttachmentsRequest message or plain object + * @returns Promise + */ + public listRuntimeProjectAttachments(request: google.cloud.apihub.v1.IListRuntimeProjectAttachmentsRequest): Promise; + + /** + * Calls DeleteRuntimeProjectAttachment. + * @param request DeleteRuntimeProjectAttachmentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteRuntimeProjectAttachment(request: google.cloud.apihub.v1.IDeleteRuntimeProjectAttachmentRequest, callback: google.cloud.apihub.v1.RuntimeProjectAttachmentService.DeleteRuntimeProjectAttachmentCallback): void; + + /** + * Calls DeleteRuntimeProjectAttachment. + * @param request DeleteRuntimeProjectAttachmentRequest message or plain object + * @returns Promise + */ + public deleteRuntimeProjectAttachment(request: google.cloud.apihub.v1.IDeleteRuntimeProjectAttachmentRequest): Promise; + + /** + * Calls LookupRuntimeProjectAttachment. + * @param request LookupRuntimeProjectAttachmentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and LookupRuntimeProjectAttachmentResponse + */ + public lookupRuntimeProjectAttachment(request: google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentRequest, callback: google.cloud.apihub.v1.RuntimeProjectAttachmentService.LookupRuntimeProjectAttachmentCallback): void; + + /** + * Calls LookupRuntimeProjectAttachment. + * @param request LookupRuntimeProjectAttachmentRequest message or plain object + * @returns Promise + */ + public lookupRuntimeProjectAttachment(request: google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentRequest): Promise; + } + + namespace RuntimeProjectAttachmentService { + + /** + * Callback as used by {@link google.cloud.apihub.v1.RuntimeProjectAttachmentService|createRuntimeProjectAttachment}. + * @param error Error, if any + * @param [response] RuntimeProjectAttachment + */ + type CreateRuntimeProjectAttachmentCallback = (error: (Error|null), response?: google.cloud.apihub.v1.RuntimeProjectAttachment) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.RuntimeProjectAttachmentService|getRuntimeProjectAttachment}. + * @param error Error, if any + * @param [response] RuntimeProjectAttachment + */ + type GetRuntimeProjectAttachmentCallback = (error: (Error|null), response?: google.cloud.apihub.v1.RuntimeProjectAttachment) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.RuntimeProjectAttachmentService|listRuntimeProjectAttachments}. + * @param error Error, if any + * @param [response] ListRuntimeProjectAttachmentsResponse + */ + type ListRuntimeProjectAttachmentsCallback = (error: (Error|null), response?: google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.RuntimeProjectAttachmentService|deleteRuntimeProjectAttachment}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteRuntimeProjectAttachmentCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.apihub.v1.RuntimeProjectAttachmentService|lookupRuntimeProjectAttachment}. + * @param error Error, if any + * @param [response] LookupRuntimeProjectAttachmentResponse + */ + type LookupRuntimeProjectAttachmentCallback = (error: (Error|null), response?: google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse) => void; + } + + /** Properties of a CreateRuntimeProjectAttachmentRequest. */ + interface ICreateRuntimeProjectAttachmentRequest { + + /** CreateRuntimeProjectAttachmentRequest parent */ + parent?: (string|null); + + /** CreateRuntimeProjectAttachmentRequest runtimeProjectAttachmentId */ + runtimeProjectAttachmentId?: (string|null); + + /** CreateRuntimeProjectAttachmentRequest runtimeProjectAttachment */ + runtimeProjectAttachment?: (google.cloud.apihub.v1.IRuntimeProjectAttachment|null); + } + + /** Represents a CreateRuntimeProjectAttachmentRequest. */ + class CreateRuntimeProjectAttachmentRequest implements ICreateRuntimeProjectAttachmentRequest { + + /** + * Constructs a new CreateRuntimeProjectAttachmentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.ICreateRuntimeProjectAttachmentRequest); + + /** CreateRuntimeProjectAttachmentRequest parent. */ + public parent: string; + + /** CreateRuntimeProjectAttachmentRequest runtimeProjectAttachmentId. */ + public runtimeProjectAttachmentId: string; + + /** CreateRuntimeProjectAttachmentRequest runtimeProjectAttachment. */ + public runtimeProjectAttachment?: (google.cloud.apihub.v1.IRuntimeProjectAttachment|null); + + /** + * Creates a new CreateRuntimeProjectAttachmentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateRuntimeProjectAttachmentRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.ICreateRuntimeProjectAttachmentRequest): google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest; + + /** + * Encodes the specified CreateRuntimeProjectAttachmentRequest message. Does not implicitly {@link google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest.verify|verify} messages. + * @param message CreateRuntimeProjectAttachmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.ICreateRuntimeProjectAttachmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateRuntimeProjectAttachmentRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest.verify|verify} messages. + * @param message CreateRuntimeProjectAttachmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.ICreateRuntimeProjectAttachmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateRuntimeProjectAttachmentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateRuntimeProjectAttachmentRequest + * @throws {Error} If the payload is not 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.apihub.v1.CreateRuntimeProjectAttachmentRequest; + + /** + * Decodes a CreateRuntimeProjectAttachmentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateRuntimeProjectAttachmentRequest + * @throws {Error} If the payload 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.apihub.v1.CreateRuntimeProjectAttachmentRequest; + + /** + * Verifies a CreateRuntimeProjectAttachmentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateRuntimeProjectAttachmentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateRuntimeProjectAttachmentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest; + + /** + * Creates a plain object from a CreateRuntimeProjectAttachmentRequest message. Also converts values to other types if specified. + * @param message CreateRuntimeProjectAttachmentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateRuntimeProjectAttachmentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateRuntimeProjectAttachmentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetRuntimeProjectAttachmentRequest. */ + interface IGetRuntimeProjectAttachmentRequest { + + /** GetRuntimeProjectAttachmentRequest name */ + name?: (string|null); + } + + /** Represents a GetRuntimeProjectAttachmentRequest. */ + class GetRuntimeProjectAttachmentRequest implements IGetRuntimeProjectAttachmentRequest { + + /** + * Constructs a new GetRuntimeProjectAttachmentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IGetRuntimeProjectAttachmentRequest); + + /** GetRuntimeProjectAttachmentRequest name. */ + public name: string; + + /** + * Creates a new GetRuntimeProjectAttachmentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetRuntimeProjectAttachmentRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.IGetRuntimeProjectAttachmentRequest): google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest; + + /** + * Encodes the specified GetRuntimeProjectAttachmentRequest message. Does not implicitly {@link google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest.verify|verify} messages. + * @param message GetRuntimeProjectAttachmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IGetRuntimeProjectAttachmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetRuntimeProjectAttachmentRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest.verify|verify} messages. + * @param message GetRuntimeProjectAttachmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IGetRuntimeProjectAttachmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetRuntimeProjectAttachmentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetRuntimeProjectAttachmentRequest + * @throws {Error} If the payload is not 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.apihub.v1.GetRuntimeProjectAttachmentRequest; + + /** + * Decodes a GetRuntimeProjectAttachmentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetRuntimeProjectAttachmentRequest + * @throws {Error} If the payload 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.apihub.v1.GetRuntimeProjectAttachmentRequest; + + /** + * Verifies a GetRuntimeProjectAttachmentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetRuntimeProjectAttachmentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetRuntimeProjectAttachmentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest; + + /** + * Creates a plain object from a GetRuntimeProjectAttachmentRequest message. Also converts values to other types if specified. + * @param message GetRuntimeProjectAttachmentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetRuntimeProjectAttachmentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetRuntimeProjectAttachmentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListRuntimeProjectAttachmentsRequest. */ + interface IListRuntimeProjectAttachmentsRequest { + + /** ListRuntimeProjectAttachmentsRequest parent */ + parent?: (string|null); + + /** ListRuntimeProjectAttachmentsRequest pageSize */ + pageSize?: (number|null); + + /** ListRuntimeProjectAttachmentsRequest pageToken */ + pageToken?: (string|null); + + /** ListRuntimeProjectAttachmentsRequest filter */ + filter?: (string|null); + + /** ListRuntimeProjectAttachmentsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListRuntimeProjectAttachmentsRequest. */ + class ListRuntimeProjectAttachmentsRequest implements IListRuntimeProjectAttachmentsRequest { + + /** + * Constructs a new ListRuntimeProjectAttachmentsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IListRuntimeProjectAttachmentsRequest); + + /** ListRuntimeProjectAttachmentsRequest parent. */ + public parent: string; + + /** ListRuntimeProjectAttachmentsRequest pageSize. */ + public pageSize: number; + + /** ListRuntimeProjectAttachmentsRequest pageToken. */ + public pageToken: string; + + /** ListRuntimeProjectAttachmentsRequest filter. */ + public filter: string; + + /** ListRuntimeProjectAttachmentsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListRuntimeProjectAttachmentsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListRuntimeProjectAttachmentsRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.IListRuntimeProjectAttachmentsRequest): google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest; + + /** + * Encodes the specified ListRuntimeProjectAttachmentsRequest message. Does not implicitly {@link google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest.verify|verify} messages. + * @param message ListRuntimeProjectAttachmentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IListRuntimeProjectAttachmentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListRuntimeProjectAttachmentsRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest.verify|verify} messages. + * @param message ListRuntimeProjectAttachmentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IListRuntimeProjectAttachmentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListRuntimeProjectAttachmentsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListRuntimeProjectAttachmentsRequest + * @throws {Error} If the payload is not 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.apihub.v1.ListRuntimeProjectAttachmentsRequest; + + /** + * Decodes a ListRuntimeProjectAttachmentsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListRuntimeProjectAttachmentsRequest + * @throws {Error} If the payload 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.apihub.v1.ListRuntimeProjectAttachmentsRequest; + + /** + * Verifies a ListRuntimeProjectAttachmentsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListRuntimeProjectAttachmentsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListRuntimeProjectAttachmentsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest; + + /** + * Creates a plain object from a ListRuntimeProjectAttachmentsRequest message. Also converts values to other types if specified. + * @param message ListRuntimeProjectAttachmentsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListRuntimeProjectAttachmentsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListRuntimeProjectAttachmentsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListRuntimeProjectAttachmentsResponse. */ + interface IListRuntimeProjectAttachmentsResponse { + + /** ListRuntimeProjectAttachmentsResponse runtimeProjectAttachments */ + runtimeProjectAttachments?: (google.cloud.apihub.v1.IRuntimeProjectAttachment[]|null); + + /** ListRuntimeProjectAttachmentsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListRuntimeProjectAttachmentsResponse. */ + class ListRuntimeProjectAttachmentsResponse implements IListRuntimeProjectAttachmentsResponse { + + /** + * Constructs a new ListRuntimeProjectAttachmentsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IListRuntimeProjectAttachmentsResponse); + + /** ListRuntimeProjectAttachmentsResponse runtimeProjectAttachments. */ + public runtimeProjectAttachments: google.cloud.apihub.v1.IRuntimeProjectAttachment[]; + + /** ListRuntimeProjectAttachmentsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListRuntimeProjectAttachmentsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListRuntimeProjectAttachmentsResponse instance + */ + public static create(properties?: google.cloud.apihub.v1.IListRuntimeProjectAttachmentsResponse): google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse; + + /** + * Encodes the specified ListRuntimeProjectAttachmentsResponse message. Does not implicitly {@link google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse.verify|verify} messages. + * @param message ListRuntimeProjectAttachmentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IListRuntimeProjectAttachmentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListRuntimeProjectAttachmentsResponse message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse.verify|verify} messages. + * @param message ListRuntimeProjectAttachmentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IListRuntimeProjectAttachmentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListRuntimeProjectAttachmentsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListRuntimeProjectAttachmentsResponse + * @throws {Error} If the payload is not 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.apihub.v1.ListRuntimeProjectAttachmentsResponse; + + /** + * Decodes a ListRuntimeProjectAttachmentsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListRuntimeProjectAttachmentsResponse + * @throws {Error} If the payload 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.apihub.v1.ListRuntimeProjectAttachmentsResponse; + + /** + * Verifies a ListRuntimeProjectAttachmentsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListRuntimeProjectAttachmentsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListRuntimeProjectAttachmentsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse; + + /** + * Creates a plain object from a ListRuntimeProjectAttachmentsResponse message. Also converts values to other types if specified. + * @param message ListRuntimeProjectAttachmentsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListRuntimeProjectAttachmentsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListRuntimeProjectAttachmentsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteRuntimeProjectAttachmentRequest. */ + interface IDeleteRuntimeProjectAttachmentRequest { + + /** DeleteRuntimeProjectAttachmentRequest name */ + name?: (string|null); + } + + /** Represents a DeleteRuntimeProjectAttachmentRequest. */ + class DeleteRuntimeProjectAttachmentRequest implements IDeleteRuntimeProjectAttachmentRequest { + + /** + * Constructs a new DeleteRuntimeProjectAttachmentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IDeleteRuntimeProjectAttachmentRequest); + + /** DeleteRuntimeProjectAttachmentRequest name. */ + public name: string; + + /** + * Creates a new DeleteRuntimeProjectAttachmentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteRuntimeProjectAttachmentRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.IDeleteRuntimeProjectAttachmentRequest): google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest; + + /** + * Encodes the specified DeleteRuntimeProjectAttachmentRequest message. Does not implicitly {@link google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest.verify|verify} messages. + * @param message DeleteRuntimeProjectAttachmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IDeleteRuntimeProjectAttachmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteRuntimeProjectAttachmentRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest.verify|verify} messages. + * @param message DeleteRuntimeProjectAttachmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IDeleteRuntimeProjectAttachmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteRuntimeProjectAttachmentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteRuntimeProjectAttachmentRequest + * @throws {Error} If the payload is not 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.apihub.v1.DeleteRuntimeProjectAttachmentRequest; + + /** + * Decodes a DeleteRuntimeProjectAttachmentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteRuntimeProjectAttachmentRequest + * @throws {Error} If the payload 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.apihub.v1.DeleteRuntimeProjectAttachmentRequest; + + /** + * Verifies a DeleteRuntimeProjectAttachmentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteRuntimeProjectAttachmentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteRuntimeProjectAttachmentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest; + + /** + * Creates a plain object from a DeleteRuntimeProjectAttachmentRequest message. Also converts values to other types if specified. + * @param message DeleteRuntimeProjectAttachmentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteRuntimeProjectAttachmentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteRuntimeProjectAttachmentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LookupRuntimeProjectAttachmentRequest. */ + interface ILookupRuntimeProjectAttachmentRequest { + + /** LookupRuntimeProjectAttachmentRequest name */ + name?: (string|null); + } + + /** Represents a LookupRuntimeProjectAttachmentRequest. */ + class LookupRuntimeProjectAttachmentRequest implements ILookupRuntimeProjectAttachmentRequest { + + /** + * Constructs a new LookupRuntimeProjectAttachmentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentRequest); + + /** LookupRuntimeProjectAttachmentRequest name. */ + public name: string; + + /** + * Creates a new LookupRuntimeProjectAttachmentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns LookupRuntimeProjectAttachmentRequest instance + */ + public static create(properties?: google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentRequest): google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest; + + /** + * Encodes the specified LookupRuntimeProjectAttachmentRequest message. Does not implicitly {@link google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest.verify|verify} messages. + * @param message LookupRuntimeProjectAttachmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LookupRuntimeProjectAttachmentRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest.verify|verify} messages. + * @param message LookupRuntimeProjectAttachmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LookupRuntimeProjectAttachmentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LookupRuntimeProjectAttachmentRequest + * @throws {Error} If the payload is not 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.apihub.v1.LookupRuntimeProjectAttachmentRequest; + + /** + * Decodes a LookupRuntimeProjectAttachmentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LookupRuntimeProjectAttachmentRequest + * @throws {Error} If the payload 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.apihub.v1.LookupRuntimeProjectAttachmentRequest; + + /** + * Verifies a LookupRuntimeProjectAttachmentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LookupRuntimeProjectAttachmentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LookupRuntimeProjectAttachmentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest; + + /** + * Creates a plain object from a LookupRuntimeProjectAttachmentRequest message. Also converts values to other types if specified. + * @param message LookupRuntimeProjectAttachmentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LookupRuntimeProjectAttachmentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LookupRuntimeProjectAttachmentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LookupRuntimeProjectAttachmentResponse. */ + interface ILookupRuntimeProjectAttachmentResponse { + + /** LookupRuntimeProjectAttachmentResponse runtimeProjectAttachment */ + runtimeProjectAttachment?: (google.cloud.apihub.v1.IRuntimeProjectAttachment|null); + } + + /** Represents a LookupRuntimeProjectAttachmentResponse. */ + class LookupRuntimeProjectAttachmentResponse implements ILookupRuntimeProjectAttachmentResponse { + + /** + * Constructs a new LookupRuntimeProjectAttachmentResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentResponse); + + /** LookupRuntimeProjectAttachmentResponse runtimeProjectAttachment. */ + public runtimeProjectAttachment?: (google.cloud.apihub.v1.IRuntimeProjectAttachment|null); + + /** + * Creates a new LookupRuntimeProjectAttachmentResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns LookupRuntimeProjectAttachmentResponse instance + */ + public static create(properties?: google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentResponse): google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse; + + /** + * Encodes the specified LookupRuntimeProjectAttachmentResponse message. Does not implicitly {@link google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse.verify|verify} messages. + * @param message LookupRuntimeProjectAttachmentResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LookupRuntimeProjectAttachmentResponse message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse.verify|verify} messages. + * @param message LookupRuntimeProjectAttachmentResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LookupRuntimeProjectAttachmentResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LookupRuntimeProjectAttachmentResponse + * @throws {Error} If the payload is not 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.apihub.v1.LookupRuntimeProjectAttachmentResponse; + + /** + * Decodes a LookupRuntimeProjectAttachmentResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LookupRuntimeProjectAttachmentResponse + * @throws {Error} If the payload 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.apihub.v1.LookupRuntimeProjectAttachmentResponse; + + /** + * Verifies a LookupRuntimeProjectAttachmentResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LookupRuntimeProjectAttachmentResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LookupRuntimeProjectAttachmentResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse; + + /** + * Creates a plain object from a LookupRuntimeProjectAttachmentResponse message. Also converts values to other types if specified. + * @param message LookupRuntimeProjectAttachmentResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LookupRuntimeProjectAttachmentResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LookupRuntimeProjectAttachmentResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RuntimeProjectAttachment. */ + interface IRuntimeProjectAttachment { + + /** RuntimeProjectAttachment name */ + name?: (string|null); + + /** RuntimeProjectAttachment runtimeProject */ + runtimeProject?: (string|null); + + /** RuntimeProjectAttachment createTime */ + createTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a RuntimeProjectAttachment. */ + class RuntimeProjectAttachment implements IRuntimeProjectAttachment { + + /** + * Constructs a new RuntimeProjectAttachment. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apihub.v1.IRuntimeProjectAttachment); + + /** RuntimeProjectAttachment name. */ + public name: string; + + /** RuntimeProjectAttachment runtimeProject. */ + public runtimeProject: string; + + /** RuntimeProjectAttachment createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new RuntimeProjectAttachment instance using the specified properties. + * @param [properties] Properties to set + * @returns RuntimeProjectAttachment instance + */ + public static create(properties?: google.cloud.apihub.v1.IRuntimeProjectAttachment): google.cloud.apihub.v1.RuntimeProjectAttachment; + + /** + * Encodes the specified RuntimeProjectAttachment message. Does not implicitly {@link google.cloud.apihub.v1.RuntimeProjectAttachment.verify|verify} messages. + * @param message RuntimeProjectAttachment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apihub.v1.IRuntimeProjectAttachment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RuntimeProjectAttachment message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.RuntimeProjectAttachment.verify|verify} messages. + * @param message RuntimeProjectAttachment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apihub.v1.IRuntimeProjectAttachment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RuntimeProjectAttachment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RuntimeProjectAttachment + * @throws {Error} If the payload is not 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.apihub.v1.RuntimeProjectAttachment; + + /** + * Decodes a RuntimeProjectAttachment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RuntimeProjectAttachment + * @throws {Error} If the payload 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.apihub.v1.RuntimeProjectAttachment; + + /** + * Verifies a RuntimeProjectAttachment message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RuntimeProjectAttachment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RuntimeProjectAttachment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.RuntimeProjectAttachment; + + /** + * Creates a plain object from a RuntimeProjectAttachment message. Also converts values to other types if specified. + * @param message RuntimeProjectAttachment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apihub.v1.RuntimeProjectAttachment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RuntimeProjectAttachment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RuntimeProjectAttachment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + } + + /** Namespace api. */ + namespace api { + + /** Properties of a Http. */ + interface IHttp { + + /** Http rules */ + rules?: (google.api.IHttpRule[]|null); + + /** Http fullyDecodeReservedExpansion */ + fullyDecodeReservedExpansion?: (boolean|null); + } + + /** Represents a Http. */ + class Http implements IHttp { + + /** + * Constructs a new Http. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttp); + + /** Http rules. */ + public rules: google.api.IHttpRule[]; + + /** Http fullyDecodeReservedExpansion. */ + public fullyDecodeReservedExpansion: boolean; + + /** + * Creates a new Http instance using the specified properties. + * @param [properties] Properties to set + * @returns Http instance + */ + public static create(properties?: google.api.IHttp): google.api.Http; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Http message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Http; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Http; + + /** + * Verifies a Http message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Http + */ + public static fromObject(object: { [k: string]: any }): google.api.Http; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @param message Http + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Http, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Http to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * 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); + + /** Publishing protoReferenceDocumentationUri */ + protoReferenceDocumentationUri?: (string|null); + + /** Publishing restReferenceDocumentationUri */ + restReferenceDocumentationUri?: (string|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[]; + + /** Publishing protoReferenceDocumentationUri. */ + public protoReferenceDocumentationUri: string; + + /** Publishing restReferenceDocumentationUri. */ + public restReferenceDocumentationUri: string; + + /** + * 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); + + /** DotnetSettings renamedServices */ + renamedServices?: ({ [k: string]: string }|null); + + /** DotnetSettings renamedResources */ + renamedResources?: ({ [k: string]: string }|null); + + /** DotnetSettings ignoredResources */ + ignoredResources?: (string[]|null); + + /** DotnetSettings forcedNamespaceAliases */ + forcedNamespaceAliases?: (string[]|null); + + /** DotnetSettings handwrittenSignatures */ + handwrittenSignatures?: (string[]|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); + + /** DotnetSettings renamedServices. */ + public renamedServices: { [k: string]: string }; + + /** DotnetSettings renamedResources. */ + public renamedResources: { [k: string]: string }; + + /** DotnetSettings ignoredResources. */ + public ignoredResources: string[]; + + /** DotnetSettings forcedNamespaceAliases. */ + public forcedNamespaceAliases: string[]; + + /** DotnetSettings handwrittenSignatures. */ + public handwrittenSignatures: string[]; + + /** + * 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); + + /** MethodSettings autoPopulatedFields */ + autoPopulatedFields?: (string[]|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); + + /** MethodSettings autoPopulatedFields. */ + public autoPopulatedFields: string[]; + + /** + * 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, + SHOPPING = 5, + GEO = 6, + GENERATIVE_AI = 7 + } + + /** 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 + } + + /** 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, + IDENTIFIER = 8 + } + + /** 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; + } + } + + /** 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; + } + + /** Edition enum. */ + enum Edition { + EDITION_UNKNOWN = 0, + EDITION_PROTO2 = 998, + EDITION_PROTO3 = 999, + EDITION_2023 = 1000, + EDITION_2024 = 1001, + EDITION_1_TEST_ONLY = 1, + EDITION_2_TEST_ONLY = 2, + EDITION_99997_TEST_ONLY = 99997, + EDITION_99998_TEST_ONLY = 99998, + EDITION_99999_TEST_ONLY = 99999, + EDITION_MAX = 2147483647 + } + + /** 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?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|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: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** + * 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); + + /** ExtensionRangeOptions declaration */ + declaration?: (google.protobuf.ExtensionRangeOptions.IDeclaration[]|null); + + /** ExtensionRangeOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** ExtensionRangeOptions verification */ + verification?: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState|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[]; + + /** ExtensionRangeOptions declaration. */ + public declaration: google.protobuf.ExtensionRangeOptions.IDeclaration[]; + + /** ExtensionRangeOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** ExtensionRangeOptions verification. */ + public verification: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState); + + /** + * 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; + } + + namespace ExtensionRangeOptions { + + /** Properties of a Declaration. */ + interface IDeclaration { + + /** Declaration number */ + number?: (number|null); + + /** Declaration fullName */ + fullName?: (string|null); + + /** Declaration type */ + type?: (string|null); + + /** Declaration reserved */ + reserved?: (boolean|null); + + /** Declaration repeated */ + repeated?: (boolean|null); + } + + /** Represents a Declaration. */ + class Declaration implements IDeclaration { + + /** + * Constructs a new Declaration. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration); + + /** Declaration number. */ + public number: number; + + /** Declaration fullName. */ + public fullName: string; + + /** Declaration type. */ + public type: string; + + /** Declaration reserved. */ + public reserved: boolean; + + /** Declaration repeated. */ + public repeated: boolean; + + /** + * Creates a new Declaration instance using the specified properties. + * @param [properties] Properties to set + * @returns Declaration instance + */ + public static create(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @param message Declaration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @param message Declaration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Declaration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Declaration + * @throws {Error} If the payload is not 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.Declaration; + + /** + * Decodes a Declaration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Declaration + * @throws {Error} If the payload 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.Declaration; + + /** + * Verifies a Declaration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Declaration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Declaration + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Creates a plain object from a Declaration message. Also converts values to other types if specified. + * @param message Declaration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ExtensionRangeOptions.Declaration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Declaration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Declaration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** VerificationState enum. */ + enum VerificationState { + DECLARATION = 0, + UNVERIFIED = 1 + } + } + + /** 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_REPEATED = 3, + LABEL_REQUIRED = 2 + } + } + + /** 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 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 features */ + features?: (google.protobuf.IFeatureSet|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 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 features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** 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 features */ + features?: (google.protobuf.IFeatureSet|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 features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** 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 targets */ + targets?: (google.protobuf.FieldOptions.OptionTargetType[]|null); + + /** FieldOptions editionDefaults */ + editionDefaults?: (google.protobuf.FieldOptions.IEditionDefault[]|null); + + /** FieldOptions features */ + features?: (google.protobuf.IFeatureSet|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 targets. */ + public targets: google.protobuf.FieldOptions.OptionTargetType[]; + + /** FieldOptions editionDefaults. */ + public editionDefaults: google.protobuf.FieldOptions.IEditionDefault[]; + + /** FieldOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** 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 EditionDefault. */ + interface IEditionDefault { + + /** EditionDefault edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** EditionDefault value */ + value?: (string|null); + } + + /** Represents an EditionDefault. */ + class EditionDefault implements IEditionDefault { + + /** + * Constructs a new EditionDefault. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FieldOptions.IEditionDefault); + + /** EditionDefault edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** EditionDefault value. */ + public value: string; + + /** + * Creates a new EditionDefault instance using the specified properties. + * @param [properties] Properties to set + * @returns EditionDefault instance + */ + public static create(properties?: google.protobuf.FieldOptions.IEditionDefault): google.protobuf.FieldOptions.EditionDefault; + + /** + * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @param message EditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @param message EditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EditionDefault message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EditionDefault + * @throws {Error} If the payload is not 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.EditionDefault; + + /** + * Decodes an EditionDefault message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EditionDefault + * @throws {Error} If the payload 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.EditionDefault; + + /** + * Verifies an EditionDefault message. + * @param message Plain 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 EditionDefault message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EditionDefault + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions.EditionDefault; + + /** + * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. + * @param message EditionDefault + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions.EditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EditionDefault to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EditionDefault + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an OneofOptions. */ + interface IOneofOptions { + + /** OneofOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** 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 features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** 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 features */ + features?: (google.protobuf.IFeatureSet|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 features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** 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 features */ + features?: (google.protobuf.IFeatureSet|null); + + /** EnumValueOptions debugRedact */ + debugRedact?: (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 features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** EnumValueOptions debugRedact. */ + public debugRedact: 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 features */ + features?: (google.protobuf.IFeatureSet|null); + + /** 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); + + /** ServiceOptions .google.api.apiVersion */ + ".google.api.apiVersion"?: (string|null); + } + + /** Represents a ServiceOptions. */ + class ServiceOptions implements IServiceOptions { + + /** + * Constructs a new ServiceOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceOptions); + + /** ServiceOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** 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 features */ + features?: (google.protobuf.IFeatureSet|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 features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** 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 FeatureSet. */ + interface IFeatureSet { + + /** FeatureSet fieldPresence */ + fieldPresence?: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence|null); + + /** FeatureSet enumType */ + enumType?: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType|null); + + /** FeatureSet repeatedFieldEncoding */ + repeatedFieldEncoding?: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding|null); + + /** FeatureSet utf8Validation */ + utf8Validation?: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation|null); + + /** FeatureSet messageEncoding */ + messageEncoding?: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding|null); + + /** FeatureSet jsonFormat */ + jsonFormat?: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat|null); + } + + /** Represents a FeatureSet. */ + class FeatureSet implements IFeatureSet { + + /** + * Constructs a new FeatureSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFeatureSet); + + /** FeatureSet fieldPresence. */ + public fieldPresence: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence); + + /** FeatureSet enumType. */ + public enumType: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType); + + /** FeatureSet repeatedFieldEncoding. */ + public repeatedFieldEncoding: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding); + + /** FeatureSet utf8Validation. */ + public utf8Validation: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation); + + /** FeatureSet messageEncoding. */ + public messageEncoding: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding); + + /** FeatureSet jsonFormat. */ + public jsonFormat: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat); + + /** + * Creates a new FeatureSet instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSet instance + */ + public static create(properties?: google.protobuf.IFeatureSet): google.protobuf.FeatureSet; + + /** + * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @param message FeatureSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @param message FeatureSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSet + * @throws {Error} If the payload is not 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.FeatureSet; + + /** + * Decodes a FeatureSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSet + * @throws {Error} If the payload 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.FeatureSet; + + /** + * Verifies a FeatureSet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSet + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSet; + + /** + * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. + * @param message FeatureSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FeatureSet { + + /** FieldPresence enum. */ + enum FieldPresence { + FIELD_PRESENCE_UNKNOWN = 0, + EXPLICIT = 1, + IMPLICIT = 2, + LEGACY_REQUIRED = 3 + } + + /** EnumType enum. */ + enum EnumType { + ENUM_TYPE_UNKNOWN = 0, + OPEN = 1, + CLOSED = 2 + } + + /** RepeatedFieldEncoding enum. */ + enum RepeatedFieldEncoding { + REPEATED_FIELD_ENCODING_UNKNOWN = 0, + PACKED = 1, + EXPANDED = 2 + } + + /** Utf8Validation enum. */ + enum Utf8Validation { + UTF8_VALIDATION_UNKNOWN = 0, + VERIFY = 2, + NONE = 3 + } + + /** MessageEncoding enum. */ + enum MessageEncoding { + MESSAGE_ENCODING_UNKNOWN = 0, + LENGTH_PREFIXED = 1, + DELIMITED = 2 + } + + /** JsonFormat enum. */ + enum JsonFormat { + JSON_FORMAT_UNKNOWN = 0, + ALLOW = 1, + LEGACY_BEST_EFFORT = 2 + } + } + + /** Properties of a FeatureSetDefaults. */ + interface IFeatureSetDefaults { + + /** FeatureSetDefaults defaults */ + defaults?: (google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]|null); + + /** FeatureSetDefaults minimumEdition */ + minimumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSetDefaults maximumEdition */ + maximumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + } + + /** Represents a FeatureSetDefaults. */ + class FeatureSetDefaults implements IFeatureSetDefaults { + + /** + * Constructs a new FeatureSetDefaults. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFeatureSetDefaults); + + /** FeatureSetDefaults defaults. */ + public defaults: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]; + + /** FeatureSetDefaults minimumEdition. */ + public minimumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSetDefaults maximumEdition. */ + public maximumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** + * Creates a new FeatureSetDefaults instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSetDefaults instance + */ + public static create(properties?: google.protobuf.IFeatureSetDefaults): google.protobuf.FeatureSetDefaults; + + /** + * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @param message FeatureSetDefaults message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @param message FeatureSetDefaults message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSetDefaults + * @throws {Error} If the payload is not 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.FeatureSetDefaults; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSetDefaults + * @throws {Error} If the payload 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.FeatureSetDefaults; + + /** + * Verifies a FeatureSetDefaults message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSetDefaults + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults; + + /** + * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. + * @param message FeatureSetDefaults + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSetDefaults, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSetDefaults to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSetDefaults + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FeatureSetDefaults { + + /** Properties of a FeatureSetEditionDefault. */ + interface IFeatureSetEditionDefault { + + /** FeatureSetEditionDefault edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSetEditionDefault features */ + features?: (google.protobuf.IFeatureSet|null); + } + + /** Represents a FeatureSetEditionDefault. */ + class FeatureSetEditionDefault implements IFeatureSetEditionDefault { + + /** + * Constructs a new FeatureSetEditionDefault. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault); + + /** FeatureSetEditionDefault edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSetEditionDefault features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** + * Creates a new FeatureSetEditionDefault instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSetEditionDefault instance + */ + public static create(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @param message FeatureSetEditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @param message FeatureSetEditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSetEditionDefault + * @throws {Error} If the payload is not 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.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSetEditionDefault + * @throws {Error} If the payload 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.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Verifies a FeatureSetEditionDefault message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSetEditionDefault + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. + * @param message FeatureSetEditionDefault + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSetEditionDefault to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSetEditionDefault + * @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 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 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 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; + } + + /** 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 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; + } + } + + /** 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/owl-bot-staging/google-cloud-apihub/v1/protos/protos.js b/owl-bot-staging/google-cloud-apihub/v1/protos/protos.js new file mode 100644 index 00000000000..dafb3c6f8b2 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/protos/protos.js @@ -0,0 +1,53441 @@ +// Copyright 2024 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_apihub_protos || ($protobuf.roots._google_cloud_apihub_protos = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.cloud = (function() { + + /** + * Namespace cloud. + * @memberof google + * @namespace + */ + var cloud = {}; + + cloud.apihub = (function() { + + /** + * Namespace apihub. + * @memberof google.cloud + * @namespace + */ + var apihub = {}; + + apihub.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.cloud.apihub + * @namespace + */ + var v1 = {}; + + v1.ApiHub = (function() { + + /** + * Constructs a new ApiHub service. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents an ApiHub + * @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 ApiHub(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (ApiHub.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = ApiHub; + + /** + * Creates new ApiHub service using the specified rpc implementation. + * @function create + * @memberof google.cloud.apihub.v1.ApiHub + * @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 {ApiHub} RPC service. Useful where requests and/or responses are streamed. + */ + ApiHub.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|createApi}. + * @memberof google.cloud.apihub.v1.ApiHub + * @typedef CreateApiCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apihub.v1.Api} [response] Api + */ + + /** + * Calls CreateApi. + * @function createApi + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.ICreateApiRequest} request CreateApiRequest message or plain object + * @param {google.cloud.apihub.v1.ApiHub.CreateApiCallback} callback Node-style callback called with the error, if any, and Api + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ApiHub.prototype.createApi = function createApi(request, callback) { + return this.rpcCall(createApi, $root.google.cloud.apihub.v1.CreateApiRequest, $root.google.cloud.apihub.v1.Api, request, callback); + }, "name", { value: "CreateApi" }); + + /** + * Calls CreateApi. + * @function createApi + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.ICreateApiRequest} request CreateApiRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|getApi}. + * @memberof google.cloud.apihub.v1.ApiHub + * @typedef GetApiCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apihub.v1.Api} [response] Api + */ + + /** + * Calls GetApi. + * @function getApi + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IGetApiRequest} request GetApiRequest message or plain object + * @param {google.cloud.apihub.v1.ApiHub.GetApiCallback} callback Node-style callback called with the error, if any, and Api + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ApiHub.prototype.getApi = function getApi(request, callback) { + return this.rpcCall(getApi, $root.google.cloud.apihub.v1.GetApiRequest, $root.google.cloud.apihub.v1.Api, request, callback); + }, "name", { value: "GetApi" }); + + /** + * Calls GetApi. + * @function getApi + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IGetApiRequest} request GetApiRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|listApis}. + * @memberof google.cloud.apihub.v1.ApiHub + * @typedef ListApisCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apihub.v1.ListApisResponse} [response] ListApisResponse + */ + + /** + * Calls ListApis. + * @function listApis + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IListApisRequest} request ListApisRequest message or plain object + * @param {google.cloud.apihub.v1.ApiHub.ListApisCallback} callback Node-style callback called with the error, if any, and ListApisResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ApiHub.prototype.listApis = function listApis(request, callback) { + return this.rpcCall(listApis, $root.google.cloud.apihub.v1.ListApisRequest, $root.google.cloud.apihub.v1.ListApisResponse, request, callback); + }, "name", { value: "ListApis" }); + + /** + * Calls ListApis. + * @function listApis + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IListApisRequest} request ListApisRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|updateApi}. + * @memberof google.cloud.apihub.v1.ApiHub + * @typedef UpdateApiCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apihub.v1.Api} [response] Api + */ + + /** + * Calls UpdateApi. + * @function updateApi + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IUpdateApiRequest} request UpdateApiRequest message or plain object + * @param {google.cloud.apihub.v1.ApiHub.UpdateApiCallback} callback Node-style callback called with the error, if any, and Api + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ApiHub.prototype.updateApi = function updateApi(request, callback) { + return this.rpcCall(updateApi, $root.google.cloud.apihub.v1.UpdateApiRequest, $root.google.cloud.apihub.v1.Api, request, callback); + }, "name", { value: "UpdateApi" }); + + /** + * Calls UpdateApi. + * @function updateApi + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IUpdateApiRequest} request UpdateApiRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|deleteApi}. + * @memberof google.cloud.apihub.v1.ApiHub + * @typedef DeleteApiCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteApi. + * @function deleteApi + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IDeleteApiRequest} request DeleteApiRequest message or plain object + * @param {google.cloud.apihub.v1.ApiHub.DeleteApiCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ApiHub.prototype.deleteApi = function deleteApi(request, callback) { + return this.rpcCall(deleteApi, $root.google.cloud.apihub.v1.DeleteApiRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteApi" }); + + /** + * Calls DeleteApi. + * @function deleteApi + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IDeleteApiRequest} request DeleteApiRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|createVersion}. + * @memberof google.cloud.apihub.v1.ApiHub + * @typedef CreateVersionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apihub.v1.Version} [response] Version + */ + + /** + * Calls CreateVersion. + * @function createVersion + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.ICreateVersionRequest} request CreateVersionRequest message or plain object + * @param {google.cloud.apihub.v1.ApiHub.CreateVersionCallback} callback Node-style callback called with the error, if any, and Version + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ApiHub.prototype.createVersion = function createVersion(request, callback) { + return this.rpcCall(createVersion, $root.google.cloud.apihub.v1.CreateVersionRequest, $root.google.cloud.apihub.v1.Version, request, callback); + }, "name", { value: "CreateVersion" }); + + /** + * Calls CreateVersion. + * @function createVersion + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.ICreateVersionRequest} request CreateVersionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|getVersion}. + * @memberof google.cloud.apihub.v1.ApiHub + * @typedef GetVersionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apihub.v1.Version} [response] Version + */ + + /** + * Calls GetVersion. + * @function getVersion + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IGetVersionRequest} request GetVersionRequest message or plain object + * @param {google.cloud.apihub.v1.ApiHub.GetVersionCallback} callback Node-style callback called with the error, if any, and Version + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ApiHub.prototype.getVersion = function getVersion(request, callback) { + return this.rpcCall(getVersion, $root.google.cloud.apihub.v1.GetVersionRequest, $root.google.cloud.apihub.v1.Version, request, callback); + }, "name", { value: "GetVersion" }); + + /** + * Calls GetVersion. + * @function getVersion + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IGetVersionRequest} request GetVersionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|listVersions}. + * @memberof google.cloud.apihub.v1.ApiHub + * @typedef ListVersionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apihub.v1.ListVersionsResponse} [response] ListVersionsResponse + */ + + /** + * Calls ListVersions. + * @function listVersions + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IListVersionsRequest} request ListVersionsRequest message or plain object + * @param {google.cloud.apihub.v1.ApiHub.ListVersionsCallback} callback Node-style callback called with the error, if any, and ListVersionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ApiHub.prototype.listVersions = function listVersions(request, callback) { + return this.rpcCall(listVersions, $root.google.cloud.apihub.v1.ListVersionsRequest, $root.google.cloud.apihub.v1.ListVersionsResponse, request, callback); + }, "name", { value: "ListVersions" }); + + /** + * Calls ListVersions. + * @function listVersions + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IListVersionsRequest} request ListVersionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|updateVersion}. + * @memberof google.cloud.apihub.v1.ApiHub + * @typedef UpdateVersionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apihub.v1.Version} [response] Version + */ + + /** + * Calls UpdateVersion. + * @function updateVersion + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IUpdateVersionRequest} request UpdateVersionRequest message or plain object + * @param {google.cloud.apihub.v1.ApiHub.UpdateVersionCallback} callback Node-style callback called with the error, if any, and Version + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ApiHub.prototype.updateVersion = function updateVersion(request, callback) { + return this.rpcCall(updateVersion, $root.google.cloud.apihub.v1.UpdateVersionRequest, $root.google.cloud.apihub.v1.Version, request, callback); + }, "name", { value: "UpdateVersion" }); + + /** + * Calls UpdateVersion. + * @function updateVersion + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IUpdateVersionRequest} request UpdateVersionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|deleteVersion}. + * @memberof google.cloud.apihub.v1.ApiHub + * @typedef DeleteVersionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteVersion. + * @function deleteVersion + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IDeleteVersionRequest} request DeleteVersionRequest message or plain object + * @param {google.cloud.apihub.v1.ApiHub.DeleteVersionCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ApiHub.prototype.deleteVersion = function deleteVersion(request, callback) { + return this.rpcCall(deleteVersion, $root.google.cloud.apihub.v1.DeleteVersionRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteVersion" }); + + /** + * Calls DeleteVersion. + * @function deleteVersion + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IDeleteVersionRequest} request DeleteVersionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|createSpec}. + * @memberof google.cloud.apihub.v1.ApiHub + * @typedef CreateSpecCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apihub.v1.Spec} [response] Spec + */ + + /** + * Calls CreateSpec. + * @function createSpec + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.ICreateSpecRequest} request CreateSpecRequest message or plain object + * @param {google.cloud.apihub.v1.ApiHub.CreateSpecCallback} callback Node-style callback called with the error, if any, and Spec + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ApiHub.prototype.createSpec = function createSpec(request, callback) { + return this.rpcCall(createSpec, $root.google.cloud.apihub.v1.CreateSpecRequest, $root.google.cloud.apihub.v1.Spec, request, callback); + }, "name", { value: "CreateSpec" }); + + /** + * Calls CreateSpec. + * @function createSpec + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.ICreateSpecRequest} request CreateSpecRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|getSpec}. + * @memberof google.cloud.apihub.v1.ApiHub + * @typedef GetSpecCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apihub.v1.Spec} [response] Spec + */ + + /** + * Calls GetSpec. + * @function getSpec + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IGetSpecRequest} request GetSpecRequest message or plain object + * @param {google.cloud.apihub.v1.ApiHub.GetSpecCallback} callback Node-style callback called with the error, if any, and Spec + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ApiHub.prototype.getSpec = function getSpec(request, callback) { + return this.rpcCall(getSpec, $root.google.cloud.apihub.v1.GetSpecRequest, $root.google.cloud.apihub.v1.Spec, request, callback); + }, "name", { value: "GetSpec" }); + + /** + * Calls GetSpec. + * @function getSpec + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IGetSpecRequest} request GetSpecRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|getSpecContents}. + * @memberof google.cloud.apihub.v1.ApiHub + * @typedef GetSpecContentsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apihub.v1.SpecContents} [response] SpecContents + */ + + /** + * Calls GetSpecContents. + * @function getSpecContents + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IGetSpecContentsRequest} request GetSpecContentsRequest message or plain object + * @param {google.cloud.apihub.v1.ApiHub.GetSpecContentsCallback} callback Node-style callback called with the error, if any, and SpecContents + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ApiHub.prototype.getSpecContents = function getSpecContents(request, callback) { + return this.rpcCall(getSpecContents, $root.google.cloud.apihub.v1.GetSpecContentsRequest, $root.google.cloud.apihub.v1.SpecContents, request, callback); + }, "name", { value: "GetSpecContents" }); + + /** + * Calls GetSpecContents. + * @function getSpecContents + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IGetSpecContentsRequest} request GetSpecContentsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|listSpecs}. + * @memberof google.cloud.apihub.v1.ApiHub + * @typedef ListSpecsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apihub.v1.ListSpecsResponse} [response] ListSpecsResponse + */ + + /** + * Calls ListSpecs. + * @function listSpecs + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IListSpecsRequest} request ListSpecsRequest message or plain object + * @param {google.cloud.apihub.v1.ApiHub.ListSpecsCallback} callback Node-style callback called with the error, if any, and ListSpecsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ApiHub.prototype.listSpecs = function listSpecs(request, callback) { + return this.rpcCall(listSpecs, $root.google.cloud.apihub.v1.ListSpecsRequest, $root.google.cloud.apihub.v1.ListSpecsResponse, request, callback); + }, "name", { value: "ListSpecs" }); + + /** + * Calls ListSpecs. + * @function listSpecs + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IListSpecsRequest} request ListSpecsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|updateSpec}. + * @memberof google.cloud.apihub.v1.ApiHub + * @typedef UpdateSpecCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apihub.v1.Spec} [response] Spec + */ + + /** + * Calls UpdateSpec. + * @function updateSpec + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IUpdateSpecRequest} request UpdateSpecRequest message or plain object + * @param {google.cloud.apihub.v1.ApiHub.UpdateSpecCallback} callback Node-style callback called with the error, if any, and Spec + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ApiHub.prototype.updateSpec = function updateSpec(request, callback) { + return this.rpcCall(updateSpec, $root.google.cloud.apihub.v1.UpdateSpecRequest, $root.google.cloud.apihub.v1.Spec, request, callback); + }, "name", { value: "UpdateSpec" }); + + /** + * Calls UpdateSpec. + * @function updateSpec + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IUpdateSpecRequest} request UpdateSpecRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|deleteSpec}. + * @memberof google.cloud.apihub.v1.ApiHub + * @typedef DeleteSpecCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteSpec. + * @function deleteSpec + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IDeleteSpecRequest} request DeleteSpecRequest message or plain object + * @param {google.cloud.apihub.v1.ApiHub.DeleteSpecCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ApiHub.prototype.deleteSpec = function deleteSpec(request, callback) { + return this.rpcCall(deleteSpec, $root.google.cloud.apihub.v1.DeleteSpecRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteSpec" }); + + /** + * Calls DeleteSpec. + * @function deleteSpec + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IDeleteSpecRequest} request DeleteSpecRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|getApiOperation}. + * @memberof google.cloud.apihub.v1.ApiHub + * @typedef GetApiOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apihub.v1.ApiOperation} [response] ApiOperation + */ + + /** + * Calls GetApiOperation. + * @function getApiOperation + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IGetApiOperationRequest} request GetApiOperationRequest message or plain object + * @param {google.cloud.apihub.v1.ApiHub.GetApiOperationCallback} callback Node-style callback called with the error, if any, and ApiOperation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ApiHub.prototype.getApiOperation = function getApiOperation(request, callback) { + return this.rpcCall(getApiOperation, $root.google.cloud.apihub.v1.GetApiOperationRequest, $root.google.cloud.apihub.v1.ApiOperation, request, callback); + }, "name", { value: "GetApiOperation" }); + + /** + * Calls GetApiOperation. + * @function getApiOperation + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IGetApiOperationRequest} request GetApiOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|listApiOperations}. + * @memberof google.cloud.apihub.v1.ApiHub + * @typedef ListApiOperationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apihub.v1.ListApiOperationsResponse} [response] ListApiOperationsResponse + */ + + /** + * Calls ListApiOperations. + * @function listApiOperations + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IListApiOperationsRequest} request ListApiOperationsRequest message or plain object + * @param {google.cloud.apihub.v1.ApiHub.ListApiOperationsCallback} callback Node-style callback called with the error, if any, and ListApiOperationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ApiHub.prototype.listApiOperations = function listApiOperations(request, callback) { + return this.rpcCall(listApiOperations, $root.google.cloud.apihub.v1.ListApiOperationsRequest, $root.google.cloud.apihub.v1.ListApiOperationsResponse, request, callback); + }, "name", { value: "ListApiOperations" }); + + /** + * Calls ListApiOperations. + * @function listApiOperations + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IListApiOperationsRequest} request ListApiOperationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|getDefinition}. + * @memberof google.cloud.apihub.v1.ApiHub + * @typedef GetDefinitionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apihub.v1.Definition} [response] Definition + */ + + /** + * Calls GetDefinition. + * @function getDefinition + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IGetDefinitionRequest} request GetDefinitionRequest message or plain object + * @param {google.cloud.apihub.v1.ApiHub.GetDefinitionCallback} callback Node-style callback called with the error, if any, and Definition + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ApiHub.prototype.getDefinition = function getDefinition(request, callback) { + return this.rpcCall(getDefinition, $root.google.cloud.apihub.v1.GetDefinitionRequest, $root.google.cloud.apihub.v1.Definition, request, callback); + }, "name", { value: "GetDefinition" }); + + /** + * Calls GetDefinition. + * @function getDefinition + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IGetDefinitionRequest} request GetDefinitionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|createDeployment}. + * @memberof google.cloud.apihub.v1.ApiHub + * @typedef CreateDeploymentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apihub.v1.Deployment} [response] Deployment + */ + + /** + * Calls CreateDeployment. + * @function createDeployment + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.ICreateDeploymentRequest} request CreateDeploymentRequest message or plain object + * @param {google.cloud.apihub.v1.ApiHub.CreateDeploymentCallback} callback Node-style callback called with the error, if any, and Deployment + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ApiHub.prototype.createDeployment = function createDeployment(request, callback) { + return this.rpcCall(createDeployment, $root.google.cloud.apihub.v1.CreateDeploymentRequest, $root.google.cloud.apihub.v1.Deployment, request, callback); + }, "name", { value: "CreateDeployment" }); + + /** + * Calls CreateDeployment. + * @function createDeployment + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.ICreateDeploymentRequest} request CreateDeploymentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|getDeployment}. + * @memberof google.cloud.apihub.v1.ApiHub + * @typedef GetDeploymentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apihub.v1.Deployment} [response] Deployment + */ + + /** + * Calls GetDeployment. + * @function getDeployment + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IGetDeploymentRequest} request GetDeploymentRequest message or plain object + * @param {google.cloud.apihub.v1.ApiHub.GetDeploymentCallback} callback Node-style callback called with the error, if any, and Deployment + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ApiHub.prototype.getDeployment = function getDeployment(request, callback) { + return this.rpcCall(getDeployment, $root.google.cloud.apihub.v1.GetDeploymentRequest, $root.google.cloud.apihub.v1.Deployment, request, callback); + }, "name", { value: "GetDeployment" }); + + /** + * Calls GetDeployment. + * @function getDeployment + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IGetDeploymentRequest} request GetDeploymentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|listDeployments}. + * @memberof google.cloud.apihub.v1.ApiHub + * @typedef ListDeploymentsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apihub.v1.ListDeploymentsResponse} [response] ListDeploymentsResponse + */ + + /** + * Calls ListDeployments. + * @function listDeployments + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IListDeploymentsRequest} request ListDeploymentsRequest message or plain object + * @param {google.cloud.apihub.v1.ApiHub.ListDeploymentsCallback} callback Node-style callback called with the error, if any, and ListDeploymentsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ApiHub.prototype.listDeployments = function listDeployments(request, callback) { + return this.rpcCall(listDeployments, $root.google.cloud.apihub.v1.ListDeploymentsRequest, $root.google.cloud.apihub.v1.ListDeploymentsResponse, request, callback); + }, "name", { value: "ListDeployments" }); + + /** + * Calls ListDeployments. + * @function listDeployments + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IListDeploymentsRequest} request ListDeploymentsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|updateDeployment}. + * @memberof google.cloud.apihub.v1.ApiHub + * @typedef UpdateDeploymentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apihub.v1.Deployment} [response] Deployment + */ + + /** + * Calls UpdateDeployment. + * @function updateDeployment + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IUpdateDeploymentRequest} request UpdateDeploymentRequest message or plain object + * @param {google.cloud.apihub.v1.ApiHub.UpdateDeploymentCallback} callback Node-style callback called with the error, if any, and Deployment + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ApiHub.prototype.updateDeployment = function updateDeployment(request, callback) { + return this.rpcCall(updateDeployment, $root.google.cloud.apihub.v1.UpdateDeploymentRequest, $root.google.cloud.apihub.v1.Deployment, request, callback); + }, "name", { value: "UpdateDeployment" }); + + /** + * Calls UpdateDeployment. + * @function updateDeployment + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IUpdateDeploymentRequest} request UpdateDeploymentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|deleteDeployment}. + * @memberof google.cloud.apihub.v1.ApiHub + * @typedef DeleteDeploymentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteDeployment. + * @function deleteDeployment + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IDeleteDeploymentRequest} request DeleteDeploymentRequest message or plain object + * @param {google.cloud.apihub.v1.ApiHub.DeleteDeploymentCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ApiHub.prototype.deleteDeployment = function deleteDeployment(request, callback) { + return this.rpcCall(deleteDeployment, $root.google.cloud.apihub.v1.DeleteDeploymentRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteDeployment" }); + + /** + * Calls DeleteDeployment. + * @function deleteDeployment + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IDeleteDeploymentRequest} request DeleteDeploymentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|createAttribute}. + * @memberof google.cloud.apihub.v1.ApiHub + * @typedef CreateAttributeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apihub.v1.Attribute} [response] Attribute + */ + + /** + * Calls CreateAttribute. + * @function createAttribute + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.ICreateAttributeRequest} request CreateAttributeRequest message or plain object + * @param {google.cloud.apihub.v1.ApiHub.CreateAttributeCallback} callback Node-style callback called with the error, if any, and Attribute + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ApiHub.prototype.createAttribute = function createAttribute(request, callback) { + return this.rpcCall(createAttribute, $root.google.cloud.apihub.v1.CreateAttributeRequest, $root.google.cloud.apihub.v1.Attribute, request, callback); + }, "name", { value: "CreateAttribute" }); + + /** + * Calls CreateAttribute. + * @function createAttribute + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.ICreateAttributeRequest} request CreateAttributeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|getAttribute}. + * @memberof google.cloud.apihub.v1.ApiHub + * @typedef GetAttributeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apihub.v1.Attribute} [response] Attribute + */ + + /** + * Calls GetAttribute. + * @function getAttribute + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IGetAttributeRequest} request GetAttributeRequest message or plain object + * @param {google.cloud.apihub.v1.ApiHub.GetAttributeCallback} callback Node-style callback called with the error, if any, and Attribute + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ApiHub.prototype.getAttribute = function getAttribute(request, callback) { + return this.rpcCall(getAttribute, $root.google.cloud.apihub.v1.GetAttributeRequest, $root.google.cloud.apihub.v1.Attribute, request, callback); + }, "name", { value: "GetAttribute" }); + + /** + * Calls GetAttribute. + * @function getAttribute + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IGetAttributeRequest} request GetAttributeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|updateAttribute}. + * @memberof google.cloud.apihub.v1.ApiHub + * @typedef UpdateAttributeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apihub.v1.Attribute} [response] Attribute + */ + + /** + * Calls UpdateAttribute. + * @function updateAttribute + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IUpdateAttributeRequest} request UpdateAttributeRequest message or plain object + * @param {google.cloud.apihub.v1.ApiHub.UpdateAttributeCallback} callback Node-style callback called with the error, if any, and Attribute + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ApiHub.prototype.updateAttribute = function updateAttribute(request, callback) { + return this.rpcCall(updateAttribute, $root.google.cloud.apihub.v1.UpdateAttributeRequest, $root.google.cloud.apihub.v1.Attribute, request, callback); + }, "name", { value: "UpdateAttribute" }); + + /** + * Calls UpdateAttribute. + * @function updateAttribute + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IUpdateAttributeRequest} request UpdateAttributeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|deleteAttribute}. + * @memberof google.cloud.apihub.v1.ApiHub + * @typedef DeleteAttributeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteAttribute. + * @function deleteAttribute + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IDeleteAttributeRequest} request DeleteAttributeRequest message or plain object + * @param {google.cloud.apihub.v1.ApiHub.DeleteAttributeCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ApiHub.prototype.deleteAttribute = function deleteAttribute(request, callback) { + return this.rpcCall(deleteAttribute, $root.google.cloud.apihub.v1.DeleteAttributeRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteAttribute" }); + + /** + * Calls DeleteAttribute. + * @function deleteAttribute + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IDeleteAttributeRequest} request DeleteAttributeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|listAttributes}. + * @memberof google.cloud.apihub.v1.ApiHub + * @typedef ListAttributesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apihub.v1.ListAttributesResponse} [response] ListAttributesResponse + */ + + /** + * Calls ListAttributes. + * @function listAttributes + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IListAttributesRequest} request ListAttributesRequest message or plain object + * @param {google.cloud.apihub.v1.ApiHub.ListAttributesCallback} callback Node-style callback called with the error, if any, and ListAttributesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ApiHub.prototype.listAttributes = function listAttributes(request, callback) { + return this.rpcCall(listAttributes, $root.google.cloud.apihub.v1.ListAttributesRequest, $root.google.cloud.apihub.v1.ListAttributesResponse, request, callback); + }, "name", { value: "ListAttributes" }); + + /** + * Calls ListAttributes. + * @function listAttributes + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IListAttributesRequest} request ListAttributesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|searchResources}. + * @memberof google.cloud.apihub.v1.ApiHub + * @typedef SearchResourcesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apihub.v1.SearchResourcesResponse} [response] SearchResourcesResponse + */ + + /** + * Calls SearchResources. + * @function searchResources + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.ISearchResourcesRequest} request SearchResourcesRequest message or plain object + * @param {google.cloud.apihub.v1.ApiHub.SearchResourcesCallback} callback Node-style callback called with the error, if any, and SearchResourcesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ApiHub.prototype.searchResources = function searchResources(request, callback) { + return this.rpcCall(searchResources, $root.google.cloud.apihub.v1.SearchResourcesRequest, $root.google.cloud.apihub.v1.SearchResourcesResponse, request, callback); + }, "name", { value: "SearchResources" }); + + /** + * Calls SearchResources. + * @function searchResources + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.ISearchResourcesRequest} request SearchResourcesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|createExternalApi}. + * @memberof google.cloud.apihub.v1.ApiHub + * @typedef CreateExternalApiCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apihub.v1.ExternalApi} [response] ExternalApi + */ + + /** + * Calls CreateExternalApi. + * @function createExternalApi + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.ICreateExternalApiRequest} request CreateExternalApiRequest message or plain object + * @param {google.cloud.apihub.v1.ApiHub.CreateExternalApiCallback} callback Node-style callback called with the error, if any, and ExternalApi + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ApiHub.prototype.createExternalApi = function createExternalApi(request, callback) { + return this.rpcCall(createExternalApi, $root.google.cloud.apihub.v1.CreateExternalApiRequest, $root.google.cloud.apihub.v1.ExternalApi, request, callback); + }, "name", { value: "CreateExternalApi" }); + + /** + * Calls CreateExternalApi. + * @function createExternalApi + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.ICreateExternalApiRequest} request CreateExternalApiRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|getExternalApi}. + * @memberof google.cloud.apihub.v1.ApiHub + * @typedef GetExternalApiCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apihub.v1.ExternalApi} [response] ExternalApi + */ + + /** + * Calls GetExternalApi. + * @function getExternalApi + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IGetExternalApiRequest} request GetExternalApiRequest message or plain object + * @param {google.cloud.apihub.v1.ApiHub.GetExternalApiCallback} callback Node-style callback called with the error, if any, and ExternalApi + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ApiHub.prototype.getExternalApi = function getExternalApi(request, callback) { + return this.rpcCall(getExternalApi, $root.google.cloud.apihub.v1.GetExternalApiRequest, $root.google.cloud.apihub.v1.ExternalApi, request, callback); + }, "name", { value: "GetExternalApi" }); + + /** + * Calls GetExternalApi. + * @function getExternalApi + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IGetExternalApiRequest} request GetExternalApiRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|updateExternalApi}. + * @memberof google.cloud.apihub.v1.ApiHub + * @typedef UpdateExternalApiCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apihub.v1.ExternalApi} [response] ExternalApi + */ + + /** + * Calls UpdateExternalApi. + * @function updateExternalApi + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IUpdateExternalApiRequest} request UpdateExternalApiRequest message or plain object + * @param {google.cloud.apihub.v1.ApiHub.UpdateExternalApiCallback} callback Node-style callback called with the error, if any, and ExternalApi + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ApiHub.prototype.updateExternalApi = function updateExternalApi(request, callback) { + return this.rpcCall(updateExternalApi, $root.google.cloud.apihub.v1.UpdateExternalApiRequest, $root.google.cloud.apihub.v1.ExternalApi, request, callback); + }, "name", { value: "UpdateExternalApi" }); + + /** + * Calls UpdateExternalApi. + * @function updateExternalApi + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IUpdateExternalApiRequest} request UpdateExternalApiRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|deleteExternalApi}. + * @memberof google.cloud.apihub.v1.ApiHub + * @typedef DeleteExternalApiCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteExternalApi. + * @function deleteExternalApi + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IDeleteExternalApiRequest} request DeleteExternalApiRequest message or plain object + * @param {google.cloud.apihub.v1.ApiHub.DeleteExternalApiCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ApiHub.prototype.deleteExternalApi = function deleteExternalApi(request, callback) { + return this.rpcCall(deleteExternalApi, $root.google.cloud.apihub.v1.DeleteExternalApiRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteExternalApi" }); + + /** + * Calls DeleteExternalApi. + * @function deleteExternalApi + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IDeleteExternalApiRequest} request DeleteExternalApiRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHub|listExternalApis}. + * @memberof google.cloud.apihub.v1.ApiHub + * @typedef ListExternalApisCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apihub.v1.ListExternalApisResponse} [response] ListExternalApisResponse + */ + + /** + * Calls ListExternalApis. + * @function listExternalApis + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IListExternalApisRequest} request ListExternalApisRequest message or plain object + * @param {google.cloud.apihub.v1.ApiHub.ListExternalApisCallback} callback Node-style callback called with the error, if any, and ListExternalApisResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ApiHub.prototype.listExternalApis = function listExternalApis(request, callback) { + return this.rpcCall(listExternalApis, $root.google.cloud.apihub.v1.ListExternalApisRequest, $root.google.cloud.apihub.v1.ListExternalApisResponse, request, callback); + }, "name", { value: "ListExternalApis" }); + + /** + * Calls ListExternalApis. + * @function listExternalApis + * @memberof google.cloud.apihub.v1.ApiHub + * @instance + * @param {google.cloud.apihub.v1.IListExternalApisRequest} request ListExternalApisRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return ApiHub; + })(); + + v1.ApiHubDependencies = (function() { + + /** + * Constructs a new ApiHubDependencies service. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents an ApiHubDependencies + * @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 ApiHubDependencies(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (ApiHubDependencies.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = ApiHubDependencies; + + /** + * Creates new ApiHubDependencies service using the specified rpc implementation. + * @function create + * @memberof google.cloud.apihub.v1.ApiHubDependencies + * @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 {ApiHubDependencies} RPC service. Useful where requests and/or responses are streamed. + */ + ApiHubDependencies.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHubDependencies|createDependency}. + * @memberof google.cloud.apihub.v1.ApiHubDependencies + * @typedef CreateDependencyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apihub.v1.Dependency} [response] Dependency + */ + + /** + * Calls CreateDependency. + * @function createDependency + * @memberof google.cloud.apihub.v1.ApiHubDependencies + * @instance + * @param {google.cloud.apihub.v1.ICreateDependencyRequest} request CreateDependencyRequest message or plain object + * @param {google.cloud.apihub.v1.ApiHubDependencies.CreateDependencyCallback} callback Node-style callback called with the error, if any, and Dependency + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ApiHubDependencies.prototype.createDependency = function createDependency(request, callback) { + return this.rpcCall(createDependency, $root.google.cloud.apihub.v1.CreateDependencyRequest, $root.google.cloud.apihub.v1.Dependency, request, callback); + }, "name", { value: "CreateDependency" }); + + /** + * Calls CreateDependency. + * @function createDependency + * @memberof google.cloud.apihub.v1.ApiHubDependencies + * @instance + * @param {google.cloud.apihub.v1.ICreateDependencyRequest} request CreateDependencyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHubDependencies|getDependency}. + * @memberof google.cloud.apihub.v1.ApiHubDependencies + * @typedef GetDependencyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apihub.v1.Dependency} [response] Dependency + */ + + /** + * Calls GetDependency. + * @function getDependency + * @memberof google.cloud.apihub.v1.ApiHubDependencies + * @instance + * @param {google.cloud.apihub.v1.IGetDependencyRequest} request GetDependencyRequest message or plain object + * @param {google.cloud.apihub.v1.ApiHubDependencies.GetDependencyCallback} callback Node-style callback called with the error, if any, and Dependency + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ApiHubDependencies.prototype.getDependency = function getDependency(request, callback) { + return this.rpcCall(getDependency, $root.google.cloud.apihub.v1.GetDependencyRequest, $root.google.cloud.apihub.v1.Dependency, request, callback); + }, "name", { value: "GetDependency" }); + + /** + * Calls GetDependency. + * @function getDependency + * @memberof google.cloud.apihub.v1.ApiHubDependencies + * @instance + * @param {google.cloud.apihub.v1.IGetDependencyRequest} request GetDependencyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHubDependencies|updateDependency}. + * @memberof google.cloud.apihub.v1.ApiHubDependencies + * @typedef UpdateDependencyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apihub.v1.Dependency} [response] Dependency + */ + + /** + * Calls UpdateDependency. + * @function updateDependency + * @memberof google.cloud.apihub.v1.ApiHubDependencies + * @instance + * @param {google.cloud.apihub.v1.IUpdateDependencyRequest} request UpdateDependencyRequest message or plain object + * @param {google.cloud.apihub.v1.ApiHubDependencies.UpdateDependencyCallback} callback Node-style callback called with the error, if any, and Dependency + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ApiHubDependencies.prototype.updateDependency = function updateDependency(request, callback) { + return this.rpcCall(updateDependency, $root.google.cloud.apihub.v1.UpdateDependencyRequest, $root.google.cloud.apihub.v1.Dependency, request, callback); + }, "name", { value: "UpdateDependency" }); + + /** + * Calls UpdateDependency. + * @function updateDependency + * @memberof google.cloud.apihub.v1.ApiHubDependencies + * @instance + * @param {google.cloud.apihub.v1.IUpdateDependencyRequest} request UpdateDependencyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHubDependencies|deleteDependency}. + * @memberof google.cloud.apihub.v1.ApiHubDependencies + * @typedef DeleteDependencyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteDependency. + * @function deleteDependency + * @memberof google.cloud.apihub.v1.ApiHubDependencies + * @instance + * @param {google.cloud.apihub.v1.IDeleteDependencyRequest} request DeleteDependencyRequest message or plain object + * @param {google.cloud.apihub.v1.ApiHubDependencies.DeleteDependencyCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ApiHubDependencies.prototype.deleteDependency = function deleteDependency(request, callback) { + return this.rpcCall(deleteDependency, $root.google.cloud.apihub.v1.DeleteDependencyRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteDependency" }); + + /** + * Calls DeleteDependency. + * @function deleteDependency + * @memberof google.cloud.apihub.v1.ApiHubDependencies + * @instance + * @param {google.cloud.apihub.v1.IDeleteDependencyRequest} request DeleteDependencyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHubDependencies|listDependencies}. + * @memberof google.cloud.apihub.v1.ApiHubDependencies + * @typedef ListDependenciesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apihub.v1.ListDependenciesResponse} [response] ListDependenciesResponse + */ + + /** + * Calls ListDependencies. + * @function listDependencies + * @memberof google.cloud.apihub.v1.ApiHubDependencies + * @instance + * @param {google.cloud.apihub.v1.IListDependenciesRequest} request ListDependenciesRequest message or plain object + * @param {google.cloud.apihub.v1.ApiHubDependencies.ListDependenciesCallback} callback Node-style callback called with the error, if any, and ListDependenciesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ApiHubDependencies.prototype.listDependencies = function listDependencies(request, callback) { + return this.rpcCall(listDependencies, $root.google.cloud.apihub.v1.ListDependenciesRequest, $root.google.cloud.apihub.v1.ListDependenciesResponse, request, callback); + }, "name", { value: "ListDependencies" }); + + /** + * Calls ListDependencies. + * @function listDependencies + * @memberof google.cloud.apihub.v1.ApiHubDependencies + * @instance + * @param {google.cloud.apihub.v1.IListDependenciesRequest} request ListDependenciesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return ApiHubDependencies; + })(); + + v1.CreateApiRequest = (function() { + + /** + * Properties of a CreateApiRequest. + * @memberof google.cloud.apihub.v1 + * @interface ICreateApiRequest + * @property {string|null} [parent] CreateApiRequest parent + * @property {string|null} [apiId] CreateApiRequest apiId + * @property {google.cloud.apihub.v1.IApi|null} [api] CreateApiRequest api + */ + + /** + * Constructs a new CreateApiRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a CreateApiRequest. + * @implements ICreateApiRequest + * @constructor + * @param {google.cloud.apihub.v1.ICreateApiRequest=} [properties] Properties to set + */ + function CreateApiRequest(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]]; + } + + /** + * CreateApiRequest parent. + * @member {string} parent + * @memberof google.cloud.apihub.v1.CreateApiRequest + * @instance + */ + CreateApiRequest.prototype.parent = ""; + + /** + * CreateApiRequest apiId. + * @member {string} apiId + * @memberof google.cloud.apihub.v1.CreateApiRequest + * @instance + */ + CreateApiRequest.prototype.apiId = ""; + + /** + * CreateApiRequest api. + * @member {google.cloud.apihub.v1.IApi|null|undefined} api + * @memberof google.cloud.apihub.v1.CreateApiRequest + * @instance + */ + CreateApiRequest.prototype.api = null; + + /** + * Creates a new CreateApiRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.CreateApiRequest + * @static + * @param {google.cloud.apihub.v1.ICreateApiRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.CreateApiRequest} CreateApiRequest instance + */ + CreateApiRequest.create = function create(properties) { + return new CreateApiRequest(properties); + }; + + /** + * Encodes the specified CreateApiRequest message. Does not implicitly {@link google.cloud.apihub.v1.CreateApiRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.CreateApiRequest + * @static + * @param {google.cloud.apihub.v1.ICreateApiRequest} message CreateApiRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateApiRequest.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.apiId != null && Object.hasOwnProperty.call(message, "apiId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.apiId); + if (message.api != null && Object.hasOwnProperty.call(message, "api")) + $root.google.cloud.apihub.v1.Api.encode(message.api, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateApiRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.CreateApiRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.CreateApiRequest + * @static + * @param {google.cloud.apihub.v1.ICreateApiRequest} message CreateApiRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateApiRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateApiRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.CreateApiRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.CreateApiRequest} CreateApiRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateApiRequest.decode = function 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.apihub.v1.CreateApiRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.apiId = reader.string(); + break; + } + case 3: { + message.api = $root.google.cloud.apihub.v1.Api.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateApiRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.CreateApiRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.CreateApiRequest} CreateApiRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateApiRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateApiRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.CreateApiRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateApiRequest.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.apiId != null && message.hasOwnProperty("apiId")) + if (!$util.isString(message.apiId)) + return "apiId: string expected"; + if (message.api != null && message.hasOwnProperty("api")) { + var error = $root.google.cloud.apihub.v1.Api.verify(message.api); + if (error) + return "api." + error; + } + return null; + }; + + /** + * Creates a CreateApiRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.CreateApiRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.CreateApiRequest} CreateApiRequest + */ + CreateApiRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.CreateApiRequest) + return object; + var message = new $root.google.cloud.apihub.v1.CreateApiRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.apiId != null) + message.apiId = String(object.apiId); + if (object.api != null) { + if (typeof object.api !== "object") + throw TypeError(".google.cloud.apihub.v1.CreateApiRequest.api: object expected"); + message.api = $root.google.cloud.apihub.v1.Api.fromObject(object.api); + } + return message; + }; + + /** + * Creates a plain object from a CreateApiRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.CreateApiRequest + * @static + * @param {google.cloud.apihub.v1.CreateApiRequest} message CreateApiRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateApiRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.apiId = ""; + object.api = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.apiId != null && message.hasOwnProperty("apiId")) + object.apiId = message.apiId; + if (message.api != null && message.hasOwnProperty("api")) + object.api = $root.google.cloud.apihub.v1.Api.toObject(message.api, options); + return object; + }; + + /** + * Converts this CreateApiRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.CreateApiRequest + * @instance + * @returns {Object.} JSON object + */ + CreateApiRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateApiRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.CreateApiRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateApiRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.CreateApiRequest"; + }; + + return CreateApiRequest; + })(); + + v1.GetApiRequest = (function() { + + /** + * Properties of a GetApiRequest. + * @memberof google.cloud.apihub.v1 + * @interface IGetApiRequest + * @property {string|null} [name] GetApiRequest name + */ + + /** + * Constructs a new GetApiRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a GetApiRequest. + * @implements IGetApiRequest + * @constructor + * @param {google.cloud.apihub.v1.IGetApiRequest=} [properties] Properties to set + */ + function GetApiRequest(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]]; + } + + /** + * GetApiRequest name. + * @member {string} name + * @memberof google.cloud.apihub.v1.GetApiRequest + * @instance + */ + GetApiRequest.prototype.name = ""; + + /** + * Creates a new GetApiRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.GetApiRequest + * @static + * @param {google.cloud.apihub.v1.IGetApiRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.GetApiRequest} GetApiRequest instance + */ + GetApiRequest.create = function create(properties) { + return new GetApiRequest(properties); + }; + + /** + * Encodes the specified GetApiRequest message. Does not implicitly {@link google.cloud.apihub.v1.GetApiRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.GetApiRequest + * @static + * @param {google.cloud.apihub.v1.IGetApiRequest} message GetApiRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetApiRequest.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 GetApiRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.GetApiRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.GetApiRequest + * @static + * @param {google.cloud.apihub.v1.IGetApiRequest} message GetApiRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetApiRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetApiRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.GetApiRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.GetApiRequest} GetApiRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetApiRequest.decode = function 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.apihub.v1.GetApiRequest(); + 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 GetApiRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.GetApiRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.GetApiRequest} GetApiRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetApiRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetApiRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.GetApiRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetApiRequest.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 GetApiRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.GetApiRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.GetApiRequest} GetApiRequest + */ + GetApiRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.GetApiRequest) + return object; + var message = new $root.google.cloud.apihub.v1.GetApiRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetApiRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.GetApiRequest + * @static + * @param {google.cloud.apihub.v1.GetApiRequest} message GetApiRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetApiRequest.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 GetApiRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.GetApiRequest + * @instance + * @returns {Object.} JSON object + */ + GetApiRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetApiRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.GetApiRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetApiRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.GetApiRequest"; + }; + + return GetApiRequest; + })(); + + v1.UpdateApiRequest = (function() { + + /** + * Properties of an UpdateApiRequest. + * @memberof google.cloud.apihub.v1 + * @interface IUpdateApiRequest + * @property {google.cloud.apihub.v1.IApi|null} [api] UpdateApiRequest api + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateApiRequest updateMask + */ + + /** + * Constructs a new UpdateApiRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents an UpdateApiRequest. + * @implements IUpdateApiRequest + * @constructor + * @param {google.cloud.apihub.v1.IUpdateApiRequest=} [properties] Properties to set + */ + function UpdateApiRequest(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]]; + } + + /** + * UpdateApiRequest api. + * @member {google.cloud.apihub.v1.IApi|null|undefined} api + * @memberof google.cloud.apihub.v1.UpdateApiRequest + * @instance + */ + UpdateApiRequest.prototype.api = null; + + /** + * UpdateApiRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.apihub.v1.UpdateApiRequest + * @instance + */ + UpdateApiRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateApiRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.UpdateApiRequest + * @static + * @param {google.cloud.apihub.v1.IUpdateApiRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.UpdateApiRequest} UpdateApiRequest instance + */ + UpdateApiRequest.create = function create(properties) { + return new UpdateApiRequest(properties); + }; + + /** + * Encodes the specified UpdateApiRequest message. Does not implicitly {@link google.cloud.apihub.v1.UpdateApiRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.UpdateApiRequest + * @static + * @param {google.cloud.apihub.v1.IUpdateApiRequest} message UpdateApiRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateApiRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.api != null && Object.hasOwnProperty.call(message, "api")) + $root.google.cloud.apihub.v1.Api.encode(message.api, 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 UpdateApiRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.UpdateApiRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.UpdateApiRequest + * @static + * @param {google.cloud.apihub.v1.IUpdateApiRequest} message UpdateApiRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateApiRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateApiRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.UpdateApiRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.UpdateApiRequest} UpdateApiRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateApiRequest.decode = function 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.apihub.v1.UpdateApiRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.api = $root.google.cloud.apihub.v1.Api.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 UpdateApiRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.UpdateApiRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.UpdateApiRequest} UpdateApiRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateApiRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateApiRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.UpdateApiRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateApiRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.api != null && message.hasOwnProperty("api")) { + var error = $root.google.cloud.apihub.v1.Api.verify(message.api); + if (error) + return "api." + 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 UpdateApiRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.UpdateApiRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.UpdateApiRequest} UpdateApiRequest + */ + UpdateApiRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.UpdateApiRequest) + return object; + var message = new $root.google.cloud.apihub.v1.UpdateApiRequest(); + if (object.api != null) { + if (typeof object.api !== "object") + throw TypeError(".google.cloud.apihub.v1.UpdateApiRequest.api: object expected"); + message.api = $root.google.cloud.apihub.v1.Api.fromObject(object.api); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.apihub.v1.UpdateApiRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateApiRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.UpdateApiRequest + * @static + * @param {google.cloud.apihub.v1.UpdateApiRequest} message UpdateApiRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateApiRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.api = null; + object.updateMask = null; + } + if (message.api != null && message.hasOwnProperty("api")) + object.api = $root.google.cloud.apihub.v1.Api.toObject(message.api, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateApiRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.UpdateApiRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateApiRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateApiRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.UpdateApiRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateApiRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.UpdateApiRequest"; + }; + + return UpdateApiRequest; + })(); + + v1.DeleteApiRequest = (function() { + + /** + * Properties of a DeleteApiRequest. + * @memberof google.cloud.apihub.v1 + * @interface IDeleteApiRequest + * @property {string|null} [name] DeleteApiRequest name + * @property {boolean|null} [force] DeleteApiRequest force + */ + + /** + * Constructs a new DeleteApiRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a DeleteApiRequest. + * @implements IDeleteApiRequest + * @constructor + * @param {google.cloud.apihub.v1.IDeleteApiRequest=} [properties] Properties to set + */ + function DeleteApiRequest(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]]; + } + + /** + * DeleteApiRequest name. + * @member {string} name + * @memberof google.cloud.apihub.v1.DeleteApiRequest + * @instance + */ + DeleteApiRequest.prototype.name = ""; + + /** + * DeleteApiRequest force. + * @member {boolean} force + * @memberof google.cloud.apihub.v1.DeleteApiRequest + * @instance + */ + DeleteApiRequest.prototype.force = false; + + /** + * Creates a new DeleteApiRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.DeleteApiRequest + * @static + * @param {google.cloud.apihub.v1.IDeleteApiRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.DeleteApiRequest} DeleteApiRequest instance + */ + DeleteApiRequest.create = function create(properties) { + return new DeleteApiRequest(properties); + }; + + /** + * Encodes the specified DeleteApiRequest message. Does not implicitly {@link google.cloud.apihub.v1.DeleteApiRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.DeleteApiRequest + * @static + * @param {google.cloud.apihub.v1.IDeleteApiRequest} message DeleteApiRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteApiRequest.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.force != null && Object.hasOwnProperty.call(message, "force")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.force); + return writer; + }; + + /** + * Encodes the specified DeleteApiRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.DeleteApiRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.DeleteApiRequest + * @static + * @param {google.cloud.apihub.v1.IDeleteApiRequest} message DeleteApiRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteApiRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteApiRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.DeleteApiRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.DeleteApiRequest} DeleteApiRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteApiRequest.decode = function 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.apihub.v1.DeleteApiRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.force = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteApiRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.DeleteApiRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.DeleteApiRequest} DeleteApiRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteApiRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteApiRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.DeleteApiRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteApiRequest.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.force != null && message.hasOwnProperty("force")) + if (typeof message.force !== "boolean") + return "force: boolean expected"; + return null; + }; + + /** + * Creates a DeleteApiRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.DeleteApiRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.DeleteApiRequest} DeleteApiRequest + */ + DeleteApiRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.DeleteApiRequest) + return object; + var message = new $root.google.cloud.apihub.v1.DeleteApiRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.force != null) + message.force = Boolean(object.force); + return message; + }; + + /** + * Creates a plain object from a DeleteApiRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.DeleteApiRequest + * @static + * @param {google.cloud.apihub.v1.DeleteApiRequest} message DeleteApiRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteApiRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.force = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.force != null && message.hasOwnProperty("force")) + object.force = message.force; + return object; + }; + + /** + * Converts this DeleteApiRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.DeleteApiRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteApiRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteApiRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.DeleteApiRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteApiRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.DeleteApiRequest"; + }; + + return DeleteApiRequest; + })(); + + v1.ListApisRequest = (function() { + + /** + * Properties of a ListApisRequest. + * @memberof google.cloud.apihub.v1 + * @interface IListApisRequest + * @property {string|null} [parent] ListApisRequest parent + * @property {string|null} [filter] ListApisRequest filter + * @property {number|null} [pageSize] ListApisRequest pageSize + * @property {string|null} [pageToken] ListApisRequest pageToken + */ + + /** + * Constructs a new ListApisRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a ListApisRequest. + * @implements IListApisRequest + * @constructor + * @param {google.cloud.apihub.v1.IListApisRequest=} [properties] Properties to set + */ + function ListApisRequest(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]]; + } + + /** + * ListApisRequest parent. + * @member {string} parent + * @memberof google.cloud.apihub.v1.ListApisRequest + * @instance + */ + ListApisRequest.prototype.parent = ""; + + /** + * ListApisRequest filter. + * @member {string} filter + * @memberof google.cloud.apihub.v1.ListApisRequest + * @instance + */ + ListApisRequest.prototype.filter = ""; + + /** + * ListApisRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.apihub.v1.ListApisRequest + * @instance + */ + ListApisRequest.prototype.pageSize = 0; + + /** + * ListApisRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.apihub.v1.ListApisRequest + * @instance + */ + ListApisRequest.prototype.pageToken = ""; + + /** + * Creates a new ListApisRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.ListApisRequest + * @static + * @param {google.cloud.apihub.v1.IListApisRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.ListApisRequest} ListApisRequest instance + */ + ListApisRequest.create = function create(properties) { + return new ListApisRequest(properties); + }; + + /** + * Encodes the specified ListApisRequest message. Does not implicitly {@link google.cloud.apihub.v1.ListApisRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.ListApisRequest + * @static + * @param {google.cloud.apihub.v1.IListApisRequest} message ListApisRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListApisRequest.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.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListApisRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListApisRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.ListApisRequest + * @static + * @param {google.cloud.apihub.v1.IListApisRequest} message ListApisRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListApisRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListApisRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.ListApisRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.ListApisRequest} ListApisRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListApisRequest.decode = function 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.apihub.v1.ListApisRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.filter = reader.string(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + case 4: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListApisRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.ListApisRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.ListApisRequest} ListApisRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListApisRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListApisRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.ListApisRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListApisRequest.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.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 ListApisRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.ListApisRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.ListApisRequest} ListApisRequest + */ + ListApisRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.ListApisRequest) + return object; + var message = new $root.google.cloud.apihub.v1.ListApisRequest(); + if (object.parent != null) + message.parent = String(object.parent); + 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 ListApisRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.ListApisRequest + * @static + * @param {google.cloud.apihub.v1.ListApisRequest} message ListApisRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListApisRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + 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; + return object; + }; + + /** + * Converts this ListApisRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.ListApisRequest + * @instance + * @returns {Object.} JSON object + */ + ListApisRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListApisRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.ListApisRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListApisRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.ListApisRequest"; + }; + + return ListApisRequest; + })(); + + v1.ListApisResponse = (function() { + + /** + * Properties of a ListApisResponse. + * @memberof google.cloud.apihub.v1 + * @interface IListApisResponse + * @property {Array.|null} [apis] ListApisResponse apis + * @property {string|null} [nextPageToken] ListApisResponse nextPageToken + */ + + /** + * Constructs a new ListApisResponse. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a ListApisResponse. + * @implements IListApisResponse + * @constructor + * @param {google.cloud.apihub.v1.IListApisResponse=} [properties] Properties to set + */ + function ListApisResponse(properties) { + this.apis = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListApisResponse apis. + * @member {Array.} apis + * @memberof google.cloud.apihub.v1.ListApisResponse + * @instance + */ + ListApisResponse.prototype.apis = $util.emptyArray; + + /** + * ListApisResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.apihub.v1.ListApisResponse + * @instance + */ + ListApisResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListApisResponse instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.ListApisResponse + * @static + * @param {google.cloud.apihub.v1.IListApisResponse=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.ListApisResponse} ListApisResponse instance + */ + ListApisResponse.create = function create(properties) { + return new ListApisResponse(properties); + }; + + /** + * Encodes the specified ListApisResponse message. Does not implicitly {@link google.cloud.apihub.v1.ListApisResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.ListApisResponse + * @static + * @param {google.cloud.apihub.v1.IListApisResponse} message ListApisResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListApisResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.apis != null && message.apis.length) + for (var i = 0; i < message.apis.length; ++i) + $root.google.cloud.apihub.v1.Api.encode(message.apis[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 ListApisResponse message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListApisResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.ListApisResponse + * @static + * @param {google.cloud.apihub.v1.IListApisResponse} message ListApisResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListApisResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListApisResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.ListApisResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.ListApisResponse} ListApisResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListApisResponse.decode = function 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.apihub.v1.ListApisResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.apis && message.apis.length)) + message.apis = []; + message.apis.push($root.google.cloud.apihub.v1.Api.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListApisResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.ListApisResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.ListApisResponse} ListApisResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListApisResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListApisResponse message. + * @function verify + * @memberof google.cloud.apihub.v1.ListApisResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListApisResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.apis != null && message.hasOwnProperty("apis")) { + if (!Array.isArray(message.apis)) + return "apis: array expected"; + for (var i = 0; i < message.apis.length; ++i) { + var error = $root.google.cloud.apihub.v1.Api.verify(message.apis[i]); + if (error) + return "apis." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListApisResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.ListApisResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.ListApisResponse} ListApisResponse + */ + ListApisResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.ListApisResponse) + return object; + var message = new $root.google.cloud.apihub.v1.ListApisResponse(); + if (object.apis) { + if (!Array.isArray(object.apis)) + throw TypeError(".google.cloud.apihub.v1.ListApisResponse.apis: array expected"); + message.apis = []; + for (var i = 0; i < object.apis.length; ++i) { + if (typeof object.apis[i] !== "object") + throw TypeError(".google.cloud.apihub.v1.ListApisResponse.apis: object expected"); + message.apis[i] = $root.google.cloud.apihub.v1.Api.fromObject(object.apis[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListApisResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.ListApisResponse + * @static + * @param {google.cloud.apihub.v1.ListApisResponse} message ListApisResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListApisResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.apis = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.apis && message.apis.length) { + object.apis = []; + for (var j = 0; j < message.apis.length; ++j) + object.apis[j] = $root.google.cloud.apihub.v1.Api.toObject(message.apis[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListApisResponse to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.ListApisResponse + * @instance + * @returns {Object.} JSON object + */ + ListApisResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListApisResponse + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.ListApisResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListApisResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.ListApisResponse"; + }; + + return ListApisResponse; + })(); + + v1.CreateVersionRequest = (function() { + + /** + * Properties of a CreateVersionRequest. + * @memberof google.cloud.apihub.v1 + * @interface ICreateVersionRequest + * @property {string|null} [parent] CreateVersionRequest parent + * @property {string|null} [versionId] CreateVersionRequest versionId + * @property {google.cloud.apihub.v1.IVersion|null} [version] CreateVersionRequest version + */ + + /** + * Constructs a new CreateVersionRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a CreateVersionRequest. + * @implements ICreateVersionRequest + * @constructor + * @param {google.cloud.apihub.v1.ICreateVersionRequest=} [properties] Properties to set + */ + function CreateVersionRequest(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]]; + } + + /** + * CreateVersionRequest parent. + * @member {string} parent + * @memberof google.cloud.apihub.v1.CreateVersionRequest + * @instance + */ + CreateVersionRequest.prototype.parent = ""; + + /** + * CreateVersionRequest versionId. + * @member {string} versionId + * @memberof google.cloud.apihub.v1.CreateVersionRequest + * @instance + */ + CreateVersionRequest.prototype.versionId = ""; + + /** + * CreateVersionRequest version. + * @member {google.cloud.apihub.v1.IVersion|null|undefined} version + * @memberof google.cloud.apihub.v1.CreateVersionRequest + * @instance + */ + CreateVersionRequest.prototype.version = null; + + /** + * Creates a new CreateVersionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.CreateVersionRequest + * @static + * @param {google.cloud.apihub.v1.ICreateVersionRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.CreateVersionRequest} CreateVersionRequest instance + */ + CreateVersionRequest.create = function create(properties) { + return new CreateVersionRequest(properties); + }; + + /** + * Encodes the specified CreateVersionRequest message. Does not implicitly {@link google.cloud.apihub.v1.CreateVersionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.CreateVersionRequest + * @static + * @param {google.cloud.apihub.v1.ICreateVersionRequest} message CreateVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateVersionRequest.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.versionId != null && Object.hasOwnProperty.call(message, "versionId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.versionId); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + $root.google.cloud.apihub.v1.Version.encode(message.version, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateVersionRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.CreateVersionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.CreateVersionRequest + * @static + * @param {google.cloud.apihub.v1.ICreateVersionRequest} message CreateVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateVersionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.CreateVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.CreateVersionRequest} CreateVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateVersionRequest.decode = function 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.apihub.v1.CreateVersionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.versionId = reader.string(); + break; + } + case 3: { + message.version = $root.google.cloud.apihub.v1.Version.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateVersionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.CreateVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.CreateVersionRequest} CreateVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateVersionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateVersionRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.CreateVersionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateVersionRequest.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.versionId != null && message.hasOwnProperty("versionId")) + if (!$util.isString(message.versionId)) + return "versionId: string expected"; + if (message.version != null && message.hasOwnProperty("version")) { + var error = $root.google.cloud.apihub.v1.Version.verify(message.version); + if (error) + return "version." + error; + } + return null; + }; + + /** + * Creates a CreateVersionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.CreateVersionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.CreateVersionRequest} CreateVersionRequest + */ + CreateVersionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.CreateVersionRequest) + return object; + var message = new $root.google.cloud.apihub.v1.CreateVersionRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.versionId != null) + message.versionId = String(object.versionId); + if (object.version != null) { + if (typeof object.version !== "object") + throw TypeError(".google.cloud.apihub.v1.CreateVersionRequest.version: object expected"); + message.version = $root.google.cloud.apihub.v1.Version.fromObject(object.version); + } + return message; + }; + + /** + * Creates a plain object from a CreateVersionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.CreateVersionRequest + * @static + * @param {google.cloud.apihub.v1.CreateVersionRequest} message CreateVersionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateVersionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.versionId = ""; + object.version = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.versionId != null && message.hasOwnProperty("versionId")) + object.versionId = message.versionId; + if (message.version != null && message.hasOwnProperty("version")) + object.version = $root.google.cloud.apihub.v1.Version.toObject(message.version, options); + return object; + }; + + /** + * Converts this CreateVersionRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.CreateVersionRequest + * @instance + * @returns {Object.} JSON object + */ + CreateVersionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateVersionRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.CreateVersionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.CreateVersionRequest"; + }; + + return CreateVersionRequest; + })(); + + v1.GetVersionRequest = (function() { + + /** + * Properties of a GetVersionRequest. + * @memberof google.cloud.apihub.v1 + * @interface IGetVersionRequest + * @property {string|null} [name] GetVersionRequest name + */ + + /** + * Constructs a new GetVersionRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a GetVersionRequest. + * @implements IGetVersionRequest + * @constructor + * @param {google.cloud.apihub.v1.IGetVersionRequest=} [properties] Properties to set + */ + function GetVersionRequest(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]]; + } + + /** + * GetVersionRequest name. + * @member {string} name + * @memberof google.cloud.apihub.v1.GetVersionRequest + * @instance + */ + GetVersionRequest.prototype.name = ""; + + /** + * Creates a new GetVersionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.GetVersionRequest + * @static + * @param {google.cloud.apihub.v1.IGetVersionRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.GetVersionRequest} GetVersionRequest instance + */ + GetVersionRequest.create = function create(properties) { + return new GetVersionRequest(properties); + }; + + /** + * Encodes the specified GetVersionRequest message. Does not implicitly {@link google.cloud.apihub.v1.GetVersionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.GetVersionRequest + * @static + * @param {google.cloud.apihub.v1.IGetVersionRequest} message GetVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetVersionRequest.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 GetVersionRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.GetVersionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.GetVersionRequest + * @static + * @param {google.cloud.apihub.v1.IGetVersionRequest} message GetVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetVersionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.GetVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.GetVersionRequest} GetVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetVersionRequest.decode = function 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.apihub.v1.GetVersionRequest(); + 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 GetVersionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.GetVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.GetVersionRequest} GetVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetVersionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetVersionRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.GetVersionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetVersionRequest.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 GetVersionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.GetVersionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.GetVersionRequest} GetVersionRequest + */ + GetVersionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.GetVersionRequest) + return object; + var message = new $root.google.cloud.apihub.v1.GetVersionRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetVersionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.GetVersionRequest + * @static + * @param {google.cloud.apihub.v1.GetVersionRequest} message GetVersionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetVersionRequest.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 GetVersionRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.GetVersionRequest + * @instance + * @returns {Object.} JSON object + */ + GetVersionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetVersionRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.GetVersionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.GetVersionRequest"; + }; + + return GetVersionRequest; + })(); + + v1.UpdateVersionRequest = (function() { + + /** + * Properties of an UpdateVersionRequest. + * @memberof google.cloud.apihub.v1 + * @interface IUpdateVersionRequest + * @property {google.cloud.apihub.v1.IVersion|null} [version] UpdateVersionRequest version + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateVersionRequest updateMask + */ + + /** + * Constructs a new UpdateVersionRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents an UpdateVersionRequest. + * @implements IUpdateVersionRequest + * @constructor + * @param {google.cloud.apihub.v1.IUpdateVersionRequest=} [properties] Properties to set + */ + function UpdateVersionRequest(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]]; + } + + /** + * UpdateVersionRequest version. + * @member {google.cloud.apihub.v1.IVersion|null|undefined} version + * @memberof google.cloud.apihub.v1.UpdateVersionRequest + * @instance + */ + UpdateVersionRequest.prototype.version = null; + + /** + * UpdateVersionRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.apihub.v1.UpdateVersionRequest + * @instance + */ + UpdateVersionRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateVersionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.UpdateVersionRequest + * @static + * @param {google.cloud.apihub.v1.IUpdateVersionRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.UpdateVersionRequest} UpdateVersionRequest instance + */ + UpdateVersionRequest.create = function create(properties) { + return new UpdateVersionRequest(properties); + }; + + /** + * Encodes the specified UpdateVersionRequest message. Does not implicitly {@link google.cloud.apihub.v1.UpdateVersionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.UpdateVersionRequest + * @static + * @param {google.cloud.apihub.v1.IUpdateVersionRequest} message UpdateVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateVersionRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + $root.google.cloud.apihub.v1.Version.encode(message.version, 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 UpdateVersionRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.UpdateVersionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.UpdateVersionRequest + * @static + * @param {google.cloud.apihub.v1.IUpdateVersionRequest} message UpdateVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateVersionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.UpdateVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.UpdateVersionRequest} UpdateVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateVersionRequest.decode = function 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.apihub.v1.UpdateVersionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.version = $root.google.cloud.apihub.v1.Version.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 UpdateVersionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.UpdateVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.UpdateVersionRequest} UpdateVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateVersionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateVersionRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.UpdateVersionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateVersionRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.version != null && message.hasOwnProperty("version")) { + var error = $root.google.cloud.apihub.v1.Version.verify(message.version); + if (error) + return "version." + 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 UpdateVersionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.UpdateVersionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.UpdateVersionRequest} UpdateVersionRequest + */ + UpdateVersionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.UpdateVersionRequest) + return object; + var message = new $root.google.cloud.apihub.v1.UpdateVersionRequest(); + if (object.version != null) { + if (typeof object.version !== "object") + throw TypeError(".google.cloud.apihub.v1.UpdateVersionRequest.version: object expected"); + message.version = $root.google.cloud.apihub.v1.Version.fromObject(object.version); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.apihub.v1.UpdateVersionRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateVersionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.UpdateVersionRequest + * @static + * @param {google.cloud.apihub.v1.UpdateVersionRequest} message UpdateVersionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateVersionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.version = null; + object.updateMask = null; + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = $root.google.cloud.apihub.v1.Version.toObject(message.version, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateVersionRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.UpdateVersionRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateVersionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateVersionRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.UpdateVersionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.UpdateVersionRequest"; + }; + + return UpdateVersionRequest; + })(); + + v1.DeleteVersionRequest = (function() { + + /** + * Properties of a DeleteVersionRequest. + * @memberof google.cloud.apihub.v1 + * @interface IDeleteVersionRequest + * @property {string|null} [name] DeleteVersionRequest name + * @property {boolean|null} [force] DeleteVersionRequest force + */ + + /** + * Constructs a new DeleteVersionRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a DeleteVersionRequest. + * @implements IDeleteVersionRequest + * @constructor + * @param {google.cloud.apihub.v1.IDeleteVersionRequest=} [properties] Properties to set + */ + function DeleteVersionRequest(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]]; + } + + /** + * DeleteVersionRequest name. + * @member {string} name + * @memberof google.cloud.apihub.v1.DeleteVersionRequest + * @instance + */ + DeleteVersionRequest.prototype.name = ""; + + /** + * DeleteVersionRequest force. + * @member {boolean} force + * @memberof google.cloud.apihub.v1.DeleteVersionRequest + * @instance + */ + DeleteVersionRequest.prototype.force = false; + + /** + * Creates a new DeleteVersionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.DeleteVersionRequest + * @static + * @param {google.cloud.apihub.v1.IDeleteVersionRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.DeleteVersionRequest} DeleteVersionRequest instance + */ + DeleteVersionRequest.create = function create(properties) { + return new DeleteVersionRequest(properties); + }; + + /** + * Encodes the specified DeleteVersionRequest message. Does not implicitly {@link google.cloud.apihub.v1.DeleteVersionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.DeleteVersionRequest + * @static + * @param {google.cloud.apihub.v1.IDeleteVersionRequest} message DeleteVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteVersionRequest.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.force != null && Object.hasOwnProperty.call(message, "force")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.force); + return writer; + }; + + /** + * Encodes the specified DeleteVersionRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.DeleteVersionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.DeleteVersionRequest + * @static + * @param {google.cloud.apihub.v1.IDeleteVersionRequest} message DeleteVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteVersionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.DeleteVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.DeleteVersionRequest} DeleteVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteVersionRequest.decode = function 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.apihub.v1.DeleteVersionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.force = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteVersionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.DeleteVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.DeleteVersionRequest} DeleteVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteVersionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteVersionRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.DeleteVersionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteVersionRequest.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.force != null && message.hasOwnProperty("force")) + if (typeof message.force !== "boolean") + return "force: boolean expected"; + return null; + }; + + /** + * Creates a DeleteVersionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.DeleteVersionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.DeleteVersionRequest} DeleteVersionRequest + */ + DeleteVersionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.DeleteVersionRequest) + return object; + var message = new $root.google.cloud.apihub.v1.DeleteVersionRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.force != null) + message.force = Boolean(object.force); + return message; + }; + + /** + * Creates a plain object from a DeleteVersionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.DeleteVersionRequest + * @static + * @param {google.cloud.apihub.v1.DeleteVersionRequest} message DeleteVersionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteVersionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.force = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.force != null && message.hasOwnProperty("force")) + object.force = message.force; + return object; + }; + + /** + * Converts this DeleteVersionRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.DeleteVersionRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteVersionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteVersionRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.DeleteVersionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.DeleteVersionRequest"; + }; + + return DeleteVersionRequest; + })(); + + v1.ListVersionsRequest = (function() { + + /** + * Properties of a ListVersionsRequest. + * @memberof google.cloud.apihub.v1 + * @interface IListVersionsRequest + * @property {string|null} [parent] ListVersionsRequest parent + * @property {string|null} [filter] ListVersionsRequest filter + * @property {number|null} [pageSize] ListVersionsRequest pageSize + * @property {string|null} [pageToken] ListVersionsRequest pageToken + */ + + /** + * Constructs a new ListVersionsRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a ListVersionsRequest. + * @implements IListVersionsRequest + * @constructor + * @param {google.cloud.apihub.v1.IListVersionsRequest=} [properties] Properties to set + */ + function ListVersionsRequest(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]]; + } + + /** + * ListVersionsRequest parent. + * @member {string} parent + * @memberof google.cloud.apihub.v1.ListVersionsRequest + * @instance + */ + ListVersionsRequest.prototype.parent = ""; + + /** + * ListVersionsRequest filter. + * @member {string} filter + * @memberof google.cloud.apihub.v1.ListVersionsRequest + * @instance + */ + ListVersionsRequest.prototype.filter = ""; + + /** + * ListVersionsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.apihub.v1.ListVersionsRequest + * @instance + */ + ListVersionsRequest.prototype.pageSize = 0; + + /** + * ListVersionsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.apihub.v1.ListVersionsRequest + * @instance + */ + ListVersionsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListVersionsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.ListVersionsRequest + * @static + * @param {google.cloud.apihub.v1.IListVersionsRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.ListVersionsRequest} ListVersionsRequest instance + */ + ListVersionsRequest.create = function create(properties) { + return new ListVersionsRequest(properties); + }; + + /** + * Encodes the specified ListVersionsRequest message. Does not implicitly {@link google.cloud.apihub.v1.ListVersionsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.ListVersionsRequest + * @static + * @param {google.cloud.apihub.v1.IListVersionsRequest} message ListVersionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListVersionsRequest.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.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListVersionsRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListVersionsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.ListVersionsRequest + * @static + * @param {google.cloud.apihub.v1.IListVersionsRequest} message ListVersionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListVersionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListVersionsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.ListVersionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.ListVersionsRequest} ListVersionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListVersionsRequest.decode = function 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.apihub.v1.ListVersionsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.filter = reader.string(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + case 4: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListVersionsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.ListVersionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.ListVersionsRequest} ListVersionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListVersionsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListVersionsRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.ListVersionsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListVersionsRequest.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.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 ListVersionsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.ListVersionsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.ListVersionsRequest} ListVersionsRequest + */ + ListVersionsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.ListVersionsRequest) + return object; + var message = new $root.google.cloud.apihub.v1.ListVersionsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + 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 ListVersionsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.ListVersionsRequest + * @static + * @param {google.cloud.apihub.v1.ListVersionsRequest} message ListVersionsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListVersionsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + 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; + return object; + }; + + /** + * Converts this ListVersionsRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.ListVersionsRequest + * @instance + * @returns {Object.} JSON object + */ + ListVersionsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListVersionsRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.ListVersionsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListVersionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.ListVersionsRequest"; + }; + + return ListVersionsRequest; + })(); + + v1.ListVersionsResponse = (function() { + + /** + * Properties of a ListVersionsResponse. + * @memberof google.cloud.apihub.v1 + * @interface IListVersionsResponse + * @property {Array.|null} [versions] ListVersionsResponse versions + * @property {string|null} [nextPageToken] ListVersionsResponse nextPageToken + */ + + /** + * Constructs a new ListVersionsResponse. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a ListVersionsResponse. + * @implements IListVersionsResponse + * @constructor + * @param {google.cloud.apihub.v1.IListVersionsResponse=} [properties] Properties to set + */ + function ListVersionsResponse(properties) { + this.versions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListVersionsResponse versions. + * @member {Array.} versions + * @memberof google.cloud.apihub.v1.ListVersionsResponse + * @instance + */ + ListVersionsResponse.prototype.versions = $util.emptyArray; + + /** + * ListVersionsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.apihub.v1.ListVersionsResponse + * @instance + */ + ListVersionsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListVersionsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.ListVersionsResponse + * @static + * @param {google.cloud.apihub.v1.IListVersionsResponse=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.ListVersionsResponse} ListVersionsResponse instance + */ + ListVersionsResponse.create = function create(properties) { + return new ListVersionsResponse(properties); + }; + + /** + * Encodes the specified ListVersionsResponse message. Does not implicitly {@link google.cloud.apihub.v1.ListVersionsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.ListVersionsResponse + * @static + * @param {google.cloud.apihub.v1.IListVersionsResponse} message ListVersionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListVersionsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.versions != null && message.versions.length) + for (var i = 0; i < message.versions.length; ++i) + $root.google.cloud.apihub.v1.Version.encode(message.versions[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 ListVersionsResponse message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListVersionsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.ListVersionsResponse + * @static + * @param {google.cloud.apihub.v1.IListVersionsResponse} message ListVersionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListVersionsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListVersionsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.ListVersionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.ListVersionsResponse} ListVersionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListVersionsResponse.decode = function 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.apihub.v1.ListVersionsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.versions && message.versions.length)) + message.versions = []; + message.versions.push($root.google.cloud.apihub.v1.Version.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListVersionsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.ListVersionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.ListVersionsResponse} ListVersionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListVersionsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListVersionsResponse message. + * @function verify + * @memberof google.cloud.apihub.v1.ListVersionsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListVersionsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.versions != null && message.hasOwnProperty("versions")) { + if (!Array.isArray(message.versions)) + return "versions: array expected"; + for (var i = 0; i < message.versions.length; ++i) { + var error = $root.google.cloud.apihub.v1.Version.verify(message.versions[i]); + if (error) + return "versions." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListVersionsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.ListVersionsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.ListVersionsResponse} ListVersionsResponse + */ + ListVersionsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.ListVersionsResponse) + return object; + var message = new $root.google.cloud.apihub.v1.ListVersionsResponse(); + if (object.versions) { + if (!Array.isArray(object.versions)) + throw TypeError(".google.cloud.apihub.v1.ListVersionsResponse.versions: array expected"); + message.versions = []; + for (var i = 0; i < object.versions.length; ++i) { + if (typeof object.versions[i] !== "object") + throw TypeError(".google.cloud.apihub.v1.ListVersionsResponse.versions: object expected"); + message.versions[i] = $root.google.cloud.apihub.v1.Version.fromObject(object.versions[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListVersionsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.ListVersionsResponse + * @static + * @param {google.cloud.apihub.v1.ListVersionsResponse} message ListVersionsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListVersionsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.versions = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.versions && message.versions.length) { + object.versions = []; + for (var j = 0; j < message.versions.length; ++j) + object.versions[j] = $root.google.cloud.apihub.v1.Version.toObject(message.versions[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListVersionsResponse to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.ListVersionsResponse + * @instance + * @returns {Object.} JSON object + */ + ListVersionsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListVersionsResponse + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.ListVersionsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListVersionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.ListVersionsResponse"; + }; + + return ListVersionsResponse; + })(); + + v1.CreateSpecRequest = (function() { + + /** + * Properties of a CreateSpecRequest. + * @memberof google.cloud.apihub.v1 + * @interface ICreateSpecRequest + * @property {string|null} [parent] CreateSpecRequest parent + * @property {string|null} [specId] CreateSpecRequest specId + * @property {google.cloud.apihub.v1.ISpec|null} [spec] CreateSpecRequest spec + */ + + /** + * Constructs a new CreateSpecRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a CreateSpecRequest. + * @implements ICreateSpecRequest + * @constructor + * @param {google.cloud.apihub.v1.ICreateSpecRequest=} [properties] Properties to set + */ + function CreateSpecRequest(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]]; + } + + /** + * CreateSpecRequest parent. + * @member {string} parent + * @memberof google.cloud.apihub.v1.CreateSpecRequest + * @instance + */ + CreateSpecRequest.prototype.parent = ""; + + /** + * CreateSpecRequest specId. + * @member {string} specId + * @memberof google.cloud.apihub.v1.CreateSpecRequest + * @instance + */ + CreateSpecRequest.prototype.specId = ""; + + /** + * CreateSpecRequest spec. + * @member {google.cloud.apihub.v1.ISpec|null|undefined} spec + * @memberof google.cloud.apihub.v1.CreateSpecRequest + * @instance + */ + CreateSpecRequest.prototype.spec = null; + + /** + * Creates a new CreateSpecRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.CreateSpecRequest + * @static + * @param {google.cloud.apihub.v1.ICreateSpecRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.CreateSpecRequest} CreateSpecRequest instance + */ + CreateSpecRequest.create = function create(properties) { + return new CreateSpecRequest(properties); + }; + + /** + * Encodes the specified CreateSpecRequest message. Does not implicitly {@link google.cloud.apihub.v1.CreateSpecRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.CreateSpecRequest + * @static + * @param {google.cloud.apihub.v1.ICreateSpecRequest} message CreateSpecRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSpecRequest.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.specId != null && Object.hasOwnProperty.call(message, "specId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.specId); + if (message.spec != null && Object.hasOwnProperty.call(message, "spec")) + $root.google.cloud.apihub.v1.Spec.encode(message.spec, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateSpecRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.CreateSpecRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.CreateSpecRequest + * @static + * @param {google.cloud.apihub.v1.ICreateSpecRequest} message CreateSpecRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSpecRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateSpecRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.CreateSpecRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.CreateSpecRequest} CreateSpecRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSpecRequest.decode = function 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.apihub.v1.CreateSpecRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.specId = reader.string(); + break; + } + case 3: { + message.spec = $root.google.cloud.apihub.v1.Spec.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateSpecRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.CreateSpecRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.CreateSpecRequest} CreateSpecRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSpecRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateSpecRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.CreateSpecRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateSpecRequest.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.specId != null && message.hasOwnProperty("specId")) + if (!$util.isString(message.specId)) + return "specId: string expected"; + if (message.spec != null && message.hasOwnProperty("spec")) { + var error = $root.google.cloud.apihub.v1.Spec.verify(message.spec); + if (error) + return "spec." + error; + } + return null; + }; + + /** + * Creates a CreateSpecRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.CreateSpecRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.CreateSpecRequest} CreateSpecRequest + */ + CreateSpecRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.CreateSpecRequest) + return object; + var message = new $root.google.cloud.apihub.v1.CreateSpecRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.specId != null) + message.specId = String(object.specId); + if (object.spec != null) { + if (typeof object.spec !== "object") + throw TypeError(".google.cloud.apihub.v1.CreateSpecRequest.spec: object expected"); + message.spec = $root.google.cloud.apihub.v1.Spec.fromObject(object.spec); + } + return message; + }; + + /** + * Creates a plain object from a CreateSpecRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.CreateSpecRequest + * @static + * @param {google.cloud.apihub.v1.CreateSpecRequest} message CreateSpecRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateSpecRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.specId = ""; + object.spec = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.specId != null && message.hasOwnProperty("specId")) + object.specId = message.specId; + if (message.spec != null && message.hasOwnProperty("spec")) + object.spec = $root.google.cloud.apihub.v1.Spec.toObject(message.spec, options); + return object; + }; + + /** + * Converts this CreateSpecRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.CreateSpecRequest + * @instance + * @returns {Object.} JSON object + */ + CreateSpecRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateSpecRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.CreateSpecRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateSpecRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.CreateSpecRequest"; + }; + + return CreateSpecRequest; + })(); + + v1.GetSpecRequest = (function() { + + /** + * Properties of a GetSpecRequest. + * @memberof google.cloud.apihub.v1 + * @interface IGetSpecRequest + * @property {string|null} [name] GetSpecRequest name + */ + + /** + * Constructs a new GetSpecRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a GetSpecRequest. + * @implements IGetSpecRequest + * @constructor + * @param {google.cloud.apihub.v1.IGetSpecRequest=} [properties] Properties to set + */ + function GetSpecRequest(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]]; + } + + /** + * GetSpecRequest name. + * @member {string} name + * @memberof google.cloud.apihub.v1.GetSpecRequest + * @instance + */ + GetSpecRequest.prototype.name = ""; + + /** + * Creates a new GetSpecRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.GetSpecRequest + * @static + * @param {google.cloud.apihub.v1.IGetSpecRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.GetSpecRequest} GetSpecRequest instance + */ + GetSpecRequest.create = function create(properties) { + return new GetSpecRequest(properties); + }; + + /** + * Encodes the specified GetSpecRequest message. Does not implicitly {@link google.cloud.apihub.v1.GetSpecRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.GetSpecRequest + * @static + * @param {google.cloud.apihub.v1.IGetSpecRequest} message GetSpecRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSpecRequest.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 GetSpecRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.GetSpecRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.GetSpecRequest + * @static + * @param {google.cloud.apihub.v1.IGetSpecRequest} message GetSpecRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSpecRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetSpecRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.GetSpecRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.GetSpecRequest} GetSpecRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSpecRequest.decode = function 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.apihub.v1.GetSpecRequest(); + 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 GetSpecRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.GetSpecRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.GetSpecRequest} GetSpecRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSpecRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetSpecRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.GetSpecRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetSpecRequest.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 GetSpecRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.GetSpecRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.GetSpecRequest} GetSpecRequest + */ + GetSpecRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.GetSpecRequest) + return object; + var message = new $root.google.cloud.apihub.v1.GetSpecRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetSpecRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.GetSpecRequest + * @static + * @param {google.cloud.apihub.v1.GetSpecRequest} message GetSpecRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetSpecRequest.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 GetSpecRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.GetSpecRequest + * @instance + * @returns {Object.} JSON object + */ + GetSpecRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetSpecRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.GetSpecRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetSpecRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.GetSpecRequest"; + }; + + return GetSpecRequest; + })(); + + v1.UpdateSpecRequest = (function() { + + /** + * Properties of an UpdateSpecRequest. + * @memberof google.cloud.apihub.v1 + * @interface IUpdateSpecRequest + * @property {google.cloud.apihub.v1.ISpec|null} [spec] UpdateSpecRequest spec + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateSpecRequest updateMask + */ + + /** + * Constructs a new UpdateSpecRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents an UpdateSpecRequest. + * @implements IUpdateSpecRequest + * @constructor + * @param {google.cloud.apihub.v1.IUpdateSpecRequest=} [properties] Properties to set + */ + function UpdateSpecRequest(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]]; + } + + /** + * UpdateSpecRequest spec. + * @member {google.cloud.apihub.v1.ISpec|null|undefined} spec + * @memberof google.cloud.apihub.v1.UpdateSpecRequest + * @instance + */ + UpdateSpecRequest.prototype.spec = null; + + /** + * UpdateSpecRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.apihub.v1.UpdateSpecRequest + * @instance + */ + UpdateSpecRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateSpecRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.UpdateSpecRequest + * @static + * @param {google.cloud.apihub.v1.IUpdateSpecRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.UpdateSpecRequest} UpdateSpecRequest instance + */ + UpdateSpecRequest.create = function create(properties) { + return new UpdateSpecRequest(properties); + }; + + /** + * Encodes the specified UpdateSpecRequest message. Does not implicitly {@link google.cloud.apihub.v1.UpdateSpecRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.UpdateSpecRequest + * @static + * @param {google.cloud.apihub.v1.IUpdateSpecRequest} message UpdateSpecRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSpecRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.spec != null && Object.hasOwnProperty.call(message, "spec")) + $root.google.cloud.apihub.v1.Spec.encode(message.spec, 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 UpdateSpecRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.UpdateSpecRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.UpdateSpecRequest + * @static + * @param {google.cloud.apihub.v1.IUpdateSpecRequest} message UpdateSpecRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSpecRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateSpecRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.UpdateSpecRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.UpdateSpecRequest} UpdateSpecRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSpecRequest.decode = function 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.apihub.v1.UpdateSpecRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.spec = $root.google.cloud.apihub.v1.Spec.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 UpdateSpecRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.UpdateSpecRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.UpdateSpecRequest} UpdateSpecRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSpecRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateSpecRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.UpdateSpecRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateSpecRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.spec != null && message.hasOwnProperty("spec")) { + var error = $root.google.cloud.apihub.v1.Spec.verify(message.spec); + if (error) + return "spec." + 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 UpdateSpecRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.UpdateSpecRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.UpdateSpecRequest} UpdateSpecRequest + */ + UpdateSpecRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.UpdateSpecRequest) + return object; + var message = new $root.google.cloud.apihub.v1.UpdateSpecRequest(); + if (object.spec != null) { + if (typeof object.spec !== "object") + throw TypeError(".google.cloud.apihub.v1.UpdateSpecRequest.spec: object expected"); + message.spec = $root.google.cloud.apihub.v1.Spec.fromObject(object.spec); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.apihub.v1.UpdateSpecRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateSpecRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.UpdateSpecRequest + * @static + * @param {google.cloud.apihub.v1.UpdateSpecRequest} message UpdateSpecRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateSpecRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.spec = null; + object.updateMask = null; + } + if (message.spec != null && message.hasOwnProperty("spec")) + object.spec = $root.google.cloud.apihub.v1.Spec.toObject(message.spec, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateSpecRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.UpdateSpecRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateSpecRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateSpecRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.UpdateSpecRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateSpecRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.UpdateSpecRequest"; + }; + + return UpdateSpecRequest; + })(); + + v1.DeleteSpecRequest = (function() { + + /** + * Properties of a DeleteSpecRequest. + * @memberof google.cloud.apihub.v1 + * @interface IDeleteSpecRequest + * @property {string|null} [name] DeleteSpecRequest name + */ + + /** + * Constructs a new DeleteSpecRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a DeleteSpecRequest. + * @implements IDeleteSpecRequest + * @constructor + * @param {google.cloud.apihub.v1.IDeleteSpecRequest=} [properties] Properties to set + */ + function DeleteSpecRequest(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]]; + } + + /** + * DeleteSpecRequest name. + * @member {string} name + * @memberof google.cloud.apihub.v1.DeleteSpecRequest + * @instance + */ + DeleteSpecRequest.prototype.name = ""; + + /** + * Creates a new DeleteSpecRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.DeleteSpecRequest + * @static + * @param {google.cloud.apihub.v1.IDeleteSpecRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.DeleteSpecRequest} DeleteSpecRequest instance + */ + DeleteSpecRequest.create = function create(properties) { + return new DeleteSpecRequest(properties); + }; + + /** + * Encodes the specified DeleteSpecRequest message. Does not implicitly {@link google.cloud.apihub.v1.DeleteSpecRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.DeleteSpecRequest + * @static + * @param {google.cloud.apihub.v1.IDeleteSpecRequest} message DeleteSpecRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSpecRequest.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 DeleteSpecRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.DeleteSpecRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.DeleteSpecRequest + * @static + * @param {google.cloud.apihub.v1.IDeleteSpecRequest} message DeleteSpecRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSpecRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteSpecRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.DeleteSpecRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.DeleteSpecRequest} DeleteSpecRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSpecRequest.decode = function 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.apihub.v1.DeleteSpecRequest(); + 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 DeleteSpecRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.DeleteSpecRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.DeleteSpecRequest} DeleteSpecRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSpecRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteSpecRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.DeleteSpecRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteSpecRequest.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 DeleteSpecRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.DeleteSpecRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.DeleteSpecRequest} DeleteSpecRequest + */ + DeleteSpecRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.DeleteSpecRequest) + return object; + var message = new $root.google.cloud.apihub.v1.DeleteSpecRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteSpecRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.DeleteSpecRequest + * @static + * @param {google.cloud.apihub.v1.DeleteSpecRequest} message DeleteSpecRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteSpecRequest.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 DeleteSpecRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.DeleteSpecRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteSpecRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteSpecRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.DeleteSpecRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteSpecRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.DeleteSpecRequest"; + }; + + return DeleteSpecRequest; + })(); + + v1.ListSpecsRequest = (function() { + + /** + * Properties of a ListSpecsRequest. + * @memberof google.cloud.apihub.v1 + * @interface IListSpecsRequest + * @property {string|null} [parent] ListSpecsRequest parent + * @property {string|null} [filter] ListSpecsRequest filter + * @property {number|null} [pageSize] ListSpecsRequest pageSize + * @property {string|null} [pageToken] ListSpecsRequest pageToken + */ + + /** + * Constructs a new ListSpecsRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a ListSpecsRequest. + * @implements IListSpecsRequest + * @constructor + * @param {google.cloud.apihub.v1.IListSpecsRequest=} [properties] Properties to set + */ + function ListSpecsRequest(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]]; + } + + /** + * ListSpecsRequest parent. + * @member {string} parent + * @memberof google.cloud.apihub.v1.ListSpecsRequest + * @instance + */ + ListSpecsRequest.prototype.parent = ""; + + /** + * ListSpecsRequest filter. + * @member {string} filter + * @memberof google.cloud.apihub.v1.ListSpecsRequest + * @instance + */ + ListSpecsRequest.prototype.filter = ""; + + /** + * ListSpecsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.apihub.v1.ListSpecsRequest + * @instance + */ + ListSpecsRequest.prototype.pageSize = 0; + + /** + * ListSpecsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.apihub.v1.ListSpecsRequest + * @instance + */ + ListSpecsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListSpecsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.ListSpecsRequest + * @static + * @param {google.cloud.apihub.v1.IListSpecsRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.ListSpecsRequest} ListSpecsRequest instance + */ + ListSpecsRequest.create = function create(properties) { + return new ListSpecsRequest(properties); + }; + + /** + * Encodes the specified ListSpecsRequest message. Does not implicitly {@link google.cloud.apihub.v1.ListSpecsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.ListSpecsRequest + * @static + * @param {google.cloud.apihub.v1.IListSpecsRequest} message ListSpecsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSpecsRequest.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.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListSpecsRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListSpecsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.ListSpecsRequest + * @static + * @param {google.cloud.apihub.v1.IListSpecsRequest} message ListSpecsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSpecsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSpecsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.ListSpecsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.ListSpecsRequest} ListSpecsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSpecsRequest.decode = function 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.apihub.v1.ListSpecsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.filter = reader.string(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + case 4: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListSpecsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.ListSpecsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.ListSpecsRequest} ListSpecsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSpecsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSpecsRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.ListSpecsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSpecsRequest.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.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 ListSpecsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.ListSpecsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.ListSpecsRequest} ListSpecsRequest + */ + ListSpecsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.ListSpecsRequest) + return object; + var message = new $root.google.cloud.apihub.v1.ListSpecsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + 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 ListSpecsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.ListSpecsRequest + * @static + * @param {google.cloud.apihub.v1.ListSpecsRequest} message ListSpecsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSpecsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + 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; + return object; + }; + + /** + * Converts this ListSpecsRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.ListSpecsRequest + * @instance + * @returns {Object.} JSON object + */ + ListSpecsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSpecsRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.ListSpecsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSpecsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.ListSpecsRequest"; + }; + + return ListSpecsRequest; + })(); + + v1.ListSpecsResponse = (function() { + + /** + * Properties of a ListSpecsResponse. + * @memberof google.cloud.apihub.v1 + * @interface IListSpecsResponse + * @property {Array.|null} [specs] ListSpecsResponse specs + * @property {string|null} [nextPageToken] ListSpecsResponse nextPageToken + */ + + /** + * Constructs a new ListSpecsResponse. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a ListSpecsResponse. + * @implements IListSpecsResponse + * @constructor + * @param {google.cloud.apihub.v1.IListSpecsResponse=} [properties] Properties to set + */ + function ListSpecsResponse(properties) { + this.specs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListSpecsResponse specs. + * @member {Array.} specs + * @memberof google.cloud.apihub.v1.ListSpecsResponse + * @instance + */ + ListSpecsResponse.prototype.specs = $util.emptyArray; + + /** + * ListSpecsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.apihub.v1.ListSpecsResponse + * @instance + */ + ListSpecsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListSpecsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.ListSpecsResponse + * @static + * @param {google.cloud.apihub.v1.IListSpecsResponse=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.ListSpecsResponse} ListSpecsResponse instance + */ + ListSpecsResponse.create = function create(properties) { + return new ListSpecsResponse(properties); + }; + + /** + * Encodes the specified ListSpecsResponse message. Does not implicitly {@link google.cloud.apihub.v1.ListSpecsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.ListSpecsResponse + * @static + * @param {google.cloud.apihub.v1.IListSpecsResponse} message ListSpecsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSpecsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.specs != null && message.specs.length) + for (var i = 0; i < message.specs.length; ++i) + $root.google.cloud.apihub.v1.Spec.encode(message.specs[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 ListSpecsResponse message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListSpecsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.ListSpecsResponse + * @static + * @param {google.cloud.apihub.v1.IListSpecsResponse} message ListSpecsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSpecsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSpecsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.ListSpecsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.ListSpecsResponse} ListSpecsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSpecsResponse.decode = function 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.apihub.v1.ListSpecsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.specs && message.specs.length)) + message.specs = []; + message.specs.push($root.google.cloud.apihub.v1.Spec.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListSpecsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.ListSpecsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.ListSpecsResponse} ListSpecsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSpecsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSpecsResponse message. + * @function verify + * @memberof google.cloud.apihub.v1.ListSpecsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSpecsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.specs != null && message.hasOwnProperty("specs")) { + if (!Array.isArray(message.specs)) + return "specs: array expected"; + for (var i = 0; i < message.specs.length; ++i) { + var error = $root.google.cloud.apihub.v1.Spec.verify(message.specs[i]); + if (error) + return "specs." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListSpecsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.ListSpecsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.ListSpecsResponse} ListSpecsResponse + */ + ListSpecsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.ListSpecsResponse) + return object; + var message = new $root.google.cloud.apihub.v1.ListSpecsResponse(); + if (object.specs) { + if (!Array.isArray(object.specs)) + throw TypeError(".google.cloud.apihub.v1.ListSpecsResponse.specs: array expected"); + message.specs = []; + for (var i = 0; i < object.specs.length; ++i) { + if (typeof object.specs[i] !== "object") + throw TypeError(".google.cloud.apihub.v1.ListSpecsResponse.specs: object expected"); + message.specs[i] = $root.google.cloud.apihub.v1.Spec.fromObject(object.specs[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListSpecsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.ListSpecsResponse + * @static + * @param {google.cloud.apihub.v1.ListSpecsResponse} message ListSpecsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSpecsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.specs = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.specs && message.specs.length) { + object.specs = []; + for (var j = 0; j < message.specs.length; ++j) + object.specs[j] = $root.google.cloud.apihub.v1.Spec.toObject(message.specs[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListSpecsResponse to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.ListSpecsResponse + * @instance + * @returns {Object.} JSON object + */ + ListSpecsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSpecsResponse + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.ListSpecsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSpecsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.ListSpecsResponse"; + }; + + return ListSpecsResponse; + })(); + + v1.GetSpecContentsRequest = (function() { + + /** + * Properties of a GetSpecContentsRequest. + * @memberof google.cloud.apihub.v1 + * @interface IGetSpecContentsRequest + * @property {string|null} [name] GetSpecContentsRequest name + */ + + /** + * Constructs a new GetSpecContentsRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a GetSpecContentsRequest. + * @implements IGetSpecContentsRequest + * @constructor + * @param {google.cloud.apihub.v1.IGetSpecContentsRequest=} [properties] Properties to set + */ + function GetSpecContentsRequest(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]]; + } + + /** + * GetSpecContentsRequest name. + * @member {string} name + * @memberof google.cloud.apihub.v1.GetSpecContentsRequest + * @instance + */ + GetSpecContentsRequest.prototype.name = ""; + + /** + * Creates a new GetSpecContentsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.GetSpecContentsRequest + * @static + * @param {google.cloud.apihub.v1.IGetSpecContentsRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.GetSpecContentsRequest} GetSpecContentsRequest instance + */ + GetSpecContentsRequest.create = function create(properties) { + return new GetSpecContentsRequest(properties); + }; + + /** + * Encodes the specified GetSpecContentsRequest message. Does not implicitly {@link google.cloud.apihub.v1.GetSpecContentsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.GetSpecContentsRequest + * @static + * @param {google.cloud.apihub.v1.IGetSpecContentsRequest} message GetSpecContentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSpecContentsRequest.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 GetSpecContentsRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.GetSpecContentsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.GetSpecContentsRequest + * @static + * @param {google.cloud.apihub.v1.IGetSpecContentsRequest} message GetSpecContentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSpecContentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetSpecContentsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.GetSpecContentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.GetSpecContentsRequest} GetSpecContentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSpecContentsRequest.decode = function 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.apihub.v1.GetSpecContentsRequest(); + 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 GetSpecContentsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.GetSpecContentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.GetSpecContentsRequest} GetSpecContentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSpecContentsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetSpecContentsRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.GetSpecContentsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetSpecContentsRequest.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 GetSpecContentsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.GetSpecContentsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.GetSpecContentsRequest} GetSpecContentsRequest + */ + GetSpecContentsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.GetSpecContentsRequest) + return object; + var message = new $root.google.cloud.apihub.v1.GetSpecContentsRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetSpecContentsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.GetSpecContentsRequest + * @static + * @param {google.cloud.apihub.v1.GetSpecContentsRequest} message GetSpecContentsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetSpecContentsRequest.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 GetSpecContentsRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.GetSpecContentsRequest + * @instance + * @returns {Object.} JSON object + */ + GetSpecContentsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetSpecContentsRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.GetSpecContentsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetSpecContentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.GetSpecContentsRequest"; + }; + + return GetSpecContentsRequest; + })(); + + v1.GetApiOperationRequest = (function() { + + /** + * Properties of a GetApiOperationRequest. + * @memberof google.cloud.apihub.v1 + * @interface IGetApiOperationRequest + * @property {string|null} [name] GetApiOperationRequest name + */ + + /** + * Constructs a new GetApiOperationRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a GetApiOperationRequest. + * @implements IGetApiOperationRequest + * @constructor + * @param {google.cloud.apihub.v1.IGetApiOperationRequest=} [properties] Properties to set + */ + function GetApiOperationRequest(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]]; + } + + /** + * GetApiOperationRequest name. + * @member {string} name + * @memberof google.cloud.apihub.v1.GetApiOperationRequest + * @instance + */ + GetApiOperationRequest.prototype.name = ""; + + /** + * Creates a new GetApiOperationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.GetApiOperationRequest + * @static + * @param {google.cloud.apihub.v1.IGetApiOperationRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.GetApiOperationRequest} GetApiOperationRequest instance + */ + GetApiOperationRequest.create = function create(properties) { + return new GetApiOperationRequest(properties); + }; + + /** + * Encodes the specified GetApiOperationRequest message. Does not implicitly {@link google.cloud.apihub.v1.GetApiOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.GetApiOperationRequest + * @static + * @param {google.cloud.apihub.v1.IGetApiOperationRequest} message GetApiOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetApiOperationRequest.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 GetApiOperationRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.GetApiOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.GetApiOperationRequest + * @static + * @param {google.cloud.apihub.v1.IGetApiOperationRequest} message GetApiOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetApiOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetApiOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.GetApiOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.GetApiOperationRequest} GetApiOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetApiOperationRequest.decode = function 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.apihub.v1.GetApiOperationRequest(); + 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 GetApiOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.GetApiOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.GetApiOperationRequest} GetApiOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetApiOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetApiOperationRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.GetApiOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetApiOperationRequest.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 GetApiOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.GetApiOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.GetApiOperationRequest} GetApiOperationRequest + */ + GetApiOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.GetApiOperationRequest) + return object; + var message = new $root.google.cloud.apihub.v1.GetApiOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetApiOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.GetApiOperationRequest + * @static + * @param {google.cloud.apihub.v1.GetApiOperationRequest} message GetApiOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetApiOperationRequest.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 GetApiOperationRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.GetApiOperationRequest + * @instance + * @returns {Object.} JSON object + */ + GetApiOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetApiOperationRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.GetApiOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetApiOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.GetApiOperationRequest"; + }; + + return GetApiOperationRequest; + })(); + + v1.ListApiOperationsRequest = (function() { + + /** + * Properties of a ListApiOperationsRequest. + * @memberof google.cloud.apihub.v1 + * @interface IListApiOperationsRequest + * @property {string|null} [parent] ListApiOperationsRequest parent + * @property {string|null} [filter] ListApiOperationsRequest filter + * @property {number|null} [pageSize] ListApiOperationsRequest pageSize + * @property {string|null} [pageToken] ListApiOperationsRequest pageToken + */ + + /** + * Constructs a new ListApiOperationsRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a ListApiOperationsRequest. + * @implements IListApiOperationsRequest + * @constructor + * @param {google.cloud.apihub.v1.IListApiOperationsRequest=} [properties] Properties to set + */ + function ListApiOperationsRequest(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]]; + } + + /** + * ListApiOperationsRequest parent. + * @member {string} parent + * @memberof google.cloud.apihub.v1.ListApiOperationsRequest + * @instance + */ + ListApiOperationsRequest.prototype.parent = ""; + + /** + * ListApiOperationsRequest filter. + * @member {string} filter + * @memberof google.cloud.apihub.v1.ListApiOperationsRequest + * @instance + */ + ListApiOperationsRequest.prototype.filter = ""; + + /** + * ListApiOperationsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.apihub.v1.ListApiOperationsRequest + * @instance + */ + ListApiOperationsRequest.prototype.pageSize = 0; + + /** + * ListApiOperationsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.apihub.v1.ListApiOperationsRequest + * @instance + */ + ListApiOperationsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListApiOperationsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.ListApiOperationsRequest + * @static + * @param {google.cloud.apihub.v1.IListApiOperationsRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.ListApiOperationsRequest} ListApiOperationsRequest instance + */ + ListApiOperationsRequest.create = function create(properties) { + return new ListApiOperationsRequest(properties); + }; + + /** + * Encodes the specified ListApiOperationsRequest message. Does not implicitly {@link google.cloud.apihub.v1.ListApiOperationsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.ListApiOperationsRequest + * @static + * @param {google.cloud.apihub.v1.IListApiOperationsRequest} message ListApiOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListApiOperationsRequest.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.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListApiOperationsRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListApiOperationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.ListApiOperationsRequest + * @static + * @param {google.cloud.apihub.v1.IListApiOperationsRequest} message ListApiOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListApiOperationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListApiOperationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.ListApiOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.ListApiOperationsRequest} ListApiOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListApiOperationsRequest.decode = function 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.apihub.v1.ListApiOperationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.filter = reader.string(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + case 4: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListApiOperationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.ListApiOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.ListApiOperationsRequest} ListApiOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListApiOperationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListApiOperationsRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.ListApiOperationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListApiOperationsRequest.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.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 ListApiOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.ListApiOperationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.ListApiOperationsRequest} ListApiOperationsRequest + */ + ListApiOperationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.ListApiOperationsRequest) + return object; + var message = new $root.google.cloud.apihub.v1.ListApiOperationsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + 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 ListApiOperationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.ListApiOperationsRequest + * @static + * @param {google.cloud.apihub.v1.ListApiOperationsRequest} message ListApiOperationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListApiOperationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + 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; + return object; + }; + + /** + * Converts this ListApiOperationsRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.ListApiOperationsRequest + * @instance + * @returns {Object.} JSON object + */ + ListApiOperationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListApiOperationsRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.ListApiOperationsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListApiOperationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.ListApiOperationsRequest"; + }; + + return ListApiOperationsRequest; + })(); + + v1.ListApiOperationsResponse = (function() { + + /** + * Properties of a ListApiOperationsResponse. + * @memberof google.cloud.apihub.v1 + * @interface IListApiOperationsResponse + * @property {Array.|null} [apiOperations] ListApiOperationsResponse apiOperations + * @property {string|null} [nextPageToken] ListApiOperationsResponse nextPageToken + */ + + /** + * Constructs a new ListApiOperationsResponse. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a ListApiOperationsResponse. + * @implements IListApiOperationsResponse + * @constructor + * @param {google.cloud.apihub.v1.IListApiOperationsResponse=} [properties] Properties to set + */ + function ListApiOperationsResponse(properties) { + this.apiOperations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListApiOperationsResponse apiOperations. + * @member {Array.} apiOperations + * @memberof google.cloud.apihub.v1.ListApiOperationsResponse + * @instance + */ + ListApiOperationsResponse.prototype.apiOperations = $util.emptyArray; + + /** + * ListApiOperationsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.apihub.v1.ListApiOperationsResponse + * @instance + */ + ListApiOperationsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListApiOperationsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.ListApiOperationsResponse + * @static + * @param {google.cloud.apihub.v1.IListApiOperationsResponse=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.ListApiOperationsResponse} ListApiOperationsResponse instance + */ + ListApiOperationsResponse.create = function create(properties) { + return new ListApiOperationsResponse(properties); + }; + + /** + * Encodes the specified ListApiOperationsResponse message. Does not implicitly {@link google.cloud.apihub.v1.ListApiOperationsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.ListApiOperationsResponse + * @static + * @param {google.cloud.apihub.v1.IListApiOperationsResponse} message ListApiOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListApiOperationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.apiOperations != null && message.apiOperations.length) + for (var i = 0; i < message.apiOperations.length; ++i) + $root.google.cloud.apihub.v1.ApiOperation.encode(message.apiOperations[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 ListApiOperationsResponse message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListApiOperationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.ListApiOperationsResponse + * @static + * @param {google.cloud.apihub.v1.IListApiOperationsResponse} message ListApiOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListApiOperationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListApiOperationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.ListApiOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.ListApiOperationsResponse} ListApiOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListApiOperationsResponse.decode = function 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.apihub.v1.ListApiOperationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.apiOperations && message.apiOperations.length)) + message.apiOperations = []; + message.apiOperations.push($root.google.cloud.apihub.v1.ApiOperation.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListApiOperationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.ListApiOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.ListApiOperationsResponse} ListApiOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListApiOperationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListApiOperationsResponse message. + * @function verify + * @memberof google.cloud.apihub.v1.ListApiOperationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListApiOperationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.apiOperations != null && message.hasOwnProperty("apiOperations")) { + if (!Array.isArray(message.apiOperations)) + return "apiOperations: array expected"; + for (var i = 0; i < message.apiOperations.length; ++i) { + var error = $root.google.cloud.apihub.v1.ApiOperation.verify(message.apiOperations[i]); + if (error) + return "apiOperations." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListApiOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.ListApiOperationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.ListApiOperationsResponse} ListApiOperationsResponse + */ + ListApiOperationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.ListApiOperationsResponse) + return object; + var message = new $root.google.cloud.apihub.v1.ListApiOperationsResponse(); + if (object.apiOperations) { + if (!Array.isArray(object.apiOperations)) + throw TypeError(".google.cloud.apihub.v1.ListApiOperationsResponse.apiOperations: array expected"); + message.apiOperations = []; + for (var i = 0; i < object.apiOperations.length; ++i) { + if (typeof object.apiOperations[i] !== "object") + throw TypeError(".google.cloud.apihub.v1.ListApiOperationsResponse.apiOperations: object expected"); + message.apiOperations[i] = $root.google.cloud.apihub.v1.ApiOperation.fromObject(object.apiOperations[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListApiOperationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.ListApiOperationsResponse + * @static + * @param {google.cloud.apihub.v1.ListApiOperationsResponse} message ListApiOperationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListApiOperationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.apiOperations = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.apiOperations && message.apiOperations.length) { + object.apiOperations = []; + for (var j = 0; j < message.apiOperations.length; ++j) + object.apiOperations[j] = $root.google.cloud.apihub.v1.ApiOperation.toObject(message.apiOperations[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListApiOperationsResponse to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.ListApiOperationsResponse + * @instance + * @returns {Object.} JSON object + */ + ListApiOperationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListApiOperationsResponse + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.ListApiOperationsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListApiOperationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.ListApiOperationsResponse"; + }; + + return ListApiOperationsResponse; + })(); + + v1.GetDefinitionRequest = (function() { + + /** + * Properties of a GetDefinitionRequest. + * @memberof google.cloud.apihub.v1 + * @interface IGetDefinitionRequest + * @property {string|null} [name] GetDefinitionRequest name + */ + + /** + * Constructs a new GetDefinitionRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a GetDefinitionRequest. + * @implements IGetDefinitionRequest + * @constructor + * @param {google.cloud.apihub.v1.IGetDefinitionRequest=} [properties] Properties to set + */ + function GetDefinitionRequest(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]]; + } + + /** + * GetDefinitionRequest name. + * @member {string} name + * @memberof google.cloud.apihub.v1.GetDefinitionRequest + * @instance + */ + GetDefinitionRequest.prototype.name = ""; + + /** + * Creates a new GetDefinitionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.GetDefinitionRequest + * @static + * @param {google.cloud.apihub.v1.IGetDefinitionRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.GetDefinitionRequest} GetDefinitionRequest instance + */ + GetDefinitionRequest.create = function create(properties) { + return new GetDefinitionRequest(properties); + }; + + /** + * Encodes the specified GetDefinitionRequest message. Does not implicitly {@link google.cloud.apihub.v1.GetDefinitionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.GetDefinitionRequest + * @static + * @param {google.cloud.apihub.v1.IGetDefinitionRequest} message GetDefinitionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDefinitionRequest.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 GetDefinitionRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.GetDefinitionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.GetDefinitionRequest + * @static + * @param {google.cloud.apihub.v1.IGetDefinitionRequest} message GetDefinitionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDefinitionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDefinitionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.GetDefinitionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.GetDefinitionRequest} GetDefinitionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDefinitionRequest.decode = function 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.apihub.v1.GetDefinitionRequest(); + 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 GetDefinitionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.GetDefinitionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.GetDefinitionRequest} GetDefinitionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDefinitionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDefinitionRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.GetDefinitionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDefinitionRequest.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 GetDefinitionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.GetDefinitionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.GetDefinitionRequest} GetDefinitionRequest + */ + GetDefinitionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.GetDefinitionRequest) + return object; + var message = new $root.google.cloud.apihub.v1.GetDefinitionRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetDefinitionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.GetDefinitionRequest + * @static + * @param {google.cloud.apihub.v1.GetDefinitionRequest} message GetDefinitionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDefinitionRequest.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 GetDefinitionRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.GetDefinitionRequest + * @instance + * @returns {Object.} JSON object + */ + GetDefinitionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetDefinitionRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.GetDefinitionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetDefinitionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.GetDefinitionRequest"; + }; + + return GetDefinitionRequest; + })(); + + v1.CreateDeploymentRequest = (function() { + + /** + * Properties of a CreateDeploymentRequest. + * @memberof google.cloud.apihub.v1 + * @interface ICreateDeploymentRequest + * @property {string|null} [parent] CreateDeploymentRequest parent + * @property {string|null} [deploymentId] CreateDeploymentRequest deploymentId + * @property {google.cloud.apihub.v1.IDeployment|null} [deployment] CreateDeploymentRequest deployment + */ + + /** + * Constructs a new CreateDeploymentRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a CreateDeploymentRequest. + * @implements ICreateDeploymentRequest + * @constructor + * @param {google.cloud.apihub.v1.ICreateDeploymentRequest=} [properties] Properties to set + */ + function CreateDeploymentRequest(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]]; + } + + /** + * CreateDeploymentRequest parent. + * @member {string} parent + * @memberof google.cloud.apihub.v1.CreateDeploymentRequest + * @instance + */ + CreateDeploymentRequest.prototype.parent = ""; + + /** + * CreateDeploymentRequest deploymentId. + * @member {string} deploymentId + * @memberof google.cloud.apihub.v1.CreateDeploymentRequest + * @instance + */ + CreateDeploymentRequest.prototype.deploymentId = ""; + + /** + * CreateDeploymentRequest deployment. + * @member {google.cloud.apihub.v1.IDeployment|null|undefined} deployment + * @memberof google.cloud.apihub.v1.CreateDeploymentRequest + * @instance + */ + CreateDeploymentRequest.prototype.deployment = null; + + /** + * Creates a new CreateDeploymentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.CreateDeploymentRequest + * @static + * @param {google.cloud.apihub.v1.ICreateDeploymentRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.CreateDeploymentRequest} CreateDeploymentRequest instance + */ + CreateDeploymentRequest.create = function create(properties) { + return new CreateDeploymentRequest(properties); + }; + + /** + * Encodes the specified CreateDeploymentRequest message. Does not implicitly {@link google.cloud.apihub.v1.CreateDeploymentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.CreateDeploymentRequest + * @static + * @param {google.cloud.apihub.v1.ICreateDeploymentRequest} message CreateDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateDeploymentRequest.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.deploymentId != null && Object.hasOwnProperty.call(message, "deploymentId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.deploymentId); + if (message.deployment != null && Object.hasOwnProperty.call(message, "deployment")) + $root.google.cloud.apihub.v1.Deployment.encode(message.deployment, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.CreateDeploymentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.CreateDeploymentRequest + * @static + * @param {google.cloud.apihub.v1.ICreateDeploymentRequest} message CreateDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateDeploymentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateDeploymentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.CreateDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.CreateDeploymentRequest} CreateDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateDeploymentRequest.decode = function 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.apihub.v1.CreateDeploymentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.deploymentId = reader.string(); + break; + } + case 3: { + message.deployment = $root.google.cloud.apihub.v1.Deployment.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateDeploymentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.CreateDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.CreateDeploymentRequest} CreateDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateDeploymentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateDeploymentRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.CreateDeploymentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateDeploymentRequest.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.deploymentId != null && message.hasOwnProperty("deploymentId")) + if (!$util.isString(message.deploymentId)) + return "deploymentId: string expected"; + if (message.deployment != null && message.hasOwnProperty("deployment")) { + var error = $root.google.cloud.apihub.v1.Deployment.verify(message.deployment); + if (error) + return "deployment." + error; + } + return null; + }; + + /** + * Creates a CreateDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.CreateDeploymentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.CreateDeploymentRequest} CreateDeploymentRequest + */ + CreateDeploymentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.CreateDeploymentRequest) + return object; + var message = new $root.google.cloud.apihub.v1.CreateDeploymentRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.deploymentId != null) + message.deploymentId = String(object.deploymentId); + if (object.deployment != null) { + if (typeof object.deployment !== "object") + throw TypeError(".google.cloud.apihub.v1.CreateDeploymentRequest.deployment: object expected"); + message.deployment = $root.google.cloud.apihub.v1.Deployment.fromObject(object.deployment); + } + return message; + }; + + /** + * Creates a plain object from a CreateDeploymentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.CreateDeploymentRequest + * @static + * @param {google.cloud.apihub.v1.CreateDeploymentRequest} message CreateDeploymentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateDeploymentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.deploymentId = ""; + object.deployment = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.deploymentId != null && message.hasOwnProperty("deploymentId")) + object.deploymentId = message.deploymentId; + if (message.deployment != null && message.hasOwnProperty("deployment")) + object.deployment = $root.google.cloud.apihub.v1.Deployment.toObject(message.deployment, options); + return object; + }; + + /** + * Converts this CreateDeploymentRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.CreateDeploymentRequest + * @instance + * @returns {Object.} JSON object + */ + CreateDeploymentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateDeploymentRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.CreateDeploymentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateDeploymentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.CreateDeploymentRequest"; + }; + + return CreateDeploymentRequest; + })(); + + v1.GetDeploymentRequest = (function() { + + /** + * Properties of a GetDeploymentRequest. + * @memberof google.cloud.apihub.v1 + * @interface IGetDeploymentRequest + * @property {string|null} [name] GetDeploymentRequest name + */ + + /** + * Constructs a new GetDeploymentRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a GetDeploymentRequest. + * @implements IGetDeploymentRequest + * @constructor + * @param {google.cloud.apihub.v1.IGetDeploymentRequest=} [properties] Properties to set + */ + function GetDeploymentRequest(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]]; + } + + /** + * GetDeploymentRequest name. + * @member {string} name + * @memberof google.cloud.apihub.v1.GetDeploymentRequest + * @instance + */ + GetDeploymentRequest.prototype.name = ""; + + /** + * Creates a new GetDeploymentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.GetDeploymentRequest + * @static + * @param {google.cloud.apihub.v1.IGetDeploymentRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.GetDeploymentRequest} GetDeploymentRequest instance + */ + GetDeploymentRequest.create = function create(properties) { + return new GetDeploymentRequest(properties); + }; + + /** + * Encodes the specified GetDeploymentRequest message. Does not implicitly {@link google.cloud.apihub.v1.GetDeploymentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.GetDeploymentRequest + * @static + * @param {google.cloud.apihub.v1.IGetDeploymentRequest} message GetDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDeploymentRequest.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 GetDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.GetDeploymentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.GetDeploymentRequest + * @static + * @param {google.cloud.apihub.v1.IGetDeploymentRequest} message GetDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDeploymentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDeploymentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.GetDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.GetDeploymentRequest} GetDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDeploymentRequest.decode = function 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.apihub.v1.GetDeploymentRequest(); + 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 GetDeploymentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.GetDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.GetDeploymentRequest} GetDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDeploymentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDeploymentRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.GetDeploymentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDeploymentRequest.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 GetDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.GetDeploymentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.GetDeploymentRequest} GetDeploymentRequest + */ + GetDeploymentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.GetDeploymentRequest) + return object; + var message = new $root.google.cloud.apihub.v1.GetDeploymentRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetDeploymentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.GetDeploymentRequest + * @static + * @param {google.cloud.apihub.v1.GetDeploymentRequest} message GetDeploymentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDeploymentRequest.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 GetDeploymentRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.GetDeploymentRequest + * @instance + * @returns {Object.} JSON object + */ + GetDeploymentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetDeploymentRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.GetDeploymentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetDeploymentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.GetDeploymentRequest"; + }; + + return GetDeploymentRequest; + })(); + + v1.UpdateDeploymentRequest = (function() { + + /** + * Properties of an UpdateDeploymentRequest. + * @memberof google.cloud.apihub.v1 + * @interface IUpdateDeploymentRequest + * @property {google.cloud.apihub.v1.IDeployment|null} [deployment] UpdateDeploymentRequest deployment + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateDeploymentRequest updateMask + */ + + /** + * Constructs a new UpdateDeploymentRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents an UpdateDeploymentRequest. + * @implements IUpdateDeploymentRequest + * @constructor + * @param {google.cloud.apihub.v1.IUpdateDeploymentRequest=} [properties] Properties to set + */ + function UpdateDeploymentRequest(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]]; + } + + /** + * UpdateDeploymentRequest deployment. + * @member {google.cloud.apihub.v1.IDeployment|null|undefined} deployment + * @memberof google.cloud.apihub.v1.UpdateDeploymentRequest + * @instance + */ + UpdateDeploymentRequest.prototype.deployment = null; + + /** + * UpdateDeploymentRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.apihub.v1.UpdateDeploymentRequest + * @instance + */ + UpdateDeploymentRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateDeploymentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.UpdateDeploymentRequest + * @static + * @param {google.cloud.apihub.v1.IUpdateDeploymentRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.UpdateDeploymentRequest} UpdateDeploymentRequest instance + */ + UpdateDeploymentRequest.create = function create(properties) { + return new UpdateDeploymentRequest(properties); + }; + + /** + * Encodes the specified UpdateDeploymentRequest message. Does not implicitly {@link google.cloud.apihub.v1.UpdateDeploymentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.UpdateDeploymentRequest + * @static + * @param {google.cloud.apihub.v1.IUpdateDeploymentRequest} message UpdateDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDeploymentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deployment != null && Object.hasOwnProperty.call(message, "deployment")) + $root.google.cloud.apihub.v1.Deployment.encode(message.deployment, 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 UpdateDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.UpdateDeploymentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.UpdateDeploymentRequest + * @static + * @param {google.cloud.apihub.v1.IUpdateDeploymentRequest} message UpdateDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDeploymentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateDeploymentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.UpdateDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.UpdateDeploymentRequest} UpdateDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDeploymentRequest.decode = function 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.apihub.v1.UpdateDeploymentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.deployment = $root.google.cloud.apihub.v1.Deployment.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 UpdateDeploymentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.UpdateDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.UpdateDeploymentRequest} UpdateDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDeploymentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateDeploymentRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.UpdateDeploymentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateDeploymentRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deployment != null && message.hasOwnProperty("deployment")) { + var error = $root.google.cloud.apihub.v1.Deployment.verify(message.deployment); + if (error) + return "deployment." + 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 UpdateDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.UpdateDeploymentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.UpdateDeploymentRequest} UpdateDeploymentRequest + */ + UpdateDeploymentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.UpdateDeploymentRequest) + return object; + var message = new $root.google.cloud.apihub.v1.UpdateDeploymentRequest(); + if (object.deployment != null) { + if (typeof object.deployment !== "object") + throw TypeError(".google.cloud.apihub.v1.UpdateDeploymentRequest.deployment: object expected"); + message.deployment = $root.google.cloud.apihub.v1.Deployment.fromObject(object.deployment); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.apihub.v1.UpdateDeploymentRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateDeploymentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.UpdateDeploymentRequest + * @static + * @param {google.cloud.apihub.v1.UpdateDeploymentRequest} message UpdateDeploymentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateDeploymentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.deployment = null; + object.updateMask = null; + } + if (message.deployment != null && message.hasOwnProperty("deployment")) + object.deployment = $root.google.cloud.apihub.v1.Deployment.toObject(message.deployment, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateDeploymentRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.UpdateDeploymentRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateDeploymentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateDeploymentRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.UpdateDeploymentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateDeploymentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.UpdateDeploymentRequest"; + }; + + return UpdateDeploymentRequest; + })(); + + v1.DeleteDeploymentRequest = (function() { + + /** + * Properties of a DeleteDeploymentRequest. + * @memberof google.cloud.apihub.v1 + * @interface IDeleteDeploymentRequest + * @property {string|null} [name] DeleteDeploymentRequest name + */ + + /** + * Constructs a new DeleteDeploymentRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a DeleteDeploymentRequest. + * @implements IDeleteDeploymentRequest + * @constructor + * @param {google.cloud.apihub.v1.IDeleteDeploymentRequest=} [properties] Properties to set + */ + function DeleteDeploymentRequest(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]]; + } + + /** + * DeleteDeploymentRequest name. + * @member {string} name + * @memberof google.cloud.apihub.v1.DeleteDeploymentRequest + * @instance + */ + DeleteDeploymentRequest.prototype.name = ""; + + /** + * Creates a new DeleteDeploymentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.DeleteDeploymentRequest + * @static + * @param {google.cloud.apihub.v1.IDeleteDeploymentRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.DeleteDeploymentRequest} DeleteDeploymentRequest instance + */ + DeleteDeploymentRequest.create = function create(properties) { + return new DeleteDeploymentRequest(properties); + }; + + /** + * Encodes the specified DeleteDeploymentRequest message. Does not implicitly {@link google.cloud.apihub.v1.DeleteDeploymentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.DeleteDeploymentRequest + * @static + * @param {google.cloud.apihub.v1.IDeleteDeploymentRequest} message DeleteDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteDeploymentRequest.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 DeleteDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.DeleteDeploymentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.DeleteDeploymentRequest + * @static + * @param {google.cloud.apihub.v1.IDeleteDeploymentRequest} message DeleteDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteDeploymentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteDeploymentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.DeleteDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.DeleteDeploymentRequest} DeleteDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteDeploymentRequest.decode = function 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.apihub.v1.DeleteDeploymentRequest(); + 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 DeleteDeploymentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.DeleteDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.DeleteDeploymentRequest} DeleteDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteDeploymentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteDeploymentRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.DeleteDeploymentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteDeploymentRequest.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 DeleteDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.DeleteDeploymentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.DeleteDeploymentRequest} DeleteDeploymentRequest + */ + DeleteDeploymentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.DeleteDeploymentRequest) + return object; + var message = new $root.google.cloud.apihub.v1.DeleteDeploymentRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteDeploymentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.DeleteDeploymentRequest + * @static + * @param {google.cloud.apihub.v1.DeleteDeploymentRequest} message DeleteDeploymentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteDeploymentRequest.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 DeleteDeploymentRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.DeleteDeploymentRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteDeploymentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteDeploymentRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.DeleteDeploymentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteDeploymentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.DeleteDeploymentRequest"; + }; + + return DeleteDeploymentRequest; + })(); + + v1.ListDeploymentsRequest = (function() { + + /** + * Properties of a ListDeploymentsRequest. + * @memberof google.cloud.apihub.v1 + * @interface IListDeploymentsRequest + * @property {string|null} [parent] ListDeploymentsRequest parent + * @property {string|null} [filter] ListDeploymentsRequest filter + * @property {number|null} [pageSize] ListDeploymentsRequest pageSize + * @property {string|null} [pageToken] ListDeploymentsRequest pageToken + */ + + /** + * Constructs a new ListDeploymentsRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a ListDeploymentsRequest. + * @implements IListDeploymentsRequest + * @constructor + * @param {google.cloud.apihub.v1.IListDeploymentsRequest=} [properties] Properties to set + */ + function ListDeploymentsRequest(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]]; + } + + /** + * ListDeploymentsRequest parent. + * @member {string} parent + * @memberof google.cloud.apihub.v1.ListDeploymentsRequest + * @instance + */ + ListDeploymentsRequest.prototype.parent = ""; + + /** + * ListDeploymentsRequest filter. + * @member {string} filter + * @memberof google.cloud.apihub.v1.ListDeploymentsRequest + * @instance + */ + ListDeploymentsRequest.prototype.filter = ""; + + /** + * ListDeploymentsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.apihub.v1.ListDeploymentsRequest + * @instance + */ + ListDeploymentsRequest.prototype.pageSize = 0; + + /** + * ListDeploymentsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.apihub.v1.ListDeploymentsRequest + * @instance + */ + ListDeploymentsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListDeploymentsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.ListDeploymentsRequest + * @static + * @param {google.cloud.apihub.v1.IListDeploymentsRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.ListDeploymentsRequest} ListDeploymentsRequest instance + */ + ListDeploymentsRequest.create = function create(properties) { + return new ListDeploymentsRequest(properties); + }; + + /** + * Encodes the specified ListDeploymentsRequest message. Does not implicitly {@link google.cloud.apihub.v1.ListDeploymentsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.ListDeploymentsRequest + * @static + * @param {google.cloud.apihub.v1.IListDeploymentsRequest} message ListDeploymentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDeploymentsRequest.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.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListDeploymentsRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListDeploymentsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.ListDeploymentsRequest + * @static + * @param {google.cloud.apihub.v1.IListDeploymentsRequest} message ListDeploymentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDeploymentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDeploymentsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.ListDeploymentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.ListDeploymentsRequest} ListDeploymentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDeploymentsRequest.decode = function 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.apihub.v1.ListDeploymentsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.filter = reader.string(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + case 4: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListDeploymentsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.ListDeploymentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.ListDeploymentsRequest} ListDeploymentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDeploymentsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDeploymentsRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.ListDeploymentsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDeploymentsRequest.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.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 ListDeploymentsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.ListDeploymentsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.ListDeploymentsRequest} ListDeploymentsRequest + */ + ListDeploymentsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.ListDeploymentsRequest) + return object; + var message = new $root.google.cloud.apihub.v1.ListDeploymentsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + 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 ListDeploymentsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.ListDeploymentsRequest + * @static + * @param {google.cloud.apihub.v1.ListDeploymentsRequest} message ListDeploymentsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDeploymentsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + 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; + return object; + }; + + /** + * Converts this ListDeploymentsRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.ListDeploymentsRequest + * @instance + * @returns {Object.} JSON object + */ + ListDeploymentsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListDeploymentsRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.ListDeploymentsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListDeploymentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.ListDeploymentsRequest"; + }; + + return ListDeploymentsRequest; + })(); + + v1.ListDeploymentsResponse = (function() { + + /** + * Properties of a ListDeploymentsResponse. + * @memberof google.cloud.apihub.v1 + * @interface IListDeploymentsResponse + * @property {Array.|null} [deployments] ListDeploymentsResponse deployments + * @property {string|null} [nextPageToken] ListDeploymentsResponse nextPageToken + */ + + /** + * Constructs a new ListDeploymentsResponse. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a ListDeploymentsResponse. + * @implements IListDeploymentsResponse + * @constructor + * @param {google.cloud.apihub.v1.IListDeploymentsResponse=} [properties] Properties to set + */ + function ListDeploymentsResponse(properties) { + this.deployments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListDeploymentsResponse deployments. + * @member {Array.} deployments + * @memberof google.cloud.apihub.v1.ListDeploymentsResponse + * @instance + */ + ListDeploymentsResponse.prototype.deployments = $util.emptyArray; + + /** + * ListDeploymentsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.apihub.v1.ListDeploymentsResponse + * @instance + */ + ListDeploymentsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListDeploymentsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.ListDeploymentsResponse + * @static + * @param {google.cloud.apihub.v1.IListDeploymentsResponse=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.ListDeploymentsResponse} ListDeploymentsResponse instance + */ + ListDeploymentsResponse.create = function create(properties) { + return new ListDeploymentsResponse(properties); + }; + + /** + * Encodes the specified ListDeploymentsResponse message. Does not implicitly {@link google.cloud.apihub.v1.ListDeploymentsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.ListDeploymentsResponse + * @static + * @param {google.cloud.apihub.v1.IListDeploymentsResponse} message ListDeploymentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDeploymentsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deployments != null && message.deployments.length) + for (var i = 0; i < message.deployments.length; ++i) + $root.google.cloud.apihub.v1.Deployment.encode(message.deployments[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 ListDeploymentsResponse message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListDeploymentsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.ListDeploymentsResponse + * @static + * @param {google.cloud.apihub.v1.IListDeploymentsResponse} message ListDeploymentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDeploymentsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDeploymentsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.ListDeploymentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.ListDeploymentsResponse} ListDeploymentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDeploymentsResponse.decode = function 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.apihub.v1.ListDeploymentsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.deployments && message.deployments.length)) + message.deployments = []; + message.deployments.push($root.google.cloud.apihub.v1.Deployment.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListDeploymentsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.ListDeploymentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.ListDeploymentsResponse} ListDeploymentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDeploymentsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDeploymentsResponse message. + * @function verify + * @memberof google.cloud.apihub.v1.ListDeploymentsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDeploymentsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deployments != null && message.hasOwnProperty("deployments")) { + if (!Array.isArray(message.deployments)) + return "deployments: array expected"; + for (var i = 0; i < message.deployments.length; ++i) { + var error = $root.google.cloud.apihub.v1.Deployment.verify(message.deployments[i]); + if (error) + return "deployments." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListDeploymentsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.ListDeploymentsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.ListDeploymentsResponse} ListDeploymentsResponse + */ + ListDeploymentsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.ListDeploymentsResponse) + return object; + var message = new $root.google.cloud.apihub.v1.ListDeploymentsResponse(); + if (object.deployments) { + if (!Array.isArray(object.deployments)) + throw TypeError(".google.cloud.apihub.v1.ListDeploymentsResponse.deployments: array expected"); + message.deployments = []; + for (var i = 0; i < object.deployments.length; ++i) { + if (typeof object.deployments[i] !== "object") + throw TypeError(".google.cloud.apihub.v1.ListDeploymentsResponse.deployments: object expected"); + message.deployments[i] = $root.google.cloud.apihub.v1.Deployment.fromObject(object.deployments[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListDeploymentsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.ListDeploymentsResponse + * @static + * @param {google.cloud.apihub.v1.ListDeploymentsResponse} message ListDeploymentsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDeploymentsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.deployments = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.deployments && message.deployments.length) { + object.deployments = []; + for (var j = 0; j < message.deployments.length; ++j) + object.deployments[j] = $root.google.cloud.apihub.v1.Deployment.toObject(message.deployments[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListDeploymentsResponse to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.ListDeploymentsResponse + * @instance + * @returns {Object.} JSON object + */ + ListDeploymentsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListDeploymentsResponse + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.ListDeploymentsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListDeploymentsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.ListDeploymentsResponse"; + }; + + return ListDeploymentsResponse; + })(); + + v1.CreateAttributeRequest = (function() { + + /** + * Properties of a CreateAttributeRequest. + * @memberof google.cloud.apihub.v1 + * @interface ICreateAttributeRequest + * @property {string|null} [parent] CreateAttributeRequest parent + * @property {string|null} [attributeId] CreateAttributeRequest attributeId + * @property {google.cloud.apihub.v1.IAttribute|null} [attribute] CreateAttributeRequest attribute + */ + + /** + * Constructs a new CreateAttributeRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a CreateAttributeRequest. + * @implements ICreateAttributeRequest + * @constructor + * @param {google.cloud.apihub.v1.ICreateAttributeRequest=} [properties] Properties to set + */ + function CreateAttributeRequest(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]]; + } + + /** + * CreateAttributeRequest parent. + * @member {string} parent + * @memberof google.cloud.apihub.v1.CreateAttributeRequest + * @instance + */ + CreateAttributeRequest.prototype.parent = ""; + + /** + * CreateAttributeRequest attributeId. + * @member {string} attributeId + * @memberof google.cloud.apihub.v1.CreateAttributeRequest + * @instance + */ + CreateAttributeRequest.prototype.attributeId = ""; + + /** + * CreateAttributeRequest attribute. + * @member {google.cloud.apihub.v1.IAttribute|null|undefined} attribute + * @memberof google.cloud.apihub.v1.CreateAttributeRequest + * @instance + */ + CreateAttributeRequest.prototype.attribute = null; + + /** + * Creates a new CreateAttributeRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.CreateAttributeRequest + * @static + * @param {google.cloud.apihub.v1.ICreateAttributeRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.CreateAttributeRequest} CreateAttributeRequest instance + */ + CreateAttributeRequest.create = function create(properties) { + return new CreateAttributeRequest(properties); + }; + + /** + * Encodes the specified CreateAttributeRequest message. Does not implicitly {@link google.cloud.apihub.v1.CreateAttributeRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.CreateAttributeRequest + * @static + * @param {google.cloud.apihub.v1.ICreateAttributeRequest} message CreateAttributeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateAttributeRequest.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.attributeId != null && Object.hasOwnProperty.call(message, "attributeId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.attributeId); + if (message.attribute != null && Object.hasOwnProperty.call(message, "attribute")) + $root.google.cloud.apihub.v1.Attribute.encode(message.attribute, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateAttributeRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.CreateAttributeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.CreateAttributeRequest + * @static + * @param {google.cloud.apihub.v1.ICreateAttributeRequest} message CreateAttributeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateAttributeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateAttributeRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.CreateAttributeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.CreateAttributeRequest} CreateAttributeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateAttributeRequest.decode = function 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.apihub.v1.CreateAttributeRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.attributeId = reader.string(); + break; + } + case 3: { + message.attribute = $root.google.cloud.apihub.v1.Attribute.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateAttributeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.CreateAttributeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.CreateAttributeRequest} CreateAttributeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateAttributeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateAttributeRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.CreateAttributeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateAttributeRequest.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.attributeId != null && message.hasOwnProperty("attributeId")) + if (!$util.isString(message.attributeId)) + return "attributeId: string expected"; + if (message.attribute != null && message.hasOwnProperty("attribute")) { + var error = $root.google.cloud.apihub.v1.Attribute.verify(message.attribute); + if (error) + return "attribute." + error; + } + return null; + }; + + /** + * Creates a CreateAttributeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.CreateAttributeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.CreateAttributeRequest} CreateAttributeRequest + */ + CreateAttributeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.CreateAttributeRequest) + return object; + var message = new $root.google.cloud.apihub.v1.CreateAttributeRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.attributeId != null) + message.attributeId = String(object.attributeId); + if (object.attribute != null) { + if (typeof object.attribute !== "object") + throw TypeError(".google.cloud.apihub.v1.CreateAttributeRequest.attribute: object expected"); + message.attribute = $root.google.cloud.apihub.v1.Attribute.fromObject(object.attribute); + } + return message; + }; + + /** + * Creates a plain object from a CreateAttributeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.CreateAttributeRequest + * @static + * @param {google.cloud.apihub.v1.CreateAttributeRequest} message CreateAttributeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateAttributeRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.attributeId = ""; + object.attribute = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.attributeId != null && message.hasOwnProperty("attributeId")) + object.attributeId = message.attributeId; + if (message.attribute != null && message.hasOwnProperty("attribute")) + object.attribute = $root.google.cloud.apihub.v1.Attribute.toObject(message.attribute, options); + return object; + }; + + /** + * Converts this CreateAttributeRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.CreateAttributeRequest + * @instance + * @returns {Object.} JSON object + */ + CreateAttributeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateAttributeRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.CreateAttributeRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateAttributeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.CreateAttributeRequest"; + }; + + return CreateAttributeRequest; + })(); + + v1.GetAttributeRequest = (function() { + + /** + * Properties of a GetAttributeRequest. + * @memberof google.cloud.apihub.v1 + * @interface IGetAttributeRequest + * @property {string|null} [name] GetAttributeRequest name + */ + + /** + * Constructs a new GetAttributeRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a GetAttributeRequest. + * @implements IGetAttributeRequest + * @constructor + * @param {google.cloud.apihub.v1.IGetAttributeRequest=} [properties] Properties to set + */ + function GetAttributeRequest(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]]; + } + + /** + * GetAttributeRequest name. + * @member {string} name + * @memberof google.cloud.apihub.v1.GetAttributeRequest + * @instance + */ + GetAttributeRequest.prototype.name = ""; + + /** + * Creates a new GetAttributeRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.GetAttributeRequest + * @static + * @param {google.cloud.apihub.v1.IGetAttributeRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.GetAttributeRequest} GetAttributeRequest instance + */ + GetAttributeRequest.create = function create(properties) { + return new GetAttributeRequest(properties); + }; + + /** + * Encodes the specified GetAttributeRequest message. Does not implicitly {@link google.cloud.apihub.v1.GetAttributeRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.GetAttributeRequest + * @static + * @param {google.cloud.apihub.v1.IGetAttributeRequest} message GetAttributeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetAttributeRequest.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 GetAttributeRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.GetAttributeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.GetAttributeRequest + * @static + * @param {google.cloud.apihub.v1.IGetAttributeRequest} message GetAttributeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetAttributeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetAttributeRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.GetAttributeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.GetAttributeRequest} GetAttributeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetAttributeRequest.decode = function 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.apihub.v1.GetAttributeRequest(); + 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 GetAttributeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.GetAttributeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.GetAttributeRequest} GetAttributeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetAttributeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetAttributeRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.GetAttributeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetAttributeRequest.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 GetAttributeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.GetAttributeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.GetAttributeRequest} GetAttributeRequest + */ + GetAttributeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.GetAttributeRequest) + return object; + var message = new $root.google.cloud.apihub.v1.GetAttributeRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetAttributeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.GetAttributeRequest + * @static + * @param {google.cloud.apihub.v1.GetAttributeRequest} message GetAttributeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetAttributeRequest.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 GetAttributeRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.GetAttributeRequest + * @instance + * @returns {Object.} JSON object + */ + GetAttributeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetAttributeRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.GetAttributeRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetAttributeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.GetAttributeRequest"; + }; + + return GetAttributeRequest; + })(); + + v1.UpdateAttributeRequest = (function() { + + /** + * Properties of an UpdateAttributeRequest. + * @memberof google.cloud.apihub.v1 + * @interface IUpdateAttributeRequest + * @property {google.cloud.apihub.v1.IAttribute|null} [attribute] UpdateAttributeRequest attribute + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateAttributeRequest updateMask + */ + + /** + * Constructs a new UpdateAttributeRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents an UpdateAttributeRequest. + * @implements IUpdateAttributeRequest + * @constructor + * @param {google.cloud.apihub.v1.IUpdateAttributeRequest=} [properties] Properties to set + */ + function UpdateAttributeRequest(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]]; + } + + /** + * UpdateAttributeRequest attribute. + * @member {google.cloud.apihub.v1.IAttribute|null|undefined} attribute + * @memberof google.cloud.apihub.v1.UpdateAttributeRequest + * @instance + */ + UpdateAttributeRequest.prototype.attribute = null; + + /** + * UpdateAttributeRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.apihub.v1.UpdateAttributeRequest + * @instance + */ + UpdateAttributeRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateAttributeRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.UpdateAttributeRequest + * @static + * @param {google.cloud.apihub.v1.IUpdateAttributeRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.UpdateAttributeRequest} UpdateAttributeRequest instance + */ + UpdateAttributeRequest.create = function create(properties) { + return new UpdateAttributeRequest(properties); + }; + + /** + * Encodes the specified UpdateAttributeRequest message. Does not implicitly {@link google.cloud.apihub.v1.UpdateAttributeRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.UpdateAttributeRequest + * @static + * @param {google.cloud.apihub.v1.IUpdateAttributeRequest} message UpdateAttributeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateAttributeRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.attribute != null && Object.hasOwnProperty.call(message, "attribute")) + $root.google.cloud.apihub.v1.Attribute.encode(message.attribute, 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 UpdateAttributeRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.UpdateAttributeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.UpdateAttributeRequest + * @static + * @param {google.cloud.apihub.v1.IUpdateAttributeRequest} message UpdateAttributeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateAttributeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateAttributeRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.UpdateAttributeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.UpdateAttributeRequest} UpdateAttributeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateAttributeRequest.decode = function 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.apihub.v1.UpdateAttributeRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.attribute = $root.google.cloud.apihub.v1.Attribute.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 UpdateAttributeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.UpdateAttributeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.UpdateAttributeRequest} UpdateAttributeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateAttributeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateAttributeRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.UpdateAttributeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateAttributeRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.attribute != null && message.hasOwnProperty("attribute")) { + var error = $root.google.cloud.apihub.v1.Attribute.verify(message.attribute); + if (error) + return "attribute." + 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 UpdateAttributeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.UpdateAttributeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.UpdateAttributeRequest} UpdateAttributeRequest + */ + UpdateAttributeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.UpdateAttributeRequest) + return object; + var message = new $root.google.cloud.apihub.v1.UpdateAttributeRequest(); + if (object.attribute != null) { + if (typeof object.attribute !== "object") + throw TypeError(".google.cloud.apihub.v1.UpdateAttributeRequest.attribute: object expected"); + message.attribute = $root.google.cloud.apihub.v1.Attribute.fromObject(object.attribute); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.apihub.v1.UpdateAttributeRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateAttributeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.UpdateAttributeRequest + * @static + * @param {google.cloud.apihub.v1.UpdateAttributeRequest} message UpdateAttributeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateAttributeRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.attribute = null; + object.updateMask = null; + } + if (message.attribute != null && message.hasOwnProperty("attribute")) + object.attribute = $root.google.cloud.apihub.v1.Attribute.toObject(message.attribute, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateAttributeRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.UpdateAttributeRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateAttributeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateAttributeRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.UpdateAttributeRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateAttributeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.UpdateAttributeRequest"; + }; + + return UpdateAttributeRequest; + })(); + + v1.DeleteAttributeRequest = (function() { + + /** + * Properties of a DeleteAttributeRequest. + * @memberof google.cloud.apihub.v1 + * @interface IDeleteAttributeRequest + * @property {string|null} [name] DeleteAttributeRequest name + */ + + /** + * Constructs a new DeleteAttributeRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a DeleteAttributeRequest. + * @implements IDeleteAttributeRequest + * @constructor + * @param {google.cloud.apihub.v1.IDeleteAttributeRequest=} [properties] Properties to set + */ + function DeleteAttributeRequest(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]]; + } + + /** + * DeleteAttributeRequest name. + * @member {string} name + * @memberof google.cloud.apihub.v1.DeleteAttributeRequest + * @instance + */ + DeleteAttributeRequest.prototype.name = ""; + + /** + * Creates a new DeleteAttributeRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.DeleteAttributeRequest + * @static + * @param {google.cloud.apihub.v1.IDeleteAttributeRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.DeleteAttributeRequest} DeleteAttributeRequest instance + */ + DeleteAttributeRequest.create = function create(properties) { + return new DeleteAttributeRequest(properties); + }; + + /** + * Encodes the specified DeleteAttributeRequest message. Does not implicitly {@link google.cloud.apihub.v1.DeleteAttributeRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.DeleteAttributeRequest + * @static + * @param {google.cloud.apihub.v1.IDeleteAttributeRequest} message DeleteAttributeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteAttributeRequest.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 DeleteAttributeRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.DeleteAttributeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.DeleteAttributeRequest + * @static + * @param {google.cloud.apihub.v1.IDeleteAttributeRequest} message DeleteAttributeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteAttributeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteAttributeRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.DeleteAttributeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.DeleteAttributeRequest} DeleteAttributeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteAttributeRequest.decode = function 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.apihub.v1.DeleteAttributeRequest(); + 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 DeleteAttributeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.DeleteAttributeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.DeleteAttributeRequest} DeleteAttributeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteAttributeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteAttributeRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.DeleteAttributeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteAttributeRequest.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 DeleteAttributeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.DeleteAttributeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.DeleteAttributeRequest} DeleteAttributeRequest + */ + DeleteAttributeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.DeleteAttributeRequest) + return object; + var message = new $root.google.cloud.apihub.v1.DeleteAttributeRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteAttributeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.DeleteAttributeRequest + * @static + * @param {google.cloud.apihub.v1.DeleteAttributeRequest} message DeleteAttributeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteAttributeRequest.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 DeleteAttributeRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.DeleteAttributeRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteAttributeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteAttributeRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.DeleteAttributeRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteAttributeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.DeleteAttributeRequest"; + }; + + return DeleteAttributeRequest; + })(); + + v1.ListAttributesRequest = (function() { + + /** + * Properties of a ListAttributesRequest. + * @memberof google.cloud.apihub.v1 + * @interface IListAttributesRequest + * @property {string|null} [parent] ListAttributesRequest parent + * @property {string|null} [filter] ListAttributesRequest filter + * @property {number|null} [pageSize] ListAttributesRequest pageSize + * @property {string|null} [pageToken] ListAttributesRequest pageToken + */ + + /** + * Constructs a new ListAttributesRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a ListAttributesRequest. + * @implements IListAttributesRequest + * @constructor + * @param {google.cloud.apihub.v1.IListAttributesRequest=} [properties] Properties to set + */ + function ListAttributesRequest(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]]; + } + + /** + * ListAttributesRequest parent. + * @member {string} parent + * @memberof google.cloud.apihub.v1.ListAttributesRequest + * @instance + */ + ListAttributesRequest.prototype.parent = ""; + + /** + * ListAttributesRequest filter. + * @member {string} filter + * @memberof google.cloud.apihub.v1.ListAttributesRequest + * @instance + */ + ListAttributesRequest.prototype.filter = ""; + + /** + * ListAttributesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.apihub.v1.ListAttributesRequest + * @instance + */ + ListAttributesRequest.prototype.pageSize = 0; + + /** + * ListAttributesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.apihub.v1.ListAttributesRequest + * @instance + */ + ListAttributesRequest.prototype.pageToken = ""; + + /** + * Creates a new ListAttributesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.ListAttributesRequest + * @static + * @param {google.cloud.apihub.v1.IListAttributesRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.ListAttributesRequest} ListAttributesRequest instance + */ + ListAttributesRequest.create = function create(properties) { + return new ListAttributesRequest(properties); + }; + + /** + * Encodes the specified ListAttributesRequest message. Does not implicitly {@link google.cloud.apihub.v1.ListAttributesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.ListAttributesRequest + * @static + * @param {google.cloud.apihub.v1.IListAttributesRequest} message ListAttributesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAttributesRequest.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.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListAttributesRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListAttributesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.ListAttributesRequest + * @static + * @param {google.cloud.apihub.v1.IListAttributesRequest} message ListAttributesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAttributesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAttributesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.ListAttributesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.ListAttributesRequest} ListAttributesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAttributesRequest.decode = function 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.apihub.v1.ListAttributesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.filter = reader.string(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + case 4: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAttributesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.ListAttributesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.ListAttributesRequest} ListAttributesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAttributesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAttributesRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.ListAttributesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAttributesRequest.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.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 ListAttributesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.ListAttributesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.ListAttributesRequest} ListAttributesRequest + */ + ListAttributesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.ListAttributesRequest) + return object; + var message = new $root.google.cloud.apihub.v1.ListAttributesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + 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 ListAttributesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.ListAttributesRequest + * @static + * @param {google.cloud.apihub.v1.ListAttributesRequest} message ListAttributesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAttributesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + 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; + return object; + }; + + /** + * Converts this ListAttributesRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.ListAttributesRequest + * @instance + * @returns {Object.} JSON object + */ + ListAttributesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListAttributesRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.ListAttributesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAttributesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.ListAttributesRequest"; + }; + + return ListAttributesRequest; + })(); + + v1.ListAttributesResponse = (function() { + + /** + * Properties of a ListAttributesResponse. + * @memberof google.cloud.apihub.v1 + * @interface IListAttributesResponse + * @property {Array.|null} [attributes] ListAttributesResponse attributes + * @property {string|null} [nextPageToken] ListAttributesResponse nextPageToken + */ + + /** + * Constructs a new ListAttributesResponse. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a ListAttributesResponse. + * @implements IListAttributesResponse + * @constructor + * @param {google.cloud.apihub.v1.IListAttributesResponse=} [properties] Properties to set + */ + function ListAttributesResponse(properties) { + this.attributes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListAttributesResponse attributes. + * @member {Array.} attributes + * @memberof google.cloud.apihub.v1.ListAttributesResponse + * @instance + */ + ListAttributesResponse.prototype.attributes = $util.emptyArray; + + /** + * ListAttributesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.apihub.v1.ListAttributesResponse + * @instance + */ + ListAttributesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListAttributesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.ListAttributesResponse + * @static + * @param {google.cloud.apihub.v1.IListAttributesResponse=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.ListAttributesResponse} ListAttributesResponse instance + */ + ListAttributesResponse.create = function create(properties) { + return new ListAttributesResponse(properties); + }; + + /** + * Encodes the specified ListAttributesResponse message. Does not implicitly {@link google.cloud.apihub.v1.ListAttributesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.ListAttributesResponse + * @static + * @param {google.cloud.apihub.v1.IListAttributesResponse} message ListAttributesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAttributesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.attributes != null && message.attributes.length) + for (var i = 0; i < message.attributes.length; ++i) + $root.google.cloud.apihub.v1.Attribute.encode(message.attributes[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 ListAttributesResponse message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListAttributesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.ListAttributesResponse + * @static + * @param {google.cloud.apihub.v1.IListAttributesResponse} message ListAttributesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAttributesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAttributesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.ListAttributesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.ListAttributesResponse} ListAttributesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAttributesResponse.decode = function 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.apihub.v1.ListAttributesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.attributes && message.attributes.length)) + message.attributes = []; + message.attributes.push($root.google.cloud.apihub.v1.Attribute.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAttributesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.ListAttributesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.ListAttributesResponse} ListAttributesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAttributesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAttributesResponse message. + * @function verify + * @memberof google.cloud.apihub.v1.ListAttributesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAttributesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.attributes != null && message.hasOwnProperty("attributes")) { + if (!Array.isArray(message.attributes)) + return "attributes: array expected"; + for (var i = 0; i < message.attributes.length; ++i) { + var error = $root.google.cloud.apihub.v1.Attribute.verify(message.attributes[i]); + if (error) + return "attributes." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListAttributesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.ListAttributesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.ListAttributesResponse} ListAttributesResponse + */ + ListAttributesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.ListAttributesResponse) + return object; + var message = new $root.google.cloud.apihub.v1.ListAttributesResponse(); + if (object.attributes) { + if (!Array.isArray(object.attributes)) + throw TypeError(".google.cloud.apihub.v1.ListAttributesResponse.attributes: array expected"); + message.attributes = []; + for (var i = 0; i < object.attributes.length; ++i) { + if (typeof object.attributes[i] !== "object") + throw TypeError(".google.cloud.apihub.v1.ListAttributesResponse.attributes: object expected"); + message.attributes[i] = $root.google.cloud.apihub.v1.Attribute.fromObject(object.attributes[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListAttributesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.ListAttributesResponse + * @static + * @param {google.cloud.apihub.v1.ListAttributesResponse} message ListAttributesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAttributesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.attributes = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.attributes && message.attributes.length) { + object.attributes = []; + for (var j = 0; j < message.attributes.length; ++j) + object.attributes[j] = $root.google.cloud.apihub.v1.Attribute.toObject(message.attributes[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListAttributesResponse to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.ListAttributesResponse + * @instance + * @returns {Object.} JSON object + */ + ListAttributesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListAttributesResponse + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.ListAttributesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAttributesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.ListAttributesResponse"; + }; + + return ListAttributesResponse; + })(); + + v1.SearchResourcesRequest = (function() { + + /** + * Properties of a SearchResourcesRequest. + * @memberof google.cloud.apihub.v1 + * @interface ISearchResourcesRequest + * @property {string|null} [location] SearchResourcesRequest location + * @property {string|null} [query] SearchResourcesRequest query + * @property {string|null} [filter] SearchResourcesRequest filter + * @property {number|null} [pageSize] SearchResourcesRequest pageSize + * @property {string|null} [pageToken] SearchResourcesRequest pageToken + */ + + /** + * Constructs a new SearchResourcesRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a SearchResourcesRequest. + * @implements ISearchResourcesRequest + * @constructor + * @param {google.cloud.apihub.v1.ISearchResourcesRequest=} [properties] Properties to set + */ + function SearchResourcesRequest(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]]; + } + + /** + * SearchResourcesRequest location. + * @member {string} location + * @memberof google.cloud.apihub.v1.SearchResourcesRequest + * @instance + */ + SearchResourcesRequest.prototype.location = ""; + + /** + * SearchResourcesRequest query. + * @member {string} query + * @memberof google.cloud.apihub.v1.SearchResourcesRequest + * @instance + */ + SearchResourcesRequest.prototype.query = ""; + + /** + * SearchResourcesRequest filter. + * @member {string} filter + * @memberof google.cloud.apihub.v1.SearchResourcesRequest + * @instance + */ + SearchResourcesRequest.prototype.filter = ""; + + /** + * SearchResourcesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.apihub.v1.SearchResourcesRequest + * @instance + */ + SearchResourcesRequest.prototype.pageSize = 0; + + /** + * SearchResourcesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.apihub.v1.SearchResourcesRequest + * @instance + */ + SearchResourcesRequest.prototype.pageToken = ""; + + /** + * Creates a new SearchResourcesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.SearchResourcesRequest + * @static + * @param {google.cloud.apihub.v1.ISearchResourcesRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.SearchResourcesRequest} SearchResourcesRequest instance + */ + SearchResourcesRequest.create = function create(properties) { + return new SearchResourcesRequest(properties); + }; + + /** + * Encodes the specified SearchResourcesRequest message. Does not implicitly {@link google.cloud.apihub.v1.SearchResourcesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.SearchResourcesRequest + * @static + * @param {google.cloud.apihub.v1.ISearchResourcesRequest} message SearchResourcesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchResourcesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.location); + if (message.query != null && Object.hasOwnProperty.call(message, "query")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.query); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified SearchResourcesRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.SearchResourcesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.SearchResourcesRequest + * @static + * @param {google.cloud.apihub.v1.ISearchResourcesRequest} message SearchResourcesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchResourcesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SearchResourcesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.SearchResourcesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.SearchResourcesRequest} SearchResourcesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchResourcesRequest.decode = function 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.apihub.v1.SearchResourcesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.location = reader.string(); + break; + } + case 2: { + message.query = reader.string(); + break; + } + case 3: { + message.filter = reader.string(); + break; + } + case 4: { + message.pageSize = reader.int32(); + break; + } + case 5: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SearchResourcesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.SearchResourcesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.SearchResourcesRequest} SearchResourcesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchResourcesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SearchResourcesRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.SearchResourcesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SearchResourcesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + if (message.query != null && message.hasOwnProperty("query")) + if (!$util.isString(message.query)) + return "query: 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 SearchResourcesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.SearchResourcesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.SearchResourcesRequest} SearchResourcesRequest + */ + SearchResourcesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.SearchResourcesRequest) + return object; + var message = new $root.google.cloud.apihub.v1.SearchResourcesRequest(); + if (object.location != null) + message.location = String(object.location); + if (object.query != null) + message.query = String(object.query); + 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 SearchResourcesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.SearchResourcesRequest + * @static + * @param {google.cloud.apihub.v1.SearchResourcesRequest} message SearchResourcesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SearchResourcesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.location = ""; + object.query = ""; + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + if (message.query != null && message.hasOwnProperty("query")) + object.query = message.query; + 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; + return object; + }; + + /** + * Converts this SearchResourcesRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.SearchResourcesRequest + * @instance + * @returns {Object.} JSON object + */ + SearchResourcesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SearchResourcesRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.SearchResourcesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SearchResourcesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.SearchResourcesRequest"; + }; + + return SearchResourcesRequest; + })(); + + v1.ApiHubResource = (function() { + + /** + * Properties of an ApiHubResource. + * @memberof google.cloud.apihub.v1 + * @interface IApiHubResource + * @property {google.cloud.apihub.v1.IApi|null} [api] ApiHubResource api + * @property {google.cloud.apihub.v1.IApiOperation|null} [operation] ApiHubResource operation + * @property {google.cloud.apihub.v1.IDeployment|null} [deployment] ApiHubResource deployment + * @property {google.cloud.apihub.v1.ISpec|null} [spec] ApiHubResource spec + * @property {google.cloud.apihub.v1.IDefinition|null} [definition] ApiHubResource definition + * @property {google.cloud.apihub.v1.IVersion|null} [version] ApiHubResource version + */ + + /** + * Constructs a new ApiHubResource. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents an ApiHubResource. + * @implements IApiHubResource + * @constructor + * @param {google.cloud.apihub.v1.IApiHubResource=} [properties] Properties to set + */ + function ApiHubResource(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]]; + } + + /** + * ApiHubResource api. + * @member {google.cloud.apihub.v1.IApi|null|undefined} api + * @memberof google.cloud.apihub.v1.ApiHubResource + * @instance + */ + ApiHubResource.prototype.api = null; + + /** + * ApiHubResource operation. + * @member {google.cloud.apihub.v1.IApiOperation|null|undefined} operation + * @memberof google.cloud.apihub.v1.ApiHubResource + * @instance + */ + ApiHubResource.prototype.operation = null; + + /** + * ApiHubResource deployment. + * @member {google.cloud.apihub.v1.IDeployment|null|undefined} deployment + * @memberof google.cloud.apihub.v1.ApiHubResource + * @instance + */ + ApiHubResource.prototype.deployment = null; + + /** + * ApiHubResource spec. + * @member {google.cloud.apihub.v1.ISpec|null|undefined} spec + * @memberof google.cloud.apihub.v1.ApiHubResource + * @instance + */ + ApiHubResource.prototype.spec = null; + + /** + * ApiHubResource definition. + * @member {google.cloud.apihub.v1.IDefinition|null|undefined} definition + * @memberof google.cloud.apihub.v1.ApiHubResource + * @instance + */ + ApiHubResource.prototype.definition = null; + + /** + * ApiHubResource version. + * @member {google.cloud.apihub.v1.IVersion|null|undefined} version + * @memberof google.cloud.apihub.v1.ApiHubResource + * @instance + */ + ApiHubResource.prototype.version = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ApiHubResource resource. + * @member {"api"|"operation"|"deployment"|"spec"|"definition"|"version"|undefined} resource + * @memberof google.cloud.apihub.v1.ApiHubResource + * @instance + */ + Object.defineProperty(ApiHubResource.prototype, "resource", { + get: $util.oneOfGetter($oneOfFields = ["api", "operation", "deployment", "spec", "definition", "version"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ApiHubResource instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.ApiHubResource + * @static + * @param {google.cloud.apihub.v1.IApiHubResource=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.ApiHubResource} ApiHubResource instance + */ + ApiHubResource.create = function create(properties) { + return new ApiHubResource(properties); + }; + + /** + * Encodes the specified ApiHubResource message. Does not implicitly {@link google.cloud.apihub.v1.ApiHubResource.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.ApiHubResource + * @static + * @param {google.cloud.apihub.v1.IApiHubResource} message ApiHubResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApiHubResource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.api != null && Object.hasOwnProperty.call(message, "api")) + $root.google.cloud.apihub.v1.Api.encode(message.api, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.operation != null && Object.hasOwnProperty.call(message, "operation")) + $root.google.cloud.apihub.v1.ApiOperation.encode(message.operation, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.deployment != null && Object.hasOwnProperty.call(message, "deployment")) + $root.google.cloud.apihub.v1.Deployment.encode(message.deployment, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.spec != null && Object.hasOwnProperty.call(message, "spec")) + $root.google.cloud.apihub.v1.Spec.encode(message.spec, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.definition != null && Object.hasOwnProperty.call(message, "definition")) + $root.google.cloud.apihub.v1.Definition.encode(message.definition, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + $root.google.cloud.apihub.v1.Version.encode(message.version, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ApiHubResource message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ApiHubResource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.ApiHubResource + * @static + * @param {google.cloud.apihub.v1.IApiHubResource} message ApiHubResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApiHubResource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ApiHubResource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.ApiHubResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.ApiHubResource} ApiHubResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApiHubResource.decode = function 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.apihub.v1.ApiHubResource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.api = $root.google.cloud.apihub.v1.Api.decode(reader, reader.uint32()); + break; + } + case 2: { + message.operation = $root.google.cloud.apihub.v1.ApiOperation.decode(reader, reader.uint32()); + break; + } + case 3: { + message.deployment = $root.google.cloud.apihub.v1.Deployment.decode(reader, reader.uint32()); + break; + } + case 4: { + message.spec = $root.google.cloud.apihub.v1.Spec.decode(reader, reader.uint32()); + break; + } + case 5: { + message.definition = $root.google.cloud.apihub.v1.Definition.decode(reader, reader.uint32()); + break; + } + case 6: { + message.version = $root.google.cloud.apihub.v1.Version.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ApiHubResource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.ApiHubResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.ApiHubResource} ApiHubResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApiHubResource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ApiHubResource message. + * @function verify + * @memberof google.cloud.apihub.v1.ApiHubResource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ApiHubResource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.api != null && message.hasOwnProperty("api")) { + properties.resource = 1; + { + var error = $root.google.cloud.apihub.v1.Api.verify(message.api); + if (error) + return "api." + error; + } + } + if (message.operation != null && message.hasOwnProperty("operation")) { + if (properties.resource === 1) + return "resource: multiple values"; + properties.resource = 1; + { + var error = $root.google.cloud.apihub.v1.ApiOperation.verify(message.operation); + if (error) + return "operation." + error; + } + } + if (message.deployment != null && message.hasOwnProperty("deployment")) { + if (properties.resource === 1) + return "resource: multiple values"; + properties.resource = 1; + { + var error = $root.google.cloud.apihub.v1.Deployment.verify(message.deployment); + if (error) + return "deployment." + error; + } + } + if (message.spec != null && message.hasOwnProperty("spec")) { + if (properties.resource === 1) + return "resource: multiple values"; + properties.resource = 1; + { + var error = $root.google.cloud.apihub.v1.Spec.verify(message.spec); + if (error) + return "spec." + error; + } + } + if (message.definition != null && message.hasOwnProperty("definition")) { + if (properties.resource === 1) + return "resource: multiple values"; + properties.resource = 1; + { + var error = $root.google.cloud.apihub.v1.Definition.verify(message.definition); + if (error) + return "definition." + error; + } + } + if (message.version != null && message.hasOwnProperty("version")) { + if (properties.resource === 1) + return "resource: multiple values"; + properties.resource = 1; + { + var error = $root.google.cloud.apihub.v1.Version.verify(message.version); + if (error) + return "version." + error; + } + } + return null; + }; + + /** + * Creates an ApiHubResource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.ApiHubResource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.ApiHubResource} ApiHubResource + */ + ApiHubResource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.ApiHubResource) + return object; + var message = new $root.google.cloud.apihub.v1.ApiHubResource(); + if (object.api != null) { + if (typeof object.api !== "object") + throw TypeError(".google.cloud.apihub.v1.ApiHubResource.api: object expected"); + message.api = $root.google.cloud.apihub.v1.Api.fromObject(object.api); + } + if (object.operation != null) { + if (typeof object.operation !== "object") + throw TypeError(".google.cloud.apihub.v1.ApiHubResource.operation: object expected"); + message.operation = $root.google.cloud.apihub.v1.ApiOperation.fromObject(object.operation); + } + if (object.deployment != null) { + if (typeof object.deployment !== "object") + throw TypeError(".google.cloud.apihub.v1.ApiHubResource.deployment: object expected"); + message.deployment = $root.google.cloud.apihub.v1.Deployment.fromObject(object.deployment); + } + if (object.spec != null) { + if (typeof object.spec !== "object") + throw TypeError(".google.cloud.apihub.v1.ApiHubResource.spec: object expected"); + message.spec = $root.google.cloud.apihub.v1.Spec.fromObject(object.spec); + } + if (object.definition != null) { + if (typeof object.definition !== "object") + throw TypeError(".google.cloud.apihub.v1.ApiHubResource.definition: object expected"); + message.definition = $root.google.cloud.apihub.v1.Definition.fromObject(object.definition); + } + if (object.version != null) { + if (typeof object.version !== "object") + throw TypeError(".google.cloud.apihub.v1.ApiHubResource.version: object expected"); + message.version = $root.google.cloud.apihub.v1.Version.fromObject(object.version); + } + return message; + }; + + /** + * Creates a plain object from an ApiHubResource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.ApiHubResource + * @static + * @param {google.cloud.apihub.v1.ApiHubResource} message ApiHubResource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ApiHubResource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.api != null && message.hasOwnProperty("api")) { + object.api = $root.google.cloud.apihub.v1.Api.toObject(message.api, options); + if (options.oneofs) + object.resource = "api"; + } + if (message.operation != null && message.hasOwnProperty("operation")) { + object.operation = $root.google.cloud.apihub.v1.ApiOperation.toObject(message.operation, options); + if (options.oneofs) + object.resource = "operation"; + } + if (message.deployment != null && message.hasOwnProperty("deployment")) { + object.deployment = $root.google.cloud.apihub.v1.Deployment.toObject(message.deployment, options); + if (options.oneofs) + object.resource = "deployment"; + } + if (message.spec != null && message.hasOwnProperty("spec")) { + object.spec = $root.google.cloud.apihub.v1.Spec.toObject(message.spec, options); + if (options.oneofs) + object.resource = "spec"; + } + if (message.definition != null && message.hasOwnProperty("definition")) { + object.definition = $root.google.cloud.apihub.v1.Definition.toObject(message.definition, options); + if (options.oneofs) + object.resource = "definition"; + } + if (message.version != null && message.hasOwnProperty("version")) { + object.version = $root.google.cloud.apihub.v1.Version.toObject(message.version, options); + if (options.oneofs) + object.resource = "version"; + } + return object; + }; + + /** + * Converts this ApiHubResource to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.ApiHubResource + * @instance + * @returns {Object.} JSON object + */ + ApiHubResource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ApiHubResource + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.ApiHubResource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ApiHubResource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.ApiHubResource"; + }; + + return ApiHubResource; + })(); + + v1.SearchResult = (function() { + + /** + * Properties of a SearchResult. + * @memberof google.cloud.apihub.v1 + * @interface ISearchResult + * @property {google.cloud.apihub.v1.IApiHubResource|null} [resource] SearchResult resource + */ + + /** + * Constructs a new SearchResult. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a SearchResult. + * @implements ISearchResult + * @constructor + * @param {google.cloud.apihub.v1.ISearchResult=} [properties] Properties to set + */ + function SearchResult(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]]; + } + + /** + * SearchResult resource. + * @member {google.cloud.apihub.v1.IApiHubResource|null|undefined} resource + * @memberof google.cloud.apihub.v1.SearchResult + * @instance + */ + SearchResult.prototype.resource = null; + + /** + * Creates a new SearchResult instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.SearchResult + * @static + * @param {google.cloud.apihub.v1.ISearchResult=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.SearchResult} SearchResult instance + */ + SearchResult.create = function create(properties) { + return new SearchResult(properties); + }; + + /** + * Encodes the specified SearchResult message. Does not implicitly {@link google.cloud.apihub.v1.SearchResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.SearchResult + * @static + * @param {google.cloud.apihub.v1.ISearchResult} message SearchResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + $root.google.cloud.apihub.v1.ApiHubResource.encode(message.resource, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SearchResult message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.SearchResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.SearchResult + * @static + * @param {google.cloud.apihub.v1.ISearchResult} message SearchResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SearchResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.SearchResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.SearchResult} SearchResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchResult.decode = function 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.apihub.v1.SearchResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.resource = $root.google.cloud.apihub.v1.ApiHubResource.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SearchResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.SearchResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.SearchResult} SearchResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SearchResult message. + * @function verify + * @memberof google.cloud.apihub.v1.SearchResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SearchResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resource != null && message.hasOwnProperty("resource")) { + var error = $root.google.cloud.apihub.v1.ApiHubResource.verify(message.resource); + if (error) + return "resource." + error; + } + return null; + }; + + /** + * Creates a SearchResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.SearchResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.SearchResult} SearchResult + */ + SearchResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.SearchResult) + return object; + var message = new $root.google.cloud.apihub.v1.SearchResult(); + if (object.resource != null) { + if (typeof object.resource !== "object") + throw TypeError(".google.cloud.apihub.v1.SearchResult.resource: object expected"); + message.resource = $root.google.cloud.apihub.v1.ApiHubResource.fromObject(object.resource); + } + return message; + }; + + /** + * Creates a plain object from a SearchResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.SearchResult + * @static + * @param {google.cloud.apihub.v1.SearchResult} message SearchResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SearchResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.resource = null; + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = $root.google.cloud.apihub.v1.ApiHubResource.toObject(message.resource, options); + return object; + }; + + /** + * Converts this SearchResult to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.SearchResult + * @instance + * @returns {Object.} JSON object + */ + SearchResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SearchResult + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.SearchResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SearchResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.SearchResult"; + }; + + return SearchResult; + })(); + + v1.SearchResourcesResponse = (function() { + + /** + * Properties of a SearchResourcesResponse. + * @memberof google.cloud.apihub.v1 + * @interface ISearchResourcesResponse + * @property {Array.|null} [searchResults] SearchResourcesResponse searchResults + * @property {string|null} [nextPageToken] SearchResourcesResponse nextPageToken + */ + + /** + * Constructs a new SearchResourcesResponse. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a SearchResourcesResponse. + * @implements ISearchResourcesResponse + * @constructor + * @param {google.cloud.apihub.v1.ISearchResourcesResponse=} [properties] Properties to set + */ + function SearchResourcesResponse(properties) { + this.searchResults = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SearchResourcesResponse searchResults. + * @member {Array.} searchResults + * @memberof google.cloud.apihub.v1.SearchResourcesResponse + * @instance + */ + SearchResourcesResponse.prototype.searchResults = $util.emptyArray; + + /** + * SearchResourcesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.apihub.v1.SearchResourcesResponse + * @instance + */ + SearchResourcesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new SearchResourcesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.SearchResourcesResponse + * @static + * @param {google.cloud.apihub.v1.ISearchResourcesResponse=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.SearchResourcesResponse} SearchResourcesResponse instance + */ + SearchResourcesResponse.create = function create(properties) { + return new SearchResourcesResponse(properties); + }; + + /** + * Encodes the specified SearchResourcesResponse message. Does not implicitly {@link google.cloud.apihub.v1.SearchResourcesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.SearchResourcesResponse + * @static + * @param {google.cloud.apihub.v1.ISearchResourcesResponse} message SearchResourcesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchResourcesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.searchResults != null && message.searchResults.length) + for (var i = 0; i < message.searchResults.length; ++i) + $root.google.cloud.apihub.v1.SearchResult.encode(message.searchResults[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 SearchResourcesResponse message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.SearchResourcesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.SearchResourcesResponse + * @static + * @param {google.cloud.apihub.v1.ISearchResourcesResponse} message SearchResourcesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchResourcesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SearchResourcesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.SearchResourcesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.SearchResourcesResponse} SearchResourcesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchResourcesResponse.decode = function 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.apihub.v1.SearchResourcesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.searchResults && message.searchResults.length)) + message.searchResults = []; + message.searchResults.push($root.google.cloud.apihub.v1.SearchResult.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SearchResourcesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.SearchResourcesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.SearchResourcesResponse} SearchResourcesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchResourcesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SearchResourcesResponse message. + * @function verify + * @memberof google.cloud.apihub.v1.SearchResourcesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SearchResourcesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.searchResults != null && message.hasOwnProperty("searchResults")) { + if (!Array.isArray(message.searchResults)) + return "searchResults: array expected"; + for (var i = 0; i < message.searchResults.length; ++i) { + var error = $root.google.cloud.apihub.v1.SearchResult.verify(message.searchResults[i]); + if (error) + return "searchResults." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a SearchResourcesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.SearchResourcesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.SearchResourcesResponse} SearchResourcesResponse + */ + SearchResourcesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.SearchResourcesResponse) + return object; + var message = new $root.google.cloud.apihub.v1.SearchResourcesResponse(); + if (object.searchResults) { + if (!Array.isArray(object.searchResults)) + throw TypeError(".google.cloud.apihub.v1.SearchResourcesResponse.searchResults: array expected"); + message.searchResults = []; + for (var i = 0; i < object.searchResults.length; ++i) { + if (typeof object.searchResults[i] !== "object") + throw TypeError(".google.cloud.apihub.v1.SearchResourcesResponse.searchResults: object expected"); + message.searchResults[i] = $root.google.cloud.apihub.v1.SearchResult.fromObject(object.searchResults[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a SearchResourcesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.SearchResourcesResponse + * @static + * @param {google.cloud.apihub.v1.SearchResourcesResponse} message SearchResourcesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SearchResourcesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.searchResults = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.searchResults && message.searchResults.length) { + object.searchResults = []; + for (var j = 0; j < message.searchResults.length; ++j) + object.searchResults[j] = $root.google.cloud.apihub.v1.SearchResult.toObject(message.searchResults[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this SearchResourcesResponse to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.SearchResourcesResponse + * @instance + * @returns {Object.} JSON object + */ + SearchResourcesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SearchResourcesResponse + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.SearchResourcesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SearchResourcesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.SearchResourcesResponse"; + }; + + return SearchResourcesResponse; + })(); + + v1.CreateDependencyRequest = (function() { + + /** + * Properties of a CreateDependencyRequest. + * @memberof google.cloud.apihub.v1 + * @interface ICreateDependencyRequest + * @property {string|null} [parent] CreateDependencyRequest parent + * @property {string|null} [dependencyId] CreateDependencyRequest dependencyId + * @property {google.cloud.apihub.v1.IDependency|null} [dependency] CreateDependencyRequest dependency + */ + + /** + * Constructs a new CreateDependencyRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a CreateDependencyRequest. + * @implements ICreateDependencyRequest + * @constructor + * @param {google.cloud.apihub.v1.ICreateDependencyRequest=} [properties] Properties to set + */ + function CreateDependencyRequest(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]]; + } + + /** + * CreateDependencyRequest parent. + * @member {string} parent + * @memberof google.cloud.apihub.v1.CreateDependencyRequest + * @instance + */ + CreateDependencyRequest.prototype.parent = ""; + + /** + * CreateDependencyRequest dependencyId. + * @member {string} dependencyId + * @memberof google.cloud.apihub.v1.CreateDependencyRequest + * @instance + */ + CreateDependencyRequest.prototype.dependencyId = ""; + + /** + * CreateDependencyRequest dependency. + * @member {google.cloud.apihub.v1.IDependency|null|undefined} dependency + * @memberof google.cloud.apihub.v1.CreateDependencyRequest + * @instance + */ + CreateDependencyRequest.prototype.dependency = null; + + /** + * Creates a new CreateDependencyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.CreateDependencyRequest + * @static + * @param {google.cloud.apihub.v1.ICreateDependencyRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.CreateDependencyRequest} CreateDependencyRequest instance + */ + CreateDependencyRequest.create = function create(properties) { + return new CreateDependencyRequest(properties); + }; + + /** + * Encodes the specified CreateDependencyRequest message. Does not implicitly {@link google.cloud.apihub.v1.CreateDependencyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.CreateDependencyRequest + * @static + * @param {google.cloud.apihub.v1.ICreateDependencyRequest} message CreateDependencyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateDependencyRequest.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.dependencyId != null && Object.hasOwnProperty.call(message, "dependencyId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.dependencyId); + if (message.dependency != null && Object.hasOwnProperty.call(message, "dependency")) + $root.google.cloud.apihub.v1.Dependency.encode(message.dependency, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateDependencyRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.CreateDependencyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.CreateDependencyRequest + * @static + * @param {google.cloud.apihub.v1.ICreateDependencyRequest} message CreateDependencyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateDependencyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateDependencyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.CreateDependencyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.CreateDependencyRequest} CreateDependencyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateDependencyRequest.decode = function 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.apihub.v1.CreateDependencyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.dependencyId = reader.string(); + break; + } + case 3: { + message.dependency = $root.google.cloud.apihub.v1.Dependency.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateDependencyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.CreateDependencyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.CreateDependencyRequest} CreateDependencyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateDependencyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateDependencyRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.CreateDependencyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateDependencyRequest.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.dependencyId != null && message.hasOwnProperty("dependencyId")) + if (!$util.isString(message.dependencyId)) + return "dependencyId: string expected"; + if (message.dependency != null && message.hasOwnProperty("dependency")) { + var error = $root.google.cloud.apihub.v1.Dependency.verify(message.dependency); + if (error) + return "dependency." + error; + } + return null; + }; + + /** + * Creates a CreateDependencyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.CreateDependencyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.CreateDependencyRequest} CreateDependencyRequest + */ + CreateDependencyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.CreateDependencyRequest) + return object; + var message = new $root.google.cloud.apihub.v1.CreateDependencyRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.dependencyId != null) + message.dependencyId = String(object.dependencyId); + if (object.dependency != null) { + if (typeof object.dependency !== "object") + throw TypeError(".google.cloud.apihub.v1.CreateDependencyRequest.dependency: object expected"); + message.dependency = $root.google.cloud.apihub.v1.Dependency.fromObject(object.dependency); + } + return message; + }; + + /** + * Creates a plain object from a CreateDependencyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.CreateDependencyRequest + * @static + * @param {google.cloud.apihub.v1.CreateDependencyRequest} message CreateDependencyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateDependencyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.dependencyId = ""; + object.dependency = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.dependencyId != null && message.hasOwnProperty("dependencyId")) + object.dependencyId = message.dependencyId; + if (message.dependency != null && message.hasOwnProperty("dependency")) + object.dependency = $root.google.cloud.apihub.v1.Dependency.toObject(message.dependency, options); + return object; + }; + + /** + * Converts this CreateDependencyRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.CreateDependencyRequest + * @instance + * @returns {Object.} JSON object + */ + CreateDependencyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateDependencyRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.CreateDependencyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateDependencyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.CreateDependencyRequest"; + }; + + return CreateDependencyRequest; + })(); + + v1.GetDependencyRequest = (function() { + + /** + * Properties of a GetDependencyRequest. + * @memberof google.cloud.apihub.v1 + * @interface IGetDependencyRequest + * @property {string|null} [name] GetDependencyRequest name + */ + + /** + * Constructs a new GetDependencyRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a GetDependencyRequest. + * @implements IGetDependencyRequest + * @constructor + * @param {google.cloud.apihub.v1.IGetDependencyRequest=} [properties] Properties to set + */ + function GetDependencyRequest(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]]; + } + + /** + * GetDependencyRequest name. + * @member {string} name + * @memberof google.cloud.apihub.v1.GetDependencyRequest + * @instance + */ + GetDependencyRequest.prototype.name = ""; + + /** + * Creates a new GetDependencyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.GetDependencyRequest + * @static + * @param {google.cloud.apihub.v1.IGetDependencyRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.GetDependencyRequest} GetDependencyRequest instance + */ + GetDependencyRequest.create = function create(properties) { + return new GetDependencyRequest(properties); + }; + + /** + * Encodes the specified GetDependencyRequest message. Does not implicitly {@link google.cloud.apihub.v1.GetDependencyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.GetDependencyRequest + * @static + * @param {google.cloud.apihub.v1.IGetDependencyRequest} message GetDependencyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDependencyRequest.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 GetDependencyRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.GetDependencyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.GetDependencyRequest + * @static + * @param {google.cloud.apihub.v1.IGetDependencyRequest} message GetDependencyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDependencyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDependencyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.GetDependencyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.GetDependencyRequest} GetDependencyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDependencyRequest.decode = function 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.apihub.v1.GetDependencyRequest(); + 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 GetDependencyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.GetDependencyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.GetDependencyRequest} GetDependencyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDependencyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDependencyRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.GetDependencyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDependencyRequest.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 GetDependencyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.GetDependencyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.GetDependencyRequest} GetDependencyRequest + */ + GetDependencyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.GetDependencyRequest) + return object; + var message = new $root.google.cloud.apihub.v1.GetDependencyRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetDependencyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.GetDependencyRequest + * @static + * @param {google.cloud.apihub.v1.GetDependencyRequest} message GetDependencyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDependencyRequest.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 GetDependencyRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.GetDependencyRequest + * @instance + * @returns {Object.} JSON object + */ + GetDependencyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetDependencyRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.GetDependencyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetDependencyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.GetDependencyRequest"; + }; + + return GetDependencyRequest; + })(); + + v1.UpdateDependencyRequest = (function() { + + /** + * Properties of an UpdateDependencyRequest. + * @memberof google.cloud.apihub.v1 + * @interface IUpdateDependencyRequest + * @property {google.cloud.apihub.v1.IDependency|null} [dependency] UpdateDependencyRequest dependency + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateDependencyRequest updateMask + */ + + /** + * Constructs a new UpdateDependencyRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents an UpdateDependencyRequest. + * @implements IUpdateDependencyRequest + * @constructor + * @param {google.cloud.apihub.v1.IUpdateDependencyRequest=} [properties] Properties to set + */ + function UpdateDependencyRequest(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]]; + } + + /** + * UpdateDependencyRequest dependency. + * @member {google.cloud.apihub.v1.IDependency|null|undefined} dependency + * @memberof google.cloud.apihub.v1.UpdateDependencyRequest + * @instance + */ + UpdateDependencyRequest.prototype.dependency = null; + + /** + * UpdateDependencyRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.apihub.v1.UpdateDependencyRequest + * @instance + */ + UpdateDependencyRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateDependencyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.UpdateDependencyRequest + * @static + * @param {google.cloud.apihub.v1.IUpdateDependencyRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.UpdateDependencyRequest} UpdateDependencyRequest instance + */ + UpdateDependencyRequest.create = function create(properties) { + return new UpdateDependencyRequest(properties); + }; + + /** + * Encodes the specified UpdateDependencyRequest message. Does not implicitly {@link google.cloud.apihub.v1.UpdateDependencyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.UpdateDependencyRequest + * @static + * @param {google.cloud.apihub.v1.IUpdateDependencyRequest} message UpdateDependencyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDependencyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dependency != null && Object.hasOwnProperty.call(message, "dependency")) + $root.google.cloud.apihub.v1.Dependency.encode(message.dependency, 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 UpdateDependencyRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.UpdateDependencyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.UpdateDependencyRequest + * @static + * @param {google.cloud.apihub.v1.IUpdateDependencyRequest} message UpdateDependencyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDependencyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateDependencyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.UpdateDependencyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.UpdateDependencyRequest} UpdateDependencyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDependencyRequest.decode = function 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.apihub.v1.UpdateDependencyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.dependency = $root.google.cloud.apihub.v1.Dependency.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 UpdateDependencyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.UpdateDependencyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.UpdateDependencyRequest} UpdateDependencyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDependencyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateDependencyRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.UpdateDependencyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateDependencyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dependency != null && message.hasOwnProperty("dependency")) { + var error = $root.google.cloud.apihub.v1.Dependency.verify(message.dependency); + if (error) + return "dependency." + 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 UpdateDependencyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.UpdateDependencyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.UpdateDependencyRequest} UpdateDependencyRequest + */ + UpdateDependencyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.UpdateDependencyRequest) + return object; + var message = new $root.google.cloud.apihub.v1.UpdateDependencyRequest(); + if (object.dependency != null) { + if (typeof object.dependency !== "object") + throw TypeError(".google.cloud.apihub.v1.UpdateDependencyRequest.dependency: object expected"); + message.dependency = $root.google.cloud.apihub.v1.Dependency.fromObject(object.dependency); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.apihub.v1.UpdateDependencyRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateDependencyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.UpdateDependencyRequest + * @static + * @param {google.cloud.apihub.v1.UpdateDependencyRequest} message UpdateDependencyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateDependencyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.dependency = null; + object.updateMask = null; + } + if (message.dependency != null && message.hasOwnProperty("dependency")) + object.dependency = $root.google.cloud.apihub.v1.Dependency.toObject(message.dependency, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateDependencyRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.UpdateDependencyRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateDependencyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateDependencyRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.UpdateDependencyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateDependencyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.UpdateDependencyRequest"; + }; + + return UpdateDependencyRequest; + })(); + + v1.DeleteDependencyRequest = (function() { + + /** + * Properties of a DeleteDependencyRequest. + * @memberof google.cloud.apihub.v1 + * @interface IDeleteDependencyRequest + * @property {string|null} [name] DeleteDependencyRequest name + */ + + /** + * Constructs a new DeleteDependencyRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a DeleteDependencyRequest. + * @implements IDeleteDependencyRequest + * @constructor + * @param {google.cloud.apihub.v1.IDeleteDependencyRequest=} [properties] Properties to set + */ + function DeleteDependencyRequest(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]]; + } + + /** + * DeleteDependencyRequest name. + * @member {string} name + * @memberof google.cloud.apihub.v1.DeleteDependencyRequest + * @instance + */ + DeleteDependencyRequest.prototype.name = ""; + + /** + * Creates a new DeleteDependencyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.DeleteDependencyRequest + * @static + * @param {google.cloud.apihub.v1.IDeleteDependencyRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.DeleteDependencyRequest} DeleteDependencyRequest instance + */ + DeleteDependencyRequest.create = function create(properties) { + return new DeleteDependencyRequest(properties); + }; + + /** + * Encodes the specified DeleteDependencyRequest message. Does not implicitly {@link google.cloud.apihub.v1.DeleteDependencyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.DeleteDependencyRequest + * @static + * @param {google.cloud.apihub.v1.IDeleteDependencyRequest} message DeleteDependencyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteDependencyRequest.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 DeleteDependencyRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.DeleteDependencyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.DeleteDependencyRequest + * @static + * @param {google.cloud.apihub.v1.IDeleteDependencyRequest} message DeleteDependencyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteDependencyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteDependencyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.DeleteDependencyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.DeleteDependencyRequest} DeleteDependencyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteDependencyRequest.decode = function 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.apihub.v1.DeleteDependencyRequest(); + 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 DeleteDependencyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.DeleteDependencyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.DeleteDependencyRequest} DeleteDependencyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteDependencyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteDependencyRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.DeleteDependencyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteDependencyRequest.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 DeleteDependencyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.DeleteDependencyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.DeleteDependencyRequest} DeleteDependencyRequest + */ + DeleteDependencyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.DeleteDependencyRequest) + return object; + var message = new $root.google.cloud.apihub.v1.DeleteDependencyRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteDependencyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.DeleteDependencyRequest + * @static + * @param {google.cloud.apihub.v1.DeleteDependencyRequest} message DeleteDependencyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteDependencyRequest.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 DeleteDependencyRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.DeleteDependencyRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteDependencyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteDependencyRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.DeleteDependencyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteDependencyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.DeleteDependencyRequest"; + }; + + return DeleteDependencyRequest; + })(); + + v1.ListDependenciesRequest = (function() { + + /** + * Properties of a ListDependenciesRequest. + * @memberof google.cloud.apihub.v1 + * @interface IListDependenciesRequest + * @property {string|null} [parent] ListDependenciesRequest parent + * @property {string|null} [filter] ListDependenciesRequest filter + * @property {number|null} [pageSize] ListDependenciesRequest pageSize + * @property {string|null} [pageToken] ListDependenciesRequest pageToken + */ + + /** + * Constructs a new ListDependenciesRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a ListDependenciesRequest. + * @implements IListDependenciesRequest + * @constructor + * @param {google.cloud.apihub.v1.IListDependenciesRequest=} [properties] Properties to set + */ + function ListDependenciesRequest(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]]; + } + + /** + * ListDependenciesRequest parent. + * @member {string} parent + * @memberof google.cloud.apihub.v1.ListDependenciesRequest + * @instance + */ + ListDependenciesRequest.prototype.parent = ""; + + /** + * ListDependenciesRequest filter. + * @member {string} filter + * @memberof google.cloud.apihub.v1.ListDependenciesRequest + * @instance + */ + ListDependenciesRequest.prototype.filter = ""; + + /** + * ListDependenciesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.apihub.v1.ListDependenciesRequest + * @instance + */ + ListDependenciesRequest.prototype.pageSize = 0; + + /** + * ListDependenciesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.apihub.v1.ListDependenciesRequest + * @instance + */ + ListDependenciesRequest.prototype.pageToken = ""; + + /** + * Creates a new ListDependenciesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.ListDependenciesRequest + * @static + * @param {google.cloud.apihub.v1.IListDependenciesRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.ListDependenciesRequest} ListDependenciesRequest instance + */ + ListDependenciesRequest.create = function create(properties) { + return new ListDependenciesRequest(properties); + }; + + /** + * Encodes the specified ListDependenciesRequest message. Does not implicitly {@link google.cloud.apihub.v1.ListDependenciesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.ListDependenciesRequest + * @static + * @param {google.cloud.apihub.v1.IListDependenciesRequest} message ListDependenciesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDependenciesRequest.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.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListDependenciesRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListDependenciesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.ListDependenciesRequest + * @static + * @param {google.cloud.apihub.v1.IListDependenciesRequest} message ListDependenciesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDependenciesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDependenciesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.ListDependenciesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.ListDependenciesRequest} ListDependenciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDependenciesRequest.decode = function 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.apihub.v1.ListDependenciesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.filter = reader.string(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + case 4: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListDependenciesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.ListDependenciesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.ListDependenciesRequest} ListDependenciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDependenciesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDependenciesRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.ListDependenciesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDependenciesRequest.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.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 ListDependenciesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.ListDependenciesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.ListDependenciesRequest} ListDependenciesRequest + */ + ListDependenciesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.ListDependenciesRequest) + return object; + var message = new $root.google.cloud.apihub.v1.ListDependenciesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + 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 ListDependenciesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.ListDependenciesRequest + * @static + * @param {google.cloud.apihub.v1.ListDependenciesRequest} message ListDependenciesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDependenciesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + 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; + return object; + }; + + /** + * Converts this ListDependenciesRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.ListDependenciesRequest + * @instance + * @returns {Object.} JSON object + */ + ListDependenciesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListDependenciesRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.ListDependenciesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListDependenciesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.ListDependenciesRequest"; + }; + + return ListDependenciesRequest; + })(); + + v1.ListDependenciesResponse = (function() { + + /** + * Properties of a ListDependenciesResponse. + * @memberof google.cloud.apihub.v1 + * @interface IListDependenciesResponse + * @property {Array.|null} [dependencies] ListDependenciesResponse dependencies + * @property {string|null} [nextPageToken] ListDependenciesResponse nextPageToken + */ + + /** + * Constructs a new ListDependenciesResponse. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a ListDependenciesResponse. + * @implements IListDependenciesResponse + * @constructor + * @param {google.cloud.apihub.v1.IListDependenciesResponse=} [properties] Properties to set + */ + function ListDependenciesResponse(properties) { + this.dependencies = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListDependenciesResponse dependencies. + * @member {Array.} dependencies + * @memberof google.cloud.apihub.v1.ListDependenciesResponse + * @instance + */ + ListDependenciesResponse.prototype.dependencies = $util.emptyArray; + + /** + * ListDependenciesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.apihub.v1.ListDependenciesResponse + * @instance + */ + ListDependenciesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListDependenciesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.ListDependenciesResponse + * @static + * @param {google.cloud.apihub.v1.IListDependenciesResponse=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.ListDependenciesResponse} ListDependenciesResponse instance + */ + ListDependenciesResponse.create = function create(properties) { + return new ListDependenciesResponse(properties); + }; + + /** + * Encodes the specified ListDependenciesResponse message. Does not implicitly {@link google.cloud.apihub.v1.ListDependenciesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.ListDependenciesResponse + * @static + * @param {google.cloud.apihub.v1.IListDependenciesResponse} message ListDependenciesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDependenciesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dependencies != null && message.dependencies.length) + for (var i = 0; i < message.dependencies.length; ++i) + $root.google.cloud.apihub.v1.Dependency.encode(message.dependencies[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 ListDependenciesResponse message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListDependenciesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.ListDependenciesResponse + * @static + * @param {google.cloud.apihub.v1.IListDependenciesResponse} message ListDependenciesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDependenciesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDependenciesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.ListDependenciesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.ListDependenciesResponse} ListDependenciesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDependenciesResponse.decode = function 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.apihub.v1.ListDependenciesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.dependencies && message.dependencies.length)) + message.dependencies = []; + message.dependencies.push($root.google.cloud.apihub.v1.Dependency.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListDependenciesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.ListDependenciesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.ListDependenciesResponse} ListDependenciesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDependenciesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDependenciesResponse message. + * @function verify + * @memberof google.cloud.apihub.v1.ListDependenciesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDependenciesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dependencies != null && message.hasOwnProperty("dependencies")) { + if (!Array.isArray(message.dependencies)) + return "dependencies: array expected"; + for (var i = 0; i < message.dependencies.length; ++i) { + var error = $root.google.cloud.apihub.v1.Dependency.verify(message.dependencies[i]); + if (error) + return "dependencies." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListDependenciesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.ListDependenciesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.ListDependenciesResponse} ListDependenciesResponse + */ + ListDependenciesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.ListDependenciesResponse) + return object; + var message = new $root.google.cloud.apihub.v1.ListDependenciesResponse(); + if (object.dependencies) { + if (!Array.isArray(object.dependencies)) + throw TypeError(".google.cloud.apihub.v1.ListDependenciesResponse.dependencies: array expected"); + message.dependencies = []; + for (var i = 0; i < object.dependencies.length; ++i) { + if (typeof object.dependencies[i] !== "object") + throw TypeError(".google.cloud.apihub.v1.ListDependenciesResponse.dependencies: object expected"); + message.dependencies[i] = $root.google.cloud.apihub.v1.Dependency.fromObject(object.dependencies[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListDependenciesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.ListDependenciesResponse + * @static + * @param {google.cloud.apihub.v1.ListDependenciesResponse} message ListDependenciesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDependenciesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.dependencies = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.dependencies && message.dependencies.length) { + object.dependencies = []; + for (var j = 0; j < message.dependencies.length; ++j) + object.dependencies[j] = $root.google.cloud.apihub.v1.Dependency.toObject(message.dependencies[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListDependenciesResponse to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.ListDependenciesResponse + * @instance + * @returns {Object.} JSON object + */ + ListDependenciesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListDependenciesResponse + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.ListDependenciesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListDependenciesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.ListDependenciesResponse"; + }; + + return ListDependenciesResponse; + })(); + + v1.CreateExternalApiRequest = (function() { + + /** + * Properties of a CreateExternalApiRequest. + * @memberof google.cloud.apihub.v1 + * @interface ICreateExternalApiRequest + * @property {string|null} [parent] CreateExternalApiRequest parent + * @property {string|null} [externalApiId] CreateExternalApiRequest externalApiId + * @property {google.cloud.apihub.v1.IExternalApi|null} [externalApi] CreateExternalApiRequest externalApi + */ + + /** + * Constructs a new CreateExternalApiRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a CreateExternalApiRequest. + * @implements ICreateExternalApiRequest + * @constructor + * @param {google.cloud.apihub.v1.ICreateExternalApiRequest=} [properties] Properties to set + */ + function CreateExternalApiRequest(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]]; + } + + /** + * CreateExternalApiRequest parent. + * @member {string} parent + * @memberof google.cloud.apihub.v1.CreateExternalApiRequest + * @instance + */ + CreateExternalApiRequest.prototype.parent = ""; + + /** + * CreateExternalApiRequest externalApiId. + * @member {string} externalApiId + * @memberof google.cloud.apihub.v1.CreateExternalApiRequest + * @instance + */ + CreateExternalApiRequest.prototype.externalApiId = ""; + + /** + * CreateExternalApiRequest externalApi. + * @member {google.cloud.apihub.v1.IExternalApi|null|undefined} externalApi + * @memberof google.cloud.apihub.v1.CreateExternalApiRequest + * @instance + */ + CreateExternalApiRequest.prototype.externalApi = null; + + /** + * Creates a new CreateExternalApiRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.CreateExternalApiRequest + * @static + * @param {google.cloud.apihub.v1.ICreateExternalApiRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.CreateExternalApiRequest} CreateExternalApiRequest instance + */ + CreateExternalApiRequest.create = function create(properties) { + return new CreateExternalApiRequest(properties); + }; + + /** + * Encodes the specified CreateExternalApiRequest message. Does not implicitly {@link google.cloud.apihub.v1.CreateExternalApiRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.CreateExternalApiRequest + * @static + * @param {google.cloud.apihub.v1.ICreateExternalApiRequest} message CreateExternalApiRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateExternalApiRequest.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.externalApiId != null && Object.hasOwnProperty.call(message, "externalApiId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.externalApiId); + if (message.externalApi != null && Object.hasOwnProperty.call(message, "externalApi")) + $root.google.cloud.apihub.v1.ExternalApi.encode(message.externalApi, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateExternalApiRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.CreateExternalApiRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.CreateExternalApiRequest + * @static + * @param {google.cloud.apihub.v1.ICreateExternalApiRequest} message CreateExternalApiRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateExternalApiRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateExternalApiRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.CreateExternalApiRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.CreateExternalApiRequest} CreateExternalApiRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateExternalApiRequest.decode = function 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.apihub.v1.CreateExternalApiRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.externalApiId = reader.string(); + break; + } + case 3: { + message.externalApi = $root.google.cloud.apihub.v1.ExternalApi.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateExternalApiRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.CreateExternalApiRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.CreateExternalApiRequest} CreateExternalApiRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateExternalApiRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateExternalApiRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.CreateExternalApiRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateExternalApiRequest.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.externalApiId != null && message.hasOwnProperty("externalApiId")) + if (!$util.isString(message.externalApiId)) + return "externalApiId: string expected"; + if (message.externalApi != null && message.hasOwnProperty("externalApi")) { + var error = $root.google.cloud.apihub.v1.ExternalApi.verify(message.externalApi); + if (error) + return "externalApi." + error; + } + return null; + }; + + /** + * Creates a CreateExternalApiRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.CreateExternalApiRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.CreateExternalApiRequest} CreateExternalApiRequest + */ + CreateExternalApiRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.CreateExternalApiRequest) + return object; + var message = new $root.google.cloud.apihub.v1.CreateExternalApiRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.externalApiId != null) + message.externalApiId = String(object.externalApiId); + if (object.externalApi != null) { + if (typeof object.externalApi !== "object") + throw TypeError(".google.cloud.apihub.v1.CreateExternalApiRequest.externalApi: object expected"); + message.externalApi = $root.google.cloud.apihub.v1.ExternalApi.fromObject(object.externalApi); + } + return message; + }; + + /** + * Creates a plain object from a CreateExternalApiRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.CreateExternalApiRequest + * @static + * @param {google.cloud.apihub.v1.CreateExternalApiRequest} message CreateExternalApiRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateExternalApiRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.externalApiId = ""; + object.externalApi = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.externalApiId != null && message.hasOwnProperty("externalApiId")) + object.externalApiId = message.externalApiId; + if (message.externalApi != null && message.hasOwnProperty("externalApi")) + object.externalApi = $root.google.cloud.apihub.v1.ExternalApi.toObject(message.externalApi, options); + return object; + }; + + /** + * Converts this CreateExternalApiRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.CreateExternalApiRequest + * @instance + * @returns {Object.} JSON object + */ + CreateExternalApiRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateExternalApiRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.CreateExternalApiRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateExternalApiRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.CreateExternalApiRequest"; + }; + + return CreateExternalApiRequest; + })(); + + v1.GetExternalApiRequest = (function() { + + /** + * Properties of a GetExternalApiRequest. + * @memberof google.cloud.apihub.v1 + * @interface IGetExternalApiRequest + * @property {string|null} [name] GetExternalApiRequest name + */ + + /** + * Constructs a new GetExternalApiRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a GetExternalApiRequest. + * @implements IGetExternalApiRequest + * @constructor + * @param {google.cloud.apihub.v1.IGetExternalApiRequest=} [properties] Properties to set + */ + function GetExternalApiRequest(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]]; + } + + /** + * GetExternalApiRequest name. + * @member {string} name + * @memberof google.cloud.apihub.v1.GetExternalApiRequest + * @instance + */ + GetExternalApiRequest.prototype.name = ""; + + /** + * Creates a new GetExternalApiRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.GetExternalApiRequest + * @static + * @param {google.cloud.apihub.v1.IGetExternalApiRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.GetExternalApiRequest} GetExternalApiRequest instance + */ + GetExternalApiRequest.create = function create(properties) { + return new GetExternalApiRequest(properties); + }; + + /** + * Encodes the specified GetExternalApiRequest message. Does not implicitly {@link google.cloud.apihub.v1.GetExternalApiRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.GetExternalApiRequest + * @static + * @param {google.cloud.apihub.v1.IGetExternalApiRequest} message GetExternalApiRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetExternalApiRequest.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 GetExternalApiRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.GetExternalApiRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.GetExternalApiRequest + * @static + * @param {google.cloud.apihub.v1.IGetExternalApiRequest} message GetExternalApiRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetExternalApiRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetExternalApiRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.GetExternalApiRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.GetExternalApiRequest} GetExternalApiRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetExternalApiRequest.decode = function 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.apihub.v1.GetExternalApiRequest(); + 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 GetExternalApiRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.GetExternalApiRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.GetExternalApiRequest} GetExternalApiRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetExternalApiRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetExternalApiRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.GetExternalApiRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetExternalApiRequest.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 GetExternalApiRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.GetExternalApiRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.GetExternalApiRequest} GetExternalApiRequest + */ + GetExternalApiRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.GetExternalApiRequest) + return object; + var message = new $root.google.cloud.apihub.v1.GetExternalApiRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetExternalApiRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.GetExternalApiRequest + * @static + * @param {google.cloud.apihub.v1.GetExternalApiRequest} message GetExternalApiRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetExternalApiRequest.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 GetExternalApiRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.GetExternalApiRequest + * @instance + * @returns {Object.} JSON object + */ + GetExternalApiRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetExternalApiRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.GetExternalApiRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetExternalApiRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.GetExternalApiRequest"; + }; + + return GetExternalApiRequest; + })(); + + v1.UpdateExternalApiRequest = (function() { + + /** + * Properties of an UpdateExternalApiRequest. + * @memberof google.cloud.apihub.v1 + * @interface IUpdateExternalApiRequest + * @property {google.cloud.apihub.v1.IExternalApi|null} [externalApi] UpdateExternalApiRequest externalApi + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateExternalApiRequest updateMask + */ + + /** + * Constructs a new UpdateExternalApiRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents an UpdateExternalApiRequest. + * @implements IUpdateExternalApiRequest + * @constructor + * @param {google.cloud.apihub.v1.IUpdateExternalApiRequest=} [properties] Properties to set + */ + function UpdateExternalApiRequest(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]]; + } + + /** + * UpdateExternalApiRequest externalApi. + * @member {google.cloud.apihub.v1.IExternalApi|null|undefined} externalApi + * @memberof google.cloud.apihub.v1.UpdateExternalApiRequest + * @instance + */ + UpdateExternalApiRequest.prototype.externalApi = null; + + /** + * UpdateExternalApiRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.apihub.v1.UpdateExternalApiRequest + * @instance + */ + UpdateExternalApiRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateExternalApiRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.UpdateExternalApiRequest + * @static + * @param {google.cloud.apihub.v1.IUpdateExternalApiRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.UpdateExternalApiRequest} UpdateExternalApiRequest instance + */ + UpdateExternalApiRequest.create = function create(properties) { + return new UpdateExternalApiRequest(properties); + }; + + /** + * Encodes the specified UpdateExternalApiRequest message. Does not implicitly {@link google.cloud.apihub.v1.UpdateExternalApiRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.UpdateExternalApiRequest + * @static + * @param {google.cloud.apihub.v1.IUpdateExternalApiRequest} message UpdateExternalApiRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateExternalApiRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.externalApi != null && Object.hasOwnProperty.call(message, "externalApi")) + $root.google.cloud.apihub.v1.ExternalApi.encode(message.externalApi, 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 UpdateExternalApiRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.UpdateExternalApiRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.UpdateExternalApiRequest + * @static + * @param {google.cloud.apihub.v1.IUpdateExternalApiRequest} message UpdateExternalApiRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateExternalApiRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateExternalApiRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.UpdateExternalApiRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.UpdateExternalApiRequest} UpdateExternalApiRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateExternalApiRequest.decode = function 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.apihub.v1.UpdateExternalApiRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.externalApi = $root.google.cloud.apihub.v1.ExternalApi.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 UpdateExternalApiRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.UpdateExternalApiRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.UpdateExternalApiRequest} UpdateExternalApiRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateExternalApiRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateExternalApiRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.UpdateExternalApiRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateExternalApiRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.externalApi != null && message.hasOwnProperty("externalApi")) { + var error = $root.google.cloud.apihub.v1.ExternalApi.verify(message.externalApi); + if (error) + return "externalApi." + 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 UpdateExternalApiRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.UpdateExternalApiRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.UpdateExternalApiRequest} UpdateExternalApiRequest + */ + UpdateExternalApiRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.UpdateExternalApiRequest) + return object; + var message = new $root.google.cloud.apihub.v1.UpdateExternalApiRequest(); + if (object.externalApi != null) { + if (typeof object.externalApi !== "object") + throw TypeError(".google.cloud.apihub.v1.UpdateExternalApiRequest.externalApi: object expected"); + message.externalApi = $root.google.cloud.apihub.v1.ExternalApi.fromObject(object.externalApi); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.apihub.v1.UpdateExternalApiRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateExternalApiRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.UpdateExternalApiRequest + * @static + * @param {google.cloud.apihub.v1.UpdateExternalApiRequest} message UpdateExternalApiRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateExternalApiRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.externalApi = null; + object.updateMask = null; + } + if (message.externalApi != null && message.hasOwnProperty("externalApi")) + object.externalApi = $root.google.cloud.apihub.v1.ExternalApi.toObject(message.externalApi, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateExternalApiRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.UpdateExternalApiRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateExternalApiRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateExternalApiRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.UpdateExternalApiRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateExternalApiRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.UpdateExternalApiRequest"; + }; + + return UpdateExternalApiRequest; + })(); + + v1.DeleteExternalApiRequest = (function() { + + /** + * Properties of a DeleteExternalApiRequest. + * @memberof google.cloud.apihub.v1 + * @interface IDeleteExternalApiRequest + * @property {string|null} [name] DeleteExternalApiRequest name + */ + + /** + * Constructs a new DeleteExternalApiRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a DeleteExternalApiRequest. + * @implements IDeleteExternalApiRequest + * @constructor + * @param {google.cloud.apihub.v1.IDeleteExternalApiRequest=} [properties] Properties to set + */ + function DeleteExternalApiRequest(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]]; + } + + /** + * DeleteExternalApiRequest name. + * @member {string} name + * @memberof google.cloud.apihub.v1.DeleteExternalApiRequest + * @instance + */ + DeleteExternalApiRequest.prototype.name = ""; + + /** + * Creates a new DeleteExternalApiRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.DeleteExternalApiRequest + * @static + * @param {google.cloud.apihub.v1.IDeleteExternalApiRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.DeleteExternalApiRequest} DeleteExternalApiRequest instance + */ + DeleteExternalApiRequest.create = function create(properties) { + return new DeleteExternalApiRequest(properties); + }; + + /** + * Encodes the specified DeleteExternalApiRequest message. Does not implicitly {@link google.cloud.apihub.v1.DeleteExternalApiRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.DeleteExternalApiRequest + * @static + * @param {google.cloud.apihub.v1.IDeleteExternalApiRequest} message DeleteExternalApiRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteExternalApiRequest.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 DeleteExternalApiRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.DeleteExternalApiRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.DeleteExternalApiRequest + * @static + * @param {google.cloud.apihub.v1.IDeleteExternalApiRequest} message DeleteExternalApiRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteExternalApiRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteExternalApiRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.DeleteExternalApiRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.DeleteExternalApiRequest} DeleteExternalApiRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteExternalApiRequest.decode = function 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.apihub.v1.DeleteExternalApiRequest(); + 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 DeleteExternalApiRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.DeleteExternalApiRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.DeleteExternalApiRequest} DeleteExternalApiRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteExternalApiRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteExternalApiRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.DeleteExternalApiRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteExternalApiRequest.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 DeleteExternalApiRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.DeleteExternalApiRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.DeleteExternalApiRequest} DeleteExternalApiRequest + */ + DeleteExternalApiRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.DeleteExternalApiRequest) + return object; + var message = new $root.google.cloud.apihub.v1.DeleteExternalApiRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteExternalApiRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.DeleteExternalApiRequest + * @static + * @param {google.cloud.apihub.v1.DeleteExternalApiRequest} message DeleteExternalApiRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteExternalApiRequest.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 DeleteExternalApiRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.DeleteExternalApiRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteExternalApiRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteExternalApiRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.DeleteExternalApiRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteExternalApiRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.DeleteExternalApiRequest"; + }; + + return DeleteExternalApiRequest; + })(); + + v1.ListExternalApisRequest = (function() { + + /** + * Properties of a ListExternalApisRequest. + * @memberof google.cloud.apihub.v1 + * @interface IListExternalApisRequest + * @property {string|null} [parent] ListExternalApisRequest parent + * @property {number|null} [pageSize] ListExternalApisRequest pageSize + * @property {string|null} [pageToken] ListExternalApisRequest pageToken + */ + + /** + * Constructs a new ListExternalApisRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a ListExternalApisRequest. + * @implements IListExternalApisRequest + * @constructor + * @param {google.cloud.apihub.v1.IListExternalApisRequest=} [properties] Properties to set + */ + function ListExternalApisRequest(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]]; + } + + /** + * ListExternalApisRequest parent. + * @member {string} parent + * @memberof google.cloud.apihub.v1.ListExternalApisRequest + * @instance + */ + ListExternalApisRequest.prototype.parent = ""; + + /** + * ListExternalApisRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.apihub.v1.ListExternalApisRequest + * @instance + */ + ListExternalApisRequest.prototype.pageSize = 0; + + /** + * ListExternalApisRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.apihub.v1.ListExternalApisRequest + * @instance + */ + ListExternalApisRequest.prototype.pageToken = ""; + + /** + * Creates a new ListExternalApisRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.ListExternalApisRequest + * @static + * @param {google.cloud.apihub.v1.IListExternalApisRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.ListExternalApisRequest} ListExternalApisRequest instance + */ + ListExternalApisRequest.create = function create(properties) { + return new ListExternalApisRequest(properties); + }; + + /** + * Encodes the specified ListExternalApisRequest message. Does not implicitly {@link google.cloud.apihub.v1.ListExternalApisRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.ListExternalApisRequest + * @static + * @param {google.cloud.apihub.v1.IListExternalApisRequest} message ListExternalApisRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListExternalApisRequest.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 ListExternalApisRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListExternalApisRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.ListExternalApisRequest + * @static + * @param {google.cloud.apihub.v1.IListExternalApisRequest} message ListExternalApisRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListExternalApisRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListExternalApisRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.ListExternalApisRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.ListExternalApisRequest} ListExternalApisRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListExternalApisRequest.decode = function 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.apihub.v1.ListExternalApisRequest(); + 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 ListExternalApisRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.ListExternalApisRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.ListExternalApisRequest} ListExternalApisRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListExternalApisRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListExternalApisRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.ListExternalApisRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListExternalApisRequest.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 ListExternalApisRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.ListExternalApisRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.ListExternalApisRequest} ListExternalApisRequest + */ + ListExternalApisRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.ListExternalApisRequest) + return object; + var message = new $root.google.cloud.apihub.v1.ListExternalApisRequest(); + 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 ListExternalApisRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.ListExternalApisRequest + * @static + * @param {google.cloud.apihub.v1.ListExternalApisRequest} message ListExternalApisRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListExternalApisRequest.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 ListExternalApisRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.ListExternalApisRequest + * @instance + * @returns {Object.} JSON object + */ + ListExternalApisRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListExternalApisRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.ListExternalApisRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListExternalApisRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.ListExternalApisRequest"; + }; + + return ListExternalApisRequest; + })(); + + v1.ListExternalApisResponse = (function() { + + /** + * Properties of a ListExternalApisResponse. + * @memberof google.cloud.apihub.v1 + * @interface IListExternalApisResponse + * @property {Array.|null} [externalApis] ListExternalApisResponse externalApis + * @property {string|null} [nextPageToken] ListExternalApisResponse nextPageToken + */ + + /** + * Constructs a new ListExternalApisResponse. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a ListExternalApisResponse. + * @implements IListExternalApisResponse + * @constructor + * @param {google.cloud.apihub.v1.IListExternalApisResponse=} [properties] Properties to set + */ + function ListExternalApisResponse(properties) { + this.externalApis = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListExternalApisResponse externalApis. + * @member {Array.} externalApis + * @memberof google.cloud.apihub.v1.ListExternalApisResponse + * @instance + */ + ListExternalApisResponse.prototype.externalApis = $util.emptyArray; + + /** + * ListExternalApisResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.apihub.v1.ListExternalApisResponse + * @instance + */ + ListExternalApisResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListExternalApisResponse instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.ListExternalApisResponse + * @static + * @param {google.cloud.apihub.v1.IListExternalApisResponse=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.ListExternalApisResponse} ListExternalApisResponse instance + */ + ListExternalApisResponse.create = function create(properties) { + return new ListExternalApisResponse(properties); + }; + + /** + * Encodes the specified ListExternalApisResponse message. Does not implicitly {@link google.cloud.apihub.v1.ListExternalApisResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.ListExternalApisResponse + * @static + * @param {google.cloud.apihub.v1.IListExternalApisResponse} message ListExternalApisResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListExternalApisResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.externalApis != null && message.externalApis.length) + for (var i = 0; i < message.externalApis.length; ++i) + $root.google.cloud.apihub.v1.ExternalApi.encode(message.externalApis[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 ListExternalApisResponse message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListExternalApisResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.ListExternalApisResponse + * @static + * @param {google.cloud.apihub.v1.IListExternalApisResponse} message ListExternalApisResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListExternalApisResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListExternalApisResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.ListExternalApisResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.ListExternalApisResponse} ListExternalApisResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListExternalApisResponse.decode = function 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.apihub.v1.ListExternalApisResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.externalApis && message.externalApis.length)) + message.externalApis = []; + message.externalApis.push($root.google.cloud.apihub.v1.ExternalApi.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListExternalApisResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.ListExternalApisResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.ListExternalApisResponse} ListExternalApisResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListExternalApisResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListExternalApisResponse message. + * @function verify + * @memberof google.cloud.apihub.v1.ListExternalApisResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListExternalApisResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.externalApis != null && message.hasOwnProperty("externalApis")) { + if (!Array.isArray(message.externalApis)) + return "externalApis: array expected"; + for (var i = 0; i < message.externalApis.length; ++i) { + var error = $root.google.cloud.apihub.v1.ExternalApi.verify(message.externalApis[i]); + if (error) + return "externalApis." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListExternalApisResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.ListExternalApisResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.ListExternalApisResponse} ListExternalApisResponse + */ + ListExternalApisResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.ListExternalApisResponse) + return object; + var message = new $root.google.cloud.apihub.v1.ListExternalApisResponse(); + if (object.externalApis) { + if (!Array.isArray(object.externalApis)) + throw TypeError(".google.cloud.apihub.v1.ListExternalApisResponse.externalApis: array expected"); + message.externalApis = []; + for (var i = 0; i < object.externalApis.length; ++i) { + if (typeof object.externalApis[i] !== "object") + throw TypeError(".google.cloud.apihub.v1.ListExternalApisResponse.externalApis: object expected"); + message.externalApis[i] = $root.google.cloud.apihub.v1.ExternalApi.fromObject(object.externalApis[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListExternalApisResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.ListExternalApisResponse + * @static + * @param {google.cloud.apihub.v1.ListExternalApisResponse} message ListExternalApisResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListExternalApisResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.externalApis = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.externalApis && message.externalApis.length) { + object.externalApis = []; + for (var j = 0; j < message.externalApis.length; ++j) + object.externalApis[j] = $root.google.cloud.apihub.v1.ExternalApi.toObject(message.externalApis[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListExternalApisResponse to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.ListExternalApisResponse + * @instance + * @returns {Object.} JSON object + */ + ListExternalApisResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListExternalApisResponse + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.ListExternalApisResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListExternalApisResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.ListExternalApisResponse"; + }; + + return ListExternalApisResponse; + })(); + + /** + * LintState enum. + * @name google.cloud.apihub.v1.LintState + * @enum {number} + * @property {number} LINT_STATE_UNSPECIFIED=0 LINT_STATE_UNSPECIFIED value + * @property {number} LINT_STATE_SUCCESS=1 LINT_STATE_SUCCESS value + * @property {number} LINT_STATE_ERROR=2 LINT_STATE_ERROR value + */ + v1.LintState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LINT_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "LINT_STATE_SUCCESS"] = 1; + values[valuesById[2] = "LINT_STATE_ERROR"] = 2; + return values; + })(); + + /** + * Linter enum. + * @name google.cloud.apihub.v1.Linter + * @enum {number} + * @property {number} LINTER_UNSPECIFIED=0 LINTER_UNSPECIFIED value + * @property {number} SPECTRAL=1 SPECTRAL value + * @property {number} OTHER=2 OTHER value + */ + v1.Linter = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LINTER_UNSPECIFIED"] = 0; + values[valuesById[1] = "SPECTRAL"] = 1; + values[valuesById[2] = "OTHER"] = 2; + return values; + })(); + + /** + * Severity enum. + * @name google.cloud.apihub.v1.Severity + * @enum {number} + * @property {number} SEVERITY_UNSPECIFIED=0 SEVERITY_UNSPECIFIED value + * @property {number} SEVERITY_ERROR=1 SEVERITY_ERROR value + * @property {number} SEVERITY_WARNING=2 SEVERITY_WARNING value + * @property {number} SEVERITY_INFO=3 SEVERITY_INFO value + * @property {number} SEVERITY_HINT=4 SEVERITY_HINT value + */ + v1.Severity = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SEVERITY_UNSPECIFIED"] = 0; + values[valuesById[1] = "SEVERITY_ERROR"] = 1; + values[valuesById[2] = "SEVERITY_WARNING"] = 2; + values[valuesById[3] = "SEVERITY_INFO"] = 3; + values[valuesById[4] = "SEVERITY_HINT"] = 4; + return values; + })(); + + v1.Api = (function() { + + /** + * Properties of an Api. + * @memberof google.cloud.apihub.v1 + * @interface IApi + * @property {string|null} [name] Api name + * @property {string|null} [displayName] Api displayName + * @property {string|null} [description] Api description + * @property {google.cloud.apihub.v1.IDocumentation|null} [documentation] Api documentation + * @property {google.cloud.apihub.v1.IOwner|null} [owner] Api owner + * @property {Array.|null} [versions] Api versions + * @property {google.protobuf.ITimestamp|null} [createTime] Api createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Api updateTime + * @property {google.cloud.apihub.v1.IAttributeValues|null} [targetUser] Api targetUser + * @property {google.cloud.apihub.v1.IAttributeValues|null} [team] Api team + * @property {google.cloud.apihub.v1.IAttributeValues|null} [businessUnit] Api businessUnit + * @property {google.cloud.apihub.v1.IAttributeValues|null} [maturityLevel] Api maturityLevel + * @property {Object.|null} [attributes] Api attributes + * @property {google.cloud.apihub.v1.IAttributeValues|null} [apiStyle] Api apiStyle + * @property {string|null} [selectedVersion] Api selectedVersion + */ + + /** + * Constructs a new Api. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents an Api. + * @implements IApi + * @constructor + * @param {google.cloud.apihub.v1.IApi=} [properties] Properties to set + */ + function Api(properties) { + this.versions = []; + this.attributes = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Api name. + * @member {string} name + * @memberof google.cloud.apihub.v1.Api + * @instance + */ + Api.prototype.name = ""; + + /** + * Api displayName. + * @member {string} displayName + * @memberof google.cloud.apihub.v1.Api + * @instance + */ + Api.prototype.displayName = ""; + + /** + * Api description. + * @member {string} description + * @memberof google.cloud.apihub.v1.Api + * @instance + */ + Api.prototype.description = ""; + + /** + * Api documentation. + * @member {google.cloud.apihub.v1.IDocumentation|null|undefined} documentation + * @memberof google.cloud.apihub.v1.Api + * @instance + */ + Api.prototype.documentation = null; + + /** + * Api owner. + * @member {google.cloud.apihub.v1.IOwner|null|undefined} owner + * @memberof google.cloud.apihub.v1.Api + * @instance + */ + Api.prototype.owner = null; + + /** + * Api versions. + * @member {Array.} versions + * @memberof google.cloud.apihub.v1.Api + * @instance + */ + Api.prototype.versions = $util.emptyArray; + + /** + * Api createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.apihub.v1.Api + * @instance + */ + Api.prototype.createTime = null; + + /** + * Api updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.apihub.v1.Api + * @instance + */ + Api.prototype.updateTime = null; + + /** + * Api targetUser. + * @member {google.cloud.apihub.v1.IAttributeValues|null|undefined} targetUser + * @memberof google.cloud.apihub.v1.Api + * @instance + */ + Api.prototype.targetUser = null; + + /** + * Api team. + * @member {google.cloud.apihub.v1.IAttributeValues|null|undefined} team + * @memberof google.cloud.apihub.v1.Api + * @instance + */ + Api.prototype.team = null; + + /** + * Api businessUnit. + * @member {google.cloud.apihub.v1.IAttributeValues|null|undefined} businessUnit + * @memberof google.cloud.apihub.v1.Api + * @instance + */ + Api.prototype.businessUnit = null; + + /** + * Api maturityLevel. + * @member {google.cloud.apihub.v1.IAttributeValues|null|undefined} maturityLevel + * @memberof google.cloud.apihub.v1.Api + * @instance + */ + Api.prototype.maturityLevel = null; + + /** + * Api attributes. + * @member {Object.} attributes + * @memberof google.cloud.apihub.v1.Api + * @instance + */ + Api.prototype.attributes = $util.emptyObject; + + /** + * Api apiStyle. + * @member {google.cloud.apihub.v1.IAttributeValues|null|undefined} apiStyle + * @memberof google.cloud.apihub.v1.Api + * @instance + */ + Api.prototype.apiStyle = null; + + /** + * Api selectedVersion. + * @member {string} selectedVersion + * @memberof google.cloud.apihub.v1.Api + * @instance + */ + Api.prototype.selectedVersion = ""; + + /** + * Creates a new Api instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.Api + * @static + * @param {google.cloud.apihub.v1.IApi=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.Api} Api instance + */ + Api.create = function create(properties) { + return new Api(properties); + }; + + /** + * Encodes the specified Api message. Does not implicitly {@link google.cloud.apihub.v1.Api.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.Api + * @static + * @param {google.cloud.apihub.v1.IApi} message Api message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Api.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.documentation != null && Object.hasOwnProperty.call(message, "documentation")) + $root.google.cloud.apihub.v1.Documentation.encode(message.documentation, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.owner != null && Object.hasOwnProperty.call(message, "owner")) + $root.google.cloud.apihub.v1.Owner.encode(message.owner, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.versions != null && message.versions.length) + for (var i = 0; i < message.versions.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.versions[i]); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.targetUser != null && Object.hasOwnProperty.call(message, "targetUser")) + $root.google.cloud.apihub.v1.AttributeValues.encode(message.targetUser, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.team != null && Object.hasOwnProperty.call(message, "team")) + $root.google.cloud.apihub.v1.AttributeValues.encode(message.team, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.businessUnit != null && Object.hasOwnProperty.call(message, "businessUnit")) + $root.google.cloud.apihub.v1.AttributeValues.encode(message.businessUnit, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.maturityLevel != null && Object.hasOwnProperty.call(message, "maturityLevel")) + $root.google.cloud.apihub.v1.AttributeValues.encode(message.maturityLevel, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.attributes != null && Object.hasOwnProperty.call(message, "attributes")) + for (var keys = Object.keys(message.attributes), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 13, wireType 2 =*/106).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.apihub.v1.AttributeValues.encode(message.attributes[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.apiStyle != null && Object.hasOwnProperty.call(message, "apiStyle")) + $root.google.cloud.apihub.v1.AttributeValues.encode(message.apiStyle, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.selectedVersion != null && Object.hasOwnProperty.call(message, "selectedVersion")) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.selectedVersion); + return writer; + }; + + /** + * Encodes the specified Api message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.Api.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.Api + * @static + * @param {google.cloud.apihub.v1.IApi} message Api message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Api.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Api message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.Api + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.Api} Api + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Api.decode = function 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.apihub.v1.Api(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + message.documentation = $root.google.cloud.apihub.v1.Documentation.decode(reader, reader.uint32()); + break; + } + case 5: { + message.owner = $root.google.cloud.apihub.v1.Owner.decode(reader, reader.uint32()); + break; + } + case 6: { + if (!(message.versions && message.versions.length)) + message.versions = []; + message.versions.push(reader.string()); + break; + } + case 7: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 8: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 9: { + message.targetUser = $root.google.cloud.apihub.v1.AttributeValues.decode(reader, reader.uint32()); + break; + } + case 10: { + message.team = $root.google.cloud.apihub.v1.AttributeValues.decode(reader, reader.uint32()); + break; + } + case 11: { + message.businessUnit = $root.google.cloud.apihub.v1.AttributeValues.decode(reader, reader.uint32()); + break; + } + case 12: { + message.maturityLevel = $root.google.cloud.apihub.v1.AttributeValues.decode(reader, reader.uint32()); + break; + } + case 13: { + if (message.attributes === $util.emptyObject) + message.attributes = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.apihub.v1.AttributeValues.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.attributes[key] = value; + break; + } + case 14: { + message.apiStyle = $root.google.cloud.apihub.v1.AttributeValues.decode(reader, reader.uint32()); + break; + } + case 15: { + message.selectedVersion = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Api message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.Api + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.Api} Api + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Api.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Api message. + * @function verify + * @memberof google.cloud.apihub.v1.Api + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Api.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.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.documentation != null && message.hasOwnProperty("documentation")) { + var error = $root.google.cloud.apihub.v1.Documentation.verify(message.documentation); + if (error) + return "documentation." + error; + } + if (message.owner != null && message.hasOwnProperty("owner")) { + var error = $root.google.cloud.apihub.v1.Owner.verify(message.owner); + if (error) + return "owner." + error; + } + if (message.versions != null && message.hasOwnProperty("versions")) { + if (!Array.isArray(message.versions)) + return "versions: array expected"; + for (var i = 0; i < message.versions.length; ++i) + if (!$util.isString(message.versions[i])) + return "versions: 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.targetUser != null && message.hasOwnProperty("targetUser")) { + var error = $root.google.cloud.apihub.v1.AttributeValues.verify(message.targetUser); + if (error) + return "targetUser." + error; + } + if (message.team != null && message.hasOwnProperty("team")) { + var error = $root.google.cloud.apihub.v1.AttributeValues.verify(message.team); + if (error) + return "team." + error; + } + if (message.businessUnit != null && message.hasOwnProperty("businessUnit")) { + var error = $root.google.cloud.apihub.v1.AttributeValues.verify(message.businessUnit); + if (error) + return "businessUnit." + error; + } + if (message.maturityLevel != null && message.hasOwnProperty("maturityLevel")) { + var error = $root.google.cloud.apihub.v1.AttributeValues.verify(message.maturityLevel); + if (error) + return "maturityLevel." + error; + } + if (message.attributes != null && message.hasOwnProperty("attributes")) { + if (!$util.isObject(message.attributes)) + return "attributes: object expected"; + var key = Object.keys(message.attributes); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.apihub.v1.AttributeValues.verify(message.attributes[key[i]]); + if (error) + return "attributes." + error; + } + } + if (message.apiStyle != null && message.hasOwnProperty("apiStyle")) { + var error = $root.google.cloud.apihub.v1.AttributeValues.verify(message.apiStyle); + if (error) + return "apiStyle." + error; + } + if (message.selectedVersion != null && message.hasOwnProperty("selectedVersion")) + if (!$util.isString(message.selectedVersion)) + return "selectedVersion: string expected"; + return null; + }; + + /** + * Creates an Api message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.Api + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.Api} Api + */ + Api.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.Api) + return object; + var message = new $root.google.cloud.apihub.v1.Api(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.documentation != null) { + if (typeof object.documentation !== "object") + throw TypeError(".google.cloud.apihub.v1.Api.documentation: object expected"); + message.documentation = $root.google.cloud.apihub.v1.Documentation.fromObject(object.documentation); + } + if (object.owner != null) { + if (typeof object.owner !== "object") + throw TypeError(".google.cloud.apihub.v1.Api.owner: object expected"); + message.owner = $root.google.cloud.apihub.v1.Owner.fromObject(object.owner); + } + if (object.versions) { + if (!Array.isArray(object.versions)) + throw TypeError(".google.cloud.apihub.v1.Api.versions: array expected"); + message.versions = []; + for (var i = 0; i < object.versions.length; ++i) + message.versions[i] = String(object.versions[i]); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.apihub.v1.Api.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.apihub.v1.Api.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.targetUser != null) { + if (typeof object.targetUser !== "object") + throw TypeError(".google.cloud.apihub.v1.Api.targetUser: object expected"); + message.targetUser = $root.google.cloud.apihub.v1.AttributeValues.fromObject(object.targetUser); + } + if (object.team != null) { + if (typeof object.team !== "object") + throw TypeError(".google.cloud.apihub.v1.Api.team: object expected"); + message.team = $root.google.cloud.apihub.v1.AttributeValues.fromObject(object.team); + } + if (object.businessUnit != null) { + if (typeof object.businessUnit !== "object") + throw TypeError(".google.cloud.apihub.v1.Api.businessUnit: object expected"); + message.businessUnit = $root.google.cloud.apihub.v1.AttributeValues.fromObject(object.businessUnit); + } + if (object.maturityLevel != null) { + if (typeof object.maturityLevel !== "object") + throw TypeError(".google.cloud.apihub.v1.Api.maturityLevel: object expected"); + message.maturityLevel = $root.google.cloud.apihub.v1.AttributeValues.fromObject(object.maturityLevel); + } + if (object.attributes) { + if (typeof object.attributes !== "object") + throw TypeError(".google.cloud.apihub.v1.Api.attributes: object expected"); + message.attributes = {}; + for (var keys = Object.keys(object.attributes), i = 0; i < keys.length; ++i) { + if (typeof object.attributes[keys[i]] !== "object") + throw TypeError(".google.cloud.apihub.v1.Api.attributes: object expected"); + message.attributes[keys[i]] = $root.google.cloud.apihub.v1.AttributeValues.fromObject(object.attributes[keys[i]]); + } + } + if (object.apiStyle != null) { + if (typeof object.apiStyle !== "object") + throw TypeError(".google.cloud.apihub.v1.Api.apiStyle: object expected"); + message.apiStyle = $root.google.cloud.apihub.v1.AttributeValues.fromObject(object.apiStyle); + } + if (object.selectedVersion != null) + message.selectedVersion = String(object.selectedVersion); + return message; + }; + + /** + * Creates a plain object from an Api message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.Api + * @static + * @param {google.cloud.apihub.v1.Api} message Api + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Api.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.versions = []; + if (options.objects || options.defaults) + object.attributes = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.description = ""; + object.documentation = null; + object.owner = null; + object.createTime = null; + object.updateTime = null; + object.targetUser = null; + object.team = null; + object.businessUnit = null; + object.maturityLevel = null; + object.apiStyle = null; + object.selectedVersion = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.documentation != null && message.hasOwnProperty("documentation")) + object.documentation = $root.google.cloud.apihub.v1.Documentation.toObject(message.documentation, options); + if (message.owner != null && message.hasOwnProperty("owner")) + object.owner = $root.google.cloud.apihub.v1.Owner.toObject(message.owner, options); + if (message.versions && message.versions.length) { + object.versions = []; + for (var j = 0; j < message.versions.length; ++j) + object.versions[j] = message.versions[j]; + } + 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); + if (message.targetUser != null && message.hasOwnProperty("targetUser")) + object.targetUser = $root.google.cloud.apihub.v1.AttributeValues.toObject(message.targetUser, options); + if (message.team != null && message.hasOwnProperty("team")) + object.team = $root.google.cloud.apihub.v1.AttributeValues.toObject(message.team, options); + if (message.businessUnit != null && message.hasOwnProperty("businessUnit")) + object.businessUnit = $root.google.cloud.apihub.v1.AttributeValues.toObject(message.businessUnit, options); + if (message.maturityLevel != null && message.hasOwnProperty("maturityLevel")) + object.maturityLevel = $root.google.cloud.apihub.v1.AttributeValues.toObject(message.maturityLevel, options); + var keys2; + if (message.attributes && (keys2 = Object.keys(message.attributes)).length) { + object.attributes = {}; + for (var j = 0; j < keys2.length; ++j) + object.attributes[keys2[j]] = $root.google.cloud.apihub.v1.AttributeValues.toObject(message.attributes[keys2[j]], options); + } + if (message.apiStyle != null && message.hasOwnProperty("apiStyle")) + object.apiStyle = $root.google.cloud.apihub.v1.AttributeValues.toObject(message.apiStyle, options); + if (message.selectedVersion != null && message.hasOwnProperty("selectedVersion")) + object.selectedVersion = message.selectedVersion; + return object; + }; + + /** + * Converts this Api to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.Api + * @instance + * @returns {Object.} JSON object + */ + Api.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Api + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.Api + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Api.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.Api"; + }; + + return Api; + })(); + + v1.Version = (function() { + + /** + * Properties of a Version. + * @memberof google.cloud.apihub.v1 + * @interface IVersion + * @property {string|null} [name] Version name + * @property {string|null} [displayName] Version displayName + * @property {string|null} [description] Version description + * @property {google.cloud.apihub.v1.IDocumentation|null} [documentation] Version documentation + * @property {Array.|null} [specs] Version specs + * @property {Array.|null} [apiOperations] Version apiOperations + * @property {Array.|null} [definitions] Version definitions + * @property {Array.|null} [deployments] Version deployments + * @property {google.protobuf.ITimestamp|null} [createTime] Version createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Version updateTime + * @property {google.cloud.apihub.v1.IAttributeValues|null} [lifecycle] Version lifecycle + * @property {google.cloud.apihub.v1.IAttributeValues|null} [compliance] Version compliance + * @property {google.cloud.apihub.v1.IAttributeValues|null} [accreditation] Version accreditation + * @property {Object.|null} [attributes] Version attributes + * @property {string|null} [selectedDeployment] Version selectedDeployment + */ + + /** + * Constructs a new Version. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a Version. + * @implements IVersion + * @constructor + * @param {google.cloud.apihub.v1.IVersion=} [properties] Properties to set + */ + function Version(properties) { + this.specs = []; + this.apiOperations = []; + this.definitions = []; + this.deployments = []; + this.attributes = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Version name. + * @member {string} name + * @memberof google.cloud.apihub.v1.Version + * @instance + */ + Version.prototype.name = ""; + + /** + * Version displayName. + * @member {string} displayName + * @memberof google.cloud.apihub.v1.Version + * @instance + */ + Version.prototype.displayName = ""; + + /** + * Version description. + * @member {string} description + * @memberof google.cloud.apihub.v1.Version + * @instance + */ + Version.prototype.description = ""; + + /** + * Version documentation. + * @member {google.cloud.apihub.v1.IDocumentation|null|undefined} documentation + * @memberof google.cloud.apihub.v1.Version + * @instance + */ + Version.prototype.documentation = null; + + /** + * Version specs. + * @member {Array.} specs + * @memberof google.cloud.apihub.v1.Version + * @instance + */ + Version.prototype.specs = $util.emptyArray; + + /** + * Version apiOperations. + * @member {Array.} apiOperations + * @memberof google.cloud.apihub.v1.Version + * @instance + */ + Version.prototype.apiOperations = $util.emptyArray; + + /** + * Version definitions. + * @member {Array.} definitions + * @memberof google.cloud.apihub.v1.Version + * @instance + */ + Version.prototype.definitions = $util.emptyArray; + + /** + * Version deployments. + * @member {Array.} deployments + * @memberof google.cloud.apihub.v1.Version + * @instance + */ + Version.prototype.deployments = $util.emptyArray; + + /** + * Version createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.apihub.v1.Version + * @instance + */ + Version.prototype.createTime = null; + + /** + * Version updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.apihub.v1.Version + * @instance + */ + Version.prototype.updateTime = null; + + /** + * Version lifecycle. + * @member {google.cloud.apihub.v1.IAttributeValues|null|undefined} lifecycle + * @memberof google.cloud.apihub.v1.Version + * @instance + */ + Version.prototype.lifecycle = null; + + /** + * Version compliance. + * @member {google.cloud.apihub.v1.IAttributeValues|null|undefined} compliance + * @memberof google.cloud.apihub.v1.Version + * @instance + */ + Version.prototype.compliance = null; + + /** + * Version accreditation. + * @member {google.cloud.apihub.v1.IAttributeValues|null|undefined} accreditation + * @memberof google.cloud.apihub.v1.Version + * @instance + */ + Version.prototype.accreditation = null; + + /** + * Version attributes. + * @member {Object.} attributes + * @memberof google.cloud.apihub.v1.Version + * @instance + */ + Version.prototype.attributes = $util.emptyObject; + + /** + * Version selectedDeployment. + * @member {string} selectedDeployment + * @memberof google.cloud.apihub.v1.Version + * @instance + */ + Version.prototype.selectedDeployment = ""; + + /** + * Creates a new Version instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.Version + * @static + * @param {google.cloud.apihub.v1.IVersion=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.Version} Version instance + */ + Version.create = function create(properties) { + return new Version(properties); + }; + + /** + * Encodes the specified Version message. Does not implicitly {@link google.cloud.apihub.v1.Version.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.Version + * @static + * @param {google.cloud.apihub.v1.IVersion} message Version message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Version.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.documentation != null && Object.hasOwnProperty.call(message, "documentation")) + $root.google.cloud.apihub.v1.Documentation.encode(message.documentation, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.specs != null && message.specs.length) + for (var i = 0; i < message.specs.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.specs[i]); + if (message.apiOperations != null && message.apiOperations.length) + for (var i = 0; i < message.apiOperations.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.apiOperations[i]); + if (message.definitions != null && message.definitions.length) + for (var i = 0; i < message.definitions.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.definitions[i]); + if (message.deployments != null && message.deployments.length) + for (var i = 0; i < message.deployments.length; ++i) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.deployments[i]); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.lifecycle != null && Object.hasOwnProperty.call(message, "lifecycle")) + $root.google.cloud.apihub.v1.AttributeValues.encode(message.lifecycle, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.compliance != null && Object.hasOwnProperty.call(message, "compliance")) + $root.google.cloud.apihub.v1.AttributeValues.encode(message.compliance, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.accreditation != null && Object.hasOwnProperty.call(message, "accreditation")) + $root.google.cloud.apihub.v1.AttributeValues.encode(message.accreditation, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.attributes != null && Object.hasOwnProperty.call(message, "attributes")) + for (var keys = Object.keys(message.attributes), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 14, wireType 2 =*/114).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.apihub.v1.AttributeValues.encode(message.attributes[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.selectedDeployment != null && Object.hasOwnProperty.call(message, "selectedDeployment")) + writer.uint32(/* id 16, wireType 2 =*/130).string(message.selectedDeployment); + return writer; + }; + + /** + * Encodes the specified Version message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.Version.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.Version + * @static + * @param {google.cloud.apihub.v1.IVersion} message Version message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Version.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Version message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.Version + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.Version} Version + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Version.decode = function 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.apihub.v1.Version(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + message.documentation = $root.google.cloud.apihub.v1.Documentation.decode(reader, reader.uint32()); + break; + } + case 5: { + if (!(message.specs && message.specs.length)) + message.specs = []; + message.specs.push(reader.string()); + break; + } + case 6: { + if (!(message.apiOperations && message.apiOperations.length)) + message.apiOperations = []; + message.apiOperations.push(reader.string()); + break; + } + case 7: { + if (!(message.definitions && message.definitions.length)) + message.definitions = []; + message.definitions.push(reader.string()); + break; + } + case 8: { + if (!(message.deployments && message.deployments.length)) + message.deployments = []; + message.deployments.push(reader.string()); + break; + } + case 9: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 10: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 11: { + message.lifecycle = $root.google.cloud.apihub.v1.AttributeValues.decode(reader, reader.uint32()); + break; + } + case 12: { + message.compliance = $root.google.cloud.apihub.v1.AttributeValues.decode(reader, reader.uint32()); + break; + } + case 13: { + message.accreditation = $root.google.cloud.apihub.v1.AttributeValues.decode(reader, reader.uint32()); + break; + } + case 14: { + if (message.attributes === $util.emptyObject) + message.attributes = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.apihub.v1.AttributeValues.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.attributes[key] = value; + break; + } + case 16: { + message.selectedDeployment = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Version message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.Version + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.Version} Version + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Version.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Version message. + * @function verify + * @memberof google.cloud.apihub.v1.Version + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Version.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.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.documentation != null && message.hasOwnProperty("documentation")) { + var error = $root.google.cloud.apihub.v1.Documentation.verify(message.documentation); + if (error) + return "documentation." + error; + } + if (message.specs != null && message.hasOwnProperty("specs")) { + if (!Array.isArray(message.specs)) + return "specs: array expected"; + for (var i = 0; i < message.specs.length; ++i) + if (!$util.isString(message.specs[i])) + return "specs: string[] expected"; + } + if (message.apiOperations != null && message.hasOwnProperty("apiOperations")) { + if (!Array.isArray(message.apiOperations)) + return "apiOperations: array expected"; + for (var i = 0; i < message.apiOperations.length; ++i) + if (!$util.isString(message.apiOperations[i])) + return "apiOperations: string[] expected"; + } + if (message.definitions != null && message.hasOwnProperty("definitions")) { + if (!Array.isArray(message.definitions)) + return "definitions: array expected"; + for (var i = 0; i < message.definitions.length; ++i) + if (!$util.isString(message.definitions[i])) + return "definitions: string[] expected"; + } + if (message.deployments != null && message.hasOwnProperty("deployments")) { + if (!Array.isArray(message.deployments)) + return "deployments: array expected"; + for (var i = 0; i < message.deployments.length; ++i) + if (!$util.isString(message.deployments[i])) + return "deployments: 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.lifecycle != null && message.hasOwnProperty("lifecycle")) { + var error = $root.google.cloud.apihub.v1.AttributeValues.verify(message.lifecycle); + if (error) + return "lifecycle." + error; + } + if (message.compliance != null && message.hasOwnProperty("compliance")) { + var error = $root.google.cloud.apihub.v1.AttributeValues.verify(message.compliance); + if (error) + return "compliance." + error; + } + if (message.accreditation != null && message.hasOwnProperty("accreditation")) { + var error = $root.google.cloud.apihub.v1.AttributeValues.verify(message.accreditation); + if (error) + return "accreditation." + error; + } + if (message.attributes != null && message.hasOwnProperty("attributes")) { + if (!$util.isObject(message.attributes)) + return "attributes: object expected"; + var key = Object.keys(message.attributes); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.apihub.v1.AttributeValues.verify(message.attributes[key[i]]); + if (error) + return "attributes." + error; + } + } + if (message.selectedDeployment != null && message.hasOwnProperty("selectedDeployment")) + if (!$util.isString(message.selectedDeployment)) + return "selectedDeployment: string expected"; + return null; + }; + + /** + * Creates a Version message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.Version + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.Version} Version + */ + Version.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.Version) + return object; + var message = new $root.google.cloud.apihub.v1.Version(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.documentation != null) { + if (typeof object.documentation !== "object") + throw TypeError(".google.cloud.apihub.v1.Version.documentation: object expected"); + message.documentation = $root.google.cloud.apihub.v1.Documentation.fromObject(object.documentation); + } + if (object.specs) { + if (!Array.isArray(object.specs)) + throw TypeError(".google.cloud.apihub.v1.Version.specs: array expected"); + message.specs = []; + for (var i = 0; i < object.specs.length; ++i) + message.specs[i] = String(object.specs[i]); + } + if (object.apiOperations) { + if (!Array.isArray(object.apiOperations)) + throw TypeError(".google.cloud.apihub.v1.Version.apiOperations: array expected"); + message.apiOperations = []; + for (var i = 0; i < object.apiOperations.length; ++i) + message.apiOperations[i] = String(object.apiOperations[i]); + } + if (object.definitions) { + if (!Array.isArray(object.definitions)) + throw TypeError(".google.cloud.apihub.v1.Version.definitions: array expected"); + message.definitions = []; + for (var i = 0; i < object.definitions.length; ++i) + message.definitions[i] = String(object.definitions[i]); + } + if (object.deployments) { + if (!Array.isArray(object.deployments)) + throw TypeError(".google.cloud.apihub.v1.Version.deployments: array expected"); + message.deployments = []; + for (var i = 0; i < object.deployments.length; ++i) + message.deployments[i] = String(object.deployments[i]); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.apihub.v1.Version.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.apihub.v1.Version.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.lifecycle != null) { + if (typeof object.lifecycle !== "object") + throw TypeError(".google.cloud.apihub.v1.Version.lifecycle: object expected"); + message.lifecycle = $root.google.cloud.apihub.v1.AttributeValues.fromObject(object.lifecycle); + } + if (object.compliance != null) { + if (typeof object.compliance !== "object") + throw TypeError(".google.cloud.apihub.v1.Version.compliance: object expected"); + message.compliance = $root.google.cloud.apihub.v1.AttributeValues.fromObject(object.compliance); + } + if (object.accreditation != null) { + if (typeof object.accreditation !== "object") + throw TypeError(".google.cloud.apihub.v1.Version.accreditation: object expected"); + message.accreditation = $root.google.cloud.apihub.v1.AttributeValues.fromObject(object.accreditation); + } + if (object.attributes) { + if (typeof object.attributes !== "object") + throw TypeError(".google.cloud.apihub.v1.Version.attributes: object expected"); + message.attributes = {}; + for (var keys = Object.keys(object.attributes), i = 0; i < keys.length; ++i) { + if (typeof object.attributes[keys[i]] !== "object") + throw TypeError(".google.cloud.apihub.v1.Version.attributes: object expected"); + message.attributes[keys[i]] = $root.google.cloud.apihub.v1.AttributeValues.fromObject(object.attributes[keys[i]]); + } + } + if (object.selectedDeployment != null) + message.selectedDeployment = String(object.selectedDeployment); + return message; + }; + + /** + * Creates a plain object from a Version message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.Version + * @static + * @param {google.cloud.apihub.v1.Version} message Version + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Version.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.specs = []; + object.apiOperations = []; + object.definitions = []; + object.deployments = []; + } + if (options.objects || options.defaults) + object.attributes = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.description = ""; + object.documentation = null; + object.createTime = null; + object.updateTime = null; + object.lifecycle = null; + object.compliance = null; + object.accreditation = null; + object.selectedDeployment = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.documentation != null && message.hasOwnProperty("documentation")) + object.documentation = $root.google.cloud.apihub.v1.Documentation.toObject(message.documentation, options); + if (message.specs && message.specs.length) { + object.specs = []; + for (var j = 0; j < message.specs.length; ++j) + object.specs[j] = message.specs[j]; + } + if (message.apiOperations && message.apiOperations.length) { + object.apiOperations = []; + for (var j = 0; j < message.apiOperations.length; ++j) + object.apiOperations[j] = message.apiOperations[j]; + } + if (message.definitions && message.definitions.length) { + object.definitions = []; + for (var j = 0; j < message.definitions.length; ++j) + object.definitions[j] = message.definitions[j]; + } + if (message.deployments && message.deployments.length) { + object.deployments = []; + for (var j = 0; j < message.deployments.length; ++j) + object.deployments[j] = message.deployments[j]; + } + 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); + if (message.lifecycle != null && message.hasOwnProperty("lifecycle")) + object.lifecycle = $root.google.cloud.apihub.v1.AttributeValues.toObject(message.lifecycle, options); + if (message.compliance != null && message.hasOwnProperty("compliance")) + object.compliance = $root.google.cloud.apihub.v1.AttributeValues.toObject(message.compliance, options); + if (message.accreditation != null && message.hasOwnProperty("accreditation")) + object.accreditation = $root.google.cloud.apihub.v1.AttributeValues.toObject(message.accreditation, options); + var keys2; + if (message.attributes && (keys2 = Object.keys(message.attributes)).length) { + object.attributes = {}; + for (var j = 0; j < keys2.length; ++j) + object.attributes[keys2[j]] = $root.google.cloud.apihub.v1.AttributeValues.toObject(message.attributes[keys2[j]], options); + } + if (message.selectedDeployment != null && message.hasOwnProperty("selectedDeployment")) + object.selectedDeployment = message.selectedDeployment; + return object; + }; + + /** + * Converts this Version to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.Version + * @instance + * @returns {Object.} JSON object + */ + Version.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Version + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.Version + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Version.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.Version"; + }; + + return Version; + })(); + + v1.Spec = (function() { + + /** + * Properties of a Spec. + * @memberof google.cloud.apihub.v1 + * @interface ISpec + * @property {string|null} [name] Spec name + * @property {string|null} [displayName] Spec displayName + * @property {google.cloud.apihub.v1.IAttributeValues|null} [specType] Spec specType + * @property {google.cloud.apihub.v1.ISpecContents|null} [contents] Spec contents + * @property {google.cloud.apihub.v1.ISpecDetails|null} [details] Spec details + * @property {string|null} [sourceUri] Spec sourceUri + * @property {google.protobuf.ITimestamp|null} [createTime] Spec createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Spec updateTime + * @property {google.cloud.apihub.v1.ILintResponse|null} [lintResponse] Spec lintResponse + * @property {Object.|null} [attributes] Spec attributes + * @property {google.cloud.apihub.v1.IDocumentation|null} [documentation] Spec documentation + * @property {google.cloud.apihub.v1.Spec.ParsingMode|null} [parsingMode] Spec parsingMode + */ + + /** + * Constructs a new Spec. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a Spec. + * @implements ISpec + * @constructor + * @param {google.cloud.apihub.v1.ISpec=} [properties] Properties to set + */ + function Spec(properties) { + this.attributes = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Spec name. + * @member {string} name + * @memberof google.cloud.apihub.v1.Spec + * @instance + */ + Spec.prototype.name = ""; + + /** + * Spec displayName. + * @member {string} displayName + * @memberof google.cloud.apihub.v1.Spec + * @instance + */ + Spec.prototype.displayName = ""; + + /** + * Spec specType. + * @member {google.cloud.apihub.v1.IAttributeValues|null|undefined} specType + * @memberof google.cloud.apihub.v1.Spec + * @instance + */ + Spec.prototype.specType = null; + + /** + * Spec contents. + * @member {google.cloud.apihub.v1.ISpecContents|null|undefined} contents + * @memberof google.cloud.apihub.v1.Spec + * @instance + */ + Spec.prototype.contents = null; + + /** + * Spec details. + * @member {google.cloud.apihub.v1.ISpecDetails|null|undefined} details + * @memberof google.cloud.apihub.v1.Spec + * @instance + */ + Spec.prototype.details = null; + + /** + * Spec sourceUri. + * @member {string} sourceUri + * @memberof google.cloud.apihub.v1.Spec + * @instance + */ + Spec.prototype.sourceUri = ""; + + /** + * Spec createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.apihub.v1.Spec + * @instance + */ + Spec.prototype.createTime = null; + + /** + * Spec updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.apihub.v1.Spec + * @instance + */ + Spec.prototype.updateTime = null; + + /** + * Spec lintResponse. + * @member {google.cloud.apihub.v1.ILintResponse|null|undefined} lintResponse + * @memberof google.cloud.apihub.v1.Spec + * @instance + */ + Spec.prototype.lintResponse = null; + + /** + * Spec attributes. + * @member {Object.} attributes + * @memberof google.cloud.apihub.v1.Spec + * @instance + */ + Spec.prototype.attributes = $util.emptyObject; + + /** + * Spec documentation. + * @member {google.cloud.apihub.v1.IDocumentation|null|undefined} documentation + * @memberof google.cloud.apihub.v1.Spec + * @instance + */ + Spec.prototype.documentation = null; + + /** + * Spec parsingMode. + * @member {google.cloud.apihub.v1.Spec.ParsingMode} parsingMode + * @memberof google.cloud.apihub.v1.Spec + * @instance + */ + Spec.prototype.parsingMode = 0; + + /** + * Creates a new Spec instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.Spec + * @static + * @param {google.cloud.apihub.v1.ISpec=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.Spec} Spec instance + */ + Spec.create = function create(properties) { + return new Spec(properties); + }; + + /** + * Encodes the specified Spec message. Does not implicitly {@link google.cloud.apihub.v1.Spec.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.Spec + * @static + * @param {google.cloud.apihub.v1.ISpec} message Spec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Spec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.specType != null && Object.hasOwnProperty.call(message, "specType")) + $root.google.cloud.apihub.v1.AttributeValues.encode(message.specType, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.contents != null && Object.hasOwnProperty.call(message, "contents")) + $root.google.cloud.apihub.v1.SpecContents.encode(message.contents, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.details != null && Object.hasOwnProperty.call(message, "details")) + $root.google.cloud.apihub.v1.SpecDetails.encode(message.details, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.sourceUri != null && Object.hasOwnProperty.call(message, "sourceUri")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.sourceUri); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.lintResponse != null && Object.hasOwnProperty.call(message, "lintResponse")) + $root.google.cloud.apihub.v1.LintResponse.encode(message.lintResponse, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.attributes != null && Object.hasOwnProperty.call(message, "attributes")) + for (var keys = Object.keys(message.attributes), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 10, wireType 2 =*/82).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.apihub.v1.AttributeValues.encode(message.attributes[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.documentation != null && Object.hasOwnProperty.call(message, "documentation")) + $root.google.cloud.apihub.v1.Documentation.encode(message.documentation, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.parsingMode != null && Object.hasOwnProperty.call(message, "parsingMode")) + writer.uint32(/* id 12, wireType 0 =*/96).int32(message.parsingMode); + return writer; + }; + + /** + * Encodes the specified Spec message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.Spec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.Spec + * @static + * @param {google.cloud.apihub.v1.ISpec} message Spec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Spec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Spec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.Spec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.Spec} Spec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Spec.decode = function 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.apihub.v1.Spec(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.specType = $root.google.cloud.apihub.v1.AttributeValues.decode(reader, reader.uint32()); + break; + } + case 4: { + message.contents = $root.google.cloud.apihub.v1.SpecContents.decode(reader, reader.uint32()); + break; + } + case 5: { + message.details = $root.google.cloud.apihub.v1.SpecDetails.decode(reader, reader.uint32()); + break; + } + case 6: { + message.sourceUri = reader.string(); + break; + } + case 7: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 8: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 9: { + message.lintResponse = $root.google.cloud.apihub.v1.LintResponse.decode(reader, reader.uint32()); + break; + } + case 10: { + if (message.attributes === $util.emptyObject) + message.attributes = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.apihub.v1.AttributeValues.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.attributes[key] = value; + break; + } + case 11: { + message.documentation = $root.google.cloud.apihub.v1.Documentation.decode(reader, reader.uint32()); + break; + } + case 12: { + message.parsingMode = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Spec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.Spec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.Spec} Spec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Spec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Spec message. + * @function verify + * @memberof google.cloud.apihub.v1.Spec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Spec.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.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.specType != null && message.hasOwnProperty("specType")) { + var error = $root.google.cloud.apihub.v1.AttributeValues.verify(message.specType); + if (error) + return "specType." + error; + } + if (message.contents != null && message.hasOwnProperty("contents")) { + var error = $root.google.cloud.apihub.v1.SpecContents.verify(message.contents); + if (error) + return "contents." + error; + } + if (message.details != null && message.hasOwnProperty("details")) { + var error = $root.google.cloud.apihub.v1.SpecDetails.verify(message.details); + if (error) + return "details." + error; + } + if (message.sourceUri != null && message.hasOwnProperty("sourceUri")) + if (!$util.isString(message.sourceUri)) + return "sourceUri: 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.lintResponse != null && message.hasOwnProperty("lintResponse")) { + var error = $root.google.cloud.apihub.v1.LintResponse.verify(message.lintResponse); + if (error) + return "lintResponse." + error; + } + if (message.attributes != null && message.hasOwnProperty("attributes")) { + if (!$util.isObject(message.attributes)) + return "attributes: object expected"; + var key = Object.keys(message.attributes); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.apihub.v1.AttributeValues.verify(message.attributes[key[i]]); + if (error) + return "attributes." + error; + } + } + if (message.documentation != null && message.hasOwnProperty("documentation")) { + var error = $root.google.cloud.apihub.v1.Documentation.verify(message.documentation); + if (error) + return "documentation." + error; + } + if (message.parsingMode != null && message.hasOwnProperty("parsingMode")) + switch (message.parsingMode) { + default: + return "parsingMode: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a Spec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.Spec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.Spec} Spec + */ + Spec.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.Spec) + return object; + var message = new $root.google.cloud.apihub.v1.Spec(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.specType != null) { + if (typeof object.specType !== "object") + throw TypeError(".google.cloud.apihub.v1.Spec.specType: object expected"); + message.specType = $root.google.cloud.apihub.v1.AttributeValues.fromObject(object.specType); + } + if (object.contents != null) { + if (typeof object.contents !== "object") + throw TypeError(".google.cloud.apihub.v1.Spec.contents: object expected"); + message.contents = $root.google.cloud.apihub.v1.SpecContents.fromObject(object.contents); + } + if (object.details != null) { + if (typeof object.details !== "object") + throw TypeError(".google.cloud.apihub.v1.Spec.details: object expected"); + message.details = $root.google.cloud.apihub.v1.SpecDetails.fromObject(object.details); + } + if (object.sourceUri != null) + message.sourceUri = String(object.sourceUri); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.apihub.v1.Spec.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.apihub.v1.Spec.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.lintResponse != null) { + if (typeof object.lintResponse !== "object") + throw TypeError(".google.cloud.apihub.v1.Spec.lintResponse: object expected"); + message.lintResponse = $root.google.cloud.apihub.v1.LintResponse.fromObject(object.lintResponse); + } + if (object.attributes) { + if (typeof object.attributes !== "object") + throw TypeError(".google.cloud.apihub.v1.Spec.attributes: object expected"); + message.attributes = {}; + for (var keys = Object.keys(object.attributes), i = 0; i < keys.length; ++i) { + if (typeof object.attributes[keys[i]] !== "object") + throw TypeError(".google.cloud.apihub.v1.Spec.attributes: object expected"); + message.attributes[keys[i]] = $root.google.cloud.apihub.v1.AttributeValues.fromObject(object.attributes[keys[i]]); + } + } + if (object.documentation != null) { + if (typeof object.documentation !== "object") + throw TypeError(".google.cloud.apihub.v1.Spec.documentation: object expected"); + message.documentation = $root.google.cloud.apihub.v1.Documentation.fromObject(object.documentation); + } + switch (object.parsingMode) { + default: + if (typeof object.parsingMode === "number") { + message.parsingMode = object.parsingMode; + break; + } + break; + case "PARSING_MODE_UNSPECIFIED": + case 0: + message.parsingMode = 0; + break; + case "RELAXED": + case 1: + message.parsingMode = 1; + break; + case "STRICT": + case 2: + message.parsingMode = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a Spec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.Spec + * @static + * @param {google.cloud.apihub.v1.Spec} message Spec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Spec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.attributes = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.specType = null; + object.contents = null; + object.details = null; + object.sourceUri = ""; + object.createTime = null; + object.updateTime = null; + object.lintResponse = null; + object.documentation = null; + object.parsingMode = options.enums === String ? "PARSING_MODE_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.specType != null && message.hasOwnProperty("specType")) + object.specType = $root.google.cloud.apihub.v1.AttributeValues.toObject(message.specType, options); + if (message.contents != null && message.hasOwnProperty("contents")) + object.contents = $root.google.cloud.apihub.v1.SpecContents.toObject(message.contents, options); + if (message.details != null && message.hasOwnProperty("details")) + object.details = $root.google.cloud.apihub.v1.SpecDetails.toObject(message.details, options); + if (message.sourceUri != null && message.hasOwnProperty("sourceUri")) + object.sourceUri = message.sourceUri; + 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); + if (message.lintResponse != null && message.hasOwnProperty("lintResponse")) + object.lintResponse = $root.google.cloud.apihub.v1.LintResponse.toObject(message.lintResponse, options); + var keys2; + if (message.attributes && (keys2 = Object.keys(message.attributes)).length) { + object.attributes = {}; + for (var j = 0; j < keys2.length; ++j) + object.attributes[keys2[j]] = $root.google.cloud.apihub.v1.AttributeValues.toObject(message.attributes[keys2[j]], options); + } + if (message.documentation != null && message.hasOwnProperty("documentation")) + object.documentation = $root.google.cloud.apihub.v1.Documentation.toObject(message.documentation, options); + if (message.parsingMode != null && message.hasOwnProperty("parsingMode")) + object.parsingMode = options.enums === String ? $root.google.cloud.apihub.v1.Spec.ParsingMode[message.parsingMode] === undefined ? message.parsingMode : $root.google.cloud.apihub.v1.Spec.ParsingMode[message.parsingMode] : message.parsingMode; + return object; + }; + + /** + * Converts this Spec to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.Spec + * @instance + * @returns {Object.} JSON object + */ + Spec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Spec + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.Spec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Spec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.Spec"; + }; + + /** + * ParsingMode enum. + * @name google.cloud.apihub.v1.Spec.ParsingMode + * @enum {number} + * @property {number} PARSING_MODE_UNSPECIFIED=0 PARSING_MODE_UNSPECIFIED value + * @property {number} RELAXED=1 RELAXED value + * @property {number} STRICT=2 STRICT value + */ + Spec.ParsingMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PARSING_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "RELAXED"] = 1; + values[valuesById[2] = "STRICT"] = 2; + return values; + })(); + + return Spec; + })(); + + v1.Deployment = (function() { + + /** + * Properties of a Deployment. + * @memberof google.cloud.apihub.v1 + * @interface IDeployment + * @property {string|null} [name] Deployment name + * @property {string|null} [displayName] Deployment displayName + * @property {string|null} [description] Deployment description + * @property {google.cloud.apihub.v1.IDocumentation|null} [documentation] Deployment documentation + * @property {google.cloud.apihub.v1.IAttributeValues|null} [deploymentType] Deployment deploymentType + * @property {string|null} [resourceUri] Deployment resourceUri + * @property {Array.|null} [endpoints] Deployment endpoints + * @property {Array.|null} [apiVersions] Deployment apiVersions + * @property {google.protobuf.ITimestamp|null} [createTime] Deployment createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Deployment updateTime + * @property {google.cloud.apihub.v1.IAttributeValues|null} [slo] Deployment slo + * @property {google.cloud.apihub.v1.IAttributeValues|null} [environment] Deployment environment + * @property {Object.|null} [attributes] Deployment attributes + */ + + /** + * Constructs a new Deployment. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a Deployment. + * @implements IDeployment + * @constructor + * @param {google.cloud.apihub.v1.IDeployment=} [properties] Properties to set + */ + function Deployment(properties) { + this.endpoints = []; + this.apiVersions = []; + this.attributes = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Deployment name. + * @member {string} name + * @memberof google.cloud.apihub.v1.Deployment + * @instance + */ + Deployment.prototype.name = ""; + + /** + * Deployment displayName. + * @member {string} displayName + * @memberof google.cloud.apihub.v1.Deployment + * @instance + */ + Deployment.prototype.displayName = ""; + + /** + * Deployment description. + * @member {string} description + * @memberof google.cloud.apihub.v1.Deployment + * @instance + */ + Deployment.prototype.description = ""; + + /** + * Deployment documentation. + * @member {google.cloud.apihub.v1.IDocumentation|null|undefined} documentation + * @memberof google.cloud.apihub.v1.Deployment + * @instance + */ + Deployment.prototype.documentation = null; + + /** + * Deployment deploymentType. + * @member {google.cloud.apihub.v1.IAttributeValues|null|undefined} deploymentType + * @memberof google.cloud.apihub.v1.Deployment + * @instance + */ + Deployment.prototype.deploymentType = null; + + /** + * Deployment resourceUri. + * @member {string} resourceUri + * @memberof google.cloud.apihub.v1.Deployment + * @instance + */ + Deployment.prototype.resourceUri = ""; + + /** + * Deployment endpoints. + * @member {Array.} endpoints + * @memberof google.cloud.apihub.v1.Deployment + * @instance + */ + Deployment.prototype.endpoints = $util.emptyArray; + + /** + * Deployment apiVersions. + * @member {Array.} apiVersions + * @memberof google.cloud.apihub.v1.Deployment + * @instance + */ + Deployment.prototype.apiVersions = $util.emptyArray; + + /** + * Deployment createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.apihub.v1.Deployment + * @instance + */ + Deployment.prototype.createTime = null; + + /** + * Deployment updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.apihub.v1.Deployment + * @instance + */ + Deployment.prototype.updateTime = null; + + /** + * Deployment slo. + * @member {google.cloud.apihub.v1.IAttributeValues|null|undefined} slo + * @memberof google.cloud.apihub.v1.Deployment + * @instance + */ + Deployment.prototype.slo = null; + + /** + * Deployment environment. + * @member {google.cloud.apihub.v1.IAttributeValues|null|undefined} environment + * @memberof google.cloud.apihub.v1.Deployment + * @instance + */ + Deployment.prototype.environment = null; + + /** + * Deployment attributes. + * @member {Object.} attributes + * @memberof google.cloud.apihub.v1.Deployment + * @instance + */ + Deployment.prototype.attributes = $util.emptyObject; + + /** + * Creates a new Deployment instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.Deployment + * @static + * @param {google.cloud.apihub.v1.IDeployment=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.Deployment} Deployment instance + */ + Deployment.create = function create(properties) { + return new Deployment(properties); + }; + + /** + * Encodes the specified Deployment message. Does not implicitly {@link google.cloud.apihub.v1.Deployment.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.Deployment + * @static + * @param {google.cloud.apihub.v1.IDeployment} message Deployment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Deployment.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.documentation != null && Object.hasOwnProperty.call(message, "documentation")) + $root.google.cloud.apihub.v1.Documentation.encode(message.documentation, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.deploymentType != null && Object.hasOwnProperty.call(message, "deploymentType")) + $root.google.cloud.apihub.v1.AttributeValues.encode(message.deploymentType, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.resourceUri != null && Object.hasOwnProperty.call(message, "resourceUri")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.resourceUri); + if (message.endpoints != null && message.endpoints.length) + for (var i = 0; i < message.endpoints.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.endpoints[i]); + if (message.apiVersions != null && message.apiVersions.length) + for (var i = 0; i < message.apiVersions.length; ++i) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.apiVersions[i]); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.slo != null && Object.hasOwnProperty.call(message, "slo")) + $root.google.cloud.apihub.v1.AttributeValues.encode(message.slo, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.environment != null && Object.hasOwnProperty.call(message, "environment")) + $root.google.cloud.apihub.v1.AttributeValues.encode(message.environment, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.attributes != null && Object.hasOwnProperty.call(message, "attributes")) + for (var keys = Object.keys(message.attributes), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 13, wireType 2 =*/106).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.apihub.v1.AttributeValues.encode(message.attributes[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified Deployment message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.Deployment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.Deployment + * @static + * @param {google.cloud.apihub.v1.IDeployment} message Deployment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Deployment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Deployment message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.Deployment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.Deployment} Deployment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Deployment.decode = function 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.apihub.v1.Deployment(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + message.documentation = $root.google.cloud.apihub.v1.Documentation.decode(reader, reader.uint32()); + break; + } + case 5: { + message.deploymentType = $root.google.cloud.apihub.v1.AttributeValues.decode(reader, reader.uint32()); + break; + } + case 6: { + message.resourceUri = reader.string(); + break; + } + case 7: { + if (!(message.endpoints && message.endpoints.length)) + message.endpoints = []; + message.endpoints.push(reader.string()); + break; + } + case 8: { + if (!(message.apiVersions && message.apiVersions.length)) + message.apiVersions = []; + message.apiVersions.push(reader.string()); + break; + } + case 9: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 10: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 11: { + message.slo = $root.google.cloud.apihub.v1.AttributeValues.decode(reader, reader.uint32()); + break; + } + case 12: { + message.environment = $root.google.cloud.apihub.v1.AttributeValues.decode(reader, reader.uint32()); + break; + } + case 13: { + if (message.attributes === $util.emptyObject) + message.attributes = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.apihub.v1.AttributeValues.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.attributes[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Deployment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.Deployment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.Deployment} Deployment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Deployment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Deployment message. + * @function verify + * @memberof google.cloud.apihub.v1.Deployment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Deployment.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.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.documentation != null && message.hasOwnProperty("documentation")) { + var error = $root.google.cloud.apihub.v1.Documentation.verify(message.documentation); + if (error) + return "documentation." + error; + } + if (message.deploymentType != null && message.hasOwnProperty("deploymentType")) { + var error = $root.google.cloud.apihub.v1.AttributeValues.verify(message.deploymentType); + if (error) + return "deploymentType." + error; + } + if (message.resourceUri != null && message.hasOwnProperty("resourceUri")) + if (!$util.isString(message.resourceUri)) + return "resourceUri: string expected"; + if (message.endpoints != null && message.hasOwnProperty("endpoints")) { + if (!Array.isArray(message.endpoints)) + return "endpoints: array expected"; + for (var i = 0; i < message.endpoints.length; ++i) + if (!$util.isString(message.endpoints[i])) + return "endpoints: string[] expected"; + } + if (message.apiVersions != null && message.hasOwnProperty("apiVersions")) { + if (!Array.isArray(message.apiVersions)) + return "apiVersions: array expected"; + for (var i = 0; i < message.apiVersions.length; ++i) + if (!$util.isString(message.apiVersions[i])) + return "apiVersions: 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.slo != null && message.hasOwnProperty("slo")) { + var error = $root.google.cloud.apihub.v1.AttributeValues.verify(message.slo); + if (error) + return "slo." + error; + } + if (message.environment != null && message.hasOwnProperty("environment")) { + var error = $root.google.cloud.apihub.v1.AttributeValues.verify(message.environment); + if (error) + return "environment." + error; + } + if (message.attributes != null && message.hasOwnProperty("attributes")) { + if (!$util.isObject(message.attributes)) + return "attributes: object expected"; + var key = Object.keys(message.attributes); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.apihub.v1.AttributeValues.verify(message.attributes[key[i]]); + if (error) + return "attributes." + error; + } + } + return null; + }; + + /** + * Creates a Deployment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.Deployment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.Deployment} Deployment + */ + Deployment.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.Deployment) + return object; + var message = new $root.google.cloud.apihub.v1.Deployment(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.documentation != null) { + if (typeof object.documentation !== "object") + throw TypeError(".google.cloud.apihub.v1.Deployment.documentation: object expected"); + message.documentation = $root.google.cloud.apihub.v1.Documentation.fromObject(object.documentation); + } + if (object.deploymentType != null) { + if (typeof object.deploymentType !== "object") + throw TypeError(".google.cloud.apihub.v1.Deployment.deploymentType: object expected"); + message.deploymentType = $root.google.cloud.apihub.v1.AttributeValues.fromObject(object.deploymentType); + } + if (object.resourceUri != null) + message.resourceUri = String(object.resourceUri); + if (object.endpoints) { + if (!Array.isArray(object.endpoints)) + throw TypeError(".google.cloud.apihub.v1.Deployment.endpoints: array expected"); + message.endpoints = []; + for (var i = 0; i < object.endpoints.length; ++i) + message.endpoints[i] = String(object.endpoints[i]); + } + if (object.apiVersions) { + if (!Array.isArray(object.apiVersions)) + throw TypeError(".google.cloud.apihub.v1.Deployment.apiVersions: array expected"); + message.apiVersions = []; + for (var i = 0; i < object.apiVersions.length; ++i) + message.apiVersions[i] = String(object.apiVersions[i]); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.apihub.v1.Deployment.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.apihub.v1.Deployment.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.slo != null) { + if (typeof object.slo !== "object") + throw TypeError(".google.cloud.apihub.v1.Deployment.slo: object expected"); + message.slo = $root.google.cloud.apihub.v1.AttributeValues.fromObject(object.slo); + } + if (object.environment != null) { + if (typeof object.environment !== "object") + throw TypeError(".google.cloud.apihub.v1.Deployment.environment: object expected"); + message.environment = $root.google.cloud.apihub.v1.AttributeValues.fromObject(object.environment); + } + if (object.attributes) { + if (typeof object.attributes !== "object") + throw TypeError(".google.cloud.apihub.v1.Deployment.attributes: object expected"); + message.attributes = {}; + for (var keys = Object.keys(object.attributes), i = 0; i < keys.length; ++i) { + if (typeof object.attributes[keys[i]] !== "object") + throw TypeError(".google.cloud.apihub.v1.Deployment.attributes: object expected"); + message.attributes[keys[i]] = $root.google.cloud.apihub.v1.AttributeValues.fromObject(object.attributes[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a Deployment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.Deployment + * @static + * @param {google.cloud.apihub.v1.Deployment} message Deployment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Deployment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.endpoints = []; + object.apiVersions = []; + } + if (options.objects || options.defaults) + object.attributes = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.description = ""; + object.documentation = null; + object.deploymentType = null; + object.resourceUri = ""; + object.createTime = null; + object.updateTime = null; + object.slo = null; + object.environment = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.documentation != null && message.hasOwnProperty("documentation")) + object.documentation = $root.google.cloud.apihub.v1.Documentation.toObject(message.documentation, options); + if (message.deploymentType != null && message.hasOwnProperty("deploymentType")) + object.deploymentType = $root.google.cloud.apihub.v1.AttributeValues.toObject(message.deploymentType, options); + if (message.resourceUri != null && message.hasOwnProperty("resourceUri")) + object.resourceUri = message.resourceUri; + if (message.endpoints && message.endpoints.length) { + object.endpoints = []; + for (var j = 0; j < message.endpoints.length; ++j) + object.endpoints[j] = message.endpoints[j]; + } + if (message.apiVersions && message.apiVersions.length) { + object.apiVersions = []; + for (var j = 0; j < message.apiVersions.length; ++j) + object.apiVersions[j] = message.apiVersions[j]; + } + 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); + if (message.slo != null && message.hasOwnProperty("slo")) + object.slo = $root.google.cloud.apihub.v1.AttributeValues.toObject(message.slo, options); + if (message.environment != null && message.hasOwnProperty("environment")) + object.environment = $root.google.cloud.apihub.v1.AttributeValues.toObject(message.environment, options); + var keys2; + if (message.attributes && (keys2 = Object.keys(message.attributes)).length) { + object.attributes = {}; + for (var j = 0; j < keys2.length; ++j) + object.attributes[keys2[j]] = $root.google.cloud.apihub.v1.AttributeValues.toObject(message.attributes[keys2[j]], options); + } + return object; + }; + + /** + * Converts this Deployment to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.Deployment + * @instance + * @returns {Object.} JSON object + */ + Deployment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Deployment + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.Deployment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Deployment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.Deployment"; + }; + + return Deployment; + })(); + + v1.ApiOperation = (function() { + + /** + * Properties of an ApiOperation. + * @memberof google.cloud.apihub.v1 + * @interface IApiOperation + * @property {string|null} [name] ApiOperation name + * @property {string|null} [spec] ApiOperation spec + * @property {google.cloud.apihub.v1.IOperationDetails|null} [details] ApiOperation details + * @property {google.protobuf.ITimestamp|null} [createTime] ApiOperation createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] ApiOperation updateTime + * @property {Object.|null} [attributes] ApiOperation attributes + */ + + /** + * Constructs a new ApiOperation. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents an ApiOperation. + * @implements IApiOperation + * @constructor + * @param {google.cloud.apihub.v1.IApiOperation=} [properties] Properties to set + */ + function ApiOperation(properties) { + this.attributes = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ApiOperation name. + * @member {string} name + * @memberof google.cloud.apihub.v1.ApiOperation + * @instance + */ + ApiOperation.prototype.name = ""; + + /** + * ApiOperation spec. + * @member {string} spec + * @memberof google.cloud.apihub.v1.ApiOperation + * @instance + */ + ApiOperation.prototype.spec = ""; + + /** + * ApiOperation details. + * @member {google.cloud.apihub.v1.IOperationDetails|null|undefined} details + * @memberof google.cloud.apihub.v1.ApiOperation + * @instance + */ + ApiOperation.prototype.details = null; + + /** + * ApiOperation createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.apihub.v1.ApiOperation + * @instance + */ + ApiOperation.prototype.createTime = null; + + /** + * ApiOperation updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.apihub.v1.ApiOperation + * @instance + */ + ApiOperation.prototype.updateTime = null; + + /** + * ApiOperation attributes. + * @member {Object.} attributes + * @memberof google.cloud.apihub.v1.ApiOperation + * @instance + */ + ApiOperation.prototype.attributes = $util.emptyObject; + + /** + * Creates a new ApiOperation instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.ApiOperation + * @static + * @param {google.cloud.apihub.v1.IApiOperation=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.ApiOperation} ApiOperation instance + */ + ApiOperation.create = function create(properties) { + return new ApiOperation(properties); + }; + + /** + * Encodes the specified ApiOperation message. Does not implicitly {@link google.cloud.apihub.v1.ApiOperation.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.ApiOperation + * @static + * @param {google.cloud.apihub.v1.IApiOperation} message ApiOperation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApiOperation.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.spec != null && Object.hasOwnProperty.call(message, "spec")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.spec); + if (message.details != null && Object.hasOwnProperty.call(message, "details")) + $root.google.cloud.apihub.v1.OperationDetails.encode(message.details, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.attributes != null && Object.hasOwnProperty.call(message, "attributes")) + for (var keys = Object.keys(message.attributes), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.apihub.v1.AttributeValues.encode(message.attributes[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified ApiOperation message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ApiOperation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.ApiOperation + * @static + * @param {google.cloud.apihub.v1.IApiOperation} message ApiOperation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApiOperation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ApiOperation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.ApiOperation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.ApiOperation} ApiOperation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApiOperation.decode = function 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.apihub.v1.ApiOperation(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.spec = reader.string(); + break; + } + case 3: { + message.details = $root.google.cloud.apihub.v1.OperationDetails.decode(reader, reader.uint32()); + break; + } + case 4: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + if (message.attributes === $util.emptyObject) + message.attributes = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.apihub.v1.AttributeValues.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.attributes[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ApiOperation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.ApiOperation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.ApiOperation} ApiOperation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApiOperation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ApiOperation message. + * @function verify + * @memberof google.cloud.apihub.v1.ApiOperation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ApiOperation.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.spec != null && message.hasOwnProperty("spec")) + if (!$util.isString(message.spec)) + return "spec: string expected"; + if (message.details != null && message.hasOwnProperty("details")) { + var error = $root.google.cloud.apihub.v1.OperationDetails.verify(message.details); + if (error) + return "details." + error; + } + 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.attributes != null && message.hasOwnProperty("attributes")) { + if (!$util.isObject(message.attributes)) + return "attributes: object expected"; + var key = Object.keys(message.attributes); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.apihub.v1.AttributeValues.verify(message.attributes[key[i]]); + if (error) + return "attributes." + error; + } + } + return null; + }; + + /** + * Creates an ApiOperation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.ApiOperation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.ApiOperation} ApiOperation + */ + ApiOperation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.ApiOperation) + return object; + var message = new $root.google.cloud.apihub.v1.ApiOperation(); + if (object.name != null) + message.name = String(object.name); + if (object.spec != null) + message.spec = String(object.spec); + if (object.details != null) { + if (typeof object.details !== "object") + throw TypeError(".google.cloud.apihub.v1.ApiOperation.details: object expected"); + message.details = $root.google.cloud.apihub.v1.OperationDetails.fromObject(object.details); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.apihub.v1.ApiOperation.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.apihub.v1.ApiOperation.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.attributes) { + if (typeof object.attributes !== "object") + throw TypeError(".google.cloud.apihub.v1.ApiOperation.attributes: object expected"); + message.attributes = {}; + for (var keys = Object.keys(object.attributes), i = 0; i < keys.length; ++i) { + if (typeof object.attributes[keys[i]] !== "object") + throw TypeError(".google.cloud.apihub.v1.ApiOperation.attributes: object expected"); + message.attributes[keys[i]] = $root.google.cloud.apihub.v1.AttributeValues.fromObject(object.attributes[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from an ApiOperation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.ApiOperation + * @static + * @param {google.cloud.apihub.v1.ApiOperation} message ApiOperation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ApiOperation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.attributes = {}; + if (options.defaults) { + object.name = ""; + object.spec = ""; + object.details = null; + object.createTime = null; + object.updateTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.spec != null && message.hasOwnProperty("spec")) + object.spec = message.spec; + if (message.details != null && message.hasOwnProperty("details")) + object.details = $root.google.cloud.apihub.v1.OperationDetails.toObject(message.details, options); + 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.attributes && (keys2 = Object.keys(message.attributes)).length) { + object.attributes = {}; + for (var j = 0; j < keys2.length; ++j) + object.attributes[keys2[j]] = $root.google.cloud.apihub.v1.AttributeValues.toObject(message.attributes[keys2[j]], options); + } + return object; + }; + + /** + * Converts this ApiOperation to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.ApiOperation + * @instance + * @returns {Object.} JSON object + */ + ApiOperation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ApiOperation + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.ApiOperation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ApiOperation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.ApiOperation"; + }; + + return ApiOperation; + })(); + + v1.Definition = (function() { + + /** + * Properties of a Definition. + * @memberof google.cloud.apihub.v1 + * @interface IDefinition + * @property {google.cloud.apihub.v1.ISchema|null} [schema] Definition schema + * @property {string|null} [name] Definition name + * @property {string|null} [spec] Definition spec + * @property {google.cloud.apihub.v1.Definition.Type|null} [type] Definition type + * @property {google.protobuf.ITimestamp|null} [createTime] Definition createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Definition updateTime + * @property {Object.|null} [attributes] Definition attributes + */ + + /** + * Constructs a new Definition. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a Definition. + * @implements IDefinition + * @constructor + * @param {google.cloud.apihub.v1.IDefinition=} [properties] Properties to set + */ + function Definition(properties) { + this.attributes = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Definition schema. + * @member {google.cloud.apihub.v1.ISchema|null|undefined} schema + * @memberof google.cloud.apihub.v1.Definition + * @instance + */ + Definition.prototype.schema = null; + + /** + * Definition name. + * @member {string} name + * @memberof google.cloud.apihub.v1.Definition + * @instance + */ + Definition.prototype.name = ""; + + /** + * Definition spec. + * @member {string} spec + * @memberof google.cloud.apihub.v1.Definition + * @instance + */ + Definition.prototype.spec = ""; + + /** + * Definition type. + * @member {google.cloud.apihub.v1.Definition.Type} type + * @memberof google.cloud.apihub.v1.Definition + * @instance + */ + Definition.prototype.type = 0; + + /** + * Definition createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.apihub.v1.Definition + * @instance + */ + Definition.prototype.createTime = null; + + /** + * Definition updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.apihub.v1.Definition + * @instance + */ + Definition.prototype.updateTime = null; + + /** + * Definition attributes. + * @member {Object.} attributes + * @memberof google.cloud.apihub.v1.Definition + * @instance + */ + Definition.prototype.attributes = $util.emptyObject; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Definition value. + * @member {"schema"|undefined} value + * @memberof google.cloud.apihub.v1.Definition + * @instance + */ + Object.defineProperty(Definition.prototype, "value", { + get: $util.oneOfGetter($oneOfFields = ["schema"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Definition instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.Definition + * @static + * @param {google.cloud.apihub.v1.IDefinition=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.Definition} Definition instance + */ + Definition.create = function create(properties) { + return new Definition(properties); + }; + + /** + * Encodes the specified Definition message. Does not implicitly {@link google.cloud.apihub.v1.Definition.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.Definition + * @static + * @param {google.cloud.apihub.v1.IDefinition} message Definition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Definition.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.spec != null && Object.hasOwnProperty.call(message, "spec")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.spec); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.type); + if (message.schema != null && Object.hasOwnProperty.call(message, "schema")) + $root.google.cloud.apihub.v1.Schema.encode(message.schema, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.attributes != null && Object.hasOwnProperty.call(message, "attributes")) + for (var keys = Object.keys(message.attributes), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.apihub.v1.AttributeValues.encode(message.attributes[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified Definition message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.Definition.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.Definition + * @static + * @param {google.cloud.apihub.v1.IDefinition} message Definition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Definition.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Definition message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.Definition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.Definition} Definition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Definition.decode = function 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.apihub.v1.Definition(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: { + message.schema = $root.google.cloud.apihub.v1.Schema.decode(reader, reader.uint32()); + break; + } + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.spec = reader.string(); + break; + } + case 3: { + message.type = reader.int32(); + break; + } + case 5: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + if (message.attributes === $util.emptyObject) + message.attributes = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.apihub.v1.AttributeValues.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.attributes[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Definition message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.Definition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.Definition} Definition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Definition.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Definition message. + * @function verify + * @memberof google.cloud.apihub.v1.Definition + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Definition.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.schema != null && message.hasOwnProperty("schema")) { + properties.value = 1; + { + var error = $root.google.cloud.apihub.v1.Schema.verify(message.schema); + if (error) + return "schema." + error; + } + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.spec != null && message.hasOwnProperty("spec")) + if (!$util.isString(message.spec)) + return "spec: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + break; + } + 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.attributes != null && message.hasOwnProperty("attributes")) { + if (!$util.isObject(message.attributes)) + return "attributes: object expected"; + var key = Object.keys(message.attributes); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.apihub.v1.AttributeValues.verify(message.attributes[key[i]]); + if (error) + return "attributes." + error; + } + } + return null; + }; + + /** + * Creates a Definition message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.Definition + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.Definition} Definition + */ + Definition.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.Definition) + return object; + var message = new $root.google.cloud.apihub.v1.Definition(); + if (object.schema != null) { + if (typeof object.schema !== "object") + throw TypeError(".google.cloud.apihub.v1.Definition.schema: object expected"); + message.schema = $root.google.cloud.apihub.v1.Schema.fromObject(object.schema); + } + if (object.name != null) + message.name = String(object.name); + if (object.spec != null) + message.spec = String(object.spec); + 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 "SCHEMA": + case 1: + message.type = 1; + break; + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.apihub.v1.Definition.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.apihub.v1.Definition.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.attributes) { + if (typeof object.attributes !== "object") + throw TypeError(".google.cloud.apihub.v1.Definition.attributes: object expected"); + message.attributes = {}; + for (var keys = Object.keys(object.attributes), i = 0; i < keys.length; ++i) { + if (typeof object.attributes[keys[i]] !== "object") + throw TypeError(".google.cloud.apihub.v1.Definition.attributes: object expected"); + message.attributes[keys[i]] = $root.google.cloud.apihub.v1.AttributeValues.fromObject(object.attributes[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a Definition message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.Definition + * @static + * @param {google.cloud.apihub.v1.Definition} message Definition + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Definition.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.attributes = {}; + if (options.defaults) { + object.name = ""; + object.spec = ""; + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.createTime = null; + object.updateTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.spec != null && message.hasOwnProperty("spec")) + object.spec = message.spec; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.apihub.v1.Definition.Type[message.type] === undefined ? message.type : $root.google.cloud.apihub.v1.Definition.Type[message.type] : message.type; + if (message.schema != null && message.hasOwnProperty("schema")) { + object.schema = $root.google.cloud.apihub.v1.Schema.toObject(message.schema, options); + if (options.oneofs) + object.value = "schema"; + } + 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.attributes && (keys2 = Object.keys(message.attributes)).length) { + object.attributes = {}; + for (var j = 0; j < keys2.length; ++j) + object.attributes[keys2[j]] = $root.google.cloud.apihub.v1.AttributeValues.toObject(message.attributes[keys2[j]], options); + } + return object; + }; + + /** + * Converts this Definition to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.Definition + * @instance + * @returns {Object.} JSON object + */ + Definition.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Definition + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.Definition + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Definition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.Definition"; + }; + + /** + * Type enum. + * @name google.cloud.apihub.v1.Definition.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} SCHEMA=1 SCHEMA value + */ + Definition.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SCHEMA"] = 1; + return values; + })(); + + return Definition; + })(); + + v1.Attribute = (function() { + + /** + * Properties of an Attribute. + * @memberof google.cloud.apihub.v1 + * @interface IAttribute + * @property {string|null} [name] Attribute name + * @property {string|null} [displayName] Attribute displayName + * @property {string|null} [description] Attribute description + * @property {google.cloud.apihub.v1.Attribute.DefinitionType|null} [definitionType] Attribute definitionType + * @property {google.cloud.apihub.v1.Attribute.Scope|null} [scope] Attribute scope + * @property {google.cloud.apihub.v1.Attribute.DataType|null} [dataType] Attribute dataType + * @property {Array.|null} [allowedValues] Attribute allowedValues + * @property {number|null} [cardinality] Attribute cardinality + * @property {boolean|null} [mandatory] Attribute mandatory + * @property {google.protobuf.ITimestamp|null} [createTime] Attribute createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Attribute updateTime + */ + + /** + * Constructs a new Attribute. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents an Attribute. + * @implements IAttribute + * @constructor + * @param {google.cloud.apihub.v1.IAttribute=} [properties] Properties to set + */ + function Attribute(properties) { + this.allowedValues = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Attribute name. + * @member {string} name + * @memberof google.cloud.apihub.v1.Attribute + * @instance + */ + Attribute.prototype.name = ""; + + /** + * Attribute displayName. + * @member {string} displayName + * @memberof google.cloud.apihub.v1.Attribute + * @instance + */ + Attribute.prototype.displayName = ""; + + /** + * Attribute description. + * @member {string} description + * @memberof google.cloud.apihub.v1.Attribute + * @instance + */ + Attribute.prototype.description = ""; + + /** + * Attribute definitionType. + * @member {google.cloud.apihub.v1.Attribute.DefinitionType} definitionType + * @memberof google.cloud.apihub.v1.Attribute + * @instance + */ + Attribute.prototype.definitionType = 0; + + /** + * Attribute scope. + * @member {google.cloud.apihub.v1.Attribute.Scope} scope + * @memberof google.cloud.apihub.v1.Attribute + * @instance + */ + Attribute.prototype.scope = 0; + + /** + * Attribute dataType. + * @member {google.cloud.apihub.v1.Attribute.DataType} dataType + * @memberof google.cloud.apihub.v1.Attribute + * @instance + */ + Attribute.prototype.dataType = 0; + + /** + * Attribute allowedValues. + * @member {Array.} allowedValues + * @memberof google.cloud.apihub.v1.Attribute + * @instance + */ + Attribute.prototype.allowedValues = $util.emptyArray; + + /** + * Attribute cardinality. + * @member {number} cardinality + * @memberof google.cloud.apihub.v1.Attribute + * @instance + */ + Attribute.prototype.cardinality = 0; + + /** + * Attribute mandatory. + * @member {boolean} mandatory + * @memberof google.cloud.apihub.v1.Attribute + * @instance + */ + Attribute.prototype.mandatory = false; + + /** + * Attribute createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.apihub.v1.Attribute + * @instance + */ + Attribute.prototype.createTime = null; + + /** + * Attribute updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.apihub.v1.Attribute + * @instance + */ + Attribute.prototype.updateTime = null; + + /** + * Creates a new Attribute instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.Attribute + * @static + * @param {google.cloud.apihub.v1.IAttribute=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.Attribute} Attribute instance + */ + Attribute.create = function create(properties) { + return new Attribute(properties); + }; + + /** + * Encodes the specified Attribute message. Does not implicitly {@link google.cloud.apihub.v1.Attribute.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.Attribute + * @static + * @param {google.cloud.apihub.v1.IAttribute} message Attribute message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Attribute.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.definitionType != null && Object.hasOwnProperty.call(message, "definitionType")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.definitionType); + if (message.scope != null && Object.hasOwnProperty.call(message, "scope")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.scope); + if (message.dataType != null && Object.hasOwnProperty.call(message, "dataType")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.dataType); + if (message.allowedValues != null && message.allowedValues.length) + for (var i = 0; i < message.allowedValues.length; ++i) + $root.google.cloud.apihub.v1.Attribute.AllowedValue.encode(message.allowedValues[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.cardinality != null && Object.hasOwnProperty.call(message, "cardinality")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.cardinality); + if (message.mandatory != null && Object.hasOwnProperty.call(message, "mandatory")) + writer.uint32(/* id 9, wireType 0 =*/72).bool(message.mandatory); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Attribute message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.Attribute.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.Attribute + * @static + * @param {google.cloud.apihub.v1.IAttribute} message Attribute message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Attribute.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Attribute message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.Attribute + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.Attribute} Attribute + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Attribute.decode = function 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.apihub.v1.Attribute(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + message.definitionType = reader.int32(); + break; + } + case 5: { + message.scope = reader.int32(); + break; + } + case 6: { + message.dataType = reader.int32(); + break; + } + case 7: { + if (!(message.allowedValues && message.allowedValues.length)) + message.allowedValues = []; + message.allowedValues.push($root.google.cloud.apihub.v1.Attribute.AllowedValue.decode(reader, reader.uint32())); + break; + } + case 8: { + message.cardinality = reader.int32(); + break; + } + case 9: { + message.mandatory = reader.bool(); + break; + } + case 10: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 11: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Attribute message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.Attribute + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.Attribute} Attribute + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Attribute.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Attribute message. + * @function verify + * @memberof google.cloud.apihub.v1.Attribute + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Attribute.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.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.definitionType != null && message.hasOwnProperty("definitionType")) + switch (message.definitionType) { + default: + return "definitionType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.scope != null && message.hasOwnProperty("scope")) + switch (message.scope) { + default: + return "scope: 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.dataType != null && message.hasOwnProperty("dataType")) + switch (message.dataType) { + default: + return "dataType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.allowedValues != null && message.hasOwnProperty("allowedValues")) { + if (!Array.isArray(message.allowedValues)) + return "allowedValues: array expected"; + for (var i = 0; i < message.allowedValues.length; ++i) { + var error = $root.google.cloud.apihub.v1.Attribute.AllowedValue.verify(message.allowedValues[i]); + if (error) + return "allowedValues." + error; + } + } + if (message.cardinality != null && message.hasOwnProperty("cardinality")) + if (!$util.isInteger(message.cardinality)) + return "cardinality: integer expected"; + if (message.mandatory != null && message.hasOwnProperty("mandatory")) + if (typeof message.mandatory !== "boolean") + return "mandatory: boolean 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; + } + return null; + }; + + /** + * Creates an Attribute message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.Attribute + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.Attribute} Attribute + */ + Attribute.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.Attribute) + return object; + var message = new $root.google.cloud.apihub.v1.Attribute(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + switch (object.definitionType) { + default: + if (typeof object.definitionType === "number") { + message.definitionType = object.definitionType; + break; + } + break; + case "DEFINITION_TYPE_UNSPECIFIED": + case 0: + message.definitionType = 0; + break; + case "SYSTEM_DEFINED": + case 1: + message.definitionType = 1; + break; + case "USER_DEFINED": + case 2: + message.definitionType = 2; + break; + } + switch (object.scope) { + default: + if (typeof object.scope === "number") { + message.scope = object.scope; + break; + } + break; + case "SCOPE_UNSPECIFIED": + case 0: + message.scope = 0; + break; + case "API": + case 1: + message.scope = 1; + break; + case "VERSION": + case 2: + message.scope = 2; + break; + case "SPEC": + case 3: + message.scope = 3; + break; + case "API_OPERATION": + case 4: + message.scope = 4; + break; + case "DEPLOYMENT": + case 5: + message.scope = 5; + break; + case "DEPENDENCY": + case 6: + message.scope = 6; + break; + case "DEFINITION": + case 7: + message.scope = 7; + break; + case "EXTERNAL_API": + case 8: + message.scope = 8; + break; + case "PLUGIN": + case 9: + message.scope = 9; + break; + } + 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 "ENUM": + case 1: + message.dataType = 1; + break; + case "JSON": + case 2: + message.dataType = 2; + break; + case "STRING": + case 3: + message.dataType = 3; + break; + } + if (object.allowedValues) { + if (!Array.isArray(object.allowedValues)) + throw TypeError(".google.cloud.apihub.v1.Attribute.allowedValues: array expected"); + message.allowedValues = []; + for (var i = 0; i < object.allowedValues.length; ++i) { + if (typeof object.allowedValues[i] !== "object") + throw TypeError(".google.cloud.apihub.v1.Attribute.allowedValues: object expected"); + message.allowedValues[i] = $root.google.cloud.apihub.v1.Attribute.AllowedValue.fromObject(object.allowedValues[i]); + } + } + if (object.cardinality != null) + message.cardinality = object.cardinality | 0; + if (object.mandatory != null) + message.mandatory = Boolean(object.mandatory); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.apihub.v1.Attribute.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.apihub.v1.Attribute.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + return message; + }; + + /** + * Creates a plain object from an Attribute message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.Attribute + * @static + * @param {google.cloud.apihub.v1.Attribute} message Attribute + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Attribute.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.allowedValues = []; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.description = ""; + object.definitionType = options.enums === String ? "DEFINITION_TYPE_UNSPECIFIED" : 0; + object.scope = options.enums === String ? "SCOPE_UNSPECIFIED" : 0; + object.dataType = options.enums === String ? "DATA_TYPE_UNSPECIFIED" : 0; + object.cardinality = 0; + object.mandatory = false; + object.createTime = null; + object.updateTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.definitionType != null && message.hasOwnProperty("definitionType")) + object.definitionType = options.enums === String ? $root.google.cloud.apihub.v1.Attribute.DefinitionType[message.definitionType] === undefined ? message.definitionType : $root.google.cloud.apihub.v1.Attribute.DefinitionType[message.definitionType] : message.definitionType; + if (message.scope != null && message.hasOwnProperty("scope")) + object.scope = options.enums === String ? $root.google.cloud.apihub.v1.Attribute.Scope[message.scope] === undefined ? message.scope : $root.google.cloud.apihub.v1.Attribute.Scope[message.scope] : message.scope; + if (message.dataType != null && message.hasOwnProperty("dataType")) + object.dataType = options.enums === String ? $root.google.cloud.apihub.v1.Attribute.DataType[message.dataType] === undefined ? message.dataType : $root.google.cloud.apihub.v1.Attribute.DataType[message.dataType] : message.dataType; + if (message.allowedValues && message.allowedValues.length) { + object.allowedValues = []; + for (var j = 0; j < message.allowedValues.length; ++j) + object.allowedValues[j] = $root.google.cloud.apihub.v1.Attribute.AllowedValue.toObject(message.allowedValues[j], options); + } + if (message.cardinality != null && message.hasOwnProperty("cardinality")) + object.cardinality = message.cardinality; + if (message.mandatory != null && message.hasOwnProperty("mandatory")) + object.mandatory = message.mandatory; + 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); + return object; + }; + + /** + * Converts this Attribute to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.Attribute + * @instance + * @returns {Object.} JSON object + */ + Attribute.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Attribute + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.Attribute + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Attribute.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.Attribute"; + }; + + Attribute.AllowedValue = (function() { + + /** + * Properties of an AllowedValue. + * @memberof google.cloud.apihub.v1.Attribute + * @interface IAllowedValue + * @property {string|null} [id] AllowedValue id + * @property {string|null} [displayName] AllowedValue displayName + * @property {string|null} [description] AllowedValue description + * @property {boolean|null} [immutable] AllowedValue immutable + */ + + /** + * Constructs a new AllowedValue. + * @memberof google.cloud.apihub.v1.Attribute + * @classdesc Represents an AllowedValue. + * @implements IAllowedValue + * @constructor + * @param {google.cloud.apihub.v1.Attribute.IAllowedValue=} [properties] Properties to set + */ + function AllowedValue(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]]; + } + + /** + * AllowedValue id. + * @member {string} id + * @memberof google.cloud.apihub.v1.Attribute.AllowedValue + * @instance + */ + AllowedValue.prototype.id = ""; + + /** + * AllowedValue displayName. + * @member {string} displayName + * @memberof google.cloud.apihub.v1.Attribute.AllowedValue + * @instance + */ + AllowedValue.prototype.displayName = ""; + + /** + * AllowedValue description. + * @member {string} description + * @memberof google.cloud.apihub.v1.Attribute.AllowedValue + * @instance + */ + AllowedValue.prototype.description = ""; + + /** + * AllowedValue immutable. + * @member {boolean} immutable + * @memberof google.cloud.apihub.v1.Attribute.AllowedValue + * @instance + */ + AllowedValue.prototype.immutable = false; + + /** + * Creates a new AllowedValue instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.Attribute.AllowedValue + * @static + * @param {google.cloud.apihub.v1.Attribute.IAllowedValue=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.Attribute.AllowedValue} AllowedValue instance + */ + AllowedValue.create = function create(properties) { + return new AllowedValue(properties); + }; + + /** + * Encodes the specified AllowedValue message. Does not implicitly {@link google.cloud.apihub.v1.Attribute.AllowedValue.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.Attribute.AllowedValue + * @static + * @param {google.cloud.apihub.v1.Attribute.IAllowedValue} message AllowedValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AllowedValue.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); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.immutable != null && Object.hasOwnProperty.call(message, "immutable")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.immutable); + return writer; + }; + + /** + * Encodes the specified AllowedValue message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.Attribute.AllowedValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.Attribute.AllowedValue + * @static + * @param {google.cloud.apihub.v1.Attribute.IAllowedValue} message AllowedValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AllowedValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AllowedValue message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.Attribute.AllowedValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.Attribute.AllowedValue} AllowedValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AllowedValue.decode = function 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.apihub.v1.Attribute.AllowedValue(); + 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; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + message.immutable = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AllowedValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.Attribute.AllowedValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.Attribute.AllowedValue} AllowedValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AllowedValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AllowedValue message. + * @function verify + * @memberof google.cloud.apihub.v1.Attribute.AllowedValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AllowedValue.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"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.immutable != null && message.hasOwnProperty("immutable")) + if (typeof message.immutable !== "boolean") + return "immutable: boolean expected"; + return null; + }; + + /** + * Creates an AllowedValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.Attribute.AllowedValue + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.Attribute.AllowedValue} AllowedValue + */ + AllowedValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.Attribute.AllowedValue) + return object; + var message = new $root.google.cloud.apihub.v1.Attribute.AllowedValue(); + if (object.id != null) + message.id = String(object.id); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.immutable != null) + message.immutable = Boolean(object.immutable); + return message; + }; + + /** + * Creates a plain object from an AllowedValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.Attribute.AllowedValue + * @static + * @param {google.cloud.apihub.v1.Attribute.AllowedValue} message AllowedValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AllowedValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.id = ""; + object.displayName = ""; + object.description = ""; + object.immutable = false; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.immutable != null && message.hasOwnProperty("immutable")) + object.immutable = message.immutable; + return object; + }; + + /** + * Converts this AllowedValue to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.Attribute.AllowedValue + * @instance + * @returns {Object.} JSON object + */ + AllowedValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AllowedValue + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.Attribute.AllowedValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AllowedValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.Attribute.AllowedValue"; + }; + + return AllowedValue; + })(); + + /** + * DefinitionType enum. + * @name google.cloud.apihub.v1.Attribute.DefinitionType + * @enum {number} + * @property {number} DEFINITION_TYPE_UNSPECIFIED=0 DEFINITION_TYPE_UNSPECIFIED value + * @property {number} SYSTEM_DEFINED=1 SYSTEM_DEFINED value + * @property {number} USER_DEFINED=2 USER_DEFINED value + */ + Attribute.DefinitionType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DEFINITION_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SYSTEM_DEFINED"] = 1; + values[valuesById[2] = "USER_DEFINED"] = 2; + return values; + })(); + + /** + * Scope enum. + * @name google.cloud.apihub.v1.Attribute.Scope + * @enum {number} + * @property {number} SCOPE_UNSPECIFIED=0 SCOPE_UNSPECIFIED value + * @property {number} API=1 API value + * @property {number} VERSION=2 VERSION value + * @property {number} SPEC=3 SPEC value + * @property {number} API_OPERATION=4 API_OPERATION value + * @property {number} DEPLOYMENT=5 DEPLOYMENT value + * @property {number} DEPENDENCY=6 DEPENDENCY value + * @property {number} DEFINITION=7 DEFINITION value + * @property {number} EXTERNAL_API=8 EXTERNAL_API value + * @property {number} PLUGIN=9 PLUGIN value + */ + Attribute.Scope = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SCOPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "API"] = 1; + values[valuesById[2] = "VERSION"] = 2; + values[valuesById[3] = "SPEC"] = 3; + values[valuesById[4] = "API_OPERATION"] = 4; + values[valuesById[5] = "DEPLOYMENT"] = 5; + values[valuesById[6] = "DEPENDENCY"] = 6; + values[valuesById[7] = "DEFINITION"] = 7; + values[valuesById[8] = "EXTERNAL_API"] = 8; + values[valuesById[9] = "PLUGIN"] = 9; + return values; + })(); + + /** + * DataType enum. + * @name google.cloud.apihub.v1.Attribute.DataType + * @enum {number} + * @property {number} DATA_TYPE_UNSPECIFIED=0 DATA_TYPE_UNSPECIFIED value + * @property {number} ENUM=1 ENUM value + * @property {number} JSON=2 JSON value + * @property {number} STRING=3 STRING value + */ + Attribute.DataType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DATA_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ENUM"] = 1; + values[valuesById[2] = "JSON"] = 2; + values[valuesById[3] = "STRING"] = 3; + return values; + })(); + + return Attribute; + })(); + + v1.SpecContents = (function() { + + /** + * Properties of a SpecContents. + * @memberof google.cloud.apihub.v1 + * @interface ISpecContents + * @property {Uint8Array|null} [contents] SpecContents contents + * @property {string|null} [mimeType] SpecContents mimeType + */ + + /** + * Constructs a new SpecContents. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a SpecContents. + * @implements ISpecContents + * @constructor + * @param {google.cloud.apihub.v1.ISpecContents=} [properties] Properties to set + */ + function SpecContents(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]]; + } + + /** + * SpecContents contents. + * @member {Uint8Array} contents + * @memberof google.cloud.apihub.v1.SpecContents + * @instance + */ + SpecContents.prototype.contents = $util.newBuffer([]); + + /** + * SpecContents mimeType. + * @member {string} mimeType + * @memberof google.cloud.apihub.v1.SpecContents + * @instance + */ + SpecContents.prototype.mimeType = ""; + + /** + * Creates a new SpecContents instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.SpecContents + * @static + * @param {google.cloud.apihub.v1.ISpecContents=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.SpecContents} SpecContents instance + */ + SpecContents.create = function create(properties) { + return new SpecContents(properties); + }; + + /** + * Encodes the specified SpecContents message. Does not implicitly {@link google.cloud.apihub.v1.SpecContents.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.SpecContents + * @static + * @param {google.cloud.apihub.v1.ISpecContents} message SpecContents message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpecContents.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.contents != null && Object.hasOwnProperty.call(message, "contents")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.contents); + if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.mimeType); + return writer; + }; + + /** + * Encodes the specified SpecContents message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.SpecContents.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.SpecContents + * @static + * @param {google.cloud.apihub.v1.ISpecContents} message SpecContents message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpecContents.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SpecContents message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.SpecContents + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.SpecContents} SpecContents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpecContents.decode = function 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.apihub.v1.SpecContents(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.contents = reader.bytes(); + break; + } + case 2: { + message.mimeType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SpecContents message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.SpecContents + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.SpecContents} SpecContents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpecContents.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SpecContents message. + * @function verify + * @memberof google.cloud.apihub.v1.SpecContents + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SpecContents.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.contents != null && message.hasOwnProperty("contents")) + if (!(message.contents && typeof message.contents.length === "number" || $util.isString(message.contents))) + return "contents: buffer expected"; + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + if (!$util.isString(message.mimeType)) + return "mimeType: string expected"; + return null; + }; + + /** + * Creates a SpecContents message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.SpecContents + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.SpecContents} SpecContents + */ + SpecContents.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.SpecContents) + return object; + var message = new $root.google.cloud.apihub.v1.SpecContents(); + if (object.contents != null) + if (typeof object.contents === "string") + $util.base64.decode(object.contents, message.contents = $util.newBuffer($util.base64.length(object.contents)), 0); + else if (object.contents.length >= 0) + message.contents = object.contents; + if (object.mimeType != null) + message.mimeType = String(object.mimeType); + return message; + }; + + /** + * Creates a plain object from a SpecContents message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.SpecContents + * @static + * @param {google.cloud.apihub.v1.SpecContents} message SpecContents + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SpecContents.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.contents = ""; + else { + object.contents = []; + if (options.bytes !== Array) + object.contents = $util.newBuffer(object.contents); + } + object.mimeType = ""; + } + if (message.contents != null && message.hasOwnProperty("contents")) + object.contents = options.bytes === String ? $util.base64.encode(message.contents, 0, message.contents.length) : options.bytes === Array ? Array.prototype.slice.call(message.contents) : message.contents; + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + object.mimeType = message.mimeType; + return object; + }; + + /** + * Converts this SpecContents to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.SpecContents + * @instance + * @returns {Object.} JSON object + */ + SpecContents.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SpecContents + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.SpecContents + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SpecContents.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.SpecContents"; + }; + + return SpecContents; + })(); + + v1.SpecDetails = (function() { + + /** + * Properties of a SpecDetails. + * @memberof google.cloud.apihub.v1 + * @interface ISpecDetails + * @property {google.cloud.apihub.v1.IOpenApiSpecDetails|null} [openApiSpecDetails] SpecDetails openApiSpecDetails + * @property {string|null} [description] SpecDetails description + */ + + /** + * Constructs a new SpecDetails. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a SpecDetails. + * @implements ISpecDetails + * @constructor + * @param {google.cloud.apihub.v1.ISpecDetails=} [properties] Properties to set + */ + function SpecDetails(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]]; + } + + /** + * SpecDetails openApiSpecDetails. + * @member {google.cloud.apihub.v1.IOpenApiSpecDetails|null|undefined} openApiSpecDetails + * @memberof google.cloud.apihub.v1.SpecDetails + * @instance + */ + SpecDetails.prototype.openApiSpecDetails = null; + + /** + * SpecDetails description. + * @member {string} description + * @memberof google.cloud.apihub.v1.SpecDetails + * @instance + */ + SpecDetails.prototype.description = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SpecDetails details. + * @member {"openApiSpecDetails"|undefined} details + * @memberof google.cloud.apihub.v1.SpecDetails + * @instance + */ + Object.defineProperty(SpecDetails.prototype, "details", { + get: $util.oneOfGetter($oneOfFields = ["openApiSpecDetails"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SpecDetails instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.SpecDetails + * @static + * @param {google.cloud.apihub.v1.ISpecDetails=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.SpecDetails} SpecDetails instance + */ + SpecDetails.create = function create(properties) { + return new SpecDetails(properties); + }; + + /** + * Encodes the specified SpecDetails message. Does not implicitly {@link google.cloud.apihub.v1.SpecDetails.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.SpecDetails + * @static + * @param {google.cloud.apihub.v1.ISpecDetails} message SpecDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpecDetails.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.description); + if (message.openApiSpecDetails != null && Object.hasOwnProperty.call(message, "openApiSpecDetails")) + $root.google.cloud.apihub.v1.OpenApiSpecDetails.encode(message.openApiSpecDetails, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SpecDetails message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.SpecDetails.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.SpecDetails + * @static + * @param {google.cloud.apihub.v1.ISpecDetails} message SpecDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpecDetails.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SpecDetails message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.SpecDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.SpecDetails} SpecDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpecDetails.decode = function 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.apihub.v1.SpecDetails(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.openApiSpecDetails = $root.google.cloud.apihub.v1.OpenApiSpecDetails.decode(reader, reader.uint32()); + break; + } + case 1: { + message.description = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SpecDetails message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.SpecDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.SpecDetails} SpecDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpecDetails.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SpecDetails message. + * @function verify + * @memberof google.cloud.apihub.v1.SpecDetails + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SpecDetails.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.openApiSpecDetails != null && message.hasOwnProperty("openApiSpecDetails")) { + properties.details = 1; + { + var error = $root.google.cloud.apihub.v1.OpenApiSpecDetails.verify(message.openApiSpecDetails); + if (error) + return "openApiSpecDetails." + error; + } + } + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + return null; + }; + + /** + * Creates a SpecDetails message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.SpecDetails + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.SpecDetails} SpecDetails + */ + SpecDetails.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.SpecDetails) + return object; + var message = new $root.google.cloud.apihub.v1.SpecDetails(); + if (object.openApiSpecDetails != null) { + if (typeof object.openApiSpecDetails !== "object") + throw TypeError(".google.cloud.apihub.v1.SpecDetails.openApiSpecDetails: object expected"); + message.openApiSpecDetails = $root.google.cloud.apihub.v1.OpenApiSpecDetails.fromObject(object.openApiSpecDetails); + } + if (object.description != null) + message.description = String(object.description); + return message; + }; + + /** + * Creates a plain object from a SpecDetails message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.SpecDetails + * @static + * @param {google.cloud.apihub.v1.SpecDetails} message SpecDetails + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SpecDetails.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.description = ""; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.openApiSpecDetails != null && message.hasOwnProperty("openApiSpecDetails")) { + object.openApiSpecDetails = $root.google.cloud.apihub.v1.OpenApiSpecDetails.toObject(message.openApiSpecDetails, options); + if (options.oneofs) + object.details = "openApiSpecDetails"; + } + return object; + }; + + /** + * Converts this SpecDetails to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.SpecDetails + * @instance + * @returns {Object.} JSON object + */ + SpecDetails.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SpecDetails + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.SpecDetails + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SpecDetails.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.SpecDetails"; + }; + + return SpecDetails; + })(); + + v1.OpenApiSpecDetails = (function() { + + /** + * Properties of an OpenApiSpecDetails. + * @memberof google.cloud.apihub.v1 + * @interface IOpenApiSpecDetails + * @property {google.cloud.apihub.v1.OpenApiSpecDetails.Format|null} [format] OpenApiSpecDetails format + * @property {string|null} [version] OpenApiSpecDetails version + * @property {google.cloud.apihub.v1.IOwner|null} [owner] OpenApiSpecDetails owner + */ + + /** + * Constructs a new OpenApiSpecDetails. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents an OpenApiSpecDetails. + * @implements IOpenApiSpecDetails + * @constructor + * @param {google.cloud.apihub.v1.IOpenApiSpecDetails=} [properties] Properties to set + */ + function OpenApiSpecDetails(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]]; + } + + /** + * OpenApiSpecDetails format. + * @member {google.cloud.apihub.v1.OpenApiSpecDetails.Format} format + * @memberof google.cloud.apihub.v1.OpenApiSpecDetails + * @instance + */ + OpenApiSpecDetails.prototype.format = 0; + + /** + * OpenApiSpecDetails version. + * @member {string} version + * @memberof google.cloud.apihub.v1.OpenApiSpecDetails + * @instance + */ + OpenApiSpecDetails.prototype.version = ""; + + /** + * OpenApiSpecDetails owner. + * @member {google.cloud.apihub.v1.IOwner|null|undefined} owner + * @memberof google.cloud.apihub.v1.OpenApiSpecDetails + * @instance + */ + OpenApiSpecDetails.prototype.owner = null; + + /** + * Creates a new OpenApiSpecDetails instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.OpenApiSpecDetails + * @static + * @param {google.cloud.apihub.v1.IOpenApiSpecDetails=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.OpenApiSpecDetails} OpenApiSpecDetails instance + */ + OpenApiSpecDetails.create = function create(properties) { + return new OpenApiSpecDetails(properties); + }; + + /** + * Encodes the specified OpenApiSpecDetails message. Does not implicitly {@link google.cloud.apihub.v1.OpenApiSpecDetails.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.OpenApiSpecDetails + * @static + * @param {google.cloud.apihub.v1.IOpenApiSpecDetails} message OpenApiSpecDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OpenApiSpecDetails.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.format != null && Object.hasOwnProperty.call(message, "format")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.format); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.version); + if (message.owner != null && Object.hasOwnProperty.call(message, "owner")) + $root.google.cloud.apihub.v1.Owner.encode(message.owner, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OpenApiSpecDetails message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.OpenApiSpecDetails.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.OpenApiSpecDetails + * @static + * @param {google.cloud.apihub.v1.IOpenApiSpecDetails} message OpenApiSpecDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OpenApiSpecDetails.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OpenApiSpecDetails message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.OpenApiSpecDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.OpenApiSpecDetails} OpenApiSpecDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OpenApiSpecDetails.decode = function 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.apihub.v1.OpenApiSpecDetails(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.format = reader.int32(); + break; + } + case 2: { + message.version = reader.string(); + break; + } + case 3: { + message.owner = $root.google.cloud.apihub.v1.Owner.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OpenApiSpecDetails message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.OpenApiSpecDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.OpenApiSpecDetails} OpenApiSpecDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OpenApiSpecDetails.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OpenApiSpecDetails message. + * @function verify + * @memberof google.cloud.apihub.v1.OpenApiSpecDetails + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OpenApiSpecDetails.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.format != null && message.hasOwnProperty("format")) + switch (message.format) { + default: + return "format: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.owner != null && message.hasOwnProperty("owner")) { + var error = $root.google.cloud.apihub.v1.Owner.verify(message.owner); + if (error) + return "owner." + error; + } + return null; + }; + + /** + * Creates an OpenApiSpecDetails message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.OpenApiSpecDetails + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.OpenApiSpecDetails} OpenApiSpecDetails + */ + OpenApiSpecDetails.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.OpenApiSpecDetails) + return object; + var message = new $root.google.cloud.apihub.v1.OpenApiSpecDetails(); + switch (object.format) { + default: + if (typeof object.format === "number") { + message.format = object.format; + break; + } + break; + case "FORMAT_UNSPECIFIED": + case 0: + message.format = 0; + break; + case "OPEN_API_SPEC_2_0": + case 1: + message.format = 1; + break; + case "OPEN_API_SPEC_3_0": + case 2: + message.format = 2; + break; + case "OPEN_API_SPEC_3_1": + case 3: + message.format = 3; + break; + } + if (object.version != null) + message.version = String(object.version); + if (object.owner != null) { + if (typeof object.owner !== "object") + throw TypeError(".google.cloud.apihub.v1.OpenApiSpecDetails.owner: object expected"); + message.owner = $root.google.cloud.apihub.v1.Owner.fromObject(object.owner); + } + return message; + }; + + /** + * Creates a plain object from an OpenApiSpecDetails message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.OpenApiSpecDetails + * @static + * @param {google.cloud.apihub.v1.OpenApiSpecDetails} message OpenApiSpecDetails + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OpenApiSpecDetails.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.format = options.enums === String ? "FORMAT_UNSPECIFIED" : 0; + object.version = ""; + object.owner = null; + } + if (message.format != null && message.hasOwnProperty("format")) + object.format = options.enums === String ? $root.google.cloud.apihub.v1.OpenApiSpecDetails.Format[message.format] === undefined ? message.format : $root.google.cloud.apihub.v1.OpenApiSpecDetails.Format[message.format] : message.format; + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.owner != null && message.hasOwnProperty("owner")) + object.owner = $root.google.cloud.apihub.v1.Owner.toObject(message.owner, options); + return object; + }; + + /** + * Converts this OpenApiSpecDetails to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.OpenApiSpecDetails + * @instance + * @returns {Object.} JSON object + */ + OpenApiSpecDetails.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OpenApiSpecDetails + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.OpenApiSpecDetails + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OpenApiSpecDetails.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.OpenApiSpecDetails"; + }; + + /** + * Format enum. + * @name google.cloud.apihub.v1.OpenApiSpecDetails.Format + * @enum {number} + * @property {number} FORMAT_UNSPECIFIED=0 FORMAT_UNSPECIFIED value + * @property {number} OPEN_API_SPEC_2_0=1 OPEN_API_SPEC_2_0 value + * @property {number} OPEN_API_SPEC_3_0=2 OPEN_API_SPEC_3_0 value + * @property {number} OPEN_API_SPEC_3_1=3 OPEN_API_SPEC_3_1 value + */ + OpenApiSpecDetails.Format = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FORMAT_UNSPECIFIED"] = 0; + values[valuesById[1] = "OPEN_API_SPEC_2_0"] = 1; + values[valuesById[2] = "OPEN_API_SPEC_3_0"] = 2; + values[valuesById[3] = "OPEN_API_SPEC_3_1"] = 3; + return values; + })(); + + return OpenApiSpecDetails; + })(); + + v1.OperationDetails = (function() { + + /** + * Properties of an OperationDetails. + * @memberof google.cloud.apihub.v1 + * @interface IOperationDetails + * @property {google.cloud.apihub.v1.IHttpOperation|null} [httpOperation] OperationDetails httpOperation + * @property {string|null} [description] OperationDetails description + * @property {google.cloud.apihub.v1.IDocumentation|null} [documentation] OperationDetails documentation + * @property {boolean|null} [deprecated] OperationDetails deprecated + */ + + /** + * Constructs a new OperationDetails. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents an OperationDetails. + * @implements IOperationDetails + * @constructor + * @param {google.cloud.apihub.v1.IOperationDetails=} [properties] Properties to set + */ + function OperationDetails(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]]; + } + + /** + * OperationDetails httpOperation. + * @member {google.cloud.apihub.v1.IHttpOperation|null|undefined} httpOperation + * @memberof google.cloud.apihub.v1.OperationDetails + * @instance + */ + OperationDetails.prototype.httpOperation = null; + + /** + * OperationDetails description. + * @member {string} description + * @memberof google.cloud.apihub.v1.OperationDetails + * @instance + */ + OperationDetails.prototype.description = ""; + + /** + * OperationDetails documentation. + * @member {google.cloud.apihub.v1.IDocumentation|null|undefined} documentation + * @memberof google.cloud.apihub.v1.OperationDetails + * @instance + */ + OperationDetails.prototype.documentation = null; + + /** + * OperationDetails deprecated. + * @member {boolean} deprecated + * @memberof google.cloud.apihub.v1.OperationDetails + * @instance + */ + OperationDetails.prototype.deprecated = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * OperationDetails operation. + * @member {"httpOperation"|undefined} operation + * @memberof google.cloud.apihub.v1.OperationDetails + * @instance + */ + Object.defineProperty(OperationDetails.prototype, "operation", { + get: $util.oneOfGetter($oneOfFields = ["httpOperation"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new OperationDetails instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.OperationDetails + * @static + * @param {google.cloud.apihub.v1.IOperationDetails=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.OperationDetails} OperationDetails instance + */ + OperationDetails.create = function create(properties) { + return new OperationDetails(properties); + }; + + /** + * Encodes the specified OperationDetails message. Does not implicitly {@link google.cloud.apihub.v1.OperationDetails.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.OperationDetails + * @static + * @param {google.cloud.apihub.v1.IOperationDetails} message OperationDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationDetails.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.description); + if (message.documentation != null && Object.hasOwnProperty.call(message, "documentation")) + $root.google.cloud.apihub.v1.Documentation.encode(message.documentation, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.httpOperation != null && Object.hasOwnProperty.call(message, "httpOperation")) + $root.google.cloud.apihub.v1.HttpOperation.encode(message.httpOperation, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OperationDetails message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.OperationDetails.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.OperationDetails + * @static + * @param {google.cloud.apihub.v1.IOperationDetails} message OperationDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationDetails.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OperationDetails message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.OperationDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.OperationDetails} OperationDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationDetails.decode = function 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.apihub.v1.OperationDetails(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: { + message.httpOperation = $root.google.cloud.apihub.v1.HttpOperation.decode(reader, reader.uint32()); + break; + } + case 1: { + message.description = reader.string(); + break; + } + case 2: { + message.documentation = $root.google.cloud.apihub.v1.Documentation.decode(reader, reader.uint32()); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OperationDetails message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.OperationDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.OperationDetails} OperationDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationDetails.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OperationDetails message. + * @function verify + * @memberof google.cloud.apihub.v1.OperationDetails + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OperationDetails.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.httpOperation != null && message.hasOwnProperty("httpOperation")) { + properties.operation = 1; + { + var error = $root.google.cloud.apihub.v1.HttpOperation.verify(message.httpOperation); + if (error) + return "httpOperation." + error; + } + } + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.documentation != null && message.hasOwnProperty("documentation")) { + var error = $root.google.cloud.apihub.v1.Documentation.verify(message.documentation); + if (error) + return "documentation." + error; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + return null; + }; + + /** + * Creates an OperationDetails message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.OperationDetails + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.OperationDetails} OperationDetails + */ + OperationDetails.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.OperationDetails) + return object; + var message = new $root.google.cloud.apihub.v1.OperationDetails(); + if (object.httpOperation != null) { + if (typeof object.httpOperation !== "object") + throw TypeError(".google.cloud.apihub.v1.OperationDetails.httpOperation: object expected"); + message.httpOperation = $root.google.cloud.apihub.v1.HttpOperation.fromObject(object.httpOperation); + } + if (object.description != null) + message.description = String(object.description); + if (object.documentation != null) { + if (typeof object.documentation !== "object") + throw TypeError(".google.cloud.apihub.v1.OperationDetails.documentation: object expected"); + message.documentation = $root.google.cloud.apihub.v1.Documentation.fromObject(object.documentation); + } + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + return message; + }; + + /** + * Creates a plain object from an OperationDetails message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.OperationDetails + * @static + * @param {google.cloud.apihub.v1.OperationDetails} message OperationDetails + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationDetails.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.description = ""; + object.documentation = null; + object.deprecated = false; + } + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.documentation != null && message.hasOwnProperty("documentation")) + object.documentation = $root.google.cloud.apihub.v1.Documentation.toObject(message.documentation, options); + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.httpOperation != null && message.hasOwnProperty("httpOperation")) { + object.httpOperation = $root.google.cloud.apihub.v1.HttpOperation.toObject(message.httpOperation, options); + if (options.oneofs) + object.operation = "httpOperation"; + } + return object; + }; + + /** + * Converts this OperationDetails to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.OperationDetails + * @instance + * @returns {Object.} JSON object + */ + OperationDetails.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OperationDetails + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.OperationDetails + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OperationDetails.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.OperationDetails"; + }; + + return OperationDetails; + })(); + + v1.HttpOperation = (function() { + + /** + * Properties of a HttpOperation. + * @memberof google.cloud.apihub.v1 + * @interface IHttpOperation + * @property {google.cloud.apihub.v1.IPath|null} [path] HttpOperation path + * @property {google.cloud.apihub.v1.HttpOperation.Method|null} [method] HttpOperation method + */ + + /** + * Constructs a new HttpOperation. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a HttpOperation. + * @implements IHttpOperation + * @constructor + * @param {google.cloud.apihub.v1.IHttpOperation=} [properties] Properties to set + */ + function HttpOperation(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]]; + } + + /** + * HttpOperation path. + * @member {google.cloud.apihub.v1.IPath|null|undefined} path + * @memberof google.cloud.apihub.v1.HttpOperation + * @instance + */ + HttpOperation.prototype.path = null; + + /** + * HttpOperation method. + * @member {google.cloud.apihub.v1.HttpOperation.Method} method + * @memberof google.cloud.apihub.v1.HttpOperation + * @instance + */ + HttpOperation.prototype.method = 0; + + /** + * Creates a new HttpOperation instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.HttpOperation + * @static + * @param {google.cloud.apihub.v1.IHttpOperation=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.HttpOperation} HttpOperation instance + */ + HttpOperation.create = function create(properties) { + return new HttpOperation(properties); + }; + + /** + * Encodes the specified HttpOperation message. Does not implicitly {@link google.cloud.apihub.v1.HttpOperation.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.HttpOperation + * @static + * @param {google.cloud.apihub.v1.IHttpOperation} message HttpOperation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpOperation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + $root.google.cloud.apihub.v1.Path.encode(message.path, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.method != null && Object.hasOwnProperty.call(message, "method")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.method); + return writer; + }; + + /** + * Encodes the specified HttpOperation message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.HttpOperation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.HttpOperation + * @static + * @param {google.cloud.apihub.v1.IHttpOperation} message HttpOperation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpOperation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HttpOperation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.HttpOperation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.HttpOperation} HttpOperation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpOperation.decode = function 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.apihub.v1.HttpOperation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.path = $root.google.cloud.apihub.v1.Path.decode(reader, reader.uint32()); + break; + } + case 2: { + message.method = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HttpOperation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.HttpOperation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.HttpOperation} HttpOperation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpOperation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HttpOperation message. + * @function verify + * @memberof google.cloud.apihub.v1.HttpOperation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HttpOperation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + var error = $root.google.cloud.apihub.v1.Path.verify(message.path); + if (error) + return "path." + error; + } + if (message.method != null && message.hasOwnProperty("method")) + switch (message.method) { + default: + return "method: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + break; + } + return null; + }; + + /** + * Creates a HttpOperation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.HttpOperation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.HttpOperation} HttpOperation + */ + HttpOperation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.HttpOperation) + return object; + var message = new $root.google.cloud.apihub.v1.HttpOperation(); + if (object.path != null) { + if (typeof object.path !== "object") + throw TypeError(".google.cloud.apihub.v1.HttpOperation.path: object expected"); + message.path = $root.google.cloud.apihub.v1.Path.fromObject(object.path); + } + switch (object.method) { + default: + if (typeof object.method === "number") { + message.method = object.method; + break; + } + break; + case "METHOD_UNSPECIFIED": + case 0: + message.method = 0; + break; + case "GET": + case 1: + message.method = 1; + break; + case "PUT": + case 2: + message.method = 2; + break; + case "POST": + case 3: + message.method = 3; + break; + case "DELETE": + case 4: + message.method = 4; + break; + case "OPTIONS": + case 5: + message.method = 5; + break; + case "HEAD": + case 6: + message.method = 6; + break; + case "PATCH": + case 7: + message.method = 7; + break; + case "TRACE": + case 8: + message.method = 8; + break; + } + return message; + }; + + /** + * Creates a plain object from a HttpOperation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.HttpOperation + * @static + * @param {google.cloud.apihub.v1.HttpOperation} message HttpOperation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HttpOperation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.path = null; + object.method = options.enums === String ? "METHOD_UNSPECIFIED" : 0; + } + if (message.path != null && message.hasOwnProperty("path")) + object.path = $root.google.cloud.apihub.v1.Path.toObject(message.path, options); + if (message.method != null && message.hasOwnProperty("method")) + object.method = options.enums === String ? $root.google.cloud.apihub.v1.HttpOperation.Method[message.method] === undefined ? message.method : $root.google.cloud.apihub.v1.HttpOperation.Method[message.method] : message.method; + return object; + }; + + /** + * Converts this HttpOperation to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.HttpOperation + * @instance + * @returns {Object.} JSON object + */ + HttpOperation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HttpOperation + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.HttpOperation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HttpOperation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.HttpOperation"; + }; + + /** + * Method enum. + * @name google.cloud.apihub.v1.HttpOperation.Method + * @enum {number} + * @property {number} METHOD_UNSPECIFIED=0 METHOD_UNSPECIFIED value + * @property {number} GET=1 GET value + * @property {number} PUT=2 PUT value + * @property {number} POST=3 POST value + * @property {number} DELETE=4 DELETE value + * @property {number} OPTIONS=5 OPTIONS value + * @property {number} HEAD=6 HEAD value + * @property {number} PATCH=7 PATCH value + * @property {number} TRACE=8 TRACE value + */ + HttpOperation.Method = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "METHOD_UNSPECIFIED"] = 0; + values[valuesById[1] = "GET"] = 1; + values[valuesById[2] = "PUT"] = 2; + values[valuesById[3] = "POST"] = 3; + values[valuesById[4] = "DELETE"] = 4; + values[valuesById[5] = "OPTIONS"] = 5; + values[valuesById[6] = "HEAD"] = 6; + values[valuesById[7] = "PATCH"] = 7; + values[valuesById[8] = "TRACE"] = 8; + return values; + })(); + + return HttpOperation; + })(); + + v1.Path = (function() { + + /** + * Properties of a Path. + * @memberof google.cloud.apihub.v1 + * @interface IPath + * @property {string|null} [path] Path path + * @property {string|null} [description] Path description + */ + + /** + * Constructs a new Path. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a Path. + * @implements IPath + * @constructor + * @param {google.cloud.apihub.v1.IPath=} [properties] Properties to set + */ + function Path(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]]; + } + + /** + * Path path. + * @member {string} path + * @memberof google.cloud.apihub.v1.Path + * @instance + */ + Path.prototype.path = ""; + + /** + * Path description. + * @member {string} description + * @memberof google.cloud.apihub.v1.Path + * @instance + */ + Path.prototype.description = ""; + + /** + * Creates a new Path instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.Path + * @static + * @param {google.cloud.apihub.v1.IPath=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.Path} Path instance + */ + Path.create = function create(properties) { + return new Path(properties); + }; + + /** + * Encodes the specified Path message. Does not implicitly {@link google.cloud.apihub.v1.Path.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.Path + * @static + * @param {google.cloud.apihub.v1.IPath} message Path message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Path.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.path); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + return writer; + }; + + /** + * Encodes the specified Path message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.Path.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.Path + * @static + * @param {google.cloud.apihub.v1.IPath} message Path message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Path.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Path message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.Path + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.Path} Path + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Path.decode = function 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.apihub.v1.Path(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.path = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Path message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.Path + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.Path} Path + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Path.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Path message. + * @function verify + * @memberof google.cloud.apihub.v1.Path + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Path.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + return null; + }; + + /** + * Creates a Path message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.Path + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.Path} Path + */ + Path.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.Path) + return object; + var message = new $root.google.cloud.apihub.v1.Path(); + if (object.path != null) + message.path = String(object.path); + if (object.description != null) + message.description = String(object.description); + return message; + }; + + /** + * Creates a plain object from a Path message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.Path + * @static + * @param {google.cloud.apihub.v1.Path} message Path + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Path.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.path = ""; + object.description = ""; + } + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + return object; + }; + + /** + * Converts this Path to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.Path + * @instance + * @returns {Object.} JSON object + */ + Path.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Path + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.Path + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Path.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.Path"; + }; + + return Path; + })(); + + v1.Schema = (function() { + + /** + * Properties of a Schema. + * @memberof google.cloud.apihub.v1 + * @interface ISchema + * @property {string|null} [displayName] Schema displayName + * @property {Uint8Array|null} [rawValue] Schema rawValue + */ + + /** + * Constructs a new Schema. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a Schema. + * @implements ISchema + * @constructor + * @param {google.cloud.apihub.v1.ISchema=} [properties] Properties to set + */ + function Schema(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]]; + } + + /** + * Schema displayName. + * @member {string} displayName + * @memberof google.cloud.apihub.v1.Schema + * @instance + */ + Schema.prototype.displayName = ""; + + /** + * Schema rawValue. + * @member {Uint8Array} rawValue + * @memberof google.cloud.apihub.v1.Schema + * @instance + */ + Schema.prototype.rawValue = $util.newBuffer([]); + + /** + * Creates a new Schema instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.Schema + * @static + * @param {google.cloud.apihub.v1.ISchema=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.Schema} Schema instance + */ + Schema.create = function create(properties) { + return new Schema(properties); + }; + + /** + * Encodes the specified Schema message. Does not implicitly {@link google.cloud.apihub.v1.Schema.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.Schema + * @static + * @param {google.cloud.apihub.v1.ISchema} message Schema message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Schema.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.displayName); + if (message.rawValue != null && Object.hasOwnProperty.call(message, "rawValue")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.rawValue); + return writer; + }; + + /** + * Encodes the specified Schema message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.Schema.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.Schema + * @static + * @param {google.cloud.apihub.v1.ISchema} message Schema message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Schema.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Schema message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.Schema + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.Schema} Schema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Schema.decode = function 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.apihub.v1.Schema(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.displayName = reader.string(); + break; + } + case 2: { + message.rawValue = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Schema message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.Schema + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.Schema} Schema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Schema.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Schema message. + * @function verify + * @memberof google.cloud.apihub.v1.Schema + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Schema.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.rawValue != null && message.hasOwnProperty("rawValue")) + if (!(message.rawValue && typeof message.rawValue.length === "number" || $util.isString(message.rawValue))) + return "rawValue: buffer expected"; + return null; + }; + + /** + * Creates a Schema message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.Schema + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.Schema} Schema + */ + Schema.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.Schema) + return object; + var message = new $root.google.cloud.apihub.v1.Schema(); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.rawValue != null) + if (typeof object.rawValue === "string") + $util.base64.decode(object.rawValue, message.rawValue = $util.newBuffer($util.base64.length(object.rawValue)), 0); + else if (object.rawValue.length >= 0) + message.rawValue = object.rawValue; + return message; + }; + + /** + * Creates a plain object from a Schema message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.Schema + * @static + * @param {google.cloud.apihub.v1.Schema} message Schema + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Schema.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.displayName = ""; + if (options.bytes === String) + object.rawValue = ""; + else { + object.rawValue = []; + if (options.bytes !== Array) + object.rawValue = $util.newBuffer(object.rawValue); + } + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.rawValue != null && message.hasOwnProperty("rawValue")) + object.rawValue = options.bytes === String ? $util.base64.encode(message.rawValue, 0, message.rawValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.rawValue) : message.rawValue; + return object; + }; + + /** + * Converts this Schema to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.Schema + * @instance + * @returns {Object.} JSON object + */ + Schema.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Schema + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.Schema + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Schema.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.Schema"; + }; + + return Schema; + })(); + + v1.Owner = (function() { + + /** + * Properties of an Owner. + * @memberof google.cloud.apihub.v1 + * @interface IOwner + * @property {string|null} [displayName] Owner displayName + * @property {string|null} [email] Owner email + */ + + /** + * Constructs a new Owner. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents an Owner. + * @implements IOwner + * @constructor + * @param {google.cloud.apihub.v1.IOwner=} [properties] Properties to set + */ + function Owner(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]]; + } + + /** + * Owner displayName. + * @member {string} displayName + * @memberof google.cloud.apihub.v1.Owner + * @instance + */ + Owner.prototype.displayName = ""; + + /** + * Owner email. + * @member {string} email + * @memberof google.cloud.apihub.v1.Owner + * @instance + */ + Owner.prototype.email = ""; + + /** + * Creates a new Owner instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.Owner + * @static + * @param {google.cloud.apihub.v1.IOwner=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.Owner} Owner instance + */ + Owner.create = function create(properties) { + return new Owner(properties); + }; + + /** + * Encodes the specified Owner message. Does not implicitly {@link google.cloud.apihub.v1.Owner.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.Owner + * @static + * @param {google.cloud.apihub.v1.IOwner} message Owner message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Owner.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.displayName); + if (message.email != null && Object.hasOwnProperty.call(message, "email")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.email); + return writer; + }; + + /** + * Encodes the specified Owner message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.Owner.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.Owner + * @static + * @param {google.cloud.apihub.v1.IOwner} message Owner message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Owner.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Owner message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.Owner + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.Owner} Owner + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Owner.decode = function 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.apihub.v1.Owner(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.displayName = reader.string(); + break; + } + case 2: { + message.email = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Owner message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.Owner + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.Owner} Owner + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Owner.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Owner message. + * @function verify + * @memberof google.cloud.apihub.v1.Owner + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Owner.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.email != null && message.hasOwnProperty("email")) + if (!$util.isString(message.email)) + return "email: string expected"; + return null; + }; + + /** + * Creates an Owner message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.Owner + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.Owner} Owner + */ + Owner.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.Owner) + return object; + var message = new $root.google.cloud.apihub.v1.Owner(); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.email != null) + message.email = String(object.email); + return message; + }; + + /** + * Creates a plain object from an Owner message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.Owner + * @static + * @param {google.cloud.apihub.v1.Owner} message Owner + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Owner.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.displayName = ""; + object.email = ""; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.email != null && message.hasOwnProperty("email")) + object.email = message.email; + return object; + }; + + /** + * Converts this Owner to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.Owner + * @instance + * @returns {Object.} JSON object + */ + Owner.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Owner + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.Owner + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Owner.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.Owner"; + }; + + return Owner; + })(); + + v1.Documentation = (function() { + + /** + * Properties of a Documentation. + * @memberof google.cloud.apihub.v1 + * @interface IDocumentation + * @property {string|null} [externalUri] Documentation externalUri + */ + + /** + * Constructs a new Documentation. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a Documentation. + * @implements IDocumentation + * @constructor + * @param {google.cloud.apihub.v1.IDocumentation=} [properties] Properties to set + */ + function Documentation(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]]; + } + + /** + * Documentation externalUri. + * @member {string} externalUri + * @memberof google.cloud.apihub.v1.Documentation + * @instance + */ + Documentation.prototype.externalUri = ""; + + /** + * Creates a new Documentation instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.Documentation + * @static + * @param {google.cloud.apihub.v1.IDocumentation=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.Documentation} Documentation instance + */ + Documentation.create = function create(properties) { + return new Documentation(properties); + }; + + /** + * Encodes the specified Documentation message. Does not implicitly {@link google.cloud.apihub.v1.Documentation.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.Documentation + * @static + * @param {google.cloud.apihub.v1.IDocumentation} message Documentation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Documentation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.externalUri != null && Object.hasOwnProperty.call(message, "externalUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.externalUri); + return writer; + }; + + /** + * Encodes the specified Documentation message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.Documentation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.Documentation + * @static + * @param {google.cloud.apihub.v1.IDocumentation} message Documentation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Documentation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Documentation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.Documentation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.Documentation} Documentation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Documentation.decode = function 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.apihub.v1.Documentation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.externalUri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Documentation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.Documentation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.Documentation} Documentation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Documentation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Documentation message. + * @function verify + * @memberof google.cloud.apihub.v1.Documentation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Documentation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.externalUri != null && message.hasOwnProperty("externalUri")) + if (!$util.isString(message.externalUri)) + return "externalUri: string expected"; + return null; + }; + + /** + * Creates a Documentation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.Documentation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.Documentation} Documentation + */ + Documentation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.Documentation) + return object; + var message = new $root.google.cloud.apihub.v1.Documentation(); + if (object.externalUri != null) + message.externalUri = String(object.externalUri); + return message; + }; + + /** + * Creates a plain object from a Documentation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.Documentation + * @static + * @param {google.cloud.apihub.v1.Documentation} message Documentation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Documentation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.externalUri = ""; + if (message.externalUri != null && message.hasOwnProperty("externalUri")) + object.externalUri = message.externalUri; + return object; + }; + + /** + * Converts this Documentation to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.Documentation + * @instance + * @returns {Object.} JSON object + */ + Documentation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Documentation + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.Documentation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Documentation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.Documentation"; + }; + + return Documentation; + })(); + + v1.AttributeValues = (function() { + + /** + * Properties of an AttributeValues. + * @memberof google.cloud.apihub.v1 + * @interface IAttributeValues + * @property {google.cloud.apihub.v1.AttributeValues.IEnumAttributeValues|null} [enumValues] AttributeValues enumValues + * @property {google.cloud.apihub.v1.AttributeValues.IStringAttributeValues|null} [stringValues] AttributeValues stringValues + * @property {google.cloud.apihub.v1.AttributeValues.IStringAttributeValues|null} [jsonValues] AttributeValues jsonValues + * @property {string|null} [attribute] AttributeValues attribute + */ + + /** + * Constructs a new AttributeValues. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents an AttributeValues. + * @implements IAttributeValues + * @constructor + * @param {google.cloud.apihub.v1.IAttributeValues=} [properties] Properties to set + */ + function AttributeValues(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]]; + } + + /** + * AttributeValues enumValues. + * @member {google.cloud.apihub.v1.AttributeValues.IEnumAttributeValues|null|undefined} enumValues + * @memberof google.cloud.apihub.v1.AttributeValues + * @instance + */ + AttributeValues.prototype.enumValues = null; + + /** + * AttributeValues stringValues. + * @member {google.cloud.apihub.v1.AttributeValues.IStringAttributeValues|null|undefined} stringValues + * @memberof google.cloud.apihub.v1.AttributeValues + * @instance + */ + AttributeValues.prototype.stringValues = null; + + /** + * AttributeValues jsonValues. + * @member {google.cloud.apihub.v1.AttributeValues.IStringAttributeValues|null|undefined} jsonValues + * @memberof google.cloud.apihub.v1.AttributeValues + * @instance + */ + AttributeValues.prototype.jsonValues = null; + + /** + * AttributeValues attribute. + * @member {string} attribute + * @memberof google.cloud.apihub.v1.AttributeValues + * @instance + */ + AttributeValues.prototype.attribute = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AttributeValues Value. + * @member {"enumValues"|"stringValues"|"jsonValues"|undefined} Value + * @memberof google.cloud.apihub.v1.AttributeValues + * @instance + */ + Object.defineProperty(AttributeValues.prototype, "Value", { + get: $util.oneOfGetter($oneOfFields = ["enumValues", "stringValues", "jsonValues"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AttributeValues instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.AttributeValues + * @static + * @param {google.cloud.apihub.v1.IAttributeValues=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.AttributeValues} AttributeValues instance + */ + AttributeValues.create = function create(properties) { + return new AttributeValues(properties); + }; + + /** + * Encodes the specified AttributeValues message. Does not implicitly {@link google.cloud.apihub.v1.AttributeValues.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.AttributeValues + * @static + * @param {google.cloud.apihub.v1.IAttributeValues} message AttributeValues message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AttributeValues.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.attribute != null && Object.hasOwnProperty.call(message, "attribute")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.attribute); + if (message.enumValues != null && Object.hasOwnProperty.call(message, "enumValues")) + $root.google.cloud.apihub.v1.AttributeValues.EnumAttributeValues.encode(message.enumValues, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.stringValues != null && Object.hasOwnProperty.call(message, "stringValues")) + $root.google.cloud.apihub.v1.AttributeValues.StringAttributeValues.encode(message.stringValues, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.jsonValues != null && Object.hasOwnProperty.call(message, "jsonValues")) + $root.google.cloud.apihub.v1.AttributeValues.StringAttributeValues.encode(message.jsonValues, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AttributeValues message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.AttributeValues.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.AttributeValues + * @static + * @param {google.cloud.apihub.v1.IAttributeValues} message AttributeValues message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AttributeValues.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AttributeValues message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.AttributeValues + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.AttributeValues} AttributeValues + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AttributeValues.decode = function 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.apihub.v1.AttributeValues(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.enumValues = $root.google.cloud.apihub.v1.AttributeValues.EnumAttributeValues.decode(reader, reader.uint32()); + break; + } + case 3: { + message.stringValues = $root.google.cloud.apihub.v1.AttributeValues.StringAttributeValues.decode(reader, reader.uint32()); + break; + } + case 4: { + message.jsonValues = $root.google.cloud.apihub.v1.AttributeValues.StringAttributeValues.decode(reader, reader.uint32()); + break; + } + case 1: { + message.attribute = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AttributeValues message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.AttributeValues + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.AttributeValues} AttributeValues + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AttributeValues.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AttributeValues message. + * @function verify + * @memberof google.cloud.apihub.v1.AttributeValues + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AttributeValues.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.enumValues != null && message.hasOwnProperty("enumValues")) { + properties.Value = 1; + { + var error = $root.google.cloud.apihub.v1.AttributeValues.EnumAttributeValues.verify(message.enumValues); + if (error) + return "enumValues." + error; + } + } + if (message.stringValues != null && message.hasOwnProperty("stringValues")) { + if (properties.Value === 1) + return "Value: multiple values"; + properties.Value = 1; + { + var error = $root.google.cloud.apihub.v1.AttributeValues.StringAttributeValues.verify(message.stringValues); + if (error) + return "stringValues." + error; + } + } + if (message.jsonValues != null && message.hasOwnProperty("jsonValues")) { + if (properties.Value === 1) + return "Value: multiple values"; + properties.Value = 1; + { + var error = $root.google.cloud.apihub.v1.AttributeValues.StringAttributeValues.verify(message.jsonValues); + if (error) + return "jsonValues." + error; + } + } + if (message.attribute != null && message.hasOwnProperty("attribute")) + if (!$util.isString(message.attribute)) + return "attribute: string expected"; + return null; + }; + + /** + * Creates an AttributeValues message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.AttributeValues + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.AttributeValues} AttributeValues + */ + AttributeValues.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.AttributeValues) + return object; + var message = new $root.google.cloud.apihub.v1.AttributeValues(); + if (object.enumValues != null) { + if (typeof object.enumValues !== "object") + throw TypeError(".google.cloud.apihub.v1.AttributeValues.enumValues: object expected"); + message.enumValues = $root.google.cloud.apihub.v1.AttributeValues.EnumAttributeValues.fromObject(object.enumValues); + } + if (object.stringValues != null) { + if (typeof object.stringValues !== "object") + throw TypeError(".google.cloud.apihub.v1.AttributeValues.stringValues: object expected"); + message.stringValues = $root.google.cloud.apihub.v1.AttributeValues.StringAttributeValues.fromObject(object.stringValues); + } + if (object.jsonValues != null) { + if (typeof object.jsonValues !== "object") + throw TypeError(".google.cloud.apihub.v1.AttributeValues.jsonValues: object expected"); + message.jsonValues = $root.google.cloud.apihub.v1.AttributeValues.StringAttributeValues.fromObject(object.jsonValues); + } + if (object.attribute != null) + message.attribute = String(object.attribute); + return message; + }; + + /** + * Creates a plain object from an AttributeValues message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.AttributeValues + * @static + * @param {google.cloud.apihub.v1.AttributeValues} message AttributeValues + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AttributeValues.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.attribute = ""; + if (message.attribute != null && message.hasOwnProperty("attribute")) + object.attribute = message.attribute; + if (message.enumValues != null && message.hasOwnProperty("enumValues")) { + object.enumValues = $root.google.cloud.apihub.v1.AttributeValues.EnumAttributeValues.toObject(message.enumValues, options); + if (options.oneofs) + object.Value = "enumValues"; + } + if (message.stringValues != null && message.hasOwnProperty("stringValues")) { + object.stringValues = $root.google.cloud.apihub.v1.AttributeValues.StringAttributeValues.toObject(message.stringValues, options); + if (options.oneofs) + object.Value = "stringValues"; + } + if (message.jsonValues != null && message.hasOwnProperty("jsonValues")) { + object.jsonValues = $root.google.cloud.apihub.v1.AttributeValues.StringAttributeValues.toObject(message.jsonValues, options); + if (options.oneofs) + object.Value = "jsonValues"; + } + return object; + }; + + /** + * Converts this AttributeValues to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.AttributeValues + * @instance + * @returns {Object.} JSON object + */ + AttributeValues.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AttributeValues + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.AttributeValues + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AttributeValues.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.AttributeValues"; + }; + + AttributeValues.EnumAttributeValues = (function() { + + /** + * Properties of an EnumAttributeValues. + * @memberof google.cloud.apihub.v1.AttributeValues + * @interface IEnumAttributeValues + * @property {Array.|null} [values] EnumAttributeValues values + */ + + /** + * Constructs a new EnumAttributeValues. + * @memberof google.cloud.apihub.v1.AttributeValues + * @classdesc Represents an EnumAttributeValues. + * @implements IEnumAttributeValues + * @constructor + * @param {google.cloud.apihub.v1.AttributeValues.IEnumAttributeValues=} [properties] Properties to set + */ + function EnumAttributeValues(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]]; + } + + /** + * EnumAttributeValues values. + * @member {Array.} values + * @memberof google.cloud.apihub.v1.AttributeValues.EnumAttributeValues + * @instance + */ + EnumAttributeValues.prototype.values = $util.emptyArray; + + /** + * Creates a new EnumAttributeValues instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.AttributeValues.EnumAttributeValues + * @static + * @param {google.cloud.apihub.v1.AttributeValues.IEnumAttributeValues=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.AttributeValues.EnumAttributeValues} EnumAttributeValues instance + */ + EnumAttributeValues.create = function create(properties) { + return new EnumAttributeValues(properties); + }; + + /** + * Encodes the specified EnumAttributeValues message. Does not implicitly {@link google.cloud.apihub.v1.AttributeValues.EnumAttributeValues.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.AttributeValues.EnumAttributeValues + * @static + * @param {google.cloud.apihub.v1.AttributeValues.IEnumAttributeValues} message EnumAttributeValues message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumAttributeValues.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.cloud.apihub.v1.Attribute.AllowedValue.encode(message.values[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumAttributeValues message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.AttributeValues.EnumAttributeValues.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.AttributeValues.EnumAttributeValues + * @static + * @param {google.cloud.apihub.v1.AttributeValues.IEnumAttributeValues} message EnumAttributeValues message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumAttributeValues.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumAttributeValues message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.AttributeValues.EnumAttributeValues + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.AttributeValues.EnumAttributeValues} EnumAttributeValues + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumAttributeValues.decode = function 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.apihub.v1.AttributeValues.EnumAttributeValues(); + 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.cloud.apihub.v1.Attribute.AllowedValue.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumAttributeValues message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.AttributeValues.EnumAttributeValues + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.AttributeValues.EnumAttributeValues} EnumAttributeValues + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumAttributeValues.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumAttributeValues message. + * @function verify + * @memberof google.cloud.apihub.v1.AttributeValues.EnumAttributeValues + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumAttributeValues.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.cloud.apihub.v1.Attribute.AllowedValue.verify(message.values[i]); + if (error) + return "values." + error; + } + } + return null; + }; + + /** + * Creates an EnumAttributeValues message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.AttributeValues.EnumAttributeValues + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.AttributeValues.EnumAttributeValues} EnumAttributeValues + */ + EnumAttributeValues.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.AttributeValues.EnumAttributeValues) + return object; + var message = new $root.google.cloud.apihub.v1.AttributeValues.EnumAttributeValues(); + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.cloud.apihub.v1.AttributeValues.EnumAttributeValues.values: array expected"); + message.values = []; + for (var i = 0; i < object.values.length; ++i) { + if (typeof object.values[i] !== "object") + throw TypeError(".google.cloud.apihub.v1.AttributeValues.EnumAttributeValues.values: object expected"); + message.values[i] = $root.google.cloud.apihub.v1.Attribute.AllowedValue.fromObject(object.values[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumAttributeValues message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.AttributeValues.EnumAttributeValues + * @static + * @param {google.cloud.apihub.v1.AttributeValues.EnumAttributeValues} message EnumAttributeValues + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumAttributeValues.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.cloud.apihub.v1.Attribute.AllowedValue.toObject(message.values[j], options); + } + return object; + }; + + /** + * Converts this EnumAttributeValues to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.AttributeValues.EnumAttributeValues + * @instance + * @returns {Object.} JSON object + */ + EnumAttributeValues.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumAttributeValues + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.AttributeValues.EnumAttributeValues + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumAttributeValues.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.AttributeValues.EnumAttributeValues"; + }; + + return EnumAttributeValues; + })(); + + AttributeValues.StringAttributeValues = (function() { + + /** + * Properties of a StringAttributeValues. + * @memberof google.cloud.apihub.v1.AttributeValues + * @interface IStringAttributeValues + * @property {Array.|null} [values] StringAttributeValues values + */ + + /** + * Constructs a new StringAttributeValues. + * @memberof google.cloud.apihub.v1.AttributeValues + * @classdesc Represents a StringAttributeValues. + * @implements IStringAttributeValues + * @constructor + * @param {google.cloud.apihub.v1.AttributeValues.IStringAttributeValues=} [properties] Properties to set + */ + function StringAttributeValues(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]]; + } + + /** + * StringAttributeValues values. + * @member {Array.} values + * @memberof google.cloud.apihub.v1.AttributeValues.StringAttributeValues + * @instance + */ + StringAttributeValues.prototype.values = $util.emptyArray; + + /** + * Creates a new StringAttributeValues instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.AttributeValues.StringAttributeValues + * @static + * @param {google.cloud.apihub.v1.AttributeValues.IStringAttributeValues=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.AttributeValues.StringAttributeValues} StringAttributeValues instance + */ + StringAttributeValues.create = function create(properties) { + return new StringAttributeValues(properties); + }; + + /** + * Encodes the specified StringAttributeValues message. Does not implicitly {@link google.cloud.apihub.v1.AttributeValues.StringAttributeValues.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.AttributeValues.StringAttributeValues + * @static + * @param {google.cloud.apihub.v1.AttributeValues.IStringAttributeValues} message StringAttributeValues message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringAttributeValues.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) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.values[i]); + return writer; + }; + + /** + * Encodes the specified StringAttributeValues message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.AttributeValues.StringAttributeValues.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.AttributeValues.StringAttributeValues + * @static + * @param {google.cloud.apihub.v1.AttributeValues.IStringAttributeValues} message StringAttributeValues message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringAttributeValues.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StringAttributeValues message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.AttributeValues.StringAttributeValues + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.AttributeValues.StringAttributeValues} StringAttributeValues + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringAttributeValues.decode = function 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.apihub.v1.AttributeValues.StringAttributeValues(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.values && message.values.length)) + message.values = []; + message.values.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StringAttributeValues message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.AttributeValues.StringAttributeValues + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.AttributeValues.StringAttributeValues} StringAttributeValues + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringAttributeValues.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StringAttributeValues message. + * @function verify + * @memberof google.cloud.apihub.v1.AttributeValues.StringAttributeValues + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StringAttributeValues.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) + if (!$util.isString(message.values[i])) + return "values: string[] expected"; + } + return null; + }; + + /** + * Creates a StringAttributeValues message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.AttributeValues.StringAttributeValues + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.AttributeValues.StringAttributeValues} StringAttributeValues + */ + StringAttributeValues.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.AttributeValues.StringAttributeValues) + return object; + var message = new $root.google.cloud.apihub.v1.AttributeValues.StringAttributeValues(); + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.cloud.apihub.v1.AttributeValues.StringAttributeValues.values: array expected"); + message.values = []; + for (var i = 0; i < object.values.length; ++i) + message.values[i] = String(object.values[i]); + } + return message; + }; + + /** + * Creates a plain object from a StringAttributeValues message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.AttributeValues.StringAttributeValues + * @static + * @param {google.cloud.apihub.v1.AttributeValues.StringAttributeValues} message StringAttributeValues + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StringAttributeValues.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] = message.values[j]; + } + return object; + }; + + /** + * Converts this StringAttributeValues to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.AttributeValues.StringAttributeValues + * @instance + * @returns {Object.} JSON object + */ + StringAttributeValues.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StringAttributeValues + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.AttributeValues.StringAttributeValues + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StringAttributeValues.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.AttributeValues.StringAttributeValues"; + }; + + return StringAttributeValues; + })(); + + return AttributeValues; + })(); + + v1.Dependency = (function() { + + /** + * Properties of a Dependency. + * @memberof google.cloud.apihub.v1 + * @interface IDependency + * @property {string|null} [name] Dependency name + * @property {google.cloud.apihub.v1.IDependencyEntityReference|null} [consumer] Dependency consumer + * @property {google.cloud.apihub.v1.IDependencyEntityReference|null} [supplier] Dependency supplier + * @property {google.cloud.apihub.v1.Dependency.State|null} [state] Dependency state + * @property {string|null} [description] Dependency description + * @property {google.cloud.apihub.v1.Dependency.DiscoveryMode|null} [discoveryMode] Dependency discoveryMode + * @property {google.cloud.apihub.v1.IDependencyErrorDetail|null} [errorDetail] Dependency errorDetail + * @property {google.protobuf.ITimestamp|null} [createTime] Dependency createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Dependency updateTime + * @property {Object.|null} [attributes] Dependency attributes + */ + + /** + * Constructs a new Dependency. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a Dependency. + * @implements IDependency + * @constructor + * @param {google.cloud.apihub.v1.IDependency=} [properties] Properties to set + */ + function Dependency(properties) { + this.attributes = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Dependency name. + * @member {string} name + * @memberof google.cloud.apihub.v1.Dependency + * @instance + */ + Dependency.prototype.name = ""; + + /** + * Dependency consumer. + * @member {google.cloud.apihub.v1.IDependencyEntityReference|null|undefined} consumer + * @memberof google.cloud.apihub.v1.Dependency + * @instance + */ + Dependency.prototype.consumer = null; + + /** + * Dependency supplier. + * @member {google.cloud.apihub.v1.IDependencyEntityReference|null|undefined} supplier + * @memberof google.cloud.apihub.v1.Dependency + * @instance + */ + Dependency.prototype.supplier = null; + + /** + * Dependency state. + * @member {google.cloud.apihub.v1.Dependency.State} state + * @memberof google.cloud.apihub.v1.Dependency + * @instance + */ + Dependency.prototype.state = 0; + + /** + * Dependency description. + * @member {string} description + * @memberof google.cloud.apihub.v1.Dependency + * @instance + */ + Dependency.prototype.description = ""; + + /** + * Dependency discoveryMode. + * @member {google.cloud.apihub.v1.Dependency.DiscoveryMode} discoveryMode + * @memberof google.cloud.apihub.v1.Dependency + * @instance + */ + Dependency.prototype.discoveryMode = 0; + + /** + * Dependency errorDetail. + * @member {google.cloud.apihub.v1.IDependencyErrorDetail|null|undefined} errorDetail + * @memberof google.cloud.apihub.v1.Dependency + * @instance + */ + Dependency.prototype.errorDetail = null; + + /** + * Dependency createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.apihub.v1.Dependency + * @instance + */ + Dependency.prototype.createTime = null; + + /** + * Dependency updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.apihub.v1.Dependency + * @instance + */ + Dependency.prototype.updateTime = null; + + /** + * Dependency attributes. + * @member {Object.} attributes + * @memberof google.cloud.apihub.v1.Dependency + * @instance + */ + Dependency.prototype.attributes = $util.emptyObject; + + /** + * Creates a new Dependency instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.Dependency + * @static + * @param {google.cloud.apihub.v1.IDependency=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.Dependency} Dependency instance + */ + Dependency.create = function create(properties) { + return new Dependency(properties); + }; + + /** + * Encodes the specified Dependency message. Does not implicitly {@link google.cloud.apihub.v1.Dependency.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.Dependency + * @static + * @param {google.cloud.apihub.v1.IDependency} message Dependency message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Dependency.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.consumer != null && Object.hasOwnProperty.call(message, "consumer")) + $root.google.cloud.apihub.v1.DependencyEntityReference.encode(message.consumer, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.supplier != null && Object.hasOwnProperty.call(message, "supplier")) + $root.google.cloud.apihub.v1.DependencyEntityReference.encode(message.supplier, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.state); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.description); + if (message.discoveryMode != null && Object.hasOwnProperty.call(message, "discoveryMode")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.discoveryMode); + if (message.errorDetail != null && Object.hasOwnProperty.call(message, "errorDetail")) + $root.google.cloud.apihub.v1.DependencyErrorDetail.encode(message.errorDetail, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.attributes != null && Object.hasOwnProperty.call(message, "attributes")) + for (var keys = Object.keys(message.attributes), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 10, wireType 2 =*/82).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.apihub.v1.AttributeValues.encode(message.attributes[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified Dependency message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.Dependency.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.Dependency + * @static + * @param {google.cloud.apihub.v1.IDependency} message Dependency message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Dependency.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Dependency message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.Dependency + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.Dependency} Dependency + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Dependency.decode = function 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.apihub.v1.Dependency(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.consumer = $root.google.cloud.apihub.v1.DependencyEntityReference.decode(reader, reader.uint32()); + break; + } + case 3: { + message.supplier = $root.google.cloud.apihub.v1.DependencyEntityReference.decode(reader, reader.uint32()); + break; + } + case 4: { + message.state = reader.int32(); + break; + } + case 5: { + message.description = reader.string(); + break; + } + case 6: { + message.discoveryMode = reader.int32(); + break; + } + case 7: { + message.errorDetail = $root.google.cloud.apihub.v1.DependencyErrorDetail.decode(reader, reader.uint32()); + break; + } + case 8: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 9: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 10: { + if (message.attributes === $util.emptyObject) + message.attributes = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.apihub.v1.AttributeValues.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.attributes[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Dependency message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.Dependency + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.Dependency} Dependency + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Dependency.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Dependency message. + * @function verify + * @memberof google.cloud.apihub.v1.Dependency + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Dependency.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.consumer != null && message.hasOwnProperty("consumer")) { + var error = $root.google.cloud.apihub.v1.DependencyEntityReference.verify(message.consumer); + if (error) + return "consumer." + error; + } + if (message.supplier != null && message.hasOwnProperty("supplier")) { + var error = $root.google.cloud.apihub.v1.DependencyEntityReference.verify(message.supplier); + if (error) + return "supplier." + 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.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.discoveryMode != null && message.hasOwnProperty("discoveryMode")) + switch (message.discoveryMode) { + default: + return "discoveryMode: enum value expected"; + case 0: + case 1: + break; + } + if (message.errorDetail != null && message.hasOwnProperty("errorDetail")) { + var error = $root.google.cloud.apihub.v1.DependencyErrorDetail.verify(message.errorDetail); + if (error) + return "errorDetail." + error; + } + 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.attributes != null && message.hasOwnProperty("attributes")) { + if (!$util.isObject(message.attributes)) + return "attributes: object expected"; + var key = Object.keys(message.attributes); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.apihub.v1.AttributeValues.verify(message.attributes[key[i]]); + if (error) + return "attributes." + error; + } + } + return null; + }; + + /** + * Creates a Dependency message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.Dependency + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.Dependency} Dependency + */ + Dependency.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.Dependency) + return object; + var message = new $root.google.cloud.apihub.v1.Dependency(); + if (object.name != null) + message.name = String(object.name); + if (object.consumer != null) { + if (typeof object.consumer !== "object") + throw TypeError(".google.cloud.apihub.v1.Dependency.consumer: object expected"); + message.consumer = $root.google.cloud.apihub.v1.DependencyEntityReference.fromObject(object.consumer); + } + if (object.supplier != null) { + if (typeof object.supplier !== "object") + throw TypeError(".google.cloud.apihub.v1.Dependency.supplier: object expected"); + message.supplier = $root.google.cloud.apihub.v1.DependencyEntityReference.fromObject(object.supplier); + } + 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 "PROPOSED": + case 1: + message.state = 1; + break; + case "VALIDATED": + case 2: + message.state = 2; + break; + } + if (object.description != null) + message.description = String(object.description); + switch (object.discoveryMode) { + default: + if (typeof object.discoveryMode === "number") { + message.discoveryMode = object.discoveryMode; + break; + } + break; + case "DISCOVERY_MODE_UNSPECIFIED": + case 0: + message.discoveryMode = 0; + break; + case "MANUAL": + case 1: + message.discoveryMode = 1; + break; + } + if (object.errorDetail != null) { + if (typeof object.errorDetail !== "object") + throw TypeError(".google.cloud.apihub.v1.Dependency.errorDetail: object expected"); + message.errorDetail = $root.google.cloud.apihub.v1.DependencyErrorDetail.fromObject(object.errorDetail); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.apihub.v1.Dependency.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.apihub.v1.Dependency.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.attributes) { + if (typeof object.attributes !== "object") + throw TypeError(".google.cloud.apihub.v1.Dependency.attributes: object expected"); + message.attributes = {}; + for (var keys = Object.keys(object.attributes), i = 0; i < keys.length; ++i) { + if (typeof object.attributes[keys[i]] !== "object") + throw TypeError(".google.cloud.apihub.v1.Dependency.attributes: object expected"); + message.attributes[keys[i]] = $root.google.cloud.apihub.v1.AttributeValues.fromObject(object.attributes[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a Dependency message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.Dependency + * @static + * @param {google.cloud.apihub.v1.Dependency} message Dependency + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Dependency.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.attributes = {}; + if (options.defaults) { + object.name = ""; + object.consumer = null; + object.supplier = null; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.description = ""; + object.discoveryMode = options.enums === String ? "DISCOVERY_MODE_UNSPECIFIED" : 0; + object.errorDetail = null; + object.createTime = null; + object.updateTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.consumer != null && message.hasOwnProperty("consumer")) + object.consumer = $root.google.cloud.apihub.v1.DependencyEntityReference.toObject(message.consumer, options); + if (message.supplier != null && message.hasOwnProperty("supplier")) + object.supplier = $root.google.cloud.apihub.v1.DependencyEntityReference.toObject(message.supplier, options); + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.apihub.v1.Dependency.State[message.state] === undefined ? message.state : $root.google.cloud.apihub.v1.Dependency.State[message.state] : message.state; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.discoveryMode != null && message.hasOwnProperty("discoveryMode")) + object.discoveryMode = options.enums === String ? $root.google.cloud.apihub.v1.Dependency.DiscoveryMode[message.discoveryMode] === undefined ? message.discoveryMode : $root.google.cloud.apihub.v1.Dependency.DiscoveryMode[message.discoveryMode] : message.discoveryMode; + if (message.errorDetail != null && message.hasOwnProperty("errorDetail")) + object.errorDetail = $root.google.cloud.apihub.v1.DependencyErrorDetail.toObject(message.errorDetail, options); + 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.attributes && (keys2 = Object.keys(message.attributes)).length) { + object.attributes = {}; + for (var j = 0; j < keys2.length; ++j) + object.attributes[keys2[j]] = $root.google.cloud.apihub.v1.AttributeValues.toObject(message.attributes[keys2[j]], options); + } + return object; + }; + + /** + * Converts this Dependency to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.Dependency + * @instance + * @returns {Object.} JSON object + */ + Dependency.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Dependency + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.Dependency + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Dependency.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.Dependency"; + }; + + /** + * State enum. + * @name google.cloud.apihub.v1.Dependency.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} PROPOSED=1 PROPOSED value + * @property {number} VALIDATED=2 VALIDATED value + */ + Dependency.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PROPOSED"] = 1; + values[valuesById[2] = "VALIDATED"] = 2; + return values; + })(); + + /** + * DiscoveryMode enum. + * @name google.cloud.apihub.v1.Dependency.DiscoveryMode + * @enum {number} + * @property {number} DISCOVERY_MODE_UNSPECIFIED=0 DISCOVERY_MODE_UNSPECIFIED value + * @property {number} MANUAL=1 MANUAL value + */ + Dependency.DiscoveryMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DISCOVERY_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "MANUAL"] = 1; + return values; + })(); + + return Dependency; + })(); + + v1.DependencyEntityReference = (function() { + + /** + * Properties of a DependencyEntityReference. + * @memberof google.cloud.apihub.v1 + * @interface IDependencyEntityReference + * @property {string|null} [operationResourceName] DependencyEntityReference operationResourceName + * @property {string|null} [externalApiResourceName] DependencyEntityReference externalApiResourceName + * @property {string|null} [displayName] DependencyEntityReference displayName + */ + + /** + * Constructs a new DependencyEntityReference. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a DependencyEntityReference. + * @implements IDependencyEntityReference + * @constructor + * @param {google.cloud.apihub.v1.IDependencyEntityReference=} [properties] Properties to set + */ + function DependencyEntityReference(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]]; + } + + /** + * DependencyEntityReference operationResourceName. + * @member {string|null|undefined} operationResourceName + * @memberof google.cloud.apihub.v1.DependencyEntityReference + * @instance + */ + DependencyEntityReference.prototype.operationResourceName = null; + + /** + * DependencyEntityReference externalApiResourceName. + * @member {string|null|undefined} externalApiResourceName + * @memberof google.cloud.apihub.v1.DependencyEntityReference + * @instance + */ + DependencyEntityReference.prototype.externalApiResourceName = null; + + /** + * DependencyEntityReference displayName. + * @member {string} displayName + * @memberof google.cloud.apihub.v1.DependencyEntityReference + * @instance + */ + DependencyEntityReference.prototype.displayName = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DependencyEntityReference identifier. + * @member {"operationResourceName"|"externalApiResourceName"|undefined} identifier + * @memberof google.cloud.apihub.v1.DependencyEntityReference + * @instance + */ + Object.defineProperty(DependencyEntityReference.prototype, "identifier", { + get: $util.oneOfGetter($oneOfFields = ["operationResourceName", "externalApiResourceName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DependencyEntityReference instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.DependencyEntityReference + * @static + * @param {google.cloud.apihub.v1.IDependencyEntityReference=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.DependencyEntityReference} DependencyEntityReference instance + */ + DependencyEntityReference.create = function create(properties) { + return new DependencyEntityReference(properties); + }; + + /** + * Encodes the specified DependencyEntityReference message. Does not implicitly {@link google.cloud.apihub.v1.DependencyEntityReference.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.DependencyEntityReference + * @static + * @param {google.cloud.apihub.v1.IDependencyEntityReference} message DependencyEntityReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DependencyEntityReference.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.displayName); + if (message.operationResourceName != null && Object.hasOwnProperty.call(message, "operationResourceName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.operationResourceName); + if (message.externalApiResourceName != null && Object.hasOwnProperty.call(message, "externalApiResourceName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.externalApiResourceName); + return writer; + }; + + /** + * Encodes the specified DependencyEntityReference message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.DependencyEntityReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.DependencyEntityReference + * @static + * @param {google.cloud.apihub.v1.IDependencyEntityReference} message DependencyEntityReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DependencyEntityReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DependencyEntityReference message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.DependencyEntityReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.DependencyEntityReference} DependencyEntityReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DependencyEntityReference.decode = function 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.apihub.v1.DependencyEntityReference(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.operationResourceName = reader.string(); + break; + } + case 3: { + message.externalApiResourceName = reader.string(); + break; + } + case 1: { + message.displayName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DependencyEntityReference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.DependencyEntityReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.DependencyEntityReference} DependencyEntityReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DependencyEntityReference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DependencyEntityReference message. + * @function verify + * @memberof google.cloud.apihub.v1.DependencyEntityReference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DependencyEntityReference.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.operationResourceName != null && message.hasOwnProperty("operationResourceName")) { + properties.identifier = 1; + if (!$util.isString(message.operationResourceName)) + return "operationResourceName: string expected"; + } + if (message.externalApiResourceName != null && message.hasOwnProperty("externalApiResourceName")) { + if (properties.identifier === 1) + return "identifier: multiple values"; + properties.identifier = 1; + if (!$util.isString(message.externalApiResourceName)) + return "externalApiResourceName: string expected"; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + return null; + }; + + /** + * Creates a DependencyEntityReference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.DependencyEntityReference + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.DependencyEntityReference} DependencyEntityReference + */ + DependencyEntityReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.DependencyEntityReference) + return object; + var message = new $root.google.cloud.apihub.v1.DependencyEntityReference(); + if (object.operationResourceName != null) + message.operationResourceName = String(object.operationResourceName); + if (object.externalApiResourceName != null) + message.externalApiResourceName = String(object.externalApiResourceName); + if (object.displayName != null) + message.displayName = String(object.displayName); + return message; + }; + + /** + * Creates a plain object from a DependencyEntityReference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.DependencyEntityReference + * @static + * @param {google.cloud.apihub.v1.DependencyEntityReference} message DependencyEntityReference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DependencyEntityReference.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.displayName = ""; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.operationResourceName != null && message.hasOwnProperty("operationResourceName")) { + object.operationResourceName = message.operationResourceName; + if (options.oneofs) + object.identifier = "operationResourceName"; + } + if (message.externalApiResourceName != null && message.hasOwnProperty("externalApiResourceName")) { + object.externalApiResourceName = message.externalApiResourceName; + if (options.oneofs) + object.identifier = "externalApiResourceName"; + } + return object; + }; + + /** + * Converts this DependencyEntityReference to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.DependencyEntityReference + * @instance + * @returns {Object.} JSON object + */ + DependencyEntityReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DependencyEntityReference + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.DependencyEntityReference + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DependencyEntityReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.DependencyEntityReference"; + }; + + return DependencyEntityReference; + })(); + + v1.DependencyErrorDetail = (function() { + + /** + * Properties of a DependencyErrorDetail. + * @memberof google.cloud.apihub.v1 + * @interface IDependencyErrorDetail + * @property {google.cloud.apihub.v1.DependencyErrorDetail.Error|null} [error] DependencyErrorDetail error + * @property {google.protobuf.ITimestamp|null} [errorTime] DependencyErrorDetail errorTime + */ + + /** + * Constructs a new DependencyErrorDetail. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a DependencyErrorDetail. + * @implements IDependencyErrorDetail + * @constructor + * @param {google.cloud.apihub.v1.IDependencyErrorDetail=} [properties] Properties to set + */ + function DependencyErrorDetail(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]]; + } + + /** + * DependencyErrorDetail error. + * @member {google.cloud.apihub.v1.DependencyErrorDetail.Error} error + * @memberof google.cloud.apihub.v1.DependencyErrorDetail + * @instance + */ + DependencyErrorDetail.prototype.error = 0; + + /** + * DependencyErrorDetail errorTime. + * @member {google.protobuf.ITimestamp|null|undefined} errorTime + * @memberof google.cloud.apihub.v1.DependencyErrorDetail + * @instance + */ + DependencyErrorDetail.prototype.errorTime = null; + + /** + * Creates a new DependencyErrorDetail instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.DependencyErrorDetail + * @static + * @param {google.cloud.apihub.v1.IDependencyErrorDetail=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.DependencyErrorDetail} DependencyErrorDetail instance + */ + DependencyErrorDetail.create = function create(properties) { + return new DependencyErrorDetail(properties); + }; + + /** + * Encodes the specified DependencyErrorDetail message. Does not implicitly {@link google.cloud.apihub.v1.DependencyErrorDetail.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.DependencyErrorDetail + * @static + * @param {google.cloud.apihub.v1.IDependencyErrorDetail} message DependencyErrorDetail message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DependencyErrorDetail.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.error); + if (message.errorTime != null && Object.hasOwnProperty.call(message, "errorTime")) + $root.google.protobuf.Timestamp.encode(message.errorTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DependencyErrorDetail message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.DependencyErrorDetail.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.DependencyErrorDetail + * @static + * @param {google.cloud.apihub.v1.IDependencyErrorDetail} message DependencyErrorDetail message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DependencyErrorDetail.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DependencyErrorDetail message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.DependencyErrorDetail + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.DependencyErrorDetail} DependencyErrorDetail + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DependencyErrorDetail.decode = function 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.apihub.v1.DependencyErrorDetail(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.error = reader.int32(); + break; + } + case 2: { + message.errorTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DependencyErrorDetail message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.DependencyErrorDetail + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.DependencyErrorDetail} DependencyErrorDetail + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DependencyErrorDetail.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DependencyErrorDetail message. + * @function verify + * @memberof google.cloud.apihub.v1.DependencyErrorDetail + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DependencyErrorDetail.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.error != null && message.hasOwnProperty("error")) + switch (message.error) { + default: + return "error: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.errorTime != null && message.hasOwnProperty("errorTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.errorTime); + if (error) + return "errorTime." + error; + } + return null; + }; + + /** + * Creates a DependencyErrorDetail message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.DependencyErrorDetail + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.DependencyErrorDetail} DependencyErrorDetail + */ + DependencyErrorDetail.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.DependencyErrorDetail) + return object; + var message = new $root.google.cloud.apihub.v1.DependencyErrorDetail(); + switch (object.error) { + default: + if (typeof object.error === "number") { + message.error = object.error; + break; + } + break; + case "ERROR_UNSPECIFIED": + case 0: + message.error = 0; + break; + case "SUPPLIER_NOT_FOUND": + case 1: + message.error = 1; + break; + case "SUPPLIER_RECREATED": + case 2: + message.error = 2; + break; + } + if (object.errorTime != null) { + if (typeof object.errorTime !== "object") + throw TypeError(".google.cloud.apihub.v1.DependencyErrorDetail.errorTime: object expected"); + message.errorTime = $root.google.protobuf.Timestamp.fromObject(object.errorTime); + } + return message; + }; + + /** + * Creates a plain object from a DependencyErrorDetail message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.DependencyErrorDetail + * @static + * @param {google.cloud.apihub.v1.DependencyErrorDetail} message DependencyErrorDetail + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DependencyErrorDetail.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.error = options.enums === String ? "ERROR_UNSPECIFIED" : 0; + object.errorTime = null; + } + if (message.error != null && message.hasOwnProperty("error")) + object.error = options.enums === String ? $root.google.cloud.apihub.v1.DependencyErrorDetail.Error[message.error] === undefined ? message.error : $root.google.cloud.apihub.v1.DependencyErrorDetail.Error[message.error] : message.error; + if (message.errorTime != null && message.hasOwnProperty("errorTime")) + object.errorTime = $root.google.protobuf.Timestamp.toObject(message.errorTime, options); + return object; + }; + + /** + * Converts this DependencyErrorDetail to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.DependencyErrorDetail + * @instance + * @returns {Object.} JSON object + */ + DependencyErrorDetail.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DependencyErrorDetail + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.DependencyErrorDetail + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DependencyErrorDetail.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.DependencyErrorDetail"; + }; + + /** + * Error enum. + * @name google.cloud.apihub.v1.DependencyErrorDetail.Error + * @enum {number} + * @property {number} ERROR_UNSPECIFIED=0 ERROR_UNSPECIFIED value + * @property {number} SUPPLIER_NOT_FOUND=1 SUPPLIER_NOT_FOUND value + * @property {number} SUPPLIER_RECREATED=2 SUPPLIER_RECREATED value + */ + DependencyErrorDetail.Error = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ERROR_UNSPECIFIED"] = 0; + values[valuesById[1] = "SUPPLIER_NOT_FOUND"] = 1; + values[valuesById[2] = "SUPPLIER_RECREATED"] = 2; + return values; + })(); + + return DependencyErrorDetail; + })(); + + v1.LintResponse = (function() { + + /** + * Properties of a LintResponse. + * @memberof google.cloud.apihub.v1 + * @interface ILintResponse + * @property {Array.|null} [issues] LintResponse issues + * @property {Array.|null} [summary] LintResponse summary + * @property {google.cloud.apihub.v1.LintState|null} [state] LintResponse state + * @property {string|null} [source] LintResponse source + * @property {google.cloud.apihub.v1.Linter|null} [linter] LintResponse linter + * @property {google.protobuf.ITimestamp|null} [createTime] LintResponse createTime + */ + + /** + * Constructs a new LintResponse. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a LintResponse. + * @implements ILintResponse + * @constructor + * @param {google.cloud.apihub.v1.ILintResponse=} [properties] Properties to set + */ + function LintResponse(properties) { + this.issues = []; + this.summary = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LintResponse issues. + * @member {Array.} issues + * @memberof google.cloud.apihub.v1.LintResponse + * @instance + */ + LintResponse.prototype.issues = $util.emptyArray; + + /** + * LintResponse summary. + * @member {Array.} summary + * @memberof google.cloud.apihub.v1.LintResponse + * @instance + */ + LintResponse.prototype.summary = $util.emptyArray; + + /** + * LintResponse state. + * @member {google.cloud.apihub.v1.LintState} state + * @memberof google.cloud.apihub.v1.LintResponse + * @instance + */ + LintResponse.prototype.state = 0; + + /** + * LintResponse source. + * @member {string} source + * @memberof google.cloud.apihub.v1.LintResponse + * @instance + */ + LintResponse.prototype.source = ""; + + /** + * LintResponse linter. + * @member {google.cloud.apihub.v1.Linter} linter + * @memberof google.cloud.apihub.v1.LintResponse + * @instance + */ + LintResponse.prototype.linter = 0; + + /** + * LintResponse createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.apihub.v1.LintResponse + * @instance + */ + LintResponse.prototype.createTime = null; + + /** + * Creates a new LintResponse instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.LintResponse + * @static + * @param {google.cloud.apihub.v1.ILintResponse=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.LintResponse} LintResponse instance + */ + LintResponse.create = function create(properties) { + return new LintResponse(properties); + }; + + /** + * Encodes the specified LintResponse message. Does not implicitly {@link google.cloud.apihub.v1.LintResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.LintResponse + * @static + * @param {google.cloud.apihub.v1.ILintResponse} message LintResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LintResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.issues != null && message.issues.length) + for (var i = 0; i < message.issues.length; ++i) + $root.google.cloud.apihub.v1.Issue.encode(message.issues[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.summary != null && message.summary.length) + for (var i = 0; i < message.summary.length; ++i) + $root.google.cloud.apihub.v1.LintResponse.SummaryEntry.encode(message.summary[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.state); + if (message.source != null && Object.hasOwnProperty.call(message, "source")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.source); + if (message.linter != null && Object.hasOwnProperty.call(message, "linter")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.linter); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LintResponse message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.LintResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.LintResponse + * @static + * @param {google.cloud.apihub.v1.ILintResponse} message LintResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LintResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LintResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.LintResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.LintResponse} LintResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LintResponse.decode = function 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.apihub.v1.LintResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.issues && message.issues.length)) + message.issues = []; + message.issues.push($root.google.cloud.apihub.v1.Issue.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.summary && message.summary.length)) + message.summary = []; + message.summary.push($root.google.cloud.apihub.v1.LintResponse.SummaryEntry.decode(reader, reader.uint32())); + break; + } + case 3: { + message.state = reader.int32(); + break; + } + case 4: { + message.source = reader.string(); + break; + } + case 5: { + message.linter = reader.int32(); + break; + } + case 6: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LintResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.LintResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.LintResponse} LintResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LintResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LintResponse message. + * @function verify + * @memberof google.cloud.apihub.v1.LintResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LintResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.issues != null && message.hasOwnProperty("issues")) { + if (!Array.isArray(message.issues)) + return "issues: array expected"; + for (var i = 0; i < message.issues.length; ++i) { + var error = $root.google.cloud.apihub.v1.Issue.verify(message.issues[i]); + if (error) + return "issues." + error; + } + } + if (message.summary != null && message.hasOwnProperty("summary")) { + if (!Array.isArray(message.summary)) + return "summary: array expected"; + for (var i = 0; i < message.summary.length; ++i) { + var error = $root.google.cloud.apihub.v1.LintResponse.SummaryEntry.verify(message.summary[i]); + if (error) + return "summary." + 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.source != null && message.hasOwnProperty("source")) + if (!$util.isString(message.source)) + return "source: string expected"; + if (message.linter != null && message.hasOwnProperty("linter")) + switch (message.linter) { + default: + return "linter: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + return null; + }; + + /** + * Creates a LintResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.LintResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.LintResponse} LintResponse + */ + LintResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.LintResponse) + return object; + var message = new $root.google.cloud.apihub.v1.LintResponse(); + if (object.issues) { + if (!Array.isArray(object.issues)) + throw TypeError(".google.cloud.apihub.v1.LintResponse.issues: array expected"); + message.issues = []; + for (var i = 0; i < object.issues.length; ++i) { + if (typeof object.issues[i] !== "object") + throw TypeError(".google.cloud.apihub.v1.LintResponse.issues: object expected"); + message.issues[i] = $root.google.cloud.apihub.v1.Issue.fromObject(object.issues[i]); + } + } + if (object.summary) { + if (!Array.isArray(object.summary)) + throw TypeError(".google.cloud.apihub.v1.LintResponse.summary: array expected"); + message.summary = []; + for (var i = 0; i < object.summary.length; ++i) { + if (typeof object.summary[i] !== "object") + throw TypeError(".google.cloud.apihub.v1.LintResponse.summary: object expected"); + message.summary[i] = $root.google.cloud.apihub.v1.LintResponse.SummaryEntry.fromObject(object.summary[i]); + } + } + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "LINT_STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "LINT_STATE_SUCCESS": + case 1: + message.state = 1; + break; + case "LINT_STATE_ERROR": + case 2: + message.state = 2; + break; + } + if (object.source != null) + message.source = String(object.source); + switch (object.linter) { + default: + if (typeof object.linter === "number") { + message.linter = object.linter; + break; + } + break; + case "LINTER_UNSPECIFIED": + case 0: + message.linter = 0; + break; + case "SPECTRAL": + case 1: + message.linter = 1; + break; + case "OTHER": + case 2: + message.linter = 2; + break; + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.apihub.v1.LintResponse.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + return message; + }; + + /** + * Creates a plain object from a LintResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.LintResponse + * @static + * @param {google.cloud.apihub.v1.LintResponse} message LintResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LintResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.issues = []; + object.summary = []; + } + if (options.defaults) { + object.state = options.enums === String ? "LINT_STATE_UNSPECIFIED" : 0; + object.source = ""; + object.linter = options.enums === String ? "LINTER_UNSPECIFIED" : 0; + object.createTime = null; + } + if (message.issues && message.issues.length) { + object.issues = []; + for (var j = 0; j < message.issues.length; ++j) + object.issues[j] = $root.google.cloud.apihub.v1.Issue.toObject(message.issues[j], options); + } + if (message.summary && message.summary.length) { + object.summary = []; + for (var j = 0; j < message.summary.length; ++j) + object.summary[j] = $root.google.cloud.apihub.v1.LintResponse.SummaryEntry.toObject(message.summary[j], options); + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.apihub.v1.LintState[message.state] === undefined ? message.state : $root.google.cloud.apihub.v1.LintState[message.state] : message.state; + if (message.source != null && message.hasOwnProperty("source")) + object.source = message.source; + if (message.linter != null && message.hasOwnProperty("linter")) + object.linter = options.enums === String ? $root.google.cloud.apihub.v1.Linter[message.linter] === undefined ? message.linter : $root.google.cloud.apihub.v1.Linter[message.linter] : message.linter; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + return object; + }; + + /** + * Converts this LintResponse to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.LintResponse + * @instance + * @returns {Object.} JSON object + */ + LintResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LintResponse + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.LintResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LintResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.LintResponse"; + }; + + LintResponse.SummaryEntry = (function() { + + /** + * Properties of a SummaryEntry. + * @memberof google.cloud.apihub.v1.LintResponse + * @interface ISummaryEntry + * @property {google.cloud.apihub.v1.Severity|null} [severity] SummaryEntry severity + * @property {number|null} [count] SummaryEntry count + */ + + /** + * Constructs a new SummaryEntry. + * @memberof google.cloud.apihub.v1.LintResponse + * @classdesc Represents a SummaryEntry. + * @implements ISummaryEntry + * @constructor + * @param {google.cloud.apihub.v1.LintResponse.ISummaryEntry=} [properties] Properties to set + */ + function SummaryEntry(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]]; + } + + /** + * SummaryEntry severity. + * @member {google.cloud.apihub.v1.Severity} severity + * @memberof google.cloud.apihub.v1.LintResponse.SummaryEntry + * @instance + */ + SummaryEntry.prototype.severity = 0; + + /** + * SummaryEntry count. + * @member {number} count + * @memberof google.cloud.apihub.v1.LintResponse.SummaryEntry + * @instance + */ + SummaryEntry.prototype.count = 0; + + /** + * Creates a new SummaryEntry instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.LintResponse.SummaryEntry + * @static + * @param {google.cloud.apihub.v1.LintResponse.ISummaryEntry=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.LintResponse.SummaryEntry} SummaryEntry instance + */ + SummaryEntry.create = function create(properties) { + return new SummaryEntry(properties); + }; + + /** + * Encodes the specified SummaryEntry message. Does not implicitly {@link google.cloud.apihub.v1.LintResponse.SummaryEntry.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.LintResponse.SummaryEntry + * @static + * @param {google.cloud.apihub.v1.LintResponse.ISummaryEntry} message SummaryEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SummaryEntry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.severity != null && Object.hasOwnProperty.call(message, "severity")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.severity); + if (message.count != null && Object.hasOwnProperty.call(message, "count")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.count); + return writer; + }; + + /** + * Encodes the specified SummaryEntry message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.LintResponse.SummaryEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.LintResponse.SummaryEntry + * @static + * @param {google.cloud.apihub.v1.LintResponse.ISummaryEntry} message SummaryEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SummaryEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SummaryEntry message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.LintResponse.SummaryEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.LintResponse.SummaryEntry} SummaryEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SummaryEntry.decode = function 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.apihub.v1.LintResponse.SummaryEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.severity = reader.int32(); + break; + } + case 2: { + message.count = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SummaryEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.LintResponse.SummaryEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.LintResponse.SummaryEntry} SummaryEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SummaryEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SummaryEntry message. + * @function verify + * @memberof google.cloud.apihub.v1.LintResponse.SummaryEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SummaryEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.severity != null && message.hasOwnProperty("severity")) + switch (message.severity) { + default: + return "severity: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.count != null && message.hasOwnProperty("count")) + if (!$util.isInteger(message.count)) + return "count: integer expected"; + return null; + }; + + /** + * Creates a SummaryEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.LintResponse.SummaryEntry + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.LintResponse.SummaryEntry} SummaryEntry + */ + SummaryEntry.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.LintResponse.SummaryEntry) + return object; + var message = new $root.google.cloud.apihub.v1.LintResponse.SummaryEntry(); + switch (object.severity) { + default: + if (typeof object.severity === "number") { + message.severity = object.severity; + break; + } + break; + case "SEVERITY_UNSPECIFIED": + case 0: + message.severity = 0; + break; + case "SEVERITY_ERROR": + case 1: + message.severity = 1; + break; + case "SEVERITY_WARNING": + case 2: + message.severity = 2; + break; + case "SEVERITY_INFO": + case 3: + message.severity = 3; + break; + case "SEVERITY_HINT": + case 4: + message.severity = 4; + break; + } + if (object.count != null) + message.count = object.count | 0; + return message; + }; + + /** + * Creates a plain object from a SummaryEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.LintResponse.SummaryEntry + * @static + * @param {google.cloud.apihub.v1.LintResponse.SummaryEntry} message SummaryEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SummaryEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.severity = options.enums === String ? "SEVERITY_UNSPECIFIED" : 0; + object.count = 0; + } + if (message.severity != null && message.hasOwnProperty("severity")) + object.severity = options.enums === String ? $root.google.cloud.apihub.v1.Severity[message.severity] === undefined ? message.severity : $root.google.cloud.apihub.v1.Severity[message.severity] : message.severity; + if (message.count != null && message.hasOwnProperty("count")) + object.count = message.count; + return object; + }; + + /** + * Converts this SummaryEntry to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.LintResponse.SummaryEntry + * @instance + * @returns {Object.} JSON object + */ + SummaryEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SummaryEntry + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.LintResponse.SummaryEntry + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SummaryEntry.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.LintResponse.SummaryEntry"; + }; + + return SummaryEntry; + })(); + + return LintResponse; + })(); + + v1.Issue = (function() { + + /** + * Properties of an Issue. + * @memberof google.cloud.apihub.v1 + * @interface IIssue + * @property {string|null} [code] Issue code + * @property {Array.|null} [path] Issue path + * @property {string|null} [message] Issue message + * @property {google.cloud.apihub.v1.Severity|null} [severity] Issue severity + * @property {google.cloud.apihub.v1.IRange|null} [range] Issue range + */ + + /** + * Constructs a new Issue. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents an Issue. + * @implements IIssue + * @constructor + * @param {google.cloud.apihub.v1.IIssue=} [properties] Properties to set + */ + function Issue(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]]; + } + + /** + * Issue code. + * @member {string} code + * @memberof google.cloud.apihub.v1.Issue + * @instance + */ + Issue.prototype.code = ""; + + /** + * Issue path. + * @member {Array.} path + * @memberof google.cloud.apihub.v1.Issue + * @instance + */ + Issue.prototype.path = $util.emptyArray; + + /** + * Issue message. + * @member {string} message + * @memberof google.cloud.apihub.v1.Issue + * @instance + */ + Issue.prototype.message = ""; + + /** + * Issue severity. + * @member {google.cloud.apihub.v1.Severity} severity + * @memberof google.cloud.apihub.v1.Issue + * @instance + */ + Issue.prototype.severity = 0; + + /** + * Issue range. + * @member {google.cloud.apihub.v1.IRange|null|undefined} range + * @memberof google.cloud.apihub.v1.Issue + * @instance + */ + Issue.prototype.range = null; + + /** + * Creates a new Issue instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.Issue + * @static + * @param {google.cloud.apihub.v1.IIssue=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.Issue} Issue instance + */ + Issue.create = function create(properties) { + return new Issue(properties); + }; + + /** + * Encodes the specified Issue message. Does not implicitly {@link google.cloud.apihub.v1.Issue.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.Issue + * @static + * @param {google.cloud.apihub.v1.IIssue} message Issue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Issue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.code); + if (message.path != null && message.path.length) + for (var i = 0; i < message.path.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.path[i]); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.message); + if (message.severity != null && Object.hasOwnProperty.call(message, "severity")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.severity); + if (message.range != null && Object.hasOwnProperty.call(message, "range")) + $root.google.cloud.apihub.v1.Range.encode(message.range, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Issue message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.Issue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.Issue + * @static + * @param {google.cloud.apihub.v1.IIssue} message Issue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Issue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Issue message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.Issue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.Issue} Issue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Issue.decode = function 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.apihub.v1.Issue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.code = reader.string(); + break; + } + case 2: { + if (!(message.path && message.path.length)) + message.path = []; + message.path.push(reader.string()); + break; + } + case 3: { + message.message = reader.string(); + break; + } + case 4: { + message.severity = reader.int32(); + break; + } + case 5: { + message.range = $root.google.cloud.apihub.v1.Range.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Issue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.Issue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.Issue} Issue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Issue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Issue message. + * @function verify + * @memberof google.cloud.apihub.v1.Issue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Issue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + if (!$util.isString(message.code)) + return "code: string 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.isString(message.path[i])) + return "path: string[] expected"; + } + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.severity != null && message.hasOwnProperty("severity")) + switch (message.severity) { + default: + return "severity: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.range != null && message.hasOwnProperty("range")) { + var error = $root.google.cloud.apihub.v1.Range.verify(message.range); + if (error) + return "range." + error; + } + return null; + }; + + /** + * Creates an Issue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.Issue + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.Issue} Issue + */ + Issue.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.Issue) + return object; + var message = new $root.google.cloud.apihub.v1.Issue(); + if (object.code != null) + message.code = String(object.code); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.cloud.apihub.v1.Issue.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = String(object.path[i]); + } + if (object.message != null) + message.message = String(object.message); + switch (object.severity) { + default: + if (typeof object.severity === "number") { + message.severity = object.severity; + break; + } + break; + case "SEVERITY_UNSPECIFIED": + case 0: + message.severity = 0; + break; + case "SEVERITY_ERROR": + case 1: + message.severity = 1; + break; + case "SEVERITY_WARNING": + case 2: + message.severity = 2; + break; + case "SEVERITY_INFO": + case 3: + message.severity = 3; + break; + case "SEVERITY_HINT": + case 4: + message.severity = 4; + break; + } + if (object.range != null) { + if (typeof object.range !== "object") + throw TypeError(".google.cloud.apihub.v1.Issue.range: object expected"); + message.range = $root.google.cloud.apihub.v1.Range.fromObject(object.range); + } + return message; + }; + + /** + * Creates a plain object from an Issue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.Issue + * @static + * @param {google.cloud.apihub.v1.Issue} message Issue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Issue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.path = []; + if (options.defaults) { + object.code = ""; + object.message = ""; + object.severity = options.enums === String ? "SEVERITY_UNSPECIFIED" : 0; + object.range = null; + } + if (message.code != null && message.hasOwnProperty("code")) + object.code = message.code; + 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.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.severity != null && message.hasOwnProperty("severity")) + object.severity = options.enums === String ? $root.google.cloud.apihub.v1.Severity[message.severity] === undefined ? message.severity : $root.google.cloud.apihub.v1.Severity[message.severity] : message.severity; + if (message.range != null && message.hasOwnProperty("range")) + object.range = $root.google.cloud.apihub.v1.Range.toObject(message.range, options); + return object; + }; + + /** + * Converts this Issue to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.Issue + * @instance + * @returns {Object.} JSON object + */ + Issue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Issue + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.Issue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Issue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.Issue"; + }; + + return Issue; + })(); + + v1.Range = (function() { + + /** + * Properties of a Range. + * @memberof google.cloud.apihub.v1 + * @interface IRange + * @property {google.cloud.apihub.v1.IPoint|null} [start] Range start + * @property {google.cloud.apihub.v1.IPoint|null} [end] Range end + */ + + /** + * Constructs a new Range. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a Range. + * @implements IRange + * @constructor + * @param {google.cloud.apihub.v1.IRange=} [properties] Properties to set + */ + function Range(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]]; + } + + /** + * Range start. + * @member {google.cloud.apihub.v1.IPoint|null|undefined} start + * @memberof google.cloud.apihub.v1.Range + * @instance + */ + Range.prototype.start = null; + + /** + * Range end. + * @member {google.cloud.apihub.v1.IPoint|null|undefined} end + * @memberof google.cloud.apihub.v1.Range + * @instance + */ + Range.prototype.end = null; + + /** + * Creates a new Range instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.Range + * @static + * @param {google.cloud.apihub.v1.IRange=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.Range} Range instance + */ + Range.create = function create(properties) { + return new Range(properties); + }; + + /** + * Encodes the specified Range message. Does not implicitly {@link google.cloud.apihub.v1.Range.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.Range + * @static + * @param {google.cloud.apihub.v1.IRange} message Range message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Range.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + $root.google.cloud.apihub.v1.Point.encode(message.start, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + $root.google.cloud.apihub.v1.Point.encode(message.end, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Range message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.Range.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.Range + * @static + * @param {google.cloud.apihub.v1.IRange} message Range message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Range.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Range message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.Range + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.Range} Range + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Range.decode = function 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.apihub.v1.Range(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.start = $root.google.cloud.apihub.v1.Point.decode(reader, reader.uint32()); + break; + } + case 2: { + message.end = $root.google.cloud.apihub.v1.Point.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Range message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.Range + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.Range} Range + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Range.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Range message. + * @function verify + * @memberof google.cloud.apihub.v1.Range + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Range.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) { + var error = $root.google.cloud.apihub.v1.Point.verify(message.start); + if (error) + return "start." + error; + } + if (message.end != null && message.hasOwnProperty("end")) { + var error = $root.google.cloud.apihub.v1.Point.verify(message.end); + if (error) + return "end." + error; + } + return null; + }; + + /** + * Creates a Range message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.Range + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.Range} Range + */ + Range.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.Range) + return object; + var message = new $root.google.cloud.apihub.v1.Range(); + if (object.start != null) { + if (typeof object.start !== "object") + throw TypeError(".google.cloud.apihub.v1.Range.start: object expected"); + message.start = $root.google.cloud.apihub.v1.Point.fromObject(object.start); + } + if (object.end != null) { + if (typeof object.end !== "object") + throw TypeError(".google.cloud.apihub.v1.Range.end: object expected"); + message.end = $root.google.cloud.apihub.v1.Point.fromObject(object.end); + } + return message; + }; + + /** + * Creates a plain object from a Range message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.Range + * @static + * @param {google.cloud.apihub.v1.Range} message Range + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Range.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = null; + object.end = null; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = $root.google.cloud.apihub.v1.Point.toObject(message.start, options); + if (message.end != null && message.hasOwnProperty("end")) + object.end = $root.google.cloud.apihub.v1.Point.toObject(message.end, options); + return object; + }; + + /** + * Converts this Range to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.Range + * @instance + * @returns {Object.} JSON object + */ + Range.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Range + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.Range + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Range.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.Range"; + }; + + return Range; + })(); + + v1.Point = (function() { + + /** + * Properties of a Point. + * @memberof google.cloud.apihub.v1 + * @interface IPoint + * @property {number|null} [line] Point line + * @property {number|null} [character] Point character + */ + + /** + * Constructs a new Point. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a Point. + * @implements IPoint + * @constructor + * @param {google.cloud.apihub.v1.IPoint=} [properties] Properties to set + */ + function Point(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]]; + } + + /** + * Point line. + * @member {number} line + * @memberof google.cloud.apihub.v1.Point + * @instance + */ + Point.prototype.line = 0; + + /** + * Point character. + * @member {number} character + * @memberof google.cloud.apihub.v1.Point + * @instance + */ + Point.prototype.character = 0; + + /** + * Creates a new Point instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.Point + * @static + * @param {google.cloud.apihub.v1.IPoint=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.Point} Point instance + */ + Point.create = function create(properties) { + return new Point(properties); + }; + + /** + * Encodes the specified Point message. Does not implicitly {@link google.cloud.apihub.v1.Point.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.Point + * @static + * @param {google.cloud.apihub.v1.IPoint} message Point message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Point.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.line != null && Object.hasOwnProperty.call(message, "line")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.line); + if (message.character != null && Object.hasOwnProperty.call(message, "character")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.character); + return writer; + }; + + /** + * Encodes the specified Point message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.Point.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.Point + * @static + * @param {google.cloud.apihub.v1.IPoint} message Point message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Point.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Point message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.Point + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.Point} Point + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Point.decode = function 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.apihub.v1.Point(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.line = reader.int32(); + break; + } + case 2: { + message.character = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Point message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.Point + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.Point} Point + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Point.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Point message. + * @function verify + * @memberof google.cloud.apihub.v1.Point + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Point.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.line != null && message.hasOwnProperty("line")) + if (!$util.isInteger(message.line)) + return "line: integer expected"; + if (message.character != null && message.hasOwnProperty("character")) + if (!$util.isInteger(message.character)) + return "character: integer expected"; + return null; + }; + + /** + * Creates a Point message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.Point + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.Point} Point + */ + Point.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.Point) + return object; + var message = new $root.google.cloud.apihub.v1.Point(); + if (object.line != null) + message.line = object.line | 0; + if (object.character != null) + message.character = object.character | 0; + return message; + }; + + /** + * Creates a plain object from a Point message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.Point + * @static + * @param {google.cloud.apihub.v1.Point} message Point + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Point.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.line = 0; + object.character = 0; + } + if (message.line != null && message.hasOwnProperty("line")) + object.line = message.line; + if (message.character != null && message.hasOwnProperty("character")) + object.character = message.character; + return object; + }; + + /** + * Converts this Point to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.Point + * @instance + * @returns {Object.} JSON object + */ + Point.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Point + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.Point + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Point.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.Point"; + }; + + return Point; + })(); + + v1.OperationMetadata = (function() { + + /** + * Properties of an OperationMetadata. + * @memberof google.cloud.apihub.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.apihub.v1 + * @classdesc Represents an OperationMetadata. + * @implements IOperationMetadata + * @constructor + * @param {google.cloud.apihub.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.apihub.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.createTime = null; + + /** + * OperationMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.apihub.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.endTime = null; + + /** + * OperationMetadata target. + * @member {string} target + * @memberof google.cloud.apihub.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.target = ""; + + /** + * OperationMetadata verb. + * @member {string} verb + * @memberof google.cloud.apihub.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.verb = ""; + + /** + * OperationMetadata statusMessage. + * @member {string} statusMessage + * @memberof google.cloud.apihub.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.statusMessage = ""; + + /** + * OperationMetadata requestedCancellation. + * @member {boolean} requestedCancellation + * @memberof google.cloud.apihub.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.requestedCancellation = false; + + /** + * OperationMetadata apiVersion. + * @member {string} apiVersion + * @memberof google.cloud.apihub.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.apiVersion = ""; + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.OperationMetadata + * @static + * @param {google.cloud.apihub.v1.IOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.OperationMetadata} OperationMetadata instance + */ + OperationMetadata.create = function create(properties) { + return new OperationMetadata(properties); + }; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.apihub.v1.OperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.OperationMetadata + * @static + * @param {google.cloud.apihub.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.apihub.v1.OperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.OperationMetadata + * @static + * @param {google.cloud.apihub.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.apihub.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.apihub.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.apihub.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.apihub.v1.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.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.apihub.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.apihub.v1.OperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.OperationMetadata} OperationMetadata + */ + OperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.OperationMetadata) + return object; + var message = new $root.google.cloud.apihub.v1.OperationMetadata(); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.apihub.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.apihub.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.apihub.v1.OperationMetadata + * @static + * @param {google.cloud.apihub.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.apihub.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.apihub.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.apihub.v1.OperationMetadata"; + }; + + return OperationMetadata; + })(); + + v1.ApiHubInstance = (function() { + + /** + * Properties of an ApiHubInstance. + * @memberof google.cloud.apihub.v1 + * @interface IApiHubInstance + * @property {string|null} [name] ApiHubInstance name + * @property {google.protobuf.ITimestamp|null} [createTime] ApiHubInstance createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] ApiHubInstance updateTime + * @property {google.cloud.apihub.v1.ApiHubInstance.State|null} [state] ApiHubInstance state + * @property {string|null} [stateMessage] ApiHubInstance stateMessage + * @property {google.cloud.apihub.v1.ApiHubInstance.IConfig|null} [config] ApiHubInstance config + * @property {Object.|null} [labels] ApiHubInstance labels + * @property {string|null} [description] ApiHubInstance description + */ + + /** + * Constructs a new ApiHubInstance. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents an ApiHubInstance. + * @implements IApiHubInstance + * @constructor + * @param {google.cloud.apihub.v1.IApiHubInstance=} [properties] Properties to set + */ + function ApiHubInstance(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]]; + } + + /** + * ApiHubInstance name. + * @member {string} name + * @memberof google.cloud.apihub.v1.ApiHubInstance + * @instance + */ + ApiHubInstance.prototype.name = ""; + + /** + * ApiHubInstance createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.apihub.v1.ApiHubInstance + * @instance + */ + ApiHubInstance.prototype.createTime = null; + + /** + * ApiHubInstance updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.apihub.v1.ApiHubInstance + * @instance + */ + ApiHubInstance.prototype.updateTime = null; + + /** + * ApiHubInstance state. + * @member {google.cloud.apihub.v1.ApiHubInstance.State} state + * @memberof google.cloud.apihub.v1.ApiHubInstance + * @instance + */ + ApiHubInstance.prototype.state = 0; + + /** + * ApiHubInstance stateMessage. + * @member {string} stateMessage + * @memberof google.cloud.apihub.v1.ApiHubInstance + * @instance + */ + ApiHubInstance.prototype.stateMessage = ""; + + /** + * ApiHubInstance config. + * @member {google.cloud.apihub.v1.ApiHubInstance.IConfig|null|undefined} config + * @memberof google.cloud.apihub.v1.ApiHubInstance + * @instance + */ + ApiHubInstance.prototype.config = null; + + /** + * ApiHubInstance labels. + * @member {Object.} labels + * @memberof google.cloud.apihub.v1.ApiHubInstance + * @instance + */ + ApiHubInstance.prototype.labels = $util.emptyObject; + + /** + * ApiHubInstance description. + * @member {string} description + * @memberof google.cloud.apihub.v1.ApiHubInstance + * @instance + */ + ApiHubInstance.prototype.description = ""; + + /** + * Creates a new ApiHubInstance instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.ApiHubInstance + * @static + * @param {google.cloud.apihub.v1.IApiHubInstance=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.ApiHubInstance} ApiHubInstance instance + */ + ApiHubInstance.create = function create(properties) { + return new ApiHubInstance(properties); + }; + + /** + * Encodes the specified ApiHubInstance message. Does not implicitly {@link google.cloud.apihub.v1.ApiHubInstance.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.ApiHubInstance + * @static + * @param {google.cloud.apihub.v1.IApiHubInstance} message ApiHubInstance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApiHubInstance.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.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.state); + if (message.stateMessage != null && Object.hasOwnProperty.call(message, "stateMessage")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.stateMessage); + if (message.config != null && Object.hasOwnProperty.call(message, "config")) + $root.google.cloud.apihub.v1.ApiHubInstance.Config.encode(message.config, writer.uint32(/* id 6, wireType 2 =*/50).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 7, wireType 2 =*/58).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 8, wireType 2 =*/66).string(message.description); + return writer; + }; + + /** + * Encodes the specified ApiHubInstance message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ApiHubInstance.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.ApiHubInstance + * @static + * @param {google.cloud.apihub.v1.IApiHubInstance} message ApiHubInstance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApiHubInstance.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ApiHubInstance message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.ApiHubInstance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.ApiHubInstance} ApiHubInstance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApiHubInstance.decode = function 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.apihub.v1.ApiHubInstance(), 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: { + message.state = reader.int32(); + break; + } + case 5: { + message.stateMessage = reader.string(); + break; + } + case 6: { + message.config = $root.google.cloud.apihub.v1.ApiHubInstance.Config.decode(reader, reader.uint32()); + break; + } + case 7: { + 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 8: { + message.description = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ApiHubInstance message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.ApiHubInstance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.ApiHubInstance} ApiHubInstance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApiHubInstance.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ApiHubInstance message. + * @function verify + * @memberof google.cloud.apihub.v1.ApiHubInstance + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ApiHubInstance.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.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.stateMessage != null && message.hasOwnProperty("stateMessage")) + if (!$util.isString(message.stateMessage)) + return "stateMessage: string expected"; + if (message.config != null && message.hasOwnProperty("config")) { + var error = $root.google.cloud.apihub.v1.ApiHubInstance.Config.verify(message.config); + if (error) + return "config." + 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"; + return null; + }; + + /** + * Creates an ApiHubInstance message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.ApiHubInstance + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.ApiHubInstance} ApiHubInstance + */ + ApiHubInstance.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.ApiHubInstance) + return object; + var message = new $root.google.cloud.apihub.v1.ApiHubInstance(); + if (object.name != null) + message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.apihub.v1.ApiHubInstance.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.apihub.v1.ApiHubInstance.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + 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 "CREATING": + case 2: + message.state = 2; + break; + case "ACTIVE": + case 3: + message.state = 3; + break; + case "UPDATING": + case 4: + message.state = 4; + break; + case "DELETING": + case 5: + message.state = 5; + break; + case "FAILED": + case 6: + message.state = 6; + break; + } + if (object.stateMessage != null) + message.stateMessage = String(object.stateMessage); + if (object.config != null) { + if (typeof object.config !== "object") + throw TypeError(".google.cloud.apihub.v1.ApiHubInstance.config: object expected"); + message.config = $root.google.cloud.apihub.v1.ApiHubInstance.Config.fromObject(object.config); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.apihub.v1.ApiHubInstance.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); + return message; + }; + + /** + * Creates a plain object from an ApiHubInstance message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.ApiHubInstance + * @static + * @param {google.cloud.apihub.v1.ApiHubInstance} message ApiHubInstance + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ApiHubInstance.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.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.stateMessage = ""; + object.config = null; + object.description = ""; + } + 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); + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.apihub.v1.ApiHubInstance.State[message.state] === undefined ? message.state : $root.google.cloud.apihub.v1.ApiHubInstance.State[message.state] : message.state; + if (message.stateMessage != null && message.hasOwnProperty("stateMessage")) + object.stateMessage = message.stateMessage; + if (message.config != null && message.hasOwnProperty("config")) + object.config = $root.google.cloud.apihub.v1.ApiHubInstance.Config.toObject(message.config, 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; + return object; + }; + + /** + * Converts this ApiHubInstance to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.ApiHubInstance + * @instance + * @returns {Object.} JSON object + */ + ApiHubInstance.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ApiHubInstance + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.ApiHubInstance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ApiHubInstance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.ApiHubInstance"; + }; + + ApiHubInstance.Config = (function() { + + /** + * Properties of a Config. + * @memberof google.cloud.apihub.v1.ApiHubInstance + * @interface IConfig + * @property {string|null} [cmekKeyName] Config cmekKeyName + */ + + /** + * Constructs a new Config. + * @memberof google.cloud.apihub.v1.ApiHubInstance + * @classdesc Represents a Config. + * @implements IConfig + * @constructor + * @param {google.cloud.apihub.v1.ApiHubInstance.IConfig=} [properties] Properties to set + */ + function Config(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]]; + } + + /** + * Config cmekKeyName. + * @member {string} cmekKeyName + * @memberof google.cloud.apihub.v1.ApiHubInstance.Config + * @instance + */ + Config.prototype.cmekKeyName = ""; + + /** + * Creates a new Config instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.ApiHubInstance.Config + * @static + * @param {google.cloud.apihub.v1.ApiHubInstance.IConfig=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.ApiHubInstance.Config} Config instance + */ + Config.create = function create(properties) { + return new Config(properties); + }; + + /** + * Encodes the specified Config message. Does not implicitly {@link google.cloud.apihub.v1.ApiHubInstance.Config.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.ApiHubInstance.Config + * @static + * @param {google.cloud.apihub.v1.ApiHubInstance.IConfig} message Config message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Config.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cmekKeyName != null && Object.hasOwnProperty.call(message, "cmekKeyName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.cmekKeyName); + return writer; + }; + + /** + * Encodes the specified Config message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ApiHubInstance.Config.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.ApiHubInstance.Config + * @static + * @param {google.cloud.apihub.v1.ApiHubInstance.IConfig} message Config message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Config.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Config message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.ApiHubInstance.Config + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.ApiHubInstance.Config} Config + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Config.decode = function 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.apihub.v1.ApiHubInstance.Config(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.cmekKeyName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Config message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.ApiHubInstance.Config + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.ApiHubInstance.Config} Config + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Config.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Config message. + * @function verify + * @memberof google.cloud.apihub.v1.ApiHubInstance.Config + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Config.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cmekKeyName != null && message.hasOwnProperty("cmekKeyName")) + if (!$util.isString(message.cmekKeyName)) + return "cmekKeyName: string expected"; + return null; + }; + + /** + * Creates a Config message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.ApiHubInstance.Config + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.ApiHubInstance.Config} Config + */ + Config.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.ApiHubInstance.Config) + return object; + var message = new $root.google.cloud.apihub.v1.ApiHubInstance.Config(); + if (object.cmekKeyName != null) + message.cmekKeyName = String(object.cmekKeyName); + return message; + }; + + /** + * Creates a plain object from a Config message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.ApiHubInstance.Config + * @static + * @param {google.cloud.apihub.v1.ApiHubInstance.Config} message Config + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Config.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.cmekKeyName = ""; + if (message.cmekKeyName != null && message.hasOwnProperty("cmekKeyName")) + object.cmekKeyName = message.cmekKeyName; + return object; + }; + + /** + * Converts this Config to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.ApiHubInstance.Config + * @instance + * @returns {Object.} JSON object + */ + Config.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Config + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.ApiHubInstance.Config + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Config.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.ApiHubInstance.Config"; + }; + + return Config; + })(); + + /** + * State enum. + * @name google.cloud.apihub.v1.ApiHubInstance.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} INACTIVE=1 INACTIVE value + * @property {number} CREATING=2 CREATING value + * @property {number} ACTIVE=3 ACTIVE value + * @property {number} UPDATING=4 UPDATING value + * @property {number} DELETING=5 DELETING value + * @property {number} FAILED=6 FAILED value + */ + ApiHubInstance.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "INACTIVE"] = 1; + values[valuesById[2] = "CREATING"] = 2; + values[valuesById[3] = "ACTIVE"] = 3; + values[valuesById[4] = "UPDATING"] = 4; + values[valuesById[5] = "DELETING"] = 5; + values[valuesById[6] = "FAILED"] = 6; + return values; + })(); + + return ApiHubInstance; + })(); + + v1.ExternalApi = (function() { + + /** + * Properties of an ExternalApi. + * @memberof google.cloud.apihub.v1 + * @interface IExternalApi + * @property {string|null} [name] ExternalApi name + * @property {string|null} [displayName] ExternalApi displayName + * @property {string|null} [description] ExternalApi description + * @property {Array.|null} [endpoints] ExternalApi endpoints + * @property {Array.|null} [paths] ExternalApi paths + * @property {google.cloud.apihub.v1.IDocumentation|null} [documentation] ExternalApi documentation + * @property {Object.|null} [attributes] ExternalApi attributes + * @property {google.protobuf.ITimestamp|null} [createTime] ExternalApi createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] ExternalApi updateTime + */ + + /** + * Constructs a new ExternalApi. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents an ExternalApi. + * @implements IExternalApi + * @constructor + * @param {google.cloud.apihub.v1.IExternalApi=} [properties] Properties to set + */ + function ExternalApi(properties) { + this.endpoints = []; + this.paths = []; + this.attributes = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExternalApi name. + * @member {string} name + * @memberof google.cloud.apihub.v1.ExternalApi + * @instance + */ + ExternalApi.prototype.name = ""; + + /** + * ExternalApi displayName. + * @member {string} displayName + * @memberof google.cloud.apihub.v1.ExternalApi + * @instance + */ + ExternalApi.prototype.displayName = ""; + + /** + * ExternalApi description. + * @member {string} description + * @memberof google.cloud.apihub.v1.ExternalApi + * @instance + */ + ExternalApi.prototype.description = ""; + + /** + * ExternalApi endpoints. + * @member {Array.} endpoints + * @memberof google.cloud.apihub.v1.ExternalApi + * @instance + */ + ExternalApi.prototype.endpoints = $util.emptyArray; + + /** + * ExternalApi paths. + * @member {Array.} paths + * @memberof google.cloud.apihub.v1.ExternalApi + * @instance + */ + ExternalApi.prototype.paths = $util.emptyArray; + + /** + * ExternalApi documentation. + * @member {google.cloud.apihub.v1.IDocumentation|null|undefined} documentation + * @memberof google.cloud.apihub.v1.ExternalApi + * @instance + */ + ExternalApi.prototype.documentation = null; + + /** + * ExternalApi attributes. + * @member {Object.} attributes + * @memberof google.cloud.apihub.v1.ExternalApi + * @instance + */ + ExternalApi.prototype.attributes = $util.emptyObject; + + /** + * ExternalApi createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.apihub.v1.ExternalApi + * @instance + */ + ExternalApi.prototype.createTime = null; + + /** + * ExternalApi updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.apihub.v1.ExternalApi + * @instance + */ + ExternalApi.prototype.updateTime = null; + + /** + * Creates a new ExternalApi instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.ExternalApi + * @static + * @param {google.cloud.apihub.v1.IExternalApi=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.ExternalApi} ExternalApi instance + */ + ExternalApi.create = function create(properties) { + return new ExternalApi(properties); + }; + + /** + * Encodes the specified ExternalApi message. Does not implicitly {@link google.cloud.apihub.v1.ExternalApi.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.ExternalApi + * @static + * @param {google.cloud.apihub.v1.IExternalApi} message ExternalApi message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExternalApi.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.endpoints != null && message.endpoints.length) + for (var i = 0; i < message.endpoints.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.endpoints[i]); + if (message.paths != null && message.paths.length) + for (var i = 0; i < message.paths.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.paths[i]); + if (message.documentation != null && Object.hasOwnProperty.call(message, "documentation")) + $root.google.cloud.apihub.v1.Documentation.encode(message.documentation, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.attributes != null && Object.hasOwnProperty.call(message, "attributes")) + for (var keys = Object.keys(message.attributes), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.apihub.v1.AttributeValues.encode(message.attributes[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExternalApi message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ExternalApi.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.ExternalApi + * @static + * @param {google.cloud.apihub.v1.IExternalApi} message ExternalApi message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExternalApi.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExternalApi message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.ExternalApi + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.ExternalApi} ExternalApi + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExternalApi.decode = function 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.apihub.v1.ExternalApi(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + if (!(message.endpoints && message.endpoints.length)) + message.endpoints = []; + message.endpoints.push(reader.string()); + break; + } + case 5: { + if (!(message.paths && message.paths.length)) + message.paths = []; + message.paths.push(reader.string()); + break; + } + case 6: { + message.documentation = $root.google.cloud.apihub.v1.Documentation.decode(reader, reader.uint32()); + break; + } + case 7: { + if (message.attributes === $util.emptyObject) + message.attributes = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.apihub.v1.AttributeValues.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.attributes[key] = value; + break; + } + case 8: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 9: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExternalApi message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.ExternalApi + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.ExternalApi} ExternalApi + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExternalApi.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExternalApi message. + * @function verify + * @memberof google.cloud.apihub.v1.ExternalApi + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExternalApi.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.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.endpoints != null && message.hasOwnProperty("endpoints")) { + if (!Array.isArray(message.endpoints)) + return "endpoints: array expected"; + for (var i = 0; i < message.endpoints.length; ++i) + if (!$util.isString(message.endpoints[i])) + return "endpoints: string[] 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"; + } + if (message.documentation != null && message.hasOwnProperty("documentation")) { + var error = $root.google.cloud.apihub.v1.Documentation.verify(message.documentation); + if (error) + return "documentation." + error; + } + if (message.attributes != null && message.hasOwnProperty("attributes")) { + if (!$util.isObject(message.attributes)) + return "attributes: object expected"; + var key = Object.keys(message.attributes); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.apihub.v1.AttributeValues.verify(message.attributes[key[i]]); + if (error) + return "attributes." + error; + } + } + 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; + } + return null; + }; + + /** + * Creates an ExternalApi message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.ExternalApi + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.ExternalApi} ExternalApi + */ + ExternalApi.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.ExternalApi) + return object; + var message = new $root.google.cloud.apihub.v1.ExternalApi(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.endpoints) { + if (!Array.isArray(object.endpoints)) + throw TypeError(".google.cloud.apihub.v1.ExternalApi.endpoints: array expected"); + message.endpoints = []; + for (var i = 0; i < object.endpoints.length; ++i) + message.endpoints[i] = String(object.endpoints[i]); + } + if (object.paths) { + if (!Array.isArray(object.paths)) + throw TypeError(".google.cloud.apihub.v1.ExternalApi.paths: array expected"); + message.paths = []; + for (var i = 0; i < object.paths.length; ++i) + message.paths[i] = String(object.paths[i]); + } + if (object.documentation != null) { + if (typeof object.documentation !== "object") + throw TypeError(".google.cloud.apihub.v1.ExternalApi.documentation: object expected"); + message.documentation = $root.google.cloud.apihub.v1.Documentation.fromObject(object.documentation); + } + if (object.attributes) { + if (typeof object.attributes !== "object") + throw TypeError(".google.cloud.apihub.v1.ExternalApi.attributes: object expected"); + message.attributes = {}; + for (var keys = Object.keys(object.attributes), i = 0; i < keys.length; ++i) { + if (typeof object.attributes[keys[i]] !== "object") + throw TypeError(".google.cloud.apihub.v1.ExternalApi.attributes: object expected"); + message.attributes[keys[i]] = $root.google.cloud.apihub.v1.AttributeValues.fromObject(object.attributes[keys[i]]); + } + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.apihub.v1.ExternalApi.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.apihub.v1.ExternalApi.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + return message; + }; + + /** + * Creates a plain object from an ExternalApi message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.ExternalApi + * @static + * @param {google.cloud.apihub.v1.ExternalApi} message ExternalApi + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExternalApi.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.endpoints = []; + object.paths = []; + } + if (options.objects || options.defaults) + object.attributes = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.description = ""; + object.documentation = null; + object.createTime = null; + object.updateTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.endpoints && message.endpoints.length) { + object.endpoints = []; + for (var j = 0; j < message.endpoints.length; ++j) + object.endpoints[j] = message.endpoints[j]; + } + if (message.paths && message.paths.length) { + object.paths = []; + for (var j = 0; j < message.paths.length; ++j) + object.paths[j] = message.paths[j]; + } + if (message.documentation != null && message.hasOwnProperty("documentation")) + object.documentation = $root.google.cloud.apihub.v1.Documentation.toObject(message.documentation, options); + var keys2; + if (message.attributes && (keys2 = Object.keys(message.attributes)).length) { + object.attributes = {}; + for (var j = 0; j < keys2.length; ++j) + object.attributes[keys2[j]] = $root.google.cloud.apihub.v1.AttributeValues.toObject(message.attributes[keys2[j]], options); + } + 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); + return object; + }; + + /** + * Converts this ExternalApi to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.ExternalApi + * @instance + * @returns {Object.} JSON object + */ + ExternalApi.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExternalApi + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.ExternalApi + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExternalApi.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.ExternalApi"; + }; + + return ExternalApi; + })(); + + v1.HostProjectRegistrationService = (function() { + + /** + * Constructs a new HostProjectRegistrationService service. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a HostProjectRegistrationService + * @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 HostProjectRegistrationService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (HostProjectRegistrationService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = HostProjectRegistrationService; + + /** + * Creates new HostProjectRegistrationService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.apihub.v1.HostProjectRegistrationService + * @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 {HostProjectRegistrationService} RPC service. Useful where requests and/or responses are streamed. + */ + HostProjectRegistrationService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.apihub.v1.HostProjectRegistrationService|createHostProjectRegistration}. + * @memberof google.cloud.apihub.v1.HostProjectRegistrationService + * @typedef CreateHostProjectRegistrationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apihub.v1.HostProjectRegistration} [response] HostProjectRegistration + */ + + /** + * Calls CreateHostProjectRegistration. + * @function createHostProjectRegistration + * @memberof google.cloud.apihub.v1.HostProjectRegistrationService + * @instance + * @param {google.cloud.apihub.v1.ICreateHostProjectRegistrationRequest} request CreateHostProjectRegistrationRequest message or plain object + * @param {google.cloud.apihub.v1.HostProjectRegistrationService.CreateHostProjectRegistrationCallback} callback Node-style callback called with the error, if any, and HostProjectRegistration + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(HostProjectRegistrationService.prototype.createHostProjectRegistration = function createHostProjectRegistration(request, callback) { + return this.rpcCall(createHostProjectRegistration, $root.google.cloud.apihub.v1.CreateHostProjectRegistrationRequest, $root.google.cloud.apihub.v1.HostProjectRegistration, request, callback); + }, "name", { value: "CreateHostProjectRegistration" }); + + /** + * Calls CreateHostProjectRegistration. + * @function createHostProjectRegistration + * @memberof google.cloud.apihub.v1.HostProjectRegistrationService + * @instance + * @param {google.cloud.apihub.v1.ICreateHostProjectRegistrationRequest} request CreateHostProjectRegistrationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.HostProjectRegistrationService|getHostProjectRegistration}. + * @memberof google.cloud.apihub.v1.HostProjectRegistrationService + * @typedef GetHostProjectRegistrationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apihub.v1.HostProjectRegistration} [response] HostProjectRegistration + */ + + /** + * Calls GetHostProjectRegistration. + * @function getHostProjectRegistration + * @memberof google.cloud.apihub.v1.HostProjectRegistrationService + * @instance + * @param {google.cloud.apihub.v1.IGetHostProjectRegistrationRequest} request GetHostProjectRegistrationRequest message or plain object + * @param {google.cloud.apihub.v1.HostProjectRegistrationService.GetHostProjectRegistrationCallback} callback Node-style callback called with the error, if any, and HostProjectRegistration + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(HostProjectRegistrationService.prototype.getHostProjectRegistration = function getHostProjectRegistration(request, callback) { + return this.rpcCall(getHostProjectRegistration, $root.google.cloud.apihub.v1.GetHostProjectRegistrationRequest, $root.google.cloud.apihub.v1.HostProjectRegistration, request, callback); + }, "name", { value: "GetHostProjectRegistration" }); + + /** + * Calls GetHostProjectRegistration. + * @function getHostProjectRegistration + * @memberof google.cloud.apihub.v1.HostProjectRegistrationService + * @instance + * @param {google.cloud.apihub.v1.IGetHostProjectRegistrationRequest} request GetHostProjectRegistrationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.HostProjectRegistrationService|listHostProjectRegistrations}. + * @memberof google.cloud.apihub.v1.HostProjectRegistrationService + * @typedef ListHostProjectRegistrationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apihub.v1.ListHostProjectRegistrationsResponse} [response] ListHostProjectRegistrationsResponse + */ + + /** + * Calls ListHostProjectRegistrations. + * @function listHostProjectRegistrations + * @memberof google.cloud.apihub.v1.HostProjectRegistrationService + * @instance + * @param {google.cloud.apihub.v1.IListHostProjectRegistrationsRequest} request ListHostProjectRegistrationsRequest message or plain object + * @param {google.cloud.apihub.v1.HostProjectRegistrationService.ListHostProjectRegistrationsCallback} callback Node-style callback called with the error, if any, and ListHostProjectRegistrationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(HostProjectRegistrationService.prototype.listHostProjectRegistrations = function listHostProjectRegistrations(request, callback) { + return this.rpcCall(listHostProjectRegistrations, $root.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest, $root.google.cloud.apihub.v1.ListHostProjectRegistrationsResponse, request, callback); + }, "name", { value: "ListHostProjectRegistrations" }); + + /** + * Calls ListHostProjectRegistrations. + * @function listHostProjectRegistrations + * @memberof google.cloud.apihub.v1.HostProjectRegistrationService + * @instance + * @param {google.cloud.apihub.v1.IListHostProjectRegistrationsRequest} request ListHostProjectRegistrationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return HostProjectRegistrationService; + })(); + + v1.CreateHostProjectRegistrationRequest = (function() { + + /** + * Properties of a CreateHostProjectRegistrationRequest. + * @memberof google.cloud.apihub.v1 + * @interface ICreateHostProjectRegistrationRequest + * @property {string|null} [parent] CreateHostProjectRegistrationRequest parent + * @property {string|null} [hostProjectRegistrationId] CreateHostProjectRegistrationRequest hostProjectRegistrationId + * @property {google.cloud.apihub.v1.IHostProjectRegistration|null} [hostProjectRegistration] CreateHostProjectRegistrationRequest hostProjectRegistration + */ + + /** + * Constructs a new CreateHostProjectRegistrationRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a CreateHostProjectRegistrationRequest. + * @implements ICreateHostProjectRegistrationRequest + * @constructor + * @param {google.cloud.apihub.v1.ICreateHostProjectRegistrationRequest=} [properties] Properties to set + */ + function CreateHostProjectRegistrationRequest(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]]; + } + + /** + * CreateHostProjectRegistrationRequest parent. + * @member {string} parent + * @memberof google.cloud.apihub.v1.CreateHostProjectRegistrationRequest + * @instance + */ + CreateHostProjectRegistrationRequest.prototype.parent = ""; + + /** + * CreateHostProjectRegistrationRequest hostProjectRegistrationId. + * @member {string} hostProjectRegistrationId + * @memberof google.cloud.apihub.v1.CreateHostProjectRegistrationRequest + * @instance + */ + CreateHostProjectRegistrationRequest.prototype.hostProjectRegistrationId = ""; + + /** + * CreateHostProjectRegistrationRequest hostProjectRegistration. + * @member {google.cloud.apihub.v1.IHostProjectRegistration|null|undefined} hostProjectRegistration + * @memberof google.cloud.apihub.v1.CreateHostProjectRegistrationRequest + * @instance + */ + CreateHostProjectRegistrationRequest.prototype.hostProjectRegistration = null; + + /** + * Creates a new CreateHostProjectRegistrationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.CreateHostProjectRegistrationRequest + * @static + * @param {google.cloud.apihub.v1.ICreateHostProjectRegistrationRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.CreateHostProjectRegistrationRequest} CreateHostProjectRegistrationRequest instance + */ + CreateHostProjectRegistrationRequest.create = function create(properties) { + return new CreateHostProjectRegistrationRequest(properties); + }; + + /** + * Encodes the specified CreateHostProjectRegistrationRequest message. Does not implicitly {@link google.cloud.apihub.v1.CreateHostProjectRegistrationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.CreateHostProjectRegistrationRequest + * @static + * @param {google.cloud.apihub.v1.ICreateHostProjectRegistrationRequest} message CreateHostProjectRegistrationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateHostProjectRegistrationRequest.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.hostProjectRegistrationId != null && Object.hasOwnProperty.call(message, "hostProjectRegistrationId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.hostProjectRegistrationId); + if (message.hostProjectRegistration != null && Object.hasOwnProperty.call(message, "hostProjectRegistration")) + $root.google.cloud.apihub.v1.HostProjectRegistration.encode(message.hostProjectRegistration, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateHostProjectRegistrationRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.CreateHostProjectRegistrationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.CreateHostProjectRegistrationRequest + * @static + * @param {google.cloud.apihub.v1.ICreateHostProjectRegistrationRequest} message CreateHostProjectRegistrationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateHostProjectRegistrationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateHostProjectRegistrationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.CreateHostProjectRegistrationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.CreateHostProjectRegistrationRequest} CreateHostProjectRegistrationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateHostProjectRegistrationRequest.decode = function 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.apihub.v1.CreateHostProjectRegistrationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.hostProjectRegistrationId = reader.string(); + break; + } + case 3: { + message.hostProjectRegistration = $root.google.cloud.apihub.v1.HostProjectRegistration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateHostProjectRegistrationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.CreateHostProjectRegistrationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.CreateHostProjectRegistrationRequest} CreateHostProjectRegistrationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateHostProjectRegistrationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateHostProjectRegistrationRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.CreateHostProjectRegistrationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateHostProjectRegistrationRequest.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.hostProjectRegistrationId != null && message.hasOwnProperty("hostProjectRegistrationId")) + if (!$util.isString(message.hostProjectRegistrationId)) + return "hostProjectRegistrationId: string expected"; + if (message.hostProjectRegistration != null && message.hasOwnProperty("hostProjectRegistration")) { + var error = $root.google.cloud.apihub.v1.HostProjectRegistration.verify(message.hostProjectRegistration); + if (error) + return "hostProjectRegistration." + error; + } + return null; + }; + + /** + * Creates a CreateHostProjectRegistrationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.CreateHostProjectRegistrationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.CreateHostProjectRegistrationRequest} CreateHostProjectRegistrationRequest + */ + CreateHostProjectRegistrationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.CreateHostProjectRegistrationRequest) + return object; + var message = new $root.google.cloud.apihub.v1.CreateHostProjectRegistrationRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.hostProjectRegistrationId != null) + message.hostProjectRegistrationId = String(object.hostProjectRegistrationId); + if (object.hostProjectRegistration != null) { + if (typeof object.hostProjectRegistration !== "object") + throw TypeError(".google.cloud.apihub.v1.CreateHostProjectRegistrationRequest.hostProjectRegistration: object expected"); + message.hostProjectRegistration = $root.google.cloud.apihub.v1.HostProjectRegistration.fromObject(object.hostProjectRegistration); + } + return message; + }; + + /** + * Creates a plain object from a CreateHostProjectRegistrationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.CreateHostProjectRegistrationRequest + * @static + * @param {google.cloud.apihub.v1.CreateHostProjectRegistrationRequest} message CreateHostProjectRegistrationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateHostProjectRegistrationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.hostProjectRegistrationId = ""; + object.hostProjectRegistration = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.hostProjectRegistrationId != null && message.hasOwnProperty("hostProjectRegistrationId")) + object.hostProjectRegistrationId = message.hostProjectRegistrationId; + if (message.hostProjectRegistration != null && message.hasOwnProperty("hostProjectRegistration")) + object.hostProjectRegistration = $root.google.cloud.apihub.v1.HostProjectRegistration.toObject(message.hostProjectRegistration, options); + return object; + }; + + /** + * Converts this CreateHostProjectRegistrationRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.CreateHostProjectRegistrationRequest + * @instance + * @returns {Object.} JSON object + */ + CreateHostProjectRegistrationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateHostProjectRegistrationRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.CreateHostProjectRegistrationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateHostProjectRegistrationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.CreateHostProjectRegistrationRequest"; + }; + + return CreateHostProjectRegistrationRequest; + })(); + + v1.GetHostProjectRegistrationRequest = (function() { + + /** + * Properties of a GetHostProjectRegistrationRequest. + * @memberof google.cloud.apihub.v1 + * @interface IGetHostProjectRegistrationRequest + * @property {string|null} [name] GetHostProjectRegistrationRequest name + */ + + /** + * Constructs a new GetHostProjectRegistrationRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a GetHostProjectRegistrationRequest. + * @implements IGetHostProjectRegistrationRequest + * @constructor + * @param {google.cloud.apihub.v1.IGetHostProjectRegistrationRequest=} [properties] Properties to set + */ + function GetHostProjectRegistrationRequest(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]]; + } + + /** + * GetHostProjectRegistrationRequest name. + * @member {string} name + * @memberof google.cloud.apihub.v1.GetHostProjectRegistrationRequest + * @instance + */ + GetHostProjectRegistrationRequest.prototype.name = ""; + + /** + * Creates a new GetHostProjectRegistrationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.GetHostProjectRegistrationRequest + * @static + * @param {google.cloud.apihub.v1.IGetHostProjectRegistrationRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.GetHostProjectRegistrationRequest} GetHostProjectRegistrationRequest instance + */ + GetHostProjectRegistrationRequest.create = function create(properties) { + return new GetHostProjectRegistrationRequest(properties); + }; + + /** + * Encodes the specified GetHostProjectRegistrationRequest message. Does not implicitly {@link google.cloud.apihub.v1.GetHostProjectRegistrationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.GetHostProjectRegistrationRequest + * @static + * @param {google.cloud.apihub.v1.IGetHostProjectRegistrationRequest} message GetHostProjectRegistrationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetHostProjectRegistrationRequest.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 GetHostProjectRegistrationRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.GetHostProjectRegistrationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.GetHostProjectRegistrationRequest + * @static + * @param {google.cloud.apihub.v1.IGetHostProjectRegistrationRequest} message GetHostProjectRegistrationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetHostProjectRegistrationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetHostProjectRegistrationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.GetHostProjectRegistrationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.GetHostProjectRegistrationRequest} GetHostProjectRegistrationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetHostProjectRegistrationRequest.decode = function 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.apihub.v1.GetHostProjectRegistrationRequest(); + 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 GetHostProjectRegistrationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.GetHostProjectRegistrationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.GetHostProjectRegistrationRequest} GetHostProjectRegistrationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetHostProjectRegistrationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetHostProjectRegistrationRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.GetHostProjectRegistrationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetHostProjectRegistrationRequest.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 GetHostProjectRegistrationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.GetHostProjectRegistrationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.GetHostProjectRegistrationRequest} GetHostProjectRegistrationRequest + */ + GetHostProjectRegistrationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.GetHostProjectRegistrationRequest) + return object; + var message = new $root.google.cloud.apihub.v1.GetHostProjectRegistrationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetHostProjectRegistrationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.GetHostProjectRegistrationRequest + * @static + * @param {google.cloud.apihub.v1.GetHostProjectRegistrationRequest} message GetHostProjectRegistrationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetHostProjectRegistrationRequest.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 GetHostProjectRegistrationRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.GetHostProjectRegistrationRequest + * @instance + * @returns {Object.} JSON object + */ + GetHostProjectRegistrationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetHostProjectRegistrationRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.GetHostProjectRegistrationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetHostProjectRegistrationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.GetHostProjectRegistrationRequest"; + }; + + return GetHostProjectRegistrationRequest; + })(); + + v1.ListHostProjectRegistrationsRequest = (function() { + + /** + * Properties of a ListHostProjectRegistrationsRequest. + * @memberof google.cloud.apihub.v1 + * @interface IListHostProjectRegistrationsRequest + * @property {string|null} [parent] ListHostProjectRegistrationsRequest parent + * @property {number|null} [pageSize] ListHostProjectRegistrationsRequest pageSize + * @property {string|null} [pageToken] ListHostProjectRegistrationsRequest pageToken + * @property {string|null} [filter] ListHostProjectRegistrationsRequest filter + * @property {string|null} [orderBy] ListHostProjectRegistrationsRequest orderBy + */ + + /** + * Constructs a new ListHostProjectRegistrationsRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a ListHostProjectRegistrationsRequest. + * @implements IListHostProjectRegistrationsRequest + * @constructor + * @param {google.cloud.apihub.v1.IListHostProjectRegistrationsRequest=} [properties] Properties to set + */ + function ListHostProjectRegistrationsRequest(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]]; + } + + /** + * ListHostProjectRegistrationsRequest parent. + * @member {string} parent + * @memberof google.cloud.apihub.v1.ListHostProjectRegistrationsRequest + * @instance + */ + ListHostProjectRegistrationsRequest.prototype.parent = ""; + + /** + * ListHostProjectRegistrationsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.apihub.v1.ListHostProjectRegistrationsRequest + * @instance + */ + ListHostProjectRegistrationsRequest.prototype.pageSize = 0; + + /** + * ListHostProjectRegistrationsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.apihub.v1.ListHostProjectRegistrationsRequest + * @instance + */ + ListHostProjectRegistrationsRequest.prototype.pageToken = ""; + + /** + * ListHostProjectRegistrationsRequest filter. + * @member {string} filter + * @memberof google.cloud.apihub.v1.ListHostProjectRegistrationsRequest + * @instance + */ + ListHostProjectRegistrationsRequest.prototype.filter = ""; + + /** + * ListHostProjectRegistrationsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.apihub.v1.ListHostProjectRegistrationsRequest + * @instance + */ + ListHostProjectRegistrationsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListHostProjectRegistrationsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.ListHostProjectRegistrationsRequest + * @static + * @param {google.cloud.apihub.v1.IListHostProjectRegistrationsRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.ListHostProjectRegistrationsRequest} ListHostProjectRegistrationsRequest instance + */ + ListHostProjectRegistrationsRequest.create = function create(properties) { + return new ListHostProjectRegistrationsRequest(properties); + }; + + /** + * Encodes the specified ListHostProjectRegistrationsRequest message. Does not implicitly {@link google.cloud.apihub.v1.ListHostProjectRegistrationsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.ListHostProjectRegistrationsRequest + * @static + * @param {google.cloud.apihub.v1.IListHostProjectRegistrationsRequest} message ListHostProjectRegistrationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListHostProjectRegistrationsRequest.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); + return writer; + }; + + /** + * Encodes the specified ListHostProjectRegistrationsRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListHostProjectRegistrationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.ListHostProjectRegistrationsRequest + * @static + * @param {google.cloud.apihub.v1.IListHostProjectRegistrationsRequest} message ListHostProjectRegistrationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListHostProjectRegistrationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListHostProjectRegistrationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.ListHostProjectRegistrationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.ListHostProjectRegistrationsRequest} ListHostProjectRegistrationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListHostProjectRegistrationsRequest.decode = function 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.apihub.v1.ListHostProjectRegistrationsRequest(); + 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; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListHostProjectRegistrationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.ListHostProjectRegistrationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.ListHostProjectRegistrationsRequest} ListHostProjectRegistrationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListHostProjectRegistrationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListHostProjectRegistrationsRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.ListHostProjectRegistrationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListHostProjectRegistrationsRequest.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"; + return null; + }; + + /** + * Creates a ListHostProjectRegistrationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.ListHostProjectRegistrationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.ListHostProjectRegistrationsRequest} ListHostProjectRegistrationsRequest + */ + ListHostProjectRegistrationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest) + return object; + var message = new $root.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest(); + 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); + return message; + }; + + /** + * Creates a plain object from a ListHostProjectRegistrationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.ListHostProjectRegistrationsRequest + * @static + * @param {google.cloud.apihub.v1.ListHostProjectRegistrationsRequest} message ListHostProjectRegistrationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListHostProjectRegistrationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + 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; + return object; + }; + + /** + * Converts this ListHostProjectRegistrationsRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.ListHostProjectRegistrationsRequest + * @instance + * @returns {Object.} JSON object + */ + ListHostProjectRegistrationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListHostProjectRegistrationsRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.ListHostProjectRegistrationsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListHostProjectRegistrationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.ListHostProjectRegistrationsRequest"; + }; + + return ListHostProjectRegistrationsRequest; + })(); + + v1.ListHostProjectRegistrationsResponse = (function() { + + /** + * Properties of a ListHostProjectRegistrationsResponse. + * @memberof google.cloud.apihub.v1 + * @interface IListHostProjectRegistrationsResponse + * @property {Array.|null} [hostProjectRegistrations] ListHostProjectRegistrationsResponse hostProjectRegistrations + * @property {string|null} [nextPageToken] ListHostProjectRegistrationsResponse nextPageToken + */ + + /** + * Constructs a new ListHostProjectRegistrationsResponse. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a ListHostProjectRegistrationsResponse. + * @implements IListHostProjectRegistrationsResponse + * @constructor + * @param {google.cloud.apihub.v1.IListHostProjectRegistrationsResponse=} [properties] Properties to set + */ + function ListHostProjectRegistrationsResponse(properties) { + this.hostProjectRegistrations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListHostProjectRegistrationsResponse hostProjectRegistrations. + * @member {Array.} hostProjectRegistrations + * @memberof google.cloud.apihub.v1.ListHostProjectRegistrationsResponse + * @instance + */ + ListHostProjectRegistrationsResponse.prototype.hostProjectRegistrations = $util.emptyArray; + + /** + * ListHostProjectRegistrationsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.apihub.v1.ListHostProjectRegistrationsResponse + * @instance + */ + ListHostProjectRegistrationsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListHostProjectRegistrationsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.ListHostProjectRegistrationsResponse + * @static + * @param {google.cloud.apihub.v1.IListHostProjectRegistrationsResponse=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.ListHostProjectRegistrationsResponse} ListHostProjectRegistrationsResponse instance + */ + ListHostProjectRegistrationsResponse.create = function create(properties) { + return new ListHostProjectRegistrationsResponse(properties); + }; + + /** + * Encodes the specified ListHostProjectRegistrationsResponse message. Does not implicitly {@link google.cloud.apihub.v1.ListHostProjectRegistrationsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.ListHostProjectRegistrationsResponse + * @static + * @param {google.cloud.apihub.v1.IListHostProjectRegistrationsResponse} message ListHostProjectRegistrationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListHostProjectRegistrationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.hostProjectRegistrations != null && message.hostProjectRegistrations.length) + for (var i = 0; i < message.hostProjectRegistrations.length; ++i) + $root.google.cloud.apihub.v1.HostProjectRegistration.encode(message.hostProjectRegistrations[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 ListHostProjectRegistrationsResponse message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListHostProjectRegistrationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.ListHostProjectRegistrationsResponse + * @static + * @param {google.cloud.apihub.v1.IListHostProjectRegistrationsResponse} message ListHostProjectRegistrationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListHostProjectRegistrationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListHostProjectRegistrationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.ListHostProjectRegistrationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.ListHostProjectRegistrationsResponse} ListHostProjectRegistrationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListHostProjectRegistrationsResponse.decode = function 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.apihub.v1.ListHostProjectRegistrationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.hostProjectRegistrations && message.hostProjectRegistrations.length)) + message.hostProjectRegistrations = []; + message.hostProjectRegistrations.push($root.google.cloud.apihub.v1.HostProjectRegistration.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListHostProjectRegistrationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.ListHostProjectRegistrationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.ListHostProjectRegistrationsResponse} ListHostProjectRegistrationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListHostProjectRegistrationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListHostProjectRegistrationsResponse message. + * @function verify + * @memberof google.cloud.apihub.v1.ListHostProjectRegistrationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListHostProjectRegistrationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.hostProjectRegistrations != null && message.hasOwnProperty("hostProjectRegistrations")) { + if (!Array.isArray(message.hostProjectRegistrations)) + return "hostProjectRegistrations: array expected"; + for (var i = 0; i < message.hostProjectRegistrations.length; ++i) { + var error = $root.google.cloud.apihub.v1.HostProjectRegistration.verify(message.hostProjectRegistrations[i]); + if (error) + return "hostProjectRegistrations." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListHostProjectRegistrationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.ListHostProjectRegistrationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.ListHostProjectRegistrationsResponse} ListHostProjectRegistrationsResponse + */ + ListHostProjectRegistrationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.ListHostProjectRegistrationsResponse) + return object; + var message = new $root.google.cloud.apihub.v1.ListHostProjectRegistrationsResponse(); + if (object.hostProjectRegistrations) { + if (!Array.isArray(object.hostProjectRegistrations)) + throw TypeError(".google.cloud.apihub.v1.ListHostProjectRegistrationsResponse.hostProjectRegistrations: array expected"); + message.hostProjectRegistrations = []; + for (var i = 0; i < object.hostProjectRegistrations.length; ++i) { + if (typeof object.hostProjectRegistrations[i] !== "object") + throw TypeError(".google.cloud.apihub.v1.ListHostProjectRegistrationsResponse.hostProjectRegistrations: object expected"); + message.hostProjectRegistrations[i] = $root.google.cloud.apihub.v1.HostProjectRegistration.fromObject(object.hostProjectRegistrations[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListHostProjectRegistrationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.ListHostProjectRegistrationsResponse + * @static + * @param {google.cloud.apihub.v1.ListHostProjectRegistrationsResponse} message ListHostProjectRegistrationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListHostProjectRegistrationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.hostProjectRegistrations = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.hostProjectRegistrations && message.hostProjectRegistrations.length) { + object.hostProjectRegistrations = []; + for (var j = 0; j < message.hostProjectRegistrations.length; ++j) + object.hostProjectRegistrations[j] = $root.google.cloud.apihub.v1.HostProjectRegistration.toObject(message.hostProjectRegistrations[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListHostProjectRegistrationsResponse to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.ListHostProjectRegistrationsResponse + * @instance + * @returns {Object.} JSON object + */ + ListHostProjectRegistrationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListHostProjectRegistrationsResponse + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.ListHostProjectRegistrationsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListHostProjectRegistrationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.ListHostProjectRegistrationsResponse"; + }; + + return ListHostProjectRegistrationsResponse; + })(); + + v1.HostProjectRegistration = (function() { + + /** + * Properties of a HostProjectRegistration. + * @memberof google.cloud.apihub.v1 + * @interface IHostProjectRegistration + * @property {string|null} [name] HostProjectRegistration name + * @property {string|null} [gcpProject] HostProjectRegistration gcpProject + * @property {google.protobuf.ITimestamp|null} [createTime] HostProjectRegistration createTime + */ + + /** + * Constructs a new HostProjectRegistration. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a HostProjectRegistration. + * @implements IHostProjectRegistration + * @constructor + * @param {google.cloud.apihub.v1.IHostProjectRegistration=} [properties] Properties to set + */ + function HostProjectRegistration(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]]; + } + + /** + * HostProjectRegistration name. + * @member {string} name + * @memberof google.cloud.apihub.v1.HostProjectRegistration + * @instance + */ + HostProjectRegistration.prototype.name = ""; + + /** + * HostProjectRegistration gcpProject. + * @member {string} gcpProject + * @memberof google.cloud.apihub.v1.HostProjectRegistration + * @instance + */ + HostProjectRegistration.prototype.gcpProject = ""; + + /** + * HostProjectRegistration createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.apihub.v1.HostProjectRegistration + * @instance + */ + HostProjectRegistration.prototype.createTime = null; + + /** + * Creates a new HostProjectRegistration instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.HostProjectRegistration + * @static + * @param {google.cloud.apihub.v1.IHostProjectRegistration=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.HostProjectRegistration} HostProjectRegistration instance + */ + HostProjectRegistration.create = function create(properties) { + return new HostProjectRegistration(properties); + }; + + /** + * Encodes the specified HostProjectRegistration message. Does not implicitly {@link google.cloud.apihub.v1.HostProjectRegistration.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.HostProjectRegistration + * @static + * @param {google.cloud.apihub.v1.IHostProjectRegistration} message HostProjectRegistration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HostProjectRegistration.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.gcpProject != null && Object.hasOwnProperty.call(message, "gcpProject")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.gcpProject); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified HostProjectRegistration message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.HostProjectRegistration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.HostProjectRegistration + * @static + * @param {google.cloud.apihub.v1.IHostProjectRegistration} message HostProjectRegistration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HostProjectRegistration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HostProjectRegistration message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.HostProjectRegistration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.HostProjectRegistration} HostProjectRegistration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HostProjectRegistration.decode = function 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.apihub.v1.HostProjectRegistration(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.gcpProject = reader.string(); + break; + } + case 3: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HostProjectRegistration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.HostProjectRegistration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.HostProjectRegistration} HostProjectRegistration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HostProjectRegistration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HostProjectRegistration message. + * @function verify + * @memberof google.cloud.apihub.v1.HostProjectRegistration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HostProjectRegistration.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.gcpProject != null && message.hasOwnProperty("gcpProject")) + if (!$util.isString(message.gcpProject)) + return "gcpProject: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + return null; + }; + + /** + * Creates a HostProjectRegistration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.HostProjectRegistration + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.HostProjectRegistration} HostProjectRegistration + */ + HostProjectRegistration.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.HostProjectRegistration) + return object; + var message = new $root.google.cloud.apihub.v1.HostProjectRegistration(); + if (object.name != null) + message.name = String(object.name); + if (object.gcpProject != null) + message.gcpProject = String(object.gcpProject); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.apihub.v1.HostProjectRegistration.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + return message; + }; + + /** + * Creates a plain object from a HostProjectRegistration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.HostProjectRegistration + * @static + * @param {google.cloud.apihub.v1.HostProjectRegistration} message HostProjectRegistration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HostProjectRegistration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.gcpProject = ""; + object.createTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.gcpProject != null && message.hasOwnProperty("gcpProject")) + object.gcpProject = message.gcpProject; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + return object; + }; + + /** + * Converts this HostProjectRegistration to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.HostProjectRegistration + * @instance + * @returns {Object.} JSON object + */ + HostProjectRegistration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HostProjectRegistration + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.HostProjectRegistration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HostProjectRegistration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.HostProjectRegistration"; + }; + + return HostProjectRegistration; + })(); + + v1.LintingService = (function() { + + /** + * Constructs a new LintingService service. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a LintingService + * @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 LintingService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (LintingService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = LintingService; + + /** + * Creates new LintingService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.apihub.v1.LintingService + * @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 {LintingService} RPC service. Useful where requests and/or responses are streamed. + */ + LintingService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.apihub.v1.LintingService|getStyleGuide}. + * @memberof google.cloud.apihub.v1.LintingService + * @typedef GetStyleGuideCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apihub.v1.StyleGuide} [response] StyleGuide + */ + + /** + * Calls GetStyleGuide. + * @function getStyleGuide + * @memberof google.cloud.apihub.v1.LintingService + * @instance + * @param {google.cloud.apihub.v1.IGetStyleGuideRequest} request GetStyleGuideRequest message or plain object + * @param {google.cloud.apihub.v1.LintingService.GetStyleGuideCallback} callback Node-style callback called with the error, if any, and StyleGuide + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(LintingService.prototype.getStyleGuide = function getStyleGuide(request, callback) { + return this.rpcCall(getStyleGuide, $root.google.cloud.apihub.v1.GetStyleGuideRequest, $root.google.cloud.apihub.v1.StyleGuide, request, callback); + }, "name", { value: "GetStyleGuide" }); + + /** + * Calls GetStyleGuide. + * @function getStyleGuide + * @memberof google.cloud.apihub.v1.LintingService + * @instance + * @param {google.cloud.apihub.v1.IGetStyleGuideRequest} request GetStyleGuideRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.LintingService|updateStyleGuide}. + * @memberof google.cloud.apihub.v1.LintingService + * @typedef UpdateStyleGuideCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apihub.v1.StyleGuide} [response] StyleGuide + */ + + /** + * Calls UpdateStyleGuide. + * @function updateStyleGuide + * @memberof google.cloud.apihub.v1.LintingService + * @instance + * @param {google.cloud.apihub.v1.IUpdateStyleGuideRequest} request UpdateStyleGuideRequest message or plain object + * @param {google.cloud.apihub.v1.LintingService.UpdateStyleGuideCallback} callback Node-style callback called with the error, if any, and StyleGuide + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(LintingService.prototype.updateStyleGuide = function updateStyleGuide(request, callback) { + return this.rpcCall(updateStyleGuide, $root.google.cloud.apihub.v1.UpdateStyleGuideRequest, $root.google.cloud.apihub.v1.StyleGuide, request, callback); + }, "name", { value: "UpdateStyleGuide" }); + + /** + * Calls UpdateStyleGuide. + * @function updateStyleGuide + * @memberof google.cloud.apihub.v1.LintingService + * @instance + * @param {google.cloud.apihub.v1.IUpdateStyleGuideRequest} request UpdateStyleGuideRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.LintingService|getStyleGuideContents}. + * @memberof google.cloud.apihub.v1.LintingService + * @typedef GetStyleGuideContentsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apihub.v1.StyleGuideContents} [response] StyleGuideContents + */ + + /** + * Calls GetStyleGuideContents. + * @function getStyleGuideContents + * @memberof google.cloud.apihub.v1.LintingService + * @instance + * @param {google.cloud.apihub.v1.IGetStyleGuideContentsRequest} request GetStyleGuideContentsRequest message or plain object + * @param {google.cloud.apihub.v1.LintingService.GetStyleGuideContentsCallback} callback Node-style callback called with the error, if any, and StyleGuideContents + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(LintingService.prototype.getStyleGuideContents = function getStyleGuideContents(request, callback) { + return this.rpcCall(getStyleGuideContents, $root.google.cloud.apihub.v1.GetStyleGuideContentsRequest, $root.google.cloud.apihub.v1.StyleGuideContents, request, callback); + }, "name", { value: "GetStyleGuideContents" }); + + /** + * Calls GetStyleGuideContents. + * @function getStyleGuideContents + * @memberof google.cloud.apihub.v1.LintingService + * @instance + * @param {google.cloud.apihub.v1.IGetStyleGuideContentsRequest} request GetStyleGuideContentsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.LintingService|lintSpec}. + * @memberof google.cloud.apihub.v1.LintingService + * @typedef LintSpecCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls LintSpec. + * @function lintSpec + * @memberof google.cloud.apihub.v1.LintingService + * @instance + * @param {google.cloud.apihub.v1.ILintSpecRequest} request LintSpecRequest message or plain object + * @param {google.cloud.apihub.v1.LintingService.LintSpecCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(LintingService.prototype.lintSpec = function lintSpec(request, callback) { + return this.rpcCall(lintSpec, $root.google.cloud.apihub.v1.LintSpecRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "LintSpec" }); + + /** + * Calls LintSpec. + * @function lintSpec + * @memberof google.cloud.apihub.v1.LintingService + * @instance + * @param {google.cloud.apihub.v1.ILintSpecRequest} request LintSpecRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return LintingService; + })(); + + v1.GetStyleGuideRequest = (function() { + + /** + * Properties of a GetStyleGuideRequest. + * @memberof google.cloud.apihub.v1 + * @interface IGetStyleGuideRequest + * @property {string|null} [name] GetStyleGuideRequest name + */ + + /** + * Constructs a new GetStyleGuideRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a GetStyleGuideRequest. + * @implements IGetStyleGuideRequest + * @constructor + * @param {google.cloud.apihub.v1.IGetStyleGuideRequest=} [properties] Properties to set + */ + function GetStyleGuideRequest(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]]; + } + + /** + * GetStyleGuideRequest name. + * @member {string} name + * @memberof google.cloud.apihub.v1.GetStyleGuideRequest + * @instance + */ + GetStyleGuideRequest.prototype.name = ""; + + /** + * Creates a new GetStyleGuideRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.GetStyleGuideRequest + * @static + * @param {google.cloud.apihub.v1.IGetStyleGuideRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.GetStyleGuideRequest} GetStyleGuideRequest instance + */ + GetStyleGuideRequest.create = function create(properties) { + return new GetStyleGuideRequest(properties); + }; + + /** + * Encodes the specified GetStyleGuideRequest message. Does not implicitly {@link google.cloud.apihub.v1.GetStyleGuideRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.GetStyleGuideRequest + * @static + * @param {google.cloud.apihub.v1.IGetStyleGuideRequest} message GetStyleGuideRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetStyleGuideRequest.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 GetStyleGuideRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.GetStyleGuideRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.GetStyleGuideRequest + * @static + * @param {google.cloud.apihub.v1.IGetStyleGuideRequest} message GetStyleGuideRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetStyleGuideRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetStyleGuideRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.GetStyleGuideRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.GetStyleGuideRequest} GetStyleGuideRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetStyleGuideRequest.decode = function 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.apihub.v1.GetStyleGuideRequest(); + 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 GetStyleGuideRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.GetStyleGuideRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.GetStyleGuideRequest} GetStyleGuideRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetStyleGuideRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetStyleGuideRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.GetStyleGuideRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetStyleGuideRequest.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 GetStyleGuideRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.GetStyleGuideRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.GetStyleGuideRequest} GetStyleGuideRequest + */ + GetStyleGuideRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.GetStyleGuideRequest) + return object; + var message = new $root.google.cloud.apihub.v1.GetStyleGuideRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetStyleGuideRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.GetStyleGuideRequest + * @static + * @param {google.cloud.apihub.v1.GetStyleGuideRequest} message GetStyleGuideRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetStyleGuideRequest.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 GetStyleGuideRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.GetStyleGuideRequest + * @instance + * @returns {Object.} JSON object + */ + GetStyleGuideRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetStyleGuideRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.GetStyleGuideRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetStyleGuideRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.GetStyleGuideRequest"; + }; + + return GetStyleGuideRequest; + })(); + + v1.UpdateStyleGuideRequest = (function() { + + /** + * Properties of an UpdateStyleGuideRequest. + * @memberof google.cloud.apihub.v1 + * @interface IUpdateStyleGuideRequest + * @property {google.cloud.apihub.v1.IStyleGuide|null} [styleGuide] UpdateStyleGuideRequest styleGuide + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateStyleGuideRequest updateMask + */ + + /** + * Constructs a new UpdateStyleGuideRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents an UpdateStyleGuideRequest. + * @implements IUpdateStyleGuideRequest + * @constructor + * @param {google.cloud.apihub.v1.IUpdateStyleGuideRequest=} [properties] Properties to set + */ + function UpdateStyleGuideRequest(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]]; + } + + /** + * UpdateStyleGuideRequest styleGuide. + * @member {google.cloud.apihub.v1.IStyleGuide|null|undefined} styleGuide + * @memberof google.cloud.apihub.v1.UpdateStyleGuideRequest + * @instance + */ + UpdateStyleGuideRequest.prototype.styleGuide = null; + + /** + * UpdateStyleGuideRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.apihub.v1.UpdateStyleGuideRequest + * @instance + */ + UpdateStyleGuideRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateStyleGuideRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.UpdateStyleGuideRequest + * @static + * @param {google.cloud.apihub.v1.IUpdateStyleGuideRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.UpdateStyleGuideRequest} UpdateStyleGuideRequest instance + */ + UpdateStyleGuideRequest.create = function create(properties) { + return new UpdateStyleGuideRequest(properties); + }; + + /** + * Encodes the specified UpdateStyleGuideRequest message. Does not implicitly {@link google.cloud.apihub.v1.UpdateStyleGuideRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.UpdateStyleGuideRequest + * @static + * @param {google.cloud.apihub.v1.IUpdateStyleGuideRequest} message UpdateStyleGuideRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateStyleGuideRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.styleGuide != null && Object.hasOwnProperty.call(message, "styleGuide")) + $root.google.cloud.apihub.v1.StyleGuide.encode(message.styleGuide, 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 UpdateStyleGuideRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.UpdateStyleGuideRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.UpdateStyleGuideRequest + * @static + * @param {google.cloud.apihub.v1.IUpdateStyleGuideRequest} message UpdateStyleGuideRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateStyleGuideRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateStyleGuideRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.UpdateStyleGuideRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.UpdateStyleGuideRequest} UpdateStyleGuideRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateStyleGuideRequest.decode = function 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.apihub.v1.UpdateStyleGuideRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.styleGuide = $root.google.cloud.apihub.v1.StyleGuide.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 UpdateStyleGuideRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.UpdateStyleGuideRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.UpdateStyleGuideRequest} UpdateStyleGuideRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateStyleGuideRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateStyleGuideRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.UpdateStyleGuideRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateStyleGuideRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.styleGuide != null && message.hasOwnProperty("styleGuide")) { + var error = $root.google.cloud.apihub.v1.StyleGuide.verify(message.styleGuide); + if (error) + return "styleGuide." + 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 UpdateStyleGuideRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.UpdateStyleGuideRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.UpdateStyleGuideRequest} UpdateStyleGuideRequest + */ + UpdateStyleGuideRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.UpdateStyleGuideRequest) + return object; + var message = new $root.google.cloud.apihub.v1.UpdateStyleGuideRequest(); + if (object.styleGuide != null) { + if (typeof object.styleGuide !== "object") + throw TypeError(".google.cloud.apihub.v1.UpdateStyleGuideRequest.styleGuide: object expected"); + message.styleGuide = $root.google.cloud.apihub.v1.StyleGuide.fromObject(object.styleGuide); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.apihub.v1.UpdateStyleGuideRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateStyleGuideRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.UpdateStyleGuideRequest + * @static + * @param {google.cloud.apihub.v1.UpdateStyleGuideRequest} message UpdateStyleGuideRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateStyleGuideRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.styleGuide = null; + object.updateMask = null; + } + if (message.styleGuide != null && message.hasOwnProperty("styleGuide")) + object.styleGuide = $root.google.cloud.apihub.v1.StyleGuide.toObject(message.styleGuide, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateStyleGuideRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.UpdateStyleGuideRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateStyleGuideRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateStyleGuideRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.UpdateStyleGuideRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateStyleGuideRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.UpdateStyleGuideRequest"; + }; + + return UpdateStyleGuideRequest; + })(); + + v1.GetStyleGuideContentsRequest = (function() { + + /** + * Properties of a GetStyleGuideContentsRequest. + * @memberof google.cloud.apihub.v1 + * @interface IGetStyleGuideContentsRequest + * @property {string|null} [name] GetStyleGuideContentsRequest name + */ + + /** + * Constructs a new GetStyleGuideContentsRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a GetStyleGuideContentsRequest. + * @implements IGetStyleGuideContentsRequest + * @constructor + * @param {google.cloud.apihub.v1.IGetStyleGuideContentsRequest=} [properties] Properties to set + */ + function GetStyleGuideContentsRequest(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]]; + } + + /** + * GetStyleGuideContentsRequest name. + * @member {string} name + * @memberof google.cloud.apihub.v1.GetStyleGuideContentsRequest + * @instance + */ + GetStyleGuideContentsRequest.prototype.name = ""; + + /** + * Creates a new GetStyleGuideContentsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.GetStyleGuideContentsRequest + * @static + * @param {google.cloud.apihub.v1.IGetStyleGuideContentsRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.GetStyleGuideContentsRequest} GetStyleGuideContentsRequest instance + */ + GetStyleGuideContentsRequest.create = function create(properties) { + return new GetStyleGuideContentsRequest(properties); + }; + + /** + * Encodes the specified GetStyleGuideContentsRequest message. Does not implicitly {@link google.cloud.apihub.v1.GetStyleGuideContentsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.GetStyleGuideContentsRequest + * @static + * @param {google.cloud.apihub.v1.IGetStyleGuideContentsRequest} message GetStyleGuideContentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetStyleGuideContentsRequest.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 GetStyleGuideContentsRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.GetStyleGuideContentsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.GetStyleGuideContentsRequest + * @static + * @param {google.cloud.apihub.v1.IGetStyleGuideContentsRequest} message GetStyleGuideContentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetStyleGuideContentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetStyleGuideContentsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.GetStyleGuideContentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.GetStyleGuideContentsRequest} GetStyleGuideContentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetStyleGuideContentsRequest.decode = function 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.apihub.v1.GetStyleGuideContentsRequest(); + 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 GetStyleGuideContentsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.GetStyleGuideContentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.GetStyleGuideContentsRequest} GetStyleGuideContentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetStyleGuideContentsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetStyleGuideContentsRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.GetStyleGuideContentsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetStyleGuideContentsRequest.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 GetStyleGuideContentsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.GetStyleGuideContentsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.GetStyleGuideContentsRequest} GetStyleGuideContentsRequest + */ + GetStyleGuideContentsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.GetStyleGuideContentsRequest) + return object; + var message = new $root.google.cloud.apihub.v1.GetStyleGuideContentsRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetStyleGuideContentsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.GetStyleGuideContentsRequest + * @static + * @param {google.cloud.apihub.v1.GetStyleGuideContentsRequest} message GetStyleGuideContentsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetStyleGuideContentsRequest.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 GetStyleGuideContentsRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.GetStyleGuideContentsRequest + * @instance + * @returns {Object.} JSON object + */ + GetStyleGuideContentsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetStyleGuideContentsRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.GetStyleGuideContentsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetStyleGuideContentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.GetStyleGuideContentsRequest"; + }; + + return GetStyleGuideContentsRequest; + })(); + + v1.LintSpecRequest = (function() { + + /** + * Properties of a LintSpecRequest. + * @memberof google.cloud.apihub.v1 + * @interface ILintSpecRequest + * @property {string|null} [name] LintSpecRequest name + */ + + /** + * Constructs a new LintSpecRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a LintSpecRequest. + * @implements ILintSpecRequest + * @constructor + * @param {google.cloud.apihub.v1.ILintSpecRequest=} [properties] Properties to set + */ + function LintSpecRequest(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]]; + } + + /** + * LintSpecRequest name. + * @member {string} name + * @memberof google.cloud.apihub.v1.LintSpecRequest + * @instance + */ + LintSpecRequest.prototype.name = ""; + + /** + * Creates a new LintSpecRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.LintSpecRequest + * @static + * @param {google.cloud.apihub.v1.ILintSpecRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.LintSpecRequest} LintSpecRequest instance + */ + LintSpecRequest.create = function create(properties) { + return new LintSpecRequest(properties); + }; + + /** + * Encodes the specified LintSpecRequest message. Does not implicitly {@link google.cloud.apihub.v1.LintSpecRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.LintSpecRequest + * @static + * @param {google.cloud.apihub.v1.ILintSpecRequest} message LintSpecRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LintSpecRequest.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 LintSpecRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.LintSpecRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.LintSpecRequest + * @static + * @param {google.cloud.apihub.v1.ILintSpecRequest} message LintSpecRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LintSpecRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LintSpecRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.LintSpecRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.LintSpecRequest} LintSpecRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LintSpecRequest.decode = function 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.apihub.v1.LintSpecRequest(); + 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 LintSpecRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.LintSpecRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.LintSpecRequest} LintSpecRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LintSpecRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LintSpecRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.LintSpecRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LintSpecRequest.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 LintSpecRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.LintSpecRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.LintSpecRequest} LintSpecRequest + */ + LintSpecRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.LintSpecRequest) + return object; + var message = new $root.google.cloud.apihub.v1.LintSpecRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a LintSpecRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.LintSpecRequest + * @static + * @param {google.cloud.apihub.v1.LintSpecRequest} message LintSpecRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LintSpecRequest.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 LintSpecRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.LintSpecRequest + * @instance + * @returns {Object.} JSON object + */ + LintSpecRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LintSpecRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.LintSpecRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LintSpecRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.LintSpecRequest"; + }; + + return LintSpecRequest; + })(); + + v1.StyleGuideContents = (function() { + + /** + * Properties of a StyleGuideContents. + * @memberof google.cloud.apihub.v1 + * @interface IStyleGuideContents + * @property {Uint8Array|null} [contents] StyleGuideContents contents + * @property {string|null} [mimeType] StyleGuideContents mimeType + */ + + /** + * Constructs a new StyleGuideContents. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a StyleGuideContents. + * @implements IStyleGuideContents + * @constructor + * @param {google.cloud.apihub.v1.IStyleGuideContents=} [properties] Properties to set + */ + function StyleGuideContents(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]]; + } + + /** + * StyleGuideContents contents. + * @member {Uint8Array} contents + * @memberof google.cloud.apihub.v1.StyleGuideContents + * @instance + */ + StyleGuideContents.prototype.contents = $util.newBuffer([]); + + /** + * StyleGuideContents mimeType. + * @member {string} mimeType + * @memberof google.cloud.apihub.v1.StyleGuideContents + * @instance + */ + StyleGuideContents.prototype.mimeType = ""; + + /** + * Creates a new StyleGuideContents instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.StyleGuideContents + * @static + * @param {google.cloud.apihub.v1.IStyleGuideContents=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.StyleGuideContents} StyleGuideContents instance + */ + StyleGuideContents.create = function create(properties) { + return new StyleGuideContents(properties); + }; + + /** + * Encodes the specified StyleGuideContents message. Does not implicitly {@link google.cloud.apihub.v1.StyleGuideContents.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.StyleGuideContents + * @static + * @param {google.cloud.apihub.v1.IStyleGuideContents} message StyleGuideContents message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StyleGuideContents.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.contents != null && Object.hasOwnProperty.call(message, "contents")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.contents); + if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.mimeType); + return writer; + }; + + /** + * Encodes the specified StyleGuideContents message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.StyleGuideContents.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.StyleGuideContents + * @static + * @param {google.cloud.apihub.v1.IStyleGuideContents} message StyleGuideContents message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StyleGuideContents.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StyleGuideContents message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.StyleGuideContents + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.StyleGuideContents} StyleGuideContents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StyleGuideContents.decode = function 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.apihub.v1.StyleGuideContents(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.contents = reader.bytes(); + break; + } + case 2: { + message.mimeType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StyleGuideContents message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.StyleGuideContents + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.StyleGuideContents} StyleGuideContents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StyleGuideContents.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StyleGuideContents message. + * @function verify + * @memberof google.cloud.apihub.v1.StyleGuideContents + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StyleGuideContents.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.contents != null && message.hasOwnProperty("contents")) + if (!(message.contents && typeof message.contents.length === "number" || $util.isString(message.contents))) + return "contents: buffer expected"; + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + if (!$util.isString(message.mimeType)) + return "mimeType: string expected"; + return null; + }; + + /** + * Creates a StyleGuideContents message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.StyleGuideContents + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.StyleGuideContents} StyleGuideContents + */ + StyleGuideContents.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.StyleGuideContents) + return object; + var message = new $root.google.cloud.apihub.v1.StyleGuideContents(); + if (object.contents != null) + if (typeof object.contents === "string") + $util.base64.decode(object.contents, message.contents = $util.newBuffer($util.base64.length(object.contents)), 0); + else if (object.contents.length >= 0) + message.contents = object.contents; + if (object.mimeType != null) + message.mimeType = String(object.mimeType); + return message; + }; + + /** + * Creates a plain object from a StyleGuideContents message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.StyleGuideContents + * @static + * @param {google.cloud.apihub.v1.StyleGuideContents} message StyleGuideContents + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StyleGuideContents.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.contents = ""; + else { + object.contents = []; + if (options.bytes !== Array) + object.contents = $util.newBuffer(object.contents); + } + object.mimeType = ""; + } + if (message.contents != null && message.hasOwnProperty("contents")) + object.contents = options.bytes === String ? $util.base64.encode(message.contents, 0, message.contents.length) : options.bytes === Array ? Array.prototype.slice.call(message.contents) : message.contents; + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + object.mimeType = message.mimeType; + return object; + }; + + /** + * Converts this StyleGuideContents to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.StyleGuideContents + * @instance + * @returns {Object.} JSON object + */ + StyleGuideContents.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StyleGuideContents + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.StyleGuideContents + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StyleGuideContents.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.StyleGuideContents"; + }; + + return StyleGuideContents; + })(); + + v1.StyleGuide = (function() { + + /** + * Properties of a StyleGuide. + * @memberof google.cloud.apihub.v1 + * @interface IStyleGuide + * @property {string|null} [name] StyleGuide name + * @property {google.cloud.apihub.v1.Linter|null} [linter] StyleGuide linter + * @property {google.cloud.apihub.v1.IStyleGuideContents|null} [contents] StyleGuide contents + */ + + /** + * Constructs a new StyleGuide. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a StyleGuide. + * @implements IStyleGuide + * @constructor + * @param {google.cloud.apihub.v1.IStyleGuide=} [properties] Properties to set + */ + function StyleGuide(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]]; + } + + /** + * StyleGuide name. + * @member {string} name + * @memberof google.cloud.apihub.v1.StyleGuide + * @instance + */ + StyleGuide.prototype.name = ""; + + /** + * StyleGuide linter. + * @member {google.cloud.apihub.v1.Linter} linter + * @memberof google.cloud.apihub.v1.StyleGuide + * @instance + */ + StyleGuide.prototype.linter = 0; + + /** + * StyleGuide contents. + * @member {google.cloud.apihub.v1.IStyleGuideContents|null|undefined} contents + * @memberof google.cloud.apihub.v1.StyleGuide + * @instance + */ + StyleGuide.prototype.contents = null; + + /** + * Creates a new StyleGuide instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.StyleGuide + * @static + * @param {google.cloud.apihub.v1.IStyleGuide=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.StyleGuide} StyleGuide instance + */ + StyleGuide.create = function create(properties) { + return new StyleGuide(properties); + }; + + /** + * Encodes the specified StyleGuide message. Does not implicitly {@link google.cloud.apihub.v1.StyleGuide.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.StyleGuide + * @static + * @param {google.cloud.apihub.v1.IStyleGuide} message StyleGuide message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StyleGuide.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.linter != null && Object.hasOwnProperty.call(message, "linter")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.linter); + if (message.contents != null && Object.hasOwnProperty.call(message, "contents")) + $root.google.cloud.apihub.v1.StyleGuideContents.encode(message.contents, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified StyleGuide message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.StyleGuide.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.StyleGuide + * @static + * @param {google.cloud.apihub.v1.IStyleGuide} message StyleGuide message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StyleGuide.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StyleGuide message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.StyleGuide + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.StyleGuide} StyleGuide + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StyleGuide.decode = function 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.apihub.v1.StyleGuide(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.linter = reader.int32(); + break; + } + case 3: { + message.contents = $root.google.cloud.apihub.v1.StyleGuideContents.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StyleGuide message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.StyleGuide + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.StyleGuide} StyleGuide + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StyleGuide.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StyleGuide message. + * @function verify + * @memberof google.cloud.apihub.v1.StyleGuide + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StyleGuide.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.linter != null && message.hasOwnProperty("linter")) + switch (message.linter) { + default: + return "linter: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.contents != null && message.hasOwnProperty("contents")) { + var error = $root.google.cloud.apihub.v1.StyleGuideContents.verify(message.contents); + if (error) + return "contents." + error; + } + return null; + }; + + /** + * Creates a StyleGuide message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.StyleGuide + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.StyleGuide} StyleGuide + */ + StyleGuide.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.StyleGuide) + return object; + var message = new $root.google.cloud.apihub.v1.StyleGuide(); + if (object.name != null) + message.name = String(object.name); + switch (object.linter) { + default: + if (typeof object.linter === "number") { + message.linter = object.linter; + break; + } + break; + case "LINTER_UNSPECIFIED": + case 0: + message.linter = 0; + break; + case "SPECTRAL": + case 1: + message.linter = 1; + break; + case "OTHER": + case 2: + message.linter = 2; + break; + } + if (object.contents != null) { + if (typeof object.contents !== "object") + throw TypeError(".google.cloud.apihub.v1.StyleGuide.contents: object expected"); + message.contents = $root.google.cloud.apihub.v1.StyleGuideContents.fromObject(object.contents); + } + return message; + }; + + /** + * Creates a plain object from a StyleGuide message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.StyleGuide + * @static + * @param {google.cloud.apihub.v1.StyleGuide} message StyleGuide + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StyleGuide.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.linter = options.enums === String ? "LINTER_UNSPECIFIED" : 0; + object.contents = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.linter != null && message.hasOwnProperty("linter")) + object.linter = options.enums === String ? $root.google.cloud.apihub.v1.Linter[message.linter] === undefined ? message.linter : $root.google.cloud.apihub.v1.Linter[message.linter] : message.linter; + if (message.contents != null && message.hasOwnProperty("contents")) + object.contents = $root.google.cloud.apihub.v1.StyleGuideContents.toObject(message.contents, options); + return object; + }; + + /** + * Converts this StyleGuide to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.StyleGuide + * @instance + * @returns {Object.} JSON object + */ + StyleGuide.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StyleGuide + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.StyleGuide + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StyleGuide.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.StyleGuide"; + }; + + return StyleGuide; + })(); + + v1.ApiHubPlugin = (function() { + + /** + * Constructs a new ApiHubPlugin service. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents an ApiHubPlugin + * @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 ApiHubPlugin(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (ApiHubPlugin.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = ApiHubPlugin; + + /** + * Creates new ApiHubPlugin service using the specified rpc implementation. + * @function create + * @memberof google.cloud.apihub.v1.ApiHubPlugin + * @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 {ApiHubPlugin} RPC service. Useful where requests and/or responses are streamed. + */ + ApiHubPlugin.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHubPlugin|getPlugin}. + * @memberof google.cloud.apihub.v1.ApiHubPlugin + * @typedef GetPluginCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apihub.v1.Plugin} [response] Plugin + */ + + /** + * Calls GetPlugin. + * @function getPlugin + * @memberof google.cloud.apihub.v1.ApiHubPlugin + * @instance + * @param {google.cloud.apihub.v1.IGetPluginRequest} request GetPluginRequest message or plain object + * @param {google.cloud.apihub.v1.ApiHubPlugin.GetPluginCallback} callback Node-style callback called with the error, if any, and Plugin + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ApiHubPlugin.prototype.getPlugin = function getPlugin(request, callback) { + return this.rpcCall(getPlugin, $root.google.cloud.apihub.v1.GetPluginRequest, $root.google.cloud.apihub.v1.Plugin, request, callback); + }, "name", { value: "GetPlugin" }); + + /** + * Calls GetPlugin. + * @function getPlugin + * @memberof google.cloud.apihub.v1.ApiHubPlugin + * @instance + * @param {google.cloud.apihub.v1.IGetPluginRequest} request GetPluginRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHubPlugin|enablePlugin}. + * @memberof google.cloud.apihub.v1.ApiHubPlugin + * @typedef EnablePluginCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apihub.v1.Plugin} [response] Plugin + */ + + /** + * Calls EnablePlugin. + * @function enablePlugin + * @memberof google.cloud.apihub.v1.ApiHubPlugin + * @instance + * @param {google.cloud.apihub.v1.IEnablePluginRequest} request EnablePluginRequest message or plain object + * @param {google.cloud.apihub.v1.ApiHubPlugin.EnablePluginCallback} callback Node-style callback called with the error, if any, and Plugin + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ApiHubPlugin.prototype.enablePlugin = function enablePlugin(request, callback) { + return this.rpcCall(enablePlugin, $root.google.cloud.apihub.v1.EnablePluginRequest, $root.google.cloud.apihub.v1.Plugin, request, callback); + }, "name", { value: "EnablePlugin" }); + + /** + * Calls EnablePlugin. + * @function enablePlugin + * @memberof google.cloud.apihub.v1.ApiHubPlugin + * @instance + * @param {google.cloud.apihub.v1.IEnablePluginRequest} request EnablePluginRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.ApiHubPlugin|disablePlugin}. + * @memberof google.cloud.apihub.v1.ApiHubPlugin + * @typedef DisablePluginCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apihub.v1.Plugin} [response] Plugin + */ + + /** + * Calls DisablePlugin. + * @function disablePlugin + * @memberof google.cloud.apihub.v1.ApiHubPlugin + * @instance + * @param {google.cloud.apihub.v1.IDisablePluginRequest} request DisablePluginRequest message or plain object + * @param {google.cloud.apihub.v1.ApiHubPlugin.DisablePluginCallback} callback Node-style callback called with the error, if any, and Plugin + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ApiHubPlugin.prototype.disablePlugin = function disablePlugin(request, callback) { + return this.rpcCall(disablePlugin, $root.google.cloud.apihub.v1.DisablePluginRequest, $root.google.cloud.apihub.v1.Plugin, request, callback); + }, "name", { value: "DisablePlugin" }); + + /** + * Calls DisablePlugin. + * @function disablePlugin + * @memberof google.cloud.apihub.v1.ApiHubPlugin + * @instance + * @param {google.cloud.apihub.v1.IDisablePluginRequest} request DisablePluginRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return ApiHubPlugin; + })(); + + v1.Plugin = (function() { + + /** + * Properties of a Plugin. + * @memberof google.cloud.apihub.v1 + * @interface IPlugin + * @property {string|null} [name] Plugin name + * @property {string|null} [displayName] Plugin displayName + * @property {google.cloud.apihub.v1.IAttributeValues|null} [type] Plugin type + * @property {string|null} [description] Plugin description + * @property {google.cloud.apihub.v1.Plugin.State|null} [state] Plugin state + */ + + /** + * Constructs a new Plugin. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a Plugin. + * @implements IPlugin + * @constructor + * @param {google.cloud.apihub.v1.IPlugin=} [properties] Properties to set + */ + function Plugin(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]]; + } + + /** + * Plugin name. + * @member {string} name + * @memberof google.cloud.apihub.v1.Plugin + * @instance + */ + Plugin.prototype.name = ""; + + /** + * Plugin displayName. + * @member {string} displayName + * @memberof google.cloud.apihub.v1.Plugin + * @instance + */ + Plugin.prototype.displayName = ""; + + /** + * Plugin type. + * @member {google.cloud.apihub.v1.IAttributeValues|null|undefined} type + * @memberof google.cloud.apihub.v1.Plugin + * @instance + */ + Plugin.prototype.type = null; + + /** + * Plugin description. + * @member {string} description + * @memberof google.cloud.apihub.v1.Plugin + * @instance + */ + Plugin.prototype.description = ""; + + /** + * Plugin state. + * @member {google.cloud.apihub.v1.Plugin.State} state + * @memberof google.cloud.apihub.v1.Plugin + * @instance + */ + Plugin.prototype.state = 0; + + /** + * Creates a new Plugin instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.Plugin + * @static + * @param {google.cloud.apihub.v1.IPlugin=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.Plugin} Plugin instance + */ + Plugin.create = function create(properties) { + return new Plugin(properties); + }; + + /** + * Encodes the specified Plugin message. Does not implicitly {@link google.cloud.apihub.v1.Plugin.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.Plugin + * @static + * @param {google.cloud.apihub.v1.IPlugin} message Plugin message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Plugin.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + $root.google.cloud.apihub.v1.AttributeValues.encode(message.type, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.description); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.state); + return writer; + }; + + /** + * Encodes the specified Plugin message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.Plugin.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.Plugin + * @static + * @param {google.cloud.apihub.v1.IPlugin} message Plugin message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Plugin.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Plugin message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.Plugin + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.Plugin} Plugin + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Plugin.decode = function 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.apihub.v1.Plugin(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.type = $root.google.cloud.apihub.v1.AttributeValues.decode(reader, reader.uint32()); + break; + } + case 4: { + message.description = reader.string(); + break; + } + case 5: { + message.state = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Plugin message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.Plugin + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.Plugin} Plugin + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Plugin.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Plugin message. + * @function verify + * @memberof google.cloud.apihub.v1.Plugin + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Plugin.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.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.type != null && message.hasOwnProperty("type")) { + var error = $root.google.cloud.apihub.v1.AttributeValues.verify(message.type); + if (error) + return "type." + error; + } + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + 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 Plugin message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.Plugin + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.Plugin} Plugin + */ + Plugin.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.Plugin) + return object; + var message = new $root.google.cloud.apihub.v1.Plugin(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.type != null) { + if (typeof object.type !== "object") + throw TypeError(".google.cloud.apihub.v1.Plugin.type: object expected"); + message.type = $root.google.cloud.apihub.v1.AttributeValues.fromObject(object.type); + } + if (object.description != null) + message.description = String(object.description); + 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 "ENABLED": + case 1: + message.state = 1; + break; + case "DISABLED": + case 2: + message.state = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a Plugin message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.Plugin + * @static + * @param {google.cloud.apihub.v1.Plugin} message Plugin + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Plugin.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.type = null; + object.description = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.type != null && message.hasOwnProperty("type")) + object.type = $root.google.cloud.apihub.v1.AttributeValues.toObject(message.type, options); + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.apihub.v1.Plugin.State[message.state] === undefined ? message.state : $root.google.cloud.apihub.v1.Plugin.State[message.state] : message.state; + return object; + }; + + /** + * Converts this Plugin to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.Plugin + * @instance + * @returns {Object.} JSON object + */ + Plugin.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Plugin + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.Plugin + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Plugin.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.Plugin"; + }; + + /** + * State enum. + * @name google.cloud.apihub.v1.Plugin.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} ENABLED=1 ENABLED value + * @property {number} DISABLED=2 DISABLED value + */ + Plugin.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ENABLED"] = 1; + values[valuesById[2] = "DISABLED"] = 2; + return values; + })(); + + return Plugin; + })(); + + v1.GetPluginRequest = (function() { + + /** + * Properties of a GetPluginRequest. + * @memberof google.cloud.apihub.v1 + * @interface IGetPluginRequest + * @property {string|null} [name] GetPluginRequest name + */ + + /** + * Constructs a new GetPluginRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a GetPluginRequest. + * @implements IGetPluginRequest + * @constructor + * @param {google.cloud.apihub.v1.IGetPluginRequest=} [properties] Properties to set + */ + function GetPluginRequest(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]]; + } + + /** + * GetPluginRequest name. + * @member {string} name + * @memberof google.cloud.apihub.v1.GetPluginRequest + * @instance + */ + GetPluginRequest.prototype.name = ""; + + /** + * Creates a new GetPluginRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.GetPluginRequest + * @static + * @param {google.cloud.apihub.v1.IGetPluginRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.GetPluginRequest} GetPluginRequest instance + */ + GetPluginRequest.create = function create(properties) { + return new GetPluginRequest(properties); + }; + + /** + * Encodes the specified GetPluginRequest message. Does not implicitly {@link google.cloud.apihub.v1.GetPluginRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.GetPluginRequest + * @static + * @param {google.cloud.apihub.v1.IGetPluginRequest} message GetPluginRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPluginRequest.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 GetPluginRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.GetPluginRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.GetPluginRequest + * @static + * @param {google.cloud.apihub.v1.IGetPluginRequest} message GetPluginRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPluginRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetPluginRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.GetPluginRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.GetPluginRequest} GetPluginRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPluginRequest.decode = function 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.apihub.v1.GetPluginRequest(); + 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 GetPluginRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.GetPluginRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.GetPluginRequest} GetPluginRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPluginRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetPluginRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.GetPluginRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetPluginRequest.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 GetPluginRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.GetPluginRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.GetPluginRequest} GetPluginRequest + */ + GetPluginRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.GetPluginRequest) + return object; + var message = new $root.google.cloud.apihub.v1.GetPluginRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetPluginRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.GetPluginRequest + * @static + * @param {google.cloud.apihub.v1.GetPluginRequest} message GetPluginRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetPluginRequest.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 GetPluginRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.GetPluginRequest + * @instance + * @returns {Object.} JSON object + */ + GetPluginRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetPluginRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.GetPluginRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetPluginRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.GetPluginRequest"; + }; + + return GetPluginRequest; + })(); + + v1.EnablePluginRequest = (function() { + + /** + * Properties of an EnablePluginRequest. + * @memberof google.cloud.apihub.v1 + * @interface IEnablePluginRequest + * @property {string|null} [name] EnablePluginRequest name + */ + + /** + * Constructs a new EnablePluginRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents an EnablePluginRequest. + * @implements IEnablePluginRequest + * @constructor + * @param {google.cloud.apihub.v1.IEnablePluginRequest=} [properties] Properties to set + */ + function EnablePluginRequest(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]]; + } + + /** + * EnablePluginRequest name. + * @member {string} name + * @memberof google.cloud.apihub.v1.EnablePluginRequest + * @instance + */ + EnablePluginRequest.prototype.name = ""; + + /** + * Creates a new EnablePluginRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.EnablePluginRequest + * @static + * @param {google.cloud.apihub.v1.IEnablePluginRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.EnablePluginRequest} EnablePluginRequest instance + */ + EnablePluginRequest.create = function create(properties) { + return new EnablePluginRequest(properties); + }; + + /** + * Encodes the specified EnablePluginRequest message. Does not implicitly {@link google.cloud.apihub.v1.EnablePluginRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.EnablePluginRequest + * @static + * @param {google.cloud.apihub.v1.IEnablePluginRequest} message EnablePluginRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnablePluginRequest.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 EnablePluginRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.EnablePluginRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.EnablePluginRequest + * @static + * @param {google.cloud.apihub.v1.IEnablePluginRequest} message EnablePluginRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnablePluginRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnablePluginRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.EnablePluginRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.EnablePluginRequest} EnablePluginRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnablePluginRequest.decode = function 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.apihub.v1.EnablePluginRequest(); + 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 an EnablePluginRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.EnablePluginRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.EnablePluginRequest} EnablePluginRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnablePluginRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnablePluginRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.EnablePluginRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnablePluginRequest.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 an EnablePluginRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.EnablePluginRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.EnablePluginRequest} EnablePluginRequest + */ + EnablePluginRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.EnablePluginRequest) + return object; + var message = new $root.google.cloud.apihub.v1.EnablePluginRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from an EnablePluginRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.EnablePluginRequest + * @static + * @param {google.cloud.apihub.v1.EnablePluginRequest} message EnablePluginRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnablePluginRequest.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 EnablePluginRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.EnablePluginRequest + * @instance + * @returns {Object.} JSON object + */ + EnablePluginRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnablePluginRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.EnablePluginRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnablePluginRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.EnablePluginRequest"; + }; + + return EnablePluginRequest; + })(); + + v1.DisablePluginRequest = (function() { + + /** + * Properties of a DisablePluginRequest. + * @memberof google.cloud.apihub.v1 + * @interface IDisablePluginRequest + * @property {string|null} [name] DisablePluginRequest name + */ + + /** + * Constructs a new DisablePluginRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a DisablePluginRequest. + * @implements IDisablePluginRequest + * @constructor + * @param {google.cloud.apihub.v1.IDisablePluginRequest=} [properties] Properties to set + */ + function DisablePluginRequest(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]]; + } + + /** + * DisablePluginRequest name. + * @member {string} name + * @memberof google.cloud.apihub.v1.DisablePluginRequest + * @instance + */ + DisablePluginRequest.prototype.name = ""; + + /** + * Creates a new DisablePluginRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.DisablePluginRequest + * @static + * @param {google.cloud.apihub.v1.IDisablePluginRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.DisablePluginRequest} DisablePluginRequest instance + */ + DisablePluginRequest.create = function create(properties) { + return new DisablePluginRequest(properties); + }; + + /** + * Encodes the specified DisablePluginRequest message. Does not implicitly {@link google.cloud.apihub.v1.DisablePluginRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.DisablePluginRequest + * @static + * @param {google.cloud.apihub.v1.IDisablePluginRequest} message DisablePluginRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DisablePluginRequest.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 DisablePluginRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.DisablePluginRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.DisablePluginRequest + * @static + * @param {google.cloud.apihub.v1.IDisablePluginRequest} message DisablePluginRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DisablePluginRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DisablePluginRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.DisablePluginRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.DisablePluginRequest} DisablePluginRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DisablePluginRequest.decode = function 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.apihub.v1.DisablePluginRequest(); + 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 DisablePluginRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.DisablePluginRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.DisablePluginRequest} DisablePluginRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DisablePluginRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DisablePluginRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.DisablePluginRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DisablePluginRequest.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 DisablePluginRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.DisablePluginRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.DisablePluginRequest} DisablePluginRequest + */ + DisablePluginRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.DisablePluginRequest) + return object; + var message = new $root.google.cloud.apihub.v1.DisablePluginRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DisablePluginRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.DisablePluginRequest + * @static + * @param {google.cloud.apihub.v1.DisablePluginRequest} message DisablePluginRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DisablePluginRequest.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 DisablePluginRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.DisablePluginRequest + * @instance + * @returns {Object.} JSON object + */ + DisablePluginRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DisablePluginRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.DisablePluginRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DisablePluginRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.DisablePluginRequest"; + }; + + return DisablePluginRequest; + })(); + + v1.Provisioning = (function() { + + /** + * Constructs a new Provisioning service. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a Provisioning + * @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 Provisioning(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Provisioning.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Provisioning; + + /** + * Creates new Provisioning service using the specified rpc implementation. + * @function create + * @memberof google.cloud.apihub.v1.Provisioning + * @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 {Provisioning} RPC service. Useful where requests and/or responses are streamed. + */ + Provisioning.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.apihub.v1.Provisioning|createApiHubInstance}. + * @memberof google.cloud.apihub.v1.Provisioning + * @typedef CreateApiHubInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateApiHubInstance. + * @function createApiHubInstance + * @memberof google.cloud.apihub.v1.Provisioning + * @instance + * @param {google.cloud.apihub.v1.ICreateApiHubInstanceRequest} request CreateApiHubInstanceRequest message or plain object + * @param {google.cloud.apihub.v1.Provisioning.CreateApiHubInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Provisioning.prototype.createApiHubInstance = function createApiHubInstance(request, callback) { + return this.rpcCall(createApiHubInstance, $root.google.cloud.apihub.v1.CreateApiHubInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateApiHubInstance" }); + + /** + * Calls CreateApiHubInstance. + * @function createApiHubInstance + * @memberof google.cloud.apihub.v1.Provisioning + * @instance + * @param {google.cloud.apihub.v1.ICreateApiHubInstanceRequest} request CreateApiHubInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.Provisioning|getApiHubInstance}. + * @memberof google.cloud.apihub.v1.Provisioning + * @typedef GetApiHubInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apihub.v1.ApiHubInstance} [response] ApiHubInstance + */ + + /** + * Calls GetApiHubInstance. + * @function getApiHubInstance + * @memberof google.cloud.apihub.v1.Provisioning + * @instance + * @param {google.cloud.apihub.v1.IGetApiHubInstanceRequest} request GetApiHubInstanceRequest message or plain object + * @param {google.cloud.apihub.v1.Provisioning.GetApiHubInstanceCallback} callback Node-style callback called with the error, if any, and ApiHubInstance + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Provisioning.prototype.getApiHubInstance = function getApiHubInstance(request, callback) { + return this.rpcCall(getApiHubInstance, $root.google.cloud.apihub.v1.GetApiHubInstanceRequest, $root.google.cloud.apihub.v1.ApiHubInstance, request, callback); + }, "name", { value: "GetApiHubInstance" }); + + /** + * Calls GetApiHubInstance. + * @function getApiHubInstance + * @memberof google.cloud.apihub.v1.Provisioning + * @instance + * @param {google.cloud.apihub.v1.IGetApiHubInstanceRequest} request GetApiHubInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.Provisioning|lookupApiHubInstance}. + * @memberof google.cloud.apihub.v1.Provisioning + * @typedef LookupApiHubInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apihub.v1.LookupApiHubInstanceResponse} [response] LookupApiHubInstanceResponse + */ + + /** + * Calls LookupApiHubInstance. + * @function lookupApiHubInstance + * @memberof google.cloud.apihub.v1.Provisioning + * @instance + * @param {google.cloud.apihub.v1.ILookupApiHubInstanceRequest} request LookupApiHubInstanceRequest message or plain object + * @param {google.cloud.apihub.v1.Provisioning.LookupApiHubInstanceCallback} callback Node-style callback called with the error, if any, and LookupApiHubInstanceResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Provisioning.prototype.lookupApiHubInstance = function lookupApiHubInstance(request, callback) { + return this.rpcCall(lookupApiHubInstance, $root.google.cloud.apihub.v1.LookupApiHubInstanceRequest, $root.google.cloud.apihub.v1.LookupApiHubInstanceResponse, request, callback); + }, "name", { value: "LookupApiHubInstance" }); + + /** + * Calls LookupApiHubInstance. + * @function lookupApiHubInstance + * @memberof google.cloud.apihub.v1.Provisioning + * @instance + * @param {google.cloud.apihub.v1.ILookupApiHubInstanceRequest} request LookupApiHubInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Provisioning; + })(); + + v1.CreateApiHubInstanceRequest = (function() { + + /** + * Properties of a CreateApiHubInstanceRequest. + * @memberof google.cloud.apihub.v1 + * @interface ICreateApiHubInstanceRequest + * @property {string|null} [parent] CreateApiHubInstanceRequest parent + * @property {string|null} [apiHubInstanceId] CreateApiHubInstanceRequest apiHubInstanceId + * @property {google.cloud.apihub.v1.IApiHubInstance|null} [apiHubInstance] CreateApiHubInstanceRequest apiHubInstance + */ + + /** + * Constructs a new CreateApiHubInstanceRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a CreateApiHubInstanceRequest. + * @implements ICreateApiHubInstanceRequest + * @constructor + * @param {google.cloud.apihub.v1.ICreateApiHubInstanceRequest=} [properties] Properties to set + */ + function CreateApiHubInstanceRequest(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]]; + } + + /** + * CreateApiHubInstanceRequest parent. + * @member {string} parent + * @memberof google.cloud.apihub.v1.CreateApiHubInstanceRequest + * @instance + */ + CreateApiHubInstanceRequest.prototype.parent = ""; + + /** + * CreateApiHubInstanceRequest apiHubInstanceId. + * @member {string} apiHubInstanceId + * @memberof google.cloud.apihub.v1.CreateApiHubInstanceRequest + * @instance + */ + CreateApiHubInstanceRequest.prototype.apiHubInstanceId = ""; + + /** + * CreateApiHubInstanceRequest apiHubInstance. + * @member {google.cloud.apihub.v1.IApiHubInstance|null|undefined} apiHubInstance + * @memberof google.cloud.apihub.v1.CreateApiHubInstanceRequest + * @instance + */ + CreateApiHubInstanceRequest.prototype.apiHubInstance = null; + + /** + * Creates a new CreateApiHubInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.CreateApiHubInstanceRequest + * @static + * @param {google.cloud.apihub.v1.ICreateApiHubInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.CreateApiHubInstanceRequest} CreateApiHubInstanceRequest instance + */ + CreateApiHubInstanceRequest.create = function create(properties) { + return new CreateApiHubInstanceRequest(properties); + }; + + /** + * Encodes the specified CreateApiHubInstanceRequest message. Does not implicitly {@link google.cloud.apihub.v1.CreateApiHubInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.CreateApiHubInstanceRequest + * @static + * @param {google.cloud.apihub.v1.ICreateApiHubInstanceRequest} message CreateApiHubInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateApiHubInstanceRequest.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.apiHubInstanceId != null && Object.hasOwnProperty.call(message, "apiHubInstanceId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.apiHubInstanceId); + if (message.apiHubInstance != null && Object.hasOwnProperty.call(message, "apiHubInstance")) + $root.google.cloud.apihub.v1.ApiHubInstance.encode(message.apiHubInstance, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateApiHubInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.CreateApiHubInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.CreateApiHubInstanceRequest + * @static + * @param {google.cloud.apihub.v1.ICreateApiHubInstanceRequest} message CreateApiHubInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateApiHubInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateApiHubInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.CreateApiHubInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.CreateApiHubInstanceRequest} CreateApiHubInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateApiHubInstanceRequest.decode = function 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.apihub.v1.CreateApiHubInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.apiHubInstanceId = reader.string(); + break; + } + case 3: { + message.apiHubInstance = $root.google.cloud.apihub.v1.ApiHubInstance.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateApiHubInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.CreateApiHubInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.CreateApiHubInstanceRequest} CreateApiHubInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateApiHubInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateApiHubInstanceRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.CreateApiHubInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateApiHubInstanceRequest.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.apiHubInstanceId != null && message.hasOwnProperty("apiHubInstanceId")) + if (!$util.isString(message.apiHubInstanceId)) + return "apiHubInstanceId: string expected"; + if (message.apiHubInstance != null && message.hasOwnProperty("apiHubInstance")) { + var error = $root.google.cloud.apihub.v1.ApiHubInstance.verify(message.apiHubInstance); + if (error) + return "apiHubInstance." + error; + } + return null; + }; + + /** + * Creates a CreateApiHubInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.CreateApiHubInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.CreateApiHubInstanceRequest} CreateApiHubInstanceRequest + */ + CreateApiHubInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.CreateApiHubInstanceRequest) + return object; + var message = new $root.google.cloud.apihub.v1.CreateApiHubInstanceRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.apiHubInstanceId != null) + message.apiHubInstanceId = String(object.apiHubInstanceId); + if (object.apiHubInstance != null) { + if (typeof object.apiHubInstance !== "object") + throw TypeError(".google.cloud.apihub.v1.CreateApiHubInstanceRequest.apiHubInstance: object expected"); + message.apiHubInstance = $root.google.cloud.apihub.v1.ApiHubInstance.fromObject(object.apiHubInstance); + } + return message; + }; + + /** + * Creates a plain object from a CreateApiHubInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.CreateApiHubInstanceRequest + * @static + * @param {google.cloud.apihub.v1.CreateApiHubInstanceRequest} message CreateApiHubInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateApiHubInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.apiHubInstanceId = ""; + object.apiHubInstance = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.apiHubInstanceId != null && message.hasOwnProperty("apiHubInstanceId")) + object.apiHubInstanceId = message.apiHubInstanceId; + if (message.apiHubInstance != null && message.hasOwnProperty("apiHubInstance")) + object.apiHubInstance = $root.google.cloud.apihub.v1.ApiHubInstance.toObject(message.apiHubInstance, options); + return object; + }; + + /** + * Converts this CreateApiHubInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.CreateApiHubInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + CreateApiHubInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateApiHubInstanceRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.CreateApiHubInstanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateApiHubInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.CreateApiHubInstanceRequest"; + }; + + return CreateApiHubInstanceRequest; + })(); + + v1.GetApiHubInstanceRequest = (function() { + + /** + * Properties of a GetApiHubInstanceRequest. + * @memberof google.cloud.apihub.v1 + * @interface IGetApiHubInstanceRequest + * @property {string|null} [name] GetApiHubInstanceRequest name + */ + + /** + * Constructs a new GetApiHubInstanceRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a GetApiHubInstanceRequest. + * @implements IGetApiHubInstanceRequest + * @constructor + * @param {google.cloud.apihub.v1.IGetApiHubInstanceRequest=} [properties] Properties to set + */ + function GetApiHubInstanceRequest(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]]; + } + + /** + * GetApiHubInstanceRequest name. + * @member {string} name + * @memberof google.cloud.apihub.v1.GetApiHubInstanceRequest + * @instance + */ + GetApiHubInstanceRequest.prototype.name = ""; + + /** + * Creates a new GetApiHubInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.GetApiHubInstanceRequest + * @static + * @param {google.cloud.apihub.v1.IGetApiHubInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.GetApiHubInstanceRequest} GetApiHubInstanceRequest instance + */ + GetApiHubInstanceRequest.create = function create(properties) { + return new GetApiHubInstanceRequest(properties); + }; + + /** + * Encodes the specified GetApiHubInstanceRequest message. Does not implicitly {@link google.cloud.apihub.v1.GetApiHubInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.GetApiHubInstanceRequest + * @static + * @param {google.cloud.apihub.v1.IGetApiHubInstanceRequest} message GetApiHubInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetApiHubInstanceRequest.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 GetApiHubInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.GetApiHubInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.GetApiHubInstanceRequest + * @static + * @param {google.cloud.apihub.v1.IGetApiHubInstanceRequest} message GetApiHubInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetApiHubInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetApiHubInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.GetApiHubInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.GetApiHubInstanceRequest} GetApiHubInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetApiHubInstanceRequest.decode = function 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.apihub.v1.GetApiHubInstanceRequest(); + 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 GetApiHubInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.GetApiHubInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.GetApiHubInstanceRequest} GetApiHubInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetApiHubInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetApiHubInstanceRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.GetApiHubInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetApiHubInstanceRequest.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 GetApiHubInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.GetApiHubInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.GetApiHubInstanceRequest} GetApiHubInstanceRequest + */ + GetApiHubInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.GetApiHubInstanceRequest) + return object; + var message = new $root.google.cloud.apihub.v1.GetApiHubInstanceRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetApiHubInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.GetApiHubInstanceRequest + * @static + * @param {google.cloud.apihub.v1.GetApiHubInstanceRequest} message GetApiHubInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetApiHubInstanceRequest.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 GetApiHubInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.GetApiHubInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + GetApiHubInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetApiHubInstanceRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.GetApiHubInstanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetApiHubInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.GetApiHubInstanceRequest"; + }; + + return GetApiHubInstanceRequest; + })(); + + v1.LookupApiHubInstanceRequest = (function() { + + /** + * Properties of a LookupApiHubInstanceRequest. + * @memberof google.cloud.apihub.v1 + * @interface ILookupApiHubInstanceRequest + * @property {string|null} [parent] LookupApiHubInstanceRequest parent + */ + + /** + * Constructs a new LookupApiHubInstanceRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a LookupApiHubInstanceRequest. + * @implements ILookupApiHubInstanceRequest + * @constructor + * @param {google.cloud.apihub.v1.ILookupApiHubInstanceRequest=} [properties] Properties to set + */ + function LookupApiHubInstanceRequest(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]]; + } + + /** + * LookupApiHubInstanceRequest parent. + * @member {string} parent + * @memberof google.cloud.apihub.v1.LookupApiHubInstanceRequest + * @instance + */ + LookupApiHubInstanceRequest.prototype.parent = ""; + + /** + * Creates a new LookupApiHubInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.LookupApiHubInstanceRequest + * @static + * @param {google.cloud.apihub.v1.ILookupApiHubInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.LookupApiHubInstanceRequest} LookupApiHubInstanceRequest instance + */ + LookupApiHubInstanceRequest.create = function create(properties) { + return new LookupApiHubInstanceRequest(properties); + }; + + /** + * Encodes the specified LookupApiHubInstanceRequest message. Does not implicitly {@link google.cloud.apihub.v1.LookupApiHubInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.LookupApiHubInstanceRequest + * @static + * @param {google.cloud.apihub.v1.ILookupApiHubInstanceRequest} message LookupApiHubInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LookupApiHubInstanceRequest.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); + return writer; + }; + + /** + * Encodes the specified LookupApiHubInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.LookupApiHubInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.LookupApiHubInstanceRequest + * @static + * @param {google.cloud.apihub.v1.ILookupApiHubInstanceRequest} message LookupApiHubInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LookupApiHubInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LookupApiHubInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.LookupApiHubInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.LookupApiHubInstanceRequest} LookupApiHubInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LookupApiHubInstanceRequest.decode = function 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.apihub.v1.LookupApiHubInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LookupApiHubInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.LookupApiHubInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.LookupApiHubInstanceRequest} LookupApiHubInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LookupApiHubInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LookupApiHubInstanceRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.LookupApiHubInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LookupApiHubInstanceRequest.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"; + return null; + }; + + /** + * Creates a LookupApiHubInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.LookupApiHubInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.LookupApiHubInstanceRequest} LookupApiHubInstanceRequest + */ + LookupApiHubInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.LookupApiHubInstanceRequest) + return object; + var message = new $root.google.cloud.apihub.v1.LookupApiHubInstanceRequest(); + if (object.parent != null) + message.parent = String(object.parent); + return message; + }; + + /** + * Creates a plain object from a LookupApiHubInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.LookupApiHubInstanceRequest + * @static + * @param {google.cloud.apihub.v1.LookupApiHubInstanceRequest} message LookupApiHubInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LookupApiHubInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.parent = ""; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + return object; + }; + + /** + * Converts this LookupApiHubInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.LookupApiHubInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + LookupApiHubInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LookupApiHubInstanceRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.LookupApiHubInstanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LookupApiHubInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.LookupApiHubInstanceRequest"; + }; + + return LookupApiHubInstanceRequest; + })(); + + v1.LookupApiHubInstanceResponse = (function() { + + /** + * Properties of a LookupApiHubInstanceResponse. + * @memberof google.cloud.apihub.v1 + * @interface ILookupApiHubInstanceResponse + * @property {google.cloud.apihub.v1.IApiHubInstance|null} [apiHubInstance] LookupApiHubInstanceResponse apiHubInstance + */ + + /** + * Constructs a new LookupApiHubInstanceResponse. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a LookupApiHubInstanceResponse. + * @implements ILookupApiHubInstanceResponse + * @constructor + * @param {google.cloud.apihub.v1.ILookupApiHubInstanceResponse=} [properties] Properties to set + */ + function LookupApiHubInstanceResponse(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]]; + } + + /** + * LookupApiHubInstanceResponse apiHubInstance. + * @member {google.cloud.apihub.v1.IApiHubInstance|null|undefined} apiHubInstance + * @memberof google.cloud.apihub.v1.LookupApiHubInstanceResponse + * @instance + */ + LookupApiHubInstanceResponse.prototype.apiHubInstance = null; + + /** + * Creates a new LookupApiHubInstanceResponse instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.LookupApiHubInstanceResponse + * @static + * @param {google.cloud.apihub.v1.ILookupApiHubInstanceResponse=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.LookupApiHubInstanceResponse} LookupApiHubInstanceResponse instance + */ + LookupApiHubInstanceResponse.create = function create(properties) { + return new LookupApiHubInstanceResponse(properties); + }; + + /** + * Encodes the specified LookupApiHubInstanceResponse message. Does not implicitly {@link google.cloud.apihub.v1.LookupApiHubInstanceResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.LookupApiHubInstanceResponse + * @static + * @param {google.cloud.apihub.v1.ILookupApiHubInstanceResponse} message LookupApiHubInstanceResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LookupApiHubInstanceResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.apiHubInstance != null && Object.hasOwnProperty.call(message, "apiHubInstance")) + $root.google.cloud.apihub.v1.ApiHubInstance.encode(message.apiHubInstance, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LookupApiHubInstanceResponse message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.LookupApiHubInstanceResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.LookupApiHubInstanceResponse + * @static + * @param {google.cloud.apihub.v1.ILookupApiHubInstanceResponse} message LookupApiHubInstanceResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LookupApiHubInstanceResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LookupApiHubInstanceResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.LookupApiHubInstanceResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.LookupApiHubInstanceResponse} LookupApiHubInstanceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LookupApiHubInstanceResponse.decode = function 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.apihub.v1.LookupApiHubInstanceResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.apiHubInstance = $root.google.cloud.apihub.v1.ApiHubInstance.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LookupApiHubInstanceResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.LookupApiHubInstanceResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.LookupApiHubInstanceResponse} LookupApiHubInstanceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LookupApiHubInstanceResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LookupApiHubInstanceResponse message. + * @function verify + * @memberof google.cloud.apihub.v1.LookupApiHubInstanceResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LookupApiHubInstanceResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.apiHubInstance != null && message.hasOwnProperty("apiHubInstance")) { + var error = $root.google.cloud.apihub.v1.ApiHubInstance.verify(message.apiHubInstance); + if (error) + return "apiHubInstance." + error; + } + return null; + }; + + /** + * Creates a LookupApiHubInstanceResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.LookupApiHubInstanceResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.LookupApiHubInstanceResponse} LookupApiHubInstanceResponse + */ + LookupApiHubInstanceResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.LookupApiHubInstanceResponse) + return object; + var message = new $root.google.cloud.apihub.v1.LookupApiHubInstanceResponse(); + if (object.apiHubInstance != null) { + if (typeof object.apiHubInstance !== "object") + throw TypeError(".google.cloud.apihub.v1.LookupApiHubInstanceResponse.apiHubInstance: object expected"); + message.apiHubInstance = $root.google.cloud.apihub.v1.ApiHubInstance.fromObject(object.apiHubInstance); + } + return message; + }; + + /** + * Creates a plain object from a LookupApiHubInstanceResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.LookupApiHubInstanceResponse + * @static + * @param {google.cloud.apihub.v1.LookupApiHubInstanceResponse} message LookupApiHubInstanceResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LookupApiHubInstanceResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.apiHubInstance = null; + if (message.apiHubInstance != null && message.hasOwnProperty("apiHubInstance")) + object.apiHubInstance = $root.google.cloud.apihub.v1.ApiHubInstance.toObject(message.apiHubInstance, options); + return object; + }; + + /** + * Converts this LookupApiHubInstanceResponse to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.LookupApiHubInstanceResponse + * @instance + * @returns {Object.} JSON object + */ + LookupApiHubInstanceResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LookupApiHubInstanceResponse + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.LookupApiHubInstanceResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LookupApiHubInstanceResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.LookupApiHubInstanceResponse"; + }; + + return LookupApiHubInstanceResponse; + })(); + + v1.RuntimeProjectAttachmentService = (function() { + + /** + * Constructs a new RuntimeProjectAttachmentService service. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a RuntimeProjectAttachmentService + * @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 RuntimeProjectAttachmentService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (RuntimeProjectAttachmentService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = RuntimeProjectAttachmentService; + + /** + * Creates new RuntimeProjectAttachmentService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.apihub.v1.RuntimeProjectAttachmentService + * @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 {RuntimeProjectAttachmentService} RPC service. Useful where requests and/or responses are streamed. + */ + RuntimeProjectAttachmentService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.apihub.v1.RuntimeProjectAttachmentService|createRuntimeProjectAttachment}. + * @memberof google.cloud.apihub.v1.RuntimeProjectAttachmentService + * @typedef CreateRuntimeProjectAttachmentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apihub.v1.RuntimeProjectAttachment} [response] RuntimeProjectAttachment + */ + + /** + * Calls CreateRuntimeProjectAttachment. + * @function createRuntimeProjectAttachment + * @memberof google.cloud.apihub.v1.RuntimeProjectAttachmentService + * @instance + * @param {google.cloud.apihub.v1.ICreateRuntimeProjectAttachmentRequest} request CreateRuntimeProjectAttachmentRequest message or plain object + * @param {google.cloud.apihub.v1.RuntimeProjectAttachmentService.CreateRuntimeProjectAttachmentCallback} callback Node-style callback called with the error, if any, and RuntimeProjectAttachment + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RuntimeProjectAttachmentService.prototype.createRuntimeProjectAttachment = function createRuntimeProjectAttachment(request, callback) { + return this.rpcCall(createRuntimeProjectAttachment, $root.google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest, $root.google.cloud.apihub.v1.RuntimeProjectAttachment, request, callback); + }, "name", { value: "CreateRuntimeProjectAttachment" }); + + /** + * Calls CreateRuntimeProjectAttachment. + * @function createRuntimeProjectAttachment + * @memberof google.cloud.apihub.v1.RuntimeProjectAttachmentService + * @instance + * @param {google.cloud.apihub.v1.ICreateRuntimeProjectAttachmentRequest} request CreateRuntimeProjectAttachmentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.RuntimeProjectAttachmentService|getRuntimeProjectAttachment}. + * @memberof google.cloud.apihub.v1.RuntimeProjectAttachmentService + * @typedef GetRuntimeProjectAttachmentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apihub.v1.RuntimeProjectAttachment} [response] RuntimeProjectAttachment + */ + + /** + * Calls GetRuntimeProjectAttachment. + * @function getRuntimeProjectAttachment + * @memberof google.cloud.apihub.v1.RuntimeProjectAttachmentService + * @instance + * @param {google.cloud.apihub.v1.IGetRuntimeProjectAttachmentRequest} request GetRuntimeProjectAttachmentRequest message or plain object + * @param {google.cloud.apihub.v1.RuntimeProjectAttachmentService.GetRuntimeProjectAttachmentCallback} callback Node-style callback called with the error, if any, and RuntimeProjectAttachment + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RuntimeProjectAttachmentService.prototype.getRuntimeProjectAttachment = function getRuntimeProjectAttachment(request, callback) { + return this.rpcCall(getRuntimeProjectAttachment, $root.google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest, $root.google.cloud.apihub.v1.RuntimeProjectAttachment, request, callback); + }, "name", { value: "GetRuntimeProjectAttachment" }); + + /** + * Calls GetRuntimeProjectAttachment. + * @function getRuntimeProjectAttachment + * @memberof google.cloud.apihub.v1.RuntimeProjectAttachmentService + * @instance + * @param {google.cloud.apihub.v1.IGetRuntimeProjectAttachmentRequest} request GetRuntimeProjectAttachmentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.RuntimeProjectAttachmentService|listRuntimeProjectAttachments}. + * @memberof google.cloud.apihub.v1.RuntimeProjectAttachmentService + * @typedef ListRuntimeProjectAttachmentsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse} [response] ListRuntimeProjectAttachmentsResponse + */ + + /** + * Calls ListRuntimeProjectAttachments. + * @function listRuntimeProjectAttachments + * @memberof google.cloud.apihub.v1.RuntimeProjectAttachmentService + * @instance + * @param {google.cloud.apihub.v1.IListRuntimeProjectAttachmentsRequest} request ListRuntimeProjectAttachmentsRequest message or plain object + * @param {google.cloud.apihub.v1.RuntimeProjectAttachmentService.ListRuntimeProjectAttachmentsCallback} callback Node-style callback called with the error, if any, and ListRuntimeProjectAttachmentsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RuntimeProjectAttachmentService.prototype.listRuntimeProjectAttachments = function listRuntimeProjectAttachments(request, callback) { + return this.rpcCall(listRuntimeProjectAttachments, $root.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest, $root.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse, request, callback); + }, "name", { value: "ListRuntimeProjectAttachments" }); + + /** + * Calls ListRuntimeProjectAttachments. + * @function listRuntimeProjectAttachments + * @memberof google.cloud.apihub.v1.RuntimeProjectAttachmentService + * @instance + * @param {google.cloud.apihub.v1.IListRuntimeProjectAttachmentsRequest} request ListRuntimeProjectAttachmentsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.RuntimeProjectAttachmentService|deleteRuntimeProjectAttachment}. + * @memberof google.cloud.apihub.v1.RuntimeProjectAttachmentService + * @typedef DeleteRuntimeProjectAttachmentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteRuntimeProjectAttachment. + * @function deleteRuntimeProjectAttachment + * @memberof google.cloud.apihub.v1.RuntimeProjectAttachmentService + * @instance + * @param {google.cloud.apihub.v1.IDeleteRuntimeProjectAttachmentRequest} request DeleteRuntimeProjectAttachmentRequest message or plain object + * @param {google.cloud.apihub.v1.RuntimeProjectAttachmentService.DeleteRuntimeProjectAttachmentCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RuntimeProjectAttachmentService.prototype.deleteRuntimeProjectAttachment = function deleteRuntimeProjectAttachment(request, callback) { + return this.rpcCall(deleteRuntimeProjectAttachment, $root.google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteRuntimeProjectAttachment" }); + + /** + * Calls DeleteRuntimeProjectAttachment. + * @function deleteRuntimeProjectAttachment + * @memberof google.cloud.apihub.v1.RuntimeProjectAttachmentService + * @instance + * @param {google.cloud.apihub.v1.IDeleteRuntimeProjectAttachmentRequest} request DeleteRuntimeProjectAttachmentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apihub.v1.RuntimeProjectAttachmentService|lookupRuntimeProjectAttachment}. + * @memberof google.cloud.apihub.v1.RuntimeProjectAttachmentService + * @typedef LookupRuntimeProjectAttachmentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse} [response] LookupRuntimeProjectAttachmentResponse + */ + + /** + * Calls LookupRuntimeProjectAttachment. + * @function lookupRuntimeProjectAttachment + * @memberof google.cloud.apihub.v1.RuntimeProjectAttachmentService + * @instance + * @param {google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentRequest} request LookupRuntimeProjectAttachmentRequest message or plain object + * @param {google.cloud.apihub.v1.RuntimeProjectAttachmentService.LookupRuntimeProjectAttachmentCallback} callback Node-style callback called with the error, if any, and LookupRuntimeProjectAttachmentResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RuntimeProjectAttachmentService.prototype.lookupRuntimeProjectAttachment = function lookupRuntimeProjectAttachment(request, callback) { + return this.rpcCall(lookupRuntimeProjectAttachment, $root.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest, $root.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse, request, callback); + }, "name", { value: "LookupRuntimeProjectAttachment" }); + + /** + * Calls LookupRuntimeProjectAttachment. + * @function lookupRuntimeProjectAttachment + * @memberof google.cloud.apihub.v1.RuntimeProjectAttachmentService + * @instance + * @param {google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentRequest} request LookupRuntimeProjectAttachmentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return RuntimeProjectAttachmentService; + })(); + + v1.CreateRuntimeProjectAttachmentRequest = (function() { + + /** + * Properties of a CreateRuntimeProjectAttachmentRequest. + * @memberof google.cloud.apihub.v1 + * @interface ICreateRuntimeProjectAttachmentRequest + * @property {string|null} [parent] CreateRuntimeProjectAttachmentRequest parent + * @property {string|null} [runtimeProjectAttachmentId] CreateRuntimeProjectAttachmentRequest runtimeProjectAttachmentId + * @property {google.cloud.apihub.v1.IRuntimeProjectAttachment|null} [runtimeProjectAttachment] CreateRuntimeProjectAttachmentRequest runtimeProjectAttachment + */ + + /** + * Constructs a new CreateRuntimeProjectAttachmentRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a CreateRuntimeProjectAttachmentRequest. + * @implements ICreateRuntimeProjectAttachmentRequest + * @constructor + * @param {google.cloud.apihub.v1.ICreateRuntimeProjectAttachmentRequest=} [properties] Properties to set + */ + function CreateRuntimeProjectAttachmentRequest(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]]; + } + + /** + * CreateRuntimeProjectAttachmentRequest parent. + * @member {string} parent + * @memberof google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest + * @instance + */ + CreateRuntimeProjectAttachmentRequest.prototype.parent = ""; + + /** + * CreateRuntimeProjectAttachmentRequest runtimeProjectAttachmentId. + * @member {string} runtimeProjectAttachmentId + * @memberof google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest + * @instance + */ + CreateRuntimeProjectAttachmentRequest.prototype.runtimeProjectAttachmentId = ""; + + /** + * CreateRuntimeProjectAttachmentRequest runtimeProjectAttachment. + * @member {google.cloud.apihub.v1.IRuntimeProjectAttachment|null|undefined} runtimeProjectAttachment + * @memberof google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest + * @instance + */ + CreateRuntimeProjectAttachmentRequest.prototype.runtimeProjectAttachment = null; + + /** + * Creates a new CreateRuntimeProjectAttachmentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest + * @static + * @param {google.cloud.apihub.v1.ICreateRuntimeProjectAttachmentRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest} CreateRuntimeProjectAttachmentRequest instance + */ + CreateRuntimeProjectAttachmentRequest.create = function create(properties) { + return new CreateRuntimeProjectAttachmentRequest(properties); + }; + + /** + * Encodes the specified CreateRuntimeProjectAttachmentRequest message. Does not implicitly {@link google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest + * @static + * @param {google.cloud.apihub.v1.ICreateRuntimeProjectAttachmentRequest} message CreateRuntimeProjectAttachmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateRuntimeProjectAttachmentRequest.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.runtimeProjectAttachmentId != null && Object.hasOwnProperty.call(message, "runtimeProjectAttachmentId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.runtimeProjectAttachmentId); + if (message.runtimeProjectAttachment != null && Object.hasOwnProperty.call(message, "runtimeProjectAttachment")) + $root.google.cloud.apihub.v1.RuntimeProjectAttachment.encode(message.runtimeProjectAttachment, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateRuntimeProjectAttachmentRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest + * @static + * @param {google.cloud.apihub.v1.ICreateRuntimeProjectAttachmentRequest} message CreateRuntimeProjectAttachmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateRuntimeProjectAttachmentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateRuntimeProjectAttachmentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest} CreateRuntimeProjectAttachmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateRuntimeProjectAttachmentRequest.decode = function 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.apihub.v1.CreateRuntimeProjectAttachmentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.runtimeProjectAttachmentId = reader.string(); + break; + } + case 3: { + message.runtimeProjectAttachment = $root.google.cloud.apihub.v1.RuntimeProjectAttachment.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateRuntimeProjectAttachmentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest} CreateRuntimeProjectAttachmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateRuntimeProjectAttachmentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateRuntimeProjectAttachmentRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateRuntimeProjectAttachmentRequest.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.runtimeProjectAttachmentId != null && message.hasOwnProperty("runtimeProjectAttachmentId")) + if (!$util.isString(message.runtimeProjectAttachmentId)) + return "runtimeProjectAttachmentId: string expected"; + if (message.runtimeProjectAttachment != null && message.hasOwnProperty("runtimeProjectAttachment")) { + var error = $root.google.cloud.apihub.v1.RuntimeProjectAttachment.verify(message.runtimeProjectAttachment); + if (error) + return "runtimeProjectAttachment." + error; + } + return null; + }; + + /** + * Creates a CreateRuntimeProjectAttachmentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest} CreateRuntimeProjectAttachmentRequest + */ + CreateRuntimeProjectAttachmentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest) + return object; + var message = new $root.google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.runtimeProjectAttachmentId != null) + message.runtimeProjectAttachmentId = String(object.runtimeProjectAttachmentId); + if (object.runtimeProjectAttachment != null) { + if (typeof object.runtimeProjectAttachment !== "object") + throw TypeError(".google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest.runtimeProjectAttachment: object expected"); + message.runtimeProjectAttachment = $root.google.cloud.apihub.v1.RuntimeProjectAttachment.fromObject(object.runtimeProjectAttachment); + } + return message; + }; + + /** + * Creates a plain object from a CreateRuntimeProjectAttachmentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest + * @static + * @param {google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest} message CreateRuntimeProjectAttachmentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateRuntimeProjectAttachmentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.runtimeProjectAttachmentId = ""; + object.runtimeProjectAttachment = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.runtimeProjectAttachmentId != null && message.hasOwnProperty("runtimeProjectAttachmentId")) + object.runtimeProjectAttachmentId = message.runtimeProjectAttachmentId; + if (message.runtimeProjectAttachment != null && message.hasOwnProperty("runtimeProjectAttachment")) + object.runtimeProjectAttachment = $root.google.cloud.apihub.v1.RuntimeProjectAttachment.toObject(message.runtimeProjectAttachment, options); + return object; + }; + + /** + * Converts this CreateRuntimeProjectAttachmentRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest + * @instance + * @returns {Object.} JSON object + */ + CreateRuntimeProjectAttachmentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateRuntimeProjectAttachmentRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateRuntimeProjectAttachmentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest"; + }; + + return CreateRuntimeProjectAttachmentRequest; + })(); + + v1.GetRuntimeProjectAttachmentRequest = (function() { + + /** + * Properties of a GetRuntimeProjectAttachmentRequest. + * @memberof google.cloud.apihub.v1 + * @interface IGetRuntimeProjectAttachmentRequest + * @property {string|null} [name] GetRuntimeProjectAttachmentRequest name + */ + + /** + * Constructs a new GetRuntimeProjectAttachmentRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a GetRuntimeProjectAttachmentRequest. + * @implements IGetRuntimeProjectAttachmentRequest + * @constructor + * @param {google.cloud.apihub.v1.IGetRuntimeProjectAttachmentRequest=} [properties] Properties to set + */ + function GetRuntimeProjectAttachmentRequest(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]]; + } + + /** + * GetRuntimeProjectAttachmentRequest name. + * @member {string} name + * @memberof google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest + * @instance + */ + GetRuntimeProjectAttachmentRequest.prototype.name = ""; + + /** + * Creates a new GetRuntimeProjectAttachmentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest + * @static + * @param {google.cloud.apihub.v1.IGetRuntimeProjectAttachmentRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest} GetRuntimeProjectAttachmentRequest instance + */ + GetRuntimeProjectAttachmentRequest.create = function create(properties) { + return new GetRuntimeProjectAttachmentRequest(properties); + }; + + /** + * Encodes the specified GetRuntimeProjectAttachmentRequest message. Does not implicitly {@link google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest + * @static + * @param {google.cloud.apihub.v1.IGetRuntimeProjectAttachmentRequest} message GetRuntimeProjectAttachmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetRuntimeProjectAttachmentRequest.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 GetRuntimeProjectAttachmentRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest + * @static + * @param {google.cloud.apihub.v1.IGetRuntimeProjectAttachmentRequest} message GetRuntimeProjectAttachmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetRuntimeProjectAttachmentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetRuntimeProjectAttachmentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest} GetRuntimeProjectAttachmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetRuntimeProjectAttachmentRequest.decode = function 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.apihub.v1.GetRuntimeProjectAttachmentRequest(); + 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 GetRuntimeProjectAttachmentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest} GetRuntimeProjectAttachmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetRuntimeProjectAttachmentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetRuntimeProjectAttachmentRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetRuntimeProjectAttachmentRequest.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 GetRuntimeProjectAttachmentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest} GetRuntimeProjectAttachmentRequest + */ + GetRuntimeProjectAttachmentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest) + return object; + var message = new $root.google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetRuntimeProjectAttachmentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest + * @static + * @param {google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest} message GetRuntimeProjectAttachmentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetRuntimeProjectAttachmentRequest.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 GetRuntimeProjectAttachmentRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest + * @instance + * @returns {Object.} JSON object + */ + GetRuntimeProjectAttachmentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetRuntimeProjectAttachmentRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetRuntimeProjectAttachmentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest"; + }; + + return GetRuntimeProjectAttachmentRequest; + })(); + + v1.ListRuntimeProjectAttachmentsRequest = (function() { + + /** + * Properties of a ListRuntimeProjectAttachmentsRequest. + * @memberof google.cloud.apihub.v1 + * @interface IListRuntimeProjectAttachmentsRequest + * @property {string|null} [parent] ListRuntimeProjectAttachmentsRequest parent + * @property {number|null} [pageSize] ListRuntimeProjectAttachmentsRequest pageSize + * @property {string|null} [pageToken] ListRuntimeProjectAttachmentsRequest pageToken + * @property {string|null} [filter] ListRuntimeProjectAttachmentsRequest filter + * @property {string|null} [orderBy] ListRuntimeProjectAttachmentsRequest orderBy + */ + + /** + * Constructs a new ListRuntimeProjectAttachmentsRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a ListRuntimeProjectAttachmentsRequest. + * @implements IListRuntimeProjectAttachmentsRequest + * @constructor + * @param {google.cloud.apihub.v1.IListRuntimeProjectAttachmentsRequest=} [properties] Properties to set + */ + function ListRuntimeProjectAttachmentsRequest(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]]; + } + + /** + * ListRuntimeProjectAttachmentsRequest parent. + * @member {string} parent + * @memberof google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest + * @instance + */ + ListRuntimeProjectAttachmentsRequest.prototype.parent = ""; + + /** + * ListRuntimeProjectAttachmentsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest + * @instance + */ + ListRuntimeProjectAttachmentsRequest.prototype.pageSize = 0; + + /** + * ListRuntimeProjectAttachmentsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest + * @instance + */ + ListRuntimeProjectAttachmentsRequest.prototype.pageToken = ""; + + /** + * ListRuntimeProjectAttachmentsRequest filter. + * @member {string} filter + * @memberof google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest + * @instance + */ + ListRuntimeProjectAttachmentsRequest.prototype.filter = ""; + + /** + * ListRuntimeProjectAttachmentsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest + * @instance + */ + ListRuntimeProjectAttachmentsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListRuntimeProjectAttachmentsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest + * @static + * @param {google.cloud.apihub.v1.IListRuntimeProjectAttachmentsRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest} ListRuntimeProjectAttachmentsRequest instance + */ + ListRuntimeProjectAttachmentsRequest.create = function create(properties) { + return new ListRuntimeProjectAttachmentsRequest(properties); + }; + + /** + * Encodes the specified ListRuntimeProjectAttachmentsRequest message. Does not implicitly {@link google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest + * @static + * @param {google.cloud.apihub.v1.IListRuntimeProjectAttachmentsRequest} message ListRuntimeProjectAttachmentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRuntimeProjectAttachmentsRequest.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); + return writer; + }; + + /** + * Encodes the specified ListRuntimeProjectAttachmentsRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest + * @static + * @param {google.cloud.apihub.v1.IListRuntimeProjectAttachmentsRequest} message ListRuntimeProjectAttachmentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRuntimeProjectAttachmentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListRuntimeProjectAttachmentsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest} ListRuntimeProjectAttachmentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRuntimeProjectAttachmentsRequest.decode = function 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.apihub.v1.ListRuntimeProjectAttachmentsRequest(); + 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; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListRuntimeProjectAttachmentsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest} ListRuntimeProjectAttachmentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRuntimeProjectAttachmentsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListRuntimeProjectAttachmentsRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListRuntimeProjectAttachmentsRequest.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"; + return null; + }; + + /** + * Creates a ListRuntimeProjectAttachmentsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest} ListRuntimeProjectAttachmentsRequest + */ + ListRuntimeProjectAttachmentsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest) + return object; + var message = new $root.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest(); + 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); + return message; + }; + + /** + * Creates a plain object from a ListRuntimeProjectAttachmentsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest + * @static + * @param {google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest} message ListRuntimeProjectAttachmentsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListRuntimeProjectAttachmentsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + 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; + return object; + }; + + /** + * Converts this ListRuntimeProjectAttachmentsRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest + * @instance + * @returns {Object.} JSON object + */ + ListRuntimeProjectAttachmentsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListRuntimeProjectAttachmentsRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListRuntimeProjectAttachmentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest"; + }; + + return ListRuntimeProjectAttachmentsRequest; + })(); + + v1.ListRuntimeProjectAttachmentsResponse = (function() { + + /** + * Properties of a ListRuntimeProjectAttachmentsResponse. + * @memberof google.cloud.apihub.v1 + * @interface IListRuntimeProjectAttachmentsResponse + * @property {Array.|null} [runtimeProjectAttachments] ListRuntimeProjectAttachmentsResponse runtimeProjectAttachments + * @property {string|null} [nextPageToken] ListRuntimeProjectAttachmentsResponse nextPageToken + */ + + /** + * Constructs a new ListRuntimeProjectAttachmentsResponse. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a ListRuntimeProjectAttachmentsResponse. + * @implements IListRuntimeProjectAttachmentsResponse + * @constructor + * @param {google.cloud.apihub.v1.IListRuntimeProjectAttachmentsResponse=} [properties] Properties to set + */ + function ListRuntimeProjectAttachmentsResponse(properties) { + this.runtimeProjectAttachments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListRuntimeProjectAttachmentsResponse runtimeProjectAttachments. + * @member {Array.} runtimeProjectAttachments + * @memberof google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse + * @instance + */ + ListRuntimeProjectAttachmentsResponse.prototype.runtimeProjectAttachments = $util.emptyArray; + + /** + * ListRuntimeProjectAttachmentsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse + * @instance + */ + ListRuntimeProjectAttachmentsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListRuntimeProjectAttachmentsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse + * @static + * @param {google.cloud.apihub.v1.IListRuntimeProjectAttachmentsResponse=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse} ListRuntimeProjectAttachmentsResponse instance + */ + ListRuntimeProjectAttachmentsResponse.create = function create(properties) { + return new ListRuntimeProjectAttachmentsResponse(properties); + }; + + /** + * Encodes the specified ListRuntimeProjectAttachmentsResponse message. Does not implicitly {@link google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse + * @static + * @param {google.cloud.apihub.v1.IListRuntimeProjectAttachmentsResponse} message ListRuntimeProjectAttachmentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRuntimeProjectAttachmentsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.runtimeProjectAttachments != null && message.runtimeProjectAttachments.length) + for (var i = 0; i < message.runtimeProjectAttachments.length; ++i) + $root.google.cloud.apihub.v1.RuntimeProjectAttachment.encode(message.runtimeProjectAttachments[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 ListRuntimeProjectAttachmentsResponse message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse + * @static + * @param {google.cloud.apihub.v1.IListRuntimeProjectAttachmentsResponse} message ListRuntimeProjectAttachmentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRuntimeProjectAttachmentsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListRuntimeProjectAttachmentsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse} ListRuntimeProjectAttachmentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRuntimeProjectAttachmentsResponse.decode = function 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.apihub.v1.ListRuntimeProjectAttachmentsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.runtimeProjectAttachments && message.runtimeProjectAttachments.length)) + message.runtimeProjectAttachments = []; + message.runtimeProjectAttachments.push($root.google.cloud.apihub.v1.RuntimeProjectAttachment.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListRuntimeProjectAttachmentsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse} ListRuntimeProjectAttachmentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRuntimeProjectAttachmentsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListRuntimeProjectAttachmentsResponse message. + * @function verify + * @memberof google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListRuntimeProjectAttachmentsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.runtimeProjectAttachments != null && message.hasOwnProperty("runtimeProjectAttachments")) { + if (!Array.isArray(message.runtimeProjectAttachments)) + return "runtimeProjectAttachments: array expected"; + for (var i = 0; i < message.runtimeProjectAttachments.length; ++i) { + var error = $root.google.cloud.apihub.v1.RuntimeProjectAttachment.verify(message.runtimeProjectAttachments[i]); + if (error) + return "runtimeProjectAttachments." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListRuntimeProjectAttachmentsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse} ListRuntimeProjectAttachmentsResponse + */ + ListRuntimeProjectAttachmentsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse) + return object; + var message = new $root.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse(); + if (object.runtimeProjectAttachments) { + if (!Array.isArray(object.runtimeProjectAttachments)) + throw TypeError(".google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse.runtimeProjectAttachments: array expected"); + message.runtimeProjectAttachments = []; + for (var i = 0; i < object.runtimeProjectAttachments.length; ++i) { + if (typeof object.runtimeProjectAttachments[i] !== "object") + throw TypeError(".google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse.runtimeProjectAttachments: object expected"); + message.runtimeProjectAttachments[i] = $root.google.cloud.apihub.v1.RuntimeProjectAttachment.fromObject(object.runtimeProjectAttachments[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListRuntimeProjectAttachmentsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse + * @static + * @param {google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse} message ListRuntimeProjectAttachmentsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListRuntimeProjectAttachmentsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.runtimeProjectAttachments = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.runtimeProjectAttachments && message.runtimeProjectAttachments.length) { + object.runtimeProjectAttachments = []; + for (var j = 0; j < message.runtimeProjectAttachments.length; ++j) + object.runtimeProjectAttachments[j] = $root.google.cloud.apihub.v1.RuntimeProjectAttachment.toObject(message.runtimeProjectAttachments[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListRuntimeProjectAttachmentsResponse to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse + * @instance + * @returns {Object.} JSON object + */ + ListRuntimeProjectAttachmentsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListRuntimeProjectAttachmentsResponse + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListRuntimeProjectAttachmentsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse"; + }; + + return ListRuntimeProjectAttachmentsResponse; + })(); + + v1.DeleteRuntimeProjectAttachmentRequest = (function() { + + /** + * Properties of a DeleteRuntimeProjectAttachmentRequest. + * @memberof google.cloud.apihub.v1 + * @interface IDeleteRuntimeProjectAttachmentRequest + * @property {string|null} [name] DeleteRuntimeProjectAttachmentRequest name + */ + + /** + * Constructs a new DeleteRuntimeProjectAttachmentRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a DeleteRuntimeProjectAttachmentRequest. + * @implements IDeleteRuntimeProjectAttachmentRequest + * @constructor + * @param {google.cloud.apihub.v1.IDeleteRuntimeProjectAttachmentRequest=} [properties] Properties to set + */ + function DeleteRuntimeProjectAttachmentRequest(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]]; + } + + /** + * DeleteRuntimeProjectAttachmentRequest name. + * @member {string} name + * @memberof google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest + * @instance + */ + DeleteRuntimeProjectAttachmentRequest.prototype.name = ""; + + /** + * Creates a new DeleteRuntimeProjectAttachmentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest + * @static + * @param {google.cloud.apihub.v1.IDeleteRuntimeProjectAttachmentRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest} DeleteRuntimeProjectAttachmentRequest instance + */ + DeleteRuntimeProjectAttachmentRequest.create = function create(properties) { + return new DeleteRuntimeProjectAttachmentRequest(properties); + }; + + /** + * Encodes the specified DeleteRuntimeProjectAttachmentRequest message. Does not implicitly {@link google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest + * @static + * @param {google.cloud.apihub.v1.IDeleteRuntimeProjectAttachmentRequest} message DeleteRuntimeProjectAttachmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteRuntimeProjectAttachmentRequest.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 DeleteRuntimeProjectAttachmentRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest + * @static + * @param {google.cloud.apihub.v1.IDeleteRuntimeProjectAttachmentRequest} message DeleteRuntimeProjectAttachmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteRuntimeProjectAttachmentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteRuntimeProjectAttachmentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest} DeleteRuntimeProjectAttachmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteRuntimeProjectAttachmentRequest.decode = function 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.apihub.v1.DeleteRuntimeProjectAttachmentRequest(); + 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 DeleteRuntimeProjectAttachmentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest} DeleteRuntimeProjectAttachmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteRuntimeProjectAttachmentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteRuntimeProjectAttachmentRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteRuntimeProjectAttachmentRequest.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 DeleteRuntimeProjectAttachmentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest} DeleteRuntimeProjectAttachmentRequest + */ + DeleteRuntimeProjectAttachmentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest) + return object; + var message = new $root.google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteRuntimeProjectAttachmentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest + * @static + * @param {google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest} message DeleteRuntimeProjectAttachmentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteRuntimeProjectAttachmentRequest.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 DeleteRuntimeProjectAttachmentRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteRuntimeProjectAttachmentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteRuntimeProjectAttachmentRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteRuntimeProjectAttachmentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest"; + }; + + return DeleteRuntimeProjectAttachmentRequest; + })(); + + v1.LookupRuntimeProjectAttachmentRequest = (function() { + + /** + * Properties of a LookupRuntimeProjectAttachmentRequest. + * @memberof google.cloud.apihub.v1 + * @interface ILookupRuntimeProjectAttachmentRequest + * @property {string|null} [name] LookupRuntimeProjectAttachmentRequest name + */ + + /** + * Constructs a new LookupRuntimeProjectAttachmentRequest. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a LookupRuntimeProjectAttachmentRequest. + * @implements ILookupRuntimeProjectAttachmentRequest + * @constructor + * @param {google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentRequest=} [properties] Properties to set + */ + function LookupRuntimeProjectAttachmentRequest(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]]; + } + + /** + * LookupRuntimeProjectAttachmentRequest name. + * @member {string} name + * @memberof google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest + * @instance + */ + LookupRuntimeProjectAttachmentRequest.prototype.name = ""; + + /** + * Creates a new LookupRuntimeProjectAttachmentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest + * @static + * @param {google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentRequest=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest} LookupRuntimeProjectAttachmentRequest instance + */ + LookupRuntimeProjectAttachmentRequest.create = function create(properties) { + return new LookupRuntimeProjectAttachmentRequest(properties); + }; + + /** + * Encodes the specified LookupRuntimeProjectAttachmentRequest message. Does not implicitly {@link google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest + * @static + * @param {google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentRequest} message LookupRuntimeProjectAttachmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LookupRuntimeProjectAttachmentRequest.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 LookupRuntimeProjectAttachmentRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest + * @static + * @param {google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentRequest} message LookupRuntimeProjectAttachmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LookupRuntimeProjectAttachmentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LookupRuntimeProjectAttachmentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest} LookupRuntimeProjectAttachmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LookupRuntimeProjectAttachmentRequest.decode = function 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.apihub.v1.LookupRuntimeProjectAttachmentRequest(); + 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 LookupRuntimeProjectAttachmentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest} LookupRuntimeProjectAttachmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LookupRuntimeProjectAttachmentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LookupRuntimeProjectAttachmentRequest message. + * @function verify + * @memberof google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LookupRuntimeProjectAttachmentRequest.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 LookupRuntimeProjectAttachmentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest} LookupRuntimeProjectAttachmentRequest + */ + LookupRuntimeProjectAttachmentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest) + return object; + var message = new $root.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a LookupRuntimeProjectAttachmentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest + * @static + * @param {google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest} message LookupRuntimeProjectAttachmentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LookupRuntimeProjectAttachmentRequest.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 LookupRuntimeProjectAttachmentRequest to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest + * @instance + * @returns {Object.} JSON object + */ + LookupRuntimeProjectAttachmentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LookupRuntimeProjectAttachmentRequest + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LookupRuntimeProjectAttachmentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest"; + }; + + return LookupRuntimeProjectAttachmentRequest; + })(); + + v1.LookupRuntimeProjectAttachmentResponse = (function() { + + /** + * Properties of a LookupRuntimeProjectAttachmentResponse. + * @memberof google.cloud.apihub.v1 + * @interface ILookupRuntimeProjectAttachmentResponse + * @property {google.cloud.apihub.v1.IRuntimeProjectAttachment|null} [runtimeProjectAttachment] LookupRuntimeProjectAttachmentResponse runtimeProjectAttachment + */ + + /** + * Constructs a new LookupRuntimeProjectAttachmentResponse. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a LookupRuntimeProjectAttachmentResponse. + * @implements ILookupRuntimeProjectAttachmentResponse + * @constructor + * @param {google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentResponse=} [properties] Properties to set + */ + function LookupRuntimeProjectAttachmentResponse(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]]; + } + + /** + * LookupRuntimeProjectAttachmentResponse runtimeProjectAttachment. + * @member {google.cloud.apihub.v1.IRuntimeProjectAttachment|null|undefined} runtimeProjectAttachment + * @memberof google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse + * @instance + */ + LookupRuntimeProjectAttachmentResponse.prototype.runtimeProjectAttachment = null; + + /** + * Creates a new LookupRuntimeProjectAttachmentResponse instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse + * @static + * @param {google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentResponse=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse} LookupRuntimeProjectAttachmentResponse instance + */ + LookupRuntimeProjectAttachmentResponse.create = function create(properties) { + return new LookupRuntimeProjectAttachmentResponse(properties); + }; + + /** + * Encodes the specified LookupRuntimeProjectAttachmentResponse message. Does not implicitly {@link google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse + * @static + * @param {google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentResponse} message LookupRuntimeProjectAttachmentResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LookupRuntimeProjectAttachmentResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.runtimeProjectAttachment != null && Object.hasOwnProperty.call(message, "runtimeProjectAttachment")) + $root.google.cloud.apihub.v1.RuntimeProjectAttachment.encode(message.runtimeProjectAttachment, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LookupRuntimeProjectAttachmentResponse message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse + * @static + * @param {google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentResponse} message LookupRuntimeProjectAttachmentResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LookupRuntimeProjectAttachmentResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LookupRuntimeProjectAttachmentResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse} LookupRuntimeProjectAttachmentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LookupRuntimeProjectAttachmentResponse.decode = function 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.apihub.v1.LookupRuntimeProjectAttachmentResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.runtimeProjectAttachment = $root.google.cloud.apihub.v1.RuntimeProjectAttachment.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LookupRuntimeProjectAttachmentResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse} LookupRuntimeProjectAttachmentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LookupRuntimeProjectAttachmentResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LookupRuntimeProjectAttachmentResponse message. + * @function verify + * @memberof google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LookupRuntimeProjectAttachmentResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.runtimeProjectAttachment != null && message.hasOwnProperty("runtimeProjectAttachment")) { + var error = $root.google.cloud.apihub.v1.RuntimeProjectAttachment.verify(message.runtimeProjectAttachment); + if (error) + return "runtimeProjectAttachment." + error; + } + return null; + }; + + /** + * Creates a LookupRuntimeProjectAttachmentResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse} LookupRuntimeProjectAttachmentResponse + */ + LookupRuntimeProjectAttachmentResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse) + return object; + var message = new $root.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse(); + if (object.runtimeProjectAttachment != null) { + if (typeof object.runtimeProjectAttachment !== "object") + throw TypeError(".google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse.runtimeProjectAttachment: object expected"); + message.runtimeProjectAttachment = $root.google.cloud.apihub.v1.RuntimeProjectAttachment.fromObject(object.runtimeProjectAttachment); + } + return message; + }; + + /** + * Creates a plain object from a LookupRuntimeProjectAttachmentResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse + * @static + * @param {google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse} message LookupRuntimeProjectAttachmentResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LookupRuntimeProjectAttachmentResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.runtimeProjectAttachment = null; + if (message.runtimeProjectAttachment != null && message.hasOwnProperty("runtimeProjectAttachment")) + object.runtimeProjectAttachment = $root.google.cloud.apihub.v1.RuntimeProjectAttachment.toObject(message.runtimeProjectAttachment, options); + return object; + }; + + /** + * Converts this LookupRuntimeProjectAttachmentResponse to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse + * @instance + * @returns {Object.} JSON object + */ + LookupRuntimeProjectAttachmentResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LookupRuntimeProjectAttachmentResponse + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LookupRuntimeProjectAttachmentResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse"; + }; + + return LookupRuntimeProjectAttachmentResponse; + })(); + + v1.RuntimeProjectAttachment = (function() { + + /** + * Properties of a RuntimeProjectAttachment. + * @memberof google.cloud.apihub.v1 + * @interface IRuntimeProjectAttachment + * @property {string|null} [name] RuntimeProjectAttachment name + * @property {string|null} [runtimeProject] RuntimeProjectAttachment runtimeProject + * @property {google.protobuf.ITimestamp|null} [createTime] RuntimeProjectAttachment createTime + */ + + /** + * Constructs a new RuntimeProjectAttachment. + * @memberof google.cloud.apihub.v1 + * @classdesc Represents a RuntimeProjectAttachment. + * @implements IRuntimeProjectAttachment + * @constructor + * @param {google.cloud.apihub.v1.IRuntimeProjectAttachment=} [properties] Properties to set + */ + function RuntimeProjectAttachment(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]]; + } + + /** + * RuntimeProjectAttachment name. + * @member {string} name + * @memberof google.cloud.apihub.v1.RuntimeProjectAttachment + * @instance + */ + RuntimeProjectAttachment.prototype.name = ""; + + /** + * RuntimeProjectAttachment runtimeProject. + * @member {string} runtimeProject + * @memberof google.cloud.apihub.v1.RuntimeProjectAttachment + * @instance + */ + RuntimeProjectAttachment.prototype.runtimeProject = ""; + + /** + * RuntimeProjectAttachment createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.apihub.v1.RuntimeProjectAttachment + * @instance + */ + RuntimeProjectAttachment.prototype.createTime = null; + + /** + * Creates a new RuntimeProjectAttachment instance using the specified properties. + * @function create + * @memberof google.cloud.apihub.v1.RuntimeProjectAttachment + * @static + * @param {google.cloud.apihub.v1.IRuntimeProjectAttachment=} [properties] Properties to set + * @returns {google.cloud.apihub.v1.RuntimeProjectAttachment} RuntimeProjectAttachment instance + */ + RuntimeProjectAttachment.create = function create(properties) { + return new RuntimeProjectAttachment(properties); + }; + + /** + * Encodes the specified RuntimeProjectAttachment message. Does not implicitly {@link google.cloud.apihub.v1.RuntimeProjectAttachment.verify|verify} messages. + * @function encode + * @memberof google.cloud.apihub.v1.RuntimeProjectAttachment + * @static + * @param {google.cloud.apihub.v1.IRuntimeProjectAttachment} message RuntimeProjectAttachment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RuntimeProjectAttachment.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.runtimeProject != null && Object.hasOwnProperty.call(message, "runtimeProject")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.runtimeProject); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RuntimeProjectAttachment message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.RuntimeProjectAttachment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apihub.v1.RuntimeProjectAttachment + * @static + * @param {google.cloud.apihub.v1.IRuntimeProjectAttachment} message RuntimeProjectAttachment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RuntimeProjectAttachment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RuntimeProjectAttachment message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apihub.v1.RuntimeProjectAttachment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apihub.v1.RuntimeProjectAttachment} RuntimeProjectAttachment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RuntimeProjectAttachment.decode = function 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.apihub.v1.RuntimeProjectAttachment(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.runtimeProject = reader.string(); + break; + } + case 3: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RuntimeProjectAttachment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apihub.v1.RuntimeProjectAttachment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apihub.v1.RuntimeProjectAttachment} RuntimeProjectAttachment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RuntimeProjectAttachment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RuntimeProjectAttachment message. + * @function verify + * @memberof google.cloud.apihub.v1.RuntimeProjectAttachment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RuntimeProjectAttachment.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.runtimeProject != null && message.hasOwnProperty("runtimeProject")) + if (!$util.isString(message.runtimeProject)) + return "runtimeProject: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + return null; + }; + + /** + * Creates a RuntimeProjectAttachment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apihub.v1.RuntimeProjectAttachment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apihub.v1.RuntimeProjectAttachment} RuntimeProjectAttachment + */ + RuntimeProjectAttachment.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apihub.v1.RuntimeProjectAttachment) + return object; + var message = new $root.google.cloud.apihub.v1.RuntimeProjectAttachment(); + if (object.name != null) + message.name = String(object.name); + if (object.runtimeProject != null) + message.runtimeProject = String(object.runtimeProject); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.apihub.v1.RuntimeProjectAttachment.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + return message; + }; + + /** + * Creates a plain object from a RuntimeProjectAttachment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apihub.v1.RuntimeProjectAttachment + * @static + * @param {google.cloud.apihub.v1.RuntimeProjectAttachment} message RuntimeProjectAttachment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RuntimeProjectAttachment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.runtimeProject = ""; + object.createTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.runtimeProject != null && message.hasOwnProperty("runtimeProject")) + object.runtimeProject = message.runtimeProject; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + return object; + }; + + /** + * Converts this RuntimeProjectAttachment to JSON. + * @function toJSON + * @memberof google.cloud.apihub.v1.RuntimeProjectAttachment + * @instance + * @returns {Object.} JSON object + */ + RuntimeProjectAttachment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RuntimeProjectAttachment + * @function getTypeUrl + * @memberof google.cloud.apihub.v1.RuntimeProjectAttachment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RuntimeProjectAttachment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apihub.v1.RuntimeProjectAttachment"; + }; + + return RuntimeProjectAttachment; + })(); + + return v1; + })(); + + return apihub; + })(); + + return cloud; + })(); + + google.api = (function() { + + /** + * Namespace api. + * @memberof google + * @namespace + */ + var api = {}; + + api.Http = (function() { + + /** + * Properties of a Http. + * @memberof google.api + * @interface IHttp + * @property {Array.|null} [rules] Http rules + * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion + */ + + /** + * Constructs a new Http. + * @memberof google.api + * @classdesc Represents a Http. + * @implements IHttp + * @constructor + * @param {google.api.IHttp=} [properties] Properties to set + */ + function Http(properties) { + this.rules = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Http rules. + * @member {Array.} rules + * @memberof google.api.Http + * @instance + */ + Http.prototype.rules = $util.emptyArray; + + /** + * Http fullyDecodeReservedExpansion. + * @member {boolean} fullyDecodeReservedExpansion + * @memberof google.api.Http + * @instance + */ + Http.prototype.fullyDecodeReservedExpansion = false; + + /** + * Creates a new Http instance using the specified properties. + * @function create + * @memberof google.api.Http + * @static + * @param {google.api.IHttp=} [properties] Properties to set + * @returns {google.api.Http} Http instance + */ + Http.create = function create(properties) { + return new Http(properties); + }; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encode + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rules != null && message.rules.length) + for (var i = 0; i < message.rules.length; ++i) + $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); + return writer; + }; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Http message from the specified reader or buffer. + * @function decode + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } + case 2: { + message.fullyDecodeReservedExpansion = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Http message. + * @function verify + * @memberof google.api.Http + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Http.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rules != null && message.hasOwnProperty("rules")) { + if (!Array.isArray(message.rules)) + return "rules: array expected"; + for (var i = 0; i < message.rules.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.rules[i]); + if (error) + return "rules." + error; + } + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + if (typeof message.fullyDecodeReservedExpansion !== "boolean") + return "fullyDecodeReservedExpansion: boolean expected"; + return null; + }; + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Http + * @static + * @param {Object.} object Plain object + * @returns {google.api.Http} Http + */ + Http.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Http) + return object; + var message = new $root.google.api.Http(); + if (object.rules) { + if (!Array.isArray(object.rules)) + throw TypeError(".google.api.Http.rules: array expected"); + message.rules = []; + for (var i = 0; i < object.rules.length; ++i) { + if (typeof object.rules[i] !== "object") + throw TypeError(".google.api.Http.rules: object expected"); + message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); + } + } + if (object.fullyDecodeReservedExpansion != null) + message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); + return message; + }; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Http + * @static + * @param {google.api.Http} message Http + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Http.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rules = []; + if (options.defaults) + object.fullyDecodeReservedExpansion = false; + if (message.rules && message.rules.length) { + object.rules = []; + for (var j = 0; j < message.rules.length; ++j) + object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; + return object; + }; + + /** + * Converts this Http to JSON. + * @function toJSON + * @memberof google.api.Http + * @instance + * @returns {Object.} JSON object + */ + Http.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * 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 + * @property {string|null} [protoReferenceDocumentationUri] Publishing protoReferenceDocumentationUri + * @property {string|null} [restReferenceDocumentationUri] Publishing restReferenceDocumentationUri + */ + + /** + * 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; + + /** + * Publishing protoReferenceDocumentationUri. + * @member {string} protoReferenceDocumentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.protoReferenceDocumentationUri = ""; + + /** + * Publishing restReferenceDocumentationUri. + * @member {string} restReferenceDocumentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.restReferenceDocumentationUri = ""; + + /** + * 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(); + if (message.protoReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "protoReferenceDocumentationUri")) + writer.uint32(/* id 110, wireType 2 =*/882).string(message.protoReferenceDocumentationUri); + if (message.restReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "restReferenceDocumentationUri")) + writer.uint32(/* id 111, wireType 2 =*/890).string(message.restReferenceDocumentationUri); + 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; + } + case 110: { + message.protoReferenceDocumentationUri = reader.string(); + break; + } + case 111: { + message.restReferenceDocumentationUri = reader.string(); + 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: + case 5: + case 6: + case 7: + 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; + } + } + if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) + if (!$util.isString(message.protoReferenceDocumentationUri)) + return "protoReferenceDocumentationUri: string expected"; + if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) + if (!$util.isString(message.restReferenceDocumentationUri)) + return "restReferenceDocumentationUri: string expected"; + 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; + case "SHOPPING": + case 5: + message.organization = 5; + break; + case "GEO": + case 6: + message.organization = 6; + break; + case "GENERATIVE_AI": + case 7: + message.organization = 7; + 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]); + } + } + if (object.protoReferenceDocumentationUri != null) + message.protoReferenceDocumentationUri = String(object.protoReferenceDocumentationUri); + if (object.restReferenceDocumentationUri != null) + message.restReferenceDocumentationUri = String(object.restReferenceDocumentationUri); + 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; + object.protoReferenceDocumentationUri = ""; + object.restReferenceDocumentationUri = ""; + } + 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); + } + if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) + object.protoReferenceDocumentationUri = message.protoReferenceDocumentationUri; + if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) + object.restReferenceDocumentationUri = message.restReferenceDocumentationUri; + 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 + * @property {Object.|null} [renamedServices] DotnetSettings renamedServices + * @property {Object.|null} [renamedResources] DotnetSettings renamedResources + * @property {Array.|null} [ignoredResources] DotnetSettings ignoredResources + * @property {Array.|null} [forcedNamespaceAliases] DotnetSettings forcedNamespaceAliases + * @property {Array.|null} [handwrittenSignatures] DotnetSettings handwrittenSignatures + */ + + /** + * 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) { + this.renamedServices = {}; + this.renamedResources = {}; + this.ignoredResources = []; + this.forcedNamespaceAliases = []; + this.handwrittenSignatures = []; + if (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; + + /** + * DotnetSettings renamedServices. + * @member {Object.} renamedServices + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.renamedServices = $util.emptyObject; + + /** + * DotnetSettings renamedResources. + * @member {Object.} renamedResources + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.renamedResources = $util.emptyObject; + + /** + * DotnetSettings ignoredResources. + * @member {Array.} ignoredResources + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.ignoredResources = $util.emptyArray; + + /** + * DotnetSettings forcedNamespaceAliases. + * @member {Array.} forcedNamespaceAliases + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.forcedNamespaceAliases = $util.emptyArray; + + /** + * DotnetSettings handwrittenSignatures. + * @member {Array.} handwrittenSignatures + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.handwrittenSignatures = $util.emptyArray; + + /** + * 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(); + if (message.renamedServices != null && Object.hasOwnProperty.call(message, "renamedServices")) + for (var keys = Object.keys(message.renamedServices), 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.renamedServices[keys[i]]).ldelim(); + if (message.renamedResources != null && Object.hasOwnProperty.call(message, "renamedResources")) + for (var keys = Object.keys(message.renamedResources), i = 0; i < keys.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedResources[keys[i]]).ldelim(); + if (message.ignoredResources != null && message.ignoredResources.length) + for (var i = 0; i < message.ignoredResources.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.ignoredResources[i]); + if (message.forcedNamespaceAliases != null && message.forcedNamespaceAliases.length) + for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.forcedNamespaceAliases[i]); + if (message.handwrittenSignatures != null && message.handwrittenSignatures.length) + for (var i = 0; i < message.handwrittenSignatures.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.handwrittenSignatures[i]); + 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(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + case 2: { + if (message.renamedServices === $util.emptyObject) + message.renamedServices = {}; + 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.renamedServices[key] = value; + break; + } + case 3: { + if (message.renamedResources === $util.emptyObject) + message.renamedResources = {}; + 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.renamedResources[key] = value; + break; + } + case 4: { + if (!(message.ignoredResources && message.ignoredResources.length)) + message.ignoredResources = []; + message.ignoredResources.push(reader.string()); + break; + } + case 5: { + if (!(message.forcedNamespaceAliases && message.forcedNamespaceAliases.length)) + message.forcedNamespaceAliases = []; + message.forcedNamespaceAliases.push(reader.string()); + break; + } + case 6: { + if (!(message.handwrittenSignatures && message.handwrittenSignatures.length)) + message.handwrittenSignatures = []; + message.handwrittenSignatures.push(reader.string()); + 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; + } + if (message.renamedServices != null && message.hasOwnProperty("renamedServices")) { + if (!$util.isObject(message.renamedServices)) + return "renamedServices: object expected"; + var key = Object.keys(message.renamedServices); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.renamedServices[key[i]])) + return "renamedServices: string{k:string} expected"; + } + if (message.renamedResources != null && message.hasOwnProperty("renamedResources")) { + if (!$util.isObject(message.renamedResources)) + return "renamedResources: object expected"; + var key = Object.keys(message.renamedResources); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.renamedResources[key[i]])) + return "renamedResources: string{k:string} expected"; + } + if (message.ignoredResources != null && message.hasOwnProperty("ignoredResources")) { + if (!Array.isArray(message.ignoredResources)) + return "ignoredResources: array expected"; + for (var i = 0; i < message.ignoredResources.length; ++i) + if (!$util.isString(message.ignoredResources[i])) + return "ignoredResources: string[] expected"; + } + if (message.forcedNamespaceAliases != null && message.hasOwnProperty("forcedNamespaceAliases")) { + if (!Array.isArray(message.forcedNamespaceAliases)) + return "forcedNamespaceAliases: array expected"; + for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) + if (!$util.isString(message.forcedNamespaceAliases[i])) + return "forcedNamespaceAliases: string[] expected"; + } + if (message.handwrittenSignatures != null && message.hasOwnProperty("handwrittenSignatures")) { + if (!Array.isArray(message.handwrittenSignatures)) + return "handwrittenSignatures: array expected"; + for (var i = 0; i < message.handwrittenSignatures.length; ++i) + if (!$util.isString(message.handwrittenSignatures[i])) + return "handwrittenSignatures: string[] expected"; + } + 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); + } + if (object.renamedServices) { + if (typeof object.renamedServices !== "object") + throw TypeError(".google.api.DotnetSettings.renamedServices: object expected"); + message.renamedServices = {}; + for (var keys = Object.keys(object.renamedServices), i = 0; i < keys.length; ++i) + message.renamedServices[keys[i]] = String(object.renamedServices[keys[i]]); + } + if (object.renamedResources) { + if (typeof object.renamedResources !== "object") + throw TypeError(".google.api.DotnetSettings.renamedResources: object expected"); + message.renamedResources = {}; + for (var keys = Object.keys(object.renamedResources), i = 0; i < keys.length; ++i) + message.renamedResources[keys[i]] = String(object.renamedResources[keys[i]]); + } + if (object.ignoredResources) { + if (!Array.isArray(object.ignoredResources)) + throw TypeError(".google.api.DotnetSettings.ignoredResources: array expected"); + message.ignoredResources = []; + for (var i = 0; i < object.ignoredResources.length; ++i) + message.ignoredResources[i] = String(object.ignoredResources[i]); + } + if (object.forcedNamespaceAliases) { + if (!Array.isArray(object.forcedNamespaceAliases)) + throw TypeError(".google.api.DotnetSettings.forcedNamespaceAliases: array expected"); + message.forcedNamespaceAliases = []; + for (var i = 0; i < object.forcedNamespaceAliases.length; ++i) + message.forcedNamespaceAliases[i] = String(object.forcedNamespaceAliases[i]); + } + if (object.handwrittenSignatures) { + if (!Array.isArray(object.handwrittenSignatures)) + throw TypeError(".google.api.DotnetSettings.handwrittenSignatures: array expected"); + message.handwrittenSignatures = []; + for (var i = 0; i < object.handwrittenSignatures.length; ++i) + message.handwrittenSignatures[i] = String(object.handwrittenSignatures[i]); + } + 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.arrays || options.defaults) { + object.ignoredResources = []; + object.forcedNamespaceAliases = []; + object.handwrittenSignatures = []; + } + if (options.objects || options.defaults) { + object.renamedServices = {}; + object.renamedResources = {}; + } + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + var keys2; + if (message.renamedServices && (keys2 = Object.keys(message.renamedServices)).length) { + object.renamedServices = {}; + for (var j = 0; j < keys2.length; ++j) + object.renamedServices[keys2[j]] = message.renamedServices[keys2[j]]; + } + if (message.renamedResources && (keys2 = Object.keys(message.renamedResources)).length) { + object.renamedResources = {}; + for (var j = 0; j < keys2.length; ++j) + object.renamedResources[keys2[j]] = message.renamedResources[keys2[j]]; + } + if (message.ignoredResources && message.ignoredResources.length) { + object.ignoredResources = []; + for (var j = 0; j < message.ignoredResources.length; ++j) + object.ignoredResources[j] = message.ignoredResources[j]; + } + if (message.forcedNamespaceAliases && message.forcedNamespaceAliases.length) { + object.forcedNamespaceAliases = []; + for (var j = 0; j < message.forcedNamespaceAliases.length; ++j) + object.forcedNamespaceAliases[j] = message.forcedNamespaceAliases[j]; + } + if (message.handwrittenSignatures && message.handwrittenSignatures.length) { + object.handwrittenSignatures = []; + for (var j = 0; j < message.handwrittenSignatures.length; ++j) + object.handwrittenSignatures[j] = message.handwrittenSignatures[j]; + } + 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 + * @property {Array.|null} [autoPopulatedFields] MethodSettings autoPopulatedFields + */ + + /** + * 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) { + this.autoPopulatedFields = []; + if (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; + + /** + * MethodSettings autoPopulatedFields. + * @member {Array.} autoPopulatedFields + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.autoPopulatedFields = $util.emptyArray; + + /** + * 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(); + if (message.autoPopulatedFields != null && message.autoPopulatedFields.length) + for (var i = 0; i < message.autoPopulatedFields.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.autoPopulatedFields[i]); + 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; + } + case 3: { + if (!(message.autoPopulatedFields && message.autoPopulatedFields.length)) + message.autoPopulatedFields = []; + message.autoPopulatedFields.push(reader.string()); + 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; + } + if (message.autoPopulatedFields != null && message.hasOwnProperty("autoPopulatedFields")) { + if (!Array.isArray(message.autoPopulatedFields)) + return "autoPopulatedFields: array expected"; + for (var i = 0; i < message.autoPopulatedFields.length; ++i) + if (!$util.isString(message.autoPopulatedFields[i])) + return "autoPopulatedFields: string[] expected"; + } + 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); + } + if (object.autoPopulatedFields) { + if (!Array.isArray(object.autoPopulatedFields)) + throw TypeError(".google.api.MethodSettings.autoPopulatedFields: array expected"); + message.autoPopulatedFields = []; + for (var i = 0; i < object.autoPopulatedFields.length; ++i) + message.autoPopulatedFields[i] = String(object.autoPopulatedFields[i]); + } + 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.arrays || options.defaults) + object.autoPopulatedFields = []; + 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); + if (message.autoPopulatedFields && message.autoPopulatedFields.length) { + object.autoPopulatedFields = []; + for (var j = 0; j < message.autoPopulatedFields.length; ++j) + object.autoPopulatedFields[j] = message.autoPopulatedFields[j]; + } + 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 + * @property {number} SHOPPING=5 SHOPPING value + * @property {number} GEO=6 GEO value + * @property {number} GENERATIVE_AI=7 GENERATIVE_AI 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; + values[valuesById[5] = "SHOPPING"] = 5; + values[valuesById[6] = "GEO"] = 6; + values[valuesById[7] = "GENERATIVE_AI"] = 7; + 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; + })(); + + /** + * 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 + * @property {number} IDENTIFIER=8 IDENTIFIER 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; + values[valuesById[8] = "IDENTIFIER"] = 8; + 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; + })(); + + 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; + })(); + + /** + * Edition enum. + * @name google.protobuf.Edition + * @enum {number} + * @property {number} EDITION_UNKNOWN=0 EDITION_UNKNOWN value + * @property {number} EDITION_PROTO2=998 EDITION_PROTO2 value + * @property {number} EDITION_PROTO3=999 EDITION_PROTO3 value + * @property {number} EDITION_2023=1000 EDITION_2023 value + * @property {number} EDITION_2024=1001 EDITION_2024 value + * @property {number} EDITION_1_TEST_ONLY=1 EDITION_1_TEST_ONLY value + * @property {number} EDITION_2_TEST_ONLY=2 EDITION_2_TEST_ONLY value + * @property {number} EDITION_99997_TEST_ONLY=99997 EDITION_99997_TEST_ONLY value + * @property {number} EDITION_99998_TEST_ONLY=99998 EDITION_99998_TEST_ONLY value + * @property {number} EDITION_99999_TEST_ONLY=99999 EDITION_99999_TEST_ONLY value + * @property {number} EDITION_MAX=2147483647 EDITION_MAX value + */ + protobuf.Edition = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EDITION_UNKNOWN"] = 0; + values[valuesById[998] = "EDITION_PROTO2"] = 998; + values[valuesById[999] = "EDITION_PROTO3"] = 999; + values[valuesById[1000] = "EDITION_2023"] = 1000; + values[valuesById[1001] = "EDITION_2024"] = 1001; + values[valuesById[1] = "EDITION_1_TEST_ONLY"] = 1; + values[valuesById[2] = "EDITION_2_TEST_ONLY"] = 2; + values[valuesById[99997] = "EDITION_99997_TEST_ONLY"] = 99997; + values[valuesById[99998] = "EDITION_99998_TEST_ONLY"] = 99998; + values[valuesById[99999] = "EDITION_99999_TEST_ONLY"] = 99999; + values[valuesById[2147483647] = "EDITION_MAX"] = 2147483647; + return values; + })(); + + 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 {google.protobuf.Edition|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 {google.protobuf.Edition} edition + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.edition = 0; + + /** + * 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 14, wireType 0 =*/112).int32(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 14: { + message.edition = reader.int32(); + 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")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + 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); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + 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 = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + 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 = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.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 + * @property {Array.|null} [declaration] ExtensionRangeOptions declaration + * @property {google.protobuf.IFeatureSet|null} [features] ExtensionRangeOptions features + * @property {google.protobuf.ExtensionRangeOptions.VerificationState|null} [verification] ExtensionRangeOptions verification + */ + + /** + * 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 = []; + this.declaration = []; + if (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; + + /** + * ExtensionRangeOptions declaration. + * @member {Array.} declaration + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.declaration = $util.emptyArray; + + /** + * ExtensionRangeOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.features = null; + + /** + * ExtensionRangeOptions verification. + * @member {google.protobuf.ExtensionRangeOptions.VerificationState} verification + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.verification = 1; + + /** + * 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.declaration != null && message.declaration.length) + for (var i = 0; i < message.declaration.length; ++i) + $root.google.protobuf.ExtensionRangeOptions.Declaration.encode(message.declaration[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.verification != null && Object.hasOwnProperty.call(message, "verification")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.verification); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); + 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; + } + case 2: { + if (!(message.declaration && message.declaration.length)) + message.declaration = []; + message.declaration.push($root.google.protobuf.ExtensionRangeOptions.Declaration.decode(reader, reader.uint32())); + break; + } + case 50: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 3: { + message.verification = reader.int32(); + 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; + } + } + if (message.declaration != null && message.hasOwnProperty("declaration")) { + if (!Array.isArray(message.declaration)) + return "declaration: array expected"; + for (var i = 0; i < message.declaration.length; ++i) { + var error = $root.google.protobuf.ExtensionRangeOptions.Declaration.verify(message.declaration[i]); + if (error) + return "declaration." + error; + } + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.verification != null && message.hasOwnProperty("verification")) + switch (message.verification) { + default: + return "verification: enum value expected"; + case 0: + case 1: + break; + } + 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]); + } + } + if (object.declaration) { + if (!Array.isArray(object.declaration)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: array expected"); + message.declaration = []; + for (var i = 0; i < object.declaration.length; ++i) { + if (typeof object.declaration[i] !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: object expected"); + message.declaration[i] = $root.google.protobuf.ExtensionRangeOptions.Declaration.fromObject(object.declaration[i]); + } + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + switch (object.verification) { + case "DECLARATION": + case 0: + message.verification = 0; + break; + default: + if (typeof object.verification === "number") { + message.verification = object.verification; + break; + } + break; + case "UNVERIFIED": + case 1: + message.verification = 1; + break; + } + 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.declaration = []; + object.uninterpretedOption = []; + } + if (options.defaults) { + object.verification = options.enums === String ? "UNVERIFIED" : 1; + object.features = null; + } + if (message.declaration && message.declaration.length) { + object.declaration = []; + for (var j = 0; j < message.declaration.length; ++j) + object.declaration[j] = $root.google.protobuf.ExtensionRangeOptions.Declaration.toObject(message.declaration[j], options); + } + if (message.verification != null && message.hasOwnProperty("verification")) + object.verification = options.enums === String ? $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] === undefined ? message.verification : $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] : message.verification; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + 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"; + }; + + ExtensionRangeOptions.Declaration = (function() { + + /** + * Properties of a Declaration. + * @memberof google.protobuf.ExtensionRangeOptions + * @interface IDeclaration + * @property {number|null} [number] Declaration number + * @property {string|null} [fullName] Declaration fullName + * @property {string|null} [type] Declaration type + * @property {boolean|null} [reserved] Declaration reserved + * @property {boolean|null} [repeated] Declaration repeated + */ + + /** + * Constructs a new Declaration. + * @memberof google.protobuf.ExtensionRangeOptions + * @classdesc Represents a Declaration. + * @implements IDeclaration + * @constructor + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set + */ + function Declaration(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]]; + } + + /** + * Declaration number. + * @member {number} number + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.number = 0; + + /** + * Declaration fullName. + * @member {string} fullName + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.fullName = ""; + + /** + * Declaration type. + * @member {string} type + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.type = ""; + + /** + * Declaration reserved. + * @member {boolean} reserved + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.reserved = false; + + /** + * Declaration repeated. + * @member {boolean} repeated + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.repeated = false; + + /** + * Creates a new Declaration instance using the specified properties. + * @function create + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration instance + */ + Declaration.create = function create(properties) { + return new Declaration(properties); + }; + + /** + * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Declaration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.number); + if (message.fullName != null && Object.hasOwnProperty.call(message, "fullName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.fullName); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.type); + if (message.reserved != null && Object.hasOwnProperty.call(message, "reserved")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.reserved); + if (message.repeated != null && Object.hasOwnProperty.call(message, "repeated")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.repeated); + return writer; + }; + + /** + * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Declaration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Declaration message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Declaration.decode = function 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.Declaration(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.number = reader.int32(); + break; + } + case 2: { + message.fullName = reader.string(); + break; + } + case 3: { + message.type = reader.string(); + break; + } + case 5: { + message.reserved = reader.bool(); + break; + } + case 6: { + message.repeated = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Declaration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Declaration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Declaration message. + * @function verify + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Declaration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.fullName != null && message.hasOwnProperty("fullName")) + if (!$util.isString(message.fullName)) + return "fullName: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.reserved != null && message.hasOwnProperty("reserved")) + if (typeof message.reserved !== "boolean") + return "reserved: boolean expected"; + if (message.repeated != null && message.hasOwnProperty("repeated")) + if (typeof message.repeated !== "boolean") + return "repeated: boolean expected"; + return null; + }; + + /** + * Creates a Declaration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + */ + Declaration.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions.Declaration) + return object; + var message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); + if (object.number != null) + message.number = object.number | 0; + if (object.fullName != null) + message.fullName = String(object.fullName); + if (object.type != null) + message.type = String(object.type); + if (object.reserved != null) + message.reserved = Boolean(object.reserved); + if (object.repeated != null) + message.repeated = Boolean(object.repeated); + return message; + }; + + /** + * Creates a plain object from a Declaration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.Declaration} message Declaration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Declaration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.number = 0; + object.fullName = ""; + object.type = ""; + object.reserved = false; + object.repeated = false; + } + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.fullName != null && message.hasOwnProperty("fullName")) + object.fullName = message.fullName; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.reserved != null && message.hasOwnProperty("reserved")) + object.reserved = message.reserved; + if (message.repeated != null && message.hasOwnProperty("repeated")) + object.repeated = message.repeated; + return object; + }; + + /** + * Converts this Declaration to JSON. + * @function toJSON + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + * @returns {Object.} JSON object + */ + Declaration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Declaration + * @function getTypeUrl + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Declaration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions.Declaration"; + }; + + return Declaration; + })(); + + /** + * VerificationState enum. + * @name google.protobuf.ExtensionRangeOptions.VerificationState + * @enum {number} + * @property {number} DECLARATION=0 DECLARATION value + * @property {number} UNVERIFIED=1 UNVERIFIED value + */ + ExtensionRangeOptions.VerificationState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DECLARATION"] = 0; + values[valuesById[1] = "UNVERIFIED"] = 1; + return values; + })(); + + 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 3: + case 2: + 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_REPEATED": + case 3: + message.label = 3; + break; + case "LABEL_REQUIRED": + case 2: + message.label = 2; + 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_REPEATED=3 LABEL_REPEATED value + * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value + */ + FieldDescriptorProto.Label = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "LABEL_OPTIONAL"] = 1; + values[valuesById[3] = "LABEL_REPEATED"] = 3; + values[valuesById[2] = "LABEL_REQUIRED"] = 2; + 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} [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 {google.protobuf.IFeatureSet|null} [features] FileOptions features + * @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 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 features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.features = null; + + /** + * 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.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.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); + 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 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 50: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + 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.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.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + 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.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.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FileOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + 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.phpMetadataNamespace = ""; + object.rubyPackage = ""; + object.features = null; + } + 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.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + object.phpMetadataNamespace = message.phpMetadataNamespace; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + object.rubyPackage = message.rubyPackage; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + 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 {google.protobuf.IFeatureSet|null} [features] MessageOptions features + * @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 features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.features = null; + + /** + * 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.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + 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 12: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + 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.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + 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.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.MessageOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + 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.features = null; + 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.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + 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 {Array.|null} [targets] FieldOptions targets + * @property {Array.|null} [editionDefaults] FieldOptions editionDefaults + * @property {google.protobuf.IFeatureSet|null} [features] FieldOptions features + * @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.targets = []; + this.editionDefaults = []; + 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 targets. + * @member {Array.} targets + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.targets = $util.emptyArray; + + /** + * FieldOptions editionDefaults. + * @member {Array.} editionDefaults + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.editionDefaults = $util.emptyArray; + + /** + * FieldOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.features = null; + + /** + * 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.targets != null && message.targets.length) + for (var i = 0; i < message.targets.length; ++i) + writer.uint32(/* id 19, wireType 0 =*/152).int32(message.targets[i]); + if (message.editionDefaults != null && message.editionDefaults.length) + for (var i = 0; i < message.editionDefaults.length; ++i) + $root.google.protobuf.FieldOptions.EditionDefault.encode(message.editionDefaults[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + 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) + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + writer.uint32(/* id 1052, wireType 0 =*/8416).int32(message[".google.api.fieldBehavior"][i]); + 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 19: { + if (!(message.targets && message.targets.length)) + message.targets = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.targets.push(reader.int32()); + } else + message.targets.push(reader.int32()); + break; + } + case 20: { + if (!(message.editionDefaults && message.editionDefaults.length)) + message.editionDefaults = []; + message.editionDefaults.push($root.google.protobuf.FieldOptions.EditionDefault.decode(reader, reader.uint32())); + break; + } + case 21: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + 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.targets != null && message.hasOwnProperty("targets")) { + if (!Array.isArray(message.targets)) + return "targets: array expected"; + for (var i = 0; i < message.targets.length; ++i) + switch (message.targets[i]) { + default: + return "targets: 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.editionDefaults != null && message.hasOwnProperty("editionDefaults")) { + if (!Array.isArray(message.editionDefaults)) + return "editionDefaults: array expected"; + for (var i = 0; i < message.editionDefaults.length; ++i) { + var error = $root.google.protobuf.FieldOptions.EditionDefault.verify(message.editionDefaults[i]); + if (error) + return "editionDefaults." + error; + } + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + 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: + case 8: + 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; + } + if (object.targets) { + if (!Array.isArray(object.targets)) + throw TypeError(".google.protobuf.FieldOptions.targets: array expected"); + message.targets = []; + for (var i = 0; i < object.targets.length; ++i) + switch (object.targets[i]) { + default: + if (typeof object.targets[i] === "number") { + message.targets[i] = object.targets[i]; + break; + } + case "TARGET_TYPE_UNKNOWN": + case 0: + message.targets[i] = 0; + break; + case "TARGET_TYPE_FILE": + case 1: + message.targets[i] = 1; + break; + case "TARGET_TYPE_EXTENSION_RANGE": + case 2: + message.targets[i] = 2; + break; + case "TARGET_TYPE_MESSAGE": + case 3: + message.targets[i] = 3; + break; + case "TARGET_TYPE_FIELD": + case 4: + message.targets[i] = 4; + break; + case "TARGET_TYPE_ONEOF": + case 5: + message.targets[i] = 5; + break; + case "TARGET_TYPE_ENUM": + case 6: + message.targets[i] = 6; + break; + case "TARGET_TYPE_ENUM_ENTRY": + case 7: + message.targets[i] = 7; + break; + case "TARGET_TYPE_SERVICE": + case 8: + message.targets[i] = 8; + break; + case "TARGET_TYPE_METHOD": + case 9: + message.targets[i] = 9; + break; + } + } + if (object.editionDefaults) { + if (!Array.isArray(object.editionDefaults)) + throw TypeError(".google.protobuf.FieldOptions.editionDefaults: array expected"); + message.editionDefaults = []; + for (var i = 0; i < object.editionDefaults.length; ++i) { + if (typeof object.editionDefaults[i] !== "object") + throw TypeError(".google.protobuf.FieldOptions.editionDefaults: object expected"); + message.editionDefaults[i] = $root.google.protobuf.FieldOptions.EditionDefault.fromObject(object.editionDefaults[i]); + } + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FieldOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + 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; + case "IDENTIFIER": + case 8: + message[".google.api.fieldBehavior"][i] = 8; + 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.targets = []; + object.editionDefaults = []; + 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.features = null; + 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.targets && message.targets.length) { + object.targets = []; + for (var j = 0; j < message.targets.length; ++j) + object.targets[j] = options.enums === String ? $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] === undefined ? message.targets[j] : $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] : message.targets[j]; + } + if (message.editionDefaults && message.editionDefaults.length) { + object.editionDefaults = []; + for (var j = 0; j < message.editionDefaults.length; ++j) + object.editionDefaults[j] = $root.google.protobuf.FieldOptions.EditionDefault.toObject(message.editionDefaults[j], options); + } + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + 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; + })(); + + FieldOptions.EditionDefault = (function() { + + /** + * Properties of an EditionDefault. + * @memberof google.protobuf.FieldOptions + * @interface IEditionDefault + * @property {google.protobuf.Edition|null} [edition] EditionDefault edition + * @property {string|null} [value] EditionDefault value + */ + + /** + * Constructs a new EditionDefault. + * @memberof google.protobuf.FieldOptions + * @classdesc Represents an EditionDefault. + * @implements IEditionDefault + * @constructor + * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set + */ + function EditionDefault(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]]; + } + + /** + * EditionDefault edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + */ + EditionDefault.prototype.edition = 0; + + /** + * EditionDefault value. + * @member {string} value + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + */ + EditionDefault.prototype.value = ""; + + /** + * Creates a new EditionDefault instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault instance + */ + EditionDefault.create = function create(properties) { + return new EditionDefault(properties); + }; + + /** + * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EditionDefault.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); + return writer; + }; + + /** + * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EditionDefault.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EditionDefault message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EditionDefault.decode = function 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.EditionDefault(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + message.edition = reader.int32(); + break; + } + case 2: { + message.value = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EditionDefault message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EditionDefault.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EditionDefault message. + * @function verify + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EditionDefault.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + return null; + }; + + /** + * Creates an EditionDefault message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + */ + EditionDefault.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions.EditionDefault) + return object; + var message = new $root.google.protobuf.FieldOptions.EditionDefault(); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.EditionDefault} message EditionDefault + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EditionDefault.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.value = ""; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this EditionDefault to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + * @returns {Object.} JSON object + */ + EditionDefault.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EditionDefault + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions.EditionDefault"; + }; + + return EditionDefault; + })(); + + return FieldOptions; + })(); + + protobuf.OneofOptions = (function() { + + /** + * Properties of an OneofOptions. + * @memberof google.protobuf + * @interface IOneofOptions + * @property {google.protobuf.IFeatureSet|null} [features] OneofOptions features + * @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 features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.features = null; + + /** + * 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.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + 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 1: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + 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.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + 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.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.OneofOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + 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 (options.defaults) + object.features = null; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + 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 {google.protobuf.IFeatureSet|null} [features] EnumOptions features + * @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 features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.features = null; + + /** + * 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.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + 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 7: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + 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.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + 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.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.EnumOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + 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; + object.features = null; + } + 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.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + 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 {google.protobuf.IFeatureSet|null} [features] EnumValueOptions features + * @property {boolean|null} [debugRedact] EnumValueOptions debugRedact + * @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 features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.features = null; + + /** + * EnumValueOptions debugRedact. + * @member {boolean} debugRedact + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.debugRedact = 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.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.debugRedact); + 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 2: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 3: { + message.debugRedact = 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.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + if (typeof message.debugRedact !== "boolean") + return "debugRedact: 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.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.debugRedact != null) + message.debugRedact = Boolean(object.debugRedact); + 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; + object.features = null; + object.debugRedact = false; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + object.debugRedact = message.debugRedact; + 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 {google.protobuf.IFeatureSet|null} [features] ServiceOptions features + * @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 + * @property {string|null} [".google.api.apiVersion"] ServiceOptions .google.api.apiVersion + */ + + /** + * 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 features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.features = null; + + /** + * 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"] = ""; + + /** + * ServiceOptions .google.api.apiVersion. + * @member {string} .google.api.apiVersion + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.apiVersion"] = ""; + + /** + * 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.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 34, wireType 2 =*/274).fork()).ldelim(); + 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"]); + if (message[".google.api.apiVersion"] != null && Object.hasOwnProperty.call(message, ".google.api.apiVersion")) + writer.uint32(/* id 525000001, wireType 2 =*/4200000010).string(message[".google.api.apiVersion"]); + 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 34: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 33: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1049: { + message[".google.api.defaultHost"] = reader.string(); + break; + } + case 1050: { + message[".google.api.oauthScopes"] = reader.string(); + break; + } + case 525000001: { + message[".google.api.apiVersion"] = 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.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + 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"; + if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) + if (!$util.isString(message[".google.api.apiVersion"])) + return ".google.api.apiVersion: 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.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.ServiceOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + 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"]); + if (object[".google.api.apiVersion"] != null) + message[".google.api.apiVersion"] = String(object[".google.api.apiVersion"]); + 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.features = null; + object[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; + object[".google.api.apiVersion"] = ""; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + 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"]; + if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) + object[".google.api.apiVersion"] = message[".google.api.apiVersion"]; + 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 {google.protobuf.IFeatureSet|null} [features] MethodOptions features + * @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 features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.features = null; + + /** + * 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.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 35, wireType 2 =*/282).fork()).ldelim(); + 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 35: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + 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.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + 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.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.MethodOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + 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.features = null; + 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.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + 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.FeatureSet = (function() { + + /** + * Properties of a FeatureSet. + * @memberof google.protobuf + * @interface IFeatureSet + * @property {google.protobuf.FeatureSet.FieldPresence|null} [fieldPresence] FeatureSet fieldPresence + * @property {google.protobuf.FeatureSet.EnumType|null} [enumType] FeatureSet enumType + * @property {google.protobuf.FeatureSet.RepeatedFieldEncoding|null} [repeatedFieldEncoding] FeatureSet repeatedFieldEncoding + * @property {google.protobuf.FeatureSet.Utf8Validation|null} [utf8Validation] FeatureSet utf8Validation + * @property {google.protobuf.FeatureSet.MessageEncoding|null} [messageEncoding] FeatureSet messageEncoding + * @property {google.protobuf.FeatureSet.JsonFormat|null} [jsonFormat] FeatureSet jsonFormat + */ + + /** + * Constructs a new FeatureSet. + * @memberof google.protobuf + * @classdesc Represents a FeatureSet. + * @implements IFeatureSet + * @constructor + * @param {google.protobuf.IFeatureSet=} [properties] Properties to set + */ + function FeatureSet(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]]; + } + + /** + * FeatureSet fieldPresence. + * @member {google.protobuf.FeatureSet.FieldPresence} fieldPresence + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.fieldPresence = 0; + + /** + * FeatureSet enumType. + * @member {google.protobuf.FeatureSet.EnumType} enumType + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.enumType = 0; + + /** + * FeatureSet repeatedFieldEncoding. + * @member {google.protobuf.FeatureSet.RepeatedFieldEncoding} repeatedFieldEncoding + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.repeatedFieldEncoding = 0; + + /** + * FeatureSet utf8Validation. + * @member {google.protobuf.FeatureSet.Utf8Validation} utf8Validation + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.utf8Validation = 0; + + /** + * FeatureSet messageEncoding. + * @member {google.protobuf.FeatureSet.MessageEncoding} messageEncoding + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.messageEncoding = 0; + + /** + * FeatureSet jsonFormat. + * @member {google.protobuf.FeatureSet.JsonFormat} jsonFormat + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.jsonFormat = 0; + + /** + * Creates a new FeatureSet instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet=} [properties] Properties to set + * @returns {google.protobuf.FeatureSet} FeatureSet instance + */ + FeatureSet.create = function create(properties) { + return new FeatureSet(properties); + }; + + /** + * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fieldPresence != null && Object.hasOwnProperty.call(message, "fieldPresence")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.fieldPresence); + if (message.enumType != null && Object.hasOwnProperty.call(message, "enumType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.enumType); + if (message.repeatedFieldEncoding != null && Object.hasOwnProperty.call(message, "repeatedFieldEncoding")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.repeatedFieldEncoding); + if (message.utf8Validation != null && Object.hasOwnProperty.call(message, "utf8Validation")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.utf8Validation); + if (message.messageEncoding != null && Object.hasOwnProperty.call(message, "messageEncoding")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.messageEncoding); + if (message.jsonFormat != null && Object.hasOwnProperty.call(message, "jsonFormat")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jsonFormat); + return writer; + }; + + /** + * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSet message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSet} FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSet.decode = function 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.FeatureSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.fieldPresence = reader.int32(); + break; + } + case 2: { + message.enumType = reader.int32(); + break; + } + case 3: { + message.repeatedFieldEncoding = reader.int32(); + break; + } + case 4: { + message.utf8Validation = reader.int32(); + break; + } + case 5: { + message.messageEncoding = reader.int32(); + break; + } + case 6: { + message.jsonFormat = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSet} FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSet message. + * @function verify + * @memberof google.protobuf.FeatureSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) + switch (message.fieldPresence) { + default: + return "fieldPresence: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.enumType != null && message.hasOwnProperty("enumType")) + switch (message.enumType) { + default: + return "enumType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) + switch (message.repeatedFieldEncoding) { + default: + return "repeatedFieldEncoding: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) + switch (message.utf8Validation) { + default: + return "utf8Validation: enum value expected"; + case 0: + case 2: + case 3: + break; + } + if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) + switch (message.messageEncoding) { + default: + return "messageEncoding: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) + switch (message.jsonFormat) { + default: + return "jsonFormat: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSet + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSet} FeatureSet + */ + FeatureSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSet) + return object; + var message = new $root.google.protobuf.FeatureSet(); + switch (object.fieldPresence) { + default: + if (typeof object.fieldPresence === "number") { + message.fieldPresence = object.fieldPresence; + break; + } + break; + case "FIELD_PRESENCE_UNKNOWN": + case 0: + message.fieldPresence = 0; + break; + case "EXPLICIT": + case 1: + message.fieldPresence = 1; + break; + case "IMPLICIT": + case 2: + message.fieldPresence = 2; + break; + case "LEGACY_REQUIRED": + case 3: + message.fieldPresence = 3; + break; + } + switch (object.enumType) { + default: + if (typeof object.enumType === "number") { + message.enumType = object.enumType; + break; + } + break; + case "ENUM_TYPE_UNKNOWN": + case 0: + message.enumType = 0; + break; + case "OPEN": + case 1: + message.enumType = 1; + break; + case "CLOSED": + case 2: + message.enumType = 2; + break; + } + switch (object.repeatedFieldEncoding) { + default: + if (typeof object.repeatedFieldEncoding === "number") { + message.repeatedFieldEncoding = object.repeatedFieldEncoding; + break; + } + break; + case "REPEATED_FIELD_ENCODING_UNKNOWN": + case 0: + message.repeatedFieldEncoding = 0; + break; + case "PACKED": + case 1: + message.repeatedFieldEncoding = 1; + break; + case "EXPANDED": + case 2: + message.repeatedFieldEncoding = 2; + break; + } + switch (object.utf8Validation) { + default: + if (typeof object.utf8Validation === "number") { + message.utf8Validation = object.utf8Validation; + break; + } + break; + case "UTF8_VALIDATION_UNKNOWN": + case 0: + message.utf8Validation = 0; + break; + case "VERIFY": + case 2: + message.utf8Validation = 2; + break; + case "NONE": + case 3: + message.utf8Validation = 3; + break; + } + switch (object.messageEncoding) { + default: + if (typeof object.messageEncoding === "number") { + message.messageEncoding = object.messageEncoding; + break; + } + break; + case "MESSAGE_ENCODING_UNKNOWN": + case 0: + message.messageEncoding = 0; + break; + case "LENGTH_PREFIXED": + case 1: + message.messageEncoding = 1; + break; + case "DELIMITED": + case 2: + message.messageEncoding = 2; + break; + } + switch (object.jsonFormat) { + default: + if (typeof object.jsonFormat === "number") { + message.jsonFormat = object.jsonFormat; + break; + } + break; + case "JSON_FORMAT_UNKNOWN": + case 0: + message.jsonFormat = 0; + break; + case "ALLOW": + case 1: + message.jsonFormat = 1; + break; + case "LEGACY_BEST_EFFORT": + case 2: + message.jsonFormat = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.FeatureSet} message FeatureSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.fieldPresence = options.enums === String ? "FIELD_PRESENCE_UNKNOWN" : 0; + object.enumType = options.enums === String ? "ENUM_TYPE_UNKNOWN" : 0; + object.repeatedFieldEncoding = options.enums === String ? "REPEATED_FIELD_ENCODING_UNKNOWN" : 0; + object.utf8Validation = options.enums === String ? "UTF8_VALIDATION_UNKNOWN" : 0; + object.messageEncoding = options.enums === String ? "MESSAGE_ENCODING_UNKNOWN" : 0; + object.jsonFormat = options.enums === String ? "JSON_FORMAT_UNKNOWN" : 0; + } + if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) + object.fieldPresence = options.enums === String ? $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] === undefined ? message.fieldPresence : $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] : message.fieldPresence; + if (message.enumType != null && message.hasOwnProperty("enumType")) + object.enumType = options.enums === String ? $root.google.protobuf.FeatureSet.EnumType[message.enumType] === undefined ? message.enumType : $root.google.protobuf.FeatureSet.EnumType[message.enumType] : message.enumType; + if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) + object.repeatedFieldEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] === undefined ? message.repeatedFieldEncoding : $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] : message.repeatedFieldEncoding; + if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) + object.utf8Validation = options.enums === String ? $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] === undefined ? message.utf8Validation : $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] : message.utf8Validation; + if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) + object.messageEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] === undefined ? message.messageEncoding : $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] : message.messageEncoding; + if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) + object.jsonFormat = options.enums === String ? $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] === undefined ? message.jsonFormat : $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] : message.jsonFormat; + return object; + }; + + /** + * Converts this FeatureSet to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSet + * @instance + * @returns {Object.} JSON object + */ + FeatureSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSet + * @function getTypeUrl + * @memberof google.protobuf.FeatureSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSet"; + }; + + /** + * FieldPresence enum. + * @name google.protobuf.FeatureSet.FieldPresence + * @enum {number} + * @property {number} FIELD_PRESENCE_UNKNOWN=0 FIELD_PRESENCE_UNKNOWN value + * @property {number} EXPLICIT=1 EXPLICIT value + * @property {number} IMPLICIT=2 IMPLICIT value + * @property {number} LEGACY_REQUIRED=3 LEGACY_REQUIRED value + */ + FeatureSet.FieldPresence = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FIELD_PRESENCE_UNKNOWN"] = 0; + values[valuesById[1] = "EXPLICIT"] = 1; + values[valuesById[2] = "IMPLICIT"] = 2; + values[valuesById[3] = "LEGACY_REQUIRED"] = 3; + return values; + })(); + + /** + * EnumType enum. + * @name google.protobuf.FeatureSet.EnumType + * @enum {number} + * @property {number} ENUM_TYPE_UNKNOWN=0 ENUM_TYPE_UNKNOWN value + * @property {number} OPEN=1 OPEN value + * @property {number} CLOSED=2 CLOSED value + */ + FeatureSet.EnumType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENUM_TYPE_UNKNOWN"] = 0; + values[valuesById[1] = "OPEN"] = 1; + values[valuesById[2] = "CLOSED"] = 2; + return values; + })(); + + /** + * RepeatedFieldEncoding enum. + * @name google.protobuf.FeatureSet.RepeatedFieldEncoding + * @enum {number} + * @property {number} REPEATED_FIELD_ENCODING_UNKNOWN=0 REPEATED_FIELD_ENCODING_UNKNOWN value + * @property {number} PACKED=1 PACKED value + * @property {number} EXPANDED=2 EXPANDED value + */ + FeatureSet.RepeatedFieldEncoding = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "REPEATED_FIELD_ENCODING_UNKNOWN"] = 0; + values[valuesById[1] = "PACKED"] = 1; + values[valuesById[2] = "EXPANDED"] = 2; + return values; + })(); + + /** + * Utf8Validation enum. + * @name google.protobuf.FeatureSet.Utf8Validation + * @enum {number} + * @property {number} UTF8_VALIDATION_UNKNOWN=0 UTF8_VALIDATION_UNKNOWN value + * @property {number} VERIFY=2 VERIFY value + * @property {number} NONE=3 NONE value + */ + FeatureSet.Utf8Validation = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UTF8_VALIDATION_UNKNOWN"] = 0; + values[valuesById[2] = "VERIFY"] = 2; + values[valuesById[3] = "NONE"] = 3; + return values; + })(); + + /** + * MessageEncoding enum. + * @name google.protobuf.FeatureSet.MessageEncoding + * @enum {number} + * @property {number} MESSAGE_ENCODING_UNKNOWN=0 MESSAGE_ENCODING_UNKNOWN value + * @property {number} LENGTH_PREFIXED=1 LENGTH_PREFIXED value + * @property {number} DELIMITED=2 DELIMITED value + */ + FeatureSet.MessageEncoding = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MESSAGE_ENCODING_UNKNOWN"] = 0; + values[valuesById[1] = "LENGTH_PREFIXED"] = 1; + values[valuesById[2] = "DELIMITED"] = 2; + return values; + })(); + + /** + * JsonFormat enum. + * @name google.protobuf.FeatureSet.JsonFormat + * @enum {number} + * @property {number} JSON_FORMAT_UNKNOWN=0 JSON_FORMAT_UNKNOWN value + * @property {number} ALLOW=1 ALLOW value + * @property {number} LEGACY_BEST_EFFORT=2 LEGACY_BEST_EFFORT value + */ + FeatureSet.JsonFormat = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JSON_FORMAT_UNKNOWN"] = 0; + values[valuesById[1] = "ALLOW"] = 1; + values[valuesById[2] = "LEGACY_BEST_EFFORT"] = 2; + return values; + })(); + + return FeatureSet; + })(); + + protobuf.FeatureSetDefaults = (function() { + + /** + * Properties of a FeatureSetDefaults. + * @memberof google.protobuf + * @interface IFeatureSetDefaults + * @property {Array.|null} [defaults] FeatureSetDefaults defaults + * @property {google.protobuf.Edition|null} [minimumEdition] FeatureSetDefaults minimumEdition + * @property {google.protobuf.Edition|null} [maximumEdition] FeatureSetDefaults maximumEdition + */ + + /** + * Constructs a new FeatureSetDefaults. + * @memberof google.protobuf + * @classdesc Represents a FeatureSetDefaults. + * @implements IFeatureSetDefaults + * @constructor + * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set + */ + function FeatureSetDefaults(properties) { + this.defaults = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSetDefaults defaults. + * @member {Array.} defaults + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.defaults = $util.emptyArray; + + /** + * FeatureSetDefaults minimumEdition. + * @member {google.protobuf.Edition} minimumEdition + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.minimumEdition = 0; + + /** + * FeatureSetDefaults maximumEdition. + * @member {google.protobuf.Edition} maximumEdition + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.maximumEdition = 0; + + /** + * Creates a new FeatureSetDefaults instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults instance + */ + FeatureSetDefaults.create = function create(properties) { + return new FeatureSetDefaults(properties); + }; + + /** + * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetDefaults.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.defaults != null && message.defaults.length) + for (var i = 0; i < message.defaults.length; ++i) + $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.encode(message.defaults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.minimumEdition != null && Object.hasOwnProperty.call(message, "minimumEdition")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.minimumEdition); + if (message.maximumEdition != null && Object.hasOwnProperty.call(message, "maximumEdition")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maximumEdition); + return writer; + }; + + /** + * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetDefaults.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetDefaults.decode = function 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.FeatureSetDefaults(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.defaults && message.defaults.length)) + message.defaults = []; + message.defaults.push($root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.decode(reader, reader.uint32())); + break; + } + case 4: { + message.minimumEdition = reader.int32(); + break; + } + case 5: { + message.maximumEdition = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetDefaults.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSetDefaults message. + * @function verify + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSetDefaults.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.defaults != null && message.hasOwnProperty("defaults")) { + if (!Array.isArray(message.defaults)) + return "defaults: array expected"; + for (var i = 0; i < message.defaults.length; ++i) { + var error = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify(message.defaults[i]); + if (error) + return "defaults." + error; + } + } + if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) + switch (message.minimumEdition) { + default: + return "minimumEdition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) + switch (message.maximumEdition) { + default: + return "maximumEdition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + return null; + }; + + /** + * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + */ + FeatureSetDefaults.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSetDefaults) + return object; + var message = new $root.google.protobuf.FeatureSetDefaults(); + if (object.defaults) { + if (!Array.isArray(object.defaults)) + throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: array expected"); + message.defaults = []; + for (var i = 0; i < object.defaults.length; ++i) { + if (typeof object.defaults[i] !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: object expected"); + message.defaults[i] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.fromObject(object.defaults[i]); + } + } + switch (object.minimumEdition) { + default: + if (typeof object.minimumEdition === "number") { + message.minimumEdition = object.minimumEdition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.minimumEdition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.minimumEdition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.minimumEdition = 999; + break; + case "EDITION_2023": + case 1000: + message.minimumEdition = 1000; + break; + case "EDITION_2024": + case 1001: + message.minimumEdition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.minimumEdition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.minimumEdition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.minimumEdition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.minimumEdition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.minimumEdition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.minimumEdition = 2147483647; + break; + } + switch (object.maximumEdition) { + default: + if (typeof object.maximumEdition === "number") { + message.maximumEdition = object.maximumEdition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.maximumEdition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.maximumEdition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.maximumEdition = 999; + break; + case "EDITION_2023": + case 1000: + message.maximumEdition = 1000; + break; + case "EDITION_2024": + case 1001: + message.maximumEdition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.maximumEdition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.maximumEdition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.maximumEdition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.maximumEdition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.maximumEdition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.maximumEdition = 2147483647; + break; + } + return message; + }; + + /** + * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.FeatureSetDefaults} message FeatureSetDefaults + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSetDefaults.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.defaults = []; + if (options.defaults) { + object.minimumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.maximumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.defaults && message.defaults.length) { + object.defaults = []; + for (var j = 0; j < message.defaults.length; ++j) + object.defaults[j] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.toObject(message.defaults[j], options); + } + if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) + object.minimumEdition = options.enums === String ? $root.google.protobuf.Edition[message.minimumEdition] === undefined ? message.minimumEdition : $root.google.protobuf.Edition[message.minimumEdition] : message.minimumEdition; + if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) + object.maximumEdition = options.enums === String ? $root.google.protobuf.Edition[message.maximumEdition] === undefined ? message.maximumEdition : $root.google.protobuf.Edition[message.maximumEdition] : message.maximumEdition; + return object; + }; + + /** + * Converts this FeatureSetDefaults to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSetDefaults + * @instance + * @returns {Object.} JSON object + */ + FeatureSetDefaults.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSetDefaults + * @function getTypeUrl + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSetDefaults.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults"; + }; + + FeatureSetDefaults.FeatureSetEditionDefault = (function() { + + /** + * Properties of a FeatureSetEditionDefault. + * @memberof google.protobuf.FeatureSetDefaults + * @interface IFeatureSetEditionDefault + * @property {google.protobuf.Edition|null} [edition] FeatureSetEditionDefault edition + * @property {google.protobuf.IFeatureSet|null} [features] FeatureSetEditionDefault features + */ + + /** + * Constructs a new FeatureSetEditionDefault. + * @memberof google.protobuf.FeatureSetDefaults + * @classdesc Represents a FeatureSetEditionDefault. + * @implements IFeatureSetEditionDefault + * @constructor + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set + */ + function FeatureSetEditionDefault(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]]; + } + + /** + * FeatureSetEditionDefault edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + */ + FeatureSetEditionDefault.prototype.edition = 0; + + /** + * FeatureSetEditionDefault features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + */ + FeatureSetEditionDefault.prototype.features = null; + + /** + * Creates a new FeatureSetEditionDefault instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault instance + */ + FeatureSetEditionDefault.create = function create(properties) { + return new FeatureSetEditionDefault(properties); + }; + + /** + * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetEditionDefault.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); + return writer; + }; + + /** + * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetEditionDefault.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetEditionDefault.decode = function 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.FeatureSetDefaults.FeatureSetEditionDefault(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + message.edition = reader.int32(); + break; + } + case 2: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetEditionDefault.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSetEditionDefault message. + * @function verify + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSetEditionDefault.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + return null; + }; + + /** + * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + */ + FeatureSetEditionDefault.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault) + return object; + var message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + return message; + }; + + /** + * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} message FeatureSetEditionDefault + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSetEditionDefault.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.features = null; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this FeatureSetEditionDefault to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + * @returns {Object.} JSON object + */ + FeatureSetEditionDefault.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSetEditionDefault + * @function getTypeUrl + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSetEditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault"; + }; + + return FeatureSetEditionDefault; + })(); + + return FeatureSetDefaults; + })(); + + 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.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.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.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; + })(); + + 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.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; + })(); + + 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/owl-bot-staging/google-cloud-apihub/v1/protos/protos.json b/owl-bot-staging/google-cloud-apihub/v1/protos/protos.json new file mode 100644 index 00000000000..eb17125dfb0 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/protos/protos.json @@ -0,0 +1,6321 @@ +{ + "nested": { + "google": { + "nested": { + "cloud": { + "nested": { + "apihub": { + "nested": { + "v1": { + "options": { + "csharp_namespace": "Google.Cloud.ApiHub.V1", + "go_package": "cloud.google.com/go/apihub/apiv1/apihubpb;apihubpb", + "java_multiple_files": true, + "java_outer_classname": "RuntimeProjectAttachmentServiceProto", + "java_package": "com.google.cloud.apihub.v1", + "php_namespace": "Google\\Cloud\\ApiHub\\V1", + "ruby_package": "Google::Cloud::ApiHub::V1", + "(google.api.resource_definition).type": "aiplatform.googleapis.com/Extension", + "(google.api.resource_definition).pattern": "projects/{project}/locations/{location}/extensions/{extension}" + }, + "nested": { + "ApiHub": { + "options": { + "(google.api.default_host)": "apihub.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "CreateApi": { + "requestType": "CreateApiRequest", + "responseType": "Api", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/apis", + "(google.api.http).body": "api", + "(google.api.method_signature)": "parent,api,api_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/apis", + "body": "api" + } + }, + { + "(google.api.method_signature)": "parent,api,api_id" + } + ] + }, + "GetApi": { + "requestType": "GetApiRequest", + "responseType": "Api", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/apis/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/apis/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListApis": { + "requestType": "ListApisRequest", + "responseType": "ListApisResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/apis", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/apis" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "UpdateApi": { + "requestType": "UpdateApiRequest", + "responseType": "Api", + "options": { + "(google.api.http).patch": "/v1/{api.name=projects/*/locations/*/apis/*}", + "(google.api.http).body": "api", + "(google.api.method_signature)": "api,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{api.name=projects/*/locations/*/apis/*}", + "body": "api" + } + }, + { + "(google.api.method_signature)": "api,update_mask" + } + ] + }, + "DeleteApi": { + "requestType": "DeleteApiRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/apis/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/apis/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateVersion": { + "requestType": "CreateVersionRequest", + "responseType": "Version", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*/apis/*}/versions", + "(google.api.http).body": "version", + "(google.api.method_signature)": "parent,version,version_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*/apis/*}/versions", + "body": "version" + } + }, + { + "(google.api.method_signature)": "parent,version,version_id" + } + ] + }, + "GetVersion": { + "requestType": "GetVersionRequest", + "responseType": "Version", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/apis/*/versions/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/apis/*/versions/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListVersions": { + "requestType": "ListVersionsRequest", + "responseType": "ListVersionsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/apis/*}/versions", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/apis/*}/versions" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "UpdateVersion": { + "requestType": "UpdateVersionRequest", + "responseType": "Version", + "options": { + "(google.api.http).patch": "/v1/{version.name=projects/*/locations/*/apis/*/versions/*}", + "(google.api.http).body": "version", + "(google.api.method_signature)": "version,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{version.name=projects/*/locations/*/apis/*/versions/*}", + "body": "version" + } + }, + { + "(google.api.method_signature)": "version,update_mask" + } + ] + }, + "DeleteVersion": { + "requestType": "DeleteVersionRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/apis/*/versions/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/apis/*/versions/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateSpec": { + "requestType": "CreateSpecRequest", + "responseType": "Spec", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*/apis/*/versions/*}/specs", + "(google.api.http).body": "spec", + "(google.api.method_signature)": "parent,spec,spec_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*/apis/*/versions/*}/specs", + "body": "spec" + } + }, + { + "(google.api.method_signature)": "parent,spec,spec_id" + } + ] + }, + "GetSpec": { + "requestType": "GetSpecRequest", + "responseType": "Spec", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "GetSpecContents": { + "requestType": "GetSpecContentsRequest", + "responseType": "SpecContents", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*}:contents", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*}:contents" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListSpecs": { + "requestType": "ListSpecsRequest", + "responseType": "ListSpecsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/apis/*/versions/*}/specs", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/apis/*/versions/*}/specs" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "UpdateSpec": { + "requestType": "UpdateSpecRequest", + "responseType": "Spec", + "options": { + "(google.api.http).patch": "/v1/{spec.name=projects/*/locations/*/apis/*/versions/*/specs/*}", + "(google.api.http).body": "spec", + "(google.api.method_signature)": "spec,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{spec.name=projects/*/locations/*/apis/*/versions/*/specs/*}", + "body": "spec" + } + }, + { + "(google.api.method_signature)": "spec,update_mask" + } + ] + }, + "DeleteSpec": { + "requestType": "DeleteSpecRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "GetApiOperation": { + "requestType": "GetApiOperationRequest", + "responseType": "ApiOperation", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/apis/*/versions/*/operations/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/apis/*/versions/*/operations/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListApiOperations": { + "requestType": "ListApiOperationsRequest", + "responseType": "ListApiOperationsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/apis/*/versions/*}/operations", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/apis/*/versions/*}/operations" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetDefinition": { + "requestType": "GetDefinitionRequest", + "responseType": "Definition", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/apis/*/versions/*/definitions/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/apis/*/versions/*/definitions/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateDeployment": { + "requestType": "CreateDeploymentRequest", + "responseType": "Deployment", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/deployments", + "(google.api.http).body": "deployment", + "(google.api.method_signature)": "parent,deployment,deployment_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/deployments", + "body": "deployment" + } + }, + { + "(google.api.method_signature)": "parent,deployment,deployment_id" + } + ] + }, + "GetDeployment": { + "requestType": "GetDeploymentRequest", + "responseType": "Deployment", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/deployments/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/deployments/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListDeployments": { + "requestType": "ListDeploymentsRequest", + "responseType": "ListDeploymentsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/deployments", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/deployments" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "UpdateDeployment": { + "requestType": "UpdateDeploymentRequest", + "responseType": "Deployment", + "options": { + "(google.api.http).patch": "/v1/{deployment.name=projects/*/locations/*/deployments/*}", + "(google.api.http).body": "deployment", + "(google.api.method_signature)": "deployment,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{deployment.name=projects/*/locations/*/deployments/*}", + "body": "deployment" + } + }, + { + "(google.api.method_signature)": "deployment,update_mask" + } + ] + }, + "DeleteDeployment": { + "requestType": "DeleteDeploymentRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/deployments/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/deployments/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateAttribute": { + "requestType": "CreateAttributeRequest", + "responseType": "Attribute", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/attributes", + "(google.api.http).body": "attribute", + "(google.api.method_signature)": "parent,attribute,attribute_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/attributes", + "body": "attribute" + } + }, + { + "(google.api.method_signature)": "parent,attribute,attribute_id" + } + ] + }, + "GetAttribute": { + "requestType": "GetAttributeRequest", + "responseType": "Attribute", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/attributes/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/attributes/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateAttribute": { + "requestType": "UpdateAttributeRequest", + "responseType": "Attribute", + "options": { + "(google.api.http).patch": "/v1/{attribute.name=projects/*/locations/*/attributes/*}", + "(google.api.http).body": "attribute", + "(google.api.method_signature)": "attribute,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{attribute.name=projects/*/locations/*/attributes/*}", + "body": "attribute" + } + }, + { + "(google.api.method_signature)": "attribute,update_mask" + } + ] + }, + "DeleteAttribute": { + "requestType": "DeleteAttributeRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/attributes/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/attributes/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListAttributes": { + "requestType": "ListAttributesRequest", + "responseType": "ListAttributesResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/attributes", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/attributes" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "SearchResources": { + "requestType": "SearchResourcesRequest", + "responseType": "SearchResourcesResponse", + "options": { + "(google.api.http).post": "/v1/{location=projects/*/locations/*}:searchResources", + "(google.api.http).body": "*", + "(google.api.method_signature)": "location,query" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{location=projects/*/locations/*}:searchResources", + "body": "*" + } + }, + { + "(google.api.method_signature)": "location,query" + } + ] + }, + "CreateExternalApi": { + "requestType": "CreateExternalApiRequest", + "responseType": "ExternalApi", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/externalApis", + "(google.api.http).body": "external_api", + "(google.api.method_signature)": "parent,external_api,external_api_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/externalApis", + "body": "external_api" + } + }, + { + "(google.api.method_signature)": "parent,external_api,external_api_id" + } + ] + }, + "GetExternalApi": { + "requestType": "GetExternalApiRequest", + "responseType": "ExternalApi", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/externalApis/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/externalApis/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateExternalApi": { + "requestType": "UpdateExternalApiRequest", + "responseType": "ExternalApi", + "options": { + "(google.api.http).patch": "/v1/{external_api.name=projects/*/locations/*/externalApis/*}", + "(google.api.http).body": "external_api", + "(google.api.method_signature)": "external_api,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{external_api.name=projects/*/locations/*/externalApis/*}", + "body": "external_api" + } + }, + { + "(google.api.method_signature)": "external_api,update_mask" + } + ] + }, + "DeleteExternalApi": { + "requestType": "DeleteExternalApiRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/externalApis/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/externalApis/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListExternalApis": { + "requestType": "ListExternalApisRequest", + "responseType": "ListExternalApisResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/externalApis", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/externalApis" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + } + } + }, + "ApiHubDependencies": { + "options": { + "(google.api.default_host)": "apihub.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "CreateDependency": { + "requestType": "CreateDependencyRequest", + "responseType": "Dependency", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/dependencies", + "(google.api.http).body": "dependency", + "(google.api.method_signature)": "parent,dependency,dependency_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/dependencies", + "body": "dependency" + } + }, + { + "(google.api.method_signature)": "parent,dependency,dependency_id" + } + ] + }, + "GetDependency": { + "requestType": "GetDependencyRequest", + "responseType": "Dependency", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/dependencies/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/dependencies/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateDependency": { + "requestType": "UpdateDependencyRequest", + "responseType": "Dependency", + "options": { + "(google.api.http).patch": "/v1/{dependency.name=projects/*/locations/*/dependencies/*}", + "(google.api.http).body": "dependency", + "(google.api.method_signature)": "dependency,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{dependency.name=projects/*/locations/*/dependencies/*}", + "body": "dependency" + } + }, + { + "(google.api.method_signature)": "dependency,update_mask" + } + ] + }, + "DeleteDependency": { + "requestType": "DeleteDependencyRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/dependencies/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/dependencies/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListDependencies": { + "requestType": "ListDependenciesRequest", + "responseType": "ListDependenciesResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/dependencies", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/dependencies" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + } + } + }, + "CreateApiRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "apihub.googleapis.com/Api" + } + }, + "apiId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "api": { + "type": "Api", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetApiRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apihub.googleapis.com/Api" + } + } + } + }, + "UpdateApiRequest": { + "fields": { + "api": { + "type": "Api", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteApiRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apihub.googleapis.com/Api" + } + }, + "force": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListApisRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "apihub.googleapis.com/Api" + } + }, + "filter": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageSize": { + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListApisResponse": { + "fields": { + "apis": { + "rule": "repeated", + "type": "Api", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CreateVersionRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apihub.googleapis.com/Api" + } + }, + "versionId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "version": { + "type": "Version", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetVersionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apihub.googleapis.com/Version" + } + } + } + }, + "UpdateVersionRequest": { + "fields": { + "version": { + "type": "Version", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteVersionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apihub.googleapis.com/Version" + } + }, + "force": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListVersionsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "apihub.googleapis.com/Version" + } + }, + "filter": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageSize": { + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListVersionsResponse": { + "fields": { + "versions": { + "rule": "repeated", + "type": "Version", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CreateSpecRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apihub.googleapis.com/Version" + } + }, + "specId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "spec": { + "type": "Spec", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetSpecRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apihub.googleapis.com/Spec" + } + } + } + }, + "UpdateSpecRequest": { + "fields": { + "spec": { + "type": "Spec", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteSpecRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apihub.googleapis.com/Spec" + } + } + } + }, + "ListSpecsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "apihub.googleapis.com/Spec" + } + }, + "filter": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageSize": { + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListSpecsResponse": { + "fields": { + "specs": { + "rule": "repeated", + "type": "Spec", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetSpecContentsRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apihub.googleapis.com/Spec" + } + } + } + }, + "GetApiOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apihub.googleapis.com/ApiOperation" + } + } + } + }, + "ListApiOperationsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "apihub.googleapis.com/ApiOperation" + } + }, + "filter": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageSize": { + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListApiOperationsResponse": { + "fields": { + "apiOperations": { + "rule": "repeated", + "type": "ApiOperation", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetDefinitionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apihub.googleapis.com/Definition" + } + } + } + }, + "CreateDeploymentRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "apihub.googleapis.com/Deployment" + } + }, + "deploymentId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "deployment": { + "type": "Deployment", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetDeploymentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apihub.googleapis.com/Deployment" + } + } + } + }, + "UpdateDeploymentRequest": { + "fields": { + "deployment": { + "type": "Deployment", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteDeploymentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apihub.googleapis.com/Deployment" + } + } + } + }, + "ListDeploymentsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "apihub.googleapis.com/Deployment" + } + }, + "filter": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageSize": { + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListDeploymentsResponse": { + "fields": { + "deployments": { + "rule": "repeated", + "type": "Deployment", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CreateAttributeRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "apihub.googleapis.com/Attribute" + } + }, + "attributeId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "attribute": { + "type": "Attribute", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetAttributeRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apihub.googleapis.com/Attribute" + } + } + } + }, + "UpdateAttributeRequest": { + "fields": { + "attribute": { + "type": "Attribute", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteAttributeRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apihub.googleapis.com/Attribute" + } + } + } + }, + "ListAttributesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "apihub.googleapis.com/Attribute" + } + }, + "filter": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageSize": { + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListAttributesResponse": { + "fields": { + "attributes": { + "rule": "repeated", + "type": "Attribute", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "SearchResourcesRequest": { + "fields": { + "location": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "query": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "filter": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageSize": { + "type": "int32", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ApiHubResource": { + "oneofs": { + "resource": { + "oneof": [ + "api", + "operation", + "deployment", + "spec", + "definition", + "version" + ] + } + }, + "fields": { + "api": { + "type": "Api", + "id": 1 + }, + "operation": { + "type": "ApiOperation", + "id": 2 + }, + "deployment": { + "type": "Deployment", + "id": 3 + }, + "spec": { + "type": "Spec", + "id": 4 + }, + "definition": { + "type": "Definition", + "id": 5 + }, + "version": { + "type": "Version", + "id": 6 + } + } + }, + "SearchResult": { + "fields": { + "resource": { + "type": "ApiHubResource", + "id": 1 + } + } + }, + "SearchResourcesResponse": { + "fields": { + "searchResults": { + "rule": "repeated", + "type": "SearchResult", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CreateDependencyRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "apihub.googleapis.com/Dependency" + } + }, + "dependencyId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "dependency": { + "type": "Dependency", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetDependencyRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apihub.googleapis.com/Dependency" + } + } + } + }, + "UpdateDependencyRequest": { + "fields": { + "dependency": { + "type": "Dependency", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteDependencyRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apihub.googleapis.com/Dependency" + } + } + } + }, + "ListDependenciesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "apihub.googleapis.com/Dependency" + } + }, + "filter": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageSize": { + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListDependenciesResponse": { + "fields": { + "dependencies": { + "rule": "repeated", + "type": "Dependency", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CreateExternalApiRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "apihub.googleapis.com/ExternalApi" + } + }, + "externalApiId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "externalApi": { + "type": "ExternalApi", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetExternalApiRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apihub.googleapis.com/ExternalApi" + } + } + } + }, + "UpdateExternalApiRequest": { + "fields": { + "externalApi": { + "type": "ExternalApi", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteExternalApiRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apihub.googleapis.com/ExternalApi" + } + } + } + }, + "ListExternalApisRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "apihub.googleapis.com/ExternalApi" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListExternalApisResponse": { + "fields": { + "externalApis": { + "rule": "repeated", + "type": "ExternalApi", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "LintState": { + "values": { + "LINT_STATE_UNSPECIFIED": 0, + "LINT_STATE_SUCCESS": 1, + "LINT_STATE_ERROR": 2 + } + }, + "Linter": { + "values": { + "LINTER_UNSPECIFIED": 0, + "SPECTRAL": 1, + "OTHER": 2 + } + }, + "Severity": { + "values": { + "SEVERITY_UNSPECIFIED": 0, + "SEVERITY_ERROR": 1, + "SEVERITY_WARNING": 2, + "SEVERITY_INFO": 3, + "SEVERITY_HINT": 4 + } + }, + "Api": { + "options": { + "(google.api.resource).type": "apihub.googleapis.com/Api", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/apis/{api}", + "(google.api.resource).plural": "apis", + "(google.api.resource).singular": "api" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "documentation": { + "type": "Documentation", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "owner": { + "type": "Owner", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "versions": { + "rule": "repeated", + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "apihub.googleapis.com/Version" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "targetUser": { + "type": "AttributeValues", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "team": { + "type": "AttributeValues", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "businessUnit": { + "type": "AttributeValues", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "maturityLevel": { + "type": "AttributeValues", + "id": 12, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "attributes": { + "keyType": "string", + "type": "AttributeValues", + "id": 13, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "apiStyle": { + "type": "AttributeValues", + "id": 14, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "selectedVersion": { + "type": "string", + "id": 15, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "apihub.googleapis.com/Version" + } + } + } + }, + "Version": { + "options": { + "(google.api.resource).type": "apihub.googleapis.com/Version", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/apis/{api}/versions/{version}", + "(google.api.resource).plural": "versions", + "(google.api.resource).singular": "version" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "documentation": { + "type": "Documentation", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "specs": { + "rule": "repeated", + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "apihub.googleapis.com/Spec" + } + }, + "apiOperations": { + "rule": "repeated", + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "apihub.googleapis.com/ApiOperation" + } + }, + "definitions": { + "rule": "repeated", + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "apihub.googleapis.com/Definition" + } + }, + "deployments": { + "rule": "repeated", + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "apihub.googleapis.com/Deployment" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "lifecycle": { + "type": "AttributeValues", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "compliance": { + "type": "AttributeValues", + "id": 12, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "accreditation": { + "type": "AttributeValues", + "id": 13, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "attributes": { + "keyType": "string", + "type": "AttributeValues", + "id": 14, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "selectedDeployment": { + "type": "string", + "id": 16, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "apihub.googleapis.com/Deployment" + } + } + } + }, + "Spec": { + "options": { + "(google.api.resource).type": "apihub.googleapis.com/Spec", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}", + "(google.api.resource).plural": "specs", + "(google.api.resource).singular": "spec" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "specType": { + "type": "AttributeValues", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "contents": { + "type": "SpecContents", + "id": 4, + "options": { + "(google.api.field_behavior)": "INPUT_ONLY" + } + }, + "details": { + "type": "SpecDetails", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "sourceUri": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "lintResponse": { + "type": "LintResponse", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "attributes": { + "keyType": "string", + "type": "AttributeValues", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "documentation": { + "type": "Documentation", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "parsingMode": { + "type": "ParsingMode", + "id": 12, + "options": { + "(google.api.field_behavior)": "INPUT_ONLY" + } + } + }, + "nested": { + "ParsingMode": { + "values": { + "PARSING_MODE_UNSPECIFIED": 0, + "RELAXED": 1, + "STRICT": 2 + } + } + } + }, + "Deployment": { + "options": { + "(google.api.resource).type": "apihub.googleapis.com/Deployment", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/deployments/{deployment}", + "(google.api.resource).plural": "deployments", + "(google.api.resource).singular": "deployment" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "documentation": { + "type": "Documentation", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "deploymentType": { + "type": "AttributeValues", + "id": 5, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "resourceUri": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "endpoints": { + "rule": "repeated", + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "apiVersions": { + "rule": "repeated", + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "slo": { + "type": "AttributeValues", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "environment": { + "type": "AttributeValues", + "id": 12, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "attributes": { + "keyType": "string", + "type": "AttributeValues", + "id": 13, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ApiOperation": { + "options": { + "(google.api.resource).type": "apihub.googleapis.com/ApiOperation", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}", + "(google.api.resource).plural": "apiOperations", + "(google.api.resource).singular": "apiOperation" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "spec": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "apihub.googleapis.com/Spec" + } + }, + "details": { + "type": "OperationDetails", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "attributes": { + "keyType": "string", + "type": "AttributeValues", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "Definition": { + "options": { + "(google.api.resource).type": "apihub.googleapis.com/Definition", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}", + "(google.api.resource).plural": "definitions", + "(google.api.resource).singular": "definition" + }, + "oneofs": { + "value": { + "oneof": [ + "schema" + ] + } + }, + "fields": { + "schema": { + "type": "Schema", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "spec": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "apihub.googleapis.com/Spec" + } + }, + "type": { + "type": "Type", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "attributes": { + "keyType": "string", + "type": "AttributeValues", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "SCHEMA": 1 + } + } + } + }, + "Attribute": { + "options": { + "(google.api.resource).type": "apihub.googleapis.com/Attribute", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/attributes/{attribute}", + "(google.api.resource).plural": "attributes", + "(google.api.resource).singular": "attribute" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "definitionType": { + "type": "DefinitionType", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "scope": { + "type": "Scope", + "id": 5, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "dataType": { + "type": "DataType", + "id": 6, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "allowedValues": { + "rule": "repeated", + "type": "AllowedValue", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "cardinality": { + "type": "int32", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "mandatory": { + "type": "bool", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "AllowedValue": { + "fields": { + "id": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "immutable": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DefinitionType": { + "values": { + "DEFINITION_TYPE_UNSPECIFIED": 0, + "SYSTEM_DEFINED": 1, + "USER_DEFINED": 2 + } + }, + "Scope": { + "values": { + "SCOPE_UNSPECIFIED": 0, + "API": 1, + "VERSION": 2, + "SPEC": 3, + "API_OPERATION": 4, + "DEPLOYMENT": 5, + "DEPENDENCY": 6, + "DEFINITION": 7, + "EXTERNAL_API": 8, + "PLUGIN": 9 + } + }, + "DataType": { + "values": { + "DATA_TYPE_UNSPECIFIED": 0, + "ENUM": 1, + "JSON": 2, + "STRING": 3 + } + } + } + }, + "SpecContents": { + "fields": { + "contents": { + "type": "bytes", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "mimeType": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "SpecDetails": { + "oneofs": { + "details": { + "oneof": [ + "openApiSpecDetails" + ] + } + }, + "fields": { + "openApiSpecDetails": { + "type": "OpenApiSpecDetails", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "description": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "OpenApiSpecDetails": { + "fields": { + "format": { + "type": "Format", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "version": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "owner": { + "type": "Owner", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "Format": { + "values": { + "FORMAT_UNSPECIFIED": 0, + "OPEN_API_SPEC_2_0": 1, + "OPEN_API_SPEC_3_0": 2, + "OPEN_API_SPEC_3_1": 3 + } + } + } + }, + "OperationDetails": { + "oneofs": { + "operation": { + "oneof": [ + "httpOperation" + ] + } + }, + "fields": { + "httpOperation": { + "type": "HttpOperation", + "id": 4 + }, + "description": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "documentation": { + "type": "Documentation", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "HttpOperation": { + "fields": { + "path": { + "type": "Path", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "method": { + "type": "Method", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "Method": { + "values": { + "METHOD_UNSPECIFIED": 0, + "GET": 1, + "PUT": 2, + "POST": 3, + "DELETE": 4, + "OPTIONS": 5, + "HEAD": 6, + "PATCH": 7, + "TRACE": 8 + } + } + } + }, + "Path": { + "fields": { + "path": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "description": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "Schema": { + "fields": { + "displayName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "rawValue": { + "type": "bytes", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "Owner": { + "fields": { + "displayName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "email": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "Documentation": { + "fields": { + "externalUri": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "AttributeValues": { + "oneofs": { + "Value": { + "oneof": [ + "enumValues", + "stringValues", + "jsonValues" + ] + } + }, + "fields": { + "enumValues": { + "type": "EnumAttributeValues", + "id": 2 + }, + "stringValues": { + "type": "StringAttributeValues", + "id": 3 + }, + "jsonValues": { + "type": "StringAttributeValues", + "id": 4 + }, + "attribute": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "apihub.googleapis.com/Attribute" + } + } + }, + "nested": { + "EnumAttributeValues": { + "fields": { + "values": { + "rule": "repeated", + "type": "Attribute.AllowedValue", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "StringAttributeValues": { + "fields": { + "values": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + } + } + }, + "Dependency": { + "options": { + "(google.api.resource).type": "apihub.googleapis.com/Dependency", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/dependencies/{dependency}", + "(google.api.resource).plural": "dependencies", + "(google.api.resource).singular": "dependency" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "consumer": { + "type": "DependencyEntityReference", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "supplier": { + "type": "DependencyEntityReference", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "state": { + "type": "State", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "description": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "discoveryMode": { + "type": "DiscoveryMode", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "errorDetail": { + "type": "DependencyErrorDetail", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "attributes": { + "keyType": "string", + "type": "AttributeValues", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "PROPOSED": 1, + "VALIDATED": 2 + } + }, + "DiscoveryMode": { + "values": { + "DISCOVERY_MODE_UNSPECIFIED": 0, + "MANUAL": 1 + } + } + } + }, + "DependencyEntityReference": { + "oneofs": { + "identifier": { + "oneof": [ + "operationResourceName", + "externalApiResourceName" + ] + } + }, + "fields": { + "operationResourceName": { + "type": "string", + "id": 2 + }, + "externalApiResourceName": { + "type": "string", + "id": 3 + }, + "displayName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "DependencyErrorDetail": { + "fields": { + "error": { + "type": "Error", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "errorTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "Error": { + "values": { + "ERROR_UNSPECIFIED": 0, + "SUPPLIER_NOT_FOUND": 1, + "SUPPLIER_RECREATED": 2 + } + } + } + }, + "LintResponse": { + "fields": { + "issues": { + "rule": "repeated", + "type": "Issue", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "summary": { + "rule": "repeated", + "type": "SummaryEntry", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "state": { + "type": "LintState", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "source": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "linter": { + "type": "Linter", + "id": 5, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "SummaryEntry": { + "fields": { + "severity": { + "type": "Severity", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "count": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + } + } + }, + "Issue": { + "fields": { + "code": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "path": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "message": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "severity": { + "type": "Severity", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "range": { + "type": "Range", + "id": 5, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "Range": { + "fields": { + "start": { + "type": "Point", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "end": { + "type": "Point", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "Point": { + "fields": { + "line": { + "type": "int32", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "character": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "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" + } + } + } + }, + "ApiHubInstance": { + "options": { + "(google.api.resource).type": "apihub.googleapis.com/ApiHubInstance", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/apiHubInstances/{api_hub_instance}", + "(google.api.resource).plural": "apiHubInstances", + "(google.api.resource).singular": "apiHubInstance" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "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" + } + }, + "state": { + "type": "State", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "stateMessage": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "config": { + "type": "Config", + "id": 6, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "description": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "Config": { + "fields": { + "cmekKeyName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "INACTIVE": 1, + "CREATING": 2, + "ACTIVE": 3, + "UPDATING": 4, + "DELETING": 5, + "FAILED": 6 + } + } + } + }, + "ExternalApi": { + "options": { + "(google.api.resource).type": "apihub.googleapis.com/ExternalApi", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/externalApis/{external_api}", + "(google.api.resource).plural": "externalApis", + "(google.api.resource).singular": "externalApi" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "endpoints": { + "rule": "repeated", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "paths": { + "rule": "repeated", + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "documentation": { + "type": "Documentation", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "attributes": { + "keyType": "string", + "type": "AttributeValues", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "HostProjectRegistrationService": { + "options": { + "(google.api.default_host)": "apihub.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "CreateHostProjectRegistration": { + "requestType": "CreateHostProjectRegistrationRequest", + "responseType": "HostProjectRegistration", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/hostProjectRegistrations", + "(google.api.http).body": "host_project_registration", + "(google.api.method_signature)": "parent,host_project_registration,host_project_registration_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/hostProjectRegistrations", + "body": "host_project_registration" + } + }, + { + "(google.api.method_signature)": "parent,host_project_registration,host_project_registration_id" + } + ] + }, + "GetHostProjectRegistration": { + "requestType": "GetHostProjectRegistrationRequest", + "responseType": "HostProjectRegistration", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/hostProjectRegistrations/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/hostProjectRegistrations/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListHostProjectRegistrations": { + "requestType": "ListHostProjectRegistrationsRequest", + "responseType": "ListHostProjectRegistrationsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/hostProjectRegistrations", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/hostProjectRegistrations" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + } + } + }, + "CreateHostProjectRegistrationRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "apihub.googleapis.com/HostProjectRegistration" + } + }, + "hostProjectRegistrationId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "hostProjectRegistration": { + "type": "HostProjectRegistration", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetHostProjectRegistrationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apihub.googleapis.com/HostProjectRegistration" + } + } + } + }, + "ListHostProjectRegistrationsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "apihub.googleapis.com/HostProjectRegistration" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "orderBy": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListHostProjectRegistrationsResponse": { + "fields": { + "hostProjectRegistrations": { + "rule": "repeated", + "type": "HostProjectRegistration", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "HostProjectRegistration": { + "options": { + "(google.api.resource).type": "apihub.googleapis.com/HostProjectRegistration", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/hostProjectRegistrations/{host_project_registration}", + "(google.api.resource).plural": "hostProjectRegistrations", + "(google.api.resource).singular": "hostProjectRegistration" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "gcpProject": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "IMMUTABLE", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "LintingService": { + "options": { + "(google.api.default_host)": "apihub.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "GetStyleGuide": { + "requestType": "GetStyleGuideRequest", + "responseType": "StyleGuide", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/plugins/*/styleGuide}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/plugins/*/styleGuide}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateStyleGuide": { + "requestType": "UpdateStyleGuideRequest", + "responseType": "StyleGuide", + "options": { + "(google.api.http).patch": "/v1/{style_guide.name=projects/*/locations/*/plugins/*/styleGuide}", + "(google.api.http).body": "style_guide", + "(google.api.method_signature)": "style_guide,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{style_guide.name=projects/*/locations/*/plugins/*/styleGuide}", + "body": "style_guide" + } + }, + { + "(google.api.method_signature)": "style_guide,update_mask" + } + ] + }, + "GetStyleGuideContents": { + "requestType": "GetStyleGuideContentsRequest", + "responseType": "StyleGuideContents", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/plugins/*/styleGuide}:contents", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/plugins/*/styleGuide}:contents" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "LintSpec": { + "requestType": "LintSpecRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*}:lint", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*}:lint", + "body": "*" + } + } + ] + } + } + }, + "GetStyleGuideRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apihub.googleapis.com/StyleGuide" + } + } + } + }, + "UpdateStyleGuideRequest": { + "fields": { + "styleGuide": { + "type": "StyleGuide", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "GetStyleGuideContentsRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apihub.googleapis.com/StyleGuide" + } + } + } + }, + "LintSpecRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apihub.googleapis.com/Spec" + } + } + } + }, + "StyleGuideContents": { + "fields": { + "contents": { + "type": "bytes", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "mimeType": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "StyleGuide": { + "options": { + "(google.api.resource).type": "apihub.googleapis.com/StyleGuide", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/plugins/{plugin}/styleGuide", + "(google.api.resource).plural": "styleGuides", + "(google.api.resource).singular": "styleGuide" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "linter": { + "type": "Linter", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "contents": { + "type": "StyleGuideContents", + "id": 3, + "options": { + "(google.api.field_behavior)": "INPUT_ONLY" + } + } + } + }, + "ApiHubPlugin": { + "options": { + "(google.api.default_host)": "apihub.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "GetPlugin": { + "requestType": "GetPluginRequest", + "responseType": "Plugin", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/plugins/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/plugins/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "EnablePlugin": { + "requestType": "EnablePluginRequest", + "responseType": "Plugin", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/plugins/*}:enable", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/plugins/*}:enable", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "DisablePlugin": { + "requestType": "DisablePluginRequest", + "responseType": "Plugin", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/plugins/*}:disable", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/plugins/*}:disable", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + } + } + }, + "Plugin": { + "options": { + "(google.api.resource).type": "apihub.googleapis.com/Plugin", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/plugins/{plugin}", + "(google.api.resource).plural": "plugins", + "(google.api.resource).singular": "plugin" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "type": { + "type": "AttributeValues", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "state": { + "type": "State", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "ENABLED": 1, + "DISABLED": 2 + } + } + } + }, + "GetPluginRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apihub.googleapis.com/Plugin" + } + } + } + }, + "EnablePluginRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apihub.googleapis.com/Plugin" + } + } + } + }, + "DisablePluginRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apihub.googleapis.com/Plugin" + } + } + } + }, + "Provisioning": { + "options": { + "(google.api.default_host)": "apihub.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "CreateApiHubInstance": { + "requestType": "CreateApiHubInstanceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/apiHubInstances", + "(google.api.http).body": "api_hub_instance", + "(google.api.method_signature)": "parent,api_hub_instance,api_hub_instance_id", + "(google.longrunning.operation_info).response_type": "ApiHubInstance", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/apiHubInstances", + "body": "api_hub_instance" + } + }, + { + "(google.api.method_signature)": "parent,api_hub_instance,api_hub_instance_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "ApiHubInstance", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "GetApiHubInstance": { + "requestType": "GetApiHubInstanceRequest", + "responseType": "ApiHubInstance", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/apiHubInstances/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/apiHubInstances/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "LookupApiHubInstance": { + "requestType": "LookupApiHubInstanceRequest", + "responseType": "LookupApiHubInstanceResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/apiHubInstances:lookup", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/apiHubInstances:lookup" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + } + } + }, + "CreateApiHubInstanceRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "apiHubInstanceId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "apiHubInstance": { + "type": "ApiHubInstance", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetApiHubInstanceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apihub.googleapis.com/ApiHubInstance" + } + } + } + }, + "LookupApiHubInstanceRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "apihub.googleapis.com/ApiHubInstance" + } + } + } + }, + "LookupApiHubInstanceResponse": { + "fields": { + "apiHubInstance": { + "type": "ApiHubInstance", + "id": 1 + } + } + }, + "RuntimeProjectAttachmentService": { + "options": { + "(google.api.default_host)": "apihub.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "CreateRuntimeProjectAttachment": { + "requestType": "CreateRuntimeProjectAttachmentRequest", + "responseType": "RuntimeProjectAttachment", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/runtimeProjectAttachments", + "(google.api.http).body": "runtime_project_attachment", + "(google.api.method_signature)": "parent,runtime_project_attachment,runtime_project_attachment_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/runtimeProjectAttachments", + "body": "runtime_project_attachment" + } + }, + { + "(google.api.method_signature)": "parent,runtime_project_attachment,runtime_project_attachment_id" + } + ] + }, + "GetRuntimeProjectAttachment": { + "requestType": "GetRuntimeProjectAttachmentRequest", + "responseType": "RuntimeProjectAttachment", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/runtimeProjectAttachments/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/runtimeProjectAttachments/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListRuntimeProjectAttachments": { + "requestType": "ListRuntimeProjectAttachmentsRequest", + "responseType": "ListRuntimeProjectAttachmentsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/runtimeProjectAttachments", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/runtimeProjectAttachments" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "DeleteRuntimeProjectAttachment": { + "requestType": "DeleteRuntimeProjectAttachmentRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/runtimeProjectAttachments/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/runtimeProjectAttachments/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "LookupRuntimeProjectAttachment": { + "requestType": "LookupRuntimeProjectAttachmentRequest", + "responseType": "LookupRuntimeProjectAttachmentResponse", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*}:lookupRuntimeProjectAttachment", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*}:lookupRuntimeProjectAttachment" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + } + } + }, + "CreateRuntimeProjectAttachmentRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "apihub.googleapis.com/RuntimeProjectAttachment" + } + }, + "runtimeProjectAttachmentId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "runtimeProjectAttachment": { + "type": "RuntimeProjectAttachment", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetRuntimeProjectAttachmentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apihub.googleapis.com/RuntimeProjectAttachment" + } + } + } + }, + "ListRuntimeProjectAttachmentsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "apihub.googleapis.com/RuntimeProjectAttachment" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "orderBy": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListRuntimeProjectAttachmentsResponse": { + "fields": { + "runtimeProjectAttachments": { + "rule": "repeated", + "type": "RuntimeProjectAttachment", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "DeleteRuntimeProjectAttachmentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apihub.googleapis.com/RuntimeProjectAttachment" + } + } + } + }, + "LookupRuntimeProjectAttachmentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + } + } + }, + "LookupRuntimeProjectAttachmentResponse": { + "fields": { + "runtimeProjectAttachment": { + "type": "RuntimeProjectAttachment", + "id": 1 + } + } + }, + "RuntimeProjectAttachment": { + "options": { + "(google.api.resource).type": "apihub.googleapis.com/RuntimeProjectAttachment", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}", + "(google.api.resource).plural": "runtimeProjectAttachments", + "(google.api.resource).singular": "runtimeProjectAttachment" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "runtimeProject": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "IMMUTABLE", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + } + } + } + } + } + } + }, + "api": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", + "java_multiple_files": true, + "java_outer_classname": "ResourceProto", + "java_package": "com.google.api", + "objc_class_prefix": "GAPI", + "cc_enable_arenas": true + }, + "nested": { + "http": { + "type": "HttpRule", + "id": 72295728, + "extend": "google.protobuf.MethodOptions" + }, + "Http": { + "fields": { + "rules": { + "rule": "repeated", + "type": "HttpRule", + "id": 1 + }, + "fullyDecodeReservedExpansion": { + "type": "bool", + "id": 2 + } + } + }, + "HttpRule": { + "oneofs": { + "pattern": { + "oneof": [ + "get", + "put", + "post", + "delete", + "patch", + "custom" + ] + } + }, + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "get": { + "type": "string", + "id": 2 + }, + "put": { + "type": "string", + "id": 3 + }, + "post": { + "type": "string", + "id": 4 + }, + "delete": { + "type": "string", + "id": 5 + }, + "patch": { + "type": "string", + "id": 6 + }, + "custom": { + "type": "CustomHttpPattern", + "id": 8 + }, + "body": { + "type": "string", + "id": 7 + }, + "responseBody": { + "type": "string", + "id": 12 + }, + "additionalBindings": { + "rule": "repeated", + "type": "HttpRule", + "id": 11 + } + } + }, + "CustomHttpPattern": { + "fields": { + "kind": { + "type": "string", + "id": 1 + }, + "path": { + "type": "string", + "id": 2 + } + } + }, + "methodSignature": { + "rule": "repeated", + "type": "string", + "id": 1051, + "extend": "google.protobuf.MethodOptions" + }, + "defaultHost": { + "type": "string", + "id": 1049, + "extend": "google.protobuf.ServiceOptions" + }, + "oauthScopes": { + "type": "string", + "id": 1050, + "extend": "google.protobuf.ServiceOptions" + }, + "apiVersion": { + "type": "string", + "id": 525000001, + "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 + }, + "protoReferenceDocumentationUri": { + "type": "string", + "id": 110 + }, + "restReferenceDocumentationUri": { + "type": "string", + "id": 111 + } + } + }, + "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 + }, + "renamedServices": { + "keyType": "string", + "type": "string", + "id": 2 + }, + "renamedResources": { + "keyType": "string", + "type": "string", + "id": 3 + }, + "ignoredResources": { + "rule": "repeated", + "type": "string", + "id": 4 + }, + "forcedNamespaceAliases": { + "rule": "repeated", + "type": "string", + "id": 5 + }, + "handwrittenSignatures": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + }, + "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 + }, + "autoPopulatedFields": { + "rule": "repeated", + "type": "string", + "id": 3 + } + }, + "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, + "SHOPPING": 5, + "GEO": 6, + "GENERATIVE_AI": 7 + } + }, + "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 + } + }, + "fieldBehavior": { + "rule": "repeated", + "type": "google.api.FieldBehavior", + "id": 1052, + "extend": "google.protobuf.FieldOptions", + "options": { + "packed": false + } + }, + "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, + "IDENTIFIER": 8 + } + }, + "resourceReference": { + "type": "google.api.ResourceReference", + "id": 1055, + "extend": "google.protobuf.FieldOptions" + }, + "resourceDefinition": { + "rule": "repeated", + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.FileOptions" + }, + "resource": { + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.MessageOptions" + }, + "ResourceDescriptor": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "pattern": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "nameField": { + "type": "string", + "id": 3 + }, + "history": { + "type": "History", + "id": 4 + }, + "plural": { + "type": "string", + "id": 5 + }, + "singular": { + "type": "string", + "id": 6 + }, + "style": { + "rule": "repeated", + "type": "Style", + "id": 10 + } + }, + "nested": { + "History": { + "values": { + "HISTORY_UNSPECIFIED": 0, + "ORIGINALLY_SINGLE_PATTERN": 1, + "FUTURE_MULTI_PATTERN": 2 + } + }, + "Style": { + "values": { + "STYLE_UNSPECIFIED": 0, + "DECLARATIVE_FRIENDLY": 1 + } + } + } + }, + "ResourceReference": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "childType": { + "type": "string", + "id": 2 + } + } + } + } + }, + "protobuf": { + "options": { + "go_package": "google.golang.org/protobuf/types/descriptorpb", + "java_package": "com.google.protobuf", + "java_outer_classname": "DescriptorProtos", + "csharp_namespace": "Google.Protobuf.Reflection", + "objc_class_prefix": "GPB", + "cc_enable_arenas": true, + "optimize_for": "SPEED" + }, + "nested": { + "FileDescriptorSet": { + "fields": { + "file": { + "rule": "repeated", + "type": "FileDescriptorProto", + "id": 1 + } + } + }, + "Edition": { + "values": { + "EDITION_UNKNOWN": 0, + "EDITION_PROTO2": 998, + "EDITION_PROTO3": 999, + "EDITION_2023": 1000, + "EDITION_2024": 1001, + "EDITION_1_TEST_ONLY": 1, + "EDITION_2_TEST_ONLY": 2, + "EDITION_99997_TEST_ONLY": 99997, + "EDITION_99998_TEST_ONLY": 99998, + "EDITION_99999_TEST_ONLY": 99999, + "EDITION_MAX": 2147483647 + } + }, + "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": "Edition", + "id": 14 + } + } + }, + "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 + }, + "declaration": { + "rule": "repeated", + "type": "Declaration", + "id": 2, + "options": { + "retention": "RETENTION_SOURCE" + } + }, + "features": { + "type": "FeatureSet", + "id": 50 + }, + "verification": { + "type": "VerificationState", + "id": 3, + "options": { + "default": "UNVERIFIED", + "retention": "RETENTION_SOURCE" + } + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "Declaration": { + "fields": { + "number": { + "type": "int32", + "id": 1 + }, + "fullName": { + "type": "string", + "id": 2 + }, + "type": { + "type": "string", + "id": 3 + }, + "reserved": { + "type": "bool", + "id": 5 + }, + "repeated": { + "type": "bool", + "id": 6 + } + }, + "reserved": [ + [ + 4, + 4 + ] + ] + }, + "VerificationState": { + "values": { + "DECLARATION": 0, + "UNVERIFIED": 1 + } + } + } + }, + "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_REPEATED": 3, + "LABEL_REQUIRED": 2 + } + } + } + }, + "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 + } + }, + "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 + }, + "features": { + "type": "FeatureSet", + "id": 50 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 42, + 42 + ], + [ + 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 + } + }, + "features": { + "type": "FeatureSet", + "id": 12 + }, + "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 + }, + "targets": { + "rule": "repeated", + "type": "OptionTargetType", + "id": 19, + "options": { + "packed": false + } + }, + "editionDefaults": { + "rule": "repeated", + "type": "EditionDefault", + "id": 20 + }, + "features": { + "type": "FeatureSet", + "id": 21 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ], + [ + 18, + 18 + ] + ], + "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 + } + }, + "EditionDefault": { + "fields": { + "edition": { + "type": "Edition", + "id": 3 + }, + "value": { + "type": "string", + "id": 2 + } + } + } + } + }, + "OneofOptions": { + "fields": { + "features": { + "type": "FeatureSet", + "id": 1 + }, + "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 + } + }, + "features": { + "type": "FeatureSet", + "id": 7 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 5, + 5 + ] + ] + }, + "EnumValueOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "features": { + "type": "FeatureSet", + "id": 2 + }, + "debugRedact": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "ServiceOptions": { + "fields": { + "features": { + "type": "FeatureSet", + "id": 34 + }, + "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" + } + }, + "features": { + "type": "FeatureSet", + "id": 35 + }, + "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 + } + } + } + } + }, + "FeatureSet": { + "fields": { + "fieldPresence": { + "type": "FieldPresence", + "id": 1, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_2023", + "edition_defaults.value": "EXPLICIT" + } + }, + "enumType": { + "type": "EnumType", + "id": 2, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "OPEN" + } + }, + "repeatedFieldEncoding": { + "type": "RepeatedFieldEncoding", + "id": 3, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "PACKED" + } + }, + "utf8Validation": { + "type": "Utf8Validation", + "id": 4, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "VERIFY" + } + }, + "messageEncoding": { + "type": "MessageEncoding", + "id": 5, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO2", + "edition_defaults.value": "LENGTH_PREFIXED" + } + }, + "jsonFormat": { + "type": "JsonFormat", + "id": 6, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "ALLOW" + } + } + }, + "extensions": [ + [ + 1000, + 1000 + ], + [ + 1001, + 1001 + ], + [ + 1002, + 1002 + ], + [ + 9990, + 9990 + ], + [ + 9995, + 9999 + ], + [ + 10000, + 10000 + ] + ], + "reserved": [ + [ + 999, + 999 + ] + ], + "nested": { + "FieldPresence": { + "values": { + "FIELD_PRESENCE_UNKNOWN": 0, + "EXPLICIT": 1, + "IMPLICIT": 2, + "LEGACY_REQUIRED": 3 + } + }, + "EnumType": { + "values": { + "ENUM_TYPE_UNKNOWN": 0, + "OPEN": 1, + "CLOSED": 2 + } + }, + "RepeatedFieldEncoding": { + "values": { + "REPEATED_FIELD_ENCODING_UNKNOWN": 0, + "PACKED": 1, + "EXPANDED": 2 + } + }, + "Utf8Validation": { + "values": { + "UTF8_VALIDATION_UNKNOWN": 0, + "VERIFY": 2, + "NONE": 3 + } + }, + "MessageEncoding": { + "values": { + "MESSAGE_ENCODING_UNKNOWN": 0, + "LENGTH_PREFIXED": 1, + "DELIMITED": 2 + } + }, + "JsonFormat": { + "values": { + "JSON_FORMAT_UNKNOWN": 0, + "ALLOW": 1, + "LEGACY_BEST_EFFORT": 2 + } + } + } + }, + "FeatureSetDefaults": { + "fields": { + "defaults": { + "rule": "repeated", + "type": "FeatureSetEditionDefault", + "id": 1 + }, + "minimumEdition": { + "type": "Edition", + "id": 4 + }, + "maximumEdition": { + "type": "Edition", + "id": 5 + } + }, + "nested": { + "FeatureSetEditionDefault": { + "fields": { + "edition": { + "type": "Edition", + "id": 3 + }, + "features": { + "type": "FeatureSet", + "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 + } + } + } + } + } + }, + "Duration": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Timestamp": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Empty": { + "fields": {} + }, + "FieldMask": { + "fields": { + "paths": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "Any": { + "fields": { + "type_url": { + "type": "string", + "id": 1 + }, + "value": { + "type": "bytes", + "id": 2 + } + } + } + } + }, + "longrunning": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.LongRunning", + "go_package": "cloud.google.com/go/longrunning/autogen/longrunningpb;longrunningpb", + "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/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.create_api.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.create_api.js new file mode 100644 index 00000000000..8d57347c734 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.create_api.js @@ -0,0 +1,77 @@ +// Copyright 2024 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, api) { + // [START apihub_v1_generated_ApiHub_CreateApi_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 parent resource for the API resource. + * Format: `projects/{project}/locations/{location}` + */ + // const parent = 'abc123' + /** + * Optional. The ID to use for the API resource, which will become the final + * component of the API's resource name. This field is optional. + * * If provided, the same will be used. The service will throw an error if + * the specified id is already used by another API resource in the API hub. + * * If not provided, a system generated id will be used. + * This value should be 4-500 characters, and valid characters + * are /[a-z][A-Z][0-9]-_/. + */ + // const apiId = 'abc123' + /** + * Required. The API resource to create. + */ + // const api = {} + + // Imports the Apihub library + const {ApiHubClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new ApiHubClient(); + + async function callCreateApi() { + // Construct request + const request = { + parent, + api, + }; + + // Run request + const response = await apihubClient.createApi(request); + console.log(response); + } + + callCreateApi(); + // [END apihub_v1_generated_ApiHub_CreateApi_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.create_attribute.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.create_attribute.js new file mode 100644 index 00000000000..63be01f4e72 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.create_attribute.js @@ -0,0 +1,78 @@ +// Copyright 2024 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, attribute) { + // [START apihub_v1_generated_ApiHub_CreateAttribute_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 parent resource for Attribute. + * Format: `projects/{project}/locations/{location}` + */ + // const parent = 'abc123' + /** + * Optional. The ID to use for the attribute, which will become the final + * component of the attribute's resource name. This field is optional. + * * If provided, the same will be used. The service will throw an error if + * the specified id is already used by another attribute resource in the API + * hub. + * * If not provided, a system generated id will be used. + * This value should be 4-500 characters, and valid characters + * are /[a-z][A-Z][0-9]-_/. + */ + // const attributeId = 'abc123' + /** + * Required. The attribute to create. + */ + // const attribute = {} + + // Imports the Apihub library + const {ApiHubClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new ApiHubClient(); + + async function callCreateAttribute() { + // Construct request + const request = { + parent, + attribute, + }; + + // Run request + const response = await apihubClient.createAttribute(request); + console.log(response); + } + + callCreateAttribute(); + // [END apihub_v1_generated_ApiHub_CreateAttribute_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.create_deployment.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.create_deployment.js new file mode 100644 index 00000000000..a9a8f0206fd --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.create_deployment.js @@ -0,0 +1,78 @@ +// Copyright 2024 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, deployment) { + // [START apihub_v1_generated_ApiHub_CreateDeployment_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 parent resource for the deployment resource. + * Format: `projects/{project}/locations/{location}` + */ + // const parent = 'abc123' + /** + * Optional. The ID to use for the deployment resource, which will become the + * final component of the deployment's resource name. This field is optional. + * * If provided, the same will be used. The service will throw an error if + * the specified id is already used by another deployment resource in the API + * hub. + * * If not provided, a system generated id will be used. + * This value should be 4-500 characters, and valid characters + * are /[a-z][A-Z][0-9]-_/. + */ + // const deploymentId = 'abc123' + /** + * Required. The deployment resource to create. + */ + // const deployment = {} + + // Imports the Apihub library + const {ApiHubClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new ApiHubClient(); + + async function callCreateDeployment() { + // Construct request + const request = { + parent, + deployment, + }; + + // Run request + const response = await apihubClient.createDeployment(request); + console.log(response); + } + + callCreateDeployment(); + // [END apihub_v1_generated_ApiHub_CreateDeployment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.create_external_api.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.create_external_api.js new file mode 100644 index 00000000000..5dc983996b8 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.create_external_api.js @@ -0,0 +1,79 @@ +// Copyright 2024 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, externalApi) { + // [START apihub_v1_generated_ApiHub_CreateExternalApi_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 parent resource for the External API resource. + * Format: `projects/{project}/locations/{location}` + */ + // const parent = 'abc123' + /** + * Optional. The ID to use for the External API resource, which will become + * the final component of the External API's resource name. This field is + * optional. + * * If provided, the same will be used. The service will throw an error if + * the specified id is already used by another External API resource in the + * API hub. + * * If not provided, a system generated id will be used. + * This value should be 4-500 characters, and valid characters + * are /[a-z][A-Z][0-9]-_/. + */ + // const externalApiId = 'abc123' + /** + * Required. The External API resource to create. + */ + // const externalApi = {} + + // Imports the Apihub library + const {ApiHubClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new ApiHubClient(); + + async function callCreateExternalApi() { + // Construct request + const request = { + parent, + externalApi, + }; + + // Run request + const response = await apihubClient.createExternalApi(request); + console.log(response); + } + + callCreateExternalApi(); + // [END apihub_v1_generated_ApiHub_CreateExternalApi_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.create_spec.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.create_spec.js new file mode 100644 index 00000000000..e4df15ade6e --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.create_spec.js @@ -0,0 +1,79 @@ +// Copyright 2024 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, spec) { + // [START apihub_v1_generated_ApiHub_CreateSpec_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 parent resource for Spec. + * Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}` + */ + // const parent = 'abc123' + /** + * Optional. The ID to use for the spec, which will become the final component + * of the spec's resource name. This field is optional. + * * If provided, the same will be used. The service will throw an error if + * the specified id is already used by another spec in the API + * resource. + * * If not provided, a system generated id will be used. + * This value should be 4-500 characters, and valid characters + * are /[a-z][A-Z][0-9]-_/. + */ + // const specId = 'abc123' + /** + * Required. The spec to create. + */ + // const spec = {} + + // Imports the Apihub library + const {ApiHubClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new ApiHubClient(); + + async function callCreateSpec() { + // Construct request + const request = { + parent, + spec, + }; + + // Run request + const response = await apihubClient.createSpec(request); + console.log(response); + } + + callCreateSpec(); + // [END apihub_v1_generated_ApiHub_CreateSpec_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.create_version.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.create_version.js new file mode 100644 index 00000000000..6fa6ebd5a01 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.create_version.js @@ -0,0 +1,77 @@ +// Copyright 2024 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, version) { + // [START apihub_v1_generated_ApiHub_CreateVersion_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 parent resource for API version. + * Format: `projects/{project}/locations/{location}/apis/{api}` + */ + // const parent = 'abc123' + /** + * Optional. The ID to use for the API version, which will become the final + * component of the version's resource name. This field is optional. + * * If provided, the same will be used. The service will throw an error if + * the specified id is already used by another version in the API resource. + * * If not provided, a system generated id will be used. + * This value should be 4-500 characters, and valid characters + * are /[a-z][A-Z][0-9]-_/. + */ + // const versionId = 'abc123' + /** + * Required. The version to create. + */ + // const version = {} + + // Imports the Apihub library + const {ApiHubClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new ApiHubClient(); + + async function callCreateVersion() { + // Construct request + const request = { + parent, + version, + }; + + // Run request + const response = await apihubClient.createVersion(request); + console.log(response); + } + + callCreateVersion(); + // [END apihub_v1_generated_ApiHub_CreateVersion_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.delete_api.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.delete_api.js new file mode 100644 index 00000000000..ac76db4aeb5 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.delete_api.js @@ -0,0 +1,67 @@ +// Copyright 2024 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 apihub_v1_generated_ApiHub_DeleteApi_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 name of the API resource to delete. + * Format: `projects/{project}/locations/{location}/apis/{api}` + */ + // const name = 'abc123' + /** + * Optional. If set to true, any versions from this API will also be deleted. + * Otherwise, the request will only work if the API has no versions. + */ + // const force = true + + // Imports the Apihub library + const {ApiHubClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new ApiHubClient(); + + async function callDeleteApi() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await apihubClient.deleteApi(request); + console.log(response); + } + + callDeleteApi(); + // [END apihub_v1_generated_ApiHub_DeleteApi_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.delete_attribute.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.delete_attribute.js new file mode 100644 index 00000000000..a5986ba91ef --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.delete_attribute.js @@ -0,0 +1,63 @@ +// Copyright 2024 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 apihub_v1_generated_ApiHub_DeleteAttribute_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 name of the attribute to delete. + * Format: + * `projects/{project}/locations/{location}/attributes/{attribute}` + */ + // const name = 'abc123' + + // Imports the Apihub library + const {ApiHubClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new ApiHubClient(); + + async function callDeleteAttribute() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await apihubClient.deleteAttribute(request); + console.log(response); + } + + callDeleteAttribute(); + // [END apihub_v1_generated_ApiHub_DeleteAttribute_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.delete_deployment.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.delete_deployment.js new file mode 100644 index 00000000000..43ef2d12495 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.delete_deployment.js @@ -0,0 +1,62 @@ +// Copyright 2024 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 apihub_v1_generated_ApiHub_DeleteDeployment_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 name of the deployment resource to delete. + * Format: `projects/{project}/locations/{location}/deployments/{deployment}` + */ + // const name = 'abc123' + + // Imports the Apihub library + const {ApiHubClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new ApiHubClient(); + + async function callDeleteDeployment() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await apihubClient.deleteDeployment(request); + console.log(response); + } + + callDeleteDeployment(); + // [END apihub_v1_generated_ApiHub_DeleteDeployment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.delete_external_api.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.delete_external_api.js new file mode 100644 index 00000000000..6951b8ea877 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.delete_external_api.js @@ -0,0 +1,63 @@ +// Copyright 2024 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 apihub_v1_generated_ApiHub_DeleteExternalApi_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 name of the External API resource to delete. + * Format: + * `projects/{project}/locations/{location}/externalApis/{externalApi}` + */ + // const name = 'abc123' + + // Imports the Apihub library + const {ApiHubClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new ApiHubClient(); + + async function callDeleteExternalApi() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await apihubClient.deleteExternalApi(request); + console.log(response); + } + + callDeleteExternalApi(); + // [END apihub_v1_generated_ApiHub_DeleteExternalApi_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.delete_spec.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.delete_spec.js new file mode 100644 index 00000000000..c3b4b211c32 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.delete_spec.js @@ -0,0 +1,63 @@ +// Copyright 2024 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 apihub_v1_generated_ApiHub_DeleteSpec_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 name of the spec to delete. + * Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}` + */ + // const name = 'abc123' + + // Imports the Apihub library + const {ApiHubClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new ApiHubClient(); + + async function callDeleteSpec() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await apihubClient.deleteSpec(request); + console.log(response); + } + + callDeleteSpec(); + // [END apihub_v1_generated_ApiHub_DeleteSpec_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.delete_version.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.delete_version.js new file mode 100644 index 00000000000..739fdc5f184 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.delete_version.js @@ -0,0 +1,68 @@ +// Copyright 2024 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 apihub_v1_generated_ApiHub_DeleteVersion_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 name of the version to delete. + * Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}` + */ + // const name = 'abc123' + /** + * Optional. If set to true, any specs from this version will also be deleted. + * Otherwise, the request will only work if the version has no specs. + */ + // const force = true + + // Imports the Apihub library + const {ApiHubClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new ApiHubClient(); + + async function callDeleteVersion() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await apihubClient.deleteVersion(request); + console.log(response); + } + + callDeleteVersion(); + // [END apihub_v1_generated_ApiHub_DeleteVersion_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_api.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_api.js new file mode 100644 index 00000000000..b081d9156d5 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_api.js @@ -0,0 +1,62 @@ +// Copyright 2024 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 apihub_v1_generated_ApiHub_GetApi_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 name of the API resource to retrieve. + * Format: `projects/{project}/locations/{location}/apis/{api}` + */ + // const name = 'abc123' + + // Imports the Apihub library + const {ApiHubClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new ApiHubClient(); + + async function callGetApi() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await apihubClient.getApi(request); + console.log(response); + } + + callGetApi(); + // [END apihub_v1_generated_ApiHub_GetApi_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_api_operation.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_api_operation.js new file mode 100644 index 00000000000..19ffe7726e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_api_operation.js @@ -0,0 +1,63 @@ +// Copyright 2024 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 apihub_v1_generated_ApiHub_GetApiOperation_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 name of the operation to retrieve. + * Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}` + */ + // const name = 'abc123' + + // Imports the Apihub library + const {ApiHubClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new ApiHubClient(); + + async function callGetApiOperation() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await apihubClient.getApiOperation(request); + console.log(response); + } + + callGetApiOperation(); + // [END apihub_v1_generated_ApiHub_GetApiOperation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_attribute.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_attribute.js new file mode 100644 index 00000000000..6bb116e01cf --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_attribute.js @@ -0,0 +1,63 @@ +// Copyright 2024 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 apihub_v1_generated_ApiHub_GetAttribute_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 name of the attribute to retrieve. + * Format: + * `projects/{project}/locations/{location}/attributes/{attribute}` + */ + // const name = 'abc123' + + // Imports the Apihub library + const {ApiHubClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new ApiHubClient(); + + async function callGetAttribute() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await apihubClient.getAttribute(request); + console.log(response); + } + + callGetAttribute(); + // [END apihub_v1_generated_ApiHub_GetAttribute_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_definition.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_definition.js new file mode 100644 index 00000000000..4ee68bb3bc8 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_definition.js @@ -0,0 +1,63 @@ +// Copyright 2024 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 apihub_v1_generated_ApiHub_GetDefinition_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 name of the definition to retrieve. + * Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}` + */ + // const name = 'abc123' + + // Imports the Apihub library + const {ApiHubClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new ApiHubClient(); + + async function callGetDefinition() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await apihubClient.getDefinition(request); + console.log(response); + } + + callGetDefinition(); + // [END apihub_v1_generated_ApiHub_GetDefinition_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_deployment.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_deployment.js new file mode 100644 index 00000000000..ce254e76c5b --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_deployment.js @@ -0,0 +1,62 @@ +// Copyright 2024 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 apihub_v1_generated_ApiHub_GetDeployment_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 name of the deployment resource to retrieve. + * Format: `projects/{project}/locations/{location}/deployments/{deployment}` + */ + // const name = 'abc123' + + // Imports the Apihub library + const {ApiHubClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new ApiHubClient(); + + async function callGetDeployment() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await apihubClient.getDeployment(request); + console.log(response); + } + + callGetDeployment(); + // [END apihub_v1_generated_ApiHub_GetDeployment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_external_api.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_external_api.js new file mode 100644 index 00000000000..7d23feb11a7 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_external_api.js @@ -0,0 +1,63 @@ +// Copyright 2024 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 apihub_v1_generated_ApiHub_GetExternalApi_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 name of the External API resource to retrieve. + * Format: + * `projects/{project}/locations/{location}/externalApis/{externalApi}` + */ + // const name = 'abc123' + + // Imports the Apihub library + const {ApiHubClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new ApiHubClient(); + + async function callGetExternalApi() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await apihubClient.getExternalApi(request); + console.log(response); + } + + callGetExternalApi(); + // [END apihub_v1_generated_ApiHub_GetExternalApi_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_spec.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_spec.js new file mode 100644 index 00000000000..03f4c0bb701 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_spec.js @@ -0,0 +1,63 @@ +// Copyright 2024 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 apihub_v1_generated_ApiHub_GetSpec_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 name of the spec to retrieve. + * Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}` + */ + // const name = 'abc123' + + // Imports the Apihub library + const {ApiHubClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new ApiHubClient(); + + async function callGetSpec() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await apihubClient.getSpec(request); + console.log(response); + } + + callGetSpec(); + // [END apihub_v1_generated_ApiHub_GetSpec_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_spec_contents.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_spec_contents.js new file mode 100644 index 00000000000..865e39c5a2c --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_spec_contents.js @@ -0,0 +1,63 @@ +// Copyright 2024 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 apihub_v1_generated_ApiHub_GetSpecContents_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 name of the spec whose contents need to be retrieved. + * Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}` + */ + // const name = 'abc123' + + // Imports the Apihub library + const {ApiHubClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new ApiHubClient(); + + async function callGetSpecContents() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await apihubClient.getSpecContents(request); + console.log(response); + } + + callGetSpecContents(); + // [END apihub_v1_generated_ApiHub_GetSpecContents_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_version.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_version.js new file mode 100644 index 00000000000..9bc61d725db --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_version.js @@ -0,0 +1,63 @@ +// Copyright 2024 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 apihub_v1_generated_ApiHub_GetVersion_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 name of the API version to retrieve. + * Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}` + */ + // const name = 'abc123' + + // Imports the Apihub library + const {ApiHubClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new ApiHubClient(); + + async function callGetVersion() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await apihubClient.getVersion(request); + console.log(response); + } + + callGetVersion(); + // [END apihub_v1_generated_ApiHub_GetVersion_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.list_api_operations.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.list_api_operations.js new file mode 100644 index 00000000000..2ec1dd7597a --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.list_api_operations.js @@ -0,0 +1,117 @@ +// Copyright 2024 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 apihub_v1_generated_ApiHub_ListApiOperations_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 parent which owns this collection of operations i.e., the API + * version. Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}` + */ + // const parent = 'abc123' + /** + * Optional. An expression that filters the list of ApiOperations. + * A filter expression consists of a field name, a comparison + * operator, and a value for filtering. The value must be a string or a + * boolean. The comparison operator must be one of: `<`, `>` or + * `=`. Filters are not case sensitive. + * The following fields in the `ApiOperation` are eligible for filtering: + * * `name` - The ApiOperation resource name. Allowed comparison + * operators: + * `=`. + * * `details.http_operation.path.path` - The http operation's complete path + * relative to server endpoint. Allowed comparison operators: `=`. + * * `details.http_operation.method` - The http operation method type. + * Allowed comparison operators: `=`. + * * `details.deprecated` - Indicates if the ApiOperation is deprecated. + * Allowed values are True / False indicating the deprycation status of the + * ApiOperation. Allowed comparison operators: `=`. + * * `create_time` - The time at which the ApiOperation was created. The + * value should be in the (RFC3339)https://tools.ietf.org/html/rfc3339 + * format. Allowed comparison operators: `>` and `<`. + * Expressions are combined with either `AND` logic operator or `OR` logical + * operator but not both of them together i.e. only one of the `AND` or `OR` + * operator can be used throughout the filter string and both the operators + * cannot be used together. No other logical operators are supported. At most + * three filter fields are allowed in the filter string and if provided + * more than that then `INVALID_ARGUMENT` error is returned by the API. + * Here are a few examples: + * * `details.deprecated = True` - The ApiOperation is deprecated. + * * `details.http_operation.method = GET AND create_time < + * \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - + * The method of the http operation of the ApiOperation is _GET_ and the + * spec was created before _2021-08-15 14:50:00 UTC_ and after _2021-08-10 + * 12:00:00 UTC_. + * * `details.http_operation.method = GET OR details.http_operation.method = + * POST`. - The http operation of the method of ApiOperation is _GET_ or + * _POST_. + */ + // const filter = 'abc123' + /** + * Optional. The maximum number of operations to return. The service may + * return fewer than this value. If unspecified, at most 50 operations will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + */ + // const pageSize = 1234 + /** + * Optional. A page token, received from a previous `ListApiOperations` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters (except page_size) provided to + * `ListApiOperations` must match the call that provided the page token. + */ + // const pageToken = 'abc123' + + // Imports the Apihub library + const {ApiHubClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new ApiHubClient(); + + async function callListApiOperations() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = apihubClient.listApiOperationsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListApiOperations(); + // [END apihub_v1_generated_ApiHub_ListApiOperations_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.list_apis.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.list_apis.js new file mode 100644 index 00000000000..30285b75116 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.list_apis.js @@ -0,0 +1,146 @@ +// Copyright 2024 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 apihub_v1_generated_ApiHub_ListApis_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 parent, which owns this collection of API resources. + * Format: `projects/{project}/locations/{location}` + */ + // const parent = 'abc123' + /** + * Optional. An expression that filters the list of ApiResources. + * A filter expression consists of a field name, a comparison + * operator, and a value for filtering. The value must be a string. The + * comparison operator must be one of: `<`, `>`, `:` or `=`. Filters are not + * case sensitive. + * The following fields in the `ApiResource` are eligible for filtering: + * * `owner.email` - The email of the team which owns the ApiResource. + * Allowed comparison operators: `=`. + * * `create_time` - The time at which the ApiResource was created. The + * value should be in the (RFC3339)https://tools.ietf.org/html/rfc3339 + * format. Allowed comparison operators: `>` and `<`. + * * `display_name` - The display name of the ApiResource. Allowed + * comparison operators: `=`. + * * `target_user.enum_values.values.id` - The allowed value id of the + * target users attribute associated with the ApiResource. Allowed + * comparison operator is `:`. + * * `target_user.enum_values.values.display_name` - The allowed value + * display name of the target users attribute associated with the + * ApiResource. Allowed comparison operator is `:`. + * * `team.enum_values.values.id` - The allowed value id of the team + * attribute associated with the ApiResource. Allowed comparison operator is + * `:`. + * * `team.enum_values.values.display_name` - The allowed value display name + * of the team attribute associated with the ApiResource. Allowed comparison + * operator is `:`. + * * `business_unit.enum_values.values.id` - The allowed value id of the + * business unit attribute associated with the ApiResource. Allowed + * comparison operator is `:`. + * * `business_unit.enum_values.values.display_name` - The allowed value + * display name of the business unit attribute associated with the + * ApiResource. Allowed comparison operator is `:`. + * * `maturity_level.enum_values.values.id` - The allowed value id of the + * maturity level attribute associated with the ApiResource. Allowed + * comparison operator is `:`. + * * `maturity_level.enum_values.values.display_name` - The allowed value + * display name of the maturity level attribute associated with the + * ApiResource. Allowed comparison operator is `:`. + * * `api_style.enum_values.values.id` - The allowed value id of the + * api style attribute associated with the ApiResource. Allowed + * comparison operator is `:`. + * * `api_style.enum_values.values.display_name` - The allowed value display + * name of the api style attribute associated with the ApiResource. Allowed + * comparison operator is `:`. + * Expressions are combined with either `AND` logic operator or `OR` logical + * operator but not both of them together i.e. only one of the `AND` or `OR` + * operator can be used throughout the filter string and both the operators + * cannot be used together. No other logical operators are supported. At most + * three filter fields are allowed in the filter string and if provided + * more than that then `INVALID_ARGUMENT` error is returned by the API. + * Here are a few examples: + * * `owner.email = \"apihub@google.com\"` - - The owner team email is + * _apihub@google.com_. + * * `owner.email = \"apihub@google.com\" AND create_time < + * \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - + * The owner team email is _apihub@google.com_ and the api was created + * before _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_. + * * `owner.email = \"apihub@google.com\" OR team.enum_values.values.id: + * apihub-team-id` - The filter string specifies the APIs where the owner + * team email is _apihub@google.com_ or the id of the allowed value + * associated with the team attribute is _apihub-team-id_. + * * `owner.email = \"apihub@google.com\" OR + * team.enum_values.values.display_name: ApiHub Team` - The filter string + * specifies the APIs where the owner team email is _apihub@google.com_ or + * the display name of the allowed value associated with the team attribute + * is `ApiHub Team`. + */ + // const filter = 'abc123' + /** + * Optional. The maximum number of API resources to return. The service may + * return fewer than this value. If unspecified, at most 50 Apis will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + */ + // const pageSize = 1234 + /** + * Optional. A page token, received from a previous `ListApis` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters (except page_size) provided to + * `ListApis` must match the call that provided the page token. + */ + // const pageToken = 'abc123' + + // Imports the Apihub library + const {ApiHubClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new ApiHubClient(); + + async function callListApis() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = apihubClient.listApisAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListApis(); + // [END apihub_v1_generated_ApiHub_ListApis_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.list_attributes.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.list_attributes.js new file mode 100644 index 00000000000..cb24939e9dd --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.list_attributes.js @@ -0,0 +1,118 @@ +// Copyright 2024 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 apihub_v1_generated_ApiHub_ListAttributes_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 parent resource for Attribute. + * Format: `projects/{project}/locations/{location}` + */ + // const parent = 'abc123' + /** + * Optional. An expression that filters the list of Attributes. + * A filter expression consists of a field name, a comparison + * operator, and a value for filtering. The value must be a string or a + * boolean. The comparison operator must be one of: `<`, `>` or + * `=`. Filters are not case sensitive. + * The following fields in the `Attribute` are eligible for filtering: + * * `display_name` - The display name of the Attribute. Allowed + * comparison operators: `=`. + * * `definition_type` - The definition type of the attribute. Allowed + * comparison operators: `=`. + * * `scope` - The scope of the attribute. Allowed comparison operators: + * `=`. + * * `data_type` - The type of the data of the attribute. Allowed + * comparison operators: `=`. + * * `mandatory` - Denotes whether the attribute is mandatory or not. + * Allowed comparison operators: `=`. + * * `create_time` - The time at which the Attribute was created. The + * value should be in the (RFC3339)https://tools.ietf.org/html/rfc3339 + * format. Allowed comparison operators: `>` and `<`. + * Expressions are combined with either `AND` logic operator or `OR` logical + * operator but not both of them together i.e. only one of the `AND` or `OR` + * operator can be used throughout the filter string and both the operators + * cannot be used together. No other logical operators are + * supported. At most three filter fields are allowed in the filter + * string and if provided more than that then `INVALID_ARGUMENT` error is + * returned by the API. + * Here are a few examples: + * * `display_name = production` - - The display name of the attribute is + * _production_. + * * `(display_name = production) AND (create_time < + * \"2021-08-15T14:50:00Z\") AND (create_time > \"2021-08-10T12:00:00Z\")` - + * The display name of the attribute is _production_ and the attribute was + * created before _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00 + * UTC_. + * * `display_name = production OR scope = api` - + * The attribute where the display name is _production_ or the scope is + * _api_. + */ + // const filter = 'abc123' + /** + * Optional. The maximum number of attribute resources to return. The service + * may return fewer than this value. If unspecified, at most 50 attributes + * will be returned. The maximum value is 1000; values above 1000 will be + * coerced to 1000. + */ + // const pageSize = 1234 + /** + * Optional. A page token, received from a previous `ListAttributes` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListAttributes` must + * match the call that provided the page token. + */ + // const pageToken = 'abc123' + + // Imports the Apihub library + const {ApiHubClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new ApiHubClient(); + + async function callListAttributes() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = apihubClient.listAttributesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListAttributes(); + // [END apihub_v1_generated_ApiHub_ListAttributes_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.list_deployments.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.list_deployments.js new file mode 100644 index 00000000000..ff07c1a2522 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.list_deployments.js @@ -0,0 +1,133 @@ +// Copyright 2024 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 apihub_v1_generated_ApiHub_ListDeployments_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 parent, which owns this collection of deployment resources. + * Format: `projects/{project}/locations/{location}` + */ + // const parent = 'abc123' + /** + * Optional. An expression that filters the list of Deployments. + * A filter expression consists of a field name, a comparison + * operator, and a value for filtering. The value must be a string. The + * comparison operator must be one of: `<`, `>` or + * `=`. Filters are not case sensitive. + * The following fields in the `Deployments` are eligible for filtering: + * * `display_name` - The display name of the Deployment. Allowed + * comparison operators: `=`. + * * `create_time` - The time at which the Deployment was created. The + * value should be in the (RFC3339)https://tools.ietf.org/html/rfc3339 + * format. Allowed comparison operators: `>` and `<`. + * * `resource_uri` - A URI to the deployment resource. Allowed + * comparison operators: `=`. + * * `api_versions` - The API versions linked to this deployment. Allowed + * comparison operators: `:`. + * * `deployment_type.enum_values.values.id` - The allowed value id of the + * deployment_type attribute associated with the Deployment. Allowed + * comparison operators: `:`. + * * `deployment_type.enum_values.values.display_name` - The allowed value + * display name of the deployment_type attribute associated with the + * Deployment. Allowed comparison operators: `:`. + * * `slo.string_values.values` -The allowed string value of the slo + * attribute associated with the deployment. Allowed comparison + * operators: `:`. + * * `environment.enum_values.values.id` - The allowed value id of the + * environment attribute associated with the deployment. Allowed + * comparison operators: `:`. + * * `environment.enum_values.values.display_name` - The allowed value + * display name of the environment attribute associated with the deployment. + * Allowed comparison operators: `:`. + * Expressions are combined with either `AND` logic operator or `OR` logical + * operator but not both of them together i.e. only one of the `AND` or `OR` + * operator can be used throughout the filter string and both the operators + * cannot be used together. No other logical operators are supported. At most + * three filter fields are allowed in the filter string and if provided + * more than that then `INVALID_ARGUMENT` error is returned by the API. + * Here are a few examples: + * * `environment.enum_values.values.id: staging-id` - The allowed value id + * of the environment attribute associated with the Deployment is + * _staging-id_. + * * `environment.enum_values.values.display_name: \"Staging Deployment\"` - + * The allowed value display name of the environment attribute associated + * with the Deployment is `Staging Deployment`. + * * `environment.enum_values.values.id: production-id AND create_time < + * \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - + * The allowed value id of the environment attribute associated with the + * Deployment is _production-id_ and Deployment was created before + * _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_. + * * `environment.enum_values.values.id: production-id OR + * slo.string_values.values: \"99.99%\"` + * - The allowed value id of the environment attribute Deployment is + * _production-id_ or string value of the slo attribute is _99.99%_. + */ + // const filter = 'abc123' + /** + * Optional. The maximum number of deployment resources to return. The service + * may return fewer than this value. If unspecified, at most 50 deployments + * will be returned. The maximum value is 1000; values above 1000 will be + * coerced to 1000. + */ + // const pageSize = 1234 + /** + * Optional. A page token, received from a previous `ListDeployments` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters (except page_size) provided to + * `ListDeployments` must match the call that provided the page token. + */ + // const pageToken = 'abc123' + + // Imports the Apihub library + const {ApiHubClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new ApiHubClient(); + + async function callListDeployments() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = apihubClient.listDeploymentsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListDeployments(); + // [END apihub_v1_generated_ApiHub_ListDeployments_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.list_external_apis.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.list_external_apis.js new file mode 100644 index 00000000000..1b74031251b --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.list_external_apis.js @@ -0,0 +1,78 @@ +// Copyright 2024 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 apihub_v1_generated_ApiHub_ListExternalApis_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 parent, which owns this collection of External API resources. + * Format: `projects/{project}/locations/{location}` + */ + // const parent = 'abc123' + /** + * Optional. The maximum number of External API resources to return. The + * service may return fewer than this value. If unspecified, at most 50 + * ExternalApis will be returned. The maximum value is 1000; values above 1000 + * will be coerced to 1000. + */ + // const pageSize = 1234 + /** + * Optional. A page token, received from a previous `ListExternalApis` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters (except page_size) provided to + * `ListExternalApis` must match the call that provided the page token. + */ + // const pageToken = 'abc123' + + // Imports the Apihub library + const {ApiHubClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new ApiHubClient(); + + async function callListExternalApis() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = apihubClient.listExternalApisAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListExternalApis(); + // [END apihub_v1_generated_ApiHub_ListExternalApis_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.list_specs.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.list_specs.js new file mode 100644 index 00000000000..4c61c8a0f80 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.list_specs.js @@ -0,0 +1,127 @@ +// Copyright 2024 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 apihub_v1_generated_ApiHub_ListSpecs_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 parent, which owns this collection of specs. + * Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}` + */ + // const parent = 'abc123' + /** + * Optional. An expression that filters the list of Specs. + * A filter expression consists of a field name, a comparison + * operator, and a value for filtering. The value must be a string. The + * comparison operator must be one of: `<`, `>`, `:` or `=`. Filters are not + * case sensitive. + * The following fields in the `Spec` are eligible for filtering: + * * `display_name` - The display name of the Spec. Allowed comparison + * operators: `=`. + * * `create_time` - The time at which the Spec was created. The + * value should be in the (RFC3339)https://tools.ietf.org/html/rfc3339 + * format. Allowed comparison operators: `>` and `<`. + * * `spec_type.enum_values.values.id` - The allowed value id of the + * spec_type attribute associated with the Spec. Allowed comparison + * operators: `:`. + * * `spec_type.enum_values.values.display_name` - The allowed value display + * name of the spec_type attribute associated with the Spec. Allowed + * comparison operators: `:`. + * * `lint_response.json_values.values` - The json value of the + * lint_response attribute associated with the Spec. Allowed comparison + * operators: `:`. + * * `mime_type` - The MIME type of the Spec. Allowed comparison + * operators: `=`. + * Expressions are combined with either `AND` logic operator or `OR` logical + * operator but not both of them together i.e. only one of the `AND` or `OR` + * operator can be used throughout the filter string and both the operators + * cannot be used together. No other logical operators are + * supported. At most three filter fields are allowed in the filter + * string and if provided more than that then `INVALID_ARGUMENT` error is + * returned by the API. + * Here are a few examples: + * * `spec_type.enum_values.values.id: rest-id` - The filter + * string specifies that the id of the allowed value associated with the + * spec_type attribute is _rest-id_. + * * `spec_type.enum_values.values.display_name: \"Rest Display Name\"` - + * The filter string specifies that the display name of the allowed value + * associated with the spec_type attribute is `Rest Display Name`. + * * `spec_type.enum_values.values.id: grpc-id AND create_time < + * \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - + * The id of the allowed value associated with the spec_type attribute is + * _grpc-id_ and the spec was created before _2021-08-15 14:50:00 UTC_ and + * after _2021-08-10 12:00:00 UTC_. + * * `spec_type.enum_values.values.id: rest-id OR + * spec_type.enum_values.values.id: grpc-id` + * - The id of the allowed value associated with the spec_type attribute is + * _rest-id_ or _grpc-id_. + */ + // const filter = 'abc123' + /** + * Optional. The maximum number of specs to return. The service may return + * fewer than this value. If unspecified, at most 50 specs will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + */ + // const pageSize = 1234 + /** + * Optional. A page token, received from a previous `ListSpecs` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListSpecs` must + * match the call that provided the page token. + */ + // const pageToken = 'abc123' + + // Imports the Apihub library + const {ApiHubClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new ApiHubClient(); + + async function callListSpecs() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = apihubClient.listSpecsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListSpecs(); + // [END apihub_v1_generated_ApiHub_ListSpecs_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.list_versions.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.list_versions.js new file mode 100644 index 00000000000..9c3a25c5038 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.list_versions.js @@ -0,0 +1,134 @@ +// Copyright 2024 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 apihub_v1_generated_ApiHub_ListVersions_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 parent which owns this collection of API versions i.e., the + * API resource Format: `projects/{project}/locations/{location}/apis/{api}` + */ + // const parent = 'abc123' + /** + * Optional. An expression that filters the list of Versions. + * A filter expression consists of a field name, a comparison + * operator, and a value for filtering. The value must be a string, a + * number, or a boolean. The comparison operator must be one of: `<`, `>` or + * `=`. Filters are not case sensitive. + * The following fields in the `Version` are eligible for filtering: + * * `display_name` - The display name of the Version. Allowed + * comparison operators: `=`. + * * `create_time` - The time at which the Version was created. The + * value should be in the (RFC3339)https://tools.ietf.org/html/rfc3339 + * format. Allowed comparison operators: `>` and `<`. + * * `lifecycle.enum_values.values.id` - The allowed value id of the + * lifecycle attribute associated with the Version. Allowed comparison + * operators: `:`. + * * `lifecycle.enum_values.values.display_name` - The allowed value display + * name of the lifecycle attribute associated with the Version. Allowed + * comparison operators: `:`. + * * `compliance.enum_values.values.id` - The allowed value id of the + * compliances attribute associated with the Version. Allowed comparison + * operators: `:`. + * * `compliance.enum_values.values.display_name` - The allowed value + * display name of the compliances attribute associated with the Version. + * Allowed comparison operators: `:`. + * * `accreditation.enum_values.values.id` - The allowed value id of the + * accreditations attribute associated with the Version. Allowed + * comparison operators: `:`. + * * `accreditation.enum_values.values.display_name` - The allowed value + * display name of the accreditations attribute associated with the Version. + * Allowed comparison operators: `:`. + * Expressions are combined with either `AND` logic operator or `OR` logical + * operator but not both of them together i.e. only one of the `AND` or `OR` + * operator can be used throughout the filter string and both the operators + * cannot be used together. No other logical operators are + * supported. At most three filter fields are allowed in the filter + * string and if provided more than that then `INVALID_ARGUMENT` error is + * returned by the API. + * Here are a few examples: + * * `lifecycle.enum_values.values.id: preview-id` - The filter string + * specifies that the id of the allowed value associated with the lifecycle + * attribute of the Version is _preview-id_. + * * `lifecycle.enum_values.values.display_name: \"Preview Display Name\"` - + * The filter string specifies that the display name of the allowed value + * associated with the lifecycle attribute of the Version is `Preview + * Display Name`. + * * `lifecycle.enum_values.values.id: preview-id AND create_time < + * \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - + * The id of the allowed value associated with the lifecycle attribute of + * the Version is _preview-id_ and it was created before _2021-08-15 + * 14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_. + * * `compliance.enum_values.values.id: gdpr-id OR + * compliance.enum_values.values.id: pci-dss-id` + * - The id of the allowed value associated with the compliance attribute is + * _gdpr-id_ or _pci-dss-id_. + */ + // const filter = 'abc123' + /** + * Optional. The maximum number of versions to return. The service may return + * fewer than this value. If unspecified, at most 50 versions will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + */ + // const pageSize = 1234 + /** + * Optional. A page token, received from a previous `ListVersions` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters (except page_size) provided to + * `ListVersions` must match the call that provided the page token. + */ + // const pageToken = 'abc123' + + // Imports the Apihub library + const {ApiHubClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new ApiHubClient(); + + async function callListVersions() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = apihubClient.listVersionsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListVersions(); + // [END apihub_v1_generated_ApiHub_ListVersions_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.search_resources.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.search_resources.js new file mode 100644 index 00000000000..620468d7230 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.search_resources.js @@ -0,0 +1,108 @@ +// Copyright 2024 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(location, query) { + // [START apihub_v1_generated_ApiHub_SearchResources_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 location which will be of the type + * `projects/{project_id}/locations/{location_id}`. This field is used to + * identify the instance of API-Hub in which resources should be searched. + */ + // const location = 'abc123' + /** + * Required. The free text search query. This query can contain keywords which + * could be related to any detail of the API-Hub resources such display names, + * descriptions, attributes etc. + */ + // const query = 'abc123' + /** + * Optional. An expression that filters the list of search results. + * A filter expression consists of a field name, a comparison operator, + * and a value for filtering. The value must be a string, a number, or a + * boolean. The comparison operator must be `=`. Filters are not case + * sensitive. + * The following field names are eligible for filtering: + * * `resource_type` - The type of resource in the search results. + * Must be one of the following: `Api`, `ApiOperation`, `Deployment`, + * `Definition`, `Spec` or `Version`. This field can only be specified once + * in the filter. + * Here are is an example: + * * `resource_type = Api` - The resource_type is _Api_. + */ + // const filter = 'abc123' + /** + * Optional. The maximum number of search results to return. The service may + * return fewer than this value. If unspecified at most 10 search results will + * be returned. If value is negative then `INVALID_ARGUMENT` error is + * returned. The maximum value is 25; values above 25 will be coerced to 25. + * While paginating, you can specify a new page size parameter for each page + * of search results to be listed. + */ + // const pageSize = 1234 + /** + * Optional. A page token, received from a previous + * SearchResources SearchResources + * call. Specify this parameter to retrieve the next page of transactions. + * When paginating, you must specify the `page_token` parameter and all the + * other parameters except + * page_size google.cloud.apihub.v1.SearchResourcesRequest.page_size + * should be specified with the same value which was used in the previous + * call. If the other fields are set with a different value than the previous + * call then `INVALID_ARGUMENT` error is returned. + */ + // const pageToken = 'abc123' + + // Imports the Apihub library + const {ApiHubClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new ApiHubClient(); + + async function callSearchResources() { + // Construct request + const request = { + location, + query, + }; + + // Run request + const iterable = apihubClient.searchResourcesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callSearchResources(); + // [END apihub_v1_generated_ApiHub_SearchResources_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.update_api.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.update_api.js new file mode 100644 index 00000000000..de22a319390 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.update_api.js @@ -0,0 +1,69 @@ +// Copyright 2024 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(api, updateMask) { + // [START apihub_v1_generated_ApiHub_UpdateApi_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 API resource to update. + * The API resource's `name` field is used to identify the API resource to + * update. + * Format: `projects/{project}/locations/{location}/apis/{api}` + */ + // const api = {} + /** + * Required. The list of fields to update. + */ + // const updateMask = {} + + // Imports the Apihub library + const {ApiHubClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new ApiHubClient(); + + async function callUpdateApi() { + // Construct request + const request = { + api, + updateMask, + }; + + // Run request + const response = await apihubClient.updateApi(request); + console.log(response); + } + + callUpdateApi(); + // [END apihub_v1_generated_ApiHub_UpdateApi_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.update_attribute.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.update_attribute.js new file mode 100644 index 00000000000..d9981224b6b --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.update_attribute.js @@ -0,0 +1,69 @@ +// Copyright 2024 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(attribute, updateMask) { + // [START apihub_v1_generated_ApiHub_UpdateAttribute_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 attribute to update. + * The attribute's `name` field is used to identify the attribute to update. + * Format: + * `projects/{project}/locations/{location}/attributes/{attribute}` + */ + // const attribute = {} + /** + * Required. The list of fields to update. + */ + // const updateMask = {} + + // Imports the Apihub library + const {ApiHubClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new ApiHubClient(); + + async function callUpdateAttribute() { + // Construct request + const request = { + attribute, + updateMask, + }; + + // Run request + const response = await apihubClient.updateAttribute(request); + console.log(response); + } + + callUpdateAttribute(); + // [END apihub_v1_generated_ApiHub_UpdateAttribute_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.update_deployment.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.update_deployment.js new file mode 100644 index 00000000000..451b90c3b7a --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.update_deployment.js @@ -0,0 +1,69 @@ +// Copyright 2024 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(deployment, updateMask) { + // [START apihub_v1_generated_ApiHub_UpdateDeployment_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 deployment resource to update. + * The deployment resource's `name` field is used to identify the deployment + * resource to update. + * Format: `projects/{project}/locations/{location}/deployments/{deployment}` + */ + // const deployment = {} + /** + * Required. The list of fields to update. + */ + // const updateMask = {} + + // Imports the Apihub library + const {ApiHubClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new ApiHubClient(); + + async function callUpdateDeployment() { + // Construct request + const request = { + deployment, + updateMask, + }; + + // Run request + const response = await apihubClient.updateDeployment(request); + console.log(response); + } + + callUpdateDeployment(); + // [END apihub_v1_generated_ApiHub_UpdateDeployment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.update_external_api.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.update_external_api.js new file mode 100644 index 00000000000..b5b266771e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.update_external_api.js @@ -0,0 +1,69 @@ +// Copyright 2024 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(externalApi, updateMask) { + // [START apihub_v1_generated_ApiHub_UpdateExternalApi_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 External API resource to update. + * The External API resource's `name` field is used to identify the External + * API resource to update. Format: + * `projects/{project}/locations/{location}/externalApis/{externalApi}` + */ + // const externalApi = {} + /** + * Required. The list of fields to update. + */ + // const updateMask = {} + + // Imports the Apihub library + const {ApiHubClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new ApiHubClient(); + + async function callUpdateExternalApi() { + // Construct request + const request = { + externalApi, + updateMask, + }; + + // Run request + const response = await apihubClient.updateExternalApi(request); + console.log(response); + } + + callUpdateExternalApi(); + // [END apihub_v1_generated_ApiHub_UpdateExternalApi_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.update_spec.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.update_spec.js new file mode 100644 index 00000000000..aa5452961ad --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.update_spec.js @@ -0,0 +1,69 @@ +// Copyright 2024 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(spec, updateMask) { + // [START apihub_v1_generated_ApiHub_UpdateSpec_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 spec to update. + * The spec's `name` field is used to identify the spec to + * update. Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}` + */ + // const spec = {} + /** + * Required. The list of fields to update. + */ + // const updateMask = {} + + // Imports the Apihub library + const {ApiHubClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new ApiHubClient(); + + async function callUpdateSpec() { + // Construct request + const request = { + spec, + updateMask, + }; + + // Run request + const response = await apihubClient.updateSpec(request); + console.log(response); + } + + callUpdateSpec(); + // [END apihub_v1_generated_ApiHub_UpdateSpec_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.update_version.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.update_version.js new file mode 100644 index 00000000000..6192934a974 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.update_version.js @@ -0,0 +1,69 @@ +// Copyright 2024 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(version, updateMask) { + // [START apihub_v1_generated_ApiHub_UpdateVersion_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 API version to update. + * The version's `name` field is used to identify the API version to update. + * Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}` + */ + // const version = {} + /** + * Required. The list of fields to update. + */ + // const updateMask = {} + + // Imports the Apihub library + const {ApiHubClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new ApiHubClient(); + + async function callUpdateVersion() { + // Construct request + const request = { + version, + updateMask, + }; + + // Run request + const response = await apihubClient.updateVersion(request); + console.log(response); + } + + callUpdateVersion(); + // [END apihub_v1_generated_ApiHub_UpdateVersion_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_dependencies.create_dependency.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_dependencies.create_dependency.js new file mode 100644 index 00000000000..44adc875150 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_dependencies.create_dependency.js @@ -0,0 +1,77 @@ +// Copyright 2024 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, dependency) { + // [START apihub_v1_generated_ApiHubDependencies_CreateDependency_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 parent resource for the dependency resource. + * Format: `projects/{project}/locations/{location}` + */ + // const parent = 'abc123' + /** + * Optional. The ID to use for the dependency resource, which will become the + * final component of the dependency's resource name. This field is optional. + * * If provided, the same will be used. The service will throw an error if + * duplicate id is provided by the client. + * * If not provided, a system generated id will be used. + * This value should be 4-500 characters, and valid characters + * are `[a-z][A-Z][0-9]-_`. + */ + // const dependencyId = 'abc123' + /** + * Required. The dependency resource to create. + */ + // const dependency = {} + + // Imports the Apihub library + const {ApiHubDependenciesClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new ApiHubDependenciesClient(); + + async function callCreateDependency() { + // Construct request + const request = { + parent, + dependency, + }; + + // Run request + const response = await apihubClient.createDependency(request); + console.log(response); + } + + callCreateDependency(); + // [END apihub_v1_generated_ApiHubDependencies_CreateDependency_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_dependencies.delete_dependency.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_dependencies.delete_dependency.js new file mode 100644 index 00000000000..560558e238a --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_dependencies.delete_dependency.js @@ -0,0 +1,62 @@ +// Copyright 2024 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 apihub_v1_generated_ApiHubDependencies_DeleteDependency_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 name of the dependency resource to delete. + * Format: `projects/{project}/locations/{location}/dependencies/{dependency}` + */ + // const name = 'abc123' + + // Imports the Apihub library + const {ApiHubDependenciesClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new ApiHubDependenciesClient(); + + async function callDeleteDependency() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await apihubClient.deleteDependency(request); + console.log(response); + } + + callDeleteDependency(); + // [END apihub_v1_generated_ApiHubDependencies_DeleteDependency_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_dependencies.get_dependency.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_dependencies.get_dependency.js new file mode 100644 index 00000000000..134880e3111 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_dependencies.get_dependency.js @@ -0,0 +1,62 @@ +// Copyright 2024 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 apihub_v1_generated_ApiHubDependencies_GetDependency_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 name of the dependency resource to retrieve. + * Format: `projects/{project}/locations/{location}/dependencies/{dependency}` + */ + // const name = 'abc123' + + // Imports the Apihub library + const {ApiHubDependenciesClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new ApiHubDependenciesClient(); + + async function callGetDependency() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await apihubClient.getDependency(request); + console.log(response); + } + + callGetDependency(); + // [END apihub_v1_generated_ApiHubDependencies_GetDependency_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_dependencies.list_dependencies.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_dependencies.list_dependencies.js new file mode 100644 index 00000000000..ed499d709cc --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_dependencies.list_dependencies.js @@ -0,0 +1,110 @@ +// Copyright 2024 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 apihub_v1_generated_ApiHubDependencies_ListDependencies_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 parent which owns this collection of dependency resources. + * Format: `projects/{project}/locations/{location}` + */ + // const parent = 'abc123' + /** + * Optional. An expression that filters the list of Dependencies. + * A filter expression consists of a field name, a comparison operator, and + * a value for filtering. The value must be a string. Allowed comparison + * operator is `=`. Filters are not case sensitive. + * The following fields in the `Dependency` are eligible for filtering: + * * `consumer.operation_resource_name` - The operation resource name for + * the consumer entity involved in a dependency. Allowed comparison + * operators: `=`. + * * `consumer.external_api_resource_name` - The external api resource name + * for the consumer entity involved in a dependency. Allowed comparison + * operators: `=`. + * * `supplier.operation_resource_name` - The operation resource name for + * the supplier entity involved in a dependency. Allowed comparison + * operators: `=`. + * * `supplier.external_api_resource_name` - The external api resource name + * for the supplier entity involved in a dependency. Allowed comparison + * operators: `=`. + * Expressions are combined with either `AND` logic operator or `OR` logical + * operator but not both of them together i.e. only one of the `AND` or `OR` + * operator can be used throughout the filter string and both the operators + * cannot be used together. No other logical operators are supported. At most + * three filter fields are allowed in the filter string and if provided + * more than that then `INVALID_ARGUMENT` error is returned by the API. + * For example, `consumer.operation_resource_name = + * \"projects/p1/locations/global/apis/a1/versions/v1/operations/o1\" OR + * supplier.operation_resource_name = + * \"projects/p1/locations/global/apis/a1/versions/v1/operations/o1\"` - The + * dependencies with either consumer or supplier operation resource name as + * _projects/p1/locations/global/apis/a1/versions/v1/operations/o1_. + */ + // const filter = 'abc123' + /** + * Optional. The maximum number of dependency resources to return. The service + * may return fewer than this value. If unspecified, at most 50 dependencies + * will be returned. The maximum value is 1000; values above 1000 will be + * coerced to 1000. + */ + // const pageSize = 1234 + /** + * Optional. A page token, received from a previous `ListDependencies` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListDependencies` must + * match the call that provided the page token. + */ + // const pageToken = 'abc123' + + // Imports the Apihub library + const {ApiHubDependenciesClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new ApiHubDependenciesClient(); + + async function callListDependencies() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = apihubClient.listDependenciesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListDependencies(); + // [END apihub_v1_generated_ApiHubDependencies_ListDependencies_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_dependencies.update_dependency.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_dependencies.update_dependency.js new file mode 100644 index 00000000000..c73bc482027 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_dependencies.update_dependency.js @@ -0,0 +1,68 @@ +// Copyright 2024 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(dependency, updateMask) { + // [START apihub_v1_generated_ApiHubDependencies_UpdateDependency_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 dependency resource to update. + * The dependency's `name` field is used to identify the dependency to update. + * Format: `projects/{project}/locations/{location}/dependencies/{dependency}` + */ + // const dependency = {} + /** + * Required. The list of fields to update. + */ + // const updateMask = {} + + // Imports the Apihub library + const {ApiHubDependenciesClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new ApiHubDependenciesClient(); + + async function callUpdateDependency() { + // Construct request + const request = { + dependency, + updateMask, + }; + + // Run request + const response = await apihubClient.updateDependency(request); + console.log(response); + } + + callUpdateDependency(); + // [END apihub_v1_generated_ApiHubDependencies_UpdateDependency_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_plugin.disable_plugin.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_plugin.disable_plugin.js new file mode 100644 index 00000000000..6ee7f42f8bf --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_plugin.disable_plugin.js @@ -0,0 +1,62 @@ +// Copyright 2024 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 apihub_v1_generated_ApiHubPlugin_DisablePlugin_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 name of the plugin to disable. + * Format: `projects/{project}/locations/{location}/plugins/{plugin}`. + */ + // const name = 'abc123' + + // Imports the Apihub library + const {ApiHubPluginClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new ApiHubPluginClient(); + + async function callDisablePlugin() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await apihubClient.disablePlugin(request); + console.log(response); + } + + callDisablePlugin(); + // [END apihub_v1_generated_ApiHubPlugin_DisablePlugin_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_plugin.enable_plugin.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_plugin.enable_plugin.js new file mode 100644 index 00000000000..54fa6296533 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_plugin.enable_plugin.js @@ -0,0 +1,62 @@ +// Copyright 2024 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 apihub_v1_generated_ApiHubPlugin_EnablePlugin_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 name of the plugin to enable. + * Format: `projects/{project}/locations/{location}/plugins/{plugin}`. + */ + // const name = 'abc123' + + // Imports the Apihub library + const {ApiHubPluginClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new ApiHubPluginClient(); + + async function callEnablePlugin() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await apihubClient.enablePlugin(request); + console.log(response); + } + + callEnablePlugin(); + // [END apihub_v1_generated_ApiHubPlugin_EnablePlugin_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_plugin.get_plugin.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_plugin.get_plugin.js new file mode 100644 index 00000000000..0cc7e786529 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_plugin.get_plugin.js @@ -0,0 +1,62 @@ +// Copyright 2024 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 apihub_v1_generated_ApiHubPlugin_GetPlugin_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 name of the plugin to retrieve. + * Format: `projects/{project}/locations/{location}/plugins/{plugin}`. + */ + // const name = 'abc123' + + // Imports the Apihub library + const {ApiHubPluginClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new ApiHubPluginClient(); + + async function callGetPlugin() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await apihubClient.getPlugin(request); + console.log(response); + } + + callGetPlugin(); + // [END apihub_v1_generated_ApiHubPlugin_GetPlugin_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/host_project_registration_service.create_host_project_registration.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/host_project_registration_service.create_host_project_registration.js new file mode 100644 index 00000000000..001d00a9ba7 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/host_project_registration_service.create_host_project_registration.js @@ -0,0 +1,75 @@ +// Copyright 2024 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, hostProjectRegistrationId, hostProjectRegistration) { + // [START apihub_v1_generated_HostProjectRegistrationService_CreateHostProjectRegistration_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 parent resource for the host project. + * Format: `projects/{project}/locations/{location}` + */ + // const parent = 'abc123' + /** + * Required. The ID to use for the Host Project Registration, which will + * become the final component of the host project registration's resource + * name. The ID must be the same as the Google cloud project specified in the + * host_project_registration.gcp_project field. + */ + // const hostProjectRegistrationId = 'abc123' + /** + * Required. The host project registration to register. + */ + // const hostProjectRegistration = {} + + // Imports the Apihub library + const {HostProjectRegistrationServiceClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new HostProjectRegistrationServiceClient(); + + async function callCreateHostProjectRegistration() { + // Construct request + const request = { + parent, + hostProjectRegistrationId, + hostProjectRegistration, + }; + + // Run request + const response = await apihubClient.createHostProjectRegistration(request); + console.log(response); + } + + callCreateHostProjectRegistration(); + // [END apihub_v1_generated_HostProjectRegistrationService_CreateHostProjectRegistration_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/host_project_registration_service.get_host_project_registration.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/host_project_registration_service.get_host_project_registration.js new file mode 100644 index 00000000000..d574c2fdfd9 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/host_project_registration_service.get_host_project_registration.js @@ -0,0 +1,62 @@ +// Copyright 2024 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 apihub_v1_generated_HostProjectRegistrationService_GetHostProjectRegistration_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. Host project registration resource name. + * projects/{project}/locations/{location}/hostProjectRegistrations/{host_project_registration_id} + */ + // const name = 'abc123' + + // Imports the Apihub library + const {HostProjectRegistrationServiceClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new HostProjectRegistrationServiceClient(); + + async function callGetHostProjectRegistration() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await apihubClient.getHostProjectRegistration(request); + console.log(response); + } + + callGetHostProjectRegistration(); + // [END apihub_v1_generated_HostProjectRegistrationService_GetHostProjectRegistration_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/host_project_registration_service.list_host_project_registrations.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/host_project_registration_service.list_host_project_registrations.js new file mode 100644 index 00000000000..8b31dd40890 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/host_project_registration_service.list_host_project_registrations.js @@ -0,0 +1,100 @@ +// Copyright 2024 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 apihub_v1_generated_HostProjectRegistrationService_ListHostProjectRegistrations_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 parent, which owns this collection of host projects. + * Format: `projects/* /locations/*` + */ + // const parent = 'abc123' + /** + * Optional. The maximum number of host project registrations to return. The + * service may return fewer than this value. If unspecified, at most 50 host + * project registrations will be returned. The maximum value is 1000; values + * above 1000 will be coerced to 1000. + */ + // const pageSize = 1234 + /** + * Optional. A page token, received from a previous + * `ListHostProjectRegistrations` call. Provide this to retrieve the + * subsequent page. + * When paginating, all other parameters (except page_size) provided to + * `ListHostProjectRegistrations` must match the call that provided the page + * token. + */ + // const pageToken = 'abc123' + /** + * Optional. An expression that filters the list of HostProjectRegistrations. + * A filter expression consists of a field name, a comparison + * operator, and a value for filtering. The value must be a string. All + * standard operators as documented at https://google.aip.dev/160 are + * supported. + * The following fields in the `HostProjectRegistration` are eligible for + * filtering: + * * `name` - The name of the HostProjectRegistration. + * * `create_time` - The time at which the HostProjectRegistration was + * created. The value should be in the + * (RFC3339)https://tools.ietf.org/html/rfc3339 format. + * * `gcp_project` - The Google cloud project associated with the + * HostProjectRegistration. + */ + // const filter = 'abc123' + /** + * Optional. Hint for how to order the results. + */ + // const orderBy = 'abc123' + + // Imports the Apihub library + const {HostProjectRegistrationServiceClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new HostProjectRegistrationServiceClient(); + + async function callListHostProjectRegistrations() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = apihubClient.listHostProjectRegistrationsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListHostProjectRegistrations(); + // [END apihub_v1_generated_HostProjectRegistrationService_ListHostProjectRegistrations_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/linting_service.get_style_guide.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/linting_service.get_style_guide.js new file mode 100644 index 00000000000..7d1f96bcc46 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/linting_service.get_style_guide.js @@ -0,0 +1,63 @@ +// Copyright 2024 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 apihub_v1_generated_LintingService_GetStyleGuide_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 name of the spec to retrieve. + * Format: + * `projects/{project}/locations/{location}/plugins/{plugin}/styleGuide`. + */ + // const name = 'abc123' + + // Imports the Apihub library + const {LintingServiceClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new LintingServiceClient(); + + async function callGetStyleGuide() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await apihubClient.getStyleGuide(request); + console.log(response); + } + + callGetStyleGuide(); + // [END apihub_v1_generated_LintingService_GetStyleGuide_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/linting_service.get_style_guide_contents.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/linting_service.get_style_guide_contents.js new file mode 100644 index 00000000000..43a14577418 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/linting_service.get_style_guide_contents.js @@ -0,0 +1,64 @@ +// Copyright 2024 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 apihub_v1_generated_LintingService_GetStyleGuideContents_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 name of the StyleGuide whose contents need to be retrieved. + * There is exactly one style guide resource per project per location. + * The expected format is + * `projects/{project}/locations/{location}/plugins/{plugin}/styleGuide`. + */ + // const name = 'abc123' + + // Imports the Apihub library + const {LintingServiceClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new LintingServiceClient(); + + async function callGetStyleGuideContents() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await apihubClient.getStyleGuideContents(request); + console.log(response); + } + + callGetStyleGuideContents(); + // [END apihub_v1_generated_LintingService_GetStyleGuideContents_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/linting_service.lint_spec.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/linting_service.lint_spec.js new file mode 100644 index 00000000000..d1327648d85 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/linting_service.lint_spec.js @@ -0,0 +1,63 @@ +// Copyright 2024 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 apihub_v1_generated_LintingService_LintSpec_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 name of the spec to be linted. + * Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}` + */ + // const name = 'abc123' + + // Imports the Apihub library + const {LintingServiceClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new LintingServiceClient(); + + async function callLintSpec() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await apihubClient.lintSpec(request); + console.log(response); + } + + callLintSpec(); + // [END apihub_v1_generated_LintingService_LintSpec_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/linting_service.update_style_guide.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/linting_service.update_style_guide.js new file mode 100644 index 00000000000..7232754ad9a --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/linting_service.update_style_guide.js @@ -0,0 +1,65 @@ +// Copyright 2024 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(styleGuide) { + // [START apihub_v1_generated_LintingService_UpdateStyleGuide_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 Style guide resource to update. + */ + // const styleGuide = {} + /** + * Optional. The list of fields to update. + */ + // const updateMask = {} + + // Imports the Apihub library + const {LintingServiceClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new LintingServiceClient(); + + async function callUpdateStyleGuide() { + // Construct request + const request = { + styleGuide, + }; + + // Run request + const response = await apihubClient.updateStyleGuide(request); + console.log(response); + } + + callUpdateStyleGuide(); + // [END apihub_v1_generated_LintingService_UpdateStyleGuide_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/provisioning.create_api_hub_instance.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/provisioning.create_api_hub_instance.js new file mode 100644 index 00000000000..2e55a19872d --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/provisioning.create_api_hub_instance.js @@ -0,0 +1,76 @@ +// Copyright 2024 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, apiHubInstance) { + // [START apihub_v1_generated_Provisioning_CreateApiHubInstance_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 parent resource for the Api Hub instance resource. + * Format: `projects/{project}/locations/{location}` + */ + // const parent = 'abc123' + /** + * Optional. Identifier to assign to the Api Hub instance. Must be unique + * within scope of the parent resource. If the field is not provided, system + * generated id will be used. + * This value should be 4-40 characters, and valid characters + * are `/[a-z][A-Z][0-9]-_/`. + */ + // const apiHubInstanceId = 'abc123' + /** + * Required. The ApiHub instance. + */ + // const apiHubInstance = {} + + // Imports the Apihub library + const {ProvisioningClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new ProvisioningClient(); + + async function callCreateApiHubInstance() { + // Construct request + const request = { + parent, + apiHubInstance, + }; + + // Run request + const [operation] = await apihubClient.createApiHubInstance(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateApiHubInstance(); + // [END apihub_v1_generated_Provisioning_CreateApiHubInstance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/provisioning.get_api_hub_instance.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/provisioning.get_api_hub_instance.js new file mode 100644 index 00000000000..a735a2af5a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/provisioning.get_api_hub_instance.js @@ -0,0 +1,63 @@ +// Copyright 2024 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 apihub_v1_generated_Provisioning_GetApiHubInstance_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 name of the Api Hub instance to retrieve. + * Format: + * `projects/{project}/locations/{location}/apiHubInstances/{apiHubInstance}`. + */ + // const name = 'abc123' + + // Imports the Apihub library + const {ProvisioningClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new ProvisioningClient(); + + async function callGetApiHubInstance() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await apihubClient.getApiHubInstance(request); + console.log(response); + } + + callGetApiHubInstance(); + // [END apihub_v1_generated_Provisioning_GetApiHubInstance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/provisioning.lookup_api_hub_instance.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/provisioning.lookup_api_hub_instance.js new file mode 100644 index 00000000000..c521c44746c --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/provisioning.lookup_api_hub_instance.js @@ -0,0 +1,64 @@ +// Copyright 2024 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 apihub_v1_generated_Provisioning_LookupApiHubInstance_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. There will always be only one Api Hub instance for a GCP project + * across all locations. + * The parent resource for the Api Hub instance resource. + * Format: `projects/{project}/locations/{location}` + */ + // const parent = 'abc123' + + // Imports the Apihub library + const {ProvisioningClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new ProvisioningClient(); + + async function callLookupApiHubInstance() { + // Construct request + const request = { + parent, + }; + + // Run request + const response = await apihubClient.lookupApiHubInstance(request); + console.log(response); + } + + callLookupApiHubInstance(); + // [END apihub_v1_generated_Provisioning_LookupApiHubInstance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/runtime_project_attachment_service.create_runtime_project_attachment.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/runtime_project_attachment_service.create_runtime_project_attachment.js new file mode 100644 index 00000000000..031f5a951a5 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/runtime_project_attachment_service.create_runtime_project_attachment.js @@ -0,0 +1,75 @@ +// Copyright 2024 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, runtimeProjectAttachmentId, runtimeProjectAttachment) { + // [START apihub_v1_generated_RuntimeProjectAttachmentService_CreateRuntimeProjectAttachment_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 parent resource for the Runtime Project Attachment. + * Format: `projects/{project}/locations/{location}` + */ + // const parent = 'abc123' + /** + * Required. The ID to use for the Runtime Project Attachment, which will + * become the final component of the Runtime Project Attachment's name. The ID + * must be the same as the project ID of the Google cloud project specified in + * the runtime_project_attachment.runtime_project field. + */ + // const runtimeProjectAttachmentId = 'abc123' + /** + * Required. The Runtime Project Attachment to create. + */ + // const runtimeProjectAttachment = {} + + // Imports the Apihub library + const {RuntimeProjectAttachmentServiceClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new RuntimeProjectAttachmentServiceClient(); + + async function callCreateRuntimeProjectAttachment() { + // Construct request + const request = { + parent, + runtimeProjectAttachmentId, + runtimeProjectAttachment, + }; + + // Run request + const response = await apihubClient.createRuntimeProjectAttachment(request); + console.log(response); + } + + callCreateRuntimeProjectAttachment(); + // [END apihub_v1_generated_RuntimeProjectAttachmentService_CreateRuntimeProjectAttachment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/runtime_project_attachment_service.delete_runtime_project_attachment.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/runtime_project_attachment_service.delete_runtime_project_attachment.js new file mode 100644 index 00000000000..5950ad165a2 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/runtime_project_attachment_service.delete_runtime_project_attachment.js @@ -0,0 +1,63 @@ +// Copyright 2024 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 apihub_v1_generated_RuntimeProjectAttachmentService_DeleteRuntimeProjectAttachment_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 name of the Runtime Project Attachment to delete. + * Format: + * `projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}` + */ + // const name = 'abc123' + + // Imports the Apihub library + const {RuntimeProjectAttachmentServiceClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new RuntimeProjectAttachmentServiceClient(); + + async function callDeleteRuntimeProjectAttachment() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await apihubClient.deleteRuntimeProjectAttachment(request); + console.log(response); + } + + callDeleteRuntimeProjectAttachment(); + // [END apihub_v1_generated_RuntimeProjectAttachmentService_DeleteRuntimeProjectAttachment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/runtime_project_attachment_service.get_runtime_project_attachment.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/runtime_project_attachment_service.get_runtime_project_attachment.js new file mode 100644 index 00000000000..1f4bacb7174 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/runtime_project_attachment_service.get_runtime_project_attachment.js @@ -0,0 +1,63 @@ +// Copyright 2024 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 apihub_v1_generated_RuntimeProjectAttachmentService_GetRuntimeProjectAttachment_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 name of the API resource to retrieve. + * Format: + * `projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}` + */ + // const name = 'abc123' + + // Imports the Apihub library + const {RuntimeProjectAttachmentServiceClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new RuntimeProjectAttachmentServiceClient(); + + async function callGetRuntimeProjectAttachment() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await apihubClient.getRuntimeProjectAttachment(request); + console.log(response); + } + + callGetRuntimeProjectAttachment(); + // [END apihub_v1_generated_RuntimeProjectAttachmentService_GetRuntimeProjectAttachment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/runtime_project_attachment_service.list_runtime_project_attachments.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/runtime_project_attachment_service.list_runtime_project_attachments.js new file mode 100644 index 00000000000..fc112de47b2 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/runtime_project_attachment_service.list_runtime_project_attachments.js @@ -0,0 +1,100 @@ +// Copyright 2024 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 apihub_v1_generated_RuntimeProjectAttachmentService_ListRuntimeProjectAttachments_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 parent, which owns this collection of runtime project + * attachments. Format: `projects/{project}/locations/{location}` + */ + // const parent = 'abc123' + /** + * Optional. The maximum number of runtime project attachments to return. The + * service may return fewer than this value. If unspecified, at most 50 + * runtime project attachments will be returned. The maximum value is 1000; + * values above 1000 will be coerced to 1000. + */ + // const pageSize = 1234 + /** + * Optional. A page token, received from a previous + * `ListRuntimeProjectAttachments` call. Provide this to retrieve the + * subsequent page. + * When paginating, all other parameters (except page_size) provided to + * `ListRuntimeProjectAttachments` must match the call that provided the page + * token. + */ + // const pageToken = 'abc123' + /** + * Optional. An expression that filters the list of RuntimeProjectAttachments. + * A filter expression consists of a field name, a comparison + * operator, and a value for filtering. The value must be a string. All + * standard operators as documented at https://google.aip.dev/160 are + * supported. + * The following fields in the `RuntimeProjectAttachment` are eligible for + * filtering: + * * `name` - The name of the RuntimeProjectAttachment. + * * `create_time` - The time at which the RuntimeProjectAttachment was + * created. The value should be in the + * (RFC3339)https://tools.ietf.org/html/rfc3339 format. + * * `runtime_project` - The Google cloud project associated with the + * RuntimeProjectAttachment. + */ + // const filter = 'abc123' + /** + * Optional. Hint for how to order the results. + */ + // const orderBy = 'abc123' + + // Imports the Apihub library + const {RuntimeProjectAttachmentServiceClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new RuntimeProjectAttachmentServiceClient(); + + async function callListRuntimeProjectAttachments() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = apihubClient.listRuntimeProjectAttachmentsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListRuntimeProjectAttachments(); + // [END apihub_v1_generated_RuntimeProjectAttachmentService_ListRuntimeProjectAttachments_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/runtime_project_attachment_service.lookup_runtime_project_attachment.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/runtime_project_attachment_service.lookup_runtime_project_attachment.js new file mode 100644 index 00000000000..0fb18901145 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/runtime_project_attachment_service.lookup_runtime_project_attachment.js @@ -0,0 +1,63 @@ +// Copyright 2024 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 apihub_v1_generated_RuntimeProjectAttachmentService_LookupRuntimeProjectAttachment_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. Runtime project ID to look up runtime project attachment for. + * Lookup happens across all regions. Expected format: + * `projects/{project}/locations/{location}`. + */ + // const name = 'abc123' + + // Imports the Apihub library + const {RuntimeProjectAttachmentServiceClient} = require('@google-cloud/apihub').v1; + + // Instantiates a client + const apihubClient = new RuntimeProjectAttachmentServiceClient(); + + async function callLookupRuntimeProjectAttachment() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await apihubClient.lookupRuntimeProjectAttachment(request); + console.log(response); + } + + callLookupRuntimeProjectAttachment(); + // [END apihub_v1_generated_RuntimeProjectAttachmentService_LookupRuntimeProjectAttachment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/snippet_metadata_google.cloud.apihub.v1.json b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/snippet_metadata_google.cloud.apihub.v1.json new file mode 100644 index 00000000000..9690b6949f7 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/snippet_metadata_google.cloud.apihub.v1.json @@ -0,0 +1,2595 @@ +{ + "clientLibrary": { + "name": "nodejs-apihub", + "version": "0.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.apihub.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "regionTag": "apihub_v1_generated_ApiHub_CreateApi_async", + "title": "ApiHub createApi Sample", + "origin": "API_DEFINITION", + "description": " Create an API resource in the API hub. Once an API resource is created, versions can be added to it.", + "canonical": true, + "file": "api_hub.create_api.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateApi", + "fullName": "google.cloud.apihub.v1.ApiHub.CreateApi", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "api_id", + "type": "TYPE_STRING" + }, + { + "name": "api", + "type": ".google.cloud.apihub.v1.Api" + } + ], + "resultType": ".google.cloud.apihub.v1.Api", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "CreateApi", + "fullName": "google.cloud.apihub.v1.ApiHub.CreateApi", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_GetApi_async", + "title": "ApiHub getApi Sample", + "origin": "API_DEFINITION", + "description": " Get API resource details including the API versions contained in it.", + "canonical": true, + "file": "api_hub.get_api.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetApi", + "fullName": "google.cloud.apihub.v1.ApiHub.GetApi", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apihub.v1.Api", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "GetApi", + "fullName": "google.cloud.apihub.v1.ApiHub.GetApi", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_ListApis_async", + "title": "ApiHub listApis Sample", + "origin": "API_DEFINITION", + "description": " List API resources in the API hub.", + "canonical": true, + "file": "api_hub.list_apis.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 138, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListApis", + "fullName": "google.cloud.apihub.v1.ApiHub.ListApis", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apihub.v1.ListApisResponse", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "ListApis", + "fullName": "google.cloud.apihub.v1.ApiHub.ListApis", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_UpdateApi_async", + "title": "ApiHub updateApi Sample", + "origin": "API_DEFINITION", + "description": " Update an API resource in the API hub. The following fields in the [API][] can be updated: * [display_name][google.cloud.apihub.v1.Api.display_name] * [description][google.cloud.apihub.v1.Api.description] * [owner][google.cloud.apihub.v1.Api.owner] * [documentation][google.cloud.apihub.v1.Api.documentation] * [target_user][google.cloud.apihub.v1.Api.target_user] * [team][google.cloud.apihub.v1.Api.team] * [business_unit][google.cloud.apihub.v1.Api.business_unit] * [maturity_level][google.cloud.apihub.v1.Api.maturity_level] * [attributes][google.cloud.apihub.v1.Api.attributes] The [update_mask][google.cloud.apihub.v1.UpdateApiRequest.update_mask] should be used to specify the fields being updated. Updating the owner field requires complete owner message and updates both owner and email fields.", + "canonical": true, + "file": "api_hub.update_api.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateApi", + "fullName": "google.cloud.apihub.v1.ApiHub.UpdateApi", + "async": true, + "parameters": [ + { + "name": "api", + "type": ".google.cloud.apihub.v1.Api" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.apihub.v1.Api", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "UpdateApi", + "fullName": "google.cloud.apihub.v1.ApiHub.UpdateApi", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_DeleteApi_async", + "title": "ApiHub deleteApi Sample", + "origin": "API_DEFINITION", + "description": " Delete an API resource in the API hub. API can only be deleted if all underlying versions are deleted.", + "canonical": true, + "file": "api_hub.delete_api.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteApi", + "fullName": "google.cloud.apihub.v1.ApiHub.DeleteApi", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "force", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "DeleteApi", + "fullName": "google.cloud.apihub.v1.ApiHub.DeleteApi", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_CreateVersion_async", + "title": "ApiHub createVersion Sample", + "origin": "API_DEFINITION", + "description": " Create an API version for an API resource in the API hub.", + "canonical": true, + "file": "api_hub.create_version.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateVersion", + "fullName": "google.cloud.apihub.v1.ApiHub.CreateVersion", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "version_id", + "type": "TYPE_STRING" + }, + { + "name": "version", + "type": ".google.cloud.apihub.v1.Version" + } + ], + "resultType": ".google.cloud.apihub.v1.Version", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "CreateVersion", + "fullName": "google.cloud.apihub.v1.ApiHub.CreateVersion", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_GetVersion_async", + "title": "ApiHub getVersion Sample", + "origin": "API_DEFINITION", + "description": " Get details about the API version of an API resource. This will include information about the specs and operations present in the API version as well as the deployments linked to it.", + "canonical": true, + "file": "api_hub.get_version.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetVersion", + "fullName": "google.cloud.apihub.v1.ApiHub.GetVersion", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apihub.v1.Version", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "GetVersion", + "fullName": "google.cloud.apihub.v1.ApiHub.GetVersion", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_ListVersions_async", + "title": "ApiHub listVersions Sample", + "origin": "API_DEFINITION", + "description": " List API versions of an API resource in the API hub.", + "canonical": true, + "file": "api_hub.list_versions.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 126, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListVersions", + "fullName": "google.cloud.apihub.v1.ApiHub.ListVersions", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apihub.v1.ListVersionsResponse", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "ListVersions", + "fullName": "google.cloud.apihub.v1.ApiHub.ListVersions", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_UpdateVersion_async", + "title": "ApiHub updateVersion Sample", + "origin": "API_DEFINITION", + "description": " Update API version. The following fields in the [version][google.cloud.apihub.v1.Version] can be updated currently: * [display_name][google.cloud.apihub.v1.Version.display_name] * [description][google.cloud.apihub.v1.Version.description] * [documentation][google.cloud.apihub.v1.Version.documentation] * [deployments][google.cloud.apihub.v1.Version.deployments] * [lifecycle][google.cloud.apihub.v1.Version.lifecycle] * [compliance][google.cloud.apihub.v1.Version.compliance] * [accreditation][google.cloud.apihub.v1.Version.accreditation] * [attributes][google.cloud.apihub.v1.Version.attributes] The [update_mask][google.cloud.apihub.v1.UpdateVersionRequest.update_mask] should be used to specify the fields being updated.", + "canonical": true, + "file": "api_hub.update_version.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateVersion", + "fullName": "google.cloud.apihub.v1.ApiHub.UpdateVersion", + "async": true, + "parameters": [ + { + "name": "version", + "type": ".google.cloud.apihub.v1.Version" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.apihub.v1.Version", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "UpdateVersion", + "fullName": "google.cloud.apihub.v1.ApiHub.UpdateVersion", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_DeleteVersion_async", + "title": "ApiHub deleteVersion Sample", + "origin": "API_DEFINITION", + "description": " Delete an API version. Version can only be deleted if all underlying specs, operations, definitions and linked deployments are deleted.", + "canonical": true, + "file": "api_hub.delete_version.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteVersion", + "fullName": "google.cloud.apihub.v1.ApiHub.DeleteVersion", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "force", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "DeleteVersion", + "fullName": "google.cloud.apihub.v1.ApiHub.DeleteVersion", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_CreateSpec_async", + "title": "ApiHub createSpec Sample", + "origin": "API_DEFINITION", + "description": " Add a spec to an API version in the API hub. Multiple specs can be added to an API version. Note, while adding a spec, at least one of `contents` or `source_uri` must be provided. If `contents` is provided, then `spec_type` must also be provided. On adding a spec with contents to the version, the operations present in it will be added to the version.Note that the file contents in the spec should be of the same type as defined in the `projects/{project}/locations/{location}/attributes/system-spec-type` attribute associated with spec resource. Note that specs of various types can be uploaded, however parsing of details is supported for OpenAPI spec currently. In order to access the information parsed from the spec, use the [GetSpec][google.cloud.apihub.v1.ApiHub.GetSpec] method. In order to access the raw contents for a particular spec, use the [GetSpecContents][google.cloud.apihub.v1.ApiHub.GetSpecContents] method. In order to access the operations parsed from the spec, use the [ListAPIOperations][google.cloud.apihub.v1.ApiHub.ListApiOperations] method.", + "canonical": true, + "file": "api_hub.create_spec.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 71, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateSpec", + "fullName": "google.cloud.apihub.v1.ApiHub.CreateSpec", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "spec_id", + "type": "TYPE_STRING" + }, + { + "name": "spec", + "type": ".google.cloud.apihub.v1.Spec" + } + ], + "resultType": ".google.cloud.apihub.v1.Spec", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "CreateSpec", + "fullName": "google.cloud.apihub.v1.ApiHub.CreateSpec", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_GetSpec_async", + "title": "ApiHub getSpec Sample", + "origin": "API_DEFINITION", + "description": " Get details about the information parsed from a spec. Note that this method does not return the raw spec contents. Use [GetSpecContents][google.cloud.apihub.v1.ApiHub.GetSpecContents] method to retrieve the same.", + "canonical": true, + "file": "api_hub.get_spec.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetSpec", + "fullName": "google.cloud.apihub.v1.ApiHub.GetSpec", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apihub.v1.Spec", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "GetSpec", + "fullName": "google.cloud.apihub.v1.ApiHub.GetSpec", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_GetSpecContents_async", + "title": "ApiHub getSpecContents Sample", + "origin": "API_DEFINITION", + "description": " Get spec contents.", + "canonical": true, + "file": "api_hub.get_spec_contents.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetSpecContents", + "fullName": "google.cloud.apihub.v1.ApiHub.GetSpecContents", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apihub.v1.SpecContents", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "GetSpecContents", + "fullName": "google.cloud.apihub.v1.ApiHub.GetSpecContents", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_ListSpecs_async", + "title": "ApiHub listSpecs Sample", + "origin": "API_DEFINITION", + "description": " List specs corresponding to a particular API resource.", + "canonical": true, + "file": "api_hub.list_specs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 119, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListSpecs", + "fullName": "google.cloud.apihub.v1.ApiHub.ListSpecs", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apihub.v1.ListSpecsResponse", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "ListSpecs", + "fullName": "google.cloud.apihub.v1.ApiHub.ListSpecs", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_UpdateSpec_async", + "title": "ApiHub updateSpec Sample", + "origin": "API_DEFINITION", + "description": " Update spec. The following fields in the [spec][google.cloud.apihub.v1.Spec] can be updated: * [display_name][google.cloud.apihub.v1.Spec.display_name] * [source_uri][google.cloud.apihub.v1.Spec.source_uri] * [lint_response][google.cloud.apihub.v1.Spec.lint_response] * [attributes][google.cloud.apihub.v1.Spec.attributes] * [contents][google.cloud.apihub.v1.Spec.contents] * [spec_type][google.cloud.apihub.v1.Spec.spec_type] In case of an OAS spec, updating spec contents can lead to: 1. Creation, deletion and update of operations. 2. Creation, deletion and update of definitions. 3. Update of other info parsed out from the new spec. In case of contents or source_uri being present in update mask, spec_type must also be present. Also, spec_type can not be present in update mask if contents or source_uri is not present. The [update_mask][google.cloud.apihub.v1.UpdateSpecRequest.update_mask] should be used to specify the fields being updated.", + "canonical": true, + "file": "api_hub.update_spec.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateSpec", + "fullName": "google.cloud.apihub.v1.ApiHub.UpdateSpec", + "async": true, + "parameters": [ + { + "name": "spec", + "type": ".google.cloud.apihub.v1.Spec" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.apihub.v1.Spec", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "UpdateSpec", + "fullName": "google.cloud.apihub.v1.ApiHub.UpdateSpec", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_DeleteSpec_async", + "title": "ApiHub deleteSpec Sample", + "origin": "API_DEFINITION", + "description": " Delete a spec. Deleting a spec will also delete the associated operations from the version.", + "canonical": true, + "file": "api_hub.delete_spec.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteSpec", + "fullName": "google.cloud.apihub.v1.ApiHub.DeleteSpec", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "DeleteSpec", + "fullName": "google.cloud.apihub.v1.ApiHub.DeleteSpec", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_GetApiOperation_async", + "title": "ApiHub getApiOperation Sample", + "origin": "API_DEFINITION", + "description": " Get details about a particular operation in API version.", + "canonical": true, + "file": "api_hub.get_api_operation.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetApiOperation", + "fullName": "google.cloud.apihub.v1.ApiHub.GetApiOperation", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apihub.v1.ApiOperation", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "GetApiOperation", + "fullName": "google.cloud.apihub.v1.ApiHub.GetApiOperation", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_ListApiOperations_async", + "title": "ApiHub listApiOperations Sample", + "origin": "API_DEFINITION", + "description": " List operations in an API version.", + "canonical": true, + "file": "api_hub.list_api_operations.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 109, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListApiOperations", + "fullName": "google.cloud.apihub.v1.ApiHub.ListApiOperations", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apihub.v1.ListApiOperationsResponse", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "ListApiOperations", + "fullName": "google.cloud.apihub.v1.ApiHub.ListApiOperations", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_GetDefinition_async", + "title": "ApiHub getDefinition Sample", + "origin": "API_DEFINITION", + "description": " Get details about a definition in an API version.", + "canonical": true, + "file": "api_hub.get_definition.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetDefinition", + "fullName": "google.cloud.apihub.v1.ApiHub.GetDefinition", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apihub.v1.Definition", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "GetDefinition", + "fullName": "google.cloud.apihub.v1.ApiHub.GetDefinition", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_CreateDeployment_async", + "title": "ApiHub createDeployment Sample", + "origin": "API_DEFINITION", + "description": " Create a deployment resource in the API hub. Once a deployment resource is created, it can be associated with API versions.", + "canonical": true, + "file": "api_hub.create_deployment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 70, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateDeployment", + "fullName": "google.cloud.apihub.v1.ApiHub.CreateDeployment", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "deployment_id", + "type": "TYPE_STRING" + }, + { + "name": "deployment", + "type": ".google.cloud.apihub.v1.Deployment" + } + ], + "resultType": ".google.cloud.apihub.v1.Deployment", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "CreateDeployment", + "fullName": "google.cloud.apihub.v1.ApiHub.CreateDeployment", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_GetDeployment_async", + "title": "ApiHub getDeployment Sample", + "origin": "API_DEFINITION", + "description": " Get details about a deployment and the API versions linked to it.", + "canonical": true, + "file": "api_hub.get_deployment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetDeployment", + "fullName": "google.cloud.apihub.v1.ApiHub.GetDeployment", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apihub.v1.Deployment", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "GetDeployment", + "fullName": "google.cloud.apihub.v1.ApiHub.GetDeployment", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_ListDeployments_async", + "title": "ApiHub listDeployments Sample", + "origin": "API_DEFINITION", + "description": " List deployment resources in the API hub.", + "canonical": true, + "file": "api_hub.list_deployments.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 125, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListDeployments", + "fullName": "google.cloud.apihub.v1.ApiHub.ListDeployments", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apihub.v1.ListDeploymentsResponse", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "ListDeployments", + "fullName": "google.cloud.apihub.v1.ApiHub.ListDeployments", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_UpdateDeployment_async", + "title": "ApiHub updateDeployment Sample", + "origin": "API_DEFINITION", + "description": " Update a deployment resource in the API hub. The following fields in the [deployment resource][google.cloud.apihub.v1.Deployment] can be updated: * [display_name][google.cloud.apihub.v1.Deployment.display_name] * [description][google.cloud.apihub.v1.Deployment.description] * [documentation][google.cloud.apihub.v1.Deployment.documentation] * [deployment_type][google.cloud.apihub.v1.Deployment.deployment_type] * [resource_uri][google.cloud.apihub.v1.Deployment.resource_uri] * [endpoints][google.cloud.apihub.v1.Deployment.endpoints] * [slo][google.cloud.apihub.v1.Deployment.slo] * [environment][google.cloud.apihub.v1.Deployment.environment] * [attributes][google.cloud.apihub.v1.Deployment.attributes] The [update_mask][google.cloud.apihub.v1.UpdateDeploymentRequest.update_mask] should be used to specify the fields being updated.", + "canonical": true, + "file": "api_hub.update_deployment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateDeployment", + "fullName": "google.cloud.apihub.v1.ApiHub.UpdateDeployment", + "async": true, + "parameters": [ + { + "name": "deployment", + "type": ".google.cloud.apihub.v1.Deployment" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.apihub.v1.Deployment", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "UpdateDeployment", + "fullName": "google.cloud.apihub.v1.ApiHub.UpdateDeployment", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_DeleteDeployment_async", + "title": "ApiHub deleteDeployment Sample", + "origin": "API_DEFINITION", + "description": " Delete a deployment resource in the API hub.", + "canonical": true, + "file": "api_hub.delete_deployment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteDeployment", + "fullName": "google.cloud.apihub.v1.ApiHub.DeleteDeployment", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "DeleteDeployment", + "fullName": "google.cloud.apihub.v1.ApiHub.DeleteDeployment", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_CreateAttribute_async", + "title": "ApiHub createAttribute Sample", + "origin": "API_DEFINITION", + "description": " Create a user defined attribute. Certain pre defined attributes are already created by the API hub. These attributes will have type as `SYSTEM_DEFINED` and can be listed via [ListAttributes][google.cloud.apihub.v1.ApiHub.ListAttributes] method. Allowed values for the same can be updated via [UpdateAttribute][google.cloud.apihub.v1.ApiHub.UpdateAttribute] method.", + "canonical": true, + "file": "api_hub.create_attribute.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 70, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateAttribute", + "fullName": "google.cloud.apihub.v1.ApiHub.CreateAttribute", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "attribute_id", + "type": "TYPE_STRING" + }, + { + "name": "attribute", + "type": ".google.cloud.apihub.v1.Attribute" + } + ], + "resultType": ".google.cloud.apihub.v1.Attribute", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "CreateAttribute", + "fullName": "google.cloud.apihub.v1.ApiHub.CreateAttribute", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_GetAttribute_async", + "title": "ApiHub getAttribute Sample", + "origin": "API_DEFINITION", + "description": " Get details about the attribute.", + "canonical": true, + "file": "api_hub.get_attribute.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetAttribute", + "fullName": "google.cloud.apihub.v1.ApiHub.GetAttribute", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apihub.v1.Attribute", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "GetAttribute", + "fullName": "google.cloud.apihub.v1.ApiHub.GetAttribute", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_UpdateAttribute_async", + "title": "ApiHub updateAttribute Sample", + "origin": "API_DEFINITION", + "description": " Update the attribute. The following fields in the [Attribute resource][google.cloud.apihub.v1.Attribute] can be updated: * [display_name][google.cloud.apihub.v1.Attribute.display_name] The display name can be updated for user defined attributes only. * [description][google.cloud.apihub.v1.Attribute.description] The description can be updated for user defined attributes only. * [allowed_values][google.cloud.apihub.v1.Attribute.allowed_values] To update the list of allowed values, clients need to use the fetched list of allowed values and add or remove values to or from the same list. The mutable allowed values can be updated for both user defined and System defined attributes. The immutable allowed values cannot be updated or deleted. The updated list of allowed values cannot be empty. If an allowed value that is already used by some resource's attribute is deleted, then the association between the resource and the attribute value will also be deleted. * [cardinality][google.cloud.apihub.v1.Attribute.cardinality] The cardinality can be updated for user defined attributes only. Cardinality can only be increased during an update. The [update_mask][google.cloud.apihub.v1.UpdateAttributeRequest.update_mask] should be used to specify the fields being updated.", + "canonical": true, + "file": "api_hub.update_attribute.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateAttribute", + "fullName": "google.cloud.apihub.v1.ApiHub.UpdateAttribute", + "async": true, + "parameters": [ + { + "name": "attribute", + "type": ".google.cloud.apihub.v1.Attribute" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.apihub.v1.Attribute", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "UpdateAttribute", + "fullName": "google.cloud.apihub.v1.ApiHub.UpdateAttribute", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_DeleteAttribute_async", + "title": "ApiHub deleteAttribute Sample", + "origin": "API_DEFINITION", + "description": " Delete an attribute. Note: System defined attributes cannot be deleted. All associations of the attribute being deleted with any API hub resource will also get deleted.", + "canonical": true, + "file": "api_hub.delete_attribute.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteAttribute", + "fullName": "google.cloud.apihub.v1.ApiHub.DeleteAttribute", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "DeleteAttribute", + "fullName": "google.cloud.apihub.v1.ApiHub.DeleteAttribute", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_ListAttributes_async", + "title": "ApiHub listAttributes Sample", + "origin": "API_DEFINITION", + "description": " List all attributes.", + "canonical": true, + "file": "api_hub.list_attributes.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 110, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListAttributes", + "fullName": "google.cloud.apihub.v1.ApiHub.ListAttributes", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apihub.v1.ListAttributesResponse", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "ListAttributes", + "fullName": "google.cloud.apihub.v1.ApiHub.ListAttributes", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_SearchResources_async", + "title": "ApiHub searchResources Sample", + "origin": "API_DEFINITION", + "description": " Search across API-Hub resources.", + "canonical": true, + "file": "api_hub.search_resources.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 100, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SearchResources", + "fullName": "google.cloud.apihub.v1.ApiHub.SearchResources", + "async": true, + "parameters": [ + { + "name": "location", + "type": "TYPE_STRING" + }, + { + "name": "query", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apihub.v1.SearchResourcesResponse", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "SearchResources", + "fullName": "google.cloud.apihub.v1.ApiHub.SearchResources", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_CreateExternalApi_async", + "title": "ApiHub createExternalApi Sample", + "origin": "API_DEFINITION", + "description": " Create an External API resource in the API hub.", + "canonical": true, + "file": "api_hub.create_external_api.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 71, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateExternalApi", + "fullName": "google.cloud.apihub.v1.ApiHub.CreateExternalApi", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "external_api_id", + "type": "TYPE_STRING" + }, + { + "name": "external_api", + "type": ".google.cloud.apihub.v1.ExternalApi" + } + ], + "resultType": ".google.cloud.apihub.v1.ExternalApi", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "CreateExternalApi", + "fullName": "google.cloud.apihub.v1.ApiHub.CreateExternalApi", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_GetExternalApi_async", + "title": "ApiHub getExternalApi Sample", + "origin": "API_DEFINITION", + "description": " Get details about an External API resource in the API hub.", + "canonical": true, + "file": "api_hub.get_external_api.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetExternalApi", + "fullName": "google.cloud.apihub.v1.ApiHub.GetExternalApi", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apihub.v1.ExternalApi", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "GetExternalApi", + "fullName": "google.cloud.apihub.v1.ApiHub.GetExternalApi", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_UpdateExternalApi_async", + "title": "ApiHub updateExternalApi Sample", + "origin": "API_DEFINITION", + "description": " Update an External API resource in the API hub. The following fields can be updated: * [display_name][google.cloud.apihub.v1.ExternalApi.display_name] * [description][google.cloud.apihub.v1.ExternalApi.description] * [documentation][google.cloud.apihub.v1.ExternalApi.documentation] * [endpoints][google.cloud.apihub.v1.ExternalApi.endpoints] * [paths][google.cloud.apihub.v1.ExternalApi.paths] The [update_mask][google.cloud.apihub.v1.UpdateExternalApiRequest.update_mask] should be used to specify the fields being updated.", + "canonical": true, + "file": "api_hub.update_external_api.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateExternalApi", + "fullName": "google.cloud.apihub.v1.ApiHub.UpdateExternalApi", + "async": true, + "parameters": [ + { + "name": "external_api", + "type": ".google.cloud.apihub.v1.ExternalApi" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.apihub.v1.ExternalApi", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "UpdateExternalApi", + "fullName": "google.cloud.apihub.v1.ApiHub.UpdateExternalApi", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_DeleteExternalApi_async", + "title": "ApiHub deleteExternalApi Sample", + "origin": "API_DEFINITION", + "description": " Delete an External API resource in the API hub.", + "canonical": true, + "file": "api_hub.delete_external_api.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteExternalApi", + "fullName": "google.cloud.apihub.v1.ApiHub.DeleteExternalApi", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "DeleteExternalApi", + "fullName": "google.cloud.apihub.v1.ApiHub.DeleteExternalApi", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHub_ListExternalApis_async", + "title": "ApiHub listExternalApis Sample", + "origin": "API_DEFINITION", + "description": " List External API resources in the API hub.", + "canonical": true, + "file": "api_hub.list_external_apis.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 70, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListExternalApis", + "fullName": "google.cloud.apihub.v1.ApiHub.ListExternalApis", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apihub.v1.ListExternalApisResponse", + "client": { + "shortName": "ApiHubClient", + "fullName": "google.cloud.apihub.v1.ApiHubClient" + }, + "method": { + "shortName": "ListExternalApis", + "fullName": "google.cloud.apihub.v1.ApiHub.ListExternalApis", + "service": { + "shortName": "ApiHub", + "fullName": "google.cloud.apihub.v1.ApiHub" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHubDependencies_CreateDependency_async", + "title": "ApiHub createDependency Sample", + "origin": "API_DEFINITION", + "description": " Create a dependency between two entities in the API hub.", + "canonical": true, + "file": "api_hub_dependencies.create_dependency.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateDependency", + "fullName": "google.cloud.apihub.v1.ApiHubDependencies.CreateDependency", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "dependency_id", + "type": "TYPE_STRING" + }, + { + "name": "dependency", + "type": ".google.cloud.apihub.v1.Dependency" + } + ], + "resultType": ".google.cloud.apihub.v1.Dependency", + "client": { + "shortName": "ApiHubDependenciesClient", + "fullName": "google.cloud.apihub.v1.ApiHubDependenciesClient" + }, + "method": { + "shortName": "CreateDependency", + "fullName": "google.cloud.apihub.v1.ApiHubDependencies.CreateDependency", + "service": { + "shortName": "ApiHubDependencies", + "fullName": "google.cloud.apihub.v1.ApiHubDependencies" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHubDependencies_GetDependency_async", + "title": "ApiHub getDependency Sample", + "origin": "API_DEFINITION", + "description": " Get details about a dependency resource in the API hub.", + "canonical": true, + "file": "api_hub_dependencies.get_dependency.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetDependency", + "fullName": "google.cloud.apihub.v1.ApiHubDependencies.GetDependency", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apihub.v1.Dependency", + "client": { + "shortName": "ApiHubDependenciesClient", + "fullName": "google.cloud.apihub.v1.ApiHubDependenciesClient" + }, + "method": { + "shortName": "GetDependency", + "fullName": "google.cloud.apihub.v1.ApiHubDependencies.GetDependency", + "service": { + "shortName": "ApiHubDependencies", + "fullName": "google.cloud.apihub.v1.ApiHubDependencies" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHubDependencies_UpdateDependency_async", + "title": "ApiHub updateDependency Sample", + "origin": "API_DEFINITION", + "description": " Update a dependency based on the [update_mask][google.cloud.apihub.v1.UpdateDependencyRequest.update_mask] provided in the request. The following fields in the [dependency][google.cloud.apihub.v1.Dependency] can be updated: * [description][google.cloud.apihub.v1.Dependency.description]", + "canonical": true, + "file": "api_hub_dependencies.update_dependency.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateDependency", + "fullName": "google.cloud.apihub.v1.ApiHubDependencies.UpdateDependency", + "async": true, + "parameters": [ + { + "name": "dependency", + "type": ".google.cloud.apihub.v1.Dependency" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.apihub.v1.Dependency", + "client": { + "shortName": "ApiHubDependenciesClient", + "fullName": "google.cloud.apihub.v1.ApiHubDependenciesClient" + }, + "method": { + "shortName": "UpdateDependency", + "fullName": "google.cloud.apihub.v1.ApiHubDependencies.UpdateDependency", + "service": { + "shortName": "ApiHubDependencies", + "fullName": "google.cloud.apihub.v1.ApiHubDependencies" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHubDependencies_DeleteDependency_async", + "title": "ApiHub deleteDependency Sample", + "origin": "API_DEFINITION", + "description": " Delete the dependency resource.", + "canonical": true, + "file": "api_hub_dependencies.delete_dependency.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteDependency", + "fullName": "google.cloud.apihub.v1.ApiHubDependencies.DeleteDependency", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "ApiHubDependenciesClient", + "fullName": "google.cloud.apihub.v1.ApiHubDependenciesClient" + }, + "method": { + "shortName": "DeleteDependency", + "fullName": "google.cloud.apihub.v1.ApiHubDependencies.DeleteDependency", + "service": { + "shortName": "ApiHubDependencies", + "fullName": "google.cloud.apihub.v1.ApiHubDependencies" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHubDependencies_ListDependencies_async", + "title": "ApiHub listDependencies Sample", + "origin": "API_DEFINITION", + "description": " List dependencies based on the provided filter and pagination parameters.", + "canonical": true, + "file": "api_hub_dependencies.list_dependencies.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 102, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListDependencies", + "fullName": "google.cloud.apihub.v1.ApiHubDependencies.ListDependencies", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apihub.v1.ListDependenciesResponse", + "client": { + "shortName": "ApiHubDependenciesClient", + "fullName": "google.cloud.apihub.v1.ApiHubDependenciesClient" + }, + "method": { + "shortName": "ListDependencies", + "fullName": "google.cloud.apihub.v1.ApiHubDependencies.ListDependencies", + "service": { + "shortName": "ApiHubDependencies", + "fullName": "google.cloud.apihub.v1.ApiHubDependencies" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHubPlugin_GetPlugin_async", + "title": "ApiHub getPlugin Sample", + "origin": "API_DEFINITION", + "description": " Get details about an API Hub plugin.", + "canonical": true, + "file": "api_hub_plugin.get_plugin.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetPlugin", + "fullName": "google.cloud.apihub.v1.ApiHubPlugin.GetPlugin", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apihub.v1.Plugin", + "client": { + "shortName": "ApiHubPluginClient", + "fullName": "google.cloud.apihub.v1.ApiHubPluginClient" + }, + "method": { + "shortName": "GetPlugin", + "fullName": "google.cloud.apihub.v1.ApiHubPlugin.GetPlugin", + "service": { + "shortName": "ApiHubPlugin", + "fullName": "google.cloud.apihub.v1.ApiHubPlugin" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHubPlugin_EnablePlugin_async", + "title": "ApiHub enablePlugin Sample", + "origin": "API_DEFINITION", + "description": " Enables a plugin. The `state` of the plugin after enabling is `ENABLED`", + "canonical": true, + "file": "api_hub_plugin.enable_plugin.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "EnablePlugin", + "fullName": "google.cloud.apihub.v1.ApiHubPlugin.EnablePlugin", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apihub.v1.Plugin", + "client": { + "shortName": "ApiHubPluginClient", + "fullName": "google.cloud.apihub.v1.ApiHubPluginClient" + }, + "method": { + "shortName": "EnablePlugin", + "fullName": "google.cloud.apihub.v1.ApiHubPlugin.EnablePlugin", + "service": { + "shortName": "ApiHubPlugin", + "fullName": "google.cloud.apihub.v1.ApiHubPlugin" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_ApiHubPlugin_DisablePlugin_async", + "title": "ApiHub disablePlugin Sample", + "origin": "API_DEFINITION", + "description": " Disables a plugin. The `state` of the plugin after disabling is `DISABLED`", + "canonical": true, + "file": "api_hub_plugin.disable_plugin.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DisablePlugin", + "fullName": "google.cloud.apihub.v1.ApiHubPlugin.DisablePlugin", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apihub.v1.Plugin", + "client": { + "shortName": "ApiHubPluginClient", + "fullName": "google.cloud.apihub.v1.ApiHubPluginClient" + }, + "method": { + "shortName": "DisablePlugin", + "fullName": "google.cloud.apihub.v1.ApiHubPlugin.DisablePlugin", + "service": { + "shortName": "ApiHubPlugin", + "fullName": "google.cloud.apihub.v1.ApiHubPlugin" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_HostProjectRegistrationService_CreateHostProjectRegistration_async", + "title": "ApiHub createHostProjectRegistration Sample", + "origin": "API_DEFINITION", + "description": " Create a host project registration. A Google cloud project can be registered as a host project if it is not attached as a runtime project to another host project. A project can be registered as a host project only once. Subsequent register calls for the same project will fail.", + "canonical": true, + "file": "host_project_registration_service.create_host_project_registration.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateHostProjectRegistration", + "fullName": "google.cloud.apihub.v1.HostProjectRegistrationService.CreateHostProjectRegistration", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "host_project_registration_id", + "type": "TYPE_STRING" + }, + { + "name": "host_project_registration", + "type": ".google.cloud.apihub.v1.HostProjectRegistration" + } + ], + "resultType": ".google.cloud.apihub.v1.HostProjectRegistration", + "client": { + "shortName": "HostProjectRegistrationServiceClient", + "fullName": "google.cloud.apihub.v1.HostProjectRegistrationServiceClient" + }, + "method": { + "shortName": "CreateHostProjectRegistration", + "fullName": "google.cloud.apihub.v1.HostProjectRegistrationService.CreateHostProjectRegistration", + "service": { + "shortName": "HostProjectRegistrationService", + "fullName": "google.cloud.apihub.v1.HostProjectRegistrationService" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_HostProjectRegistrationService_GetHostProjectRegistration_async", + "title": "ApiHub getHostProjectRegistration Sample", + "origin": "API_DEFINITION", + "description": " Get a host project registration.", + "canonical": true, + "file": "host_project_registration_service.get_host_project_registration.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetHostProjectRegistration", + "fullName": "google.cloud.apihub.v1.HostProjectRegistrationService.GetHostProjectRegistration", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apihub.v1.HostProjectRegistration", + "client": { + "shortName": "HostProjectRegistrationServiceClient", + "fullName": "google.cloud.apihub.v1.HostProjectRegistrationServiceClient" + }, + "method": { + "shortName": "GetHostProjectRegistration", + "fullName": "google.cloud.apihub.v1.HostProjectRegistrationService.GetHostProjectRegistration", + "service": { + "shortName": "HostProjectRegistrationService", + "fullName": "google.cloud.apihub.v1.HostProjectRegistrationService" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_HostProjectRegistrationService_ListHostProjectRegistrations_async", + "title": "ApiHub listHostProjectRegistrations Sample", + "origin": "API_DEFINITION", + "description": " Lists host project registrations.", + "canonical": true, + "file": "host_project_registration_service.list_host_project_registrations.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 92, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListHostProjectRegistrations", + "fullName": "google.cloud.apihub.v1.HostProjectRegistrationService.ListHostProjectRegistrations", + "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" + } + ], + "resultType": ".google.cloud.apihub.v1.ListHostProjectRegistrationsResponse", + "client": { + "shortName": "HostProjectRegistrationServiceClient", + "fullName": "google.cloud.apihub.v1.HostProjectRegistrationServiceClient" + }, + "method": { + "shortName": "ListHostProjectRegistrations", + "fullName": "google.cloud.apihub.v1.HostProjectRegistrationService.ListHostProjectRegistrations", + "service": { + "shortName": "HostProjectRegistrationService", + "fullName": "google.cloud.apihub.v1.HostProjectRegistrationService" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_LintingService_GetStyleGuide_async", + "title": "ApiHub getStyleGuide Sample", + "origin": "API_DEFINITION", + "description": " Get the style guide being used for linting.", + "canonical": true, + "file": "linting_service.get_style_guide.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetStyleGuide", + "fullName": "google.cloud.apihub.v1.LintingService.GetStyleGuide", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apihub.v1.StyleGuide", + "client": { + "shortName": "LintingServiceClient", + "fullName": "google.cloud.apihub.v1.LintingServiceClient" + }, + "method": { + "shortName": "GetStyleGuide", + "fullName": "google.cloud.apihub.v1.LintingService.GetStyleGuide", + "service": { + "shortName": "LintingService", + "fullName": "google.cloud.apihub.v1.LintingService" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_LintingService_UpdateStyleGuide_async", + "title": "ApiHub updateStyleGuide Sample", + "origin": "API_DEFINITION", + "description": " Update the styleGuide to be used for liniting in by API hub.", + "canonical": true, + "file": "linting_service.update_style_guide.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateStyleGuide", + "fullName": "google.cloud.apihub.v1.LintingService.UpdateStyleGuide", + "async": true, + "parameters": [ + { + "name": "style_guide", + "type": ".google.cloud.apihub.v1.StyleGuide" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.apihub.v1.StyleGuide", + "client": { + "shortName": "LintingServiceClient", + "fullName": "google.cloud.apihub.v1.LintingServiceClient" + }, + "method": { + "shortName": "UpdateStyleGuide", + "fullName": "google.cloud.apihub.v1.LintingService.UpdateStyleGuide", + "service": { + "shortName": "LintingService", + "fullName": "google.cloud.apihub.v1.LintingService" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_LintingService_GetStyleGuideContents_async", + "title": "ApiHub getStyleGuideContents Sample", + "origin": "API_DEFINITION", + "description": " Get the contents of the style guide.", + "canonical": true, + "file": "linting_service.get_style_guide_contents.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetStyleGuideContents", + "fullName": "google.cloud.apihub.v1.LintingService.GetStyleGuideContents", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apihub.v1.StyleGuideContents", + "client": { + "shortName": "LintingServiceClient", + "fullName": "google.cloud.apihub.v1.LintingServiceClient" + }, + "method": { + "shortName": "GetStyleGuideContents", + "fullName": "google.cloud.apihub.v1.LintingService.GetStyleGuideContents", + "service": { + "shortName": "LintingService", + "fullName": "google.cloud.apihub.v1.LintingService" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_LintingService_LintSpec_async", + "title": "ApiHub lintSpec Sample", + "origin": "API_DEFINITION", + "description": " Lints the requested spec and updates the corresponding API Spec with the lint response. This lint response will be available in all subsequent Get and List Spec calls to Core service.", + "canonical": true, + "file": "linting_service.lint_spec.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "LintSpec", + "fullName": "google.cloud.apihub.v1.LintingService.LintSpec", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "LintingServiceClient", + "fullName": "google.cloud.apihub.v1.LintingServiceClient" + }, + "method": { + "shortName": "LintSpec", + "fullName": "google.cloud.apihub.v1.LintingService.LintSpec", + "service": { + "shortName": "LintingService", + "fullName": "google.cloud.apihub.v1.LintingService" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_Provisioning_CreateApiHubInstance_async", + "title": "ApiHub createApiHubInstance Sample", + "origin": "API_DEFINITION", + "description": " Provisions instance resources for the API Hub.", + "canonical": true, + "file": "provisioning.create_api_hub_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateApiHubInstance", + "fullName": "google.cloud.apihub.v1.Provisioning.CreateApiHubInstance", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "api_hub_instance_id", + "type": "TYPE_STRING" + }, + { + "name": "api_hub_instance", + "type": ".google.cloud.apihub.v1.ApiHubInstance" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "ProvisioningClient", + "fullName": "google.cloud.apihub.v1.ProvisioningClient" + }, + "method": { + "shortName": "CreateApiHubInstance", + "fullName": "google.cloud.apihub.v1.Provisioning.CreateApiHubInstance", + "service": { + "shortName": "Provisioning", + "fullName": "google.cloud.apihub.v1.Provisioning" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_Provisioning_GetApiHubInstance_async", + "title": "ApiHub getApiHubInstance Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single API Hub instance.", + "canonical": true, + "file": "provisioning.get_api_hub_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetApiHubInstance", + "fullName": "google.cloud.apihub.v1.Provisioning.GetApiHubInstance", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apihub.v1.ApiHubInstance", + "client": { + "shortName": "ProvisioningClient", + "fullName": "google.cloud.apihub.v1.ProvisioningClient" + }, + "method": { + "shortName": "GetApiHubInstance", + "fullName": "google.cloud.apihub.v1.Provisioning.GetApiHubInstance", + "service": { + "shortName": "Provisioning", + "fullName": "google.cloud.apihub.v1.Provisioning" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_Provisioning_LookupApiHubInstance_async", + "title": "ApiHub lookupApiHubInstance Sample", + "origin": "API_DEFINITION", + "description": " Looks up an Api Hub instance in a given GCP project. There will always be only one Api Hub instance for a GCP project across all locations.", + "canonical": true, + "file": "provisioning.lookup_api_hub_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "LookupApiHubInstance", + "fullName": "google.cloud.apihub.v1.Provisioning.LookupApiHubInstance", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apihub.v1.LookupApiHubInstanceResponse", + "client": { + "shortName": "ProvisioningClient", + "fullName": "google.cloud.apihub.v1.ProvisioningClient" + }, + "method": { + "shortName": "LookupApiHubInstance", + "fullName": "google.cloud.apihub.v1.Provisioning.LookupApiHubInstance", + "service": { + "shortName": "Provisioning", + "fullName": "google.cloud.apihub.v1.Provisioning" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_RuntimeProjectAttachmentService_CreateRuntimeProjectAttachment_async", + "title": "ApiHub createRuntimeProjectAttachment Sample", + "origin": "API_DEFINITION", + "description": " Attaches a runtime project to the host project.", + "canonical": true, + "file": "runtime_project_attachment_service.create_runtime_project_attachment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateRuntimeProjectAttachment", + "fullName": "google.cloud.apihub.v1.RuntimeProjectAttachmentService.CreateRuntimeProjectAttachment", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "runtime_project_attachment_id", + "type": "TYPE_STRING" + }, + { + "name": "runtime_project_attachment", + "type": ".google.cloud.apihub.v1.RuntimeProjectAttachment" + } + ], + "resultType": ".google.cloud.apihub.v1.RuntimeProjectAttachment", + "client": { + "shortName": "RuntimeProjectAttachmentServiceClient", + "fullName": "google.cloud.apihub.v1.RuntimeProjectAttachmentServiceClient" + }, + "method": { + "shortName": "CreateRuntimeProjectAttachment", + "fullName": "google.cloud.apihub.v1.RuntimeProjectAttachmentService.CreateRuntimeProjectAttachment", + "service": { + "shortName": "RuntimeProjectAttachmentService", + "fullName": "google.cloud.apihub.v1.RuntimeProjectAttachmentService" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_RuntimeProjectAttachmentService_GetRuntimeProjectAttachment_async", + "title": "ApiHub getRuntimeProjectAttachment Sample", + "origin": "API_DEFINITION", + "description": " Gets a runtime project attachment.", + "canonical": true, + "file": "runtime_project_attachment_service.get_runtime_project_attachment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetRuntimeProjectAttachment", + "fullName": "google.cloud.apihub.v1.RuntimeProjectAttachmentService.GetRuntimeProjectAttachment", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apihub.v1.RuntimeProjectAttachment", + "client": { + "shortName": "RuntimeProjectAttachmentServiceClient", + "fullName": "google.cloud.apihub.v1.RuntimeProjectAttachmentServiceClient" + }, + "method": { + "shortName": "GetRuntimeProjectAttachment", + "fullName": "google.cloud.apihub.v1.RuntimeProjectAttachmentService.GetRuntimeProjectAttachment", + "service": { + "shortName": "RuntimeProjectAttachmentService", + "fullName": "google.cloud.apihub.v1.RuntimeProjectAttachmentService" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_RuntimeProjectAttachmentService_ListRuntimeProjectAttachments_async", + "title": "ApiHub listRuntimeProjectAttachments Sample", + "origin": "API_DEFINITION", + "description": " List runtime projects attached to the host project.", + "canonical": true, + "file": "runtime_project_attachment_service.list_runtime_project_attachments.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 92, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListRuntimeProjectAttachments", + "fullName": "google.cloud.apihub.v1.RuntimeProjectAttachmentService.ListRuntimeProjectAttachments", + "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" + } + ], + "resultType": ".google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse", + "client": { + "shortName": "RuntimeProjectAttachmentServiceClient", + "fullName": "google.cloud.apihub.v1.RuntimeProjectAttachmentServiceClient" + }, + "method": { + "shortName": "ListRuntimeProjectAttachments", + "fullName": "google.cloud.apihub.v1.RuntimeProjectAttachmentService.ListRuntimeProjectAttachments", + "service": { + "shortName": "RuntimeProjectAttachmentService", + "fullName": "google.cloud.apihub.v1.RuntimeProjectAttachmentService" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_RuntimeProjectAttachmentService_DeleteRuntimeProjectAttachment_async", + "title": "ApiHub deleteRuntimeProjectAttachment Sample", + "origin": "API_DEFINITION", + "description": " Delete a runtime project attachment in the API Hub. This call will detach the runtime project from the host project.", + "canonical": true, + "file": "runtime_project_attachment_service.delete_runtime_project_attachment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteRuntimeProjectAttachment", + "fullName": "google.cloud.apihub.v1.RuntimeProjectAttachmentService.DeleteRuntimeProjectAttachment", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "RuntimeProjectAttachmentServiceClient", + "fullName": "google.cloud.apihub.v1.RuntimeProjectAttachmentServiceClient" + }, + "method": { + "shortName": "DeleteRuntimeProjectAttachment", + "fullName": "google.cloud.apihub.v1.RuntimeProjectAttachmentService.DeleteRuntimeProjectAttachment", + "service": { + "shortName": "RuntimeProjectAttachmentService", + "fullName": "google.cloud.apihub.v1.RuntimeProjectAttachmentService" + } + } + } + }, + { + "regionTag": "apihub_v1_generated_RuntimeProjectAttachmentService_LookupRuntimeProjectAttachment_async", + "title": "ApiHub lookupRuntimeProjectAttachment Sample", + "origin": "API_DEFINITION", + "description": " Look up a runtime project attachment. This API can be called in the context of any project.", + "canonical": true, + "file": "runtime_project_attachment_service.lookup_runtime_project_attachment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "LookupRuntimeProjectAttachment", + "fullName": "google.cloud.apihub.v1.RuntimeProjectAttachmentService.LookupRuntimeProjectAttachment", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse", + "client": { + "shortName": "RuntimeProjectAttachmentServiceClient", + "fullName": "google.cloud.apihub.v1.RuntimeProjectAttachmentServiceClient" + }, + "method": { + "shortName": "LookupRuntimeProjectAttachment", + "fullName": "google.cloud.apihub.v1.RuntimeProjectAttachmentService.LookupRuntimeProjectAttachment", + "service": { + "shortName": "RuntimeProjectAttachmentService", + "fullName": "google.cloud.apihub.v1.RuntimeProjectAttachmentService" + } + } + } + } + ] +} diff --git a/owl-bot-staging/google-cloud-apihub/v1/src/index.ts b/owl-bot-staging/google-cloud-apihub/v1/src/index.ts new file mode 100644 index 00000000000..dbd2cb2b100 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/src/index.ts @@ -0,0 +1,37 @@ +// Copyright 2024 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 v1 from './v1'; +const ApiHubClient = v1.ApiHubClient; +type ApiHubClient = v1.ApiHubClient; +const ApiHubDependenciesClient = v1.ApiHubDependenciesClient; +type ApiHubDependenciesClient = v1.ApiHubDependenciesClient; +const ApiHubPluginClient = v1.ApiHubPluginClient; +type ApiHubPluginClient = v1.ApiHubPluginClient; +const HostProjectRegistrationServiceClient = v1.HostProjectRegistrationServiceClient; +type HostProjectRegistrationServiceClient = v1.HostProjectRegistrationServiceClient; +const LintingServiceClient = v1.LintingServiceClient; +type LintingServiceClient = v1.LintingServiceClient; +const ProvisioningClient = v1.ProvisioningClient; +type ProvisioningClient = v1.ProvisioningClient; +const RuntimeProjectAttachmentServiceClient = v1.RuntimeProjectAttachmentServiceClient; +type RuntimeProjectAttachmentServiceClient = v1.RuntimeProjectAttachmentServiceClient; +export {v1, ApiHubClient, ApiHubDependenciesClient, ApiHubPluginClient, HostProjectRegistrationServiceClient, LintingServiceClient, ProvisioningClient, RuntimeProjectAttachmentServiceClient}; +export default {v1, ApiHubClient, ApiHubDependenciesClient, ApiHubPluginClient, HostProjectRegistrationServiceClient, LintingServiceClient, ProvisioningClient, RuntimeProjectAttachmentServiceClient}; +import * as protos from '../protos/protos'; +export {protos} diff --git a/owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_client.ts b/owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_client.ts new file mode 100644 index 00000000000..e815e16fa10 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_client.ts @@ -0,0 +1,6157 @@ +// Copyright 2024 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, PaginationCallback, GaxCall, 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/api_hub_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './api_hub_client_config.json'; +const version = require('../../../package.json').version; + +/** + * This service provides all methods related to the API hub. + * @class + * @memberof v1 + */ +export class ApiHubClient { + 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}; + private _universeDomain: string; + private _servicePath: string; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + locationsClient: LocationsClient; + pathTemplates: {[name: string]: gax.PathTemplate}; + apiHubStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of ApiHubClient. + * + * @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 ApiHubClient({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 ApiHubClient; + if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { + throw new Error('Please set either universe_domain or universeDomain, but not both.'); + } + const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; + this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; + this._servicePath = 'apihub.' + this._universeDomain; + const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). + if (!opts) { + opts = {fallback: true}; + } else { + opts.fallback = opts.fallback ?? true; + } + 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 !== this._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 = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + 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 === 'object' && '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 = { + apiPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}' + ), + apiHubInstancePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apiHubInstances/{api_hub_instance}' + ), + apiOperationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}' + ), + attributePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/attributes/{attribute}' + ), + definitionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}' + ), + dependencyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/dependencies/{dependency}' + ), + deploymentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/deployments/{deployment}' + ), + externalApiPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/externalApis/{external_api}' + ), + hostProjectRegistrationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/hostProjectRegistrations/{host_project_registration}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + pluginPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/plugins/{plugin}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + runtimeProjectAttachmentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}' + ), + specPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}' + ), + styleGuidePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/plugins/{plugin}/styleGuide' + ), + versionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}/versions/{version}' + ), + }; + + // 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 = { + listApis: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'apis'), + listVersions: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'versions'), + listSpecs: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'specs'), + listApiOperations: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'apiOperations'), + listDeployments: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'deployments'), + listAttributes: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'attributes'), + searchResources: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'searchResults'), + listExternalApis: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'externalApis') + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.apihub.v1.ApiHub', 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.apiHubStub) { + return this.apiHubStub; + } + + // Put together the "service stub" for + // google.cloud.apihub.v1.ApiHub. + this.apiHubStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.apihub.v1.ApiHub') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.apihub.v1.ApiHub, + 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 apiHubStubMethods = + ['createApi', 'getApi', 'listApis', 'updateApi', 'deleteApi', 'createVersion', 'getVersion', 'listVersions', 'updateVersion', 'deleteVersion', 'createSpec', 'getSpec', 'getSpecContents', 'listSpecs', 'updateSpec', 'deleteSpec', 'getApiOperation', 'listApiOperations', 'getDefinition', 'createDeployment', 'getDeployment', 'listDeployments', 'updateDeployment', 'deleteDeployment', 'createAttribute', 'getAttribute', 'updateAttribute', 'deleteAttribute', 'listAttributes', 'searchResources', 'createExternalApi', 'getExternalApi', 'updateExternalApi', 'deleteExternalApi', 'listExternalApis']; + for (const methodName of apiHubStubMethods) { + const callPromise = this.apiHubStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + this.descriptors.page[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.apiHubStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'apihub.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'apihub.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * 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 -- + // ------------------- +/** + * Create an API resource in the API hub. + * Once an API resource is created, versions can be added to it. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource for the API resource. + * Format: `projects/{project}/locations/{location}` + * @param {string} [request.apiId] + * Optional. The ID to use for the API resource, which will become the final + * component of the API's resource name. This field is optional. + * + * * If provided, the same will be used. The service will throw an error if + * the specified id is already used by another API resource in the API hub. + * * If not provided, a system generated id will be used. + * + * This value should be 4-500 characters, and valid characters + * are /{@link protos.A-Z|a-z}[0-9]-_/. + * @param {google.cloud.apihub.v1.Api} request.api + * Required. The API resource to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.apihub.v1.Api|Api}. + * 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/api_hub.create_api.js + * region_tag:apihub_v1_generated_ApiHub_CreateApi_async + */ + createApi( + request?: protos.google.cloud.apihub.v1.ICreateApiRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.apihub.v1.IApi, + protos.google.cloud.apihub.v1.ICreateApiRequest|undefined, {}|undefined + ]>; + createApi( + request: protos.google.cloud.apihub.v1.ICreateApiRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.IApi, + protos.google.cloud.apihub.v1.ICreateApiRequest|null|undefined, + {}|null|undefined>): void; + createApi( + request: protos.google.cloud.apihub.v1.ICreateApiRequest, + callback: Callback< + protos.google.cloud.apihub.v1.IApi, + protos.google.cloud.apihub.v1.ICreateApiRequest|null|undefined, + {}|null|undefined>): void; + createApi( + request?: protos.google.cloud.apihub.v1.ICreateApiRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.apihub.v1.IApi, + protos.google.cloud.apihub.v1.ICreateApiRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.apihub.v1.IApi, + protos.google.cloud.apihub.v1.ICreateApiRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.apihub.v1.IApi, + protos.google.cloud.apihub.v1.ICreateApiRequest|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.createApi(request, options, callback); + } +/** + * Get API resource details including the API versions contained in it. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the API resource to retrieve. + * Format: `projects/{project}/locations/{location}/apis/{api}` + * @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.apihub.v1.Api|Api}. + * 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/api_hub.get_api.js + * region_tag:apihub_v1_generated_ApiHub_GetApi_async + */ + getApi( + request?: protos.google.cloud.apihub.v1.IGetApiRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.apihub.v1.IApi, + protos.google.cloud.apihub.v1.IGetApiRequest|undefined, {}|undefined + ]>; + getApi( + request: protos.google.cloud.apihub.v1.IGetApiRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.IApi, + protos.google.cloud.apihub.v1.IGetApiRequest|null|undefined, + {}|null|undefined>): void; + getApi( + request: protos.google.cloud.apihub.v1.IGetApiRequest, + callback: Callback< + protos.google.cloud.apihub.v1.IApi, + protos.google.cloud.apihub.v1.IGetApiRequest|null|undefined, + {}|null|undefined>): void; + getApi( + request?: protos.google.cloud.apihub.v1.IGetApiRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.apihub.v1.IApi, + protos.google.cloud.apihub.v1.IGetApiRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.apihub.v1.IApi, + protos.google.cloud.apihub.v1.IGetApiRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.apihub.v1.IApi, + protos.google.cloud.apihub.v1.IGetApiRequest|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.getApi(request, options, callback); + } +/** + * Update an API resource in the API hub. The following fields in the + * {@link protos.|API} can be updated: + * + * * {@link protos.google.cloud.apihub.v1.Api.display_name|display_name} + * * {@link protos.google.cloud.apihub.v1.Api.description|description} + * * {@link protos.google.cloud.apihub.v1.Api.owner|owner} + * * {@link protos.google.cloud.apihub.v1.Api.documentation|documentation} + * * {@link protos.google.cloud.apihub.v1.Api.target_user|target_user} + * * {@link protos.google.cloud.apihub.v1.Api.team|team} + * * {@link protos.google.cloud.apihub.v1.Api.business_unit|business_unit} + * * {@link protos.google.cloud.apihub.v1.Api.maturity_level|maturity_level} + * * {@link protos.google.cloud.apihub.v1.Api.attributes|attributes} + * + * The + * {@link protos.google.cloud.apihub.v1.UpdateApiRequest.update_mask|update_mask} + * should be used to specify the fields being updated. + * + * Updating the owner field requires complete owner message + * and updates both owner and email fields. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.apihub.v1.Api} request.api + * Required. The API resource to update. + * + * The API resource's `name` field is used to identify the API resource to + * update. + * Format: `projects/{project}/locations/{location}/apis/{api}` + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The list of fields to update. + * @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.apihub.v1.Api|Api}. + * 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/api_hub.update_api.js + * region_tag:apihub_v1_generated_ApiHub_UpdateApi_async + */ + updateApi( + request?: protos.google.cloud.apihub.v1.IUpdateApiRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.apihub.v1.IApi, + protos.google.cloud.apihub.v1.IUpdateApiRequest|undefined, {}|undefined + ]>; + updateApi( + request: protos.google.cloud.apihub.v1.IUpdateApiRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.IApi, + protos.google.cloud.apihub.v1.IUpdateApiRequest|null|undefined, + {}|null|undefined>): void; + updateApi( + request: protos.google.cloud.apihub.v1.IUpdateApiRequest, + callback: Callback< + protos.google.cloud.apihub.v1.IApi, + protos.google.cloud.apihub.v1.IUpdateApiRequest|null|undefined, + {}|null|undefined>): void; + updateApi( + request?: protos.google.cloud.apihub.v1.IUpdateApiRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.apihub.v1.IApi, + protos.google.cloud.apihub.v1.IUpdateApiRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.apihub.v1.IApi, + protos.google.cloud.apihub.v1.IUpdateApiRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.apihub.v1.IApi, + protos.google.cloud.apihub.v1.IUpdateApiRequest|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({ + 'api.name': request.api!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateApi(request, options, callback); + } +/** + * Delete an API resource in the API hub. API can only be deleted if all + * underlying versions are deleted. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the API resource to delete. + * Format: `projects/{project}/locations/{location}/apis/{api}` + * @param {boolean} [request.force] + * Optional. If set to true, any versions from this API will also be deleted. + * Otherwise, the request will only work if the API has no versions. + * @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.protobuf.Empty|Empty}. + * 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/api_hub.delete_api.js + * region_tag:apihub_v1_generated_ApiHub_DeleteApi_async + */ + deleteApi( + request?: protos.google.cloud.apihub.v1.IDeleteApiRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteApiRequest|undefined, {}|undefined + ]>; + deleteApi( + request: protos.google.cloud.apihub.v1.IDeleteApiRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteApiRequest|null|undefined, + {}|null|undefined>): void; + deleteApi( + request: protos.google.cloud.apihub.v1.IDeleteApiRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteApiRequest|null|undefined, + {}|null|undefined>): void; + deleteApi( + request?: protos.google.cloud.apihub.v1.IDeleteApiRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteApiRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteApiRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteApiRequest|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.deleteApi(request, options, callback); + } +/** + * Create an API version for an API resource in the API hub. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource for API version. + * Format: `projects/{project}/locations/{location}/apis/{api}` + * @param {string} [request.versionId] + * Optional. The ID to use for the API version, which will become the final + * component of the version's resource name. This field is optional. + * + * * If provided, the same will be used. The service will throw an error if + * the specified id is already used by another version in the API resource. + * * If not provided, a system generated id will be used. + * + * This value should be 4-500 characters, and valid characters + * are /{@link protos.A-Z|a-z}[0-9]-_/. + * @param {google.cloud.apihub.v1.Version} request.version + * Required. The version to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.apihub.v1.Version|Version}. + * 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/api_hub.create_version.js + * region_tag:apihub_v1_generated_ApiHub_CreateVersion_async + */ + createVersion( + request?: protos.google.cloud.apihub.v1.ICreateVersionRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.apihub.v1.IVersion, + protos.google.cloud.apihub.v1.ICreateVersionRequest|undefined, {}|undefined + ]>; + createVersion( + request: protos.google.cloud.apihub.v1.ICreateVersionRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.IVersion, + protos.google.cloud.apihub.v1.ICreateVersionRequest|null|undefined, + {}|null|undefined>): void; + createVersion( + request: protos.google.cloud.apihub.v1.ICreateVersionRequest, + callback: Callback< + protos.google.cloud.apihub.v1.IVersion, + protos.google.cloud.apihub.v1.ICreateVersionRequest|null|undefined, + {}|null|undefined>): void; + createVersion( + request?: protos.google.cloud.apihub.v1.ICreateVersionRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.apihub.v1.IVersion, + protos.google.cloud.apihub.v1.ICreateVersionRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.apihub.v1.IVersion, + protos.google.cloud.apihub.v1.ICreateVersionRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.apihub.v1.IVersion, + protos.google.cloud.apihub.v1.ICreateVersionRequest|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.createVersion(request, options, callback); + } +/** + * Get details about the API version of an API resource. This will include + * information about the specs and operations present in the API + * version as well as the deployments linked to it. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the API version to retrieve. + * Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}` + * @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.apihub.v1.Version|Version}. + * 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/api_hub.get_version.js + * region_tag:apihub_v1_generated_ApiHub_GetVersion_async + */ + getVersion( + request?: protos.google.cloud.apihub.v1.IGetVersionRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.apihub.v1.IVersion, + protos.google.cloud.apihub.v1.IGetVersionRequest|undefined, {}|undefined + ]>; + getVersion( + request: protos.google.cloud.apihub.v1.IGetVersionRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.IVersion, + protos.google.cloud.apihub.v1.IGetVersionRequest|null|undefined, + {}|null|undefined>): void; + getVersion( + request: protos.google.cloud.apihub.v1.IGetVersionRequest, + callback: Callback< + protos.google.cloud.apihub.v1.IVersion, + protos.google.cloud.apihub.v1.IGetVersionRequest|null|undefined, + {}|null|undefined>): void; + getVersion( + request?: protos.google.cloud.apihub.v1.IGetVersionRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.apihub.v1.IVersion, + protos.google.cloud.apihub.v1.IGetVersionRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.apihub.v1.IVersion, + protos.google.cloud.apihub.v1.IGetVersionRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.apihub.v1.IVersion, + protos.google.cloud.apihub.v1.IGetVersionRequest|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.getVersion(request, options, callback); + } +/** + * Update API version. The following fields in the + * {@link protos.google.cloud.apihub.v1.Version|version} can be updated currently: + * + * * {@link protos.google.cloud.apihub.v1.Version.display_name|display_name} + * * {@link protos.google.cloud.apihub.v1.Version.description|description} + * * {@link protos.google.cloud.apihub.v1.Version.documentation|documentation} + * * {@link protos.google.cloud.apihub.v1.Version.deployments|deployments} + * * {@link protos.google.cloud.apihub.v1.Version.lifecycle|lifecycle} + * * {@link protos.google.cloud.apihub.v1.Version.compliance|compliance} + * * {@link protos.google.cloud.apihub.v1.Version.accreditation|accreditation} + * * {@link protos.google.cloud.apihub.v1.Version.attributes|attributes} + * + * The + * {@link protos.google.cloud.apihub.v1.UpdateVersionRequest.update_mask|update_mask} + * should be used to specify the fields being updated. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.apihub.v1.Version} request.version + * Required. The API version to update. + * + * The version's `name` field is used to identify the API version to update. + * Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}` + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The list of fields to update. + * @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.apihub.v1.Version|Version}. + * 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/api_hub.update_version.js + * region_tag:apihub_v1_generated_ApiHub_UpdateVersion_async + */ + updateVersion( + request?: protos.google.cloud.apihub.v1.IUpdateVersionRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.apihub.v1.IVersion, + protos.google.cloud.apihub.v1.IUpdateVersionRequest|undefined, {}|undefined + ]>; + updateVersion( + request: protos.google.cloud.apihub.v1.IUpdateVersionRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.IVersion, + protos.google.cloud.apihub.v1.IUpdateVersionRequest|null|undefined, + {}|null|undefined>): void; + updateVersion( + request: protos.google.cloud.apihub.v1.IUpdateVersionRequest, + callback: Callback< + protos.google.cloud.apihub.v1.IVersion, + protos.google.cloud.apihub.v1.IUpdateVersionRequest|null|undefined, + {}|null|undefined>): void; + updateVersion( + request?: protos.google.cloud.apihub.v1.IUpdateVersionRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.apihub.v1.IVersion, + protos.google.cloud.apihub.v1.IUpdateVersionRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.apihub.v1.IVersion, + protos.google.cloud.apihub.v1.IUpdateVersionRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.apihub.v1.IVersion, + protos.google.cloud.apihub.v1.IUpdateVersionRequest|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({ + 'version.name': request.version!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateVersion(request, options, callback); + } +/** + * Delete an API version. Version can only be deleted if all underlying specs, + * operations, definitions and linked deployments are deleted. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the version to delete. + * Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}` + * @param {boolean} [request.force] + * Optional. If set to true, any specs from this version will also be deleted. + * Otherwise, the request will only work if the version has no specs. + * @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.protobuf.Empty|Empty}. + * 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/api_hub.delete_version.js + * region_tag:apihub_v1_generated_ApiHub_DeleteVersion_async + */ + deleteVersion( + request?: protos.google.cloud.apihub.v1.IDeleteVersionRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteVersionRequest|undefined, {}|undefined + ]>; + deleteVersion( + request: protos.google.cloud.apihub.v1.IDeleteVersionRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteVersionRequest|null|undefined, + {}|null|undefined>): void; + deleteVersion( + request: protos.google.cloud.apihub.v1.IDeleteVersionRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteVersionRequest|null|undefined, + {}|null|undefined>): void; + deleteVersion( + request?: protos.google.cloud.apihub.v1.IDeleteVersionRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteVersionRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteVersionRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteVersionRequest|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.deleteVersion(request, options, callback); + } +/** + * Add a spec to an API version in the API hub. + * Multiple specs can be added to an API version. + * Note, while adding a spec, at least one of `contents` or `source_uri` must + * be provided. If `contents` is provided, then `spec_type` must also be + * provided. + * + * On adding a spec with contents to the version, the operations present in it + * will be added to the version.Note that the file contents in the spec should + * be of the same type as defined in the + * `projects/{project}/locations/{location}/attributes/system-spec-type` + * attribute associated with spec resource. Note that specs of various types + * can be uploaded, however parsing of details is supported for OpenAPI spec + * currently. + * + * In order to access the information parsed from the spec, use the + * {@link protos.google.cloud.apihub.v1.ApiHub.GetSpec|GetSpec} method. + * In order to access the raw contents for a particular spec, use the + * {@link protos.google.cloud.apihub.v1.ApiHub.GetSpecContents|GetSpecContents} method. + * In order to access the operations parsed from the spec, use the + * {@link protos.google.cloud.apihub.v1.ApiHub.ListApiOperations|ListAPIOperations} + * method. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource for Spec. + * Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}` + * @param {string} [request.specId] + * Optional. The ID to use for the spec, which will become the final component + * of the spec's resource name. This field is optional. + * + * * If provided, the same will be used. The service will throw an error if + * the specified id is already used by another spec in the API + * resource. + * * If not provided, a system generated id will be used. + * + * This value should be 4-500 characters, and valid characters + * are /{@link protos.A-Z|a-z}[0-9]-_/. + * @param {google.cloud.apihub.v1.Spec} request.spec + * Required. The spec to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.apihub.v1.Spec|Spec}. + * 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/api_hub.create_spec.js + * region_tag:apihub_v1_generated_ApiHub_CreateSpec_async + */ + createSpec( + request?: protos.google.cloud.apihub.v1.ICreateSpecRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.apihub.v1.ISpec, + protos.google.cloud.apihub.v1.ICreateSpecRequest|undefined, {}|undefined + ]>; + createSpec( + request: protos.google.cloud.apihub.v1.ICreateSpecRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.ISpec, + protos.google.cloud.apihub.v1.ICreateSpecRequest|null|undefined, + {}|null|undefined>): void; + createSpec( + request: protos.google.cloud.apihub.v1.ICreateSpecRequest, + callback: Callback< + protos.google.cloud.apihub.v1.ISpec, + protos.google.cloud.apihub.v1.ICreateSpecRequest|null|undefined, + {}|null|undefined>): void; + createSpec( + request?: protos.google.cloud.apihub.v1.ICreateSpecRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.apihub.v1.ISpec, + protos.google.cloud.apihub.v1.ICreateSpecRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.apihub.v1.ISpec, + protos.google.cloud.apihub.v1.ICreateSpecRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.apihub.v1.ISpec, + protos.google.cloud.apihub.v1.ICreateSpecRequest|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.createSpec(request, options, callback); + } +/** + * Get details about the information parsed from a spec. + * Note that this method does not return the raw spec contents. + * Use {@link protos.google.cloud.apihub.v1.ApiHub.GetSpecContents|GetSpecContents} method + * to retrieve the same. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the spec to retrieve. + * Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}` + * @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.apihub.v1.Spec|Spec}. + * 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/api_hub.get_spec.js + * region_tag:apihub_v1_generated_ApiHub_GetSpec_async + */ + getSpec( + request?: protos.google.cloud.apihub.v1.IGetSpecRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.apihub.v1.ISpec, + protos.google.cloud.apihub.v1.IGetSpecRequest|undefined, {}|undefined + ]>; + getSpec( + request: protos.google.cloud.apihub.v1.IGetSpecRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.ISpec, + protos.google.cloud.apihub.v1.IGetSpecRequest|null|undefined, + {}|null|undefined>): void; + getSpec( + request: protos.google.cloud.apihub.v1.IGetSpecRequest, + callback: Callback< + protos.google.cloud.apihub.v1.ISpec, + protos.google.cloud.apihub.v1.IGetSpecRequest|null|undefined, + {}|null|undefined>): void; + getSpec( + request?: protos.google.cloud.apihub.v1.IGetSpecRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.apihub.v1.ISpec, + protos.google.cloud.apihub.v1.IGetSpecRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.apihub.v1.ISpec, + protos.google.cloud.apihub.v1.IGetSpecRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.apihub.v1.ISpec, + protos.google.cloud.apihub.v1.IGetSpecRequest|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.getSpec(request, options, callback); + } +/** + * Get spec contents. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the spec whose contents need to be retrieved. + * Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}` + * @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.apihub.v1.SpecContents|SpecContents}. + * 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/api_hub.get_spec_contents.js + * region_tag:apihub_v1_generated_ApiHub_GetSpecContents_async + */ + getSpecContents( + request?: protos.google.cloud.apihub.v1.IGetSpecContentsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.apihub.v1.ISpecContents, + protos.google.cloud.apihub.v1.IGetSpecContentsRequest|undefined, {}|undefined + ]>; + getSpecContents( + request: protos.google.cloud.apihub.v1.IGetSpecContentsRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.ISpecContents, + protos.google.cloud.apihub.v1.IGetSpecContentsRequest|null|undefined, + {}|null|undefined>): void; + getSpecContents( + request: protos.google.cloud.apihub.v1.IGetSpecContentsRequest, + callback: Callback< + protos.google.cloud.apihub.v1.ISpecContents, + protos.google.cloud.apihub.v1.IGetSpecContentsRequest|null|undefined, + {}|null|undefined>): void; + getSpecContents( + request?: protos.google.cloud.apihub.v1.IGetSpecContentsRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.apihub.v1.ISpecContents, + protos.google.cloud.apihub.v1.IGetSpecContentsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.apihub.v1.ISpecContents, + protos.google.cloud.apihub.v1.IGetSpecContentsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.apihub.v1.ISpecContents, + protos.google.cloud.apihub.v1.IGetSpecContentsRequest|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.getSpecContents(request, options, callback); + } +/** + * Update spec. The following fields in the + * {@link protos.google.cloud.apihub.v1.Spec|spec} can be updated: + * + * * {@link protos.google.cloud.apihub.v1.Spec.display_name|display_name} + * * {@link protos.google.cloud.apihub.v1.Spec.source_uri|source_uri} + * * {@link protos.google.cloud.apihub.v1.Spec.lint_response|lint_response} + * * {@link protos.google.cloud.apihub.v1.Spec.attributes|attributes} + * * {@link protos.google.cloud.apihub.v1.Spec.contents|contents} + * * {@link protos.google.cloud.apihub.v1.Spec.spec_type|spec_type} + * + * In case of an OAS spec, updating spec contents can lead to: + * 1. Creation, deletion and update of operations. + * 2. Creation, deletion and update of definitions. + * 3. Update of other info parsed out from the new spec. + * + * In case of contents or source_uri being present in update mask, spec_type + * must also be present. Also, spec_type can not be present in update mask if + * contents or source_uri is not present. + * + * The + * {@link protos.google.cloud.apihub.v1.UpdateSpecRequest.update_mask|update_mask} + * should be used to specify the fields being updated. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.apihub.v1.Spec} request.spec + * Required. The spec to update. + * + * The spec's `name` field is used to identify the spec to + * update. Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}` + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The list of fields to update. + * @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.apihub.v1.Spec|Spec}. + * 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/api_hub.update_spec.js + * region_tag:apihub_v1_generated_ApiHub_UpdateSpec_async + */ + updateSpec( + request?: protos.google.cloud.apihub.v1.IUpdateSpecRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.apihub.v1.ISpec, + protos.google.cloud.apihub.v1.IUpdateSpecRequest|undefined, {}|undefined + ]>; + updateSpec( + request: protos.google.cloud.apihub.v1.IUpdateSpecRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.ISpec, + protos.google.cloud.apihub.v1.IUpdateSpecRequest|null|undefined, + {}|null|undefined>): void; + updateSpec( + request: protos.google.cloud.apihub.v1.IUpdateSpecRequest, + callback: Callback< + protos.google.cloud.apihub.v1.ISpec, + protos.google.cloud.apihub.v1.IUpdateSpecRequest|null|undefined, + {}|null|undefined>): void; + updateSpec( + request?: protos.google.cloud.apihub.v1.IUpdateSpecRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.apihub.v1.ISpec, + protos.google.cloud.apihub.v1.IUpdateSpecRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.apihub.v1.ISpec, + protos.google.cloud.apihub.v1.IUpdateSpecRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.apihub.v1.ISpec, + protos.google.cloud.apihub.v1.IUpdateSpecRequest|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({ + 'spec.name': request.spec!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateSpec(request, options, callback); + } +/** + * Delete a spec. + * Deleting a spec will also delete the associated operations from the + * version. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the spec to delete. + * Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}` + * @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.protobuf.Empty|Empty}. + * 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/api_hub.delete_spec.js + * region_tag:apihub_v1_generated_ApiHub_DeleteSpec_async + */ + deleteSpec( + request?: protos.google.cloud.apihub.v1.IDeleteSpecRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteSpecRequest|undefined, {}|undefined + ]>; + deleteSpec( + request: protos.google.cloud.apihub.v1.IDeleteSpecRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteSpecRequest|null|undefined, + {}|null|undefined>): void; + deleteSpec( + request: protos.google.cloud.apihub.v1.IDeleteSpecRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteSpecRequest|null|undefined, + {}|null|undefined>): void; + deleteSpec( + request?: protos.google.cloud.apihub.v1.IDeleteSpecRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteSpecRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteSpecRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteSpecRequest|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.deleteSpec(request, options, callback); + } +/** + * Get details about a particular operation in API version. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the operation to retrieve. + * Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}` + * @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.apihub.v1.ApiOperation|ApiOperation}. + * 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/api_hub.get_api_operation.js + * region_tag:apihub_v1_generated_ApiHub_GetApiOperation_async + */ + getApiOperation( + request?: protos.google.cloud.apihub.v1.IGetApiOperationRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.apihub.v1.IApiOperation, + protos.google.cloud.apihub.v1.IGetApiOperationRequest|undefined, {}|undefined + ]>; + getApiOperation( + request: protos.google.cloud.apihub.v1.IGetApiOperationRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.IApiOperation, + protos.google.cloud.apihub.v1.IGetApiOperationRequest|null|undefined, + {}|null|undefined>): void; + getApiOperation( + request: protos.google.cloud.apihub.v1.IGetApiOperationRequest, + callback: Callback< + protos.google.cloud.apihub.v1.IApiOperation, + protos.google.cloud.apihub.v1.IGetApiOperationRequest|null|undefined, + {}|null|undefined>): void; + getApiOperation( + request?: protos.google.cloud.apihub.v1.IGetApiOperationRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.apihub.v1.IApiOperation, + protos.google.cloud.apihub.v1.IGetApiOperationRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.apihub.v1.IApiOperation, + protos.google.cloud.apihub.v1.IGetApiOperationRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.apihub.v1.IApiOperation, + protos.google.cloud.apihub.v1.IGetApiOperationRequest|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.getApiOperation(request, options, callback); + } +/** + * Get details about a definition in an API version. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the definition to retrieve. + * Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}` + * @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.apihub.v1.Definition|Definition}. + * 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/api_hub.get_definition.js + * region_tag:apihub_v1_generated_ApiHub_GetDefinition_async + */ + getDefinition( + request?: protos.google.cloud.apihub.v1.IGetDefinitionRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.apihub.v1.IDefinition, + protos.google.cloud.apihub.v1.IGetDefinitionRequest|undefined, {}|undefined + ]>; + getDefinition( + request: protos.google.cloud.apihub.v1.IGetDefinitionRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.IDefinition, + protos.google.cloud.apihub.v1.IGetDefinitionRequest|null|undefined, + {}|null|undefined>): void; + getDefinition( + request: protos.google.cloud.apihub.v1.IGetDefinitionRequest, + callback: Callback< + protos.google.cloud.apihub.v1.IDefinition, + protos.google.cloud.apihub.v1.IGetDefinitionRequest|null|undefined, + {}|null|undefined>): void; + getDefinition( + request?: protos.google.cloud.apihub.v1.IGetDefinitionRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.apihub.v1.IDefinition, + protos.google.cloud.apihub.v1.IGetDefinitionRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.apihub.v1.IDefinition, + protos.google.cloud.apihub.v1.IGetDefinitionRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.apihub.v1.IDefinition, + protos.google.cloud.apihub.v1.IGetDefinitionRequest|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.getDefinition(request, options, callback); + } +/** + * Create a deployment resource in the API hub. + * Once a deployment resource is created, it can be associated with API + * versions. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource for the deployment resource. + * Format: `projects/{project}/locations/{location}` + * @param {string} [request.deploymentId] + * Optional. The ID to use for the deployment resource, which will become the + * final component of the deployment's resource name. This field is optional. + * + * * If provided, the same will be used. The service will throw an error if + * the specified id is already used by another deployment resource in the API + * hub. + * * If not provided, a system generated id will be used. + * + * This value should be 4-500 characters, and valid characters + * are /{@link protos.A-Z|a-z}[0-9]-_/. + * @param {google.cloud.apihub.v1.Deployment} request.deployment + * Required. The deployment resource to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.apihub.v1.Deployment|Deployment}. + * 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/api_hub.create_deployment.js + * region_tag:apihub_v1_generated_ApiHub_CreateDeployment_async + */ + createDeployment( + request?: protos.google.cloud.apihub.v1.ICreateDeploymentRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.apihub.v1.IDeployment, + protos.google.cloud.apihub.v1.ICreateDeploymentRequest|undefined, {}|undefined + ]>; + createDeployment( + request: protos.google.cloud.apihub.v1.ICreateDeploymentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.IDeployment, + protos.google.cloud.apihub.v1.ICreateDeploymentRequest|null|undefined, + {}|null|undefined>): void; + createDeployment( + request: protos.google.cloud.apihub.v1.ICreateDeploymentRequest, + callback: Callback< + protos.google.cloud.apihub.v1.IDeployment, + protos.google.cloud.apihub.v1.ICreateDeploymentRequest|null|undefined, + {}|null|undefined>): void; + createDeployment( + request?: protos.google.cloud.apihub.v1.ICreateDeploymentRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.apihub.v1.IDeployment, + protos.google.cloud.apihub.v1.ICreateDeploymentRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.apihub.v1.IDeployment, + protos.google.cloud.apihub.v1.ICreateDeploymentRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.apihub.v1.IDeployment, + protos.google.cloud.apihub.v1.ICreateDeploymentRequest|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.createDeployment(request, options, callback); + } +/** + * Get details about a deployment and the API versions linked to it. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the deployment resource to retrieve. + * Format: `projects/{project}/locations/{location}/deployments/{deployment}` + * @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.apihub.v1.Deployment|Deployment}. + * 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/api_hub.get_deployment.js + * region_tag:apihub_v1_generated_ApiHub_GetDeployment_async + */ + getDeployment( + request?: protos.google.cloud.apihub.v1.IGetDeploymentRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.apihub.v1.IDeployment, + protos.google.cloud.apihub.v1.IGetDeploymentRequest|undefined, {}|undefined + ]>; + getDeployment( + request: protos.google.cloud.apihub.v1.IGetDeploymentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.IDeployment, + protos.google.cloud.apihub.v1.IGetDeploymentRequest|null|undefined, + {}|null|undefined>): void; + getDeployment( + request: protos.google.cloud.apihub.v1.IGetDeploymentRequest, + callback: Callback< + protos.google.cloud.apihub.v1.IDeployment, + protos.google.cloud.apihub.v1.IGetDeploymentRequest|null|undefined, + {}|null|undefined>): void; + getDeployment( + request?: protos.google.cloud.apihub.v1.IGetDeploymentRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.apihub.v1.IDeployment, + protos.google.cloud.apihub.v1.IGetDeploymentRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.apihub.v1.IDeployment, + protos.google.cloud.apihub.v1.IGetDeploymentRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.apihub.v1.IDeployment, + protos.google.cloud.apihub.v1.IGetDeploymentRequest|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.getDeployment(request, options, callback); + } +/** + * Update a deployment resource in the API hub. The following fields in the + * {@link protos.google.cloud.apihub.v1.Deployment|deployment resource} can be + * updated: + * + * * {@link protos.google.cloud.apihub.v1.Deployment.display_name|display_name} + * * {@link protos.google.cloud.apihub.v1.Deployment.description|description} + * * {@link protos.google.cloud.apihub.v1.Deployment.documentation|documentation} + * * {@link protos.google.cloud.apihub.v1.Deployment.deployment_type|deployment_type} + * * {@link protos.google.cloud.apihub.v1.Deployment.resource_uri|resource_uri} + * * {@link protos.google.cloud.apihub.v1.Deployment.endpoints|endpoints} + * * {@link protos.google.cloud.apihub.v1.Deployment.slo|slo} + * * {@link protos.google.cloud.apihub.v1.Deployment.environment|environment} + * * {@link protos.google.cloud.apihub.v1.Deployment.attributes|attributes} + * + * The + * {@link protos.google.cloud.apihub.v1.UpdateDeploymentRequest.update_mask|update_mask} + * should be used to specify the fields being updated. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.apihub.v1.Deployment} request.deployment + * Required. The deployment resource to update. + * + * The deployment resource's `name` field is used to identify the deployment + * resource to update. + * Format: `projects/{project}/locations/{location}/deployments/{deployment}` + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The list of fields to update. + * @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.apihub.v1.Deployment|Deployment}. + * 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/api_hub.update_deployment.js + * region_tag:apihub_v1_generated_ApiHub_UpdateDeployment_async + */ + updateDeployment( + request?: protos.google.cloud.apihub.v1.IUpdateDeploymentRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.apihub.v1.IDeployment, + protos.google.cloud.apihub.v1.IUpdateDeploymentRequest|undefined, {}|undefined + ]>; + updateDeployment( + request: protos.google.cloud.apihub.v1.IUpdateDeploymentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.IDeployment, + protos.google.cloud.apihub.v1.IUpdateDeploymentRequest|null|undefined, + {}|null|undefined>): void; + updateDeployment( + request: protos.google.cloud.apihub.v1.IUpdateDeploymentRequest, + callback: Callback< + protos.google.cloud.apihub.v1.IDeployment, + protos.google.cloud.apihub.v1.IUpdateDeploymentRequest|null|undefined, + {}|null|undefined>): void; + updateDeployment( + request?: protos.google.cloud.apihub.v1.IUpdateDeploymentRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.apihub.v1.IDeployment, + protos.google.cloud.apihub.v1.IUpdateDeploymentRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.apihub.v1.IDeployment, + protos.google.cloud.apihub.v1.IUpdateDeploymentRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.apihub.v1.IDeployment, + protos.google.cloud.apihub.v1.IUpdateDeploymentRequest|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({ + 'deployment.name': request.deployment!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateDeployment(request, options, callback); + } +/** + * Delete a deployment resource in the API hub. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the deployment resource to delete. + * Format: `projects/{project}/locations/{location}/deployments/{deployment}` + * @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.protobuf.Empty|Empty}. + * 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/api_hub.delete_deployment.js + * region_tag:apihub_v1_generated_ApiHub_DeleteDeployment_async + */ + deleteDeployment( + request?: protos.google.cloud.apihub.v1.IDeleteDeploymentRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteDeploymentRequest|undefined, {}|undefined + ]>; + deleteDeployment( + request: protos.google.cloud.apihub.v1.IDeleteDeploymentRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteDeploymentRequest|null|undefined, + {}|null|undefined>): void; + deleteDeployment( + request: protos.google.cloud.apihub.v1.IDeleteDeploymentRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteDeploymentRequest|null|undefined, + {}|null|undefined>): void; + deleteDeployment( + request?: protos.google.cloud.apihub.v1.IDeleteDeploymentRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteDeploymentRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteDeploymentRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteDeploymentRequest|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.deleteDeployment(request, options, callback); + } +/** + * Create a user defined attribute. + * + * Certain pre defined attributes are already created by the API hub. These + * attributes will have type as `SYSTEM_DEFINED` and can be listed via + * {@link protos.google.cloud.apihub.v1.ApiHub.ListAttributes|ListAttributes} method. + * Allowed values for the same can be updated via + * {@link protos.google.cloud.apihub.v1.ApiHub.UpdateAttribute|UpdateAttribute} method. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource for Attribute. + * Format: `projects/{project}/locations/{location}` + * @param {string} [request.attributeId] + * Optional. The ID to use for the attribute, which will become the final + * component of the attribute's resource name. This field is optional. + * + * * If provided, the same will be used. The service will throw an error if + * the specified id is already used by another attribute resource in the API + * hub. + * * If not provided, a system generated id will be used. + * + * This value should be 4-500 characters, and valid characters + * are /{@link protos.A-Z|a-z}[0-9]-_/. + * @param {google.cloud.apihub.v1.Attribute} request.attribute + * Required. The attribute to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.apihub.v1.Attribute|Attribute}. + * 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/api_hub.create_attribute.js + * region_tag:apihub_v1_generated_ApiHub_CreateAttribute_async + */ + createAttribute( + request?: protos.google.cloud.apihub.v1.ICreateAttributeRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.apihub.v1.IAttribute, + protos.google.cloud.apihub.v1.ICreateAttributeRequest|undefined, {}|undefined + ]>; + createAttribute( + request: protos.google.cloud.apihub.v1.ICreateAttributeRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.IAttribute, + protos.google.cloud.apihub.v1.ICreateAttributeRequest|null|undefined, + {}|null|undefined>): void; + createAttribute( + request: protos.google.cloud.apihub.v1.ICreateAttributeRequest, + callback: Callback< + protos.google.cloud.apihub.v1.IAttribute, + protos.google.cloud.apihub.v1.ICreateAttributeRequest|null|undefined, + {}|null|undefined>): void; + createAttribute( + request?: protos.google.cloud.apihub.v1.ICreateAttributeRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.apihub.v1.IAttribute, + protos.google.cloud.apihub.v1.ICreateAttributeRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.apihub.v1.IAttribute, + protos.google.cloud.apihub.v1.ICreateAttributeRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.apihub.v1.IAttribute, + protos.google.cloud.apihub.v1.ICreateAttributeRequest|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.createAttribute(request, options, callback); + } +/** + * Get details about the attribute. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the attribute to retrieve. + * Format: + * `projects/{project}/locations/{location}/attributes/{attribute}` + * @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.apihub.v1.Attribute|Attribute}. + * 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/api_hub.get_attribute.js + * region_tag:apihub_v1_generated_ApiHub_GetAttribute_async + */ + getAttribute( + request?: protos.google.cloud.apihub.v1.IGetAttributeRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.apihub.v1.IAttribute, + protos.google.cloud.apihub.v1.IGetAttributeRequest|undefined, {}|undefined + ]>; + getAttribute( + request: protos.google.cloud.apihub.v1.IGetAttributeRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.IAttribute, + protos.google.cloud.apihub.v1.IGetAttributeRequest|null|undefined, + {}|null|undefined>): void; + getAttribute( + request: protos.google.cloud.apihub.v1.IGetAttributeRequest, + callback: Callback< + protos.google.cloud.apihub.v1.IAttribute, + protos.google.cloud.apihub.v1.IGetAttributeRequest|null|undefined, + {}|null|undefined>): void; + getAttribute( + request?: protos.google.cloud.apihub.v1.IGetAttributeRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.apihub.v1.IAttribute, + protos.google.cloud.apihub.v1.IGetAttributeRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.apihub.v1.IAttribute, + protos.google.cloud.apihub.v1.IGetAttributeRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.apihub.v1.IAttribute, + protos.google.cloud.apihub.v1.IGetAttributeRequest|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.getAttribute(request, options, callback); + } +/** + * Update the attribute. The following fields in the + * {@link protos.google.cloud.apihub.v1.Attribute|Attribute resource} can be updated: + * + * * {@link protos.google.cloud.apihub.v1.Attribute.display_name|display_name} + * The display name can be updated for user defined attributes only. + * * {@link protos.google.cloud.apihub.v1.Attribute.description|description} + * The description can be updated for user defined attributes only. + * * {@link protos.google.cloud.apihub.v1.Attribute.allowed_values|allowed_values} + * To update the list of allowed values, clients need to use the fetched list + * of allowed values and add or remove values to or from the same list. + * The mutable allowed values can be updated for both user defined and System + * defined attributes. The immutable allowed values cannot be updated or + * deleted. The updated list of allowed values cannot be empty. If an allowed + * value that is already used by some resource's attribute is deleted, then + * the association between the resource and the attribute value will also be + * deleted. + * * {@link protos.google.cloud.apihub.v1.Attribute.cardinality|cardinality} + * The cardinality can be updated for user defined attributes only. + * Cardinality can only be increased during an update. + * + * The + * {@link protos.google.cloud.apihub.v1.UpdateAttributeRequest.update_mask|update_mask} + * should be used to specify the fields being updated. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.apihub.v1.Attribute} request.attribute + * Required. The attribute to update. + * + * The attribute's `name` field is used to identify the attribute to update. + * Format: + * `projects/{project}/locations/{location}/attributes/{attribute}` + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The list of fields to update. + * @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.apihub.v1.Attribute|Attribute}. + * 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/api_hub.update_attribute.js + * region_tag:apihub_v1_generated_ApiHub_UpdateAttribute_async + */ + updateAttribute( + request?: protos.google.cloud.apihub.v1.IUpdateAttributeRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.apihub.v1.IAttribute, + protos.google.cloud.apihub.v1.IUpdateAttributeRequest|undefined, {}|undefined + ]>; + updateAttribute( + request: protos.google.cloud.apihub.v1.IUpdateAttributeRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.IAttribute, + protos.google.cloud.apihub.v1.IUpdateAttributeRequest|null|undefined, + {}|null|undefined>): void; + updateAttribute( + request: protos.google.cloud.apihub.v1.IUpdateAttributeRequest, + callback: Callback< + protos.google.cloud.apihub.v1.IAttribute, + protos.google.cloud.apihub.v1.IUpdateAttributeRequest|null|undefined, + {}|null|undefined>): void; + updateAttribute( + request?: protos.google.cloud.apihub.v1.IUpdateAttributeRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.apihub.v1.IAttribute, + protos.google.cloud.apihub.v1.IUpdateAttributeRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.apihub.v1.IAttribute, + protos.google.cloud.apihub.v1.IUpdateAttributeRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.apihub.v1.IAttribute, + protos.google.cloud.apihub.v1.IUpdateAttributeRequest|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({ + 'attribute.name': request.attribute!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateAttribute(request, options, callback); + } +/** + * Delete an attribute. + * + * Note: System defined attributes cannot be deleted. All + * associations of the attribute being deleted with any API hub resource will + * also get deleted. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the attribute to delete. + * Format: + * `projects/{project}/locations/{location}/attributes/{attribute}` + * @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.protobuf.Empty|Empty}. + * 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/api_hub.delete_attribute.js + * region_tag:apihub_v1_generated_ApiHub_DeleteAttribute_async + */ + deleteAttribute( + request?: protos.google.cloud.apihub.v1.IDeleteAttributeRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteAttributeRequest|undefined, {}|undefined + ]>; + deleteAttribute( + request: protos.google.cloud.apihub.v1.IDeleteAttributeRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteAttributeRequest|null|undefined, + {}|null|undefined>): void; + deleteAttribute( + request: protos.google.cloud.apihub.v1.IDeleteAttributeRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteAttributeRequest|null|undefined, + {}|null|undefined>): void; + deleteAttribute( + request?: protos.google.cloud.apihub.v1.IDeleteAttributeRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteAttributeRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteAttributeRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteAttributeRequest|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.deleteAttribute(request, options, callback); + } +/** + * Create an External API resource in the API hub. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource for the External API resource. + * Format: `projects/{project}/locations/{location}` + * @param {string} [request.externalApiId] + * Optional. The ID to use for the External API resource, which will become + * the final component of the External API's resource name. This field is + * optional. + * + * * If provided, the same will be used. The service will throw an error if + * the specified id is already used by another External API resource in the + * API hub. + * * If not provided, a system generated id will be used. + * + * This value should be 4-500 characters, and valid characters + * are /{@link protos.A-Z|a-z}[0-9]-_/. + * @param {google.cloud.apihub.v1.ExternalApi} request.externalApi + * Required. The External API resource to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.apihub.v1.ExternalApi|ExternalApi}. + * 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/api_hub.create_external_api.js + * region_tag:apihub_v1_generated_ApiHub_CreateExternalApi_async + */ + createExternalApi( + request?: protos.google.cloud.apihub.v1.ICreateExternalApiRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.apihub.v1.IExternalApi, + protos.google.cloud.apihub.v1.ICreateExternalApiRequest|undefined, {}|undefined + ]>; + createExternalApi( + request: protos.google.cloud.apihub.v1.ICreateExternalApiRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.IExternalApi, + protos.google.cloud.apihub.v1.ICreateExternalApiRequest|null|undefined, + {}|null|undefined>): void; + createExternalApi( + request: protos.google.cloud.apihub.v1.ICreateExternalApiRequest, + callback: Callback< + protos.google.cloud.apihub.v1.IExternalApi, + protos.google.cloud.apihub.v1.ICreateExternalApiRequest|null|undefined, + {}|null|undefined>): void; + createExternalApi( + request?: protos.google.cloud.apihub.v1.ICreateExternalApiRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.apihub.v1.IExternalApi, + protos.google.cloud.apihub.v1.ICreateExternalApiRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.apihub.v1.IExternalApi, + protos.google.cloud.apihub.v1.ICreateExternalApiRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.apihub.v1.IExternalApi, + protos.google.cloud.apihub.v1.ICreateExternalApiRequest|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.createExternalApi(request, options, callback); + } +/** + * Get details about an External API resource in the API hub. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the External API resource to retrieve. + * Format: + * `projects/{project}/locations/{location}/externalApis/{externalApi}` + * @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.apihub.v1.ExternalApi|ExternalApi}. + * 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/api_hub.get_external_api.js + * region_tag:apihub_v1_generated_ApiHub_GetExternalApi_async + */ + getExternalApi( + request?: protos.google.cloud.apihub.v1.IGetExternalApiRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.apihub.v1.IExternalApi, + protos.google.cloud.apihub.v1.IGetExternalApiRequest|undefined, {}|undefined + ]>; + getExternalApi( + request: protos.google.cloud.apihub.v1.IGetExternalApiRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.IExternalApi, + protos.google.cloud.apihub.v1.IGetExternalApiRequest|null|undefined, + {}|null|undefined>): void; + getExternalApi( + request: protos.google.cloud.apihub.v1.IGetExternalApiRequest, + callback: Callback< + protos.google.cloud.apihub.v1.IExternalApi, + protos.google.cloud.apihub.v1.IGetExternalApiRequest|null|undefined, + {}|null|undefined>): void; + getExternalApi( + request?: protos.google.cloud.apihub.v1.IGetExternalApiRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.apihub.v1.IExternalApi, + protos.google.cloud.apihub.v1.IGetExternalApiRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.apihub.v1.IExternalApi, + protos.google.cloud.apihub.v1.IGetExternalApiRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.apihub.v1.IExternalApi, + protos.google.cloud.apihub.v1.IGetExternalApiRequest|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.getExternalApi(request, options, callback); + } +/** + * Update an External API resource in the API hub. The following fields can be + * updated: + * + * * {@link protos.google.cloud.apihub.v1.ExternalApi.display_name|display_name} + * * {@link protos.google.cloud.apihub.v1.ExternalApi.description|description} + * * {@link protos.google.cloud.apihub.v1.ExternalApi.documentation|documentation} + * * {@link protos.google.cloud.apihub.v1.ExternalApi.endpoints|endpoints} + * * {@link protos.google.cloud.apihub.v1.ExternalApi.paths|paths} + * + * The + * {@link protos.google.cloud.apihub.v1.UpdateExternalApiRequest.update_mask|update_mask} + * should be used to specify the fields being updated. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.apihub.v1.ExternalApi} request.externalApi + * Required. The External API resource to update. + * + * The External API resource's `name` field is used to identify the External + * API resource to update. Format: + * `projects/{project}/locations/{location}/externalApis/{externalApi}` + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The list of fields to update. + * @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.apihub.v1.ExternalApi|ExternalApi}. + * 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/api_hub.update_external_api.js + * region_tag:apihub_v1_generated_ApiHub_UpdateExternalApi_async + */ + updateExternalApi( + request?: protos.google.cloud.apihub.v1.IUpdateExternalApiRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.apihub.v1.IExternalApi, + protos.google.cloud.apihub.v1.IUpdateExternalApiRequest|undefined, {}|undefined + ]>; + updateExternalApi( + request: protos.google.cloud.apihub.v1.IUpdateExternalApiRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.IExternalApi, + protos.google.cloud.apihub.v1.IUpdateExternalApiRequest|null|undefined, + {}|null|undefined>): void; + updateExternalApi( + request: protos.google.cloud.apihub.v1.IUpdateExternalApiRequest, + callback: Callback< + protos.google.cloud.apihub.v1.IExternalApi, + protos.google.cloud.apihub.v1.IUpdateExternalApiRequest|null|undefined, + {}|null|undefined>): void; + updateExternalApi( + request?: protos.google.cloud.apihub.v1.IUpdateExternalApiRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.apihub.v1.IExternalApi, + protos.google.cloud.apihub.v1.IUpdateExternalApiRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.apihub.v1.IExternalApi, + protos.google.cloud.apihub.v1.IUpdateExternalApiRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.apihub.v1.IExternalApi, + protos.google.cloud.apihub.v1.IUpdateExternalApiRequest|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({ + 'external_api.name': request.externalApi!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateExternalApi(request, options, callback); + } +/** + * Delete an External API resource in the API hub. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the External API resource to delete. + * Format: + * `projects/{project}/locations/{location}/externalApis/{externalApi}` + * @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.protobuf.Empty|Empty}. + * 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/api_hub.delete_external_api.js + * region_tag:apihub_v1_generated_ApiHub_DeleteExternalApi_async + */ + deleteExternalApi( + request?: protos.google.cloud.apihub.v1.IDeleteExternalApiRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteExternalApiRequest|undefined, {}|undefined + ]>; + deleteExternalApi( + request: protos.google.cloud.apihub.v1.IDeleteExternalApiRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteExternalApiRequest|null|undefined, + {}|null|undefined>): void; + deleteExternalApi( + request: protos.google.cloud.apihub.v1.IDeleteExternalApiRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteExternalApiRequest|null|undefined, + {}|null|undefined>): void; + deleteExternalApi( + request?: protos.google.cloud.apihub.v1.IDeleteExternalApiRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteExternalApiRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteExternalApiRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteExternalApiRequest|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.deleteExternalApi(request, options, callback); + } + + /** + * List API resources in the API hub. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of API resources. + * Format: `projects/{project}/locations/{location}` + * @param {string} [request.filter] + * Optional. An expression that filters the list of ApiResources. + * + * A filter expression consists of a field name, a comparison + * operator, and a value for filtering. The value must be a string. The + * comparison operator must be one of: `<`, `>`, `:` or `=`. Filters are not + * case sensitive. + * + * The following fields in the `ApiResource` are eligible for filtering: + * + * * `owner.email` - The email of the team which owns the ApiResource. + * Allowed comparison operators: `=`. + * * `create_time` - The time at which the ApiResource was created. The + * value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] + * format. Allowed comparison operators: `>` and `<`. + * * `display_name` - The display name of the ApiResource. Allowed + * comparison operators: `=`. + * * `target_user.enum_values.values.id` - The allowed value id of the + * target users attribute associated with the ApiResource. Allowed + * comparison operator is `:`. + * * `target_user.enum_values.values.display_name` - The allowed value + * display name of the target users attribute associated with the + * ApiResource. Allowed comparison operator is `:`. + * * `team.enum_values.values.id` - The allowed value id of the team + * attribute associated with the ApiResource. Allowed comparison operator is + * `:`. + * * `team.enum_values.values.display_name` - The allowed value display name + * of the team attribute associated with the ApiResource. Allowed comparison + * operator is `:`. + * * `business_unit.enum_values.values.id` - The allowed value id of the + * business unit attribute associated with the ApiResource. Allowed + * comparison operator is `:`. + * * `business_unit.enum_values.values.display_name` - The allowed value + * display name of the business unit attribute associated with the + * ApiResource. Allowed comparison operator is `:`. + * * `maturity_level.enum_values.values.id` - The allowed value id of the + * maturity level attribute associated with the ApiResource. Allowed + * comparison operator is `:`. + * * `maturity_level.enum_values.values.display_name` - The allowed value + * display name of the maturity level attribute associated with the + * ApiResource. Allowed comparison operator is `:`. + * * `api_style.enum_values.values.id` - The allowed value id of the + * api style attribute associated with the ApiResource. Allowed + * comparison operator is `:`. + * * `api_style.enum_values.values.display_name` - The allowed value display + * name of the api style attribute associated with the ApiResource. Allowed + * comparison operator is `:`. + * + * Expressions are combined with either `AND` logic operator or `OR` logical + * operator but not both of them together i.e. only one of the `AND` or `OR` + * operator can be used throughout the filter string and both the operators + * cannot be used together. No other logical operators are supported. At most + * three filter fields are allowed in the filter string and if provided + * more than that then `INVALID_ARGUMENT` error is returned by the API. + * + * Here are a few examples: + * + * * `owner.email = \"apihub@google.com\"` - - The owner team email is + * _apihub@google.com_. + * * `owner.email = \"apihub@google.com\" AND create_time < + * \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - + * The owner team email is _apihub@google.com_ and the api was created + * before _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_. + * * `owner.email = \"apihub@google.com\" OR team.enum_values.values.id: + * apihub-team-id` - The filter string specifies the APIs where the owner + * team email is _apihub@google.com_ or the id of the allowed value + * associated with the team attribute is _apihub-team-id_. + * * `owner.email = \"apihub@google.com\" OR + * team.enum_values.values.display_name: ApiHub Team` - The filter string + * specifies the APIs where the owner team email is _apihub@google.com_ or + * the display name of the allowed value associated with the team attribute + * is `ApiHub Team`. + * @param {number} [request.pageSize] + * Optional. The maximum number of API resources to return. The service may + * return fewer than this value. If unspecified, at most 50 Apis will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListApis` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters (except page_size) provided to + * `ListApis` must match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.apihub.v1.Api|Api}. + * 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 `listApisAsync()` + * 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. + */ + listApis( + request?: protos.google.cloud.apihub.v1.IListApisRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.apihub.v1.IApi[], + protos.google.cloud.apihub.v1.IListApisRequest|null, + protos.google.cloud.apihub.v1.IListApisResponse + ]>; + listApis( + request: protos.google.cloud.apihub.v1.IListApisRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.apihub.v1.IListApisRequest, + protos.google.cloud.apihub.v1.IListApisResponse|null|undefined, + protos.google.cloud.apihub.v1.IApi>): void; + listApis( + request: protos.google.cloud.apihub.v1.IListApisRequest, + callback: PaginationCallback< + protos.google.cloud.apihub.v1.IListApisRequest, + protos.google.cloud.apihub.v1.IListApisResponse|null|undefined, + protos.google.cloud.apihub.v1.IApi>): void; + listApis( + request?: protos.google.cloud.apihub.v1.IListApisRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.apihub.v1.IListApisRequest, + protos.google.cloud.apihub.v1.IListApisResponse|null|undefined, + protos.google.cloud.apihub.v1.IApi>, + callback?: PaginationCallback< + protos.google.cloud.apihub.v1.IListApisRequest, + protos.google.cloud.apihub.v1.IListApisResponse|null|undefined, + protos.google.cloud.apihub.v1.IApi>): + Promise<[ + protos.google.cloud.apihub.v1.IApi[], + protos.google.cloud.apihub.v1.IListApisRequest|null, + protos.google.cloud.apihub.v1.IListApisResponse + ]>|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.listApis(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of API resources. + * Format: `projects/{project}/locations/{location}` + * @param {string} [request.filter] + * Optional. An expression that filters the list of ApiResources. + * + * A filter expression consists of a field name, a comparison + * operator, and a value for filtering. The value must be a string. The + * comparison operator must be one of: `<`, `>`, `:` or `=`. Filters are not + * case sensitive. + * + * The following fields in the `ApiResource` are eligible for filtering: + * + * * `owner.email` - The email of the team which owns the ApiResource. + * Allowed comparison operators: `=`. + * * `create_time` - The time at which the ApiResource was created. The + * value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] + * format. Allowed comparison operators: `>` and `<`. + * * `display_name` - The display name of the ApiResource. Allowed + * comparison operators: `=`. + * * `target_user.enum_values.values.id` - The allowed value id of the + * target users attribute associated with the ApiResource. Allowed + * comparison operator is `:`. + * * `target_user.enum_values.values.display_name` - The allowed value + * display name of the target users attribute associated with the + * ApiResource. Allowed comparison operator is `:`. + * * `team.enum_values.values.id` - The allowed value id of the team + * attribute associated with the ApiResource. Allowed comparison operator is + * `:`. + * * `team.enum_values.values.display_name` - The allowed value display name + * of the team attribute associated with the ApiResource. Allowed comparison + * operator is `:`. + * * `business_unit.enum_values.values.id` - The allowed value id of the + * business unit attribute associated with the ApiResource. Allowed + * comparison operator is `:`. + * * `business_unit.enum_values.values.display_name` - The allowed value + * display name of the business unit attribute associated with the + * ApiResource. Allowed comparison operator is `:`. + * * `maturity_level.enum_values.values.id` - The allowed value id of the + * maturity level attribute associated with the ApiResource. Allowed + * comparison operator is `:`. + * * `maturity_level.enum_values.values.display_name` - The allowed value + * display name of the maturity level attribute associated with the + * ApiResource. Allowed comparison operator is `:`. + * * `api_style.enum_values.values.id` - The allowed value id of the + * api style attribute associated with the ApiResource. Allowed + * comparison operator is `:`. + * * `api_style.enum_values.values.display_name` - The allowed value display + * name of the api style attribute associated with the ApiResource. Allowed + * comparison operator is `:`. + * + * Expressions are combined with either `AND` logic operator or `OR` logical + * operator but not both of them together i.e. only one of the `AND` or `OR` + * operator can be used throughout the filter string and both the operators + * cannot be used together. No other logical operators are supported. At most + * three filter fields are allowed in the filter string and if provided + * more than that then `INVALID_ARGUMENT` error is returned by the API. + * + * Here are a few examples: + * + * * `owner.email = \"apihub@google.com\"` - - The owner team email is + * _apihub@google.com_. + * * `owner.email = \"apihub@google.com\" AND create_time < + * \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - + * The owner team email is _apihub@google.com_ and the api was created + * before _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_. + * * `owner.email = \"apihub@google.com\" OR team.enum_values.values.id: + * apihub-team-id` - The filter string specifies the APIs where the owner + * team email is _apihub@google.com_ or the id of the allowed value + * associated with the team attribute is _apihub-team-id_. + * * `owner.email = \"apihub@google.com\" OR + * team.enum_values.values.display_name: ApiHub Team` - The filter string + * specifies the APIs where the owner team email is _apihub@google.com_ or + * the display name of the allowed value associated with the team attribute + * is `ApiHub Team`. + * @param {number} [request.pageSize] + * Optional. The maximum number of API resources to return. The service may + * return fewer than this value. If unspecified, at most 50 Apis will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListApis` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters (except page_size) provided to + * `ListApis` must match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.apihub.v1.Api|Api} 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 `listApisAsync()` + * 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. + */ + listApisStream( + request?: protos.google.cloud.apihub.v1.IListApisRequest, + 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['listApis']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listApis.createStream( + this.innerApiCalls.listApis as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listApis`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of API resources. + * Format: `projects/{project}/locations/{location}` + * @param {string} [request.filter] + * Optional. An expression that filters the list of ApiResources. + * + * A filter expression consists of a field name, a comparison + * operator, and a value for filtering. The value must be a string. The + * comparison operator must be one of: `<`, `>`, `:` or `=`. Filters are not + * case sensitive. + * + * The following fields in the `ApiResource` are eligible for filtering: + * + * * `owner.email` - The email of the team which owns the ApiResource. + * Allowed comparison operators: `=`. + * * `create_time` - The time at which the ApiResource was created. The + * value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] + * format. Allowed comparison operators: `>` and `<`. + * * `display_name` - The display name of the ApiResource. Allowed + * comparison operators: `=`. + * * `target_user.enum_values.values.id` - The allowed value id of the + * target users attribute associated with the ApiResource. Allowed + * comparison operator is `:`. + * * `target_user.enum_values.values.display_name` - The allowed value + * display name of the target users attribute associated with the + * ApiResource. Allowed comparison operator is `:`. + * * `team.enum_values.values.id` - The allowed value id of the team + * attribute associated with the ApiResource. Allowed comparison operator is + * `:`. + * * `team.enum_values.values.display_name` - The allowed value display name + * of the team attribute associated with the ApiResource. Allowed comparison + * operator is `:`. + * * `business_unit.enum_values.values.id` - The allowed value id of the + * business unit attribute associated with the ApiResource. Allowed + * comparison operator is `:`. + * * `business_unit.enum_values.values.display_name` - The allowed value + * display name of the business unit attribute associated with the + * ApiResource. Allowed comparison operator is `:`. + * * `maturity_level.enum_values.values.id` - The allowed value id of the + * maturity level attribute associated with the ApiResource. Allowed + * comparison operator is `:`. + * * `maturity_level.enum_values.values.display_name` - The allowed value + * display name of the maturity level attribute associated with the + * ApiResource. Allowed comparison operator is `:`. + * * `api_style.enum_values.values.id` - The allowed value id of the + * api style attribute associated with the ApiResource. Allowed + * comparison operator is `:`. + * * `api_style.enum_values.values.display_name` - The allowed value display + * name of the api style attribute associated with the ApiResource. Allowed + * comparison operator is `:`. + * + * Expressions are combined with either `AND` logic operator or `OR` logical + * operator but not both of them together i.e. only one of the `AND` or `OR` + * operator can be used throughout the filter string and both the operators + * cannot be used together. No other logical operators are supported. At most + * three filter fields are allowed in the filter string and if provided + * more than that then `INVALID_ARGUMENT` error is returned by the API. + * + * Here are a few examples: + * + * * `owner.email = \"apihub@google.com\"` - - The owner team email is + * _apihub@google.com_. + * * `owner.email = \"apihub@google.com\" AND create_time < + * \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - + * The owner team email is _apihub@google.com_ and the api was created + * before _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_. + * * `owner.email = \"apihub@google.com\" OR team.enum_values.values.id: + * apihub-team-id` - The filter string specifies the APIs where the owner + * team email is _apihub@google.com_ or the id of the allowed value + * associated with the team attribute is _apihub-team-id_. + * * `owner.email = \"apihub@google.com\" OR + * team.enum_values.values.display_name: ApiHub Team` - The filter string + * specifies the APIs where the owner team email is _apihub@google.com_ or + * the display name of the allowed value associated with the team attribute + * is `ApiHub Team`. + * @param {number} [request.pageSize] + * Optional. The maximum number of API resources to return. The service may + * return fewer than this value. If unspecified, at most 50 Apis will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListApis` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters (except page_size) provided to + * `ListApis` must match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@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.apihub.v1.Api|Api}. 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/api_hub.list_apis.js + * region_tag:apihub_v1_generated_ApiHub_ListApis_async + */ + listApisAsync( + request?: protos.google.cloud.apihub.v1.IListApisRequest, + 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['listApis']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listApis.asyncIterate( + this.innerApiCalls['listApis'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * List API versions of an API resource in the API hub. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent which owns this collection of API versions i.e., the + * API resource Format: `projects/{project}/locations/{location}/apis/{api}` + * @param {string} [request.filter] + * Optional. An expression that filters the list of Versions. + * + * A filter expression consists of a field name, a comparison + * operator, and a value for filtering. The value must be a string, a + * number, or a boolean. The comparison operator must be one of: `<`, `>` or + * `=`. Filters are not case sensitive. + * + * The following fields in the `Version` are eligible for filtering: + * + * * `display_name` - The display name of the Version. Allowed + * comparison operators: `=`. + * * `create_time` - The time at which the Version was created. The + * value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] + * format. Allowed comparison operators: `>` and `<`. + * * `lifecycle.enum_values.values.id` - The allowed value id of the + * lifecycle attribute associated with the Version. Allowed comparison + * operators: `:`. + * * `lifecycle.enum_values.values.display_name` - The allowed value display + * name of the lifecycle attribute associated with the Version. Allowed + * comparison operators: `:`. + * * `compliance.enum_values.values.id` - The allowed value id of the + * compliances attribute associated with the Version. Allowed comparison + * operators: `:`. + * * `compliance.enum_values.values.display_name` - The allowed value + * display name of the compliances attribute associated with the Version. + * Allowed comparison operators: `:`. + * * `accreditation.enum_values.values.id` - The allowed value id of the + * accreditations attribute associated with the Version. Allowed + * comparison operators: `:`. + * * `accreditation.enum_values.values.display_name` - The allowed value + * display name of the accreditations attribute associated with the Version. + * Allowed comparison operators: `:`. + * + * Expressions are combined with either `AND` logic operator or `OR` logical + * operator but not both of them together i.e. only one of the `AND` or `OR` + * operator can be used throughout the filter string and both the operators + * cannot be used together. No other logical operators are + * supported. At most three filter fields are allowed in the filter + * string and if provided more than that then `INVALID_ARGUMENT` error is + * returned by the API. + * + * Here are a few examples: + * + * * `lifecycle.enum_values.values.id: preview-id` - The filter string + * specifies that the id of the allowed value associated with the lifecycle + * attribute of the Version is _preview-id_. + * * `lifecycle.enum_values.values.display_name: \"Preview Display Name\"` - + * The filter string specifies that the display name of the allowed value + * associated with the lifecycle attribute of the Version is `Preview + * Display Name`. + * * `lifecycle.enum_values.values.id: preview-id AND create_time < + * \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - + * The id of the allowed value associated with the lifecycle attribute of + * the Version is _preview-id_ and it was created before _2021-08-15 + * 14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_. + * * `compliance.enum_values.values.id: gdpr-id OR + * compliance.enum_values.values.id: pci-dss-id` + * - The id of the allowed value associated with the compliance attribute is + * _gdpr-id_ or _pci-dss-id_. + * @param {number} [request.pageSize] + * Optional. The maximum number of versions to return. The service may return + * fewer than this value. If unspecified, at most 50 versions will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListVersions` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters (except page_size) provided to + * `ListVersions` must match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.apihub.v1.Version|Version}. + * 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 `listVersionsAsync()` + * 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. + */ + listVersions( + request?: protos.google.cloud.apihub.v1.IListVersionsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.apihub.v1.IVersion[], + protos.google.cloud.apihub.v1.IListVersionsRequest|null, + protos.google.cloud.apihub.v1.IListVersionsResponse + ]>; + listVersions( + request: protos.google.cloud.apihub.v1.IListVersionsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.apihub.v1.IListVersionsRequest, + protos.google.cloud.apihub.v1.IListVersionsResponse|null|undefined, + protos.google.cloud.apihub.v1.IVersion>): void; + listVersions( + request: protos.google.cloud.apihub.v1.IListVersionsRequest, + callback: PaginationCallback< + protos.google.cloud.apihub.v1.IListVersionsRequest, + protos.google.cloud.apihub.v1.IListVersionsResponse|null|undefined, + protos.google.cloud.apihub.v1.IVersion>): void; + listVersions( + request?: protos.google.cloud.apihub.v1.IListVersionsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.apihub.v1.IListVersionsRequest, + protos.google.cloud.apihub.v1.IListVersionsResponse|null|undefined, + protos.google.cloud.apihub.v1.IVersion>, + callback?: PaginationCallback< + protos.google.cloud.apihub.v1.IListVersionsRequest, + protos.google.cloud.apihub.v1.IListVersionsResponse|null|undefined, + protos.google.cloud.apihub.v1.IVersion>): + Promise<[ + protos.google.cloud.apihub.v1.IVersion[], + protos.google.cloud.apihub.v1.IListVersionsRequest|null, + protos.google.cloud.apihub.v1.IListVersionsResponse + ]>|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.listVersions(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent which owns this collection of API versions i.e., the + * API resource Format: `projects/{project}/locations/{location}/apis/{api}` + * @param {string} [request.filter] + * Optional. An expression that filters the list of Versions. + * + * A filter expression consists of a field name, a comparison + * operator, and a value for filtering. The value must be a string, a + * number, or a boolean. The comparison operator must be one of: `<`, `>` or + * `=`. Filters are not case sensitive. + * + * The following fields in the `Version` are eligible for filtering: + * + * * `display_name` - The display name of the Version. Allowed + * comparison operators: `=`. + * * `create_time` - The time at which the Version was created. The + * value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] + * format. Allowed comparison operators: `>` and `<`. + * * `lifecycle.enum_values.values.id` - The allowed value id of the + * lifecycle attribute associated with the Version. Allowed comparison + * operators: `:`. + * * `lifecycle.enum_values.values.display_name` - The allowed value display + * name of the lifecycle attribute associated with the Version. Allowed + * comparison operators: `:`. + * * `compliance.enum_values.values.id` - The allowed value id of the + * compliances attribute associated with the Version. Allowed comparison + * operators: `:`. + * * `compliance.enum_values.values.display_name` - The allowed value + * display name of the compliances attribute associated with the Version. + * Allowed comparison operators: `:`. + * * `accreditation.enum_values.values.id` - The allowed value id of the + * accreditations attribute associated with the Version. Allowed + * comparison operators: `:`. + * * `accreditation.enum_values.values.display_name` - The allowed value + * display name of the accreditations attribute associated with the Version. + * Allowed comparison operators: `:`. + * + * Expressions are combined with either `AND` logic operator or `OR` logical + * operator but not both of them together i.e. only one of the `AND` or `OR` + * operator can be used throughout the filter string and both the operators + * cannot be used together. No other logical operators are + * supported. At most three filter fields are allowed in the filter + * string and if provided more than that then `INVALID_ARGUMENT` error is + * returned by the API. + * + * Here are a few examples: + * + * * `lifecycle.enum_values.values.id: preview-id` - The filter string + * specifies that the id of the allowed value associated with the lifecycle + * attribute of the Version is _preview-id_. + * * `lifecycle.enum_values.values.display_name: \"Preview Display Name\"` - + * The filter string specifies that the display name of the allowed value + * associated with the lifecycle attribute of the Version is `Preview + * Display Name`. + * * `lifecycle.enum_values.values.id: preview-id AND create_time < + * \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - + * The id of the allowed value associated with the lifecycle attribute of + * the Version is _preview-id_ and it was created before _2021-08-15 + * 14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_. + * * `compliance.enum_values.values.id: gdpr-id OR + * compliance.enum_values.values.id: pci-dss-id` + * - The id of the allowed value associated with the compliance attribute is + * _gdpr-id_ or _pci-dss-id_. + * @param {number} [request.pageSize] + * Optional. The maximum number of versions to return. The service may return + * fewer than this value. If unspecified, at most 50 versions will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListVersions` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters (except page_size) provided to + * `ListVersions` must match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.apihub.v1.Version|Version} 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 `listVersionsAsync()` + * 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. + */ + listVersionsStream( + request?: protos.google.cloud.apihub.v1.IListVersionsRequest, + 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['listVersions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listVersions.createStream( + this.innerApiCalls.listVersions as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listVersions`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent which owns this collection of API versions i.e., the + * API resource Format: `projects/{project}/locations/{location}/apis/{api}` + * @param {string} [request.filter] + * Optional. An expression that filters the list of Versions. + * + * A filter expression consists of a field name, a comparison + * operator, and a value for filtering. The value must be a string, a + * number, or a boolean. The comparison operator must be one of: `<`, `>` or + * `=`. Filters are not case sensitive. + * + * The following fields in the `Version` are eligible for filtering: + * + * * `display_name` - The display name of the Version. Allowed + * comparison operators: `=`. + * * `create_time` - The time at which the Version was created. The + * value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] + * format. Allowed comparison operators: `>` and `<`. + * * `lifecycle.enum_values.values.id` - The allowed value id of the + * lifecycle attribute associated with the Version. Allowed comparison + * operators: `:`. + * * `lifecycle.enum_values.values.display_name` - The allowed value display + * name of the lifecycle attribute associated with the Version. Allowed + * comparison operators: `:`. + * * `compliance.enum_values.values.id` - The allowed value id of the + * compliances attribute associated with the Version. Allowed comparison + * operators: `:`. + * * `compliance.enum_values.values.display_name` - The allowed value + * display name of the compliances attribute associated with the Version. + * Allowed comparison operators: `:`. + * * `accreditation.enum_values.values.id` - The allowed value id of the + * accreditations attribute associated with the Version. Allowed + * comparison operators: `:`. + * * `accreditation.enum_values.values.display_name` - The allowed value + * display name of the accreditations attribute associated with the Version. + * Allowed comparison operators: `:`. + * + * Expressions are combined with either `AND` logic operator or `OR` logical + * operator but not both of them together i.e. only one of the `AND` or `OR` + * operator can be used throughout the filter string and both the operators + * cannot be used together. No other logical operators are + * supported. At most three filter fields are allowed in the filter + * string and if provided more than that then `INVALID_ARGUMENT` error is + * returned by the API. + * + * Here are a few examples: + * + * * `lifecycle.enum_values.values.id: preview-id` - The filter string + * specifies that the id of the allowed value associated with the lifecycle + * attribute of the Version is _preview-id_. + * * `lifecycle.enum_values.values.display_name: \"Preview Display Name\"` - + * The filter string specifies that the display name of the allowed value + * associated with the lifecycle attribute of the Version is `Preview + * Display Name`. + * * `lifecycle.enum_values.values.id: preview-id AND create_time < + * \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - + * The id of the allowed value associated with the lifecycle attribute of + * the Version is _preview-id_ and it was created before _2021-08-15 + * 14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_. + * * `compliance.enum_values.values.id: gdpr-id OR + * compliance.enum_values.values.id: pci-dss-id` + * - The id of the allowed value associated with the compliance attribute is + * _gdpr-id_ or _pci-dss-id_. + * @param {number} [request.pageSize] + * Optional. The maximum number of versions to return. The service may return + * fewer than this value. If unspecified, at most 50 versions will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListVersions` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters (except page_size) provided to + * `ListVersions` must match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@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.apihub.v1.Version|Version}. 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/api_hub.list_versions.js + * region_tag:apihub_v1_generated_ApiHub_ListVersions_async + */ + listVersionsAsync( + request?: protos.google.cloud.apihub.v1.IListVersionsRequest, + 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['listVersions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listVersions.asyncIterate( + this.innerApiCalls['listVersions'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * List specs corresponding to a particular API resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of specs. + * Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}` + * @param {string} [request.filter] + * Optional. An expression that filters the list of Specs. + * + * A filter expression consists of a field name, a comparison + * operator, and a value for filtering. The value must be a string. The + * comparison operator must be one of: `<`, `>`, `:` or `=`. Filters are not + * case sensitive. + * + * The following fields in the `Spec` are eligible for filtering: + * + * * `display_name` - The display name of the Spec. Allowed comparison + * operators: `=`. + * * `create_time` - The time at which the Spec was created. The + * value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] + * format. Allowed comparison operators: `>` and `<`. + * * `spec_type.enum_values.values.id` - The allowed value id of the + * spec_type attribute associated with the Spec. Allowed comparison + * operators: `:`. + * * `spec_type.enum_values.values.display_name` - The allowed value display + * name of the spec_type attribute associated with the Spec. Allowed + * comparison operators: `:`. + * * `lint_response.json_values.values` - The json value of the + * lint_response attribute associated with the Spec. Allowed comparison + * operators: `:`. + * * `mime_type` - The MIME type of the Spec. Allowed comparison + * operators: `=`. + * + * Expressions are combined with either `AND` logic operator or `OR` logical + * operator but not both of them together i.e. only one of the `AND` or `OR` + * operator can be used throughout the filter string and both the operators + * cannot be used together. No other logical operators are + * supported. At most three filter fields are allowed in the filter + * string and if provided more than that then `INVALID_ARGUMENT` error is + * returned by the API. + * + * Here are a few examples: + * + * * `spec_type.enum_values.values.id: rest-id` - The filter + * string specifies that the id of the allowed value associated with the + * spec_type attribute is _rest-id_. + * * `spec_type.enum_values.values.display_name: \"Rest Display Name\"` - + * The filter string specifies that the display name of the allowed value + * associated with the spec_type attribute is `Rest Display Name`. + * * `spec_type.enum_values.values.id: grpc-id AND create_time < + * \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - + * The id of the allowed value associated with the spec_type attribute is + * _grpc-id_ and the spec was created before _2021-08-15 14:50:00 UTC_ and + * after _2021-08-10 12:00:00 UTC_. + * * `spec_type.enum_values.values.id: rest-id OR + * spec_type.enum_values.values.id: grpc-id` + * - The id of the allowed value associated with the spec_type attribute is + * _rest-id_ or _grpc-id_. + * @param {number} [request.pageSize] + * Optional. The maximum number of specs to return. The service may return + * fewer than this value. If unspecified, at most 50 specs will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListSpecs` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListSpecs` must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.apihub.v1.Spec|Spec}. + * 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 `listSpecsAsync()` + * 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. + */ + listSpecs( + request?: protos.google.cloud.apihub.v1.IListSpecsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.apihub.v1.ISpec[], + protos.google.cloud.apihub.v1.IListSpecsRequest|null, + protos.google.cloud.apihub.v1.IListSpecsResponse + ]>; + listSpecs( + request: protos.google.cloud.apihub.v1.IListSpecsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.apihub.v1.IListSpecsRequest, + protos.google.cloud.apihub.v1.IListSpecsResponse|null|undefined, + protos.google.cloud.apihub.v1.ISpec>): void; + listSpecs( + request: protos.google.cloud.apihub.v1.IListSpecsRequest, + callback: PaginationCallback< + protos.google.cloud.apihub.v1.IListSpecsRequest, + protos.google.cloud.apihub.v1.IListSpecsResponse|null|undefined, + protos.google.cloud.apihub.v1.ISpec>): void; + listSpecs( + request?: protos.google.cloud.apihub.v1.IListSpecsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.apihub.v1.IListSpecsRequest, + protos.google.cloud.apihub.v1.IListSpecsResponse|null|undefined, + protos.google.cloud.apihub.v1.ISpec>, + callback?: PaginationCallback< + protos.google.cloud.apihub.v1.IListSpecsRequest, + protos.google.cloud.apihub.v1.IListSpecsResponse|null|undefined, + protos.google.cloud.apihub.v1.ISpec>): + Promise<[ + protos.google.cloud.apihub.v1.ISpec[], + protos.google.cloud.apihub.v1.IListSpecsRequest|null, + protos.google.cloud.apihub.v1.IListSpecsResponse + ]>|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.listSpecs(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of specs. + * Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}` + * @param {string} [request.filter] + * Optional. An expression that filters the list of Specs. + * + * A filter expression consists of a field name, a comparison + * operator, and a value for filtering. The value must be a string. The + * comparison operator must be one of: `<`, `>`, `:` or `=`. Filters are not + * case sensitive. + * + * The following fields in the `Spec` are eligible for filtering: + * + * * `display_name` - The display name of the Spec. Allowed comparison + * operators: `=`. + * * `create_time` - The time at which the Spec was created. The + * value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] + * format. Allowed comparison operators: `>` and `<`. + * * `spec_type.enum_values.values.id` - The allowed value id of the + * spec_type attribute associated with the Spec. Allowed comparison + * operators: `:`. + * * `spec_type.enum_values.values.display_name` - The allowed value display + * name of the spec_type attribute associated with the Spec. Allowed + * comparison operators: `:`. + * * `lint_response.json_values.values` - The json value of the + * lint_response attribute associated with the Spec. Allowed comparison + * operators: `:`. + * * `mime_type` - The MIME type of the Spec. Allowed comparison + * operators: `=`. + * + * Expressions are combined with either `AND` logic operator or `OR` logical + * operator but not both of them together i.e. only one of the `AND` or `OR` + * operator can be used throughout the filter string and both the operators + * cannot be used together. No other logical operators are + * supported. At most three filter fields are allowed in the filter + * string and if provided more than that then `INVALID_ARGUMENT` error is + * returned by the API. + * + * Here are a few examples: + * + * * `spec_type.enum_values.values.id: rest-id` - The filter + * string specifies that the id of the allowed value associated with the + * spec_type attribute is _rest-id_. + * * `spec_type.enum_values.values.display_name: \"Rest Display Name\"` - + * The filter string specifies that the display name of the allowed value + * associated with the spec_type attribute is `Rest Display Name`. + * * `spec_type.enum_values.values.id: grpc-id AND create_time < + * \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - + * The id of the allowed value associated with the spec_type attribute is + * _grpc-id_ and the spec was created before _2021-08-15 14:50:00 UTC_ and + * after _2021-08-10 12:00:00 UTC_. + * * `spec_type.enum_values.values.id: rest-id OR + * spec_type.enum_values.values.id: grpc-id` + * - The id of the allowed value associated with the spec_type attribute is + * _rest-id_ or _grpc-id_. + * @param {number} [request.pageSize] + * Optional. The maximum number of specs to return. The service may return + * fewer than this value. If unspecified, at most 50 specs will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListSpecs` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListSpecs` must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.apihub.v1.Spec|Spec} 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 `listSpecsAsync()` + * 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. + */ + listSpecsStream( + request?: protos.google.cloud.apihub.v1.IListSpecsRequest, + 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['listSpecs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listSpecs.createStream( + this.innerApiCalls.listSpecs as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listSpecs`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of specs. + * Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}` + * @param {string} [request.filter] + * Optional. An expression that filters the list of Specs. + * + * A filter expression consists of a field name, a comparison + * operator, and a value for filtering. The value must be a string. The + * comparison operator must be one of: `<`, `>`, `:` or `=`. Filters are not + * case sensitive. + * + * The following fields in the `Spec` are eligible for filtering: + * + * * `display_name` - The display name of the Spec. Allowed comparison + * operators: `=`. + * * `create_time` - The time at which the Spec was created. The + * value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] + * format. Allowed comparison operators: `>` and `<`. + * * `spec_type.enum_values.values.id` - The allowed value id of the + * spec_type attribute associated with the Spec. Allowed comparison + * operators: `:`. + * * `spec_type.enum_values.values.display_name` - The allowed value display + * name of the spec_type attribute associated with the Spec. Allowed + * comparison operators: `:`. + * * `lint_response.json_values.values` - The json value of the + * lint_response attribute associated with the Spec. Allowed comparison + * operators: `:`. + * * `mime_type` - The MIME type of the Spec. Allowed comparison + * operators: `=`. + * + * Expressions are combined with either `AND` logic operator or `OR` logical + * operator but not both of them together i.e. only one of the `AND` or `OR` + * operator can be used throughout the filter string and both the operators + * cannot be used together. No other logical operators are + * supported. At most three filter fields are allowed in the filter + * string and if provided more than that then `INVALID_ARGUMENT` error is + * returned by the API. + * + * Here are a few examples: + * + * * `spec_type.enum_values.values.id: rest-id` - The filter + * string specifies that the id of the allowed value associated with the + * spec_type attribute is _rest-id_. + * * `spec_type.enum_values.values.display_name: \"Rest Display Name\"` - + * The filter string specifies that the display name of the allowed value + * associated with the spec_type attribute is `Rest Display Name`. + * * `spec_type.enum_values.values.id: grpc-id AND create_time < + * \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - + * The id of the allowed value associated with the spec_type attribute is + * _grpc-id_ and the spec was created before _2021-08-15 14:50:00 UTC_ and + * after _2021-08-10 12:00:00 UTC_. + * * `spec_type.enum_values.values.id: rest-id OR + * spec_type.enum_values.values.id: grpc-id` + * - The id of the allowed value associated with the spec_type attribute is + * _rest-id_ or _grpc-id_. + * @param {number} [request.pageSize] + * Optional. The maximum number of specs to return. The service may return + * fewer than this value. If unspecified, at most 50 specs will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListSpecs` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListSpecs` must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@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.apihub.v1.Spec|Spec}. 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/api_hub.list_specs.js + * region_tag:apihub_v1_generated_ApiHub_ListSpecs_async + */ + listSpecsAsync( + request?: protos.google.cloud.apihub.v1.IListSpecsRequest, + 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['listSpecs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listSpecs.asyncIterate( + this.innerApiCalls['listSpecs'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * List operations in an API version. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent which owns this collection of operations i.e., the API + * version. Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}` + * @param {string} [request.filter] + * Optional. An expression that filters the list of ApiOperations. + * + * A filter expression consists of a field name, a comparison + * operator, and a value for filtering. The value must be a string or a + * boolean. The comparison operator must be one of: `<`, `>` or + * `=`. Filters are not case sensitive. + * + * The following fields in the `ApiOperation` are eligible for filtering: + * * `name` - The ApiOperation resource name. Allowed comparison + * operators: + * `=`. + * * `details.http_operation.path.path` - The http operation's complete path + * relative to server endpoint. Allowed comparison operators: `=`. + * * `details.http_operation.method` - The http operation method type. + * Allowed comparison operators: `=`. + * * `details.deprecated` - Indicates if the ApiOperation is deprecated. + * Allowed values are True / False indicating the deprycation status of the + * ApiOperation. Allowed comparison operators: `=`. + * * `create_time` - The time at which the ApiOperation was created. The + * value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] + * format. Allowed comparison operators: `>` and `<`. + * + * Expressions are combined with either `AND` logic operator or `OR` logical + * operator but not both of them together i.e. only one of the `AND` or `OR` + * operator can be used throughout the filter string and both the operators + * cannot be used together. No other logical operators are supported. At most + * three filter fields are allowed in the filter string and if provided + * more than that then `INVALID_ARGUMENT` error is returned by the API. + * + * Here are a few examples: + * + * * `details.deprecated = True` - The ApiOperation is deprecated. + * * `details.http_operation.method = GET AND create_time < + * \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - + * The method of the http operation of the ApiOperation is _GET_ and the + * spec was created before _2021-08-15 14:50:00 UTC_ and after _2021-08-10 + * 12:00:00 UTC_. + * * `details.http_operation.method = GET OR details.http_operation.method = + * POST`. - The http operation of the method of ApiOperation is _GET_ or + * _POST_. + * @param {number} [request.pageSize] + * Optional. The maximum number of operations to return. The service may + * return fewer than this value. If unspecified, at most 50 operations will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListApiOperations` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters (except page_size) provided to + * `ListApiOperations` must match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.apihub.v1.ApiOperation|ApiOperation}. + * 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 `listApiOperationsAsync()` + * 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. + */ + listApiOperations( + request?: protos.google.cloud.apihub.v1.IListApiOperationsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.apihub.v1.IApiOperation[], + protos.google.cloud.apihub.v1.IListApiOperationsRequest|null, + protos.google.cloud.apihub.v1.IListApiOperationsResponse + ]>; + listApiOperations( + request: protos.google.cloud.apihub.v1.IListApiOperationsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.apihub.v1.IListApiOperationsRequest, + protos.google.cloud.apihub.v1.IListApiOperationsResponse|null|undefined, + protos.google.cloud.apihub.v1.IApiOperation>): void; + listApiOperations( + request: protos.google.cloud.apihub.v1.IListApiOperationsRequest, + callback: PaginationCallback< + protos.google.cloud.apihub.v1.IListApiOperationsRequest, + protos.google.cloud.apihub.v1.IListApiOperationsResponse|null|undefined, + protos.google.cloud.apihub.v1.IApiOperation>): void; + listApiOperations( + request?: protos.google.cloud.apihub.v1.IListApiOperationsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.apihub.v1.IListApiOperationsRequest, + protos.google.cloud.apihub.v1.IListApiOperationsResponse|null|undefined, + protos.google.cloud.apihub.v1.IApiOperation>, + callback?: PaginationCallback< + protos.google.cloud.apihub.v1.IListApiOperationsRequest, + protos.google.cloud.apihub.v1.IListApiOperationsResponse|null|undefined, + protos.google.cloud.apihub.v1.IApiOperation>): + Promise<[ + protos.google.cloud.apihub.v1.IApiOperation[], + protos.google.cloud.apihub.v1.IListApiOperationsRequest|null, + protos.google.cloud.apihub.v1.IListApiOperationsResponse + ]>|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.listApiOperations(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent which owns this collection of operations i.e., the API + * version. Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}` + * @param {string} [request.filter] + * Optional. An expression that filters the list of ApiOperations. + * + * A filter expression consists of a field name, a comparison + * operator, and a value for filtering. The value must be a string or a + * boolean. The comparison operator must be one of: `<`, `>` or + * `=`. Filters are not case sensitive. + * + * The following fields in the `ApiOperation` are eligible for filtering: + * * `name` - The ApiOperation resource name. Allowed comparison + * operators: + * `=`. + * * `details.http_operation.path.path` - The http operation's complete path + * relative to server endpoint. Allowed comparison operators: `=`. + * * `details.http_operation.method` - The http operation method type. + * Allowed comparison operators: `=`. + * * `details.deprecated` - Indicates if the ApiOperation is deprecated. + * Allowed values are True / False indicating the deprycation status of the + * ApiOperation. Allowed comparison operators: `=`. + * * `create_time` - The time at which the ApiOperation was created. The + * value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] + * format. Allowed comparison operators: `>` and `<`. + * + * Expressions are combined with either `AND` logic operator or `OR` logical + * operator but not both of them together i.e. only one of the `AND` or `OR` + * operator can be used throughout the filter string and both the operators + * cannot be used together. No other logical operators are supported. At most + * three filter fields are allowed in the filter string and if provided + * more than that then `INVALID_ARGUMENT` error is returned by the API. + * + * Here are a few examples: + * + * * `details.deprecated = True` - The ApiOperation is deprecated. + * * `details.http_operation.method = GET AND create_time < + * \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - + * The method of the http operation of the ApiOperation is _GET_ and the + * spec was created before _2021-08-15 14:50:00 UTC_ and after _2021-08-10 + * 12:00:00 UTC_. + * * `details.http_operation.method = GET OR details.http_operation.method = + * POST`. - The http operation of the method of ApiOperation is _GET_ or + * _POST_. + * @param {number} [request.pageSize] + * Optional. The maximum number of operations to return. The service may + * return fewer than this value. If unspecified, at most 50 operations will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListApiOperations` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters (except page_size) provided to + * `ListApiOperations` must match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.apihub.v1.ApiOperation|ApiOperation} 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 `listApiOperationsAsync()` + * 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. + */ + listApiOperationsStream( + request?: protos.google.cloud.apihub.v1.IListApiOperationsRequest, + 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['listApiOperations']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listApiOperations.createStream( + this.innerApiCalls.listApiOperations as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listApiOperations`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent which owns this collection of operations i.e., the API + * version. Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}` + * @param {string} [request.filter] + * Optional. An expression that filters the list of ApiOperations. + * + * A filter expression consists of a field name, a comparison + * operator, and a value for filtering. The value must be a string or a + * boolean. The comparison operator must be one of: `<`, `>` or + * `=`. Filters are not case sensitive. + * + * The following fields in the `ApiOperation` are eligible for filtering: + * * `name` - The ApiOperation resource name. Allowed comparison + * operators: + * `=`. + * * `details.http_operation.path.path` - The http operation's complete path + * relative to server endpoint. Allowed comparison operators: `=`. + * * `details.http_operation.method` - The http operation method type. + * Allowed comparison operators: `=`. + * * `details.deprecated` - Indicates if the ApiOperation is deprecated. + * Allowed values are True / False indicating the deprycation status of the + * ApiOperation. Allowed comparison operators: `=`. + * * `create_time` - The time at which the ApiOperation was created. The + * value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] + * format. Allowed comparison operators: `>` and `<`. + * + * Expressions are combined with either `AND` logic operator or `OR` logical + * operator but not both of them together i.e. only one of the `AND` or `OR` + * operator can be used throughout the filter string and both the operators + * cannot be used together. No other logical operators are supported. At most + * three filter fields are allowed in the filter string and if provided + * more than that then `INVALID_ARGUMENT` error is returned by the API. + * + * Here are a few examples: + * + * * `details.deprecated = True` - The ApiOperation is deprecated. + * * `details.http_operation.method = GET AND create_time < + * \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - + * The method of the http operation of the ApiOperation is _GET_ and the + * spec was created before _2021-08-15 14:50:00 UTC_ and after _2021-08-10 + * 12:00:00 UTC_. + * * `details.http_operation.method = GET OR details.http_operation.method = + * POST`. - The http operation of the method of ApiOperation is _GET_ or + * _POST_. + * @param {number} [request.pageSize] + * Optional. The maximum number of operations to return. The service may + * return fewer than this value. If unspecified, at most 50 operations will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListApiOperations` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters (except page_size) provided to + * `ListApiOperations` must match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@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.apihub.v1.ApiOperation|ApiOperation}. 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/api_hub.list_api_operations.js + * region_tag:apihub_v1_generated_ApiHub_ListApiOperations_async + */ + listApiOperationsAsync( + request?: protos.google.cloud.apihub.v1.IListApiOperationsRequest, + 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['listApiOperations']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listApiOperations.asyncIterate( + this.innerApiCalls['listApiOperations'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * List deployment resources in the API hub. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of deployment resources. + * Format: `projects/{project}/locations/{location}` + * @param {string} [request.filter] + * Optional. An expression that filters the list of Deployments. + * + * A filter expression consists of a field name, a comparison + * operator, and a value for filtering. The value must be a string. The + * comparison operator must be one of: `<`, `>` or + * `=`. Filters are not case sensitive. + * + * The following fields in the `Deployments` are eligible for filtering: + * + * * `display_name` - The display name of the Deployment. Allowed + * comparison operators: `=`. + * * `create_time` - The time at which the Deployment was created. The + * value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] + * format. Allowed comparison operators: `>` and `<`. + * * `resource_uri` - A URI to the deployment resource. Allowed + * comparison operators: `=`. + * * `api_versions` - The API versions linked to this deployment. Allowed + * comparison operators: `:`. + * * `deployment_type.enum_values.values.id` - The allowed value id of the + * deployment_type attribute associated with the Deployment. Allowed + * comparison operators: `:`. + * * `deployment_type.enum_values.values.display_name` - The allowed value + * display name of the deployment_type attribute associated with the + * Deployment. Allowed comparison operators: `:`. + * * `slo.string_values.values` -The allowed string value of the slo + * attribute associated with the deployment. Allowed comparison + * operators: `:`. + * * `environment.enum_values.values.id` - The allowed value id of the + * environment attribute associated with the deployment. Allowed + * comparison operators: `:`. + * * `environment.enum_values.values.display_name` - The allowed value + * display name of the environment attribute associated with the deployment. + * Allowed comparison operators: `:`. + * + * Expressions are combined with either `AND` logic operator or `OR` logical + * operator but not both of them together i.e. only one of the `AND` or `OR` + * operator can be used throughout the filter string and both the operators + * cannot be used together. No other logical operators are supported. At most + * three filter fields are allowed in the filter string and if provided + * more than that then `INVALID_ARGUMENT` error is returned by the API. + * + * Here are a few examples: + * + * * `environment.enum_values.values.id: staging-id` - The allowed value id + * of the environment attribute associated with the Deployment is + * _staging-id_. + * * `environment.enum_values.values.display_name: \"Staging Deployment\"` - + * The allowed value display name of the environment attribute associated + * with the Deployment is `Staging Deployment`. + * * `environment.enum_values.values.id: production-id AND create_time < + * \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - + * The allowed value id of the environment attribute associated with the + * Deployment is _production-id_ and Deployment was created before + * _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_. + * * `environment.enum_values.values.id: production-id OR + * slo.string_values.values: \"99.99%\"` + * - The allowed value id of the environment attribute Deployment is + * _production-id_ or string value of the slo attribute is _99.99%_. + * @param {number} [request.pageSize] + * Optional. The maximum number of deployment resources to return. The service + * may return fewer than this value. If unspecified, at most 50 deployments + * will be returned. The maximum value is 1000; values above 1000 will be + * coerced to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListDeployments` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters (except page_size) provided to + * `ListDeployments` must match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.apihub.v1.Deployment|Deployment}. + * 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 `listDeploymentsAsync()` + * 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. + */ + listDeployments( + request?: protos.google.cloud.apihub.v1.IListDeploymentsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.apihub.v1.IDeployment[], + protos.google.cloud.apihub.v1.IListDeploymentsRequest|null, + protos.google.cloud.apihub.v1.IListDeploymentsResponse + ]>; + listDeployments( + request: protos.google.cloud.apihub.v1.IListDeploymentsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.apihub.v1.IListDeploymentsRequest, + protos.google.cloud.apihub.v1.IListDeploymentsResponse|null|undefined, + protos.google.cloud.apihub.v1.IDeployment>): void; + listDeployments( + request: protos.google.cloud.apihub.v1.IListDeploymentsRequest, + callback: PaginationCallback< + protos.google.cloud.apihub.v1.IListDeploymentsRequest, + protos.google.cloud.apihub.v1.IListDeploymentsResponse|null|undefined, + protos.google.cloud.apihub.v1.IDeployment>): void; + listDeployments( + request?: protos.google.cloud.apihub.v1.IListDeploymentsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.apihub.v1.IListDeploymentsRequest, + protos.google.cloud.apihub.v1.IListDeploymentsResponse|null|undefined, + protos.google.cloud.apihub.v1.IDeployment>, + callback?: PaginationCallback< + protos.google.cloud.apihub.v1.IListDeploymentsRequest, + protos.google.cloud.apihub.v1.IListDeploymentsResponse|null|undefined, + protos.google.cloud.apihub.v1.IDeployment>): + Promise<[ + protos.google.cloud.apihub.v1.IDeployment[], + protos.google.cloud.apihub.v1.IListDeploymentsRequest|null, + protos.google.cloud.apihub.v1.IListDeploymentsResponse + ]>|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.listDeployments(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of deployment resources. + * Format: `projects/{project}/locations/{location}` + * @param {string} [request.filter] + * Optional. An expression that filters the list of Deployments. + * + * A filter expression consists of a field name, a comparison + * operator, and a value for filtering. The value must be a string. The + * comparison operator must be one of: `<`, `>` or + * `=`. Filters are not case sensitive. + * + * The following fields in the `Deployments` are eligible for filtering: + * + * * `display_name` - The display name of the Deployment. Allowed + * comparison operators: `=`. + * * `create_time` - The time at which the Deployment was created. The + * value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] + * format. Allowed comparison operators: `>` and `<`. + * * `resource_uri` - A URI to the deployment resource. Allowed + * comparison operators: `=`. + * * `api_versions` - The API versions linked to this deployment. Allowed + * comparison operators: `:`. + * * `deployment_type.enum_values.values.id` - The allowed value id of the + * deployment_type attribute associated with the Deployment. Allowed + * comparison operators: `:`. + * * `deployment_type.enum_values.values.display_name` - The allowed value + * display name of the deployment_type attribute associated with the + * Deployment. Allowed comparison operators: `:`. + * * `slo.string_values.values` -The allowed string value of the slo + * attribute associated with the deployment. Allowed comparison + * operators: `:`. + * * `environment.enum_values.values.id` - The allowed value id of the + * environment attribute associated with the deployment. Allowed + * comparison operators: `:`. + * * `environment.enum_values.values.display_name` - The allowed value + * display name of the environment attribute associated with the deployment. + * Allowed comparison operators: `:`. + * + * Expressions are combined with either `AND` logic operator or `OR` logical + * operator but not both of them together i.e. only one of the `AND` or `OR` + * operator can be used throughout the filter string and both the operators + * cannot be used together. No other logical operators are supported. At most + * three filter fields are allowed in the filter string and if provided + * more than that then `INVALID_ARGUMENT` error is returned by the API. + * + * Here are a few examples: + * + * * `environment.enum_values.values.id: staging-id` - The allowed value id + * of the environment attribute associated with the Deployment is + * _staging-id_. + * * `environment.enum_values.values.display_name: \"Staging Deployment\"` - + * The allowed value display name of the environment attribute associated + * with the Deployment is `Staging Deployment`. + * * `environment.enum_values.values.id: production-id AND create_time < + * \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - + * The allowed value id of the environment attribute associated with the + * Deployment is _production-id_ and Deployment was created before + * _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_. + * * `environment.enum_values.values.id: production-id OR + * slo.string_values.values: \"99.99%\"` + * - The allowed value id of the environment attribute Deployment is + * _production-id_ or string value of the slo attribute is _99.99%_. + * @param {number} [request.pageSize] + * Optional. The maximum number of deployment resources to return. The service + * may return fewer than this value. If unspecified, at most 50 deployments + * will be returned. The maximum value is 1000; values above 1000 will be + * coerced to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListDeployments` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters (except page_size) provided to + * `ListDeployments` must match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.apihub.v1.Deployment|Deployment} 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 `listDeploymentsAsync()` + * 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. + */ + listDeploymentsStream( + request?: protos.google.cloud.apihub.v1.IListDeploymentsRequest, + 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['listDeployments']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listDeployments.createStream( + this.innerApiCalls.listDeployments as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listDeployments`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of deployment resources. + * Format: `projects/{project}/locations/{location}` + * @param {string} [request.filter] + * Optional. An expression that filters the list of Deployments. + * + * A filter expression consists of a field name, a comparison + * operator, and a value for filtering. The value must be a string. The + * comparison operator must be one of: `<`, `>` or + * `=`. Filters are not case sensitive. + * + * The following fields in the `Deployments` are eligible for filtering: + * + * * `display_name` - The display name of the Deployment. Allowed + * comparison operators: `=`. + * * `create_time` - The time at which the Deployment was created. The + * value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] + * format. Allowed comparison operators: `>` and `<`. + * * `resource_uri` - A URI to the deployment resource. Allowed + * comparison operators: `=`. + * * `api_versions` - The API versions linked to this deployment. Allowed + * comparison operators: `:`. + * * `deployment_type.enum_values.values.id` - The allowed value id of the + * deployment_type attribute associated with the Deployment. Allowed + * comparison operators: `:`. + * * `deployment_type.enum_values.values.display_name` - The allowed value + * display name of the deployment_type attribute associated with the + * Deployment. Allowed comparison operators: `:`. + * * `slo.string_values.values` -The allowed string value of the slo + * attribute associated with the deployment. Allowed comparison + * operators: `:`. + * * `environment.enum_values.values.id` - The allowed value id of the + * environment attribute associated with the deployment. Allowed + * comparison operators: `:`. + * * `environment.enum_values.values.display_name` - The allowed value + * display name of the environment attribute associated with the deployment. + * Allowed comparison operators: `:`. + * + * Expressions are combined with either `AND` logic operator or `OR` logical + * operator but not both of them together i.e. only one of the `AND` or `OR` + * operator can be used throughout the filter string and both the operators + * cannot be used together. No other logical operators are supported. At most + * three filter fields are allowed in the filter string and if provided + * more than that then `INVALID_ARGUMENT` error is returned by the API. + * + * Here are a few examples: + * + * * `environment.enum_values.values.id: staging-id` - The allowed value id + * of the environment attribute associated with the Deployment is + * _staging-id_. + * * `environment.enum_values.values.display_name: \"Staging Deployment\"` - + * The allowed value display name of the environment attribute associated + * with the Deployment is `Staging Deployment`. + * * `environment.enum_values.values.id: production-id AND create_time < + * \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - + * The allowed value id of the environment attribute associated with the + * Deployment is _production-id_ and Deployment was created before + * _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_. + * * `environment.enum_values.values.id: production-id OR + * slo.string_values.values: \"99.99%\"` + * - The allowed value id of the environment attribute Deployment is + * _production-id_ or string value of the slo attribute is _99.99%_. + * @param {number} [request.pageSize] + * Optional. The maximum number of deployment resources to return. The service + * may return fewer than this value. If unspecified, at most 50 deployments + * will be returned. The maximum value is 1000; values above 1000 will be + * coerced to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListDeployments` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters (except page_size) provided to + * `ListDeployments` must match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@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.apihub.v1.Deployment|Deployment}. 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/api_hub.list_deployments.js + * region_tag:apihub_v1_generated_ApiHub_ListDeployments_async + */ + listDeploymentsAsync( + request?: protos.google.cloud.apihub.v1.IListDeploymentsRequest, + 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['listDeployments']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listDeployments.asyncIterate( + this.innerApiCalls['listDeployments'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * List all attributes. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource for Attribute. + * Format: `projects/{project}/locations/{location}` + * @param {string} [request.filter] + * Optional. An expression that filters the list of Attributes. + * + * A filter expression consists of a field name, a comparison + * operator, and a value for filtering. The value must be a string or a + * boolean. The comparison operator must be one of: `<`, `>` or + * `=`. Filters are not case sensitive. + * + * The following fields in the `Attribute` are eligible for filtering: + * + * * `display_name` - The display name of the Attribute. Allowed + * comparison operators: `=`. + * * `definition_type` - The definition type of the attribute. Allowed + * comparison operators: `=`. + * * `scope` - The scope of the attribute. Allowed comparison operators: + * `=`. + * * `data_type` - The type of the data of the attribute. Allowed + * comparison operators: `=`. + * * `mandatory` - Denotes whether the attribute is mandatory or not. + * Allowed comparison operators: `=`. + * * `create_time` - The time at which the Attribute was created. The + * value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] + * format. Allowed comparison operators: `>` and `<`. + * + * Expressions are combined with either `AND` logic operator or `OR` logical + * operator but not both of them together i.e. only one of the `AND` or `OR` + * operator can be used throughout the filter string and both the operators + * cannot be used together. No other logical operators are + * supported. At most three filter fields are allowed in the filter + * string and if provided more than that then `INVALID_ARGUMENT` error is + * returned by the API. + * + * Here are a few examples: + * + * * `display_name = production` - - The display name of the attribute is + * _production_. + * * `(display_name = production) AND (create_time < + * \"2021-08-15T14:50:00Z\") AND (create_time > \"2021-08-10T12:00:00Z\")` - + * The display name of the attribute is _production_ and the attribute was + * created before _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00 + * UTC_. + * * `display_name = production OR scope = api` - + * The attribute where the display name is _production_ or the scope is + * _api_. + * @param {number} [request.pageSize] + * Optional. The maximum number of attribute resources to return. The service + * may return fewer than this value. If unspecified, at most 50 attributes + * will be returned. The maximum value is 1000; values above 1000 will be + * coerced to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListAttributes` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListAttributes` must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.apihub.v1.Attribute|Attribute}. + * 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 `listAttributesAsync()` + * 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. + */ + listAttributes( + request?: protos.google.cloud.apihub.v1.IListAttributesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.apihub.v1.IAttribute[], + protos.google.cloud.apihub.v1.IListAttributesRequest|null, + protos.google.cloud.apihub.v1.IListAttributesResponse + ]>; + listAttributes( + request: protos.google.cloud.apihub.v1.IListAttributesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.apihub.v1.IListAttributesRequest, + protos.google.cloud.apihub.v1.IListAttributesResponse|null|undefined, + protos.google.cloud.apihub.v1.IAttribute>): void; + listAttributes( + request: protos.google.cloud.apihub.v1.IListAttributesRequest, + callback: PaginationCallback< + protos.google.cloud.apihub.v1.IListAttributesRequest, + protos.google.cloud.apihub.v1.IListAttributesResponse|null|undefined, + protos.google.cloud.apihub.v1.IAttribute>): void; + listAttributes( + request?: protos.google.cloud.apihub.v1.IListAttributesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.apihub.v1.IListAttributesRequest, + protos.google.cloud.apihub.v1.IListAttributesResponse|null|undefined, + protos.google.cloud.apihub.v1.IAttribute>, + callback?: PaginationCallback< + protos.google.cloud.apihub.v1.IListAttributesRequest, + protos.google.cloud.apihub.v1.IListAttributesResponse|null|undefined, + protos.google.cloud.apihub.v1.IAttribute>): + Promise<[ + protos.google.cloud.apihub.v1.IAttribute[], + protos.google.cloud.apihub.v1.IListAttributesRequest|null, + protos.google.cloud.apihub.v1.IListAttributesResponse + ]>|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.listAttributes(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource for Attribute. + * Format: `projects/{project}/locations/{location}` + * @param {string} [request.filter] + * Optional. An expression that filters the list of Attributes. + * + * A filter expression consists of a field name, a comparison + * operator, and a value for filtering. The value must be a string or a + * boolean. The comparison operator must be one of: `<`, `>` or + * `=`. Filters are not case sensitive. + * + * The following fields in the `Attribute` are eligible for filtering: + * + * * `display_name` - The display name of the Attribute. Allowed + * comparison operators: `=`. + * * `definition_type` - The definition type of the attribute. Allowed + * comparison operators: `=`. + * * `scope` - The scope of the attribute. Allowed comparison operators: + * `=`. + * * `data_type` - The type of the data of the attribute. Allowed + * comparison operators: `=`. + * * `mandatory` - Denotes whether the attribute is mandatory or not. + * Allowed comparison operators: `=`. + * * `create_time` - The time at which the Attribute was created. The + * value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] + * format. Allowed comparison operators: `>` and `<`. + * + * Expressions are combined with either `AND` logic operator or `OR` logical + * operator but not both of them together i.e. only one of the `AND` or `OR` + * operator can be used throughout the filter string and both the operators + * cannot be used together. No other logical operators are + * supported. At most three filter fields are allowed in the filter + * string and if provided more than that then `INVALID_ARGUMENT` error is + * returned by the API. + * + * Here are a few examples: + * + * * `display_name = production` - - The display name of the attribute is + * _production_. + * * `(display_name = production) AND (create_time < + * \"2021-08-15T14:50:00Z\") AND (create_time > \"2021-08-10T12:00:00Z\")` - + * The display name of the attribute is _production_ and the attribute was + * created before _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00 + * UTC_. + * * `display_name = production OR scope = api` - + * The attribute where the display name is _production_ or the scope is + * _api_. + * @param {number} [request.pageSize] + * Optional. The maximum number of attribute resources to return. The service + * may return fewer than this value. If unspecified, at most 50 attributes + * will be returned. The maximum value is 1000; values above 1000 will be + * coerced to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListAttributes` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListAttributes` must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.apihub.v1.Attribute|Attribute} 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 `listAttributesAsync()` + * 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. + */ + listAttributesStream( + request?: protos.google.cloud.apihub.v1.IListAttributesRequest, + 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['listAttributes']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listAttributes.createStream( + this.innerApiCalls.listAttributes as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listAttributes`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource for Attribute. + * Format: `projects/{project}/locations/{location}` + * @param {string} [request.filter] + * Optional. An expression that filters the list of Attributes. + * + * A filter expression consists of a field name, a comparison + * operator, and a value for filtering. The value must be a string or a + * boolean. The comparison operator must be one of: `<`, `>` or + * `=`. Filters are not case sensitive. + * + * The following fields in the `Attribute` are eligible for filtering: + * + * * `display_name` - The display name of the Attribute. Allowed + * comparison operators: `=`. + * * `definition_type` - The definition type of the attribute. Allowed + * comparison operators: `=`. + * * `scope` - The scope of the attribute. Allowed comparison operators: + * `=`. + * * `data_type` - The type of the data of the attribute. Allowed + * comparison operators: `=`. + * * `mandatory` - Denotes whether the attribute is mandatory or not. + * Allowed comparison operators: `=`. + * * `create_time` - The time at which the Attribute was created. The + * value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] + * format. Allowed comparison operators: `>` and `<`. + * + * Expressions are combined with either `AND` logic operator or `OR` logical + * operator but not both of them together i.e. only one of the `AND` or `OR` + * operator can be used throughout the filter string and both the operators + * cannot be used together. No other logical operators are + * supported. At most three filter fields are allowed in the filter + * string and if provided more than that then `INVALID_ARGUMENT` error is + * returned by the API. + * + * Here are a few examples: + * + * * `display_name = production` - - The display name of the attribute is + * _production_. + * * `(display_name = production) AND (create_time < + * \"2021-08-15T14:50:00Z\") AND (create_time > \"2021-08-10T12:00:00Z\")` - + * The display name of the attribute is _production_ and the attribute was + * created before _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00 + * UTC_. + * * `display_name = production OR scope = api` - + * The attribute where the display name is _production_ or the scope is + * _api_. + * @param {number} [request.pageSize] + * Optional. The maximum number of attribute resources to return. The service + * may return fewer than this value. If unspecified, at most 50 attributes + * will be returned. The maximum value is 1000; values above 1000 will be + * coerced to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListAttributes` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListAttributes` must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@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.apihub.v1.Attribute|Attribute}. 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/api_hub.list_attributes.js + * region_tag:apihub_v1_generated_ApiHub_ListAttributes_async + */ + listAttributesAsync( + request?: protos.google.cloud.apihub.v1.IListAttributesRequest, + 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['listAttributes']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listAttributes.asyncIterate( + this.innerApiCalls['listAttributes'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Search across API-Hub resources. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.location + * Required. The resource name of the location which will be of the type + * `projects/{project_id}/locations/{location_id}`. This field is used to + * identify the instance of API-Hub in which resources should be searched. + * @param {string} request.query + * Required. The free text search query. This query can contain keywords which + * could be related to any detail of the API-Hub resources such display names, + * descriptions, attributes etc. + * @param {string} [request.filter] + * Optional. An expression that filters the list of search results. + * + * A filter expression consists of a field name, a comparison operator, + * and a value for filtering. The value must be a string, a number, or a + * boolean. The comparison operator must be `=`. Filters are not case + * sensitive. + * + * The following field names are eligible for filtering: + * * `resource_type` - The type of resource in the search results. + * Must be one of the following: `Api`, `ApiOperation`, `Deployment`, + * `Definition`, `Spec` or `Version`. This field can only be specified once + * in the filter. + * + * Here are is an example: + * + * * `resource_type = Api` - The resource_type is _Api_. + * @param {number} [request.pageSize] + * Optional. The maximum number of search results to return. The service may + * return fewer than this value. If unspecified at most 10 search results will + * be returned. If value is negative then `INVALID_ARGUMENT` error is + * returned. The maximum value is 25; values above 25 will be coerced to 25. + * While paginating, you can specify a new page size parameter for each page + * of search results to be listed. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous + * {@link protos.SearchResources|SearchResources} + * call. Specify this parameter to retrieve the next page of transactions. + * + * When paginating, you must specify the `page_token` parameter and all the + * other parameters except + * {@link protos.google.cloud.apihub.v1.SearchResourcesRequest.page_size|page_size} + * should be specified with the same value which was used in the previous + * call. If the other fields are set with a different value than the previous + * call then `INVALID_ARGUMENT` error is returned. + * @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.apihub.v1.SearchResult|SearchResult}. + * 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 `searchResourcesAsync()` + * 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. + */ + searchResources( + request?: protos.google.cloud.apihub.v1.ISearchResourcesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.apihub.v1.ISearchResult[], + protos.google.cloud.apihub.v1.ISearchResourcesRequest|null, + protos.google.cloud.apihub.v1.ISearchResourcesResponse + ]>; + searchResources( + request: protos.google.cloud.apihub.v1.ISearchResourcesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.apihub.v1.ISearchResourcesRequest, + protos.google.cloud.apihub.v1.ISearchResourcesResponse|null|undefined, + protos.google.cloud.apihub.v1.ISearchResult>): void; + searchResources( + request: protos.google.cloud.apihub.v1.ISearchResourcesRequest, + callback: PaginationCallback< + protos.google.cloud.apihub.v1.ISearchResourcesRequest, + protos.google.cloud.apihub.v1.ISearchResourcesResponse|null|undefined, + protos.google.cloud.apihub.v1.ISearchResult>): void; + searchResources( + request?: protos.google.cloud.apihub.v1.ISearchResourcesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.apihub.v1.ISearchResourcesRequest, + protos.google.cloud.apihub.v1.ISearchResourcesResponse|null|undefined, + protos.google.cloud.apihub.v1.ISearchResult>, + callback?: PaginationCallback< + protos.google.cloud.apihub.v1.ISearchResourcesRequest, + protos.google.cloud.apihub.v1.ISearchResourcesResponse|null|undefined, + protos.google.cloud.apihub.v1.ISearchResult>): + Promise<[ + protos.google.cloud.apihub.v1.ISearchResult[], + protos.google.cloud.apihub.v1.ISearchResourcesRequest|null, + protos.google.cloud.apihub.v1.ISearchResourcesResponse + ]>|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({ + 'location': request.location ?? '', + }); + this.initialize(); + return this.innerApiCalls.searchResources(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.location + * Required. The resource name of the location which will be of the type + * `projects/{project_id}/locations/{location_id}`. This field is used to + * identify the instance of API-Hub in which resources should be searched. + * @param {string} request.query + * Required. The free text search query. This query can contain keywords which + * could be related to any detail of the API-Hub resources such display names, + * descriptions, attributes etc. + * @param {string} [request.filter] + * Optional. An expression that filters the list of search results. + * + * A filter expression consists of a field name, a comparison operator, + * and a value for filtering. The value must be a string, a number, or a + * boolean. The comparison operator must be `=`. Filters are not case + * sensitive. + * + * The following field names are eligible for filtering: + * * `resource_type` - The type of resource in the search results. + * Must be one of the following: `Api`, `ApiOperation`, `Deployment`, + * `Definition`, `Spec` or `Version`. This field can only be specified once + * in the filter. + * + * Here are is an example: + * + * * `resource_type = Api` - The resource_type is _Api_. + * @param {number} [request.pageSize] + * Optional. The maximum number of search results to return. The service may + * return fewer than this value. If unspecified at most 10 search results will + * be returned. If value is negative then `INVALID_ARGUMENT` error is + * returned. The maximum value is 25; values above 25 will be coerced to 25. + * While paginating, you can specify a new page size parameter for each page + * of search results to be listed. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous + * {@link protos.SearchResources|SearchResources} + * call. Specify this parameter to retrieve the next page of transactions. + * + * When paginating, you must specify the `page_token` parameter and all the + * other parameters except + * {@link protos.google.cloud.apihub.v1.SearchResourcesRequest.page_size|page_size} + * should be specified with the same value which was used in the previous + * call. If the other fields are set with a different value than the previous + * call then `INVALID_ARGUMENT` error is returned. + * @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.apihub.v1.SearchResult|SearchResult} 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 `searchResourcesAsync()` + * 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. + */ + searchResourcesStream( + request?: protos.google.cloud.apihub.v1.ISearchResourcesRequest, + 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({ + 'location': request.location ?? '', + }); + const defaultCallSettings = this._defaults['searchResources']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.searchResources.createStream( + this.innerApiCalls.searchResources as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `searchResources`, 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.location + * Required. The resource name of the location which will be of the type + * `projects/{project_id}/locations/{location_id}`. This field is used to + * identify the instance of API-Hub in which resources should be searched. + * @param {string} request.query + * Required. The free text search query. This query can contain keywords which + * could be related to any detail of the API-Hub resources such display names, + * descriptions, attributes etc. + * @param {string} [request.filter] + * Optional. An expression that filters the list of search results. + * + * A filter expression consists of a field name, a comparison operator, + * and a value for filtering. The value must be a string, a number, or a + * boolean. The comparison operator must be `=`. Filters are not case + * sensitive. + * + * The following field names are eligible for filtering: + * * `resource_type` - The type of resource in the search results. + * Must be one of the following: `Api`, `ApiOperation`, `Deployment`, + * `Definition`, `Spec` or `Version`. This field can only be specified once + * in the filter. + * + * Here are is an example: + * + * * `resource_type = Api` - The resource_type is _Api_. + * @param {number} [request.pageSize] + * Optional. The maximum number of search results to return. The service may + * return fewer than this value. If unspecified at most 10 search results will + * be returned. If value is negative then `INVALID_ARGUMENT` error is + * returned. The maximum value is 25; values above 25 will be coerced to 25. + * While paginating, you can specify a new page size parameter for each page + * of search results to be listed. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous + * {@link protos.SearchResources|SearchResources} + * call. Specify this parameter to retrieve the next page of transactions. + * + * When paginating, you must specify the `page_token` parameter and all the + * other parameters except + * {@link protos.google.cloud.apihub.v1.SearchResourcesRequest.page_size|page_size} + * should be specified with the same value which was used in the previous + * call. If the other fields are set with a different value than the previous + * call then `INVALID_ARGUMENT` error is returned. + * @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.apihub.v1.SearchResult|SearchResult}. 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/api_hub.search_resources.js + * region_tag:apihub_v1_generated_ApiHub_SearchResources_async + */ + searchResourcesAsync( + request?: protos.google.cloud.apihub.v1.ISearchResourcesRequest, + 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({ + 'location': request.location ?? '', + }); + const defaultCallSettings = this._defaults['searchResources']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.searchResources.asyncIterate( + this.innerApiCalls['searchResources'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * List External API resources in the API hub. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of External API resources. + * Format: `projects/{project}/locations/{location}` + * @param {number} [request.pageSize] + * Optional. The maximum number of External API resources to return. The + * service may return fewer than this value. If unspecified, at most 50 + * ExternalApis will be returned. The maximum value is 1000; values above 1000 + * will be coerced to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListExternalApis` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters (except page_size) provided to + * `ListExternalApis` must match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.apihub.v1.ExternalApi|ExternalApi}. + * 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 `listExternalApisAsync()` + * 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. + */ + listExternalApis( + request?: protos.google.cloud.apihub.v1.IListExternalApisRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.apihub.v1.IExternalApi[], + protos.google.cloud.apihub.v1.IListExternalApisRequest|null, + protos.google.cloud.apihub.v1.IListExternalApisResponse + ]>; + listExternalApis( + request: protos.google.cloud.apihub.v1.IListExternalApisRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.apihub.v1.IListExternalApisRequest, + protos.google.cloud.apihub.v1.IListExternalApisResponse|null|undefined, + protos.google.cloud.apihub.v1.IExternalApi>): void; + listExternalApis( + request: protos.google.cloud.apihub.v1.IListExternalApisRequest, + callback: PaginationCallback< + protos.google.cloud.apihub.v1.IListExternalApisRequest, + protos.google.cloud.apihub.v1.IListExternalApisResponse|null|undefined, + protos.google.cloud.apihub.v1.IExternalApi>): void; + listExternalApis( + request?: protos.google.cloud.apihub.v1.IListExternalApisRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.apihub.v1.IListExternalApisRequest, + protos.google.cloud.apihub.v1.IListExternalApisResponse|null|undefined, + protos.google.cloud.apihub.v1.IExternalApi>, + callback?: PaginationCallback< + protos.google.cloud.apihub.v1.IListExternalApisRequest, + protos.google.cloud.apihub.v1.IListExternalApisResponse|null|undefined, + protos.google.cloud.apihub.v1.IExternalApi>): + Promise<[ + protos.google.cloud.apihub.v1.IExternalApi[], + protos.google.cloud.apihub.v1.IListExternalApisRequest|null, + protos.google.cloud.apihub.v1.IListExternalApisResponse + ]>|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.listExternalApis(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of External API resources. + * Format: `projects/{project}/locations/{location}` + * @param {number} [request.pageSize] + * Optional. The maximum number of External API resources to return. The + * service may return fewer than this value. If unspecified, at most 50 + * ExternalApis will be returned. The maximum value is 1000; values above 1000 + * will be coerced to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListExternalApis` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters (except page_size) provided to + * `ListExternalApis` must match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.apihub.v1.ExternalApi|ExternalApi} 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 `listExternalApisAsync()` + * 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. + */ + listExternalApisStream( + request?: protos.google.cloud.apihub.v1.IListExternalApisRequest, + 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['listExternalApis']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listExternalApis.createStream( + this.innerApiCalls.listExternalApis as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listExternalApis`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of External API resources. + * Format: `projects/{project}/locations/{location}` + * @param {number} [request.pageSize] + * Optional. The maximum number of External API resources to return. The + * service may return fewer than this value. If unspecified, at most 50 + * ExternalApis will be returned. The maximum value is 1000; values above 1000 + * will be coerced to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListExternalApis` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters (except page_size) provided to + * `ListExternalApis` must match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@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.apihub.v1.ExternalApi|ExternalApi}. 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/api_hub.list_external_apis.js + * region_tag:apihub_v1_generated_ApiHub_ListExternalApis_async + */ + listExternalApisAsync( + request?: protos.google.cloud.apihub.v1.IListExternalApisRequest, + 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['listExternalApis']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listExternalApis.asyncIterate( + this.innerApiCalls['listExternalApis'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } +/** + * 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); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified api resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @returns {string} Resource name string. + */ + apiPath(project:string,location:string,api:string) { + return this.pathTemplates.apiPathTemplate.render({ + project: project, + location: location, + api: api, + }); + } + + /** + * Parse the project from Api resource. + * + * @param {string} apiName + * A fully-qualified path representing Api resource. + * @returns {string} A string representing the project. + */ + matchProjectFromApiName(apiName: string) { + return this.pathTemplates.apiPathTemplate.match(apiName).project; + } + + /** + * Parse the location from Api resource. + * + * @param {string} apiName + * A fully-qualified path representing Api resource. + * @returns {string} A string representing the location. + */ + matchLocationFromApiName(apiName: string) { + return this.pathTemplates.apiPathTemplate.match(apiName).location; + } + + /** + * Parse the api from Api resource. + * + * @param {string} apiName + * A fully-qualified path representing Api resource. + * @returns {string} A string representing the api. + */ + matchApiFromApiName(apiName: string) { + return this.pathTemplates.apiPathTemplate.match(apiName).api; + } + + /** + * Return a fully-qualified apiHubInstance resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api_hub_instance + * @returns {string} Resource name string. + */ + apiHubInstancePath(project:string,location:string,apiHubInstance:string) { + return this.pathTemplates.apiHubInstancePathTemplate.render({ + project: project, + location: location, + api_hub_instance: apiHubInstance, + }); + } + + /** + * Parse the project from ApiHubInstance resource. + * + * @param {string} apiHubInstanceName + * A fully-qualified path representing ApiHubInstance resource. + * @returns {string} A string representing the project. + */ + matchProjectFromApiHubInstanceName(apiHubInstanceName: string) { + return this.pathTemplates.apiHubInstancePathTemplate.match(apiHubInstanceName).project; + } + + /** + * Parse the location from ApiHubInstance resource. + * + * @param {string} apiHubInstanceName + * A fully-qualified path representing ApiHubInstance resource. + * @returns {string} A string representing the location. + */ + matchLocationFromApiHubInstanceName(apiHubInstanceName: string) { + return this.pathTemplates.apiHubInstancePathTemplate.match(apiHubInstanceName).location; + } + + /** + * Parse the api_hub_instance from ApiHubInstance resource. + * + * @param {string} apiHubInstanceName + * A fully-qualified path representing ApiHubInstance resource. + * @returns {string} A string representing the api_hub_instance. + */ + matchApiHubInstanceFromApiHubInstanceName(apiHubInstanceName: string) { + return this.pathTemplates.apiHubInstancePathTemplate.match(apiHubInstanceName).api_hub_instance; + } + + /** + * Return a fully-qualified apiOperation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @param {string} version + * @param {string} operation + * @returns {string} Resource name string. + */ + apiOperationPath(project:string,location:string,api:string,version:string,operation:string) { + return this.pathTemplates.apiOperationPathTemplate.render({ + project: project, + location: location, + api: api, + version: version, + operation: operation, + }); + } + + /** + * Parse the project from ApiOperation resource. + * + * @param {string} apiOperationName + * A fully-qualified path representing ApiOperation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromApiOperationName(apiOperationName: string) { + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).project; + } + + /** + * Parse the location from ApiOperation resource. + * + * @param {string} apiOperationName + * A fully-qualified path representing ApiOperation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromApiOperationName(apiOperationName: string) { + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).location; + } + + /** + * Parse the api from ApiOperation resource. + * + * @param {string} apiOperationName + * A fully-qualified path representing ApiOperation resource. + * @returns {string} A string representing the api. + */ + matchApiFromApiOperationName(apiOperationName: string) { + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).api; + } + + /** + * Parse the version from ApiOperation resource. + * + * @param {string} apiOperationName + * A fully-qualified path representing ApiOperation resource. + * @returns {string} A string representing the version. + */ + matchVersionFromApiOperationName(apiOperationName: string) { + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).version; + } + + /** + * Parse the operation from ApiOperation resource. + * + * @param {string} apiOperationName + * A fully-qualified path representing ApiOperation resource. + * @returns {string} A string representing the operation. + */ + matchOperationFromApiOperationName(apiOperationName: string) { + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).operation; + } + + /** + * Return a fully-qualified attribute resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} attribute + * @returns {string} Resource name string. + */ + attributePath(project:string,location:string,attribute:string) { + return this.pathTemplates.attributePathTemplate.render({ + project: project, + location: location, + attribute: attribute, + }); + } + + /** + * Parse the project from Attribute resource. + * + * @param {string} attributeName + * A fully-qualified path representing Attribute resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAttributeName(attributeName: string) { + return this.pathTemplates.attributePathTemplate.match(attributeName).project; + } + + /** + * Parse the location from Attribute resource. + * + * @param {string} attributeName + * A fully-qualified path representing Attribute resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAttributeName(attributeName: string) { + return this.pathTemplates.attributePathTemplate.match(attributeName).location; + } + + /** + * Parse the attribute from Attribute resource. + * + * @param {string} attributeName + * A fully-qualified path representing Attribute resource. + * @returns {string} A string representing the attribute. + */ + matchAttributeFromAttributeName(attributeName: string) { + return this.pathTemplates.attributePathTemplate.match(attributeName).attribute; + } + + /** + * Return a fully-qualified definition resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @param {string} version + * @param {string} definition + * @returns {string} Resource name string. + */ + definitionPath(project:string,location:string,api:string,version:string,definition:string) { + return this.pathTemplates.definitionPathTemplate.render({ + project: project, + location: location, + api: api, + version: version, + definition: definition, + }); + } + + /** + * Parse the project from Definition resource. + * + * @param {string} definitionName + * A fully-qualified path representing Definition resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDefinitionName(definitionName: string) { + return this.pathTemplates.definitionPathTemplate.match(definitionName).project; + } + + /** + * Parse the location from Definition resource. + * + * @param {string} definitionName + * A fully-qualified path representing Definition resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDefinitionName(definitionName: string) { + return this.pathTemplates.definitionPathTemplate.match(definitionName).location; + } + + /** + * Parse the api from Definition resource. + * + * @param {string} definitionName + * A fully-qualified path representing Definition resource. + * @returns {string} A string representing the api. + */ + matchApiFromDefinitionName(definitionName: string) { + return this.pathTemplates.definitionPathTemplate.match(definitionName).api; + } + + /** + * Parse the version from Definition resource. + * + * @param {string} definitionName + * A fully-qualified path representing Definition resource. + * @returns {string} A string representing the version. + */ + matchVersionFromDefinitionName(definitionName: string) { + return this.pathTemplates.definitionPathTemplate.match(definitionName).version; + } + + /** + * Parse the definition from Definition resource. + * + * @param {string} definitionName + * A fully-qualified path representing Definition resource. + * @returns {string} A string representing the definition. + */ + matchDefinitionFromDefinitionName(definitionName: string) { + return this.pathTemplates.definitionPathTemplate.match(definitionName).definition; + } + + /** + * Return a fully-qualified dependency resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dependency + * @returns {string} Resource name string. + */ + dependencyPath(project:string,location:string,dependency:string) { + return this.pathTemplates.dependencyPathTemplate.render({ + project: project, + location: location, + dependency: dependency, + }); + } + + /** + * Parse the project from Dependency resource. + * + * @param {string} dependencyName + * A fully-qualified path representing Dependency resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDependencyName(dependencyName: string) { + return this.pathTemplates.dependencyPathTemplate.match(dependencyName).project; + } + + /** + * Parse the location from Dependency resource. + * + * @param {string} dependencyName + * A fully-qualified path representing Dependency resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDependencyName(dependencyName: string) { + return this.pathTemplates.dependencyPathTemplate.match(dependencyName).location; + } + + /** + * Parse the dependency from Dependency resource. + * + * @param {string} dependencyName + * A fully-qualified path representing Dependency resource. + * @returns {string} A string representing the dependency. + */ + matchDependencyFromDependencyName(dependencyName: string) { + return this.pathTemplates.dependencyPathTemplate.match(dependencyName).dependency; + } + + /** + * Return a fully-qualified deployment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} deployment + * @returns {string} Resource name string. + */ + deploymentPath(project:string,location:string,deployment:string) { + return this.pathTemplates.deploymentPathTemplate.render({ + project: project, + location: location, + deployment: deployment, + }); + } + + /** + * Parse the project from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName).project; + } + + /** + * Parse the location from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName).location; + } + + /** + * Parse the deployment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the deployment. + */ + matchDeploymentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName).deployment; + } + + /** + * Return a fully-qualified externalApi resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} external_api + * @returns {string} Resource name string. + */ + externalApiPath(project:string,location:string,externalApi:string) { + return this.pathTemplates.externalApiPathTemplate.render({ + project: project, + location: location, + external_api: externalApi, + }); + } + + /** + * Parse the project from ExternalApi resource. + * + * @param {string} externalApiName + * A fully-qualified path representing ExternalApi resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExternalApiName(externalApiName: string) { + return this.pathTemplates.externalApiPathTemplate.match(externalApiName).project; + } + + /** + * Parse the location from ExternalApi resource. + * + * @param {string} externalApiName + * A fully-qualified path representing ExternalApi resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExternalApiName(externalApiName: string) { + return this.pathTemplates.externalApiPathTemplate.match(externalApiName).location; + } + + /** + * Parse the external_api from ExternalApi resource. + * + * @param {string} externalApiName + * A fully-qualified path representing ExternalApi resource. + * @returns {string} A string representing the external_api. + */ + matchExternalApiFromExternalApiName(externalApiName: string) { + return this.pathTemplates.externalApiPathTemplate.match(externalApiName).external_api; + } + + /** + * Return a fully-qualified hostProjectRegistration resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} host_project_registration + * @returns {string} Resource name string. + */ + hostProjectRegistrationPath(project:string,location:string,hostProjectRegistration:string) { + return this.pathTemplates.hostProjectRegistrationPathTemplate.render({ + project: project, + location: location, + host_project_registration: hostProjectRegistration, + }); + } + + /** + * Parse the project from HostProjectRegistration resource. + * + * @param {string} hostProjectRegistrationName + * A fully-qualified path representing HostProjectRegistration resource. + * @returns {string} A string representing the project. + */ + matchProjectFromHostProjectRegistrationName(hostProjectRegistrationName: string) { + return this.pathTemplates.hostProjectRegistrationPathTemplate.match(hostProjectRegistrationName).project; + } + + /** + * Parse the location from HostProjectRegistration resource. + * + * @param {string} hostProjectRegistrationName + * A fully-qualified path representing HostProjectRegistration resource. + * @returns {string} A string representing the location. + */ + matchLocationFromHostProjectRegistrationName(hostProjectRegistrationName: string) { + return this.pathTemplates.hostProjectRegistrationPathTemplate.match(hostProjectRegistrationName).location; + } + + /** + * Parse the host_project_registration from HostProjectRegistration resource. + * + * @param {string} hostProjectRegistrationName + * A fully-qualified path representing HostProjectRegistration resource. + * @returns {string} A string representing the host_project_registration. + */ + matchHostProjectRegistrationFromHostProjectRegistrationName(hostProjectRegistrationName: string) { + return this.pathTemplates.hostProjectRegistrationPathTemplate.match(hostProjectRegistrationName).host_project_registration; + } + + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project:string,location:string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + + /** + * Return a fully-qualified plugin resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} plugin + * @returns {string} Resource name string. + */ + pluginPath(project:string,location:string,plugin:string) { + return this.pathTemplates.pluginPathTemplate.render({ + project: project, + location: location, + plugin: plugin, + }); + } + + /** + * Parse the project from Plugin resource. + * + * @param {string} pluginName + * A fully-qualified path representing Plugin resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPluginName(pluginName: string) { + return this.pathTemplates.pluginPathTemplate.match(pluginName).project; + } + + /** + * Parse the location from Plugin resource. + * + * @param {string} pluginName + * A fully-qualified path representing Plugin resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPluginName(pluginName: string) { + return this.pathTemplates.pluginPathTemplate.match(pluginName).location; + } + + /** + * Parse the plugin from Plugin resource. + * + * @param {string} pluginName + * A fully-qualified path representing Plugin resource. + * @returns {string} A string representing the plugin. + */ + matchPluginFromPluginName(pluginName: string) { + return this.pathTemplates.pluginPathTemplate.match(pluginName).plugin; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project:string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified runtimeProjectAttachment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} runtime_project_attachment + * @returns {string} Resource name string. + */ + runtimeProjectAttachmentPath(project:string,location:string,runtimeProjectAttachment:string) { + return this.pathTemplates.runtimeProjectAttachmentPathTemplate.render({ + project: project, + location: location, + runtime_project_attachment: runtimeProjectAttachment, + }); + } + + /** + * Parse the project from RuntimeProjectAttachment resource. + * + * @param {string} runtimeProjectAttachmentName + * A fully-qualified path representing RuntimeProjectAttachment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRuntimeProjectAttachmentName(runtimeProjectAttachmentName: string) { + return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match(runtimeProjectAttachmentName).project; + } + + /** + * Parse the location from RuntimeProjectAttachment resource. + * + * @param {string} runtimeProjectAttachmentName + * A fully-qualified path representing RuntimeProjectAttachment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRuntimeProjectAttachmentName(runtimeProjectAttachmentName: string) { + return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match(runtimeProjectAttachmentName).location; + } + + /** + * Parse the runtime_project_attachment from RuntimeProjectAttachment resource. + * + * @param {string} runtimeProjectAttachmentName + * A fully-qualified path representing RuntimeProjectAttachment resource. + * @returns {string} A string representing the runtime_project_attachment. + */ + matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName(runtimeProjectAttachmentName: string) { + return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match(runtimeProjectAttachmentName).runtime_project_attachment; + } + + /** + * Return a fully-qualified spec resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @param {string} version + * @param {string} spec + * @returns {string} Resource name string. + */ + specPath(project:string,location:string,api:string,version:string,spec:string) { + return this.pathTemplates.specPathTemplate.render({ + project: project, + location: location, + api: api, + version: version, + spec: spec, + }); + } + + /** + * Parse the project from Spec resource. + * + * @param {string} specName + * A fully-qualified path representing Spec resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSpecName(specName: string) { + return this.pathTemplates.specPathTemplate.match(specName).project; + } + + /** + * Parse the location from Spec resource. + * + * @param {string} specName + * A fully-qualified path representing Spec resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSpecName(specName: string) { + return this.pathTemplates.specPathTemplate.match(specName).location; + } + + /** + * Parse the api from Spec resource. + * + * @param {string} specName + * A fully-qualified path representing Spec resource. + * @returns {string} A string representing the api. + */ + matchApiFromSpecName(specName: string) { + return this.pathTemplates.specPathTemplate.match(specName).api; + } + + /** + * Parse the version from Spec resource. + * + * @param {string} specName + * A fully-qualified path representing Spec resource. + * @returns {string} A string representing the version. + */ + matchVersionFromSpecName(specName: string) { + return this.pathTemplates.specPathTemplate.match(specName).version; + } + + /** + * Parse the spec from Spec resource. + * + * @param {string} specName + * A fully-qualified path representing Spec resource. + * @returns {string} A string representing the spec. + */ + matchSpecFromSpecName(specName: string) { + return this.pathTemplates.specPathTemplate.match(specName).spec; + } + + /** + * Return a fully-qualified styleGuide resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} plugin + * @returns {string} Resource name string. + */ + styleGuidePath(project:string,location:string,plugin:string) { + return this.pathTemplates.styleGuidePathTemplate.render({ + project: project, + location: location, + plugin: plugin, + }); + } + + /** + * Parse the project from StyleGuide resource. + * + * @param {string} styleGuideName + * A fully-qualified path representing StyleGuide resource. + * @returns {string} A string representing the project. + */ + matchProjectFromStyleGuideName(styleGuideName: string) { + return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName).project; + } + + /** + * Parse the location from StyleGuide resource. + * + * @param {string} styleGuideName + * A fully-qualified path representing StyleGuide resource. + * @returns {string} A string representing the location. + */ + matchLocationFromStyleGuideName(styleGuideName: string) { + return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName).location; + } + + /** + * Parse the plugin from StyleGuide resource. + * + * @param {string} styleGuideName + * A fully-qualified path representing StyleGuide resource. + * @returns {string} A string representing the plugin. + */ + matchPluginFromStyleGuideName(styleGuideName: string) { + return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName).plugin; + } + + /** + * Return a fully-qualified version resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @param {string} version + * @returns {string} Resource name string. + */ + versionPath(project:string,location:string,api:string,version:string) { + return this.pathTemplates.versionPathTemplate.render({ + project: project, + location: location, + api: api, + version: version, + }); + } + + /** + * Parse the project from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the project. + */ + matchProjectFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).project; + } + + /** + * Parse the location from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the location. + */ + matchLocationFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).location; + } + + /** + * Parse the api from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the api. + */ + matchApiFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).api; + } + + /** + * Parse the version from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the version. + */ + matchVersionFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).version; + } + + /** + * 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.apiHubStub && !this._terminated) { + return this.apiHubStub.then(stub => { + this._terminated = true; + stub.close(); + this.locationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_client_config.json b/owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_client_config.json new file mode 100644 index 00000000000..d279d06d0ba --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_client_config.json @@ -0,0 +1,213 @@ +{ + "interfaces": { + "google.cloud.apihub.v1.ApiHub": { + "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": { + "CreateApi": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetApi": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ListApis": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "UpdateApi": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteApi": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateVersion": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetVersion": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ListVersions": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "UpdateVersion": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteVersion": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateSpec": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetSpec": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetSpecContents": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ListSpecs": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "UpdateSpec": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteSpec": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetApiOperation": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ListApiOperations": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetDefinition": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "CreateDeployment": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetDeployment": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ListDeployments": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "UpdateDeployment": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteDeployment": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateAttribute": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetAttribute": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "UpdateAttribute": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteAttribute": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListAttributes": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "SearchResources": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "CreateExternalApi": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetExternalApi": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "UpdateExternalApi": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteExternalApi": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListExternalApis": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_dependencies_client.ts b/owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_dependencies_client.ts new file mode 100644 index 00000000000..5cadcb4a302 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_dependencies_client.ts @@ -0,0 +1,1933 @@ +// Copyright 2024 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, PaginationCallback, GaxCall, 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/api_hub_dependencies_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './api_hub_dependencies_client_config.json'; +const version = require('../../../package.json').version; + +/** + * This service provides methods for various operations related to a + * {@link protos.google.cloud.apihub.v1.Dependency|Dependency} in the API hub. + * @class + * @memberof v1 + */ +export class ApiHubDependenciesClient { + 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}; + private _universeDomain: string; + private _servicePath: string; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + locationsClient: LocationsClient; + pathTemplates: {[name: string]: gax.PathTemplate}; + apiHubDependenciesStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of ApiHubDependenciesClient. + * + * @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 ApiHubDependenciesClient({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 ApiHubDependenciesClient; + if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { + throw new Error('Please set either universe_domain or universeDomain, but not both.'); + } + const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; + this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; + this._servicePath = 'apihub.' + this._universeDomain; + const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). + if (!opts) { + opts = {fallback: true}; + } else { + opts.fallback = opts.fallback ?? true; + } + 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 !== this._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 = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + 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 === 'object' && '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 = { + apiPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}' + ), + apiHubInstancePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apiHubInstances/{api_hub_instance}' + ), + apiOperationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}' + ), + attributePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/attributes/{attribute}' + ), + definitionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}' + ), + dependencyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/dependencies/{dependency}' + ), + deploymentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/deployments/{deployment}' + ), + externalApiPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/externalApis/{external_api}' + ), + hostProjectRegistrationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/hostProjectRegistrations/{host_project_registration}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + pluginPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/plugins/{plugin}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + runtimeProjectAttachmentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}' + ), + specPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}' + ), + styleGuidePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/plugins/{plugin}/styleGuide' + ), + versionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}/versions/{version}' + ), + }; + + // 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 = { + listDependencies: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'dependencies') + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.apihub.v1.ApiHubDependencies', 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.apiHubDependenciesStub) { + return this.apiHubDependenciesStub; + } + + // Put together the "service stub" for + // google.cloud.apihub.v1.ApiHubDependencies. + this.apiHubDependenciesStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.apihub.v1.ApiHubDependencies') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.apihub.v1.ApiHubDependencies, + 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 apiHubDependenciesStubMethods = + ['createDependency', 'getDependency', 'updateDependency', 'deleteDependency', 'listDependencies']; + for (const methodName of apiHubDependenciesStubMethods) { + const callPromise = this.apiHubDependenciesStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + this.descriptors.page[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.apiHubDependenciesStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'apihub.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'apihub.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * 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 -- + // ------------------- +/** + * Create a dependency between two entities in the API hub. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource for the dependency resource. + * Format: `projects/{project}/locations/{location}` + * @param {string} [request.dependencyId] + * Optional. The ID to use for the dependency resource, which will become the + * final component of the dependency's resource name. This field is optional. + * * If provided, the same will be used. The service will throw an error if + * duplicate id is provided by the client. + * * If not provided, a system generated id will be used. + * + * This value should be 4-500 characters, and valid characters + * are `{@link protos.A-Z|a-z}[0-9]-_`. + * @param {google.cloud.apihub.v1.Dependency} request.dependency + * Required. The dependency resource to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.apihub.v1.Dependency|Dependency}. + * 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/api_hub_dependencies.create_dependency.js + * region_tag:apihub_v1_generated_ApiHubDependencies_CreateDependency_async + */ + createDependency( + request?: protos.google.cloud.apihub.v1.ICreateDependencyRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.apihub.v1.IDependency, + protos.google.cloud.apihub.v1.ICreateDependencyRequest|undefined, {}|undefined + ]>; + createDependency( + request: protos.google.cloud.apihub.v1.ICreateDependencyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.IDependency, + protos.google.cloud.apihub.v1.ICreateDependencyRequest|null|undefined, + {}|null|undefined>): void; + createDependency( + request: protos.google.cloud.apihub.v1.ICreateDependencyRequest, + callback: Callback< + protos.google.cloud.apihub.v1.IDependency, + protos.google.cloud.apihub.v1.ICreateDependencyRequest|null|undefined, + {}|null|undefined>): void; + createDependency( + request?: protos.google.cloud.apihub.v1.ICreateDependencyRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.apihub.v1.IDependency, + protos.google.cloud.apihub.v1.ICreateDependencyRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.apihub.v1.IDependency, + protos.google.cloud.apihub.v1.ICreateDependencyRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.apihub.v1.IDependency, + protos.google.cloud.apihub.v1.ICreateDependencyRequest|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.createDependency(request, options, callback); + } +/** + * Get details about a dependency resource in the API hub. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the dependency resource to retrieve. + * Format: `projects/{project}/locations/{location}/dependencies/{dependency}` + * @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.apihub.v1.Dependency|Dependency}. + * 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/api_hub_dependencies.get_dependency.js + * region_tag:apihub_v1_generated_ApiHubDependencies_GetDependency_async + */ + getDependency( + request?: protos.google.cloud.apihub.v1.IGetDependencyRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.apihub.v1.IDependency, + protos.google.cloud.apihub.v1.IGetDependencyRequest|undefined, {}|undefined + ]>; + getDependency( + request: protos.google.cloud.apihub.v1.IGetDependencyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.IDependency, + protos.google.cloud.apihub.v1.IGetDependencyRequest|null|undefined, + {}|null|undefined>): void; + getDependency( + request: protos.google.cloud.apihub.v1.IGetDependencyRequest, + callback: Callback< + protos.google.cloud.apihub.v1.IDependency, + protos.google.cloud.apihub.v1.IGetDependencyRequest|null|undefined, + {}|null|undefined>): void; + getDependency( + request?: protos.google.cloud.apihub.v1.IGetDependencyRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.apihub.v1.IDependency, + protos.google.cloud.apihub.v1.IGetDependencyRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.apihub.v1.IDependency, + protos.google.cloud.apihub.v1.IGetDependencyRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.apihub.v1.IDependency, + protos.google.cloud.apihub.v1.IGetDependencyRequest|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.getDependency(request, options, callback); + } +/** + * Update a dependency based on the + * {@link protos.google.cloud.apihub.v1.UpdateDependencyRequest.update_mask|update_mask} + * provided in the request. + * + * The following fields in the {@link protos.google.cloud.apihub.v1.Dependency|dependency} + * can be updated: + * * {@link protos.google.cloud.apihub.v1.Dependency.description|description} + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.apihub.v1.Dependency} request.dependency + * Required. The dependency resource to update. + * + * The dependency's `name` field is used to identify the dependency to update. + * Format: `projects/{project}/locations/{location}/dependencies/{dependency}` + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The list of fields to update. + * @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.apihub.v1.Dependency|Dependency}. + * 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/api_hub_dependencies.update_dependency.js + * region_tag:apihub_v1_generated_ApiHubDependencies_UpdateDependency_async + */ + updateDependency( + request?: protos.google.cloud.apihub.v1.IUpdateDependencyRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.apihub.v1.IDependency, + protos.google.cloud.apihub.v1.IUpdateDependencyRequest|undefined, {}|undefined + ]>; + updateDependency( + request: protos.google.cloud.apihub.v1.IUpdateDependencyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.IDependency, + protos.google.cloud.apihub.v1.IUpdateDependencyRequest|null|undefined, + {}|null|undefined>): void; + updateDependency( + request: protos.google.cloud.apihub.v1.IUpdateDependencyRequest, + callback: Callback< + protos.google.cloud.apihub.v1.IDependency, + protos.google.cloud.apihub.v1.IUpdateDependencyRequest|null|undefined, + {}|null|undefined>): void; + updateDependency( + request?: protos.google.cloud.apihub.v1.IUpdateDependencyRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.apihub.v1.IDependency, + protos.google.cloud.apihub.v1.IUpdateDependencyRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.apihub.v1.IDependency, + protos.google.cloud.apihub.v1.IUpdateDependencyRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.apihub.v1.IDependency, + protos.google.cloud.apihub.v1.IUpdateDependencyRequest|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({ + 'dependency.name': request.dependency!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateDependency(request, options, callback); + } +/** + * Delete the dependency resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the dependency resource to delete. + * Format: `projects/{project}/locations/{location}/dependencies/{dependency}` + * @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.protobuf.Empty|Empty}. + * 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/api_hub_dependencies.delete_dependency.js + * region_tag:apihub_v1_generated_ApiHubDependencies_DeleteDependency_async + */ + deleteDependency( + request?: protos.google.cloud.apihub.v1.IDeleteDependencyRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteDependencyRequest|undefined, {}|undefined + ]>; + deleteDependency( + request: protos.google.cloud.apihub.v1.IDeleteDependencyRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteDependencyRequest|null|undefined, + {}|null|undefined>): void; + deleteDependency( + request: protos.google.cloud.apihub.v1.IDeleteDependencyRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteDependencyRequest|null|undefined, + {}|null|undefined>): void; + deleteDependency( + request?: protos.google.cloud.apihub.v1.IDeleteDependencyRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteDependencyRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteDependencyRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteDependencyRequest|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.deleteDependency(request, options, callback); + } + + /** + * List dependencies based on the provided filter and pagination parameters. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent which owns this collection of dependency resources. + * Format: `projects/{project}/locations/{location}` + * @param {string} [request.filter] + * Optional. An expression that filters the list of Dependencies. + * + * A filter expression consists of a field name, a comparison operator, and + * a value for filtering. The value must be a string. Allowed comparison + * operator is `=`. Filters are not case sensitive. + * + * The following fields in the `Dependency` are eligible for filtering: + * + * * `consumer.operation_resource_name` - The operation resource name for + * the consumer entity involved in a dependency. Allowed comparison + * operators: `=`. + * * `consumer.external_api_resource_name` - The external api resource name + * for the consumer entity involved in a dependency. Allowed comparison + * operators: `=`. + * * `supplier.operation_resource_name` - The operation resource name for + * the supplier entity involved in a dependency. Allowed comparison + * operators: `=`. + * * `supplier.external_api_resource_name` - The external api resource name + * for the supplier entity involved in a dependency. Allowed comparison + * operators: `=`. + * + * Expressions are combined with either `AND` logic operator or `OR` logical + * operator but not both of them together i.e. only one of the `AND` or `OR` + * operator can be used throughout the filter string and both the operators + * cannot be used together. No other logical operators are supported. At most + * three filter fields are allowed in the filter string and if provided + * more than that then `INVALID_ARGUMENT` error is returned by the API. + * + * For example, `consumer.operation_resource_name = + * \"projects/p1/locations/global/apis/a1/versions/v1/operations/o1\" OR + * supplier.operation_resource_name = + * \"projects/p1/locations/global/apis/a1/versions/v1/operations/o1\"` - The + * dependencies with either consumer or supplier operation resource name as + * _projects/p1/locations/global/apis/a1/versions/v1/operations/o1_. + * @param {number} [request.pageSize] + * Optional. The maximum number of dependency resources to return. The service + * may return fewer than this value. If unspecified, at most 50 dependencies + * will be returned. The maximum value is 1000; values above 1000 will be + * coerced to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListDependencies` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListDependencies` must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.apihub.v1.Dependency|Dependency}. + * 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 `listDependenciesAsync()` + * 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. + */ + listDependencies( + request?: protos.google.cloud.apihub.v1.IListDependenciesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.apihub.v1.IDependency[], + protos.google.cloud.apihub.v1.IListDependenciesRequest|null, + protos.google.cloud.apihub.v1.IListDependenciesResponse + ]>; + listDependencies( + request: protos.google.cloud.apihub.v1.IListDependenciesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.apihub.v1.IListDependenciesRequest, + protos.google.cloud.apihub.v1.IListDependenciesResponse|null|undefined, + protos.google.cloud.apihub.v1.IDependency>): void; + listDependencies( + request: protos.google.cloud.apihub.v1.IListDependenciesRequest, + callback: PaginationCallback< + protos.google.cloud.apihub.v1.IListDependenciesRequest, + protos.google.cloud.apihub.v1.IListDependenciesResponse|null|undefined, + protos.google.cloud.apihub.v1.IDependency>): void; + listDependencies( + request?: protos.google.cloud.apihub.v1.IListDependenciesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.apihub.v1.IListDependenciesRequest, + protos.google.cloud.apihub.v1.IListDependenciesResponse|null|undefined, + protos.google.cloud.apihub.v1.IDependency>, + callback?: PaginationCallback< + protos.google.cloud.apihub.v1.IListDependenciesRequest, + protos.google.cloud.apihub.v1.IListDependenciesResponse|null|undefined, + protos.google.cloud.apihub.v1.IDependency>): + Promise<[ + protos.google.cloud.apihub.v1.IDependency[], + protos.google.cloud.apihub.v1.IListDependenciesRequest|null, + protos.google.cloud.apihub.v1.IListDependenciesResponse + ]>|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.listDependencies(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent which owns this collection of dependency resources. + * Format: `projects/{project}/locations/{location}` + * @param {string} [request.filter] + * Optional. An expression that filters the list of Dependencies. + * + * A filter expression consists of a field name, a comparison operator, and + * a value for filtering. The value must be a string. Allowed comparison + * operator is `=`. Filters are not case sensitive. + * + * The following fields in the `Dependency` are eligible for filtering: + * + * * `consumer.operation_resource_name` - The operation resource name for + * the consumer entity involved in a dependency. Allowed comparison + * operators: `=`. + * * `consumer.external_api_resource_name` - The external api resource name + * for the consumer entity involved in a dependency. Allowed comparison + * operators: `=`. + * * `supplier.operation_resource_name` - The operation resource name for + * the supplier entity involved in a dependency. Allowed comparison + * operators: `=`. + * * `supplier.external_api_resource_name` - The external api resource name + * for the supplier entity involved in a dependency. Allowed comparison + * operators: `=`. + * + * Expressions are combined with either `AND` logic operator or `OR` logical + * operator but not both of them together i.e. only one of the `AND` or `OR` + * operator can be used throughout the filter string and both the operators + * cannot be used together. No other logical operators are supported. At most + * three filter fields are allowed in the filter string and if provided + * more than that then `INVALID_ARGUMENT` error is returned by the API. + * + * For example, `consumer.operation_resource_name = + * \"projects/p1/locations/global/apis/a1/versions/v1/operations/o1\" OR + * supplier.operation_resource_name = + * \"projects/p1/locations/global/apis/a1/versions/v1/operations/o1\"` - The + * dependencies with either consumer or supplier operation resource name as + * _projects/p1/locations/global/apis/a1/versions/v1/operations/o1_. + * @param {number} [request.pageSize] + * Optional. The maximum number of dependency resources to return. The service + * may return fewer than this value. If unspecified, at most 50 dependencies + * will be returned. The maximum value is 1000; values above 1000 will be + * coerced to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListDependencies` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListDependencies` must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.apihub.v1.Dependency|Dependency} 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 `listDependenciesAsync()` + * 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. + */ + listDependenciesStream( + request?: protos.google.cloud.apihub.v1.IListDependenciesRequest, + 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['listDependencies']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listDependencies.createStream( + this.innerApiCalls.listDependencies as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listDependencies`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent which owns this collection of dependency resources. + * Format: `projects/{project}/locations/{location}` + * @param {string} [request.filter] + * Optional. An expression that filters the list of Dependencies. + * + * A filter expression consists of a field name, a comparison operator, and + * a value for filtering. The value must be a string. Allowed comparison + * operator is `=`. Filters are not case sensitive. + * + * The following fields in the `Dependency` are eligible for filtering: + * + * * `consumer.operation_resource_name` - The operation resource name for + * the consumer entity involved in a dependency. Allowed comparison + * operators: `=`. + * * `consumer.external_api_resource_name` - The external api resource name + * for the consumer entity involved in a dependency. Allowed comparison + * operators: `=`. + * * `supplier.operation_resource_name` - The operation resource name for + * the supplier entity involved in a dependency. Allowed comparison + * operators: `=`. + * * `supplier.external_api_resource_name` - The external api resource name + * for the supplier entity involved in a dependency. Allowed comparison + * operators: `=`. + * + * Expressions are combined with either `AND` logic operator or `OR` logical + * operator but not both of them together i.e. only one of the `AND` or `OR` + * operator can be used throughout the filter string and both the operators + * cannot be used together. No other logical operators are supported. At most + * three filter fields are allowed in the filter string and if provided + * more than that then `INVALID_ARGUMENT` error is returned by the API. + * + * For example, `consumer.operation_resource_name = + * \"projects/p1/locations/global/apis/a1/versions/v1/operations/o1\" OR + * supplier.operation_resource_name = + * \"projects/p1/locations/global/apis/a1/versions/v1/operations/o1\"` - The + * dependencies with either consumer or supplier operation resource name as + * _projects/p1/locations/global/apis/a1/versions/v1/operations/o1_. + * @param {number} [request.pageSize] + * Optional. The maximum number of dependency resources to return. The service + * may return fewer than this value. If unspecified, at most 50 dependencies + * will be returned. The maximum value is 1000; values above 1000 will be + * coerced to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListDependencies` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListDependencies` must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@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.apihub.v1.Dependency|Dependency}. 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/api_hub_dependencies.list_dependencies.js + * region_tag:apihub_v1_generated_ApiHubDependencies_ListDependencies_async + */ + listDependenciesAsync( + request?: protos.google.cloud.apihub.v1.IListDependenciesRequest, + 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['listDependencies']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listDependencies.asyncIterate( + this.innerApiCalls['listDependencies'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } +/** + * 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); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified api resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @returns {string} Resource name string. + */ + apiPath(project:string,location:string,api:string) { + return this.pathTemplates.apiPathTemplate.render({ + project: project, + location: location, + api: api, + }); + } + + /** + * Parse the project from Api resource. + * + * @param {string} apiName + * A fully-qualified path representing Api resource. + * @returns {string} A string representing the project. + */ + matchProjectFromApiName(apiName: string) { + return this.pathTemplates.apiPathTemplate.match(apiName).project; + } + + /** + * Parse the location from Api resource. + * + * @param {string} apiName + * A fully-qualified path representing Api resource. + * @returns {string} A string representing the location. + */ + matchLocationFromApiName(apiName: string) { + return this.pathTemplates.apiPathTemplate.match(apiName).location; + } + + /** + * Parse the api from Api resource. + * + * @param {string} apiName + * A fully-qualified path representing Api resource. + * @returns {string} A string representing the api. + */ + matchApiFromApiName(apiName: string) { + return this.pathTemplates.apiPathTemplate.match(apiName).api; + } + + /** + * Return a fully-qualified apiHubInstance resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api_hub_instance + * @returns {string} Resource name string. + */ + apiHubInstancePath(project:string,location:string,apiHubInstance:string) { + return this.pathTemplates.apiHubInstancePathTemplate.render({ + project: project, + location: location, + api_hub_instance: apiHubInstance, + }); + } + + /** + * Parse the project from ApiHubInstance resource. + * + * @param {string} apiHubInstanceName + * A fully-qualified path representing ApiHubInstance resource. + * @returns {string} A string representing the project. + */ + matchProjectFromApiHubInstanceName(apiHubInstanceName: string) { + return this.pathTemplates.apiHubInstancePathTemplate.match(apiHubInstanceName).project; + } + + /** + * Parse the location from ApiHubInstance resource. + * + * @param {string} apiHubInstanceName + * A fully-qualified path representing ApiHubInstance resource. + * @returns {string} A string representing the location. + */ + matchLocationFromApiHubInstanceName(apiHubInstanceName: string) { + return this.pathTemplates.apiHubInstancePathTemplate.match(apiHubInstanceName).location; + } + + /** + * Parse the api_hub_instance from ApiHubInstance resource. + * + * @param {string} apiHubInstanceName + * A fully-qualified path representing ApiHubInstance resource. + * @returns {string} A string representing the api_hub_instance. + */ + matchApiHubInstanceFromApiHubInstanceName(apiHubInstanceName: string) { + return this.pathTemplates.apiHubInstancePathTemplate.match(apiHubInstanceName).api_hub_instance; + } + + /** + * Return a fully-qualified apiOperation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @param {string} version + * @param {string} operation + * @returns {string} Resource name string. + */ + apiOperationPath(project:string,location:string,api:string,version:string,operation:string) { + return this.pathTemplates.apiOperationPathTemplate.render({ + project: project, + location: location, + api: api, + version: version, + operation: operation, + }); + } + + /** + * Parse the project from ApiOperation resource. + * + * @param {string} apiOperationName + * A fully-qualified path representing ApiOperation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromApiOperationName(apiOperationName: string) { + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).project; + } + + /** + * Parse the location from ApiOperation resource. + * + * @param {string} apiOperationName + * A fully-qualified path representing ApiOperation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromApiOperationName(apiOperationName: string) { + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).location; + } + + /** + * Parse the api from ApiOperation resource. + * + * @param {string} apiOperationName + * A fully-qualified path representing ApiOperation resource. + * @returns {string} A string representing the api. + */ + matchApiFromApiOperationName(apiOperationName: string) { + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).api; + } + + /** + * Parse the version from ApiOperation resource. + * + * @param {string} apiOperationName + * A fully-qualified path representing ApiOperation resource. + * @returns {string} A string representing the version. + */ + matchVersionFromApiOperationName(apiOperationName: string) { + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).version; + } + + /** + * Parse the operation from ApiOperation resource. + * + * @param {string} apiOperationName + * A fully-qualified path representing ApiOperation resource. + * @returns {string} A string representing the operation. + */ + matchOperationFromApiOperationName(apiOperationName: string) { + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).operation; + } + + /** + * Return a fully-qualified attribute resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} attribute + * @returns {string} Resource name string. + */ + attributePath(project:string,location:string,attribute:string) { + return this.pathTemplates.attributePathTemplate.render({ + project: project, + location: location, + attribute: attribute, + }); + } + + /** + * Parse the project from Attribute resource. + * + * @param {string} attributeName + * A fully-qualified path representing Attribute resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAttributeName(attributeName: string) { + return this.pathTemplates.attributePathTemplate.match(attributeName).project; + } + + /** + * Parse the location from Attribute resource. + * + * @param {string} attributeName + * A fully-qualified path representing Attribute resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAttributeName(attributeName: string) { + return this.pathTemplates.attributePathTemplate.match(attributeName).location; + } + + /** + * Parse the attribute from Attribute resource. + * + * @param {string} attributeName + * A fully-qualified path representing Attribute resource. + * @returns {string} A string representing the attribute. + */ + matchAttributeFromAttributeName(attributeName: string) { + return this.pathTemplates.attributePathTemplate.match(attributeName).attribute; + } + + /** + * Return a fully-qualified definition resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @param {string} version + * @param {string} definition + * @returns {string} Resource name string. + */ + definitionPath(project:string,location:string,api:string,version:string,definition:string) { + return this.pathTemplates.definitionPathTemplate.render({ + project: project, + location: location, + api: api, + version: version, + definition: definition, + }); + } + + /** + * Parse the project from Definition resource. + * + * @param {string} definitionName + * A fully-qualified path representing Definition resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDefinitionName(definitionName: string) { + return this.pathTemplates.definitionPathTemplate.match(definitionName).project; + } + + /** + * Parse the location from Definition resource. + * + * @param {string} definitionName + * A fully-qualified path representing Definition resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDefinitionName(definitionName: string) { + return this.pathTemplates.definitionPathTemplate.match(definitionName).location; + } + + /** + * Parse the api from Definition resource. + * + * @param {string} definitionName + * A fully-qualified path representing Definition resource. + * @returns {string} A string representing the api. + */ + matchApiFromDefinitionName(definitionName: string) { + return this.pathTemplates.definitionPathTemplate.match(definitionName).api; + } + + /** + * Parse the version from Definition resource. + * + * @param {string} definitionName + * A fully-qualified path representing Definition resource. + * @returns {string} A string representing the version. + */ + matchVersionFromDefinitionName(definitionName: string) { + return this.pathTemplates.definitionPathTemplate.match(definitionName).version; + } + + /** + * Parse the definition from Definition resource. + * + * @param {string} definitionName + * A fully-qualified path representing Definition resource. + * @returns {string} A string representing the definition. + */ + matchDefinitionFromDefinitionName(definitionName: string) { + return this.pathTemplates.definitionPathTemplate.match(definitionName).definition; + } + + /** + * Return a fully-qualified dependency resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dependency + * @returns {string} Resource name string. + */ + dependencyPath(project:string,location:string,dependency:string) { + return this.pathTemplates.dependencyPathTemplate.render({ + project: project, + location: location, + dependency: dependency, + }); + } + + /** + * Parse the project from Dependency resource. + * + * @param {string} dependencyName + * A fully-qualified path representing Dependency resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDependencyName(dependencyName: string) { + return this.pathTemplates.dependencyPathTemplate.match(dependencyName).project; + } + + /** + * Parse the location from Dependency resource. + * + * @param {string} dependencyName + * A fully-qualified path representing Dependency resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDependencyName(dependencyName: string) { + return this.pathTemplates.dependencyPathTemplate.match(dependencyName).location; + } + + /** + * Parse the dependency from Dependency resource. + * + * @param {string} dependencyName + * A fully-qualified path representing Dependency resource. + * @returns {string} A string representing the dependency. + */ + matchDependencyFromDependencyName(dependencyName: string) { + return this.pathTemplates.dependencyPathTemplate.match(dependencyName).dependency; + } + + /** + * Return a fully-qualified deployment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} deployment + * @returns {string} Resource name string. + */ + deploymentPath(project:string,location:string,deployment:string) { + return this.pathTemplates.deploymentPathTemplate.render({ + project: project, + location: location, + deployment: deployment, + }); + } + + /** + * Parse the project from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName).project; + } + + /** + * Parse the location from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName).location; + } + + /** + * Parse the deployment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the deployment. + */ + matchDeploymentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName).deployment; + } + + /** + * Return a fully-qualified externalApi resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} external_api + * @returns {string} Resource name string. + */ + externalApiPath(project:string,location:string,externalApi:string) { + return this.pathTemplates.externalApiPathTemplate.render({ + project: project, + location: location, + external_api: externalApi, + }); + } + + /** + * Parse the project from ExternalApi resource. + * + * @param {string} externalApiName + * A fully-qualified path representing ExternalApi resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExternalApiName(externalApiName: string) { + return this.pathTemplates.externalApiPathTemplate.match(externalApiName).project; + } + + /** + * Parse the location from ExternalApi resource. + * + * @param {string} externalApiName + * A fully-qualified path representing ExternalApi resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExternalApiName(externalApiName: string) { + return this.pathTemplates.externalApiPathTemplate.match(externalApiName).location; + } + + /** + * Parse the external_api from ExternalApi resource. + * + * @param {string} externalApiName + * A fully-qualified path representing ExternalApi resource. + * @returns {string} A string representing the external_api. + */ + matchExternalApiFromExternalApiName(externalApiName: string) { + return this.pathTemplates.externalApiPathTemplate.match(externalApiName).external_api; + } + + /** + * Return a fully-qualified hostProjectRegistration resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} host_project_registration + * @returns {string} Resource name string. + */ + hostProjectRegistrationPath(project:string,location:string,hostProjectRegistration:string) { + return this.pathTemplates.hostProjectRegistrationPathTemplate.render({ + project: project, + location: location, + host_project_registration: hostProjectRegistration, + }); + } + + /** + * Parse the project from HostProjectRegistration resource. + * + * @param {string} hostProjectRegistrationName + * A fully-qualified path representing HostProjectRegistration resource. + * @returns {string} A string representing the project. + */ + matchProjectFromHostProjectRegistrationName(hostProjectRegistrationName: string) { + return this.pathTemplates.hostProjectRegistrationPathTemplate.match(hostProjectRegistrationName).project; + } + + /** + * Parse the location from HostProjectRegistration resource. + * + * @param {string} hostProjectRegistrationName + * A fully-qualified path representing HostProjectRegistration resource. + * @returns {string} A string representing the location. + */ + matchLocationFromHostProjectRegistrationName(hostProjectRegistrationName: string) { + return this.pathTemplates.hostProjectRegistrationPathTemplate.match(hostProjectRegistrationName).location; + } + + /** + * Parse the host_project_registration from HostProjectRegistration resource. + * + * @param {string} hostProjectRegistrationName + * A fully-qualified path representing HostProjectRegistration resource. + * @returns {string} A string representing the host_project_registration. + */ + matchHostProjectRegistrationFromHostProjectRegistrationName(hostProjectRegistrationName: string) { + return this.pathTemplates.hostProjectRegistrationPathTemplate.match(hostProjectRegistrationName).host_project_registration; + } + + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project:string,location:string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + + /** + * Return a fully-qualified plugin resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} plugin + * @returns {string} Resource name string. + */ + pluginPath(project:string,location:string,plugin:string) { + return this.pathTemplates.pluginPathTemplate.render({ + project: project, + location: location, + plugin: plugin, + }); + } + + /** + * Parse the project from Plugin resource. + * + * @param {string} pluginName + * A fully-qualified path representing Plugin resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPluginName(pluginName: string) { + return this.pathTemplates.pluginPathTemplate.match(pluginName).project; + } + + /** + * Parse the location from Plugin resource. + * + * @param {string} pluginName + * A fully-qualified path representing Plugin resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPluginName(pluginName: string) { + return this.pathTemplates.pluginPathTemplate.match(pluginName).location; + } + + /** + * Parse the plugin from Plugin resource. + * + * @param {string} pluginName + * A fully-qualified path representing Plugin resource. + * @returns {string} A string representing the plugin. + */ + matchPluginFromPluginName(pluginName: string) { + return this.pathTemplates.pluginPathTemplate.match(pluginName).plugin; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project:string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified runtimeProjectAttachment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} runtime_project_attachment + * @returns {string} Resource name string. + */ + runtimeProjectAttachmentPath(project:string,location:string,runtimeProjectAttachment:string) { + return this.pathTemplates.runtimeProjectAttachmentPathTemplate.render({ + project: project, + location: location, + runtime_project_attachment: runtimeProjectAttachment, + }); + } + + /** + * Parse the project from RuntimeProjectAttachment resource. + * + * @param {string} runtimeProjectAttachmentName + * A fully-qualified path representing RuntimeProjectAttachment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRuntimeProjectAttachmentName(runtimeProjectAttachmentName: string) { + return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match(runtimeProjectAttachmentName).project; + } + + /** + * Parse the location from RuntimeProjectAttachment resource. + * + * @param {string} runtimeProjectAttachmentName + * A fully-qualified path representing RuntimeProjectAttachment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRuntimeProjectAttachmentName(runtimeProjectAttachmentName: string) { + return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match(runtimeProjectAttachmentName).location; + } + + /** + * Parse the runtime_project_attachment from RuntimeProjectAttachment resource. + * + * @param {string} runtimeProjectAttachmentName + * A fully-qualified path representing RuntimeProjectAttachment resource. + * @returns {string} A string representing the runtime_project_attachment. + */ + matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName(runtimeProjectAttachmentName: string) { + return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match(runtimeProjectAttachmentName).runtime_project_attachment; + } + + /** + * Return a fully-qualified spec resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @param {string} version + * @param {string} spec + * @returns {string} Resource name string. + */ + specPath(project:string,location:string,api:string,version:string,spec:string) { + return this.pathTemplates.specPathTemplate.render({ + project: project, + location: location, + api: api, + version: version, + spec: spec, + }); + } + + /** + * Parse the project from Spec resource. + * + * @param {string} specName + * A fully-qualified path representing Spec resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSpecName(specName: string) { + return this.pathTemplates.specPathTemplate.match(specName).project; + } + + /** + * Parse the location from Spec resource. + * + * @param {string} specName + * A fully-qualified path representing Spec resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSpecName(specName: string) { + return this.pathTemplates.specPathTemplate.match(specName).location; + } + + /** + * Parse the api from Spec resource. + * + * @param {string} specName + * A fully-qualified path representing Spec resource. + * @returns {string} A string representing the api. + */ + matchApiFromSpecName(specName: string) { + return this.pathTemplates.specPathTemplate.match(specName).api; + } + + /** + * Parse the version from Spec resource. + * + * @param {string} specName + * A fully-qualified path representing Spec resource. + * @returns {string} A string representing the version. + */ + matchVersionFromSpecName(specName: string) { + return this.pathTemplates.specPathTemplate.match(specName).version; + } + + /** + * Parse the spec from Spec resource. + * + * @param {string} specName + * A fully-qualified path representing Spec resource. + * @returns {string} A string representing the spec. + */ + matchSpecFromSpecName(specName: string) { + return this.pathTemplates.specPathTemplate.match(specName).spec; + } + + /** + * Return a fully-qualified styleGuide resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} plugin + * @returns {string} Resource name string. + */ + styleGuidePath(project:string,location:string,plugin:string) { + return this.pathTemplates.styleGuidePathTemplate.render({ + project: project, + location: location, + plugin: plugin, + }); + } + + /** + * Parse the project from StyleGuide resource. + * + * @param {string} styleGuideName + * A fully-qualified path representing StyleGuide resource. + * @returns {string} A string representing the project. + */ + matchProjectFromStyleGuideName(styleGuideName: string) { + return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName).project; + } + + /** + * Parse the location from StyleGuide resource. + * + * @param {string} styleGuideName + * A fully-qualified path representing StyleGuide resource. + * @returns {string} A string representing the location. + */ + matchLocationFromStyleGuideName(styleGuideName: string) { + return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName).location; + } + + /** + * Parse the plugin from StyleGuide resource. + * + * @param {string} styleGuideName + * A fully-qualified path representing StyleGuide resource. + * @returns {string} A string representing the plugin. + */ + matchPluginFromStyleGuideName(styleGuideName: string) { + return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName).plugin; + } + + /** + * Return a fully-qualified version resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @param {string} version + * @returns {string} Resource name string. + */ + versionPath(project:string,location:string,api:string,version:string) { + return this.pathTemplates.versionPathTemplate.render({ + project: project, + location: location, + api: api, + version: version, + }); + } + + /** + * Parse the project from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the project. + */ + matchProjectFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).project; + } + + /** + * Parse the location from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the location. + */ + matchLocationFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).location; + } + + /** + * Parse the api from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the api. + */ + matchApiFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).api; + } + + /** + * Parse the version from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the version. + */ + matchVersionFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).version; + } + + /** + * 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.apiHubDependenciesStub && !this._terminated) { + return this.apiHubDependenciesStub.then(stub => { + this._terminated = true; + stub.close(); + this.locationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_dependencies_client_config.json b/owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_dependencies_client_config.json new file mode 100644 index 00000000000..eade2c78f29 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_dependencies_client_config.json @@ -0,0 +1,63 @@ +{ + "interfaces": { + "google.cloud.apihub.v1.ApiHubDependencies": { + "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": { + "CreateDependency": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetDependency": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "UpdateDependency": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteDependency": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListDependencies": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_dependencies_proto_list.json b/owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_dependencies_proto_list.json new file mode 100644 index 00000000000..07e987f7fb3 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_dependencies_proto_list.json @@ -0,0 +1,9 @@ +[ + "../../protos/google/cloud/apihub/v1/apihub_service.proto", + "../../protos/google/cloud/apihub/v1/common_fields.proto", + "../../protos/google/cloud/apihub/v1/host_project_registration_service.proto", + "../../protos/google/cloud/apihub/v1/linting_service.proto", + "../../protos/google/cloud/apihub/v1/plugin_service.proto", + "../../protos/google/cloud/apihub/v1/provisioning_service.proto", + "../../protos/google/cloud/apihub/v1/runtime_project_attachment_service.proto" +] diff --git a/owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_plugin_client.ts b/owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_plugin_client.ts new file mode 100644 index 00000000000..55eea0843ee --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_plugin_client.ts @@ -0,0 +1,1469 @@ +// Copyright 2024 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, LocationsClient, LocationProtos} from 'google-gax'; + +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); + +/** + * Client JSON configuration object, loaded from + * `src/v1/api_hub_plugin_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './api_hub_plugin_client_config.json'; +const version = require('../../../package.json').version; + +/** + * This service is used for managing plugins inside the API Hub. + * @class + * @memberof v1 + */ +export class ApiHubPluginClient { + 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}; + private _universeDomain: string; + private _servicePath: string; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + locationsClient: LocationsClient; + pathTemplates: {[name: string]: gax.PathTemplate}; + apiHubPluginStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of ApiHubPluginClient. + * + * @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 ApiHubPluginClient({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 ApiHubPluginClient; + if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { + throw new Error('Please set either universe_domain or universeDomain, but not both.'); + } + const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; + this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; + this._servicePath = 'apihub.' + this._universeDomain; + const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). + if (!opts) { + opts = {fallback: true}; + } else { + opts.fallback = opts.fallback ?? true; + } + 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 !== this._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 = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + 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 === 'object' && '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 = { + apiPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}' + ), + apiHubInstancePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apiHubInstances/{api_hub_instance}' + ), + apiOperationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}' + ), + attributePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/attributes/{attribute}' + ), + definitionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}' + ), + dependencyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/dependencies/{dependency}' + ), + deploymentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/deployments/{deployment}' + ), + externalApiPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/externalApis/{external_api}' + ), + hostProjectRegistrationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/hostProjectRegistrations/{host_project_registration}' + ), + pluginPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/plugins/{plugin}' + ), + runtimeProjectAttachmentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}' + ), + specPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}' + ), + styleGuidePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/plugins/{plugin}/styleGuide' + ), + versionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}/versions/{version}' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.apihub.v1.ApiHubPlugin', 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.apiHubPluginStub) { + return this.apiHubPluginStub; + } + + // Put together the "service stub" for + // google.cloud.apihub.v1.ApiHubPlugin. + this.apiHubPluginStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.apihub.v1.ApiHubPlugin') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.apihub.v1.ApiHubPlugin, + 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 apiHubPluginStubMethods = + ['getPlugin', 'enablePlugin', 'disablePlugin']; + for (const methodName of apiHubPluginStubMethods) { + const callPromise = this.apiHubPluginStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.apiHubPluginStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'apihub.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'apihub.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * 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 -- + // ------------------- +/** + * Get details about an API Hub plugin. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the plugin to retrieve. + * Format: `projects/{project}/locations/{location}/plugins/{plugin}`. + * @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.apihub.v1.Plugin|Plugin}. + * 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/api_hub_plugin.get_plugin.js + * region_tag:apihub_v1_generated_ApiHubPlugin_GetPlugin_async + */ + getPlugin( + request?: protos.google.cloud.apihub.v1.IGetPluginRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.apihub.v1.IPlugin, + protos.google.cloud.apihub.v1.IGetPluginRequest|undefined, {}|undefined + ]>; + getPlugin( + request: protos.google.cloud.apihub.v1.IGetPluginRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.IPlugin, + protos.google.cloud.apihub.v1.IGetPluginRequest|null|undefined, + {}|null|undefined>): void; + getPlugin( + request: protos.google.cloud.apihub.v1.IGetPluginRequest, + callback: Callback< + protos.google.cloud.apihub.v1.IPlugin, + protos.google.cloud.apihub.v1.IGetPluginRequest|null|undefined, + {}|null|undefined>): void; + getPlugin( + request?: protos.google.cloud.apihub.v1.IGetPluginRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.apihub.v1.IPlugin, + protos.google.cloud.apihub.v1.IGetPluginRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.apihub.v1.IPlugin, + protos.google.cloud.apihub.v1.IGetPluginRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.apihub.v1.IPlugin, + protos.google.cloud.apihub.v1.IGetPluginRequest|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.getPlugin(request, options, callback); + } +/** + * Enables a plugin. + * The `state` of the plugin after enabling is `ENABLED` + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the plugin to enable. + * Format: `projects/{project}/locations/{location}/plugins/{plugin}`. + * @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.apihub.v1.Plugin|Plugin}. + * 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/api_hub_plugin.enable_plugin.js + * region_tag:apihub_v1_generated_ApiHubPlugin_EnablePlugin_async + */ + enablePlugin( + request?: protos.google.cloud.apihub.v1.IEnablePluginRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.apihub.v1.IPlugin, + protos.google.cloud.apihub.v1.IEnablePluginRequest|undefined, {}|undefined + ]>; + enablePlugin( + request: protos.google.cloud.apihub.v1.IEnablePluginRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.IPlugin, + protos.google.cloud.apihub.v1.IEnablePluginRequest|null|undefined, + {}|null|undefined>): void; + enablePlugin( + request: protos.google.cloud.apihub.v1.IEnablePluginRequest, + callback: Callback< + protos.google.cloud.apihub.v1.IPlugin, + protos.google.cloud.apihub.v1.IEnablePluginRequest|null|undefined, + {}|null|undefined>): void; + enablePlugin( + request?: protos.google.cloud.apihub.v1.IEnablePluginRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.apihub.v1.IPlugin, + protos.google.cloud.apihub.v1.IEnablePluginRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.apihub.v1.IPlugin, + protos.google.cloud.apihub.v1.IEnablePluginRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.apihub.v1.IPlugin, + protos.google.cloud.apihub.v1.IEnablePluginRequest|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.enablePlugin(request, options, callback); + } +/** + * Disables a plugin. + * The `state` of the plugin after disabling is `DISABLED` + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the plugin to disable. + * Format: `projects/{project}/locations/{location}/plugins/{plugin}`. + * @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.apihub.v1.Plugin|Plugin}. + * 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/api_hub_plugin.disable_plugin.js + * region_tag:apihub_v1_generated_ApiHubPlugin_DisablePlugin_async + */ + disablePlugin( + request?: protos.google.cloud.apihub.v1.IDisablePluginRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.apihub.v1.IPlugin, + protos.google.cloud.apihub.v1.IDisablePluginRequest|undefined, {}|undefined + ]>; + disablePlugin( + request: protos.google.cloud.apihub.v1.IDisablePluginRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.IPlugin, + protos.google.cloud.apihub.v1.IDisablePluginRequest|null|undefined, + {}|null|undefined>): void; + disablePlugin( + request: protos.google.cloud.apihub.v1.IDisablePluginRequest, + callback: Callback< + protos.google.cloud.apihub.v1.IPlugin, + protos.google.cloud.apihub.v1.IDisablePluginRequest|null|undefined, + {}|null|undefined>): void; + disablePlugin( + request?: protos.google.cloud.apihub.v1.IDisablePluginRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.apihub.v1.IPlugin, + protos.google.cloud.apihub.v1.IDisablePluginRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.apihub.v1.IPlugin, + protos.google.cloud.apihub.v1.IDisablePluginRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.apihub.v1.IPlugin, + protos.google.cloud.apihub.v1.IDisablePluginRequest|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.disablePlugin(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); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified api resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @returns {string} Resource name string. + */ + apiPath(project:string,location:string,api:string) { + return this.pathTemplates.apiPathTemplate.render({ + project: project, + location: location, + api: api, + }); + } + + /** + * Parse the project from Api resource. + * + * @param {string} apiName + * A fully-qualified path representing Api resource. + * @returns {string} A string representing the project. + */ + matchProjectFromApiName(apiName: string) { + return this.pathTemplates.apiPathTemplate.match(apiName).project; + } + + /** + * Parse the location from Api resource. + * + * @param {string} apiName + * A fully-qualified path representing Api resource. + * @returns {string} A string representing the location. + */ + matchLocationFromApiName(apiName: string) { + return this.pathTemplates.apiPathTemplate.match(apiName).location; + } + + /** + * Parse the api from Api resource. + * + * @param {string} apiName + * A fully-qualified path representing Api resource. + * @returns {string} A string representing the api. + */ + matchApiFromApiName(apiName: string) { + return this.pathTemplates.apiPathTemplate.match(apiName).api; + } + + /** + * Return a fully-qualified apiHubInstance resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api_hub_instance + * @returns {string} Resource name string. + */ + apiHubInstancePath(project:string,location:string,apiHubInstance:string) { + return this.pathTemplates.apiHubInstancePathTemplate.render({ + project: project, + location: location, + api_hub_instance: apiHubInstance, + }); + } + + /** + * Parse the project from ApiHubInstance resource. + * + * @param {string} apiHubInstanceName + * A fully-qualified path representing ApiHubInstance resource. + * @returns {string} A string representing the project. + */ + matchProjectFromApiHubInstanceName(apiHubInstanceName: string) { + return this.pathTemplates.apiHubInstancePathTemplate.match(apiHubInstanceName).project; + } + + /** + * Parse the location from ApiHubInstance resource. + * + * @param {string} apiHubInstanceName + * A fully-qualified path representing ApiHubInstance resource. + * @returns {string} A string representing the location. + */ + matchLocationFromApiHubInstanceName(apiHubInstanceName: string) { + return this.pathTemplates.apiHubInstancePathTemplate.match(apiHubInstanceName).location; + } + + /** + * Parse the api_hub_instance from ApiHubInstance resource. + * + * @param {string} apiHubInstanceName + * A fully-qualified path representing ApiHubInstance resource. + * @returns {string} A string representing the api_hub_instance. + */ + matchApiHubInstanceFromApiHubInstanceName(apiHubInstanceName: string) { + return this.pathTemplates.apiHubInstancePathTemplate.match(apiHubInstanceName).api_hub_instance; + } + + /** + * Return a fully-qualified apiOperation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @param {string} version + * @param {string} operation + * @returns {string} Resource name string. + */ + apiOperationPath(project:string,location:string,api:string,version:string,operation:string) { + return this.pathTemplates.apiOperationPathTemplate.render({ + project: project, + location: location, + api: api, + version: version, + operation: operation, + }); + } + + /** + * Parse the project from ApiOperation resource. + * + * @param {string} apiOperationName + * A fully-qualified path representing ApiOperation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromApiOperationName(apiOperationName: string) { + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).project; + } + + /** + * Parse the location from ApiOperation resource. + * + * @param {string} apiOperationName + * A fully-qualified path representing ApiOperation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromApiOperationName(apiOperationName: string) { + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).location; + } + + /** + * Parse the api from ApiOperation resource. + * + * @param {string} apiOperationName + * A fully-qualified path representing ApiOperation resource. + * @returns {string} A string representing the api. + */ + matchApiFromApiOperationName(apiOperationName: string) { + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).api; + } + + /** + * Parse the version from ApiOperation resource. + * + * @param {string} apiOperationName + * A fully-qualified path representing ApiOperation resource. + * @returns {string} A string representing the version. + */ + matchVersionFromApiOperationName(apiOperationName: string) { + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).version; + } + + /** + * Parse the operation from ApiOperation resource. + * + * @param {string} apiOperationName + * A fully-qualified path representing ApiOperation resource. + * @returns {string} A string representing the operation. + */ + matchOperationFromApiOperationName(apiOperationName: string) { + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).operation; + } + + /** + * Return a fully-qualified attribute resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} attribute + * @returns {string} Resource name string. + */ + attributePath(project:string,location:string,attribute:string) { + return this.pathTemplates.attributePathTemplate.render({ + project: project, + location: location, + attribute: attribute, + }); + } + + /** + * Parse the project from Attribute resource. + * + * @param {string} attributeName + * A fully-qualified path representing Attribute resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAttributeName(attributeName: string) { + return this.pathTemplates.attributePathTemplate.match(attributeName).project; + } + + /** + * Parse the location from Attribute resource. + * + * @param {string} attributeName + * A fully-qualified path representing Attribute resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAttributeName(attributeName: string) { + return this.pathTemplates.attributePathTemplate.match(attributeName).location; + } + + /** + * Parse the attribute from Attribute resource. + * + * @param {string} attributeName + * A fully-qualified path representing Attribute resource. + * @returns {string} A string representing the attribute. + */ + matchAttributeFromAttributeName(attributeName: string) { + return this.pathTemplates.attributePathTemplate.match(attributeName).attribute; + } + + /** + * Return a fully-qualified definition resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @param {string} version + * @param {string} definition + * @returns {string} Resource name string. + */ + definitionPath(project:string,location:string,api:string,version:string,definition:string) { + return this.pathTemplates.definitionPathTemplate.render({ + project: project, + location: location, + api: api, + version: version, + definition: definition, + }); + } + + /** + * Parse the project from Definition resource. + * + * @param {string} definitionName + * A fully-qualified path representing Definition resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDefinitionName(definitionName: string) { + return this.pathTemplates.definitionPathTemplate.match(definitionName).project; + } + + /** + * Parse the location from Definition resource. + * + * @param {string} definitionName + * A fully-qualified path representing Definition resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDefinitionName(definitionName: string) { + return this.pathTemplates.definitionPathTemplate.match(definitionName).location; + } + + /** + * Parse the api from Definition resource. + * + * @param {string} definitionName + * A fully-qualified path representing Definition resource. + * @returns {string} A string representing the api. + */ + matchApiFromDefinitionName(definitionName: string) { + return this.pathTemplates.definitionPathTemplate.match(definitionName).api; + } + + /** + * Parse the version from Definition resource. + * + * @param {string} definitionName + * A fully-qualified path representing Definition resource. + * @returns {string} A string representing the version. + */ + matchVersionFromDefinitionName(definitionName: string) { + return this.pathTemplates.definitionPathTemplate.match(definitionName).version; + } + + /** + * Parse the definition from Definition resource. + * + * @param {string} definitionName + * A fully-qualified path representing Definition resource. + * @returns {string} A string representing the definition. + */ + matchDefinitionFromDefinitionName(definitionName: string) { + return this.pathTemplates.definitionPathTemplate.match(definitionName).definition; + } + + /** + * Return a fully-qualified dependency resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dependency + * @returns {string} Resource name string. + */ + dependencyPath(project:string,location:string,dependency:string) { + return this.pathTemplates.dependencyPathTemplate.render({ + project: project, + location: location, + dependency: dependency, + }); + } + + /** + * Parse the project from Dependency resource. + * + * @param {string} dependencyName + * A fully-qualified path representing Dependency resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDependencyName(dependencyName: string) { + return this.pathTemplates.dependencyPathTemplate.match(dependencyName).project; + } + + /** + * Parse the location from Dependency resource. + * + * @param {string} dependencyName + * A fully-qualified path representing Dependency resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDependencyName(dependencyName: string) { + return this.pathTemplates.dependencyPathTemplate.match(dependencyName).location; + } + + /** + * Parse the dependency from Dependency resource. + * + * @param {string} dependencyName + * A fully-qualified path representing Dependency resource. + * @returns {string} A string representing the dependency. + */ + matchDependencyFromDependencyName(dependencyName: string) { + return this.pathTemplates.dependencyPathTemplate.match(dependencyName).dependency; + } + + /** + * Return a fully-qualified deployment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} deployment + * @returns {string} Resource name string. + */ + deploymentPath(project:string,location:string,deployment:string) { + return this.pathTemplates.deploymentPathTemplate.render({ + project: project, + location: location, + deployment: deployment, + }); + } + + /** + * Parse the project from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName).project; + } + + /** + * Parse the location from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName).location; + } + + /** + * Parse the deployment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the deployment. + */ + matchDeploymentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName).deployment; + } + + /** + * Return a fully-qualified externalApi resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} external_api + * @returns {string} Resource name string. + */ + externalApiPath(project:string,location:string,externalApi:string) { + return this.pathTemplates.externalApiPathTemplate.render({ + project: project, + location: location, + external_api: externalApi, + }); + } + + /** + * Parse the project from ExternalApi resource. + * + * @param {string} externalApiName + * A fully-qualified path representing ExternalApi resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExternalApiName(externalApiName: string) { + return this.pathTemplates.externalApiPathTemplate.match(externalApiName).project; + } + + /** + * Parse the location from ExternalApi resource. + * + * @param {string} externalApiName + * A fully-qualified path representing ExternalApi resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExternalApiName(externalApiName: string) { + return this.pathTemplates.externalApiPathTemplate.match(externalApiName).location; + } + + /** + * Parse the external_api from ExternalApi resource. + * + * @param {string} externalApiName + * A fully-qualified path representing ExternalApi resource. + * @returns {string} A string representing the external_api. + */ + matchExternalApiFromExternalApiName(externalApiName: string) { + return this.pathTemplates.externalApiPathTemplate.match(externalApiName).external_api; + } + + /** + * Return a fully-qualified hostProjectRegistration resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} host_project_registration + * @returns {string} Resource name string. + */ + hostProjectRegistrationPath(project:string,location:string,hostProjectRegistration:string) { + return this.pathTemplates.hostProjectRegistrationPathTemplate.render({ + project: project, + location: location, + host_project_registration: hostProjectRegistration, + }); + } + + /** + * Parse the project from HostProjectRegistration resource. + * + * @param {string} hostProjectRegistrationName + * A fully-qualified path representing HostProjectRegistration resource. + * @returns {string} A string representing the project. + */ + matchProjectFromHostProjectRegistrationName(hostProjectRegistrationName: string) { + return this.pathTemplates.hostProjectRegistrationPathTemplate.match(hostProjectRegistrationName).project; + } + + /** + * Parse the location from HostProjectRegistration resource. + * + * @param {string} hostProjectRegistrationName + * A fully-qualified path representing HostProjectRegistration resource. + * @returns {string} A string representing the location. + */ + matchLocationFromHostProjectRegistrationName(hostProjectRegistrationName: string) { + return this.pathTemplates.hostProjectRegistrationPathTemplate.match(hostProjectRegistrationName).location; + } + + /** + * Parse the host_project_registration from HostProjectRegistration resource. + * + * @param {string} hostProjectRegistrationName + * A fully-qualified path representing HostProjectRegistration resource. + * @returns {string} A string representing the host_project_registration. + */ + matchHostProjectRegistrationFromHostProjectRegistrationName(hostProjectRegistrationName: string) { + return this.pathTemplates.hostProjectRegistrationPathTemplate.match(hostProjectRegistrationName).host_project_registration; + } + + /** + * Return a fully-qualified plugin resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} plugin + * @returns {string} Resource name string. + */ + pluginPath(project:string,location:string,plugin:string) { + return this.pathTemplates.pluginPathTemplate.render({ + project: project, + location: location, + plugin: plugin, + }); + } + + /** + * Parse the project from Plugin resource. + * + * @param {string} pluginName + * A fully-qualified path representing Plugin resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPluginName(pluginName: string) { + return this.pathTemplates.pluginPathTemplate.match(pluginName).project; + } + + /** + * Parse the location from Plugin resource. + * + * @param {string} pluginName + * A fully-qualified path representing Plugin resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPluginName(pluginName: string) { + return this.pathTemplates.pluginPathTemplate.match(pluginName).location; + } + + /** + * Parse the plugin from Plugin resource. + * + * @param {string} pluginName + * A fully-qualified path representing Plugin resource. + * @returns {string} A string representing the plugin. + */ + matchPluginFromPluginName(pluginName: string) { + return this.pathTemplates.pluginPathTemplate.match(pluginName).plugin; + } + + /** + * Return a fully-qualified runtimeProjectAttachment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} runtime_project_attachment + * @returns {string} Resource name string. + */ + runtimeProjectAttachmentPath(project:string,location:string,runtimeProjectAttachment:string) { + return this.pathTemplates.runtimeProjectAttachmentPathTemplate.render({ + project: project, + location: location, + runtime_project_attachment: runtimeProjectAttachment, + }); + } + + /** + * Parse the project from RuntimeProjectAttachment resource. + * + * @param {string} runtimeProjectAttachmentName + * A fully-qualified path representing RuntimeProjectAttachment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRuntimeProjectAttachmentName(runtimeProjectAttachmentName: string) { + return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match(runtimeProjectAttachmentName).project; + } + + /** + * Parse the location from RuntimeProjectAttachment resource. + * + * @param {string} runtimeProjectAttachmentName + * A fully-qualified path representing RuntimeProjectAttachment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRuntimeProjectAttachmentName(runtimeProjectAttachmentName: string) { + return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match(runtimeProjectAttachmentName).location; + } + + /** + * Parse the runtime_project_attachment from RuntimeProjectAttachment resource. + * + * @param {string} runtimeProjectAttachmentName + * A fully-qualified path representing RuntimeProjectAttachment resource. + * @returns {string} A string representing the runtime_project_attachment. + */ + matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName(runtimeProjectAttachmentName: string) { + return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match(runtimeProjectAttachmentName).runtime_project_attachment; + } + + /** + * Return a fully-qualified spec resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @param {string} version + * @param {string} spec + * @returns {string} Resource name string. + */ + specPath(project:string,location:string,api:string,version:string,spec:string) { + return this.pathTemplates.specPathTemplate.render({ + project: project, + location: location, + api: api, + version: version, + spec: spec, + }); + } + + /** + * Parse the project from Spec resource. + * + * @param {string} specName + * A fully-qualified path representing Spec resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSpecName(specName: string) { + return this.pathTemplates.specPathTemplate.match(specName).project; + } + + /** + * Parse the location from Spec resource. + * + * @param {string} specName + * A fully-qualified path representing Spec resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSpecName(specName: string) { + return this.pathTemplates.specPathTemplate.match(specName).location; + } + + /** + * Parse the api from Spec resource. + * + * @param {string} specName + * A fully-qualified path representing Spec resource. + * @returns {string} A string representing the api. + */ + matchApiFromSpecName(specName: string) { + return this.pathTemplates.specPathTemplate.match(specName).api; + } + + /** + * Parse the version from Spec resource. + * + * @param {string} specName + * A fully-qualified path representing Spec resource. + * @returns {string} A string representing the version. + */ + matchVersionFromSpecName(specName: string) { + return this.pathTemplates.specPathTemplate.match(specName).version; + } + + /** + * Parse the spec from Spec resource. + * + * @param {string} specName + * A fully-qualified path representing Spec resource. + * @returns {string} A string representing the spec. + */ + matchSpecFromSpecName(specName: string) { + return this.pathTemplates.specPathTemplate.match(specName).spec; + } + + /** + * Return a fully-qualified styleGuide resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} plugin + * @returns {string} Resource name string. + */ + styleGuidePath(project:string,location:string,plugin:string) { + return this.pathTemplates.styleGuidePathTemplate.render({ + project: project, + location: location, + plugin: plugin, + }); + } + + /** + * Parse the project from StyleGuide resource. + * + * @param {string} styleGuideName + * A fully-qualified path representing StyleGuide resource. + * @returns {string} A string representing the project. + */ + matchProjectFromStyleGuideName(styleGuideName: string) { + return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName).project; + } + + /** + * Parse the location from StyleGuide resource. + * + * @param {string} styleGuideName + * A fully-qualified path representing StyleGuide resource. + * @returns {string} A string representing the location. + */ + matchLocationFromStyleGuideName(styleGuideName: string) { + return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName).location; + } + + /** + * Parse the plugin from StyleGuide resource. + * + * @param {string} styleGuideName + * A fully-qualified path representing StyleGuide resource. + * @returns {string} A string representing the plugin. + */ + matchPluginFromStyleGuideName(styleGuideName: string) { + return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName).plugin; + } + + /** + * Return a fully-qualified version resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @param {string} version + * @returns {string} Resource name string. + */ + versionPath(project:string,location:string,api:string,version:string) { + return this.pathTemplates.versionPathTemplate.render({ + project: project, + location: location, + api: api, + version: version, + }); + } + + /** + * Parse the project from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the project. + */ + matchProjectFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).project; + } + + /** + * Parse the location from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the location. + */ + matchLocationFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).location; + } + + /** + * Parse the api from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the api. + */ + matchApiFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).api; + } + + /** + * Parse the version from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the version. + */ + matchVersionFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).version; + } + + /** + * 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.apiHubPluginStub && !this._terminated) { + return this.apiHubPluginStub.then(stub => { + this._terminated = true; + stub.close(); + this.locationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_plugin_client_config.json b/owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_plugin_client_config.json new file mode 100644 index 00000000000..1627eceb991 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_plugin_client_config.json @@ -0,0 +1,53 @@ +{ + "interfaces": { + "google.cloud.apihub.v1.ApiHubPlugin": { + "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": { + "GetPlugin": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "EnablePlugin": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DisablePlugin": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_plugin_proto_list.json b/owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_plugin_proto_list.json new file mode 100644 index 00000000000..07e987f7fb3 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_plugin_proto_list.json @@ -0,0 +1,9 @@ +[ + "../../protos/google/cloud/apihub/v1/apihub_service.proto", + "../../protos/google/cloud/apihub/v1/common_fields.proto", + "../../protos/google/cloud/apihub/v1/host_project_registration_service.proto", + "../../protos/google/cloud/apihub/v1/linting_service.proto", + "../../protos/google/cloud/apihub/v1/plugin_service.proto", + "../../protos/google/cloud/apihub/v1/provisioning_service.proto", + "../../protos/google/cloud/apihub/v1/runtime_project_attachment_service.proto" +] diff --git a/owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_proto_list.json b/owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_proto_list.json new file mode 100644 index 00000000000..07e987f7fb3 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_proto_list.json @@ -0,0 +1,9 @@ +[ + "../../protos/google/cloud/apihub/v1/apihub_service.proto", + "../../protos/google/cloud/apihub/v1/common_fields.proto", + "../../protos/google/cloud/apihub/v1/host_project_registration_service.proto", + "../../protos/google/cloud/apihub/v1/linting_service.proto", + "../../protos/google/cloud/apihub/v1/plugin_service.proto", + "../../protos/google/cloud/apihub/v1/provisioning_service.proto", + "../../protos/google/cloud/apihub/v1/runtime_project_attachment_service.proto" +] diff --git a/owl-bot-staging/google-cloud-apihub/v1/src/v1/gapic_metadata.json b/owl-bot-staging/google-cloud-apihub/v1/src/v1/gapic_metadata.json new file mode 100644 index 00000000000..54b63d3eaca --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/src/v1/gapic_metadata.json @@ -0,0 +1,731 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.apihub.v1", + "libraryPackage": "@google-cloud/apihub", + "services": { + "ApiHub": { + "clients": { + "grpc": { + "libraryClient": "ApiHubClient", + "rpcs": { + "CreateApi": { + "methods": [ + "createApi" + ] + }, + "GetApi": { + "methods": [ + "getApi" + ] + }, + "UpdateApi": { + "methods": [ + "updateApi" + ] + }, + "DeleteApi": { + "methods": [ + "deleteApi" + ] + }, + "CreateVersion": { + "methods": [ + "createVersion" + ] + }, + "GetVersion": { + "methods": [ + "getVersion" + ] + }, + "UpdateVersion": { + "methods": [ + "updateVersion" + ] + }, + "DeleteVersion": { + "methods": [ + "deleteVersion" + ] + }, + "CreateSpec": { + "methods": [ + "createSpec" + ] + }, + "GetSpec": { + "methods": [ + "getSpec" + ] + }, + "GetSpecContents": { + "methods": [ + "getSpecContents" + ] + }, + "UpdateSpec": { + "methods": [ + "updateSpec" + ] + }, + "DeleteSpec": { + "methods": [ + "deleteSpec" + ] + }, + "GetApiOperation": { + "methods": [ + "getApiOperation" + ] + }, + "GetDefinition": { + "methods": [ + "getDefinition" + ] + }, + "CreateDeployment": { + "methods": [ + "createDeployment" + ] + }, + "GetDeployment": { + "methods": [ + "getDeployment" + ] + }, + "UpdateDeployment": { + "methods": [ + "updateDeployment" + ] + }, + "DeleteDeployment": { + "methods": [ + "deleteDeployment" + ] + }, + "CreateAttribute": { + "methods": [ + "createAttribute" + ] + }, + "GetAttribute": { + "methods": [ + "getAttribute" + ] + }, + "UpdateAttribute": { + "methods": [ + "updateAttribute" + ] + }, + "DeleteAttribute": { + "methods": [ + "deleteAttribute" + ] + }, + "CreateExternalApi": { + "methods": [ + "createExternalApi" + ] + }, + "GetExternalApi": { + "methods": [ + "getExternalApi" + ] + }, + "UpdateExternalApi": { + "methods": [ + "updateExternalApi" + ] + }, + "DeleteExternalApi": { + "methods": [ + "deleteExternalApi" + ] + }, + "ListApis": { + "methods": [ + "listApis", + "listApisStream", + "listApisAsync" + ] + }, + "ListVersions": { + "methods": [ + "listVersions", + "listVersionsStream", + "listVersionsAsync" + ] + }, + "ListSpecs": { + "methods": [ + "listSpecs", + "listSpecsStream", + "listSpecsAsync" + ] + }, + "ListApiOperations": { + "methods": [ + "listApiOperations", + "listApiOperationsStream", + "listApiOperationsAsync" + ] + }, + "ListDeployments": { + "methods": [ + "listDeployments", + "listDeploymentsStream", + "listDeploymentsAsync" + ] + }, + "ListAttributes": { + "methods": [ + "listAttributes", + "listAttributesStream", + "listAttributesAsync" + ] + }, + "SearchResources": { + "methods": [ + "searchResources", + "searchResourcesStream", + "searchResourcesAsync" + ] + }, + "ListExternalApis": { + "methods": [ + "listExternalApis", + "listExternalApisStream", + "listExternalApisAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "ApiHubClient", + "rpcs": { + "CreateApi": { + "methods": [ + "createApi" + ] + }, + "GetApi": { + "methods": [ + "getApi" + ] + }, + "UpdateApi": { + "methods": [ + "updateApi" + ] + }, + "DeleteApi": { + "methods": [ + "deleteApi" + ] + }, + "CreateVersion": { + "methods": [ + "createVersion" + ] + }, + "GetVersion": { + "methods": [ + "getVersion" + ] + }, + "UpdateVersion": { + "methods": [ + "updateVersion" + ] + }, + "DeleteVersion": { + "methods": [ + "deleteVersion" + ] + }, + "CreateSpec": { + "methods": [ + "createSpec" + ] + }, + "GetSpec": { + "methods": [ + "getSpec" + ] + }, + "GetSpecContents": { + "methods": [ + "getSpecContents" + ] + }, + "UpdateSpec": { + "methods": [ + "updateSpec" + ] + }, + "DeleteSpec": { + "methods": [ + "deleteSpec" + ] + }, + "GetApiOperation": { + "methods": [ + "getApiOperation" + ] + }, + "GetDefinition": { + "methods": [ + "getDefinition" + ] + }, + "CreateDeployment": { + "methods": [ + "createDeployment" + ] + }, + "GetDeployment": { + "methods": [ + "getDeployment" + ] + }, + "UpdateDeployment": { + "methods": [ + "updateDeployment" + ] + }, + "DeleteDeployment": { + "methods": [ + "deleteDeployment" + ] + }, + "CreateAttribute": { + "methods": [ + "createAttribute" + ] + }, + "GetAttribute": { + "methods": [ + "getAttribute" + ] + }, + "UpdateAttribute": { + "methods": [ + "updateAttribute" + ] + }, + "DeleteAttribute": { + "methods": [ + "deleteAttribute" + ] + }, + "CreateExternalApi": { + "methods": [ + "createExternalApi" + ] + }, + "GetExternalApi": { + "methods": [ + "getExternalApi" + ] + }, + "UpdateExternalApi": { + "methods": [ + "updateExternalApi" + ] + }, + "DeleteExternalApi": { + "methods": [ + "deleteExternalApi" + ] + }, + "ListApis": { + "methods": [ + "listApis", + "listApisStream", + "listApisAsync" + ] + }, + "ListVersions": { + "methods": [ + "listVersions", + "listVersionsStream", + "listVersionsAsync" + ] + }, + "ListSpecs": { + "methods": [ + "listSpecs", + "listSpecsStream", + "listSpecsAsync" + ] + }, + "ListApiOperations": { + "methods": [ + "listApiOperations", + "listApiOperationsStream", + "listApiOperationsAsync" + ] + }, + "ListDeployments": { + "methods": [ + "listDeployments", + "listDeploymentsStream", + "listDeploymentsAsync" + ] + }, + "ListAttributes": { + "methods": [ + "listAttributes", + "listAttributesStream", + "listAttributesAsync" + ] + }, + "SearchResources": { + "methods": [ + "searchResources", + "searchResourcesStream", + "searchResourcesAsync" + ] + }, + "ListExternalApis": { + "methods": [ + "listExternalApis", + "listExternalApisStream", + "listExternalApisAsync" + ] + } + } + } + } + }, + "ApiHubDependencies": { + "clients": { + "grpc": { + "libraryClient": "ApiHubDependenciesClient", + "rpcs": { + "CreateDependency": { + "methods": [ + "createDependency" + ] + }, + "GetDependency": { + "methods": [ + "getDependency" + ] + }, + "UpdateDependency": { + "methods": [ + "updateDependency" + ] + }, + "DeleteDependency": { + "methods": [ + "deleteDependency" + ] + }, + "ListDependencies": { + "methods": [ + "listDependencies", + "listDependenciesStream", + "listDependenciesAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "ApiHubDependenciesClient", + "rpcs": { + "CreateDependency": { + "methods": [ + "createDependency" + ] + }, + "GetDependency": { + "methods": [ + "getDependency" + ] + }, + "UpdateDependency": { + "methods": [ + "updateDependency" + ] + }, + "DeleteDependency": { + "methods": [ + "deleteDependency" + ] + }, + "ListDependencies": { + "methods": [ + "listDependencies", + "listDependenciesStream", + "listDependenciesAsync" + ] + } + } + } + } + }, + "ApiHubPlugin": { + "clients": { + "grpc": { + "libraryClient": "ApiHubPluginClient", + "rpcs": { + "GetPlugin": { + "methods": [ + "getPlugin" + ] + }, + "EnablePlugin": { + "methods": [ + "enablePlugin" + ] + }, + "DisablePlugin": { + "methods": [ + "disablePlugin" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "ApiHubPluginClient", + "rpcs": { + "GetPlugin": { + "methods": [ + "getPlugin" + ] + }, + "EnablePlugin": { + "methods": [ + "enablePlugin" + ] + }, + "DisablePlugin": { + "methods": [ + "disablePlugin" + ] + } + } + } + } + }, + "HostProjectRegistrationService": { + "clients": { + "grpc": { + "libraryClient": "HostProjectRegistrationServiceClient", + "rpcs": { + "CreateHostProjectRegistration": { + "methods": [ + "createHostProjectRegistration" + ] + }, + "GetHostProjectRegistration": { + "methods": [ + "getHostProjectRegistration" + ] + }, + "ListHostProjectRegistrations": { + "methods": [ + "listHostProjectRegistrations", + "listHostProjectRegistrationsStream", + "listHostProjectRegistrationsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "HostProjectRegistrationServiceClient", + "rpcs": { + "CreateHostProjectRegistration": { + "methods": [ + "createHostProjectRegistration" + ] + }, + "GetHostProjectRegistration": { + "methods": [ + "getHostProjectRegistration" + ] + }, + "ListHostProjectRegistrations": { + "methods": [ + "listHostProjectRegistrations", + "listHostProjectRegistrationsStream", + "listHostProjectRegistrationsAsync" + ] + } + } + } + } + }, + "LintingService": { + "clients": { + "grpc": { + "libraryClient": "LintingServiceClient", + "rpcs": { + "GetStyleGuide": { + "methods": [ + "getStyleGuide" + ] + }, + "UpdateStyleGuide": { + "methods": [ + "updateStyleGuide" + ] + }, + "GetStyleGuideContents": { + "methods": [ + "getStyleGuideContents" + ] + }, + "LintSpec": { + "methods": [ + "lintSpec" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "LintingServiceClient", + "rpcs": { + "GetStyleGuide": { + "methods": [ + "getStyleGuide" + ] + }, + "UpdateStyleGuide": { + "methods": [ + "updateStyleGuide" + ] + }, + "GetStyleGuideContents": { + "methods": [ + "getStyleGuideContents" + ] + }, + "LintSpec": { + "methods": [ + "lintSpec" + ] + } + } + } + } + }, + "Provisioning": { + "clients": { + "grpc": { + "libraryClient": "ProvisioningClient", + "rpcs": { + "GetApiHubInstance": { + "methods": [ + "getApiHubInstance" + ] + }, + "LookupApiHubInstance": { + "methods": [ + "lookupApiHubInstance" + ] + }, + "CreateApiHubInstance": { + "methods": [ + "createApiHubInstance" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "ProvisioningClient", + "rpcs": { + "GetApiHubInstance": { + "methods": [ + "getApiHubInstance" + ] + }, + "LookupApiHubInstance": { + "methods": [ + "lookupApiHubInstance" + ] + }, + "CreateApiHubInstance": { + "methods": [ + "createApiHubInstance" + ] + } + } + } + } + }, + "RuntimeProjectAttachmentService": { + "clients": { + "grpc": { + "libraryClient": "RuntimeProjectAttachmentServiceClient", + "rpcs": { + "CreateRuntimeProjectAttachment": { + "methods": [ + "createRuntimeProjectAttachment" + ] + }, + "GetRuntimeProjectAttachment": { + "methods": [ + "getRuntimeProjectAttachment" + ] + }, + "DeleteRuntimeProjectAttachment": { + "methods": [ + "deleteRuntimeProjectAttachment" + ] + }, + "LookupRuntimeProjectAttachment": { + "methods": [ + "lookupRuntimeProjectAttachment" + ] + }, + "ListRuntimeProjectAttachments": { + "methods": [ + "listRuntimeProjectAttachments", + "listRuntimeProjectAttachmentsStream", + "listRuntimeProjectAttachmentsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "RuntimeProjectAttachmentServiceClient", + "rpcs": { + "CreateRuntimeProjectAttachment": { + "methods": [ + "createRuntimeProjectAttachment" + ] + }, + "GetRuntimeProjectAttachment": { + "methods": [ + "getRuntimeProjectAttachment" + ] + }, + "DeleteRuntimeProjectAttachment": { + "methods": [ + "deleteRuntimeProjectAttachment" + ] + }, + "LookupRuntimeProjectAttachment": { + "methods": [ + "lookupRuntimeProjectAttachment" + ] + }, + "ListRuntimeProjectAttachments": { + "methods": [ + "listRuntimeProjectAttachments", + "listRuntimeProjectAttachmentsStream", + "listRuntimeProjectAttachmentsAsync" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-apihub/v1/src/v1/host_project_registration_service_client.ts b/owl-bot-staging/google-cloud-apihub/v1/src/v1/host_project_registration_service_client.ts new file mode 100644 index 00000000000..e4781db5f63 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/src/v1/host_project_registration_service_client.ts @@ -0,0 +1,1738 @@ +// Copyright 2024 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, PaginationCallback, GaxCall, 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/host_project_registration_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './host_project_registration_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * This service is used for managing the host project registrations. + * @class + * @memberof v1 + */ +export class HostProjectRegistrationServiceClient { + 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}; + private _universeDomain: string; + private _servicePath: string; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + locationsClient: LocationsClient; + pathTemplates: {[name: string]: gax.PathTemplate}; + hostProjectRegistrationServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of HostProjectRegistrationServiceClient. + * + * @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 HostProjectRegistrationServiceClient({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 HostProjectRegistrationServiceClient; + if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { + throw new Error('Please set either universe_domain or universeDomain, but not both.'); + } + const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; + this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; + this._servicePath = 'apihub.' + this._universeDomain; + const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). + if (!opts) { + opts = {fallback: true}; + } else { + opts.fallback = opts.fallback ?? true; + } + 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 !== this._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 = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + 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 === 'object' && '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 = { + apiPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}' + ), + apiHubInstancePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apiHubInstances/{api_hub_instance}' + ), + apiOperationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}' + ), + attributePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/attributes/{attribute}' + ), + definitionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}' + ), + dependencyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/dependencies/{dependency}' + ), + deploymentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/deployments/{deployment}' + ), + externalApiPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/externalApis/{external_api}' + ), + hostProjectRegistrationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/hostProjectRegistrations/{host_project_registration}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + pluginPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/plugins/{plugin}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + runtimeProjectAttachmentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}' + ), + specPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}' + ), + styleGuidePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/plugins/{plugin}/styleGuide' + ), + versionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}/versions/{version}' + ), + }; + + // 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 = { + listHostProjectRegistrations: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'hostProjectRegistrations') + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.apihub.v1.HostProjectRegistrationService', 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.hostProjectRegistrationServiceStub) { + return this.hostProjectRegistrationServiceStub; + } + + // Put together the "service stub" for + // google.cloud.apihub.v1.HostProjectRegistrationService. + this.hostProjectRegistrationServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.apihub.v1.HostProjectRegistrationService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.apihub.v1.HostProjectRegistrationService, + 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 hostProjectRegistrationServiceStubMethods = + ['createHostProjectRegistration', 'getHostProjectRegistration', 'listHostProjectRegistrations']; + for (const methodName of hostProjectRegistrationServiceStubMethods) { + const callPromise = this.hostProjectRegistrationServiceStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + this.descriptors.page[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.hostProjectRegistrationServiceStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'apihub.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'apihub.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * 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 -- + // ------------------- +/** + * Create a host project registration. + * A Google cloud project can be registered as a host project if it is not + * attached as a runtime project to another host project. + * A project can be registered as a host project only once. Subsequent + * register calls for the same project will fail. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource for the host project. + * Format: `projects/{project}/locations/{location}` + * @param {string} request.hostProjectRegistrationId + * Required. The ID to use for the Host Project Registration, which will + * become the final component of the host project registration's resource + * name. The ID must be the same as the Google cloud project specified in the + * host_project_registration.gcp_project field. + * @param {google.cloud.apihub.v1.HostProjectRegistration} request.hostProjectRegistration + * Required. The host project registration to register. + * @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.apihub.v1.HostProjectRegistration|HostProjectRegistration}. + * 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/host_project_registration_service.create_host_project_registration.js + * region_tag:apihub_v1_generated_HostProjectRegistrationService_CreateHostProjectRegistration_async + */ + createHostProjectRegistration( + request?: protos.google.cloud.apihub.v1.ICreateHostProjectRegistrationRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.apihub.v1.IHostProjectRegistration, + protos.google.cloud.apihub.v1.ICreateHostProjectRegistrationRequest|undefined, {}|undefined + ]>; + createHostProjectRegistration( + request: protos.google.cloud.apihub.v1.ICreateHostProjectRegistrationRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.IHostProjectRegistration, + protos.google.cloud.apihub.v1.ICreateHostProjectRegistrationRequest|null|undefined, + {}|null|undefined>): void; + createHostProjectRegistration( + request: protos.google.cloud.apihub.v1.ICreateHostProjectRegistrationRequest, + callback: Callback< + protos.google.cloud.apihub.v1.IHostProjectRegistration, + protos.google.cloud.apihub.v1.ICreateHostProjectRegistrationRequest|null|undefined, + {}|null|undefined>): void; + createHostProjectRegistration( + request?: protos.google.cloud.apihub.v1.ICreateHostProjectRegistrationRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.apihub.v1.IHostProjectRegistration, + protos.google.cloud.apihub.v1.ICreateHostProjectRegistrationRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.apihub.v1.IHostProjectRegistration, + protos.google.cloud.apihub.v1.ICreateHostProjectRegistrationRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.apihub.v1.IHostProjectRegistration, + protos.google.cloud.apihub.v1.ICreateHostProjectRegistrationRequest|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.createHostProjectRegistration(request, options, callback); + } +/** + * Get a host project registration. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Host project registration resource name. + * projects/{project}/locations/{location}/hostProjectRegistrations/{host_project_registration_id} + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.apihub.v1.HostProjectRegistration|HostProjectRegistration}. + * 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/host_project_registration_service.get_host_project_registration.js + * region_tag:apihub_v1_generated_HostProjectRegistrationService_GetHostProjectRegistration_async + */ + getHostProjectRegistration( + request?: protos.google.cloud.apihub.v1.IGetHostProjectRegistrationRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.apihub.v1.IHostProjectRegistration, + protos.google.cloud.apihub.v1.IGetHostProjectRegistrationRequest|undefined, {}|undefined + ]>; + getHostProjectRegistration( + request: protos.google.cloud.apihub.v1.IGetHostProjectRegistrationRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.IHostProjectRegistration, + protos.google.cloud.apihub.v1.IGetHostProjectRegistrationRequest|null|undefined, + {}|null|undefined>): void; + getHostProjectRegistration( + request: protos.google.cloud.apihub.v1.IGetHostProjectRegistrationRequest, + callback: Callback< + protos.google.cloud.apihub.v1.IHostProjectRegistration, + protos.google.cloud.apihub.v1.IGetHostProjectRegistrationRequest|null|undefined, + {}|null|undefined>): void; + getHostProjectRegistration( + request?: protos.google.cloud.apihub.v1.IGetHostProjectRegistrationRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.apihub.v1.IHostProjectRegistration, + protos.google.cloud.apihub.v1.IGetHostProjectRegistrationRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.apihub.v1.IHostProjectRegistration, + protos.google.cloud.apihub.v1.IGetHostProjectRegistrationRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.apihub.v1.IHostProjectRegistration, + protos.google.cloud.apihub.v1.IGetHostProjectRegistrationRequest|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.getHostProjectRegistration(request, options, callback); + } + + /** + * Lists host project registrations. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of host projects. + * Format: `projects/* /locations/*` + * @param {number} [request.pageSize] + * Optional. The maximum number of host project registrations to return. The + * service may return fewer than this value. If unspecified, at most 50 host + * project registrations will be returned. The maximum value is 1000; values + * above 1000 will be coerced to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous + * `ListHostProjectRegistrations` call. Provide this to retrieve the + * subsequent page. + * + * When paginating, all other parameters (except page_size) provided to + * `ListHostProjectRegistrations` must match the call that provided the page + * token. + * @param {string} [request.filter] + * Optional. An expression that filters the list of HostProjectRegistrations. + * + * A filter expression consists of a field name, a comparison + * operator, and a value for filtering. The value must be a string. All + * standard operators as documented at https://google.aip.dev/160 are + * supported. + * + * The following fields in the `HostProjectRegistration` are eligible for + * filtering: + * + * * `name` - The name of the HostProjectRegistration. + * * `create_time` - The time at which the HostProjectRegistration was + * created. The value should be in the + * (RFC3339)[https://tools.ietf.org/html/rfc3339] format. + * * `gcp_project` - The Google cloud project associated with the + * HostProjectRegistration. + * @param {string} [request.orderBy] + * Optional. Hint for how to order the results. + * @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.apihub.v1.HostProjectRegistration|HostProjectRegistration}. + * 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 `listHostProjectRegistrationsAsync()` + * 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. + */ + listHostProjectRegistrations( + request?: protos.google.cloud.apihub.v1.IListHostProjectRegistrationsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.apihub.v1.IHostProjectRegistration[], + protos.google.cloud.apihub.v1.IListHostProjectRegistrationsRequest|null, + protos.google.cloud.apihub.v1.IListHostProjectRegistrationsResponse + ]>; + listHostProjectRegistrations( + request: protos.google.cloud.apihub.v1.IListHostProjectRegistrationsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.apihub.v1.IListHostProjectRegistrationsRequest, + protos.google.cloud.apihub.v1.IListHostProjectRegistrationsResponse|null|undefined, + protos.google.cloud.apihub.v1.IHostProjectRegistration>): void; + listHostProjectRegistrations( + request: protos.google.cloud.apihub.v1.IListHostProjectRegistrationsRequest, + callback: PaginationCallback< + protos.google.cloud.apihub.v1.IListHostProjectRegistrationsRequest, + protos.google.cloud.apihub.v1.IListHostProjectRegistrationsResponse|null|undefined, + protos.google.cloud.apihub.v1.IHostProjectRegistration>): void; + listHostProjectRegistrations( + request?: protos.google.cloud.apihub.v1.IListHostProjectRegistrationsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.apihub.v1.IListHostProjectRegistrationsRequest, + protos.google.cloud.apihub.v1.IListHostProjectRegistrationsResponse|null|undefined, + protos.google.cloud.apihub.v1.IHostProjectRegistration>, + callback?: PaginationCallback< + protos.google.cloud.apihub.v1.IListHostProjectRegistrationsRequest, + protos.google.cloud.apihub.v1.IListHostProjectRegistrationsResponse|null|undefined, + protos.google.cloud.apihub.v1.IHostProjectRegistration>): + Promise<[ + protos.google.cloud.apihub.v1.IHostProjectRegistration[], + protos.google.cloud.apihub.v1.IListHostProjectRegistrationsRequest|null, + protos.google.cloud.apihub.v1.IListHostProjectRegistrationsResponse + ]>|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.listHostProjectRegistrations(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of host projects. + * Format: `projects/* /locations/*` + * @param {number} [request.pageSize] + * Optional. The maximum number of host project registrations to return. The + * service may return fewer than this value. If unspecified, at most 50 host + * project registrations will be returned. The maximum value is 1000; values + * above 1000 will be coerced to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous + * `ListHostProjectRegistrations` call. Provide this to retrieve the + * subsequent page. + * + * When paginating, all other parameters (except page_size) provided to + * `ListHostProjectRegistrations` must match the call that provided the page + * token. + * @param {string} [request.filter] + * Optional. An expression that filters the list of HostProjectRegistrations. + * + * A filter expression consists of a field name, a comparison + * operator, and a value for filtering. The value must be a string. All + * standard operators as documented at https://google.aip.dev/160 are + * supported. + * + * The following fields in the `HostProjectRegistration` are eligible for + * filtering: + * + * * `name` - The name of the HostProjectRegistration. + * * `create_time` - The time at which the HostProjectRegistration was + * created. The value should be in the + * (RFC3339)[https://tools.ietf.org/html/rfc3339] format. + * * `gcp_project` - The Google cloud project associated with the + * HostProjectRegistration. + * @param {string} [request.orderBy] + * Optional. Hint for how to order the results. + * @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.apihub.v1.HostProjectRegistration|HostProjectRegistration} 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 `listHostProjectRegistrationsAsync()` + * 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. + */ + listHostProjectRegistrationsStream( + request?: protos.google.cloud.apihub.v1.IListHostProjectRegistrationsRequest, + 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['listHostProjectRegistrations']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listHostProjectRegistrations.createStream( + this.innerApiCalls.listHostProjectRegistrations as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listHostProjectRegistrations`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of host projects. + * Format: `projects/* /locations/*` + * @param {number} [request.pageSize] + * Optional. The maximum number of host project registrations to return. The + * service may return fewer than this value. If unspecified, at most 50 host + * project registrations will be returned. The maximum value is 1000; values + * above 1000 will be coerced to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous + * `ListHostProjectRegistrations` call. Provide this to retrieve the + * subsequent page. + * + * When paginating, all other parameters (except page_size) provided to + * `ListHostProjectRegistrations` must match the call that provided the page + * token. + * @param {string} [request.filter] + * Optional. An expression that filters the list of HostProjectRegistrations. + * + * A filter expression consists of a field name, a comparison + * operator, and a value for filtering. The value must be a string. All + * standard operators as documented at https://google.aip.dev/160 are + * supported. + * + * The following fields in the `HostProjectRegistration` are eligible for + * filtering: + * + * * `name` - The name of the HostProjectRegistration. + * * `create_time` - The time at which the HostProjectRegistration was + * created. The value should be in the + * (RFC3339)[https://tools.ietf.org/html/rfc3339] format. + * * `gcp_project` - The Google cloud project associated with the + * HostProjectRegistration. + * @param {string} [request.orderBy] + * Optional. Hint for how to order the results. + * @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.apihub.v1.HostProjectRegistration|HostProjectRegistration}. 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/host_project_registration_service.list_host_project_registrations.js + * region_tag:apihub_v1_generated_HostProjectRegistrationService_ListHostProjectRegistrations_async + */ + listHostProjectRegistrationsAsync( + request?: protos.google.cloud.apihub.v1.IListHostProjectRegistrationsRequest, + 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['listHostProjectRegistrations']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listHostProjectRegistrations.asyncIterate( + this.innerApiCalls['listHostProjectRegistrations'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } +/** + * 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); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified api resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @returns {string} Resource name string. + */ + apiPath(project:string,location:string,api:string) { + return this.pathTemplates.apiPathTemplate.render({ + project: project, + location: location, + api: api, + }); + } + + /** + * Parse the project from Api resource. + * + * @param {string} apiName + * A fully-qualified path representing Api resource. + * @returns {string} A string representing the project. + */ + matchProjectFromApiName(apiName: string) { + return this.pathTemplates.apiPathTemplate.match(apiName).project; + } + + /** + * Parse the location from Api resource. + * + * @param {string} apiName + * A fully-qualified path representing Api resource. + * @returns {string} A string representing the location. + */ + matchLocationFromApiName(apiName: string) { + return this.pathTemplates.apiPathTemplate.match(apiName).location; + } + + /** + * Parse the api from Api resource. + * + * @param {string} apiName + * A fully-qualified path representing Api resource. + * @returns {string} A string representing the api. + */ + matchApiFromApiName(apiName: string) { + return this.pathTemplates.apiPathTemplate.match(apiName).api; + } + + /** + * Return a fully-qualified apiHubInstance resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api_hub_instance + * @returns {string} Resource name string. + */ + apiHubInstancePath(project:string,location:string,apiHubInstance:string) { + return this.pathTemplates.apiHubInstancePathTemplate.render({ + project: project, + location: location, + api_hub_instance: apiHubInstance, + }); + } + + /** + * Parse the project from ApiHubInstance resource. + * + * @param {string} apiHubInstanceName + * A fully-qualified path representing ApiHubInstance resource. + * @returns {string} A string representing the project. + */ + matchProjectFromApiHubInstanceName(apiHubInstanceName: string) { + return this.pathTemplates.apiHubInstancePathTemplate.match(apiHubInstanceName).project; + } + + /** + * Parse the location from ApiHubInstance resource. + * + * @param {string} apiHubInstanceName + * A fully-qualified path representing ApiHubInstance resource. + * @returns {string} A string representing the location. + */ + matchLocationFromApiHubInstanceName(apiHubInstanceName: string) { + return this.pathTemplates.apiHubInstancePathTemplate.match(apiHubInstanceName).location; + } + + /** + * Parse the api_hub_instance from ApiHubInstance resource. + * + * @param {string} apiHubInstanceName + * A fully-qualified path representing ApiHubInstance resource. + * @returns {string} A string representing the api_hub_instance. + */ + matchApiHubInstanceFromApiHubInstanceName(apiHubInstanceName: string) { + return this.pathTemplates.apiHubInstancePathTemplate.match(apiHubInstanceName).api_hub_instance; + } + + /** + * Return a fully-qualified apiOperation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @param {string} version + * @param {string} operation + * @returns {string} Resource name string. + */ + apiOperationPath(project:string,location:string,api:string,version:string,operation:string) { + return this.pathTemplates.apiOperationPathTemplate.render({ + project: project, + location: location, + api: api, + version: version, + operation: operation, + }); + } + + /** + * Parse the project from ApiOperation resource. + * + * @param {string} apiOperationName + * A fully-qualified path representing ApiOperation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromApiOperationName(apiOperationName: string) { + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).project; + } + + /** + * Parse the location from ApiOperation resource. + * + * @param {string} apiOperationName + * A fully-qualified path representing ApiOperation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromApiOperationName(apiOperationName: string) { + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).location; + } + + /** + * Parse the api from ApiOperation resource. + * + * @param {string} apiOperationName + * A fully-qualified path representing ApiOperation resource. + * @returns {string} A string representing the api. + */ + matchApiFromApiOperationName(apiOperationName: string) { + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).api; + } + + /** + * Parse the version from ApiOperation resource. + * + * @param {string} apiOperationName + * A fully-qualified path representing ApiOperation resource. + * @returns {string} A string representing the version. + */ + matchVersionFromApiOperationName(apiOperationName: string) { + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).version; + } + + /** + * Parse the operation from ApiOperation resource. + * + * @param {string} apiOperationName + * A fully-qualified path representing ApiOperation resource. + * @returns {string} A string representing the operation. + */ + matchOperationFromApiOperationName(apiOperationName: string) { + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).operation; + } + + /** + * Return a fully-qualified attribute resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} attribute + * @returns {string} Resource name string. + */ + attributePath(project:string,location:string,attribute:string) { + return this.pathTemplates.attributePathTemplate.render({ + project: project, + location: location, + attribute: attribute, + }); + } + + /** + * Parse the project from Attribute resource. + * + * @param {string} attributeName + * A fully-qualified path representing Attribute resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAttributeName(attributeName: string) { + return this.pathTemplates.attributePathTemplate.match(attributeName).project; + } + + /** + * Parse the location from Attribute resource. + * + * @param {string} attributeName + * A fully-qualified path representing Attribute resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAttributeName(attributeName: string) { + return this.pathTemplates.attributePathTemplate.match(attributeName).location; + } + + /** + * Parse the attribute from Attribute resource. + * + * @param {string} attributeName + * A fully-qualified path representing Attribute resource. + * @returns {string} A string representing the attribute. + */ + matchAttributeFromAttributeName(attributeName: string) { + return this.pathTemplates.attributePathTemplate.match(attributeName).attribute; + } + + /** + * Return a fully-qualified definition resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @param {string} version + * @param {string} definition + * @returns {string} Resource name string. + */ + definitionPath(project:string,location:string,api:string,version:string,definition:string) { + return this.pathTemplates.definitionPathTemplate.render({ + project: project, + location: location, + api: api, + version: version, + definition: definition, + }); + } + + /** + * Parse the project from Definition resource. + * + * @param {string} definitionName + * A fully-qualified path representing Definition resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDefinitionName(definitionName: string) { + return this.pathTemplates.definitionPathTemplate.match(definitionName).project; + } + + /** + * Parse the location from Definition resource. + * + * @param {string} definitionName + * A fully-qualified path representing Definition resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDefinitionName(definitionName: string) { + return this.pathTemplates.definitionPathTemplate.match(definitionName).location; + } + + /** + * Parse the api from Definition resource. + * + * @param {string} definitionName + * A fully-qualified path representing Definition resource. + * @returns {string} A string representing the api. + */ + matchApiFromDefinitionName(definitionName: string) { + return this.pathTemplates.definitionPathTemplate.match(definitionName).api; + } + + /** + * Parse the version from Definition resource. + * + * @param {string} definitionName + * A fully-qualified path representing Definition resource. + * @returns {string} A string representing the version. + */ + matchVersionFromDefinitionName(definitionName: string) { + return this.pathTemplates.definitionPathTemplate.match(definitionName).version; + } + + /** + * Parse the definition from Definition resource. + * + * @param {string} definitionName + * A fully-qualified path representing Definition resource. + * @returns {string} A string representing the definition. + */ + matchDefinitionFromDefinitionName(definitionName: string) { + return this.pathTemplates.definitionPathTemplate.match(definitionName).definition; + } + + /** + * Return a fully-qualified dependency resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dependency + * @returns {string} Resource name string. + */ + dependencyPath(project:string,location:string,dependency:string) { + return this.pathTemplates.dependencyPathTemplate.render({ + project: project, + location: location, + dependency: dependency, + }); + } + + /** + * Parse the project from Dependency resource. + * + * @param {string} dependencyName + * A fully-qualified path representing Dependency resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDependencyName(dependencyName: string) { + return this.pathTemplates.dependencyPathTemplate.match(dependencyName).project; + } + + /** + * Parse the location from Dependency resource. + * + * @param {string} dependencyName + * A fully-qualified path representing Dependency resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDependencyName(dependencyName: string) { + return this.pathTemplates.dependencyPathTemplate.match(dependencyName).location; + } + + /** + * Parse the dependency from Dependency resource. + * + * @param {string} dependencyName + * A fully-qualified path representing Dependency resource. + * @returns {string} A string representing the dependency. + */ + matchDependencyFromDependencyName(dependencyName: string) { + return this.pathTemplates.dependencyPathTemplate.match(dependencyName).dependency; + } + + /** + * Return a fully-qualified deployment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} deployment + * @returns {string} Resource name string. + */ + deploymentPath(project:string,location:string,deployment:string) { + return this.pathTemplates.deploymentPathTemplate.render({ + project: project, + location: location, + deployment: deployment, + }); + } + + /** + * Parse the project from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName).project; + } + + /** + * Parse the location from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName).location; + } + + /** + * Parse the deployment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the deployment. + */ + matchDeploymentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName).deployment; + } + + /** + * Return a fully-qualified externalApi resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} external_api + * @returns {string} Resource name string. + */ + externalApiPath(project:string,location:string,externalApi:string) { + return this.pathTemplates.externalApiPathTemplate.render({ + project: project, + location: location, + external_api: externalApi, + }); + } + + /** + * Parse the project from ExternalApi resource. + * + * @param {string} externalApiName + * A fully-qualified path representing ExternalApi resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExternalApiName(externalApiName: string) { + return this.pathTemplates.externalApiPathTemplate.match(externalApiName).project; + } + + /** + * Parse the location from ExternalApi resource. + * + * @param {string} externalApiName + * A fully-qualified path representing ExternalApi resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExternalApiName(externalApiName: string) { + return this.pathTemplates.externalApiPathTemplate.match(externalApiName).location; + } + + /** + * Parse the external_api from ExternalApi resource. + * + * @param {string} externalApiName + * A fully-qualified path representing ExternalApi resource. + * @returns {string} A string representing the external_api. + */ + matchExternalApiFromExternalApiName(externalApiName: string) { + return this.pathTemplates.externalApiPathTemplate.match(externalApiName).external_api; + } + + /** + * Return a fully-qualified hostProjectRegistration resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} host_project_registration + * @returns {string} Resource name string. + */ + hostProjectRegistrationPath(project:string,location:string,hostProjectRegistration:string) { + return this.pathTemplates.hostProjectRegistrationPathTemplate.render({ + project: project, + location: location, + host_project_registration: hostProjectRegistration, + }); + } + + /** + * Parse the project from HostProjectRegistration resource. + * + * @param {string} hostProjectRegistrationName + * A fully-qualified path representing HostProjectRegistration resource. + * @returns {string} A string representing the project. + */ + matchProjectFromHostProjectRegistrationName(hostProjectRegistrationName: string) { + return this.pathTemplates.hostProjectRegistrationPathTemplate.match(hostProjectRegistrationName).project; + } + + /** + * Parse the location from HostProjectRegistration resource. + * + * @param {string} hostProjectRegistrationName + * A fully-qualified path representing HostProjectRegistration resource. + * @returns {string} A string representing the location. + */ + matchLocationFromHostProjectRegistrationName(hostProjectRegistrationName: string) { + return this.pathTemplates.hostProjectRegistrationPathTemplate.match(hostProjectRegistrationName).location; + } + + /** + * Parse the host_project_registration from HostProjectRegistration resource. + * + * @param {string} hostProjectRegistrationName + * A fully-qualified path representing HostProjectRegistration resource. + * @returns {string} A string representing the host_project_registration. + */ + matchHostProjectRegistrationFromHostProjectRegistrationName(hostProjectRegistrationName: string) { + return this.pathTemplates.hostProjectRegistrationPathTemplate.match(hostProjectRegistrationName).host_project_registration; + } + + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project:string,location:string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + + /** + * Return a fully-qualified plugin resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} plugin + * @returns {string} Resource name string. + */ + pluginPath(project:string,location:string,plugin:string) { + return this.pathTemplates.pluginPathTemplate.render({ + project: project, + location: location, + plugin: plugin, + }); + } + + /** + * Parse the project from Plugin resource. + * + * @param {string} pluginName + * A fully-qualified path representing Plugin resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPluginName(pluginName: string) { + return this.pathTemplates.pluginPathTemplate.match(pluginName).project; + } + + /** + * Parse the location from Plugin resource. + * + * @param {string} pluginName + * A fully-qualified path representing Plugin resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPluginName(pluginName: string) { + return this.pathTemplates.pluginPathTemplate.match(pluginName).location; + } + + /** + * Parse the plugin from Plugin resource. + * + * @param {string} pluginName + * A fully-qualified path representing Plugin resource. + * @returns {string} A string representing the plugin. + */ + matchPluginFromPluginName(pluginName: string) { + return this.pathTemplates.pluginPathTemplate.match(pluginName).plugin; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project:string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified runtimeProjectAttachment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} runtime_project_attachment + * @returns {string} Resource name string. + */ + runtimeProjectAttachmentPath(project:string,location:string,runtimeProjectAttachment:string) { + return this.pathTemplates.runtimeProjectAttachmentPathTemplate.render({ + project: project, + location: location, + runtime_project_attachment: runtimeProjectAttachment, + }); + } + + /** + * Parse the project from RuntimeProjectAttachment resource. + * + * @param {string} runtimeProjectAttachmentName + * A fully-qualified path representing RuntimeProjectAttachment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRuntimeProjectAttachmentName(runtimeProjectAttachmentName: string) { + return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match(runtimeProjectAttachmentName).project; + } + + /** + * Parse the location from RuntimeProjectAttachment resource. + * + * @param {string} runtimeProjectAttachmentName + * A fully-qualified path representing RuntimeProjectAttachment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRuntimeProjectAttachmentName(runtimeProjectAttachmentName: string) { + return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match(runtimeProjectAttachmentName).location; + } + + /** + * Parse the runtime_project_attachment from RuntimeProjectAttachment resource. + * + * @param {string} runtimeProjectAttachmentName + * A fully-qualified path representing RuntimeProjectAttachment resource. + * @returns {string} A string representing the runtime_project_attachment. + */ + matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName(runtimeProjectAttachmentName: string) { + return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match(runtimeProjectAttachmentName).runtime_project_attachment; + } + + /** + * Return a fully-qualified spec resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @param {string} version + * @param {string} spec + * @returns {string} Resource name string. + */ + specPath(project:string,location:string,api:string,version:string,spec:string) { + return this.pathTemplates.specPathTemplate.render({ + project: project, + location: location, + api: api, + version: version, + spec: spec, + }); + } + + /** + * Parse the project from Spec resource. + * + * @param {string} specName + * A fully-qualified path representing Spec resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSpecName(specName: string) { + return this.pathTemplates.specPathTemplate.match(specName).project; + } + + /** + * Parse the location from Spec resource. + * + * @param {string} specName + * A fully-qualified path representing Spec resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSpecName(specName: string) { + return this.pathTemplates.specPathTemplate.match(specName).location; + } + + /** + * Parse the api from Spec resource. + * + * @param {string} specName + * A fully-qualified path representing Spec resource. + * @returns {string} A string representing the api. + */ + matchApiFromSpecName(specName: string) { + return this.pathTemplates.specPathTemplate.match(specName).api; + } + + /** + * Parse the version from Spec resource. + * + * @param {string} specName + * A fully-qualified path representing Spec resource. + * @returns {string} A string representing the version. + */ + matchVersionFromSpecName(specName: string) { + return this.pathTemplates.specPathTemplate.match(specName).version; + } + + /** + * Parse the spec from Spec resource. + * + * @param {string} specName + * A fully-qualified path representing Spec resource. + * @returns {string} A string representing the spec. + */ + matchSpecFromSpecName(specName: string) { + return this.pathTemplates.specPathTemplate.match(specName).spec; + } + + /** + * Return a fully-qualified styleGuide resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} plugin + * @returns {string} Resource name string. + */ + styleGuidePath(project:string,location:string,plugin:string) { + return this.pathTemplates.styleGuidePathTemplate.render({ + project: project, + location: location, + plugin: plugin, + }); + } + + /** + * Parse the project from StyleGuide resource. + * + * @param {string} styleGuideName + * A fully-qualified path representing StyleGuide resource. + * @returns {string} A string representing the project. + */ + matchProjectFromStyleGuideName(styleGuideName: string) { + return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName).project; + } + + /** + * Parse the location from StyleGuide resource. + * + * @param {string} styleGuideName + * A fully-qualified path representing StyleGuide resource. + * @returns {string} A string representing the location. + */ + matchLocationFromStyleGuideName(styleGuideName: string) { + return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName).location; + } + + /** + * Parse the plugin from StyleGuide resource. + * + * @param {string} styleGuideName + * A fully-qualified path representing StyleGuide resource. + * @returns {string} A string representing the plugin. + */ + matchPluginFromStyleGuideName(styleGuideName: string) { + return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName).plugin; + } + + /** + * Return a fully-qualified version resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @param {string} version + * @returns {string} Resource name string. + */ + versionPath(project:string,location:string,api:string,version:string) { + return this.pathTemplates.versionPathTemplate.render({ + project: project, + location: location, + api: api, + version: version, + }); + } + + /** + * Parse the project from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the project. + */ + matchProjectFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).project; + } + + /** + * Parse the location from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the location. + */ + matchLocationFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).location; + } + + /** + * Parse the api from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the api. + */ + matchApiFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).api; + } + + /** + * Parse the version from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the version. + */ + matchVersionFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).version; + } + + /** + * 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.hostProjectRegistrationServiceStub && !this._terminated) { + return this.hostProjectRegistrationServiceStub.then(stub => { + this._terminated = true; + stub.close(); + this.locationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-cloud-apihub/v1/src/v1/host_project_registration_service_client_config.json b/owl-bot-staging/google-cloud-apihub/v1/src/v1/host_project_registration_service_client_config.json new file mode 100644 index 00000000000..8daddd428c6 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/src/v1/host_project_registration_service_client_config.json @@ -0,0 +1,53 @@ +{ + "interfaces": { + "google.cloud.apihub.v1.HostProjectRegistrationService": { + "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": { + "CreateHostProjectRegistration": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetHostProjectRegistration": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ListHostProjectRegistrations": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-apihub/v1/src/v1/host_project_registration_service_proto_list.json b/owl-bot-staging/google-cloud-apihub/v1/src/v1/host_project_registration_service_proto_list.json new file mode 100644 index 00000000000..07e987f7fb3 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/src/v1/host_project_registration_service_proto_list.json @@ -0,0 +1,9 @@ +[ + "../../protos/google/cloud/apihub/v1/apihub_service.proto", + "../../protos/google/cloud/apihub/v1/common_fields.proto", + "../../protos/google/cloud/apihub/v1/host_project_registration_service.proto", + "../../protos/google/cloud/apihub/v1/linting_service.proto", + "../../protos/google/cloud/apihub/v1/plugin_service.proto", + "../../protos/google/cloud/apihub/v1/provisioning_service.proto", + "../../protos/google/cloud/apihub/v1/runtime_project_attachment_service.proto" +] diff --git a/owl-bot-staging/google-cloud-apihub/v1/src/v1/index.ts b/owl-bot-staging/google-cloud-apihub/v1/src/v1/index.ts new file mode 100644 index 00000000000..ea67cfcd904 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/src/v1/index.ts @@ -0,0 +1,25 @@ +// Copyright 2024 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 {ApiHubClient} from './api_hub_client'; +export {ApiHubDependenciesClient} from './api_hub_dependencies_client'; +export {ApiHubPluginClient} from './api_hub_plugin_client'; +export {HostProjectRegistrationServiceClient} from './host_project_registration_service_client'; +export {LintingServiceClient} from './linting_service_client'; +export {ProvisioningClient} from './provisioning_client'; +export {RuntimeProjectAttachmentServiceClient} from './runtime_project_attachment_service_client'; diff --git a/owl-bot-staging/google-cloud-apihub/v1/src/v1/linting_service_client.ts b/owl-bot-staging/google-cloud-apihub/v1/src/v1/linting_service_client.ts new file mode 100644 index 00000000000..3e2a0e0cd44 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/src/v1/linting_service_client.ts @@ -0,0 +1,1545 @@ +// Copyright 2024 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, LocationsClient, LocationProtos} from 'google-gax'; + +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); + +/** + * Client JSON configuration object, loaded from + * `src/v1/linting_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './linting_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * This service provides all methods related to the 1p Linter. + * @class + * @memberof v1 + */ +export class LintingServiceClient { + 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}; + private _universeDomain: string; + private _servicePath: string; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + locationsClient: LocationsClient; + pathTemplates: {[name: string]: gax.PathTemplate}; + lintingServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of LintingServiceClient. + * + * @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 LintingServiceClient({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 LintingServiceClient; + if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { + throw new Error('Please set either universe_domain or universeDomain, but not both.'); + } + const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; + this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; + this._servicePath = 'apihub.' + this._universeDomain; + const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). + if (!opts) { + opts = {fallback: true}; + } else { + opts.fallback = opts.fallback ?? true; + } + 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 !== this._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 = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + 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 === 'object' && '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 = { + apiPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}' + ), + apiHubInstancePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apiHubInstances/{api_hub_instance}' + ), + apiOperationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}' + ), + attributePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/attributes/{attribute}' + ), + definitionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}' + ), + dependencyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/dependencies/{dependency}' + ), + deploymentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/deployments/{deployment}' + ), + externalApiPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/externalApis/{external_api}' + ), + hostProjectRegistrationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/hostProjectRegistrations/{host_project_registration}' + ), + pluginPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/plugins/{plugin}' + ), + runtimeProjectAttachmentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}' + ), + specPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}' + ), + styleGuidePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/plugins/{plugin}/styleGuide' + ), + versionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}/versions/{version}' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.apihub.v1.LintingService', 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.lintingServiceStub) { + return this.lintingServiceStub; + } + + // Put together the "service stub" for + // google.cloud.apihub.v1.LintingService. + this.lintingServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.apihub.v1.LintingService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.apihub.v1.LintingService, + 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 lintingServiceStubMethods = + ['getStyleGuide', 'updateStyleGuide', 'getStyleGuideContents', 'lintSpec']; + for (const methodName of lintingServiceStubMethods) { + const callPromise = this.lintingServiceStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.lintingServiceStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'apihub.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'apihub.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * 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 -- + // ------------------- +/** + * Get the style guide being used for linting. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the spec to retrieve. + * Format: + * `projects/{project}/locations/{location}/plugins/{plugin}/styleGuide`. + * @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.apihub.v1.StyleGuide|StyleGuide}. + * 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/linting_service.get_style_guide.js + * region_tag:apihub_v1_generated_LintingService_GetStyleGuide_async + */ + getStyleGuide( + request?: protos.google.cloud.apihub.v1.IGetStyleGuideRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.apihub.v1.IStyleGuide, + protos.google.cloud.apihub.v1.IGetStyleGuideRequest|undefined, {}|undefined + ]>; + getStyleGuide( + request: protos.google.cloud.apihub.v1.IGetStyleGuideRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.IStyleGuide, + protos.google.cloud.apihub.v1.IGetStyleGuideRequest|null|undefined, + {}|null|undefined>): void; + getStyleGuide( + request: protos.google.cloud.apihub.v1.IGetStyleGuideRequest, + callback: Callback< + protos.google.cloud.apihub.v1.IStyleGuide, + protos.google.cloud.apihub.v1.IGetStyleGuideRequest|null|undefined, + {}|null|undefined>): void; + getStyleGuide( + request?: protos.google.cloud.apihub.v1.IGetStyleGuideRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.apihub.v1.IStyleGuide, + protos.google.cloud.apihub.v1.IGetStyleGuideRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.apihub.v1.IStyleGuide, + protos.google.cloud.apihub.v1.IGetStyleGuideRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.apihub.v1.IStyleGuide, + protos.google.cloud.apihub.v1.IGetStyleGuideRequest|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.getStyleGuide(request, options, callback); + } +/** + * Update the styleGuide to be used for liniting in by API hub. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.apihub.v1.StyleGuide} request.styleGuide + * Required. The Style guide resource to update. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. The list of fields to update. + * @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.apihub.v1.StyleGuide|StyleGuide}. + * 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/linting_service.update_style_guide.js + * region_tag:apihub_v1_generated_LintingService_UpdateStyleGuide_async + */ + updateStyleGuide( + request?: protos.google.cloud.apihub.v1.IUpdateStyleGuideRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.apihub.v1.IStyleGuide, + protos.google.cloud.apihub.v1.IUpdateStyleGuideRequest|undefined, {}|undefined + ]>; + updateStyleGuide( + request: protos.google.cloud.apihub.v1.IUpdateStyleGuideRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.IStyleGuide, + protos.google.cloud.apihub.v1.IUpdateStyleGuideRequest|null|undefined, + {}|null|undefined>): void; + updateStyleGuide( + request: protos.google.cloud.apihub.v1.IUpdateStyleGuideRequest, + callback: Callback< + protos.google.cloud.apihub.v1.IStyleGuide, + protos.google.cloud.apihub.v1.IUpdateStyleGuideRequest|null|undefined, + {}|null|undefined>): void; + updateStyleGuide( + request?: protos.google.cloud.apihub.v1.IUpdateStyleGuideRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.apihub.v1.IStyleGuide, + protos.google.cloud.apihub.v1.IUpdateStyleGuideRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.apihub.v1.IStyleGuide, + protos.google.cloud.apihub.v1.IUpdateStyleGuideRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.apihub.v1.IStyleGuide, + protos.google.cloud.apihub.v1.IUpdateStyleGuideRequest|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({ + 'style_guide.name': request.styleGuide!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateStyleGuide(request, options, callback); + } +/** + * Get the contents of the style guide. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the StyleGuide whose contents need to be retrieved. + * There is exactly one style guide resource per project per location. + * The expected format is + * `projects/{project}/locations/{location}/plugins/{plugin}/styleGuide`. + * @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.apihub.v1.StyleGuideContents|StyleGuideContents}. + * 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/linting_service.get_style_guide_contents.js + * region_tag:apihub_v1_generated_LintingService_GetStyleGuideContents_async + */ + getStyleGuideContents( + request?: protos.google.cloud.apihub.v1.IGetStyleGuideContentsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.apihub.v1.IStyleGuideContents, + protos.google.cloud.apihub.v1.IGetStyleGuideContentsRequest|undefined, {}|undefined + ]>; + getStyleGuideContents( + request: protos.google.cloud.apihub.v1.IGetStyleGuideContentsRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.IStyleGuideContents, + protos.google.cloud.apihub.v1.IGetStyleGuideContentsRequest|null|undefined, + {}|null|undefined>): void; + getStyleGuideContents( + request: protos.google.cloud.apihub.v1.IGetStyleGuideContentsRequest, + callback: Callback< + protos.google.cloud.apihub.v1.IStyleGuideContents, + protos.google.cloud.apihub.v1.IGetStyleGuideContentsRequest|null|undefined, + {}|null|undefined>): void; + getStyleGuideContents( + request?: protos.google.cloud.apihub.v1.IGetStyleGuideContentsRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.apihub.v1.IStyleGuideContents, + protos.google.cloud.apihub.v1.IGetStyleGuideContentsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.apihub.v1.IStyleGuideContents, + protos.google.cloud.apihub.v1.IGetStyleGuideContentsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.apihub.v1.IStyleGuideContents, + protos.google.cloud.apihub.v1.IGetStyleGuideContentsRequest|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.getStyleGuideContents(request, options, callback); + } +/** + * Lints the requested spec and updates the corresponding API Spec with the + * lint response. This lint response will be available in all subsequent + * Get and List Spec calls to Core service. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the spec to be linted. + * Format: + * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}` + * @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.protobuf.Empty|Empty}. + * 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/linting_service.lint_spec.js + * region_tag:apihub_v1_generated_LintingService_LintSpec_async + */ + lintSpec( + request?: protos.google.cloud.apihub.v1.ILintSpecRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.ILintSpecRequest|undefined, {}|undefined + ]>; + lintSpec( + request: protos.google.cloud.apihub.v1.ILintSpecRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.ILintSpecRequest|null|undefined, + {}|null|undefined>): void; + lintSpec( + request: protos.google.cloud.apihub.v1.ILintSpecRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.ILintSpecRequest|null|undefined, + {}|null|undefined>): void; + lintSpec( + request?: protos.google.cloud.apihub.v1.ILintSpecRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.ILintSpecRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.ILintSpecRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.ILintSpecRequest|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.lintSpec(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); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified api resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @returns {string} Resource name string. + */ + apiPath(project:string,location:string,api:string) { + return this.pathTemplates.apiPathTemplate.render({ + project: project, + location: location, + api: api, + }); + } + + /** + * Parse the project from Api resource. + * + * @param {string} apiName + * A fully-qualified path representing Api resource. + * @returns {string} A string representing the project. + */ + matchProjectFromApiName(apiName: string) { + return this.pathTemplates.apiPathTemplate.match(apiName).project; + } + + /** + * Parse the location from Api resource. + * + * @param {string} apiName + * A fully-qualified path representing Api resource. + * @returns {string} A string representing the location. + */ + matchLocationFromApiName(apiName: string) { + return this.pathTemplates.apiPathTemplate.match(apiName).location; + } + + /** + * Parse the api from Api resource. + * + * @param {string} apiName + * A fully-qualified path representing Api resource. + * @returns {string} A string representing the api. + */ + matchApiFromApiName(apiName: string) { + return this.pathTemplates.apiPathTemplate.match(apiName).api; + } + + /** + * Return a fully-qualified apiHubInstance resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api_hub_instance + * @returns {string} Resource name string. + */ + apiHubInstancePath(project:string,location:string,apiHubInstance:string) { + return this.pathTemplates.apiHubInstancePathTemplate.render({ + project: project, + location: location, + api_hub_instance: apiHubInstance, + }); + } + + /** + * Parse the project from ApiHubInstance resource. + * + * @param {string} apiHubInstanceName + * A fully-qualified path representing ApiHubInstance resource. + * @returns {string} A string representing the project. + */ + matchProjectFromApiHubInstanceName(apiHubInstanceName: string) { + return this.pathTemplates.apiHubInstancePathTemplate.match(apiHubInstanceName).project; + } + + /** + * Parse the location from ApiHubInstance resource. + * + * @param {string} apiHubInstanceName + * A fully-qualified path representing ApiHubInstance resource. + * @returns {string} A string representing the location. + */ + matchLocationFromApiHubInstanceName(apiHubInstanceName: string) { + return this.pathTemplates.apiHubInstancePathTemplate.match(apiHubInstanceName).location; + } + + /** + * Parse the api_hub_instance from ApiHubInstance resource. + * + * @param {string} apiHubInstanceName + * A fully-qualified path representing ApiHubInstance resource. + * @returns {string} A string representing the api_hub_instance. + */ + matchApiHubInstanceFromApiHubInstanceName(apiHubInstanceName: string) { + return this.pathTemplates.apiHubInstancePathTemplate.match(apiHubInstanceName).api_hub_instance; + } + + /** + * Return a fully-qualified apiOperation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @param {string} version + * @param {string} operation + * @returns {string} Resource name string. + */ + apiOperationPath(project:string,location:string,api:string,version:string,operation:string) { + return this.pathTemplates.apiOperationPathTemplate.render({ + project: project, + location: location, + api: api, + version: version, + operation: operation, + }); + } + + /** + * Parse the project from ApiOperation resource. + * + * @param {string} apiOperationName + * A fully-qualified path representing ApiOperation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromApiOperationName(apiOperationName: string) { + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).project; + } + + /** + * Parse the location from ApiOperation resource. + * + * @param {string} apiOperationName + * A fully-qualified path representing ApiOperation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromApiOperationName(apiOperationName: string) { + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).location; + } + + /** + * Parse the api from ApiOperation resource. + * + * @param {string} apiOperationName + * A fully-qualified path representing ApiOperation resource. + * @returns {string} A string representing the api. + */ + matchApiFromApiOperationName(apiOperationName: string) { + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).api; + } + + /** + * Parse the version from ApiOperation resource. + * + * @param {string} apiOperationName + * A fully-qualified path representing ApiOperation resource. + * @returns {string} A string representing the version. + */ + matchVersionFromApiOperationName(apiOperationName: string) { + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).version; + } + + /** + * Parse the operation from ApiOperation resource. + * + * @param {string} apiOperationName + * A fully-qualified path representing ApiOperation resource. + * @returns {string} A string representing the operation. + */ + matchOperationFromApiOperationName(apiOperationName: string) { + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).operation; + } + + /** + * Return a fully-qualified attribute resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} attribute + * @returns {string} Resource name string. + */ + attributePath(project:string,location:string,attribute:string) { + return this.pathTemplates.attributePathTemplate.render({ + project: project, + location: location, + attribute: attribute, + }); + } + + /** + * Parse the project from Attribute resource. + * + * @param {string} attributeName + * A fully-qualified path representing Attribute resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAttributeName(attributeName: string) { + return this.pathTemplates.attributePathTemplate.match(attributeName).project; + } + + /** + * Parse the location from Attribute resource. + * + * @param {string} attributeName + * A fully-qualified path representing Attribute resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAttributeName(attributeName: string) { + return this.pathTemplates.attributePathTemplate.match(attributeName).location; + } + + /** + * Parse the attribute from Attribute resource. + * + * @param {string} attributeName + * A fully-qualified path representing Attribute resource. + * @returns {string} A string representing the attribute. + */ + matchAttributeFromAttributeName(attributeName: string) { + return this.pathTemplates.attributePathTemplate.match(attributeName).attribute; + } + + /** + * Return a fully-qualified definition resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @param {string} version + * @param {string} definition + * @returns {string} Resource name string. + */ + definitionPath(project:string,location:string,api:string,version:string,definition:string) { + return this.pathTemplates.definitionPathTemplate.render({ + project: project, + location: location, + api: api, + version: version, + definition: definition, + }); + } + + /** + * Parse the project from Definition resource. + * + * @param {string} definitionName + * A fully-qualified path representing Definition resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDefinitionName(definitionName: string) { + return this.pathTemplates.definitionPathTemplate.match(definitionName).project; + } + + /** + * Parse the location from Definition resource. + * + * @param {string} definitionName + * A fully-qualified path representing Definition resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDefinitionName(definitionName: string) { + return this.pathTemplates.definitionPathTemplate.match(definitionName).location; + } + + /** + * Parse the api from Definition resource. + * + * @param {string} definitionName + * A fully-qualified path representing Definition resource. + * @returns {string} A string representing the api. + */ + matchApiFromDefinitionName(definitionName: string) { + return this.pathTemplates.definitionPathTemplate.match(definitionName).api; + } + + /** + * Parse the version from Definition resource. + * + * @param {string} definitionName + * A fully-qualified path representing Definition resource. + * @returns {string} A string representing the version. + */ + matchVersionFromDefinitionName(definitionName: string) { + return this.pathTemplates.definitionPathTemplate.match(definitionName).version; + } + + /** + * Parse the definition from Definition resource. + * + * @param {string} definitionName + * A fully-qualified path representing Definition resource. + * @returns {string} A string representing the definition. + */ + matchDefinitionFromDefinitionName(definitionName: string) { + return this.pathTemplates.definitionPathTemplate.match(definitionName).definition; + } + + /** + * Return a fully-qualified dependency resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dependency + * @returns {string} Resource name string. + */ + dependencyPath(project:string,location:string,dependency:string) { + return this.pathTemplates.dependencyPathTemplate.render({ + project: project, + location: location, + dependency: dependency, + }); + } + + /** + * Parse the project from Dependency resource. + * + * @param {string} dependencyName + * A fully-qualified path representing Dependency resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDependencyName(dependencyName: string) { + return this.pathTemplates.dependencyPathTemplate.match(dependencyName).project; + } + + /** + * Parse the location from Dependency resource. + * + * @param {string} dependencyName + * A fully-qualified path representing Dependency resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDependencyName(dependencyName: string) { + return this.pathTemplates.dependencyPathTemplate.match(dependencyName).location; + } + + /** + * Parse the dependency from Dependency resource. + * + * @param {string} dependencyName + * A fully-qualified path representing Dependency resource. + * @returns {string} A string representing the dependency. + */ + matchDependencyFromDependencyName(dependencyName: string) { + return this.pathTemplates.dependencyPathTemplate.match(dependencyName).dependency; + } + + /** + * Return a fully-qualified deployment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} deployment + * @returns {string} Resource name string. + */ + deploymentPath(project:string,location:string,deployment:string) { + return this.pathTemplates.deploymentPathTemplate.render({ + project: project, + location: location, + deployment: deployment, + }); + } + + /** + * Parse the project from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName).project; + } + + /** + * Parse the location from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName).location; + } + + /** + * Parse the deployment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the deployment. + */ + matchDeploymentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName).deployment; + } + + /** + * Return a fully-qualified externalApi resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} external_api + * @returns {string} Resource name string. + */ + externalApiPath(project:string,location:string,externalApi:string) { + return this.pathTemplates.externalApiPathTemplate.render({ + project: project, + location: location, + external_api: externalApi, + }); + } + + /** + * Parse the project from ExternalApi resource. + * + * @param {string} externalApiName + * A fully-qualified path representing ExternalApi resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExternalApiName(externalApiName: string) { + return this.pathTemplates.externalApiPathTemplate.match(externalApiName).project; + } + + /** + * Parse the location from ExternalApi resource. + * + * @param {string} externalApiName + * A fully-qualified path representing ExternalApi resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExternalApiName(externalApiName: string) { + return this.pathTemplates.externalApiPathTemplate.match(externalApiName).location; + } + + /** + * Parse the external_api from ExternalApi resource. + * + * @param {string} externalApiName + * A fully-qualified path representing ExternalApi resource. + * @returns {string} A string representing the external_api. + */ + matchExternalApiFromExternalApiName(externalApiName: string) { + return this.pathTemplates.externalApiPathTemplate.match(externalApiName).external_api; + } + + /** + * Return a fully-qualified hostProjectRegistration resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} host_project_registration + * @returns {string} Resource name string. + */ + hostProjectRegistrationPath(project:string,location:string,hostProjectRegistration:string) { + return this.pathTemplates.hostProjectRegistrationPathTemplate.render({ + project: project, + location: location, + host_project_registration: hostProjectRegistration, + }); + } + + /** + * Parse the project from HostProjectRegistration resource. + * + * @param {string} hostProjectRegistrationName + * A fully-qualified path representing HostProjectRegistration resource. + * @returns {string} A string representing the project. + */ + matchProjectFromHostProjectRegistrationName(hostProjectRegistrationName: string) { + return this.pathTemplates.hostProjectRegistrationPathTemplate.match(hostProjectRegistrationName).project; + } + + /** + * Parse the location from HostProjectRegistration resource. + * + * @param {string} hostProjectRegistrationName + * A fully-qualified path representing HostProjectRegistration resource. + * @returns {string} A string representing the location. + */ + matchLocationFromHostProjectRegistrationName(hostProjectRegistrationName: string) { + return this.pathTemplates.hostProjectRegistrationPathTemplate.match(hostProjectRegistrationName).location; + } + + /** + * Parse the host_project_registration from HostProjectRegistration resource. + * + * @param {string} hostProjectRegistrationName + * A fully-qualified path representing HostProjectRegistration resource. + * @returns {string} A string representing the host_project_registration. + */ + matchHostProjectRegistrationFromHostProjectRegistrationName(hostProjectRegistrationName: string) { + return this.pathTemplates.hostProjectRegistrationPathTemplate.match(hostProjectRegistrationName).host_project_registration; + } + + /** + * Return a fully-qualified plugin resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} plugin + * @returns {string} Resource name string. + */ + pluginPath(project:string,location:string,plugin:string) { + return this.pathTemplates.pluginPathTemplate.render({ + project: project, + location: location, + plugin: plugin, + }); + } + + /** + * Parse the project from Plugin resource. + * + * @param {string} pluginName + * A fully-qualified path representing Plugin resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPluginName(pluginName: string) { + return this.pathTemplates.pluginPathTemplate.match(pluginName).project; + } + + /** + * Parse the location from Plugin resource. + * + * @param {string} pluginName + * A fully-qualified path representing Plugin resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPluginName(pluginName: string) { + return this.pathTemplates.pluginPathTemplate.match(pluginName).location; + } + + /** + * Parse the plugin from Plugin resource. + * + * @param {string} pluginName + * A fully-qualified path representing Plugin resource. + * @returns {string} A string representing the plugin. + */ + matchPluginFromPluginName(pluginName: string) { + return this.pathTemplates.pluginPathTemplate.match(pluginName).plugin; + } + + /** + * Return a fully-qualified runtimeProjectAttachment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} runtime_project_attachment + * @returns {string} Resource name string. + */ + runtimeProjectAttachmentPath(project:string,location:string,runtimeProjectAttachment:string) { + return this.pathTemplates.runtimeProjectAttachmentPathTemplate.render({ + project: project, + location: location, + runtime_project_attachment: runtimeProjectAttachment, + }); + } + + /** + * Parse the project from RuntimeProjectAttachment resource. + * + * @param {string} runtimeProjectAttachmentName + * A fully-qualified path representing RuntimeProjectAttachment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRuntimeProjectAttachmentName(runtimeProjectAttachmentName: string) { + return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match(runtimeProjectAttachmentName).project; + } + + /** + * Parse the location from RuntimeProjectAttachment resource. + * + * @param {string} runtimeProjectAttachmentName + * A fully-qualified path representing RuntimeProjectAttachment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRuntimeProjectAttachmentName(runtimeProjectAttachmentName: string) { + return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match(runtimeProjectAttachmentName).location; + } + + /** + * Parse the runtime_project_attachment from RuntimeProjectAttachment resource. + * + * @param {string} runtimeProjectAttachmentName + * A fully-qualified path representing RuntimeProjectAttachment resource. + * @returns {string} A string representing the runtime_project_attachment. + */ + matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName(runtimeProjectAttachmentName: string) { + return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match(runtimeProjectAttachmentName).runtime_project_attachment; + } + + /** + * Return a fully-qualified spec resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @param {string} version + * @param {string} spec + * @returns {string} Resource name string. + */ + specPath(project:string,location:string,api:string,version:string,spec:string) { + return this.pathTemplates.specPathTemplate.render({ + project: project, + location: location, + api: api, + version: version, + spec: spec, + }); + } + + /** + * Parse the project from Spec resource. + * + * @param {string} specName + * A fully-qualified path representing Spec resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSpecName(specName: string) { + return this.pathTemplates.specPathTemplate.match(specName).project; + } + + /** + * Parse the location from Spec resource. + * + * @param {string} specName + * A fully-qualified path representing Spec resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSpecName(specName: string) { + return this.pathTemplates.specPathTemplate.match(specName).location; + } + + /** + * Parse the api from Spec resource. + * + * @param {string} specName + * A fully-qualified path representing Spec resource. + * @returns {string} A string representing the api. + */ + matchApiFromSpecName(specName: string) { + return this.pathTemplates.specPathTemplate.match(specName).api; + } + + /** + * Parse the version from Spec resource. + * + * @param {string} specName + * A fully-qualified path representing Spec resource. + * @returns {string} A string representing the version. + */ + matchVersionFromSpecName(specName: string) { + return this.pathTemplates.specPathTemplate.match(specName).version; + } + + /** + * Parse the spec from Spec resource. + * + * @param {string} specName + * A fully-qualified path representing Spec resource. + * @returns {string} A string representing the spec. + */ + matchSpecFromSpecName(specName: string) { + return this.pathTemplates.specPathTemplate.match(specName).spec; + } + + /** + * Return a fully-qualified styleGuide resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} plugin + * @returns {string} Resource name string. + */ + styleGuidePath(project:string,location:string,plugin:string) { + return this.pathTemplates.styleGuidePathTemplate.render({ + project: project, + location: location, + plugin: plugin, + }); + } + + /** + * Parse the project from StyleGuide resource. + * + * @param {string} styleGuideName + * A fully-qualified path representing StyleGuide resource. + * @returns {string} A string representing the project. + */ + matchProjectFromStyleGuideName(styleGuideName: string) { + return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName).project; + } + + /** + * Parse the location from StyleGuide resource. + * + * @param {string} styleGuideName + * A fully-qualified path representing StyleGuide resource. + * @returns {string} A string representing the location. + */ + matchLocationFromStyleGuideName(styleGuideName: string) { + return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName).location; + } + + /** + * Parse the plugin from StyleGuide resource. + * + * @param {string} styleGuideName + * A fully-qualified path representing StyleGuide resource. + * @returns {string} A string representing the plugin. + */ + matchPluginFromStyleGuideName(styleGuideName: string) { + return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName).plugin; + } + + /** + * Return a fully-qualified version resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @param {string} version + * @returns {string} Resource name string. + */ + versionPath(project:string,location:string,api:string,version:string) { + return this.pathTemplates.versionPathTemplate.render({ + project: project, + location: location, + api: api, + version: version, + }); + } + + /** + * Parse the project from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the project. + */ + matchProjectFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).project; + } + + /** + * Parse the location from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the location. + */ + matchLocationFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).location; + } + + /** + * Parse the api from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the api. + */ + matchApiFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).api; + } + + /** + * Parse the version from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the version. + */ + matchVersionFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).version; + } + + /** + * 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.lintingServiceStub && !this._terminated) { + return this.lintingServiceStub.then(stub => { + this._terminated = true; + stub.close(); + this.locationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-cloud-apihub/v1/src/v1/linting_service_client_config.json b/owl-bot-staging/google-cloud-apihub/v1/src/v1/linting_service_client_config.json new file mode 100644 index 00000000000..83c20bac98a --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/src/v1/linting_service_client_config.json @@ -0,0 +1,58 @@ +{ + "interfaces": { + "google.cloud.apihub.v1.LintingService": { + "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": { + "GetStyleGuide": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "UpdateStyleGuide": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetStyleGuideContents": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "LintSpec": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-apihub/v1/src/v1/linting_service_proto_list.json b/owl-bot-staging/google-cloud-apihub/v1/src/v1/linting_service_proto_list.json new file mode 100644 index 00000000000..07e987f7fb3 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/src/v1/linting_service_proto_list.json @@ -0,0 +1,9 @@ +[ + "../../protos/google/cloud/apihub/v1/apihub_service.proto", + "../../protos/google/cloud/apihub/v1/common_fields.proto", + "../../protos/google/cloud/apihub/v1/host_project_registration_service.proto", + "../../protos/google/cloud/apihub/v1/linting_service.proto", + "../../protos/google/cloud/apihub/v1/plugin_service.proto", + "../../protos/google/cloud/apihub/v1/provisioning_service.proto", + "../../protos/google/cloud/apihub/v1/runtime_project_attachment_service.proto" +] diff --git a/owl-bot-staging/google-cloud-apihub/v1/src/v1/provisioning_client.ts b/owl-bot-staging/google-cloud-apihub/v1/src/v1/provisioning_client.ts new file mode 100644 index 00000000000..6bed4d9bb76 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/src/v1/provisioning_client.ts @@ -0,0 +1,1767 @@ +// Copyright 2024 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, LocationsClient, LocationProtos} from 'google-gax'; + +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); + +/** + * Client JSON configuration object, loaded from + * `src/v1/provisioning_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './provisioning_client_config.json'; +const version = require('../../../package.json').version; + +/** + * This service is used for managing the data plane provisioning of the API hub. + * @class + * @memberof v1 + */ +export class ProvisioningClient { + 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}; + private _universeDomain: string; + private _servicePath: string; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + locationsClient: LocationsClient; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + provisioningStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of ProvisioningClient. + * + * @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 ProvisioningClient({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 ProvisioningClient; + if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { + throw new Error('Please set either universe_domain or universeDomain, but not both.'); + } + const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; + this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; + this._servicePath = 'apihub.' + this._universeDomain; + const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). + if (!opts) { + opts = {fallback: true}; + } else { + opts.fallback = opts.fallback ?? true; + } + 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 !== this._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 = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + 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 === 'object' && '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 = { + apiPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}' + ), + apiHubInstancePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apiHubInstances/{api_hub_instance}' + ), + apiOperationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}' + ), + attributePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/attributes/{attribute}' + ), + definitionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}' + ), + dependencyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/dependencies/{dependency}' + ), + deploymentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/deployments/{deployment}' + ), + externalApiPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/externalApis/{external_api}' + ), + hostProjectRegistrationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/hostProjectRegistrations/{host_project_registration}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + pluginPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/plugins/{plugin}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + runtimeProjectAttachmentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}' + ), + specPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}' + ), + styleGuidePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/plugins/{plugin}/styleGuide' + ), + versionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}/versions/{version}' + ), + }; + + 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.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 createApiHubInstanceResponse = protoFilesRoot.lookup( + '.google.cloud.apihub.v1.ApiHubInstance') as gax.protobuf.Type; + const createApiHubInstanceMetadata = protoFilesRoot.lookup( + '.google.cloud.apihub.v1.OperationMetadata') as gax.protobuf.Type; + + this.descriptors.longrunning = { + createApiHubInstance: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createApiHubInstanceResponse.decode.bind(createApiHubInstanceResponse), + createApiHubInstanceMetadata.decode.bind(createApiHubInstanceMetadata)) + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.apihub.v1.Provisioning', 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.provisioningStub) { + return this.provisioningStub; + } + + // Put together the "service stub" for + // google.cloud.apihub.v1.Provisioning. + this.provisioningStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.apihub.v1.Provisioning') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.apihub.v1.Provisioning, + 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 provisioningStubMethods = + ['createApiHubInstance', 'getApiHubInstance', 'lookupApiHubInstance']; + for (const methodName of provisioningStubMethods) { + const callPromise = this.provisioningStub.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.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.provisioningStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'apihub.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'apihub.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * 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 API Hub instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the Api Hub instance to retrieve. + * Format: + * `projects/{project}/locations/{location}/apiHubInstances/{apiHubInstance}`. + * @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.apihub.v1.ApiHubInstance|ApiHubInstance}. + * 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/provisioning.get_api_hub_instance.js + * region_tag:apihub_v1_generated_Provisioning_GetApiHubInstance_async + */ + getApiHubInstance( + request?: protos.google.cloud.apihub.v1.IGetApiHubInstanceRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.apihub.v1.IApiHubInstance, + protos.google.cloud.apihub.v1.IGetApiHubInstanceRequest|undefined, {}|undefined + ]>; + getApiHubInstance( + request: protos.google.cloud.apihub.v1.IGetApiHubInstanceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.IApiHubInstance, + protos.google.cloud.apihub.v1.IGetApiHubInstanceRequest|null|undefined, + {}|null|undefined>): void; + getApiHubInstance( + request: protos.google.cloud.apihub.v1.IGetApiHubInstanceRequest, + callback: Callback< + protos.google.cloud.apihub.v1.IApiHubInstance, + protos.google.cloud.apihub.v1.IGetApiHubInstanceRequest|null|undefined, + {}|null|undefined>): void; + getApiHubInstance( + request?: protos.google.cloud.apihub.v1.IGetApiHubInstanceRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.apihub.v1.IApiHubInstance, + protos.google.cloud.apihub.v1.IGetApiHubInstanceRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.apihub.v1.IApiHubInstance, + protos.google.cloud.apihub.v1.IGetApiHubInstanceRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.apihub.v1.IApiHubInstance, + protos.google.cloud.apihub.v1.IGetApiHubInstanceRequest|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.getApiHubInstance(request, options, callback); + } +/** + * Looks up an Api Hub instance in a given GCP project. There will always be + * only one Api Hub instance for a GCP project across all locations. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. There will always be only one Api Hub instance for a GCP project + * across all locations. + * The parent resource for the Api Hub instance resource. + * Format: `projects/{project}/locations/{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 protos.google.cloud.apihub.v1.LookupApiHubInstanceResponse|LookupApiHubInstanceResponse}. + * 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/provisioning.lookup_api_hub_instance.js + * region_tag:apihub_v1_generated_Provisioning_LookupApiHubInstance_async + */ + lookupApiHubInstance( + request?: protos.google.cloud.apihub.v1.ILookupApiHubInstanceRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.apihub.v1.ILookupApiHubInstanceResponse, + protos.google.cloud.apihub.v1.ILookupApiHubInstanceRequest|undefined, {}|undefined + ]>; + lookupApiHubInstance( + request: protos.google.cloud.apihub.v1.ILookupApiHubInstanceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.ILookupApiHubInstanceResponse, + protos.google.cloud.apihub.v1.ILookupApiHubInstanceRequest|null|undefined, + {}|null|undefined>): void; + lookupApiHubInstance( + request: protos.google.cloud.apihub.v1.ILookupApiHubInstanceRequest, + callback: Callback< + protos.google.cloud.apihub.v1.ILookupApiHubInstanceResponse, + protos.google.cloud.apihub.v1.ILookupApiHubInstanceRequest|null|undefined, + {}|null|undefined>): void; + lookupApiHubInstance( + request?: protos.google.cloud.apihub.v1.ILookupApiHubInstanceRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.apihub.v1.ILookupApiHubInstanceResponse, + protos.google.cloud.apihub.v1.ILookupApiHubInstanceRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.apihub.v1.ILookupApiHubInstanceResponse, + protos.google.cloud.apihub.v1.ILookupApiHubInstanceRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.apihub.v1.ILookupApiHubInstanceResponse, + protos.google.cloud.apihub.v1.ILookupApiHubInstanceRequest|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.lookupApiHubInstance(request, options, callback); + } + +/** + * Provisions instance resources for the API Hub. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource for the Api Hub instance resource. + * Format: `projects/{project}/locations/{location}` + * @param {string} [request.apiHubInstanceId] + * Optional. Identifier to assign to the Api Hub instance. Must be unique + * within scope of the parent resource. If the field is not provided, system + * generated id will be used. + * + * This value should be 4-40 characters, and valid characters + * are `/{@link protos.A-Z|a-z}[0-9]-_/`. + * @param {google.cloud.apihub.v1.ApiHubInstance} request.apiHubInstance + * Required. The ApiHub instance. + * @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/provisioning.create_api_hub_instance.js + * region_tag:apihub_v1_generated_Provisioning_CreateApiHubInstance_async + */ + createApiHubInstance( + request?: protos.google.cloud.apihub.v1.ICreateApiHubInstanceRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + createApiHubInstance( + request: protos.google.cloud.apihub.v1.ICreateApiHubInstanceRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createApiHubInstance( + request: protos.google.cloud.apihub.v1.ICreateApiHubInstanceRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createApiHubInstance( + request?: protos.google.cloud.apihub.v1.ICreateApiHubInstanceRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + 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.createApiHubInstance(request, options, callback); + } +/** + * Check the status of the long running operation returned by `createApiHubInstance()`. + * @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/provisioning.create_api_hub_instance.js + * region_tag:apihub_v1_generated_Provisioning_CreateApiHubInstance_async + */ + async checkCreateApiHubInstanceProgress(name: string): Promise>{ + 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.createApiHubInstance, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * 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 api resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @returns {string} Resource name string. + */ + apiPath(project:string,location:string,api:string) { + return this.pathTemplates.apiPathTemplate.render({ + project: project, + location: location, + api: api, + }); + } + + /** + * Parse the project from Api resource. + * + * @param {string} apiName + * A fully-qualified path representing Api resource. + * @returns {string} A string representing the project. + */ + matchProjectFromApiName(apiName: string) { + return this.pathTemplates.apiPathTemplate.match(apiName).project; + } + + /** + * Parse the location from Api resource. + * + * @param {string} apiName + * A fully-qualified path representing Api resource. + * @returns {string} A string representing the location. + */ + matchLocationFromApiName(apiName: string) { + return this.pathTemplates.apiPathTemplate.match(apiName).location; + } + + /** + * Parse the api from Api resource. + * + * @param {string} apiName + * A fully-qualified path representing Api resource. + * @returns {string} A string representing the api. + */ + matchApiFromApiName(apiName: string) { + return this.pathTemplates.apiPathTemplate.match(apiName).api; + } + + /** + * Return a fully-qualified apiHubInstance resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api_hub_instance + * @returns {string} Resource name string. + */ + apiHubInstancePath(project:string,location:string,apiHubInstance:string) { + return this.pathTemplates.apiHubInstancePathTemplate.render({ + project: project, + location: location, + api_hub_instance: apiHubInstance, + }); + } + + /** + * Parse the project from ApiHubInstance resource. + * + * @param {string} apiHubInstanceName + * A fully-qualified path representing ApiHubInstance resource. + * @returns {string} A string representing the project. + */ + matchProjectFromApiHubInstanceName(apiHubInstanceName: string) { + return this.pathTemplates.apiHubInstancePathTemplate.match(apiHubInstanceName).project; + } + + /** + * Parse the location from ApiHubInstance resource. + * + * @param {string} apiHubInstanceName + * A fully-qualified path representing ApiHubInstance resource. + * @returns {string} A string representing the location. + */ + matchLocationFromApiHubInstanceName(apiHubInstanceName: string) { + return this.pathTemplates.apiHubInstancePathTemplate.match(apiHubInstanceName).location; + } + + /** + * Parse the api_hub_instance from ApiHubInstance resource. + * + * @param {string} apiHubInstanceName + * A fully-qualified path representing ApiHubInstance resource. + * @returns {string} A string representing the api_hub_instance. + */ + matchApiHubInstanceFromApiHubInstanceName(apiHubInstanceName: string) { + return this.pathTemplates.apiHubInstancePathTemplate.match(apiHubInstanceName).api_hub_instance; + } + + /** + * Return a fully-qualified apiOperation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @param {string} version + * @param {string} operation + * @returns {string} Resource name string. + */ + apiOperationPath(project:string,location:string,api:string,version:string,operation:string) { + return this.pathTemplates.apiOperationPathTemplate.render({ + project: project, + location: location, + api: api, + version: version, + operation: operation, + }); + } + + /** + * Parse the project from ApiOperation resource. + * + * @param {string} apiOperationName + * A fully-qualified path representing ApiOperation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromApiOperationName(apiOperationName: string) { + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).project; + } + + /** + * Parse the location from ApiOperation resource. + * + * @param {string} apiOperationName + * A fully-qualified path representing ApiOperation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromApiOperationName(apiOperationName: string) { + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).location; + } + + /** + * Parse the api from ApiOperation resource. + * + * @param {string} apiOperationName + * A fully-qualified path representing ApiOperation resource. + * @returns {string} A string representing the api. + */ + matchApiFromApiOperationName(apiOperationName: string) { + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).api; + } + + /** + * Parse the version from ApiOperation resource. + * + * @param {string} apiOperationName + * A fully-qualified path representing ApiOperation resource. + * @returns {string} A string representing the version. + */ + matchVersionFromApiOperationName(apiOperationName: string) { + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).version; + } + + /** + * Parse the operation from ApiOperation resource. + * + * @param {string} apiOperationName + * A fully-qualified path representing ApiOperation resource. + * @returns {string} A string representing the operation. + */ + matchOperationFromApiOperationName(apiOperationName: string) { + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).operation; + } + + /** + * Return a fully-qualified attribute resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} attribute + * @returns {string} Resource name string. + */ + attributePath(project:string,location:string,attribute:string) { + return this.pathTemplates.attributePathTemplate.render({ + project: project, + location: location, + attribute: attribute, + }); + } + + /** + * Parse the project from Attribute resource. + * + * @param {string} attributeName + * A fully-qualified path representing Attribute resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAttributeName(attributeName: string) { + return this.pathTemplates.attributePathTemplate.match(attributeName).project; + } + + /** + * Parse the location from Attribute resource. + * + * @param {string} attributeName + * A fully-qualified path representing Attribute resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAttributeName(attributeName: string) { + return this.pathTemplates.attributePathTemplate.match(attributeName).location; + } + + /** + * Parse the attribute from Attribute resource. + * + * @param {string} attributeName + * A fully-qualified path representing Attribute resource. + * @returns {string} A string representing the attribute. + */ + matchAttributeFromAttributeName(attributeName: string) { + return this.pathTemplates.attributePathTemplate.match(attributeName).attribute; + } + + /** + * Return a fully-qualified definition resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @param {string} version + * @param {string} definition + * @returns {string} Resource name string. + */ + definitionPath(project:string,location:string,api:string,version:string,definition:string) { + return this.pathTemplates.definitionPathTemplate.render({ + project: project, + location: location, + api: api, + version: version, + definition: definition, + }); + } + + /** + * Parse the project from Definition resource. + * + * @param {string} definitionName + * A fully-qualified path representing Definition resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDefinitionName(definitionName: string) { + return this.pathTemplates.definitionPathTemplate.match(definitionName).project; + } + + /** + * Parse the location from Definition resource. + * + * @param {string} definitionName + * A fully-qualified path representing Definition resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDefinitionName(definitionName: string) { + return this.pathTemplates.definitionPathTemplate.match(definitionName).location; + } + + /** + * Parse the api from Definition resource. + * + * @param {string} definitionName + * A fully-qualified path representing Definition resource. + * @returns {string} A string representing the api. + */ + matchApiFromDefinitionName(definitionName: string) { + return this.pathTemplates.definitionPathTemplate.match(definitionName).api; + } + + /** + * Parse the version from Definition resource. + * + * @param {string} definitionName + * A fully-qualified path representing Definition resource. + * @returns {string} A string representing the version. + */ + matchVersionFromDefinitionName(definitionName: string) { + return this.pathTemplates.definitionPathTemplate.match(definitionName).version; + } + + /** + * Parse the definition from Definition resource. + * + * @param {string} definitionName + * A fully-qualified path representing Definition resource. + * @returns {string} A string representing the definition. + */ + matchDefinitionFromDefinitionName(definitionName: string) { + return this.pathTemplates.definitionPathTemplate.match(definitionName).definition; + } + + /** + * Return a fully-qualified dependency resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dependency + * @returns {string} Resource name string. + */ + dependencyPath(project:string,location:string,dependency:string) { + return this.pathTemplates.dependencyPathTemplate.render({ + project: project, + location: location, + dependency: dependency, + }); + } + + /** + * Parse the project from Dependency resource. + * + * @param {string} dependencyName + * A fully-qualified path representing Dependency resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDependencyName(dependencyName: string) { + return this.pathTemplates.dependencyPathTemplate.match(dependencyName).project; + } + + /** + * Parse the location from Dependency resource. + * + * @param {string} dependencyName + * A fully-qualified path representing Dependency resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDependencyName(dependencyName: string) { + return this.pathTemplates.dependencyPathTemplate.match(dependencyName).location; + } + + /** + * Parse the dependency from Dependency resource. + * + * @param {string} dependencyName + * A fully-qualified path representing Dependency resource. + * @returns {string} A string representing the dependency. + */ + matchDependencyFromDependencyName(dependencyName: string) { + return this.pathTemplates.dependencyPathTemplate.match(dependencyName).dependency; + } + + /** + * Return a fully-qualified deployment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} deployment + * @returns {string} Resource name string. + */ + deploymentPath(project:string,location:string,deployment:string) { + return this.pathTemplates.deploymentPathTemplate.render({ + project: project, + location: location, + deployment: deployment, + }); + } + + /** + * Parse the project from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName).project; + } + + /** + * Parse the location from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName).location; + } + + /** + * Parse the deployment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the deployment. + */ + matchDeploymentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName).deployment; + } + + /** + * Return a fully-qualified externalApi resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} external_api + * @returns {string} Resource name string. + */ + externalApiPath(project:string,location:string,externalApi:string) { + return this.pathTemplates.externalApiPathTemplate.render({ + project: project, + location: location, + external_api: externalApi, + }); + } + + /** + * Parse the project from ExternalApi resource. + * + * @param {string} externalApiName + * A fully-qualified path representing ExternalApi resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExternalApiName(externalApiName: string) { + return this.pathTemplates.externalApiPathTemplate.match(externalApiName).project; + } + + /** + * Parse the location from ExternalApi resource. + * + * @param {string} externalApiName + * A fully-qualified path representing ExternalApi resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExternalApiName(externalApiName: string) { + return this.pathTemplates.externalApiPathTemplate.match(externalApiName).location; + } + + /** + * Parse the external_api from ExternalApi resource. + * + * @param {string} externalApiName + * A fully-qualified path representing ExternalApi resource. + * @returns {string} A string representing the external_api. + */ + matchExternalApiFromExternalApiName(externalApiName: string) { + return this.pathTemplates.externalApiPathTemplate.match(externalApiName).external_api; + } + + /** + * Return a fully-qualified hostProjectRegistration resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} host_project_registration + * @returns {string} Resource name string. + */ + hostProjectRegistrationPath(project:string,location:string,hostProjectRegistration:string) { + return this.pathTemplates.hostProjectRegistrationPathTemplate.render({ + project: project, + location: location, + host_project_registration: hostProjectRegistration, + }); + } + + /** + * Parse the project from HostProjectRegistration resource. + * + * @param {string} hostProjectRegistrationName + * A fully-qualified path representing HostProjectRegistration resource. + * @returns {string} A string representing the project. + */ + matchProjectFromHostProjectRegistrationName(hostProjectRegistrationName: string) { + return this.pathTemplates.hostProjectRegistrationPathTemplate.match(hostProjectRegistrationName).project; + } + + /** + * Parse the location from HostProjectRegistration resource. + * + * @param {string} hostProjectRegistrationName + * A fully-qualified path representing HostProjectRegistration resource. + * @returns {string} A string representing the location. + */ + matchLocationFromHostProjectRegistrationName(hostProjectRegistrationName: string) { + return this.pathTemplates.hostProjectRegistrationPathTemplate.match(hostProjectRegistrationName).location; + } + + /** + * Parse the host_project_registration from HostProjectRegistration resource. + * + * @param {string} hostProjectRegistrationName + * A fully-qualified path representing HostProjectRegistration resource. + * @returns {string} A string representing the host_project_registration. + */ + matchHostProjectRegistrationFromHostProjectRegistrationName(hostProjectRegistrationName: string) { + return this.pathTemplates.hostProjectRegistrationPathTemplate.match(hostProjectRegistrationName).host_project_registration; + } + + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project:string,location:string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + + /** + * Return a fully-qualified plugin resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} plugin + * @returns {string} Resource name string. + */ + pluginPath(project:string,location:string,plugin:string) { + return this.pathTemplates.pluginPathTemplate.render({ + project: project, + location: location, + plugin: plugin, + }); + } + + /** + * Parse the project from Plugin resource. + * + * @param {string} pluginName + * A fully-qualified path representing Plugin resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPluginName(pluginName: string) { + return this.pathTemplates.pluginPathTemplate.match(pluginName).project; + } + + /** + * Parse the location from Plugin resource. + * + * @param {string} pluginName + * A fully-qualified path representing Plugin resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPluginName(pluginName: string) { + return this.pathTemplates.pluginPathTemplate.match(pluginName).location; + } + + /** + * Parse the plugin from Plugin resource. + * + * @param {string} pluginName + * A fully-qualified path representing Plugin resource. + * @returns {string} A string representing the plugin. + */ + matchPluginFromPluginName(pluginName: string) { + return this.pathTemplates.pluginPathTemplate.match(pluginName).plugin; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project:string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified runtimeProjectAttachment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} runtime_project_attachment + * @returns {string} Resource name string. + */ + runtimeProjectAttachmentPath(project:string,location:string,runtimeProjectAttachment:string) { + return this.pathTemplates.runtimeProjectAttachmentPathTemplate.render({ + project: project, + location: location, + runtime_project_attachment: runtimeProjectAttachment, + }); + } + + /** + * Parse the project from RuntimeProjectAttachment resource. + * + * @param {string} runtimeProjectAttachmentName + * A fully-qualified path representing RuntimeProjectAttachment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRuntimeProjectAttachmentName(runtimeProjectAttachmentName: string) { + return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match(runtimeProjectAttachmentName).project; + } + + /** + * Parse the location from RuntimeProjectAttachment resource. + * + * @param {string} runtimeProjectAttachmentName + * A fully-qualified path representing RuntimeProjectAttachment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRuntimeProjectAttachmentName(runtimeProjectAttachmentName: string) { + return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match(runtimeProjectAttachmentName).location; + } + + /** + * Parse the runtime_project_attachment from RuntimeProjectAttachment resource. + * + * @param {string} runtimeProjectAttachmentName + * A fully-qualified path representing RuntimeProjectAttachment resource. + * @returns {string} A string representing the runtime_project_attachment. + */ + matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName(runtimeProjectAttachmentName: string) { + return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match(runtimeProjectAttachmentName).runtime_project_attachment; + } + + /** + * Return a fully-qualified spec resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @param {string} version + * @param {string} spec + * @returns {string} Resource name string. + */ + specPath(project:string,location:string,api:string,version:string,spec:string) { + return this.pathTemplates.specPathTemplate.render({ + project: project, + location: location, + api: api, + version: version, + spec: spec, + }); + } + + /** + * Parse the project from Spec resource. + * + * @param {string} specName + * A fully-qualified path representing Spec resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSpecName(specName: string) { + return this.pathTemplates.specPathTemplate.match(specName).project; + } + + /** + * Parse the location from Spec resource. + * + * @param {string} specName + * A fully-qualified path representing Spec resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSpecName(specName: string) { + return this.pathTemplates.specPathTemplate.match(specName).location; + } + + /** + * Parse the api from Spec resource. + * + * @param {string} specName + * A fully-qualified path representing Spec resource. + * @returns {string} A string representing the api. + */ + matchApiFromSpecName(specName: string) { + return this.pathTemplates.specPathTemplate.match(specName).api; + } + + /** + * Parse the version from Spec resource. + * + * @param {string} specName + * A fully-qualified path representing Spec resource. + * @returns {string} A string representing the version. + */ + matchVersionFromSpecName(specName: string) { + return this.pathTemplates.specPathTemplate.match(specName).version; + } + + /** + * Parse the spec from Spec resource. + * + * @param {string} specName + * A fully-qualified path representing Spec resource. + * @returns {string} A string representing the spec. + */ + matchSpecFromSpecName(specName: string) { + return this.pathTemplates.specPathTemplate.match(specName).spec; + } + + /** + * Return a fully-qualified styleGuide resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} plugin + * @returns {string} Resource name string. + */ + styleGuidePath(project:string,location:string,plugin:string) { + return this.pathTemplates.styleGuidePathTemplate.render({ + project: project, + location: location, + plugin: plugin, + }); + } + + /** + * Parse the project from StyleGuide resource. + * + * @param {string} styleGuideName + * A fully-qualified path representing StyleGuide resource. + * @returns {string} A string representing the project. + */ + matchProjectFromStyleGuideName(styleGuideName: string) { + return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName).project; + } + + /** + * Parse the location from StyleGuide resource. + * + * @param {string} styleGuideName + * A fully-qualified path representing StyleGuide resource. + * @returns {string} A string representing the location. + */ + matchLocationFromStyleGuideName(styleGuideName: string) { + return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName).location; + } + + /** + * Parse the plugin from StyleGuide resource. + * + * @param {string} styleGuideName + * A fully-qualified path representing StyleGuide resource. + * @returns {string} A string representing the plugin. + */ + matchPluginFromStyleGuideName(styleGuideName: string) { + return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName).plugin; + } + + /** + * Return a fully-qualified version resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @param {string} version + * @returns {string} Resource name string. + */ + versionPath(project:string,location:string,api:string,version:string) { + return this.pathTemplates.versionPathTemplate.render({ + project: project, + location: location, + api: api, + version: version, + }); + } + + /** + * Parse the project from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the project. + */ + matchProjectFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).project; + } + + /** + * Parse the location from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the location. + */ + matchLocationFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).location; + } + + /** + * Parse the api from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the api. + */ + matchApiFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).api; + } + + /** + * Parse the version from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the version. + */ + matchVersionFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).version; + } + + /** + * 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.provisioningStub && !this._terminated) { + return this.provisioningStub.then(stub => { + this._terminated = true; + stub.close(); + this.locationsClient.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-cloud-apihub/v1/src/v1/provisioning_client_config.json b/owl-bot-staging/google-cloud-apihub/v1/src/v1/provisioning_client_config.json new file mode 100644 index 00000000000..828739a1214 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/src/v1/provisioning_client_config.json @@ -0,0 +1,53 @@ +{ + "interfaces": { + "google.cloud.apihub.v1.Provisioning": { + "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": { + "CreateApiHubInstance": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetApiHubInstance": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "LookupApiHubInstance": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-apihub/v1/src/v1/provisioning_proto_list.json b/owl-bot-staging/google-cloud-apihub/v1/src/v1/provisioning_proto_list.json new file mode 100644 index 00000000000..07e987f7fb3 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/src/v1/provisioning_proto_list.json @@ -0,0 +1,9 @@ +[ + "../../protos/google/cloud/apihub/v1/apihub_service.proto", + "../../protos/google/cloud/apihub/v1/common_fields.proto", + "../../protos/google/cloud/apihub/v1/host_project_registration_service.proto", + "../../protos/google/cloud/apihub/v1/linting_service.proto", + "../../protos/google/cloud/apihub/v1/plugin_service.proto", + "../../protos/google/cloud/apihub/v1/provisioning_service.proto", + "../../protos/google/cloud/apihub/v1/runtime_project_attachment_service.proto" +] diff --git a/owl-bot-staging/google-cloud-apihub/v1/src/v1/runtime_project_attachment_service_client.ts b/owl-bot-staging/google-cloud-apihub/v1/src/v1/runtime_project_attachment_service_client.ts new file mode 100644 index 00000000000..0593b85e83e --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/src/v1/runtime_project_attachment_service_client.ts @@ -0,0 +1,1881 @@ +// Copyright 2024 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, PaginationCallback, GaxCall, 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/runtime_project_attachment_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './runtime_project_attachment_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * This service is used for managing the runtime project attachments. + * @class + * @memberof v1 + */ +export class RuntimeProjectAttachmentServiceClient { + 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}; + private _universeDomain: string; + private _servicePath: string; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + locationsClient: LocationsClient; + pathTemplates: {[name: string]: gax.PathTemplate}; + runtimeProjectAttachmentServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of RuntimeProjectAttachmentServiceClient. + * + * @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 RuntimeProjectAttachmentServiceClient({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 RuntimeProjectAttachmentServiceClient; + if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { + throw new Error('Please set either universe_domain or universeDomain, but not both.'); + } + const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; + this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; + this._servicePath = 'apihub.' + this._universeDomain; + const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). + if (!opts) { + opts = {fallback: true}; + } else { + opts.fallback = opts.fallback ?? true; + } + 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 !== this._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 = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + 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 === 'object' && '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 = { + apiPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}' + ), + apiHubInstancePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apiHubInstances/{api_hub_instance}' + ), + apiOperationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}' + ), + attributePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/attributes/{attribute}' + ), + definitionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}' + ), + dependencyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/dependencies/{dependency}' + ), + deploymentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/deployments/{deployment}' + ), + externalApiPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/externalApis/{external_api}' + ), + hostProjectRegistrationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/hostProjectRegistrations/{host_project_registration}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + pluginPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/plugins/{plugin}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + runtimeProjectAttachmentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}' + ), + specPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}' + ), + styleGuidePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/plugins/{plugin}/styleGuide' + ), + versionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}/versions/{version}' + ), + }; + + // 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 = { + listRuntimeProjectAttachments: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'runtimeProjectAttachments') + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.apihub.v1.RuntimeProjectAttachmentService', 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.runtimeProjectAttachmentServiceStub) { + return this.runtimeProjectAttachmentServiceStub; + } + + // Put together the "service stub" for + // google.cloud.apihub.v1.RuntimeProjectAttachmentService. + this.runtimeProjectAttachmentServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.apihub.v1.RuntimeProjectAttachmentService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.apihub.v1.RuntimeProjectAttachmentService, + 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 runtimeProjectAttachmentServiceStubMethods = + ['createRuntimeProjectAttachment', 'getRuntimeProjectAttachment', 'listRuntimeProjectAttachments', 'deleteRuntimeProjectAttachment', 'lookupRuntimeProjectAttachment']; + for (const methodName of runtimeProjectAttachmentServiceStubMethods) { + const callPromise = this.runtimeProjectAttachmentServiceStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + this.descriptors.page[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.runtimeProjectAttachmentServiceStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'apihub.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'apihub.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * 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 -- + // ------------------- +/** + * Attaches a runtime project to the host project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource for the Runtime Project Attachment. + * Format: `projects/{project}/locations/{location}` + * @param {string} request.runtimeProjectAttachmentId + * Required. The ID to use for the Runtime Project Attachment, which will + * become the final component of the Runtime Project Attachment's name. The ID + * must be the same as the project ID of the Google cloud project specified in + * the runtime_project_attachment.runtime_project field. + * @param {google.cloud.apihub.v1.RuntimeProjectAttachment} request.runtimeProjectAttachment + * Required. The Runtime Project Attachment to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.apihub.v1.RuntimeProjectAttachment|RuntimeProjectAttachment}. + * 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/runtime_project_attachment_service.create_runtime_project_attachment.js + * region_tag:apihub_v1_generated_RuntimeProjectAttachmentService_CreateRuntimeProjectAttachment_async + */ + createRuntimeProjectAttachment( + request?: protos.google.cloud.apihub.v1.ICreateRuntimeProjectAttachmentRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.apihub.v1.IRuntimeProjectAttachment, + protos.google.cloud.apihub.v1.ICreateRuntimeProjectAttachmentRequest|undefined, {}|undefined + ]>; + createRuntimeProjectAttachment( + request: protos.google.cloud.apihub.v1.ICreateRuntimeProjectAttachmentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.IRuntimeProjectAttachment, + protos.google.cloud.apihub.v1.ICreateRuntimeProjectAttachmentRequest|null|undefined, + {}|null|undefined>): void; + createRuntimeProjectAttachment( + request: protos.google.cloud.apihub.v1.ICreateRuntimeProjectAttachmentRequest, + callback: Callback< + protos.google.cloud.apihub.v1.IRuntimeProjectAttachment, + protos.google.cloud.apihub.v1.ICreateRuntimeProjectAttachmentRequest|null|undefined, + {}|null|undefined>): void; + createRuntimeProjectAttachment( + request?: protos.google.cloud.apihub.v1.ICreateRuntimeProjectAttachmentRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.apihub.v1.IRuntimeProjectAttachment, + protos.google.cloud.apihub.v1.ICreateRuntimeProjectAttachmentRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.apihub.v1.IRuntimeProjectAttachment, + protos.google.cloud.apihub.v1.ICreateRuntimeProjectAttachmentRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.apihub.v1.IRuntimeProjectAttachment, + protos.google.cloud.apihub.v1.ICreateRuntimeProjectAttachmentRequest|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.createRuntimeProjectAttachment(request, options, callback); + } +/** + * Gets a runtime project attachment. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the API resource to retrieve. + * Format: + * `projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}` + * @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.apihub.v1.RuntimeProjectAttachment|RuntimeProjectAttachment}. + * 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/runtime_project_attachment_service.get_runtime_project_attachment.js + * region_tag:apihub_v1_generated_RuntimeProjectAttachmentService_GetRuntimeProjectAttachment_async + */ + getRuntimeProjectAttachment( + request?: protos.google.cloud.apihub.v1.IGetRuntimeProjectAttachmentRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.apihub.v1.IRuntimeProjectAttachment, + protos.google.cloud.apihub.v1.IGetRuntimeProjectAttachmentRequest|undefined, {}|undefined + ]>; + getRuntimeProjectAttachment( + request: protos.google.cloud.apihub.v1.IGetRuntimeProjectAttachmentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.IRuntimeProjectAttachment, + protos.google.cloud.apihub.v1.IGetRuntimeProjectAttachmentRequest|null|undefined, + {}|null|undefined>): void; + getRuntimeProjectAttachment( + request: protos.google.cloud.apihub.v1.IGetRuntimeProjectAttachmentRequest, + callback: Callback< + protos.google.cloud.apihub.v1.IRuntimeProjectAttachment, + protos.google.cloud.apihub.v1.IGetRuntimeProjectAttachmentRequest|null|undefined, + {}|null|undefined>): void; + getRuntimeProjectAttachment( + request?: protos.google.cloud.apihub.v1.IGetRuntimeProjectAttachmentRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.apihub.v1.IRuntimeProjectAttachment, + protos.google.cloud.apihub.v1.IGetRuntimeProjectAttachmentRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.apihub.v1.IRuntimeProjectAttachment, + protos.google.cloud.apihub.v1.IGetRuntimeProjectAttachmentRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.apihub.v1.IRuntimeProjectAttachment, + protos.google.cloud.apihub.v1.IGetRuntimeProjectAttachmentRequest|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.getRuntimeProjectAttachment(request, options, callback); + } +/** + * Delete a runtime project attachment in the API Hub. This call will detach + * the runtime project from the host project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the Runtime Project Attachment to delete. + * Format: + * `projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}` + * @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.protobuf.Empty|Empty}. + * 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/runtime_project_attachment_service.delete_runtime_project_attachment.js + * region_tag:apihub_v1_generated_RuntimeProjectAttachmentService_DeleteRuntimeProjectAttachment_async + */ + deleteRuntimeProjectAttachment( + request?: protos.google.cloud.apihub.v1.IDeleteRuntimeProjectAttachmentRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteRuntimeProjectAttachmentRequest|undefined, {}|undefined + ]>; + deleteRuntimeProjectAttachment( + request: protos.google.cloud.apihub.v1.IDeleteRuntimeProjectAttachmentRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteRuntimeProjectAttachmentRequest|null|undefined, + {}|null|undefined>): void; + deleteRuntimeProjectAttachment( + request: protos.google.cloud.apihub.v1.IDeleteRuntimeProjectAttachmentRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteRuntimeProjectAttachmentRequest|null|undefined, + {}|null|undefined>): void; + deleteRuntimeProjectAttachment( + request?: protos.google.cloud.apihub.v1.IDeleteRuntimeProjectAttachmentRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteRuntimeProjectAttachmentRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteRuntimeProjectAttachmentRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteRuntimeProjectAttachmentRequest|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.deleteRuntimeProjectAttachment(request, options, callback); + } +/** + * Look up a runtime project attachment. This API can be called in the context + * of any project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Runtime project ID to look up runtime project attachment for. + * Lookup happens across all regions. Expected format: + * `projects/{project}/locations/{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 protos.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse|LookupRuntimeProjectAttachmentResponse}. + * 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/runtime_project_attachment_service.lookup_runtime_project_attachment.js + * region_tag:apihub_v1_generated_RuntimeProjectAttachmentService_LookupRuntimeProjectAttachment_async + */ + lookupRuntimeProjectAttachment( + request?: protos.google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentResponse, + protos.google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentRequest|undefined, {}|undefined + ]>; + lookupRuntimeProjectAttachment( + request: protos.google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentResponse, + protos.google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentRequest|null|undefined, + {}|null|undefined>): void; + lookupRuntimeProjectAttachment( + request: protos.google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentRequest, + callback: Callback< + protos.google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentResponse, + protos.google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentRequest|null|undefined, + {}|null|undefined>): void; + lookupRuntimeProjectAttachment( + request?: protos.google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentResponse, + protos.google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentResponse, + protos.google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentResponse, + protos.google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentRequest|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.lookupRuntimeProjectAttachment(request, options, callback); + } + + /** + * List runtime projects attached to the host project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of runtime project + * attachments. Format: `projects/{project}/locations/{location}` + * @param {number} [request.pageSize] + * Optional. The maximum number of runtime project attachments to return. The + * service may return fewer than this value. If unspecified, at most 50 + * runtime project attachments will be returned. The maximum value is 1000; + * values above 1000 will be coerced to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous + * `ListRuntimeProjectAttachments` call. Provide this to retrieve the + * subsequent page. + * + * When paginating, all other parameters (except page_size) provided to + * `ListRuntimeProjectAttachments` must match the call that provided the page + * token. + * @param {string} [request.filter] + * Optional. An expression that filters the list of RuntimeProjectAttachments. + * + * A filter expression consists of a field name, a comparison + * operator, and a value for filtering. The value must be a string. All + * standard operators as documented at https://google.aip.dev/160 are + * supported. + * + * The following fields in the `RuntimeProjectAttachment` are eligible for + * filtering: + * + * * `name` - The name of the RuntimeProjectAttachment. + * * `create_time` - The time at which the RuntimeProjectAttachment was + * created. The value should be in the + * (RFC3339)[https://tools.ietf.org/html/rfc3339] format. + * * `runtime_project` - The Google cloud project associated with the + * RuntimeProjectAttachment. + * @param {string} [request.orderBy] + * Optional. Hint for how to order the results. + * @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.apihub.v1.RuntimeProjectAttachment|RuntimeProjectAttachment}. + * 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 `listRuntimeProjectAttachmentsAsync()` + * 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. + */ + listRuntimeProjectAttachments( + request?: protos.google.cloud.apihub.v1.IListRuntimeProjectAttachmentsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.apihub.v1.IRuntimeProjectAttachment[], + protos.google.cloud.apihub.v1.IListRuntimeProjectAttachmentsRequest|null, + protos.google.cloud.apihub.v1.IListRuntimeProjectAttachmentsResponse + ]>; + listRuntimeProjectAttachments( + request: protos.google.cloud.apihub.v1.IListRuntimeProjectAttachmentsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.apihub.v1.IListRuntimeProjectAttachmentsRequest, + protos.google.cloud.apihub.v1.IListRuntimeProjectAttachmentsResponse|null|undefined, + protos.google.cloud.apihub.v1.IRuntimeProjectAttachment>): void; + listRuntimeProjectAttachments( + request: protos.google.cloud.apihub.v1.IListRuntimeProjectAttachmentsRequest, + callback: PaginationCallback< + protos.google.cloud.apihub.v1.IListRuntimeProjectAttachmentsRequest, + protos.google.cloud.apihub.v1.IListRuntimeProjectAttachmentsResponse|null|undefined, + protos.google.cloud.apihub.v1.IRuntimeProjectAttachment>): void; + listRuntimeProjectAttachments( + request?: protos.google.cloud.apihub.v1.IListRuntimeProjectAttachmentsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.apihub.v1.IListRuntimeProjectAttachmentsRequest, + protos.google.cloud.apihub.v1.IListRuntimeProjectAttachmentsResponse|null|undefined, + protos.google.cloud.apihub.v1.IRuntimeProjectAttachment>, + callback?: PaginationCallback< + protos.google.cloud.apihub.v1.IListRuntimeProjectAttachmentsRequest, + protos.google.cloud.apihub.v1.IListRuntimeProjectAttachmentsResponse|null|undefined, + protos.google.cloud.apihub.v1.IRuntimeProjectAttachment>): + Promise<[ + protos.google.cloud.apihub.v1.IRuntimeProjectAttachment[], + protos.google.cloud.apihub.v1.IListRuntimeProjectAttachmentsRequest|null, + protos.google.cloud.apihub.v1.IListRuntimeProjectAttachmentsResponse + ]>|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.listRuntimeProjectAttachments(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of runtime project + * attachments. Format: `projects/{project}/locations/{location}` + * @param {number} [request.pageSize] + * Optional. The maximum number of runtime project attachments to return. The + * service may return fewer than this value. If unspecified, at most 50 + * runtime project attachments will be returned. The maximum value is 1000; + * values above 1000 will be coerced to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous + * `ListRuntimeProjectAttachments` call. Provide this to retrieve the + * subsequent page. + * + * When paginating, all other parameters (except page_size) provided to + * `ListRuntimeProjectAttachments` must match the call that provided the page + * token. + * @param {string} [request.filter] + * Optional. An expression that filters the list of RuntimeProjectAttachments. + * + * A filter expression consists of a field name, a comparison + * operator, and a value for filtering. The value must be a string. All + * standard operators as documented at https://google.aip.dev/160 are + * supported. + * + * The following fields in the `RuntimeProjectAttachment` are eligible for + * filtering: + * + * * `name` - The name of the RuntimeProjectAttachment. + * * `create_time` - The time at which the RuntimeProjectAttachment was + * created. The value should be in the + * (RFC3339)[https://tools.ietf.org/html/rfc3339] format. + * * `runtime_project` - The Google cloud project associated with the + * RuntimeProjectAttachment. + * @param {string} [request.orderBy] + * Optional. Hint for how to order the results. + * @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.apihub.v1.RuntimeProjectAttachment|RuntimeProjectAttachment} 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 `listRuntimeProjectAttachmentsAsync()` + * 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. + */ + listRuntimeProjectAttachmentsStream( + request?: protos.google.cloud.apihub.v1.IListRuntimeProjectAttachmentsRequest, + 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['listRuntimeProjectAttachments']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listRuntimeProjectAttachments.createStream( + this.innerApiCalls.listRuntimeProjectAttachments as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listRuntimeProjectAttachments`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of runtime project + * attachments. Format: `projects/{project}/locations/{location}` + * @param {number} [request.pageSize] + * Optional. The maximum number of runtime project attachments to return. The + * service may return fewer than this value. If unspecified, at most 50 + * runtime project attachments will be returned. The maximum value is 1000; + * values above 1000 will be coerced to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous + * `ListRuntimeProjectAttachments` call. Provide this to retrieve the + * subsequent page. + * + * When paginating, all other parameters (except page_size) provided to + * `ListRuntimeProjectAttachments` must match the call that provided the page + * token. + * @param {string} [request.filter] + * Optional. An expression that filters the list of RuntimeProjectAttachments. + * + * A filter expression consists of a field name, a comparison + * operator, and a value for filtering. The value must be a string. All + * standard operators as documented at https://google.aip.dev/160 are + * supported. + * + * The following fields in the `RuntimeProjectAttachment` are eligible for + * filtering: + * + * * `name` - The name of the RuntimeProjectAttachment. + * * `create_time` - The time at which the RuntimeProjectAttachment was + * created. The value should be in the + * (RFC3339)[https://tools.ietf.org/html/rfc3339] format. + * * `runtime_project` - The Google cloud project associated with the + * RuntimeProjectAttachment. + * @param {string} [request.orderBy] + * Optional. Hint for how to order the results. + * @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.apihub.v1.RuntimeProjectAttachment|RuntimeProjectAttachment}. 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/runtime_project_attachment_service.list_runtime_project_attachments.js + * region_tag:apihub_v1_generated_RuntimeProjectAttachmentService_ListRuntimeProjectAttachments_async + */ + listRuntimeProjectAttachmentsAsync( + request?: protos.google.cloud.apihub.v1.IListRuntimeProjectAttachmentsRequest, + 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['listRuntimeProjectAttachments']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listRuntimeProjectAttachments.asyncIterate( + this.innerApiCalls['listRuntimeProjectAttachments'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } +/** + * 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); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified api resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @returns {string} Resource name string. + */ + apiPath(project:string,location:string,api:string) { + return this.pathTemplates.apiPathTemplate.render({ + project: project, + location: location, + api: api, + }); + } + + /** + * Parse the project from Api resource. + * + * @param {string} apiName + * A fully-qualified path representing Api resource. + * @returns {string} A string representing the project. + */ + matchProjectFromApiName(apiName: string) { + return this.pathTemplates.apiPathTemplate.match(apiName).project; + } + + /** + * Parse the location from Api resource. + * + * @param {string} apiName + * A fully-qualified path representing Api resource. + * @returns {string} A string representing the location. + */ + matchLocationFromApiName(apiName: string) { + return this.pathTemplates.apiPathTemplate.match(apiName).location; + } + + /** + * Parse the api from Api resource. + * + * @param {string} apiName + * A fully-qualified path representing Api resource. + * @returns {string} A string representing the api. + */ + matchApiFromApiName(apiName: string) { + return this.pathTemplates.apiPathTemplate.match(apiName).api; + } + + /** + * Return a fully-qualified apiHubInstance resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api_hub_instance + * @returns {string} Resource name string. + */ + apiHubInstancePath(project:string,location:string,apiHubInstance:string) { + return this.pathTemplates.apiHubInstancePathTemplate.render({ + project: project, + location: location, + api_hub_instance: apiHubInstance, + }); + } + + /** + * Parse the project from ApiHubInstance resource. + * + * @param {string} apiHubInstanceName + * A fully-qualified path representing ApiHubInstance resource. + * @returns {string} A string representing the project. + */ + matchProjectFromApiHubInstanceName(apiHubInstanceName: string) { + return this.pathTemplates.apiHubInstancePathTemplate.match(apiHubInstanceName).project; + } + + /** + * Parse the location from ApiHubInstance resource. + * + * @param {string} apiHubInstanceName + * A fully-qualified path representing ApiHubInstance resource. + * @returns {string} A string representing the location. + */ + matchLocationFromApiHubInstanceName(apiHubInstanceName: string) { + return this.pathTemplates.apiHubInstancePathTemplate.match(apiHubInstanceName).location; + } + + /** + * Parse the api_hub_instance from ApiHubInstance resource. + * + * @param {string} apiHubInstanceName + * A fully-qualified path representing ApiHubInstance resource. + * @returns {string} A string representing the api_hub_instance. + */ + matchApiHubInstanceFromApiHubInstanceName(apiHubInstanceName: string) { + return this.pathTemplates.apiHubInstancePathTemplate.match(apiHubInstanceName).api_hub_instance; + } + + /** + * Return a fully-qualified apiOperation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @param {string} version + * @param {string} operation + * @returns {string} Resource name string. + */ + apiOperationPath(project:string,location:string,api:string,version:string,operation:string) { + return this.pathTemplates.apiOperationPathTemplate.render({ + project: project, + location: location, + api: api, + version: version, + operation: operation, + }); + } + + /** + * Parse the project from ApiOperation resource. + * + * @param {string} apiOperationName + * A fully-qualified path representing ApiOperation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromApiOperationName(apiOperationName: string) { + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).project; + } + + /** + * Parse the location from ApiOperation resource. + * + * @param {string} apiOperationName + * A fully-qualified path representing ApiOperation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromApiOperationName(apiOperationName: string) { + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).location; + } + + /** + * Parse the api from ApiOperation resource. + * + * @param {string} apiOperationName + * A fully-qualified path representing ApiOperation resource. + * @returns {string} A string representing the api. + */ + matchApiFromApiOperationName(apiOperationName: string) { + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).api; + } + + /** + * Parse the version from ApiOperation resource. + * + * @param {string} apiOperationName + * A fully-qualified path representing ApiOperation resource. + * @returns {string} A string representing the version. + */ + matchVersionFromApiOperationName(apiOperationName: string) { + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).version; + } + + /** + * Parse the operation from ApiOperation resource. + * + * @param {string} apiOperationName + * A fully-qualified path representing ApiOperation resource. + * @returns {string} A string representing the operation. + */ + matchOperationFromApiOperationName(apiOperationName: string) { + return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).operation; + } + + /** + * Return a fully-qualified attribute resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} attribute + * @returns {string} Resource name string. + */ + attributePath(project:string,location:string,attribute:string) { + return this.pathTemplates.attributePathTemplate.render({ + project: project, + location: location, + attribute: attribute, + }); + } + + /** + * Parse the project from Attribute resource. + * + * @param {string} attributeName + * A fully-qualified path representing Attribute resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAttributeName(attributeName: string) { + return this.pathTemplates.attributePathTemplate.match(attributeName).project; + } + + /** + * Parse the location from Attribute resource. + * + * @param {string} attributeName + * A fully-qualified path representing Attribute resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAttributeName(attributeName: string) { + return this.pathTemplates.attributePathTemplate.match(attributeName).location; + } + + /** + * Parse the attribute from Attribute resource. + * + * @param {string} attributeName + * A fully-qualified path representing Attribute resource. + * @returns {string} A string representing the attribute. + */ + matchAttributeFromAttributeName(attributeName: string) { + return this.pathTemplates.attributePathTemplate.match(attributeName).attribute; + } + + /** + * Return a fully-qualified definition resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @param {string} version + * @param {string} definition + * @returns {string} Resource name string. + */ + definitionPath(project:string,location:string,api:string,version:string,definition:string) { + return this.pathTemplates.definitionPathTemplate.render({ + project: project, + location: location, + api: api, + version: version, + definition: definition, + }); + } + + /** + * Parse the project from Definition resource. + * + * @param {string} definitionName + * A fully-qualified path representing Definition resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDefinitionName(definitionName: string) { + return this.pathTemplates.definitionPathTemplate.match(definitionName).project; + } + + /** + * Parse the location from Definition resource. + * + * @param {string} definitionName + * A fully-qualified path representing Definition resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDefinitionName(definitionName: string) { + return this.pathTemplates.definitionPathTemplate.match(definitionName).location; + } + + /** + * Parse the api from Definition resource. + * + * @param {string} definitionName + * A fully-qualified path representing Definition resource. + * @returns {string} A string representing the api. + */ + matchApiFromDefinitionName(definitionName: string) { + return this.pathTemplates.definitionPathTemplate.match(definitionName).api; + } + + /** + * Parse the version from Definition resource. + * + * @param {string} definitionName + * A fully-qualified path representing Definition resource. + * @returns {string} A string representing the version. + */ + matchVersionFromDefinitionName(definitionName: string) { + return this.pathTemplates.definitionPathTemplate.match(definitionName).version; + } + + /** + * Parse the definition from Definition resource. + * + * @param {string} definitionName + * A fully-qualified path representing Definition resource. + * @returns {string} A string representing the definition. + */ + matchDefinitionFromDefinitionName(definitionName: string) { + return this.pathTemplates.definitionPathTemplate.match(definitionName).definition; + } + + /** + * Return a fully-qualified dependency resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dependency + * @returns {string} Resource name string. + */ + dependencyPath(project:string,location:string,dependency:string) { + return this.pathTemplates.dependencyPathTemplate.render({ + project: project, + location: location, + dependency: dependency, + }); + } + + /** + * Parse the project from Dependency resource. + * + * @param {string} dependencyName + * A fully-qualified path representing Dependency resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDependencyName(dependencyName: string) { + return this.pathTemplates.dependencyPathTemplate.match(dependencyName).project; + } + + /** + * Parse the location from Dependency resource. + * + * @param {string} dependencyName + * A fully-qualified path representing Dependency resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDependencyName(dependencyName: string) { + return this.pathTemplates.dependencyPathTemplate.match(dependencyName).location; + } + + /** + * Parse the dependency from Dependency resource. + * + * @param {string} dependencyName + * A fully-qualified path representing Dependency resource. + * @returns {string} A string representing the dependency. + */ + matchDependencyFromDependencyName(dependencyName: string) { + return this.pathTemplates.dependencyPathTemplate.match(dependencyName).dependency; + } + + /** + * Return a fully-qualified deployment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} deployment + * @returns {string} Resource name string. + */ + deploymentPath(project:string,location:string,deployment:string) { + return this.pathTemplates.deploymentPathTemplate.render({ + project: project, + location: location, + deployment: deployment, + }); + } + + /** + * Parse the project from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName).project; + } + + /** + * Parse the location from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName).location; + } + + /** + * Parse the deployment from Deployment resource. + * + * @param {string} deploymentName + * A fully-qualified path representing Deployment resource. + * @returns {string} A string representing the deployment. + */ + matchDeploymentFromDeploymentName(deploymentName: string) { + return this.pathTemplates.deploymentPathTemplate.match(deploymentName).deployment; + } + + /** + * Return a fully-qualified externalApi resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} external_api + * @returns {string} Resource name string. + */ + externalApiPath(project:string,location:string,externalApi:string) { + return this.pathTemplates.externalApiPathTemplate.render({ + project: project, + location: location, + external_api: externalApi, + }); + } + + /** + * Parse the project from ExternalApi resource. + * + * @param {string} externalApiName + * A fully-qualified path representing ExternalApi resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExternalApiName(externalApiName: string) { + return this.pathTemplates.externalApiPathTemplate.match(externalApiName).project; + } + + /** + * Parse the location from ExternalApi resource. + * + * @param {string} externalApiName + * A fully-qualified path representing ExternalApi resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExternalApiName(externalApiName: string) { + return this.pathTemplates.externalApiPathTemplate.match(externalApiName).location; + } + + /** + * Parse the external_api from ExternalApi resource. + * + * @param {string} externalApiName + * A fully-qualified path representing ExternalApi resource. + * @returns {string} A string representing the external_api. + */ + matchExternalApiFromExternalApiName(externalApiName: string) { + return this.pathTemplates.externalApiPathTemplate.match(externalApiName).external_api; + } + + /** + * Return a fully-qualified hostProjectRegistration resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} host_project_registration + * @returns {string} Resource name string. + */ + hostProjectRegistrationPath(project:string,location:string,hostProjectRegistration:string) { + return this.pathTemplates.hostProjectRegistrationPathTemplate.render({ + project: project, + location: location, + host_project_registration: hostProjectRegistration, + }); + } + + /** + * Parse the project from HostProjectRegistration resource. + * + * @param {string} hostProjectRegistrationName + * A fully-qualified path representing HostProjectRegistration resource. + * @returns {string} A string representing the project. + */ + matchProjectFromHostProjectRegistrationName(hostProjectRegistrationName: string) { + return this.pathTemplates.hostProjectRegistrationPathTemplate.match(hostProjectRegistrationName).project; + } + + /** + * Parse the location from HostProjectRegistration resource. + * + * @param {string} hostProjectRegistrationName + * A fully-qualified path representing HostProjectRegistration resource. + * @returns {string} A string representing the location. + */ + matchLocationFromHostProjectRegistrationName(hostProjectRegistrationName: string) { + return this.pathTemplates.hostProjectRegistrationPathTemplate.match(hostProjectRegistrationName).location; + } + + /** + * Parse the host_project_registration from HostProjectRegistration resource. + * + * @param {string} hostProjectRegistrationName + * A fully-qualified path representing HostProjectRegistration resource. + * @returns {string} A string representing the host_project_registration. + */ + matchHostProjectRegistrationFromHostProjectRegistrationName(hostProjectRegistrationName: string) { + return this.pathTemplates.hostProjectRegistrationPathTemplate.match(hostProjectRegistrationName).host_project_registration; + } + + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project:string,location:string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + + /** + * Return a fully-qualified plugin resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} plugin + * @returns {string} Resource name string. + */ + pluginPath(project:string,location:string,plugin:string) { + return this.pathTemplates.pluginPathTemplate.render({ + project: project, + location: location, + plugin: plugin, + }); + } + + /** + * Parse the project from Plugin resource. + * + * @param {string} pluginName + * A fully-qualified path representing Plugin resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPluginName(pluginName: string) { + return this.pathTemplates.pluginPathTemplate.match(pluginName).project; + } + + /** + * Parse the location from Plugin resource. + * + * @param {string} pluginName + * A fully-qualified path representing Plugin resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPluginName(pluginName: string) { + return this.pathTemplates.pluginPathTemplate.match(pluginName).location; + } + + /** + * Parse the plugin from Plugin resource. + * + * @param {string} pluginName + * A fully-qualified path representing Plugin resource. + * @returns {string} A string representing the plugin. + */ + matchPluginFromPluginName(pluginName: string) { + return this.pathTemplates.pluginPathTemplate.match(pluginName).plugin; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project:string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified runtimeProjectAttachment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} runtime_project_attachment + * @returns {string} Resource name string. + */ + runtimeProjectAttachmentPath(project:string,location:string,runtimeProjectAttachment:string) { + return this.pathTemplates.runtimeProjectAttachmentPathTemplate.render({ + project: project, + location: location, + runtime_project_attachment: runtimeProjectAttachment, + }); + } + + /** + * Parse the project from RuntimeProjectAttachment resource. + * + * @param {string} runtimeProjectAttachmentName + * A fully-qualified path representing RuntimeProjectAttachment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRuntimeProjectAttachmentName(runtimeProjectAttachmentName: string) { + return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match(runtimeProjectAttachmentName).project; + } + + /** + * Parse the location from RuntimeProjectAttachment resource. + * + * @param {string} runtimeProjectAttachmentName + * A fully-qualified path representing RuntimeProjectAttachment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRuntimeProjectAttachmentName(runtimeProjectAttachmentName: string) { + return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match(runtimeProjectAttachmentName).location; + } + + /** + * Parse the runtime_project_attachment from RuntimeProjectAttachment resource. + * + * @param {string} runtimeProjectAttachmentName + * A fully-qualified path representing RuntimeProjectAttachment resource. + * @returns {string} A string representing the runtime_project_attachment. + */ + matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName(runtimeProjectAttachmentName: string) { + return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match(runtimeProjectAttachmentName).runtime_project_attachment; + } + + /** + * Return a fully-qualified spec resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @param {string} version + * @param {string} spec + * @returns {string} Resource name string. + */ + specPath(project:string,location:string,api:string,version:string,spec:string) { + return this.pathTemplates.specPathTemplate.render({ + project: project, + location: location, + api: api, + version: version, + spec: spec, + }); + } + + /** + * Parse the project from Spec resource. + * + * @param {string} specName + * A fully-qualified path representing Spec resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSpecName(specName: string) { + return this.pathTemplates.specPathTemplate.match(specName).project; + } + + /** + * Parse the location from Spec resource. + * + * @param {string} specName + * A fully-qualified path representing Spec resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSpecName(specName: string) { + return this.pathTemplates.specPathTemplate.match(specName).location; + } + + /** + * Parse the api from Spec resource. + * + * @param {string} specName + * A fully-qualified path representing Spec resource. + * @returns {string} A string representing the api. + */ + matchApiFromSpecName(specName: string) { + return this.pathTemplates.specPathTemplate.match(specName).api; + } + + /** + * Parse the version from Spec resource. + * + * @param {string} specName + * A fully-qualified path representing Spec resource. + * @returns {string} A string representing the version. + */ + matchVersionFromSpecName(specName: string) { + return this.pathTemplates.specPathTemplate.match(specName).version; + } + + /** + * Parse the spec from Spec resource. + * + * @param {string} specName + * A fully-qualified path representing Spec resource. + * @returns {string} A string representing the spec. + */ + matchSpecFromSpecName(specName: string) { + return this.pathTemplates.specPathTemplate.match(specName).spec; + } + + /** + * Return a fully-qualified styleGuide resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} plugin + * @returns {string} Resource name string. + */ + styleGuidePath(project:string,location:string,plugin:string) { + return this.pathTemplates.styleGuidePathTemplate.render({ + project: project, + location: location, + plugin: plugin, + }); + } + + /** + * Parse the project from StyleGuide resource. + * + * @param {string} styleGuideName + * A fully-qualified path representing StyleGuide resource. + * @returns {string} A string representing the project. + */ + matchProjectFromStyleGuideName(styleGuideName: string) { + return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName).project; + } + + /** + * Parse the location from StyleGuide resource. + * + * @param {string} styleGuideName + * A fully-qualified path representing StyleGuide resource. + * @returns {string} A string representing the location. + */ + matchLocationFromStyleGuideName(styleGuideName: string) { + return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName).location; + } + + /** + * Parse the plugin from StyleGuide resource. + * + * @param {string} styleGuideName + * A fully-qualified path representing StyleGuide resource. + * @returns {string} A string representing the plugin. + */ + matchPluginFromStyleGuideName(styleGuideName: string) { + return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName).plugin; + } + + /** + * Return a fully-qualified version resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @param {string} version + * @returns {string} Resource name string. + */ + versionPath(project:string,location:string,api:string,version:string) { + return this.pathTemplates.versionPathTemplate.render({ + project: project, + location: location, + api: api, + version: version, + }); + } + + /** + * Parse the project from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the project. + */ + matchProjectFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).project; + } + + /** + * Parse the location from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the location. + */ + matchLocationFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).location; + } + + /** + * Parse the api from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the api. + */ + matchApiFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).api; + } + + /** + * Parse the version from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the version. + */ + matchVersionFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).version; + } + + /** + * 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.runtimeProjectAttachmentServiceStub && !this._terminated) { + return this.runtimeProjectAttachmentServiceStub.then(stub => { + this._terminated = true; + stub.close(); + this.locationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-cloud-apihub/v1/src/v1/runtime_project_attachment_service_client_config.json b/owl-bot-staging/google-cloud-apihub/v1/src/v1/runtime_project_attachment_service_client_config.json new file mode 100644 index 00000000000..fd774c04498 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/src/v1/runtime_project_attachment_service_client_config.json @@ -0,0 +1,63 @@ +{ + "interfaces": { + "google.cloud.apihub.v1.RuntimeProjectAttachmentService": { + "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": { + "CreateRuntimeProjectAttachment": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetRuntimeProjectAttachment": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ListRuntimeProjectAttachments": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "DeleteRuntimeProjectAttachment": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "LookupRuntimeProjectAttachment": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-apihub/v1/src/v1/runtime_project_attachment_service_proto_list.json b/owl-bot-staging/google-cloud-apihub/v1/src/v1/runtime_project_attachment_service_proto_list.json new file mode 100644 index 00000000000..07e987f7fb3 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/src/v1/runtime_project_attachment_service_proto_list.json @@ -0,0 +1,9 @@ +[ + "../../protos/google/cloud/apihub/v1/apihub_service.proto", + "../../protos/google/cloud/apihub/v1/common_fields.proto", + "../../protos/google/cloud/apihub/v1/host_project_registration_service.proto", + "../../protos/google/cloud/apihub/v1/linting_service.proto", + "../../protos/google/cloud/apihub/v1/plugin_service.proto", + "../../protos/google/cloud/apihub/v1/provisioning_service.proto", + "../../protos/google/cloud/apihub/v1/runtime_project_attachment_service.proto" +] diff --git a/owl-bot-staging/google-cloud-apihub/v1/system-test/fixtures/sample/src/index.js b/owl-bot-staging/google-cloud-apihub/v1/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000000..f0e98e48ab9 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/system-test/fixtures/sample/src/index.js @@ -0,0 +1,33 @@ +// Copyright 2024 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 apihub = require('@google-cloud/apihub'); + +function main() { + const apiHubClient = new apihub.ApiHubClient(); + const apiHubDependenciesClient = new apihub.ApiHubDependenciesClient(); + const apiHubPluginClient = new apihub.ApiHubPluginClient(); + const hostProjectRegistrationServiceClient = new apihub.HostProjectRegistrationServiceClient(); + const lintingServiceClient = new apihub.LintingServiceClient(); + const provisioningClient = new apihub.ProvisioningClient(); + const runtimeProjectAttachmentServiceClient = new apihub.RuntimeProjectAttachmentServiceClient(); +} + +main(); diff --git a/owl-bot-staging/google-cloud-apihub/v1/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/google-cloud-apihub/v1/system-test/fixtures/sample/src/index.ts new file mode 100644 index 00000000000..15cbcb831c6 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,68 @@ +// Copyright 2024 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 {ApiHubClient, ApiHubDependenciesClient, ApiHubPluginClient, HostProjectRegistrationServiceClient, LintingServiceClient, ProvisioningClient, RuntimeProjectAttachmentServiceClient} from '@google-cloud/apihub'; + +// check that the client class type name can be used +function doStuffWithApiHubClient(client: ApiHubClient) { + client.close(); +} +function doStuffWithApiHubDependenciesClient(client: ApiHubDependenciesClient) { + client.close(); +} +function doStuffWithApiHubPluginClient(client: ApiHubPluginClient) { + client.close(); +} +function doStuffWithHostProjectRegistrationServiceClient(client: HostProjectRegistrationServiceClient) { + client.close(); +} +function doStuffWithLintingServiceClient(client: LintingServiceClient) { + client.close(); +} +function doStuffWithProvisioningClient(client: ProvisioningClient) { + client.close(); +} +function doStuffWithRuntimeProjectAttachmentServiceClient(client: RuntimeProjectAttachmentServiceClient) { + client.close(); +} + +function main() { + // check that the client instance can be created + const apiHubClient = new ApiHubClient(); + doStuffWithApiHubClient(apiHubClient); + // check that the client instance can be created + const apiHubDependenciesClient = new ApiHubDependenciesClient(); + doStuffWithApiHubDependenciesClient(apiHubDependenciesClient); + // check that the client instance can be created + const apiHubPluginClient = new ApiHubPluginClient(); + doStuffWithApiHubPluginClient(apiHubPluginClient); + // check that the client instance can be created + const hostProjectRegistrationServiceClient = new HostProjectRegistrationServiceClient(); + doStuffWithHostProjectRegistrationServiceClient(hostProjectRegistrationServiceClient); + // check that the client instance can be created + const lintingServiceClient = new LintingServiceClient(); + doStuffWithLintingServiceClient(lintingServiceClient); + // check that the client instance can be created + const provisioningClient = new ProvisioningClient(); + doStuffWithProvisioningClient(provisioningClient); + // check that the client instance can be created + const runtimeProjectAttachmentServiceClient = new RuntimeProjectAttachmentServiceClient(); + doStuffWithRuntimeProjectAttachmentServiceClient(runtimeProjectAttachmentServiceClient); +} + +main(); diff --git a/owl-bot-staging/google-cloud-apihub/v1/system-test/install.ts b/owl-bot-staging/google-cloud-apihub/v1/system-test/install.ts new file mode 100644 index 00000000000..fd5bfdc71d5 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/system-test/install.ts @@ -0,0 +1,49 @@ +// Copyright 2024 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/owl-bot-staging/google-cloud-apihub/v1/test/gapic_api_hub_dependencies_v1.ts b/owl-bot-staging/google-cloud-apihub/v1/test/gapic_api_hub_dependencies_v1.ts new file mode 100644 index 00000000000..b5b1fb6fa6a --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/test/gapic_api_hub_dependencies_v1.ts @@ -0,0 +1,1890 @@ +// Copyright 2024 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, beforeEach, afterEach} from 'mocha'; +import * as apihubdependenciesModule from '../src'; + +import {PassThrough} from 'stream'; + +import {GoogleAuth, protobuf, 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 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.ApiHubDependenciesClient', () => { + let googleAuth: GoogleAuth; + beforeEach(() => { + googleAuth = { + getClient: sinon.stub().resolves({ + getRequestHeaders: sinon.stub().resolves({Authorization: 'Bearer SOME_TOKEN'}), + }) + } as unknown as GoogleAuth; + }); + afterEach(() => { + sinon.restore(); + }); + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'apihub.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, "googleapis.com"); + }); + + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = apihubdependenciesModule.v1.ApiHubDependenciesClient.servicePath; + assert.strictEqual(servicePath, 'apihub.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = apihubdependenciesModule.v1.ApiHubDependenciesClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'apihub.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'apihub.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'apihub.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'apihub.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'apihub.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { new apihubdependenciesModule.v1.ApiHubDependenciesClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = apihubdependenciesModule.v1.ApiHubDependenciesClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + assert.strictEqual(client.apiHubDependenciesStub, undefined); + await client.initialize(); + assert(client.apiHubDependenciesStub); + }); + + it('has close method for the initialized client', done => { + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + assert(client.apiHubDependenciesStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + assert.strictEqual(client.apiHubDependenciesStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + auth: googleAuth, + 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 apihubdependenciesModule.v1.ApiHubDependenciesClient({ + auth: googleAuth, + 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('createDependency', () => { + it('invokes createDependency without error', async () => { + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateDependencyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.CreateDependencyRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Dependency() + ); + client.innerApiCalls.createDependency = stubSimpleCall(expectedResponse); + const [response] = await client.createDependency(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createDependency as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createDependency as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createDependency without error using callback', async () => { + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateDependencyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.CreateDependencyRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Dependency() + ); + client.innerApiCalls.createDependency = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createDependency( + request, + (err?: Error|null, result?: protos.google.cloud.apihub.v1.IDependency|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createDependency as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createDependency as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createDependency with error', async () => { + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateDependencyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.CreateDependencyRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createDependency = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createDependency(request), expectedError); + const actualRequest = (client.innerApiCalls.createDependency as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createDependency as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createDependency with closed client', async () => { + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateDependencyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.CreateDependencyRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createDependency(request), expectedError); + }); + }); + + describe('getDependency', () => { + it('invokes getDependency without error', async () => { + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetDependencyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetDependencyRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Dependency() + ); + client.innerApiCalls.getDependency = stubSimpleCall(expectedResponse); + const [response] = await client.getDependency(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getDependency as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getDependency as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDependency without error using callback', async () => { + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetDependencyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetDependencyRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Dependency() + ); + client.innerApiCalls.getDependency = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getDependency( + request, + (err?: Error|null, result?: protos.google.cloud.apihub.v1.IDependency|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getDependency as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getDependency as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDependency with error', async () => { + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetDependencyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetDependencyRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getDependency = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getDependency(request), expectedError); + const actualRequest = (client.innerApiCalls.getDependency as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getDependency as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDependency with closed client', async () => { + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetDependencyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetDependencyRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getDependency(request), expectedError); + }); + }); + + describe('updateDependency', () => { + it('invokes updateDependency without error', async () => { + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.UpdateDependencyRequest() + ); + request.dependency ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.UpdateDependencyRequest', ['dependency', 'name']); + request.dependency.name = defaultValue1; + const expectedHeaderRequestParams = `dependency.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Dependency() + ); + client.innerApiCalls.updateDependency = stubSimpleCall(expectedResponse); + const [response] = await client.updateDependency(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateDependency as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateDependency as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDependency without error using callback', async () => { + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.UpdateDependencyRequest() + ); + request.dependency ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.UpdateDependencyRequest', ['dependency', 'name']); + request.dependency.name = defaultValue1; + const expectedHeaderRequestParams = `dependency.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Dependency() + ); + client.innerApiCalls.updateDependency = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateDependency( + request, + (err?: Error|null, result?: protos.google.cloud.apihub.v1.IDependency|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateDependency as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateDependency as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDependency with error', async () => { + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.UpdateDependencyRequest() + ); + request.dependency ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.UpdateDependencyRequest', ['dependency', 'name']); + request.dependency.name = defaultValue1; + const expectedHeaderRequestParams = `dependency.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateDependency = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateDependency(request), expectedError); + const actualRequest = (client.innerApiCalls.updateDependency as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateDependency as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDependency with closed client', async () => { + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.UpdateDependencyRequest() + ); + request.dependency ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.UpdateDependencyRequest', ['dependency', 'name']); + request.dependency.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateDependency(request), expectedError); + }); + }); + + describe('deleteDependency', () => { + it('invokes deleteDependency without error', async () => { + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DeleteDependencyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.DeleteDependencyRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteDependency = stubSimpleCall(expectedResponse); + const [response] = await client.deleteDependency(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteDependency as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteDependency as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteDependency without error using callback', async () => { + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DeleteDependencyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.DeleteDependencyRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteDependency = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteDependency( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteDependency as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteDependency as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteDependency with error', async () => { + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DeleteDependencyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.DeleteDependencyRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteDependency = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteDependency(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteDependency as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteDependency as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteDependency with closed client', async () => { + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DeleteDependencyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.DeleteDependencyRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteDependency(request), expectedError); + }); + }); + + describe('listDependencies', () => { + it('invokes listDependencies without error', async () => { + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListDependenciesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListDependenciesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.Dependency()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Dependency()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Dependency()), + ]; + client.innerApiCalls.listDependencies = stubSimpleCall(expectedResponse); + const [response] = await client.listDependencies(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listDependencies as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listDependencies as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDependencies without error using callback', async () => { + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListDependenciesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListDependenciesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.Dependency()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Dependency()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Dependency()), + ]; + client.innerApiCalls.listDependencies = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listDependencies( + request, + (err?: Error|null, result?: protos.google.cloud.apihub.v1.IDependency[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listDependencies as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listDependencies as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDependencies with error', async () => { + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListDependenciesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListDependenciesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listDependencies = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listDependencies(request), expectedError); + const actualRequest = (client.innerApiCalls.listDependencies as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listDependencies as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDependenciesStream without error', async () => { + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListDependenciesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListDependenciesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.Dependency()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Dependency()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Dependency()), + ]; + client.descriptors.page.listDependencies.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listDependenciesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.apihub.v1.Dependency[] = []; + stream.on('data', (response: protos.google.cloud.apihub.v1.Dependency) => { + 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.listDependencies.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listDependencies, request)); + assert( + (client.descriptors.page.listDependencies.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listDependenciesStream with error', async () => { + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListDependenciesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListDependenciesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listDependencies.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listDependenciesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.apihub.v1.Dependency[] = []; + stream.on('data', (response: protos.google.cloud.apihub.v1.Dependency) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listDependencies.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listDependencies, request)); + assert( + (client.descriptors.page.listDependencies.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listDependencies without error', async () => { + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListDependenciesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListDependenciesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.Dependency()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Dependency()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Dependency()), + ]; + client.descriptors.page.listDependencies.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.apihub.v1.IDependency[] = []; + const iterable = client.listDependenciesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listDependencies.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listDependencies.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listDependencies with error', async () => { + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListDependenciesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListDependenciesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listDependencies.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listDependenciesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.apihub.v1.IDependency[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listDependencies.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listDependencies.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + auth: googleAuth, + 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 apihubdependenciesModule.v1.ApiHubDependenciesClient({ + auth: googleAuth, + 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 apihubdependenciesModule.v1.ApiHubDependenciesClient({ + auth: googleAuth, + 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 apihubdependenciesModule.v1.ApiHubDependenciesClient({ + auth: googleAuth, + 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 apihubdependenciesModule.v1.ApiHubDependenciesClient({ + 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('Path templates', () => { + + describe('api', () => { + const fakePath = "/rendered/path/api"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + api: "apiValue", + }; + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.apiPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.apiPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('apiPath', () => { + const result = client.apiPath("projectValue", "locationValue", "apiValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.apiPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromApiName', () => { + const result = client.matchProjectFromApiName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.apiPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromApiName', () => { + const result = client.matchLocationFromApiName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.apiPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchApiFromApiName', () => { + const result = client.matchApiFromApiName(fakePath); + assert.strictEqual(result, "apiValue"); + assert((client.pathTemplates.apiPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('apiHubInstance', () => { + const fakePath = "/rendered/path/apiHubInstance"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + api_hub_instance: "apiHubInstanceValue", + }; + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.apiHubInstancePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.apiHubInstancePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('apiHubInstancePath', () => { + const result = client.apiHubInstancePath("projectValue", "locationValue", "apiHubInstanceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.apiHubInstancePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromApiHubInstanceName', () => { + const result = client.matchProjectFromApiHubInstanceName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromApiHubInstanceName', () => { + const result = client.matchLocationFromApiHubInstanceName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchApiHubInstanceFromApiHubInstanceName', () => { + const result = client.matchApiHubInstanceFromApiHubInstanceName(fakePath); + assert.strictEqual(result, "apiHubInstanceValue"); + assert((client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('apiOperation', () => { + const fakePath = "/rendered/path/apiOperation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + api: "apiValue", + version: "versionValue", + operation: "operationValue", + }; + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.apiOperationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.apiOperationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('apiOperationPath', () => { + const result = client.apiOperationPath("projectValue", "locationValue", "apiValue", "versionValue", "operationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.apiOperationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromApiOperationName', () => { + const result = client.matchProjectFromApiOperationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromApiOperationName', () => { + const result = client.matchLocationFromApiOperationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchApiFromApiOperationName', () => { + const result = client.matchApiFromApiOperationName(fakePath); + assert.strictEqual(result, "apiValue"); + assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchVersionFromApiOperationName', () => { + const result = client.matchVersionFromApiOperationName(fakePath); + assert.strictEqual(result, "versionValue"); + assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchOperationFromApiOperationName', () => { + const result = client.matchOperationFromApiOperationName(fakePath); + assert.strictEqual(result, "operationValue"); + assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('attribute', () => { + const fakePath = "/rendered/path/attribute"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + attribute: "attributeValue", + }; + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.attributePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.attributePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('attributePath', () => { + const result = client.attributePath("projectValue", "locationValue", "attributeValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.attributePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAttributeName', () => { + const result = client.matchProjectFromAttributeName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.attributePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAttributeName', () => { + const result = client.matchLocationFromAttributeName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.attributePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAttributeFromAttributeName', () => { + const result = client.matchAttributeFromAttributeName(fakePath); + assert.strictEqual(result, "attributeValue"); + assert((client.pathTemplates.attributePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('definition', () => { + const fakePath = "/rendered/path/definition"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + api: "apiValue", + version: "versionValue", + definition: "definitionValue", + }; + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.definitionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.definitionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('definitionPath', () => { + const result = client.definitionPath("projectValue", "locationValue", "apiValue", "versionValue", "definitionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.definitionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDefinitionName', () => { + const result = client.matchProjectFromDefinitionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDefinitionName', () => { + const result = client.matchLocationFromDefinitionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchApiFromDefinitionName', () => { + const result = client.matchApiFromDefinitionName(fakePath); + assert.strictEqual(result, "apiValue"); + assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchVersionFromDefinitionName', () => { + const result = client.matchVersionFromDefinitionName(fakePath); + assert.strictEqual(result, "versionValue"); + assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDefinitionFromDefinitionName', () => { + const result = client.matchDefinitionFromDefinitionName(fakePath); + assert.strictEqual(result, "definitionValue"); + assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dependency', () => { + const fakePath = "/rendered/path/dependency"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dependency: "dependencyValue", + }; + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dependencyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.dependencyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('dependencyPath', () => { + const result = client.dependencyPath("projectValue", "locationValue", "dependencyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.dependencyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDependencyName', () => { + const result = client.matchProjectFromDependencyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.dependencyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDependencyName', () => { + const result = client.matchLocationFromDependencyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.dependencyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDependencyFromDependencyName', () => { + const result = client.matchDependencyFromDependencyName(fakePath); + assert.strictEqual(result, "dependencyValue"); + assert((client.pathTemplates.dependencyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('deployment', () => { + const fakePath = "/rendered/path/deployment"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + deployment: "deploymentValue", + }; + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.deploymentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.deploymentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('deploymentPath', () => { + const result = client.deploymentPath("projectValue", "locationValue", "deploymentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.deploymentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDeploymentName', () => { + const result = client.matchProjectFromDeploymentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDeploymentName', () => { + const result = client.matchLocationFromDeploymentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDeploymentFromDeploymentName', () => { + const result = client.matchDeploymentFromDeploymentName(fakePath); + assert.strictEqual(result, "deploymentValue"); + assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('externalApi', () => { + const fakePath = "/rendered/path/externalApi"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + external_api: "externalApiValue", + }; + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.externalApiPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.externalApiPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('externalApiPath', () => { + const result = client.externalApiPath("projectValue", "locationValue", "externalApiValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.externalApiPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromExternalApiName', () => { + const result = client.matchProjectFromExternalApiName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.externalApiPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromExternalApiName', () => { + const result = client.matchLocationFromExternalApiName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.externalApiPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExternalApiFromExternalApiName', () => { + const result = client.matchExternalApiFromExternalApiName(fakePath); + assert.strictEqual(result, "externalApiValue"); + assert((client.pathTemplates.externalApiPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('hostProjectRegistration', () => { + const fakePath = "/rendered/path/hostProjectRegistration"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + host_project_registration: "hostProjectRegistrationValue", + }; + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.hostProjectRegistrationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.hostProjectRegistrationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('hostProjectRegistrationPath', () => { + const result = client.hostProjectRegistrationPath("projectValue", "locationValue", "hostProjectRegistrationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.hostProjectRegistrationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromHostProjectRegistrationName', () => { + const result = client.matchProjectFromHostProjectRegistrationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.hostProjectRegistrationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromHostProjectRegistrationName', () => { + const result = client.matchLocationFromHostProjectRegistrationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.hostProjectRegistrationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchHostProjectRegistrationFromHostProjectRegistrationName', () => { + const result = client.matchHostProjectRegistrationFromHostProjectRegistrationName(fakePath); + assert.strictEqual(result, "hostProjectRegistrationValue"); + assert((client.pathTemplates.hostProjectRegistrationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('location', () => { + const fakePath = "/rendered/path/location"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + }; + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.locationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.locationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath("projectValue", "locationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('plugin', () => { + const fakePath = "/rendered/path/plugin"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + plugin: "pluginValue", + }; + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.pluginPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.pluginPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('pluginPath', () => { + const result = client.pluginPath("projectValue", "locationValue", "pluginValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.pluginPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromPluginName', () => { + const result = client.matchProjectFromPluginName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.pluginPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromPluginName', () => { + const result = client.matchLocationFromPluginName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.pluginPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPluginFromPluginName', () => { + const result = client.matchPluginFromPluginName(fakePath); + assert.strictEqual(result, "pluginValue"); + assert((client.pathTemplates.pluginPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('project', () => { + const fakePath = "/rendered/path/project"; + const expectedParameters = { + project: "projectValue", + }; + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath("projectValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('runtimeProjectAttachment', () => { + const fakePath = "/rendered/path/runtimeProjectAttachment"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + runtime_project_attachment: "runtimeProjectAttachmentValue", + }; + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.runtimeProjectAttachmentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.runtimeProjectAttachmentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('runtimeProjectAttachmentPath', () => { + const result = client.runtimeProjectAttachmentPath("projectValue", "locationValue", "runtimeProjectAttachmentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromRuntimeProjectAttachmentName', () => { + const result = client.matchProjectFromRuntimeProjectAttachmentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromRuntimeProjectAttachmentName', () => { + const result = client.matchLocationFromRuntimeProjectAttachmentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName', () => { + const result = client.matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName(fakePath); + assert.strictEqual(result, "runtimeProjectAttachmentValue"); + assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('spec', () => { + const fakePath = "/rendered/path/spec"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + api: "apiValue", + version: "versionValue", + spec: "specValue", + }; + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.specPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.specPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('specPath', () => { + const result = client.specPath("projectValue", "locationValue", "apiValue", "versionValue", "specValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.specPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSpecName', () => { + const result = client.matchProjectFromSpecName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSpecName', () => { + const result = client.matchLocationFromSpecName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchApiFromSpecName', () => { + const result = client.matchApiFromSpecName(fakePath); + assert.strictEqual(result, "apiValue"); + assert((client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchVersionFromSpecName', () => { + const result = client.matchVersionFromSpecName(fakePath); + assert.strictEqual(result, "versionValue"); + assert((client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSpecFromSpecName', () => { + const result = client.matchSpecFromSpecName(fakePath); + assert.strictEqual(result, "specValue"); + assert((client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('styleGuide', () => { + const fakePath = "/rendered/path/styleGuide"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + plugin: "pluginValue", + }; + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.styleGuidePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.styleGuidePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('styleGuidePath', () => { + const result = client.styleGuidePath("projectValue", "locationValue", "pluginValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.styleGuidePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromStyleGuideName', () => { + const result = client.matchProjectFromStyleGuideName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.styleGuidePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromStyleGuideName', () => { + const result = client.matchLocationFromStyleGuideName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.styleGuidePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPluginFromStyleGuideName', () => { + const result = client.matchPluginFromStyleGuideName(fakePath); + assert.strictEqual(result, "pluginValue"); + assert((client.pathTemplates.styleGuidePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('version', () => { + const fakePath = "/rendered/path/version"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + api: "apiValue", + version: "versionValue", + }; + const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.versionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.versionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('versionPath', () => { + const result = client.versionPath("projectValue", "locationValue", "apiValue", "versionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.versionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromVersionName', () => { + const result = client.matchProjectFromVersionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromVersionName', () => { + const result = client.matchLocationFromVersionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchApiFromVersionName', () => { + const result = client.matchApiFromVersionName(fakePath); + assert.strictEqual(result, "apiValue"); + assert((client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchVersionFromVersionName', () => { + const result = client.matchVersionFromVersionName(fakePath); + assert.strictEqual(result, "versionValue"); + assert((client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-apihub/v1/test/gapic_api_hub_plugin_v1.ts b/owl-bot-staging/google-cloud-apihub/v1/test/gapic_api_hub_plugin_v1.ts new file mode 100644 index 00000000000..19735625663 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/test/gapic_api_hub_plugin_v1.ts @@ -0,0 +1,1438 @@ +// Copyright 2024 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, beforeEach, afterEach} from 'mocha'; +import * as apihubpluginModule from '../src'; + +import {GoogleAuth, protobuf, 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 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.ApiHubPluginClient', () => { + let googleAuth: GoogleAuth; + beforeEach(() => { + googleAuth = { + getClient: sinon.stub().resolves({ + getRequestHeaders: sinon.stub().resolves({Authorization: 'Bearer SOME_TOKEN'}), + }) + } as unknown as GoogleAuth; + }); + afterEach(() => { + sinon.restore(); + }); + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new apihubpluginModule.v1.ApiHubPluginClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'apihub.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new apihubpluginModule.v1.ApiHubPluginClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, "googleapis.com"); + }); + + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = apihubpluginModule.v1.ApiHubPluginClient.servicePath; + assert.strictEqual(servicePath, 'apihub.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = apihubpluginModule.v1.ApiHubPluginClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'apihub.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new apihubpluginModule.v1.ApiHubPluginClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'apihub.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new apihubpluginModule.v1.ApiHubPluginClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'apihub.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new apihubpluginModule.v1.ApiHubPluginClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'apihub.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new apihubpluginModule.v1.ApiHubPluginClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'apihub.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { new apihubpluginModule.v1.ApiHubPluginClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = apihubpluginModule.v1.ApiHubPluginClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new apihubpluginModule.v1.ApiHubPluginClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new apihubpluginModule.v1.ApiHubPluginClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new apihubpluginModule.v1.ApiHubPluginClient({ + auth: googleAuth, + projectId: 'bogus', + }); + assert.strictEqual(client.apiHubPluginStub, undefined); + await client.initialize(); + assert(client.apiHubPluginStub); + }); + + it('has close method for the initialized client', done => { + const client = new apihubpluginModule.v1.ApiHubPluginClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + assert(client.apiHubPluginStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new apihubpluginModule.v1.ApiHubPluginClient({ + auth: googleAuth, + projectId: 'bogus', + }); + assert.strictEqual(client.apiHubPluginStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new apihubpluginModule.v1.ApiHubPluginClient({ + auth: googleAuth, + 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 apihubpluginModule.v1.ApiHubPluginClient({ + auth: googleAuth, + 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('getPlugin', () => { + it('invokes getPlugin without error', async () => { + const client = new apihubpluginModule.v1.ApiHubPluginClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetPluginRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetPluginRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Plugin() + ); + client.innerApiCalls.getPlugin = stubSimpleCall(expectedResponse); + const [response] = await client.getPlugin(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getPlugin as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getPlugin as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getPlugin without error using callback', async () => { + const client = new apihubpluginModule.v1.ApiHubPluginClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetPluginRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetPluginRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Plugin() + ); + client.innerApiCalls.getPlugin = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getPlugin( + request, + (err?: Error|null, result?: protos.google.cloud.apihub.v1.IPlugin|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getPlugin as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getPlugin as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getPlugin with error', async () => { + const client = new apihubpluginModule.v1.ApiHubPluginClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetPluginRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetPluginRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getPlugin = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getPlugin(request), expectedError); + const actualRequest = (client.innerApiCalls.getPlugin as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getPlugin as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getPlugin with closed client', async () => { + const client = new apihubpluginModule.v1.ApiHubPluginClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetPluginRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetPluginRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getPlugin(request), expectedError); + }); + }); + + describe('enablePlugin', () => { + it('invokes enablePlugin without error', async () => { + const client = new apihubpluginModule.v1.ApiHubPluginClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.EnablePluginRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.EnablePluginRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Plugin() + ); + client.innerApiCalls.enablePlugin = stubSimpleCall(expectedResponse); + const [response] = await client.enablePlugin(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.enablePlugin as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.enablePlugin as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes enablePlugin without error using callback', async () => { + const client = new apihubpluginModule.v1.ApiHubPluginClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.EnablePluginRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.EnablePluginRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Plugin() + ); + client.innerApiCalls.enablePlugin = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.enablePlugin( + request, + (err?: Error|null, result?: protos.google.cloud.apihub.v1.IPlugin|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.enablePlugin as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.enablePlugin as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes enablePlugin with error', async () => { + const client = new apihubpluginModule.v1.ApiHubPluginClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.EnablePluginRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.EnablePluginRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.enablePlugin = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.enablePlugin(request), expectedError); + const actualRequest = (client.innerApiCalls.enablePlugin as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.enablePlugin as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes enablePlugin with closed client', async () => { + const client = new apihubpluginModule.v1.ApiHubPluginClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.EnablePluginRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.EnablePluginRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.enablePlugin(request), expectedError); + }); + }); + + describe('disablePlugin', () => { + it('invokes disablePlugin without error', async () => { + const client = new apihubpluginModule.v1.ApiHubPluginClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DisablePluginRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.DisablePluginRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Plugin() + ); + client.innerApiCalls.disablePlugin = stubSimpleCall(expectedResponse); + const [response] = await client.disablePlugin(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.disablePlugin as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.disablePlugin as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes disablePlugin without error using callback', async () => { + const client = new apihubpluginModule.v1.ApiHubPluginClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DisablePluginRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.DisablePluginRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Plugin() + ); + client.innerApiCalls.disablePlugin = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.disablePlugin( + request, + (err?: Error|null, result?: protos.google.cloud.apihub.v1.IPlugin|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.disablePlugin as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.disablePlugin as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes disablePlugin with error', async () => { + const client = new apihubpluginModule.v1.ApiHubPluginClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DisablePluginRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.DisablePluginRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.disablePlugin = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.disablePlugin(request), expectedError); + const actualRequest = (client.innerApiCalls.disablePlugin as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.disablePlugin as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes disablePlugin with closed client', async () => { + const client = new apihubpluginModule.v1.ApiHubPluginClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DisablePluginRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.DisablePluginRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.disablePlugin(request), expectedError); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new apihubpluginModule.v1.ApiHubPluginClient({ + auth: googleAuth, + 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 apihubpluginModule.v1.ApiHubPluginClient({ + auth: googleAuth, + 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 apihubpluginModule.v1.ApiHubPluginClient({ + auth: googleAuth, + 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 apihubpluginModule.v1.ApiHubPluginClient({ + auth: googleAuth, + 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 apihubpluginModule.v1.ApiHubPluginClient({ + 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('Path templates', () => { + + describe('api', () => { + const fakePath = "/rendered/path/api"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + api: "apiValue", + }; + const client = new apihubpluginModule.v1.ApiHubPluginClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.apiPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.apiPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('apiPath', () => { + const result = client.apiPath("projectValue", "locationValue", "apiValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.apiPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromApiName', () => { + const result = client.matchProjectFromApiName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.apiPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromApiName', () => { + const result = client.matchLocationFromApiName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.apiPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchApiFromApiName', () => { + const result = client.matchApiFromApiName(fakePath); + assert.strictEqual(result, "apiValue"); + assert((client.pathTemplates.apiPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('apiHubInstance', () => { + const fakePath = "/rendered/path/apiHubInstance"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + api_hub_instance: "apiHubInstanceValue", + }; + const client = new apihubpluginModule.v1.ApiHubPluginClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.apiHubInstancePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.apiHubInstancePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('apiHubInstancePath', () => { + const result = client.apiHubInstancePath("projectValue", "locationValue", "apiHubInstanceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.apiHubInstancePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromApiHubInstanceName', () => { + const result = client.matchProjectFromApiHubInstanceName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromApiHubInstanceName', () => { + const result = client.matchLocationFromApiHubInstanceName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchApiHubInstanceFromApiHubInstanceName', () => { + const result = client.matchApiHubInstanceFromApiHubInstanceName(fakePath); + assert.strictEqual(result, "apiHubInstanceValue"); + assert((client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('apiOperation', () => { + const fakePath = "/rendered/path/apiOperation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + api: "apiValue", + version: "versionValue", + operation: "operationValue", + }; + const client = new apihubpluginModule.v1.ApiHubPluginClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.apiOperationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.apiOperationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('apiOperationPath', () => { + const result = client.apiOperationPath("projectValue", "locationValue", "apiValue", "versionValue", "operationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.apiOperationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromApiOperationName', () => { + const result = client.matchProjectFromApiOperationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromApiOperationName', () => { + const result = client.matchLocationFromApiOperationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchApiFromApiOperationName', () => { + const result = client.matchApiFromApiOperationName(fakePath); + assert.strictEqual(result, "apiValue"); + assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchVersionFromApiOperationName', () => { + const result = client.matchVersionFromApiOperationName(fakePath); + assert.strictEqual(result, "versionValue"); + assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchOperationFromApiOperationName', () => { + const result = client.matchOperationFromApiOperationName(fakePath); + assert.strictEqual(result, "operationValue"); + assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('attribute', () => { + const fakePath = "/rendered/path/attribute"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + attribute: "attributeValue", + }; + const client = new apihubpluginModule.v1.ApiHubPluginClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.attributePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.attributePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('attributePath', () => { + const result = client.attributePath("projectValue", "locationValue", "attributeValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.attributePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAttributeName', () => { + const result = client.matchProjectFromAttributeName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.attributePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAttributeName', () => { + const result = client.matchLocationFromAttributeName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.attributePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAttributeFromAttributeName', () => { + const result = client.matchAttributeFromAttributeName(fakePath); + assert.strictEqual(result, "attributeValue"); + assert((client.pathTemplates.attributePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('definition', () => { + const fakePath = "/rendered/path/definition"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + api: "apiValue", + version: "versionValue", + definition: "definitionValue", + }; + const client = new apihubpluginModule.v1.ApiHubPluginClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.definitionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.definitionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('definitionPath', () => { + const result = client.definitionPath("projectValue", "locationValue", "apiValue", "versionValue", "definitionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.definitionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDefinitionName', () => { + const result = client.matchProjectFromDefinitionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDefinitionName', () => { + const result = client.matchLocationFromDefinitionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchApiFromDefinitionName', () => { + const result = client.matchApiFromDefinitionName(fakePath); + assert.strictEqual(result, "apiValue"); + assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchVersionFromDefinitionName', () => { + const result = client.matchVersionFromDefinitionName(fakePath); + assert.strictEqual(result, "versionValue"); + assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDefinitionFromDefinitionName', () => { + const result = client.matchDefinitionFromDefinitionName(fakePath); + assert.strictEqual(result, "definitionValue"); + assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dependency', () => { + const fakePath = "/rendered/path/dependency"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dependency: "dependencyValue", + }; + const client = new apihubpluginModule.v1.ApiHubPluginClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dependencyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.dependencyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('dependencyPath', () => { + const result = client.dependencyPath("projectValue", "locationValue", "dependencyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.dependencyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDependencyName', () => { + const result = client.matchProjectFromDependencyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.dependencyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDependencyName', () => { + const result = client.matchLocationFromDependencyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.dependencyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDependencyFromDependencyName', () => { + const result = client.matchDependencyFromDependencyName(fakePath); + assert.strictEqual(result, "dependencyValue"); + assert((client.pathTemplates.dependencyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('deployment', () => { + const fakePath = "/rendered/path/deployment"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + deployment: "deploymentValue", + }; + const client = new apihubpluginModule.v1.ApiHubPluginClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.deploymentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.deploymentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('deploymentPath', () => { + const result = client.deploymentPath("projectValue", "locationValue", "deploymentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.deploymentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDeploymentName', () => { + const result = client.matchProjectFromDeploymentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDeploymentName', () => { + const result = client.matchLocationFromDeploymentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDeploymentFromDeploymentName', () => { + const result = client.matchDeploymentFromDeploymentName(fakePath); + assert.strictEqual(result, "deploymentValue"); + assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('externalApi', () => { + const fakePath = "/rendered/path/externalApi"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + external_api: "externalApiValue", + }; + const client = new apihubpluginModule.v1.ApiHubPluginClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.externalApiPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.externalApiPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('externalApiPath', () => { + const result = client.externalApiPath("projectValue", "locationValue", "externalApiValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.externalApiPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromExternalApiName', () => { + const result = client.matchProjectFromExternalApiName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.externalApiPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromExternalApiName', () => { + const result = client.matchLocationFromExternalApiName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.externalApiPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExternalApiFromExternalApiName', () => { + const result = client.matchExternalApiFromExternalApiName(fakePath); + assert.strictEqual(result, "externalApiValue"); + assert((client.pathTemplates.externalApiPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('hostProjectRegistration', () => { + const fakePath = "/rendered/path/hostProjectRegistration"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + host_project_registration: "hostProjectRegistrationValue", + }; + const client = new apihubpluginModule.v1.ApiHubPluginClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.hostProjectRegistrationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.hostProjectRegistrationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('hostProjectRegistrationPath', () => { + const result = client.hostProjectRegistrationPath("projectValue", "locationValue", "hostProjectRegistrationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.hostProjectRegistrationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromHostProjectRegistrationName', () => { + const result = client.matchProjectFromHostProjectRegistrationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.hostProjectRegistrationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromHostProjectRegistrationName', () => { + const result = client.matchLocationFromHostProjectRegistrationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.hostProjectRegistrationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchHostProjectRegistrationFromHostProjectRegistrationName', () => { + const result = client.matchHostProjectRegistrationFromHostProjectRegistrationName(fakePath); + assert.strictEqual(result, "hostProjectRegistrationValue"); + assert((client.pathTemplates.hostProjectRegistrationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('plugin', () => { + const fakePath = "/rendered/path/plugin"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + plugin: "pluginValue", + }; + const client = new apihubpluginModule.v1.ApiHubPluginClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.pluginPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.pluginPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('pluginPath', () => { + const result = client.pluginPath("projectValue", "locationValue", "pluginValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.pluginPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromPluginName', () => { + const result = client.matchProjectFromPluginName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.pluginPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromPluginName', () => { + const result = client.matchLocationFromPluginName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.pluginPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPluginFromPluginName', () => { + const result = client.matchPluginFromPluginName(fakePath); + assert.strictEqual(result, "pluginValue"); + assert((client.pathTemplates.pluginPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('runtimeProjectAttachment', () => { + const fakePath = "/rendered/path/runtimeProjectAttachment"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + runtime_project_attachment: "runtimeProjectAttachmentValue", + }; + const client = new apihubpluginModule.v1.ApiHubPluginClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.runtimeProjectAttachmentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.runtimeProjectAttachmentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('runtimeProjectAttachmentPath', () => { + const result = client.runtimeProjectAttachmentPath("projectValue", "locationValue", "runtimeProjectAttachmentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromRuntimeProjectAttachmentName', () => { + const result = client.matchProjectFromRuntimeProjectAttachmentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromRuntimeProjectAttachmentName', () => { + const result = client.matchLocationFromRuntimeProjectAttachmentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName', () => { + const result = client.matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName(fakePath); + assert.strictEqual(result, "runtimeProjectAttachmentValue"); + assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('spec', () => { + const fakePath = "/rendered/path/spec"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + api: "apiValue", + version: "versionValue", + spec: "specValue", + }; + const client = new apihubpluginModule.v1.ApiHubPluginClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.specPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.specPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('specPath', () => { + const result = client.specPath("projectValue", "locationValue", "apiValue", "versionValue", "specValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.specPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSpecName', () => { + const result = client.matchProjectFromSpecName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSpecName', () => { + const result = client.matchLocationFromSpecName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchApiFromSpecName', () => { + const result = client.matchApiFromSpecName(fakePath); + assert.strictEqual(result, "apiValue"); + assert((client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchVersionFromSpecName', () => { + const result = client.matchVersionFromSpecName(fakePath); + assert.strictEqual(result, "versionValue"); + assert((client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSpecFromSpecName', () => { + const result = client.matchSpecFromSpecName(fakePath); + assert.strictEqual(result, "specValue"); + assert((client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('styleGuide', () => { + const fakePath = "/rendered/path/styleGuide"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + plugin: "pluginValue", + }; + const client = new apihubpluginModule.v1.ApiHubPluginClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.styleGuidePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.styleGuidePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('styleGuidePath', () => { + const result = client.styleGuidePath("projectValue", "locationValue", "pluginValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.styleGuidePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromStyleGuideName', () => { + const result = client.matchProjectFromStyleGuideName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.styleGuidePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromStyleGuideName', () => { + const result = client.matchLocationFromStyleGuideName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.styleGuidePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPluginFromStyleGuideName', () => { + const result = client.matchPluginFromStyleGuideName(fakePath); + assert.strictEqual(result, "pluginValue"); + assert((client.pathTemplates.styleGuidePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('version', () => { + const fakePath = "/rendered/path/version"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + api: "apiValue", + version: "versionValue", + }; + const client = new apihubpluginModule.v1.ApiHubPluginClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.versionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.versionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('versionPath', () => { + const result = client.versionPath("projectValue", "locationValue", "apiValue", "versionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.versionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromVersionName', () => { + const result = client.matchProjectFromVersionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromVersionName', () => { + const result = client.matchLocationFromVersionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchApiFromVersionName', () => { + const result = client.matchApiFromVersionName(fakePath); + assert.strictEqual(result, "apiValue"); + assert((client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchVersionFromVersionName', () => { + const result = client.matchVersionFromVersionName(fakePath); + assert.strictEqual(result, "versionValue"); + assert((client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-apihub/v1/test/gapic_api_hub_v1.ts b/owl-bot-staging/google-cloud-apihub/v1/test/gapic_api_hub_v1.ts new file mode 100644 index 00000000000..c0ac312408c --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/test/gapic_api_hub_v1.ts @@ -0,0 +1,6109 @@ +// Copyright 2024 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, beforeEach, afterEach} from 'mocha'; +import * as apihubModule from '../src'; + +import {PassThrough} from 'stream'; + +import {GoogleAuth, protobuf, 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 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.ApiHubClient', () => { + let googleAuth: GoogleAuth; + beforeEach(() => { + googleAuth = { + getClient: sinon.stub().resolves({ + getRequestHeaders: sinon.stub().resolves({Authorization: 'Bearer SOME_TOKEN'}), + }) + } as unknown as GoogleAuth; + }); + afterEach(() => { + sinon.restore(); + }); + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new apihubModule.v1.ApiHubClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'apihub.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new apihubModule.v1.ApiHubClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, "googleapis.com"); + }); + + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = apihubModule.v1.ApiHubClient.servicePath; + assert.strictEqual(servicePath, 'apihub.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = apihubModule.v1.ApiHubClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'apihub.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new apihubModule.v1.ApiHubClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'apihub.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new apihubModule.v1.ApiHubClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'apihub.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new apihubModule.v1.ApiHubClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'apihub.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new apihubModule.v1.ApiHubClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'apihub.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { new apihubModule.v1.ApiHubClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = apihubModule.v1.ApiHubClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new apihubModule.v1.ApiHubClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new apihubModule.v1.ApiHubClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + assert.strictEqual(client.apiHubStub, undefined); + await client.initialize(); + assert(client.apiHubStub); + }); + + it('has close method for the initialized client', done => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + assert(client.apiHubStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + assert.strictEqual(client.apiHubStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + 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 apihubModule.v1.ApiHubClient({ + auth: googleAuth, + 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('createApi', () => { + it('invokes createApi without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateApiRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.CreateApiRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Api() + ); + client.innerApiCalls.createApi = stubSimpleCall(expectedResponse); + const [response] = await client.createApi(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createApi as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createApi as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createApi without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateApiRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.CreateApiRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Api() + ); + client.innerApiCalls.createApi = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createApi( + request, + (err?: Error|null, result?: protos.google.cloud.apihub.v1.IApi|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createApi as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createApi as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createApi with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateApiRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.CreateApiRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createApi = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createApi(request), expectedError); + const actualRequest = (client.innerApiCalls.createApi as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createApi as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createApi with closed client', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateApiRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.CreateApiRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createApi(request), expectedError); + }); + }); + + describe('getApi', () => { + it('invokes getApi without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetApiRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetApiRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Api() + ); + client.innerApiCalls.getApi = stubSimpleCall(expectedResponse); + const [response] = await client.getApi(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getApi as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getApi as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getApi without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetApiRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetApiRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Api() + ); + client.innerApiCalls.getApi = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getApi( + request, + (err?: Error|null, result?: protos.google.cloud.apihub.v1.IApi|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getApi as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getApi as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getApi with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetApiRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetApiRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getApi = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getApi(request), expectedError); + const actualRequest = (client.innerApiCalls.getApi as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getApi as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getApi with closed client', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetApiRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetApiRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getApi(request), expectedError); + }); + }); + + describe('updateApi', () => { + it('invokes updateApi without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.UpdateApiRequest() + ); + request.api ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.UpdateApiRequest', ['api', 'name']); + request.api.name = defaultValue1; + const expectedHeaderRequestParams = `api.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Api() + ); + client.innerApiCalls.updateApi = stubSimpleCall(expectedResponse); + const [response] = await client.updateApi(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateApi as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateApi as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateApi without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.UpdateApiRequest() + ); + request.api ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.UpdateApiRequest', ['api', 'name']); + request.api.name = defaultValue1; + const expectedHeaderRequestParams = `api.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Api() + ); + client.innerApiCalls.updateApi = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateApi( + request, + (err?: Error|null, result?: protos.google.cloud.apihub.v1.IApi|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateApi as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateApi as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateApi with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.UpdateApiRequest() + ); + request.api ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.UpdateApiRequest', ['api', 'name']); + request.api.name = defaultValue1; + const expectedHeaderRequestParams = `api.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateApi = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateApi(request), expectedError); + const actualRequest = (client.innerApiCalls.updateApi as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateApi as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateApi with closed client', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.UpdateApiRequest() + ); + request.api ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.UpdateApiRequest', ['api', 'name']); + request.api.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateApi(request), expectedError); + }); + }); + + describe('deleteApi', () => { + it('invokes deleteApi without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DeleteApiRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.DeleteApiRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteApi = stubSimpleCall(expectedResponse); + const [response] = await client.deleteApi(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteApi as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteApi as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteApi without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DeleteApiRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.DeleteApiRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteApi = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteApi( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteApi as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteApi as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteApi with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DeleteApiRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.DeleteApiRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteApi = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteApi(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteApi as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteApi as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteApi with closed client', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DeleteApiRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.DeleteApiRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteApi(request), expectedError); + }); + }); + + describe('createVersion', () => { + it('invokes createVersion without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.CreateVersionRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Version() + ); + client.innerApiCalls.createVersion = stubSimpleCall(expectedResponse); + const [response] = await client.createVersion(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createVersion without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.CreateVersionRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Version() + ); + client.innerApiCalls.createVersion = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createVersion( + request, + (err?: Error|null, result?: protos.google.cloud.apihub.v1.IVersion|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createVersion with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.CreateVersionRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createVersion = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createVersion(request), expectedError); + const actualRequest = (client.innerApiCalls.createVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createVersion with closed client', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.CreateVersionRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createVersion(request), expectedError); + }); + }); + + describe('getVersion', () => { + it('invokes getVersion without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetVersionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Version() + ); + client.innerApiCalls.getVersion = stubSimpleCall(expectedResponse); + const [response] = await client.getVersion(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getVersion without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetVersionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Version() + ); + client.innerApiCalls.getVersion = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getVersion( + request, + (err?: Error|null, result?: protos.google.cloud.apihub.v1.IVersion|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getVersion with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetVersionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getVersion = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getVersion(request), expectedError); + const actualRequest = (client.innerApiCalls.getVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getVersion with closed client', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetVersionRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getVersion(request), expectedError); + }); + }); + + describe('updateVersion', () => { + it('invokes updateVersion without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.UpdateVersionRequest() + ); + request.version ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.UpdateVersionRequest', ['version', 'name']); + request.version.name = defaultValue1; + const expectedHeaderRequestParams = `version.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Version() + ); + client.innerApiCalls.updateVersion = stubSimpleCall(expectedResponse); + const [response] = await client.updateVersion(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateVersion without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.UpdateVersionRequest() + ); + request.version ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.UpdateVersionRequest', ['version', 'name']); + request.version.name = defaultValue1; + const expectedHeaderRequestParams = `version.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Version() + ); + client.innerApiCalls.updateVersion = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateVersion( + request, + (err?: Error|null, result?: protos.google.cloud.apihub.v1.IVersion|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateVersion with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.UpdateVersionRequest() + ); + request.version ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.UpdateVersionRequest', ['version', 'name']); + request.version.name = defaultValue1; + const expectedHeaderRequestParams = `version.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateVersion = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateVersion(request), expectedError); + const actualRequest = (client.innerApiCalls.updateVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateVersion with closed client', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.UpdateVersionRequest() + ); + request.version ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.UpdateVersionRequest', ['version', 'name']); + request.version.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateVersion(request), expectedError); + }); + }); + + describe('deleteVersion', () => { + it('invokes deleteVersion without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DeleteVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.DeleteVersionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteVersion = stubSimpleCall(expectedResponse); + const [response] = await client.deleteVersion(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteVersion without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DeleteVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.DeleteVersionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteVersion = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteVersion( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteVersion with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DeleteVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.DeleteVersionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteVersion = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteVersion(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteVersion with closed client', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DeleteVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.DeleteVersionRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteVersion(request), expectedError); + }); + }); + + describe('createSpec', () => { + it('invokes createSpec without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateSpecRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.CreateSpecRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Spec() + ); + client.innerApiCalls.createSpec = stubSimpleCall(expectedResponse); + const [response] = await client.createSpec(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createSpec as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createSpec as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSpec without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateSpecRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.CreateSpecRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Spec() + ); + client.innerApiCalls.createSpec = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createSpec( + request, + (err?: Error|null, result?: protos.google.cloud.apihub.v1.ISpec|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createSpec as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createSpec as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSpec with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateSpecRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.CreateSpecRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createSpec = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createSpec(request), expectedError); + const actualRequest = (client.innerApiCalls.createSpec as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createSpec as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSpec with closed client', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateSpecRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.CreateSpecRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createSpec(request), expectedError); + }); + }); + + describe('getSpec', () => { + it('invokes getSpec without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetSpecRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetSpecRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Spec() + ); + client.innerApiCalls.getSpec = stubSimpleCall(expectedResponse); + const [response] = await client.getSpec(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getSpec as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getSpec as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSpec without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetSpecRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetSpecRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Spec() + ); + client.innerApiCalls.getSpec = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getSpec( + request, + (err?: Error|null, result?: protos.google.cloud.apihub.v1.ISpec|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getSpec as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getSpec as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSpec with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetSpecRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetSpecRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getSpec = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getSpec(request), expectedError); + const actualRequest = (client.innerApiCalls.getSpec as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getSpec as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSpec with closed client', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetSpecRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetSpecRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getSpec(request), expectedError); + }); + }); + + describe('getSpecContents', () => { + it('invokes getSpecContents without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetSpecContentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetSpecContentsRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.SpecContents() + ); + client.innerApiCalls.getSpecContents = stubSimpleCall(expectedResponse); + const [response] = await client.getSpecContents(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getSpecContents as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getSpecContents as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSpecContents without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetSpecContentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetSpecContentsRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.SpecContents() + ); + client.innerApiCalls.getSpecContents = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getSpecContents( + request, + (err?: Error|null, result?: protos.google.cloud.apihub.v1.ISpecContents|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getSpecContents as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getSpecContents as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSpecContents with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetSpecContentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetSpecContentsRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getSpecContents = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getSpecContents(request), expectedError); + const actualRequest = (client.innerApiCalls.getSpecContents as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getSpecContents as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSpecContents with closed client', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetSpecContentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetSpecContentsRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getSpecContents(request), expectedError); + }); + }); + + describe('updateSpec', () => { + it('invokes updateSpec without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.UpdateSpecRequest() + ); + request.spec ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.UpdateSpecRequest', ['spec', 'name']); + request.spec.name = defaultValue1; + const expectedHeaderRequestParams = `spec.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Spec() + ); + client.innerApiCalls.updateSpec = stubSimpleCall(expectedResponse); + const [response] = await client.updateSpec(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateSpec as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateSpec as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSpec without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.UpdateSpecRequest() + ); + request.spec ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.UpdateSpecRequest', ['spec', 'name']); + request.spec.name = defaultValue1; + const expectedHeaderRequestParams = `spec.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Spec() + ); + client.innerApiCalls.updateSpec = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateSpec( + request, + (err?: Error|null, result?: protos.google.cloud.apihub.v1.ISpec|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateSpec as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateSpec as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSpec with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.UpdateSpecRequest() + ); + request.spec ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.UpdateSpecRequest', ['spec', 'name']); + request.spec.name = defaultValue1; + const expectedHeaderRequestParams = `spec.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateSpec = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateSpec(request), expectedError); + const actualRequest = (client.innerApiCalls.updateSpec as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateSpec as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSpec with closed client', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.UpdateSpecRequest() + ); + request.spec ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.UpdateSpecRequest', ['spec', 'name']); + request.spec.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateSpec(request), expectedError); + }); + }); + + describe('deleteSpec', () => { + it('invokes deleteSpec without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DeleteSpecRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.DeleteSpecRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteSpec = stubSimpleCall(expectedResponse); + const [response] = await client.deleteSpec(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteSpec as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteSpec as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSpec without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DeleteSpecRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.DeleteSpecRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteSpec = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteSpec( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteSpec as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteSpec as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSpec with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DeleteSpecRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.DeleteSpecRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteSpec = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteSpec(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteSpec as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteSpec as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSpec with closed client', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DeleteSpecRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.DeleteSpecRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteSpec(request), expectedError); + }); + }); + + describe('getApiOperation', () => { + it('invokes getApiOperation without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetApiOperationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetApiOperationRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.ApiOperation() + ); + client.innerApiCalls.getApiOperation = stubSimpleCall(expectedResponse); + const [response] = await client.getApiOperation(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getApiOperation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getApiOperation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getApiOperation without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetApiOperationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetApiOperationRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.ApiOperation() + ); + client.innerApiCalls.getApiOperation = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getApiOperation( + request, + (err?: Error|null, result?: protos.google.cloud.apihub.v1.IApiOperation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getApiOperation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getApiOperation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getApiOperation with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetApiOperationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetApiOperationRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getApiOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getApiOperation(request), expectedError); + const actualRequest = (client.innerApiCalls.getApiOperation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getApiOperation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getApiOperation with closed client', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetApiOperationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetApiOperationRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getApiOperation(request), expectedError); + }); + }); + + describe('getDefinition', () => { + it('invokes getDefinition without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetDefinitionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetDefinitionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Definition() + ); + client.innerApiCalls.getDefinition = stubSimpleCall(expectedResponse); + const [response] = await client.getDefinition(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getDefinition as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getDefinition as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDefinition without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetDefinitionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetDefinitionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Definition() + ); + client.innerApiCalls.getDefinition = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getDefinition( + request, + (err?: Error|null, result?: protos.google.cloud.apihub.v1.IDefinition|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getDefinition as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getDefinition as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDefinition with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetDefinitionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetDefinitionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getDefinition = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getDefinition(request), expectedError); + const actualRequest = (client.innerApiCalls.getDefinition as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getDefinition as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDefinition with closed client', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetDefinitionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetDefinitionRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getDefinition(request), expectedError); + }); + }); + + describe('createDeployment', () => { + it('invokes createDeployment without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateDeploymentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.CreateDeploymentRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Deployment() + ); + client.innerApiCalls.createDeployment = stubSimpleCall(expectedResponse); + const [response] = await client.createDeployment(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createDeployment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createDeployment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createDeployment without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateDeploymentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.CreateDeploymentRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Deployment() + ); + client.innerApiCalls.createDeployment = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createDeployment( + request, + (err?: Error|null, result?: protos.google.cloud.apihub.v1.IDeployment|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createDeployment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createDeployment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createDeployment with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateDeploymentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.CreateDeploymentRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createDeployment = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createDeployment(request), expectedError); + const actualRequest = (client.innerApiCalls.createDeployment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createDeployment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createDeployment with closed client', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateDeploymentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.CreateDeploymentRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createDeployment(request), expectedError); + }); + }); + + describe('getDeployment', () => { + it('invokes getDeployment without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetDeploymentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetDeploymentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Deployment() + ); + client.innerApiCalls.getDeployment = stubSimpleCall(expectedResponse); + const [response] = await client.getDeployment(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getDeployment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getDeployment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDeployment without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetDeploymentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetDeploymentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Deployment() + ); + client.innerApiCalls.getDeployment = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getDeployment( + request, + (err?: Error|null, result?: protos.google.cloud.apihub.v1.IDeployment|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getDeployment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getDeployment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDeployment with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetDeploymentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetDeploymentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getDeployment = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getDeployment(request), expectedError); + const actualRequest = (client.innerApiCalls.getDeployment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getDeployment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDeployment with closed client', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetDeploymentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetDeploymentRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getDeployment(request), expectedError); + }); + }); + + describe('updateDeployment', () => { + it('invokes updateDeployment without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.UpdateDeploymentRequest() + ); + request.deployment ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.UpdateDeploymentRequest', ['deployment', 'name']); + request.deployment.name = defaultValue1; + const expectedHeaderRequestParams = `deployment.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Deployment() + ); + client.innerApiCalls.updateDeployment = stubSimpleCall(expectedResponse); + const [response] = await client.updateDeployment(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateDeployment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateDeployment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDeployment without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.UpdateDeploymentRequest() + ); + request.deployment ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.UpdateDeploymentRequest', ['deployment', 'name']); + request.deployment.name = defaultValue1; + const expectedHeaderRequestParams = `deployment.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Deployment() + ); + client.innerApiCalls.updateDeployment = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateDeployment( + request, + (err?: Error|null, result?: protos.google.cloud.apihub.v1.IDeployment|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateDeployment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateDeployment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDeployment with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.UpdateDeploymentRequest() + ); + request.deployment ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.UpdateDeploymentRequest', ['deployment', 'name']); + request.deployment.name = defaultValue1; + const expectedHeaderRequestParams = `deployment.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateDeployment = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateDeployment(request), expectedError); + const actualRequest = (client.innerApiCalls.updateDeployment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateDeployment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDeployment with closed client', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.UpdateDeploymentRequest() + ); + request.deployment ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.UpdateDeploymentRequest', ['deployment', 'name']); + request.deployment.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateDeployment(request), expectedError); + }); + }); + + describe('deleteDeployment', () => { + it('invokes deleteDeployment without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DeleteDeploymentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.DeleteDeploymentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteDeployment = stubSimpleCall(expectedResponse); + const [response] = await client.deleteDeployment(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteDeployment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteDeployment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteDeployment without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DeleteDeploymentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.DeleteDeploymentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteDeployment = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteDeployment( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteDeployment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteDeployment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteDeployment with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DeleteDeploymentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.DeleteDeploymentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteDeployment = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteDeployment(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteDeployment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteDeployment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteDeployment with closed client', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DeleteDeploymentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.DeleteDeploymentRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteDeployment(request), expectedError); + }); + }); + + describe('createAttribute', () => { + it('invokes createAttribute without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateAttributeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.CreateAttributeRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Attribute() + ); + client.innerApiCalls.createAttribute = stubSimpleCall(expectedResponse); + const [response] = await client.createAttribute(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createAttribute as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createAttribute as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createAttribute without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateAttributeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.CreateAttributeRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Attribute() + ); + client.innerApiCalls.createAttribute = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createAttribute( + request, + (err?: Error|null, result?: protos.google.cloud.apihub.v1.IAttribute|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createAttribute as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createAttribute as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createAttribute with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateAttributeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.CreateAttributeRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createAttribute = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createAttribute(request), expectedError); + const actualRequest = (client.innerApiCalls.createAttribute as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createAttribute as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createAttribute with closed client', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateAttributeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.CreateAttributeRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createAttribute(request), expectedError); + }); + }); + + describe('getAttribute', () => { + it('invokes getAttribute without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetAttributeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetAttributeRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Attribute() + ); + client.innerApiCalls.getAttribute = stubSimpleCall(expectedResponse); + const [response] = await client.getAttribute(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getAttribute as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getAttribute as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAttribute without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetAttributeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetAttributeRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Attribute() + ); + client.innerApiCalls.getAttribute = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getAttribute( + request, + (err?: Error|null, result?: protos.google.cloud.apihub.v1.IAttribute|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getAttribute as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getAttribute as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAttribute with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetAttributeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetAttributeRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getAttribute = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getAttribute(request), expectedError); + const actualRequest = (client.innerApiCalls.getAttribute as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getAttribute as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAttribute with closed client', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetAttributeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetAttributeRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getAttribute(request), expectedError); + }); + }); + + describe('updateAttribute', () => { + it('invokes updateAttribute without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.UpdateAttributeRequest() + ); + request.attribute ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.UpdateAttributeRequest', ['attribute', 'name']); + request.attribute.name = defaultValue1; + const expectedHeaderRequestParams = `attribute.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Attribute() + ); + client.innerApiCalls.updateAttribute = stubSimpleCall(expectedResponse); + const [response] = await client.updateAttribute(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateAttribute as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateAttribute as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateAttribute without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.UpdateAttributeRequest() + ); + request.attribute ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.UpdateAttributeRequest', ['attribute', 'name']); + request.attribute.name = defaultValue1; + const expectedHeaderRequestParams = `attribute.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.Attribute() + ); + client.innerApiCalls.updateAttribute = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateAttribute( + request, + (err?: Error|null, result?: protos.google.cloud.apihub.v1.IAttribute|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateAttribute as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateAttribute as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateAttribute with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.UpdateAttributeRequest() + ); + request.attribute ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.UpdateAttributeRequest', ['attribute', 'name']); + request.attribute.name = defaultValue1; + const expectedHeaderRequestParams = `attribute.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateAttribute = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateAttribute(request), expectedError); + const actualRequest = (client.innerApiCalls.updateAttribute as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateAttribute as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateAttribute with closed client', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.UpdateAttributeRequest() + ); + request.attribute ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.UpdateAttributeRequest', ['attribute', 'name']); + request.attribute.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateAttribute(request), expectedError); + }); + }); + + describe('deleteAttribute', () => { + it('invokes deleteAttribute without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DeleteAttributeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.DeleteAttributeRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteAttribute = stubSimpleCall(expectedResponse); + const [response] = await client.deleteAttribute(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteAttribute as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteAttribute as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteAttribute without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DeleteAttributeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.DeleteAttributeRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteAttribute = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteAttribute( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteAttribute as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteAttribute as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteAttribute with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DeleteAttributeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.DeleteAttributeRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteAttribute = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteAttribute(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteAttribute as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteAttribute as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteAttribute with closed client', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DeleteAttributeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.DeleteAttributeRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteAttribute(request), expectedError); + }); + }); + + describe('createExternalApi', () => { + it('invokes createExternalApi without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateExternalApiRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.CreateExternalApiRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.ExternalApi() + ); + client.innerApiCalls.createExternalApi = stubSimpleCall(expectedResponse); + const [response] = await client.createExternalApi(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createExternalApi as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createExternalApi as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createExternalApi without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateExternalApiRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.CreateExternalApiRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.ExternalApi() + ); + client.innerApiCalls.createExternalApi = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createExternalApi( + request, + (err?: Error|null, result?: protos.google.cloud.apihub.v1.IExternalApi|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createExternalApi as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createExternalApi as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createExternalApi with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateExternalApiRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.CreateExternalApiRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createExternalApi = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createExternalApi(request), expectedError); + const actualRequest = (client.innerApiCalls.createExternalApi as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createExternalApi as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createExternalApi with closed client', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateExternalApiRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.CreateExternalApiRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createExternalApi(request), expectedError); + }); + }); + + describe('getExternalApi', () => { + it('invokes getExternalApi without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetExternalApiRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetExternalApiRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.ExternalApi() + ); + client.innerApiCalls.getExternalApi = stubSimpleCall(expectedResponse); + const [response] = await client.getExternalApi(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getExternalApi as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getExternalApi as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getExternalApi without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetExternalApiRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetExternalApiRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.ExternalApi() + ); + client.innerApiCalls.getExternalApi = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getExternalApi( + request, + (err?: Error|null, result?: protos.google.cloud.apihub.v1.IExternalApi|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getExternalApi as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getExternalApi as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getExternalApi with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetExternalApiRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetExternalApiRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getExternalApi = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getExternalApi(request), expectedError); + const actualRequest = (client.innerApiCalls.getExternalApi as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getExternalApi as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getExternalApi with closed client', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetExternalApiRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetExternalApiRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getExternalApi(request), expectedError); + }); + }); + + describe('updateExternalApi', () => { + it('invokes updateExternalApi without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.UpdateExternalApiRequest() + ); + request.externalApi ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.UpdateExternalApiRequest', ['externalApi', 'name']); + request.externalApi.name = defaultValue1; + const expectedHeaderRequestParams = `external_api.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.ExternalApi() + ); + client.innerApiCalls.updateExternalApi = stubSimpleCall(expectedResponse); + const [response] = await client.updateExternalApi(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateExternalApi as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateExternalApi as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateExternalApi without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.UpdateExternalApiRequest() + ); + request.externalApi ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.UpdateExternalApiRequest', ['externalApi', 'name']); + request.externalApi.name = defaultValue1; + const expectedHeaderRequestParams = `external_api.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.ExternalApi() + ); + client.innerApiCalls.updateExternalApi = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateExternalApi( + request, + (err?: Error|null, result?: protos.google.cloud.apihub.v1.IExternalApi|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateExternalApi as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateExternalApi as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateExternalApi with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.UpdateExternalApiRequest() + ); + request.externalApi ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.UpdateExternalApiRequest', ['externalApi', 'name']); + request.externalApi.name = defaultValue1; + const expectedHeaderRequestParams = `external_api.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateExternalApi = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateExternalApi(request), expectedError); + const actualRequest = (client.innerApiCalls.updateExternalApi as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateExternalApi as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateExternalApi with closed client', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.UpdateExternalApiRequest() + ); + request.externalApi ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.UpdateExternalApiRequest', ['externalApi', 'name']); + request.externalApi.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateExternalApi(request), expectedError); + }); + }); + + describe('deleteExternalApi', () => { + it('invokes deleteExternalApi without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DeleteExternalApiRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.DeleteExternalApiRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteExternalApi = stubSimpleCall(expectedResponse); + const [response] = await client.deleteExternalApi(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteExternalApi as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteExternalApi as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteExternalApi without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DeleteExternalApiRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.DeleteExternalApiRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteExternalApi = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteExternalApi( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteExternalApi as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteExternalApi as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteExternalApi with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DeleteExternalApiRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.DeleteExternalApiRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteExternalApi = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteExternalApi(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteExternalApi as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteExternalApi as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteExternalApi with closed client', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DeleteExternalApiRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.DeleteExternalApiRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteExternalApi(request), expectedError); + }); + }); + + describe('listApis', () => { + it('invokes listApis without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListApisRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListApisRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.Api()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Api()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Api()), + ]; + client.innerApiCalls.listApis = stubSimpleCall(expectedResponse); + const [response] = await client.listApis(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listApis as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listApis as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listApis without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListApisRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListApisRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.Api()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Api()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Api()), + ]; + client.innerApiCalls.listApis = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listApis( + request, + (err?: Error|null, result?: protos.google.cloud.apihub.v1.IApi[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listApis as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listApis as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listApis with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListApisRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListApisRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listApis = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listApis(request), expectedError); + const actualRequest = (client.innerApiCalls.listApis as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listApis as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listApisStream without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListApisRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListApisRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.Api()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Api()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Api()), + ]; + client.descriptors.page.listApis.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listApisStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.apihub.v1.Api[] = []; + stream.on('data', (response: protos.google.cloud.apihub.v1.Api) => { + 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.listApis.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listApis, request)); + assert( + (client.descriptors.page.listApis.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listApisStream with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListApisRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListApisRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listApis.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listApisStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.apihub.v1.Api[] = []; + stream.on('data', (response: protos.google.cloud.apihub.v1.Api) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listApis.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listApis, request)); + assert( + (client.descriptors.page.listApis.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listApis without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListApisRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListApisRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.Api()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Api()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Api()), + ]; + client.descriptors.page.listApis.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.apihub.v1.IApi[] = []; + const iterable = client.listApisAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listApis.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listApis.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listApis with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListApisRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListApisRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listApis.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listApisAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.apihub.v1.IApi[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listApis.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listApis.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listVersions', () => { + it('invokes listVersions without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListVersionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListVersionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.Version()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Version()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Version()), + ]; + client.innerApiCalls.listVersions = stubSimpleCall(expectedResponse); + const [response] = await client.listVersions(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listVersions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listVersions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listVersions without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListVersionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListVersionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.Version()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Version()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Version()), + ]; + client.innerApiCalls.listVersions = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listVersions( + request, + (err?: Error|null, result?: protos.google.cloud.apihub.v1.IVersion[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listVersions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listVersions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listVersions with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListVersionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListVersionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listVersions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listVersions(request), expectedError); + const actualRequest = (client.innerApiCalls.listVersions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listVersions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listVersionsStream without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListVersionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListVersionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.Version()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Version()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Version()), + ]; + client.descriptors.page.listVersions.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listVersionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.apihub.v1.Version[] = []; + stream.on('data', (response: protos.google.cloud.apihub.v1.Version) => { + 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.listVersions.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listVersions, request)); + assert( + (client.descriptors.page.listVersions.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listVersionsStream with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListVersionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListVersionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listVersions.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listVersionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.apihub.v1.Version[] = []; + stream.on('data', (response: protos.google.cloud.apihub.v1.Version) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listVersions.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listVersions, request)); + assert( + (client.descriptors.page.listVersions.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listVersions without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListVersionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListVersionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.Version()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Version()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Version()), + ]; + client.descriptors.page.listVersions.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.apihub.v1.IVersion[] = []; + const iterable = client.listVersionsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listVersions.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listVersions.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listVersions with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListVersionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListVersionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listVersions.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listVersionsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.apihub.v1.IVersion[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listVersions.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listVersions.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listSpecs', () => { + it('invokes listSpecs without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListSpecsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListSpecsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.Spec()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Spec()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Spec()), + ]; + client.innerApiCalls.listSpecs = stubSimpleCall(expectedResponse); + const [response] = await client.listSpecs(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listSpecs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listSpecs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSpecs without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListSpecsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListSpecsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.Spec()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Spec()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Spec()), + ]; + client.innerApiCalls.listSpecs = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listSpecs( + request, + (err?: Error|null, result?: protos.google.cloud.apihub.v1.ISpec[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listSpecs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listSpecs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSpecs with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListSpecsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListSpecsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listSpecs = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listSpecs(request), expectedError); + const actualRequest = (client.innerApiCalls.listSpecs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listSpecs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSpecsStream without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListSpecsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListSpecsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.Spec()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Spec()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Spec()), + ]; + client.descriptors.page.listSpecs.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listSpecsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.apihub.v1.Spec[] = []; + stream.on('data', (response: protos.google.cloud.apihub.v1.Spec) => { + 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.listSpecs.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listSpecs, request)); + assert( + (client.descriptors.page.listSpecs.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listSpecsStream with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListSpecsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListSpecsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listSpecs.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listSpecsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.apihub.v1.Spec[] = []; + stream.on('data', (response: protos.google.cloud.apihub.v1.Spec) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listSpecs.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listSpecs, request)); + assert( + (client.descriptors.page.listSpecs.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listSpecs without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListSpecsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListSpecsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.Spec()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Spec()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Spec()), + ]; + client.descriptors.page.listSpecs.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.apihub.v1.ISpec[] = []; + const iterable = client.listSpecsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listSpecs.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listSpecs.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listSpecs with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListSpecsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListSpecsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listSpecs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listSpecsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.apihub.v1.ISpec[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listSpecs.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listSpecs.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listApiOperations', () => { + it('invokes listApiOperations without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListApiOperationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListApiOperationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.ApiOperation()), + generateSampleMessage(new protos.google.cloud.apihub.v1.ApiOperation()), + generateSampleMessage(new protos.google.cloud.apihub.v1.ApiOperation()), + ]; + client.innerApiCalls.listApiOperations = stubSimpleCall(expectedResponse); + const [response] = await client.listApiOperations(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listApiOperations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listApiOperations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listApiOperations without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListApiOperationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListApiOperationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.ApiOperation()), + generateSampleMessage(new protos.google.cloud.apihub.v1.ApiOperation()), + generateSampleMessage(new protos.google.cloud.apihub.v1.ApiOperation()), + ]; + client.innerApiCalls.listApiOperations = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listApiOperations( + request, + (err?: Error|null, result?: protos.google.cloud.apihub.v1.IApiOperation[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listApiOperations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listApiOperations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listApiOperations with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListApiOperationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListApiOperationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listApiOperations = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listApiOperations(request), expectedError); + const actualRequest = (client.innerApiCalls.listApiOperations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listApiOperations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listApiOperationsStream without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListApiOperationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListApiOperationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.ApiOperation()), + generateSampleMessage(new protos.google.cloud.apihub.v1.ApiOperation()), + generateSampleMessage(new protos.google.cloud.apihub.v1.ApiOperation()), + ]; + client.descriptors.page.listApiOperations.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listApiOperationsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.apihub.v1.ApiOperation[] = []; + stream.on('data', (response: protos.google.cloud.apihub.v1.ApiOperation) => { + 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.listApiOperations.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listApiOperations, request)); + assert( + (client.descriptors.page.listApiOperations.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listApiOperationsStream with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListApiOperationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListApiOperationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listApiOperations.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listApiOperationsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.apihub.v1.ApiOperation[] = []; + stream.on('data', (response: protos.google.cloud.apihub.v1.ApiOperation) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listApiOperations.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listApiOperations, request)); + assert( + (client.descriptors.page.listApiOperations.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listApiOperations without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListApiOperationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListApiOperationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.ApiOperation()), + generateSampleMessage(new protos.google.cloud.apihub.v1.ApiOperation()), + generateSampleMessage(new protos.google.cloud.apihub.v1.ApiOperation()), + ]; + client.descriptors.page.listApiOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.apihub.v1.IApiOperation[] = []; + const iterable = client.listApiOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listApiOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listApiOperations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listApiOperations with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListApiOperationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListApiOperationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listApiOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listApiOperationsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.apihub.v1.IApiOperation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listApiOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listApiOperations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listDeployments', () => { + it('invokes listDeployments without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListDeploymentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListDeploymentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.Deployment()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Deployment()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Deployment()), + ]; + client.innerApiCalls.listDeployments = stubSimpleCall(expectedResponse); + const [response] = await client.listDeployments(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listDeployments as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listDeployments as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDeployments without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListDeploymentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListDeploymentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.Deployment()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Deployment()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Deployment()), + ]; + client.innerApiCalls.listDeployments = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listDeployments( + request, + (err?: Error|null, result?: protos.google.cloud.apihub.v1.IDeployment[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listDeployments as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listDeployments as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDeployments with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListDeploymentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListDeploymentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listDeployments = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listDeployments(request), expectedError); + const actualRequest = (client.innerApiCalls.listDeployments as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listDeployments as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDeploymentsStream without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListDeploymentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListDeploymentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.Deployment()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Deployment()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Deployment()), + ]; + client.descriptors.page.listDeployments.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listDeploymentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.apihub.v1.Deployment[] = []; + stream.on('data', (response: protos.google.cloud.apihub.v1.Deployment) => { + 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.listDeployments.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listDeployments, request)); + assert( + (client.descriptors.page.listDeployments.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listDeploymentsStream with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListDeploymentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListDeploymentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listDeployments.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listDeploymentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.apihub.v1.Deployment[] = []; + stream.on('data', (response: protos.google.cloud.apihub.v1.Deployment) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listDeployments.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listDeployments, request)); + assert( + (client.descriptors.page.listDeployments.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listDeployments without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListDeploymentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListDeploymentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.Deployment()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Deployment()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Deployment()), + ]; + client.descriptors.page.listDeployments.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.apihub.v1.IDeployment[] = []; + const iterable = client.listDeploymentsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listDeployments.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listDeployments.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listDeployments with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListDeploymentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListDeploymentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listDeployments.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listDeploymentsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.apihub.v1.IDeployment[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listDeployments.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listDeployments.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listAttributes', () => { + it('invokes listAttributes without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListAttributesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListAttributesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.Attribute()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Attribute()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Attribute()), + ]; + client.innerApiCalls.listAttributes = stubSimpleCall(expectedResponse); + const [response] = await client.listAttributes(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listAttributes as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listAttributes as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAttributes without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListAttributesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListAttributesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.Attribute()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Attribute()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Attribute()), + ]; + client.innerApiCalls.listAttributes = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listAttributes( + request, + (err?: Error|null, result?: protos.google.cloud.apihub.v1.IAttribute[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listAttributes as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listAttributes as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAttributes with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListAttributesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListAttributesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listAttributes = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listAttributes(request), expectedError); + const actualRequest = (client.innerApiCalls.listAttributes as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listAttributes as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAttributesStream without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListAttributesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListAttributesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.Attribute()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Attribute()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Attribute()), + ]; + client.descriptors.page.listAttributes.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listAttributesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.apihub.v1.Attribute[] = []; + stream.on('data', (response: protos.google.cloud.apihub.v1.Attribute) => { + 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.listAttributes.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listAttributes, request)); + assert( + (client.descriptors.page.listAttributes.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listAttributesStream with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListAttributesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListAttributesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listAttributes.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listAttributesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.apihub.v1.Attribute[] = []; + stream.on('data', (response: protos.google.cloud.apihub.v1.Attribute) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listAttributes.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listAttributes, request)); + assert( + (client.descriptors.page.listAttributes.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listAttributes without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListAttributesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListAttributesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.Attribute()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Attribute()), + generateSampleMessage(new protos.google.cloud.apihub.v1.Attribute()), + ]; + client.descriptors.page.listAttributes.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.apihub.v1.IAttribute[] = []; + const iterable = client.listAttributesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listAttributes.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listAttributes.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listAttributes with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListAttributesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListAttributesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listAttributes.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listAttributesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.apihub.v1.IAttribute[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listAttributes.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listAttributes.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('searchResources', () => { + it('invokes searchResources without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.SearchResourcesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.SearchResourcesRequest', ['location']); + request.location = defaultValue1; + const expectedHeaderRequestParams = `location=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.SearchResult()), + generateSampleMessage(new protos.google.cloud.apihub.v1.SearchResult()), + generateSampleMessage(new protos.google.cloud.apihub.v1.SearchResult()), + ]; + client.innerApiCalls.searchResources = stubSimpleCall(expectedResponse); + const [response] = await client.searchResources(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.searchResources as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.searchResources as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes searchResources without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.SearchResourcesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.SearchResourcesRequest', ['location']); + request.location = defaultValue1; + const expectedHeaderRequestParams = `location=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.SearchResult()), + generateSampleMessage(new protos.google.cloud.apihub.v1.SearchResult()), + generateSampleMessage(new protos.google.cloud.apihub.v1.SearchResult()), + ]; + client.innerApiCalls.searchResources = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.searchResources( + request, + (err?: Error|null, result?: protos.google.cloud.apihub.v1.ISearchResult[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.searchResources as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.searchResources as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes searchResources with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.SearchResourcesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.SearchResourcesRequest', ['location']); + request.location = defaultValue1; + const expectedHeaderRequestParams = `location=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.searchResources = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.searchResources(request), expectedError); + const actualRequest = (client.innerApiCalls.searchResources as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.searchResources as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes searchResourcesStream without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.SearchResourcesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.SearchResourcesRequest', ['location']); + request.location = defaultValue1; + const expectedHeaderRequestParams = `location=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.SearchResult()), + generateSampleMessage(new protos.google.cloud.apihub.v1.SearchResult()), + generateSampleMessage(new protos.google.cloud.apihub.v1.SearchResult()), + ]; + client.descriptors.page.searchResources.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.searchResourcesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.apihub.v1.SearchResult[] = []; + stream.on('data', (response: protos.google.cloud.apihub.v1.SearchResult) => { + 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.searchResources.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.searchResources, request)); + assert( + (client.descriptors.page.searchResources.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes searchResourcesStream with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.SearchResourcesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.SearchResourcesRequest', ['location']); + request.location = defaultValue1; + const expectedHeaderRequestParams = `location=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.searchResources.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.searchResourcesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.apihub.v1.SearchResult[] = []; + stream.on('data', (response: protos.google.cloud.apihub.v1.SearchResult) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.searchResources.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.searchResources, request)); + assert( + (client.descriptors.page.searchResources.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with searchResources without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.SearchResourcesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.SearchResourcesRequest', ['location']); + request.location = defaultValue1; + const expectedHeaderRequestParams = `location=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.SearchResult()), + generateSampleMessage(new protos.google.cloud.apihub.v1.SearchResult()), + generateSampleMessage(new protos.google.cloud.apihub.v1.SearchResult()), + ]; + client.descriptors.page.searchResources.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.apihub.v1.ISearchResult[] = []; + const iterable = client.searchResourcesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.searchResources.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.searchResources.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with searchResources with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.SearchResourcesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.SearchResourcesRequest', ['location']); + request.location = defaultValue1; + const expectedHeaderRequestParams = `location=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.searchResources.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.searchResourcesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.apihub.v1.ISearchResult[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.searchResources.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.searchResources.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listExternalApis', () => { + it('invokes listExternalApis without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListExternalApisRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListExternalApisRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.ExternalApi()), + generateSampleMessage(new protos.google.cloud.apihub.v1.ExternalApi()), + generateSampleMessage(new protos.google.cloud.apihub.v1.ExternalApi()), + ]; + client.innerApiCalls.listExternalApis = stubSimpleCall(expectedResponse); + const [response] = await client.listExternalApis(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listExternalApis as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listExternalApis as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listExternalApis without error using callback', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListExternalApisRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListExternalApisRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.ExternalApi()), + generateSampleMessage(new protos.google.cloud.apihub.v1.ExternalApi()), + generateSampleMessage(new protos.google.cloud.apihub.v1.ExternalApi()), + ]; + client.innerApiCalls.listExternalApis = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listExternalApis( + request, + (err?: Error|null, result?: protos.google.cloud.apihub.v1.IExternalApi[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listExternalApis as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listExternalApis as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listExternalApis with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListExternalApisRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListExternalApisRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listExternalApis = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listExternalApis(request), expectedError); + const actualRequest = (client.innerApiCalls.listExternalApis as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listExternalApis as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listExternalApisStream without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListExternalApisRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListExternalApisRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.ExternalApi()), + generateSampleMessage(new protos.google.cloud.apihub.v1.ExternalApi()), + generateSampleMessage(new protos.google.cloud.apihub.v1.ExternalApi()), + ]; + client.descriptors.page.listExternalApis.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listExternalApisStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.apihub.v1.ExternalApi[] = []; + stream.on('data', (response: protos.google.cloud.apihub.v1.ExternalApi) => { + 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.listExternalApis.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listExternalApis, request)); + assert( + (client.descriptors.page.listExternalApis.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listExternalApisStream with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListExternalApisRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListExternalApisRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listExternalApis.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listExternalApisStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.apihub.v1.ExternalApi[] = []; + stream.on('data', (response: protos.google.cloud.apihub.v1.ExternalApi) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listExternalApis.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listExternalApis, request)); + assert( + (client.descriptors.page.listExternalApis.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listExternalApis without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListExternalApisRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListExternalApisRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.ExternalApi()), + generateSampleMessage(new protos.google.cloud.apihub.v1.ExternalApi()), + generateSampleMessage(new protos.google.cloud.apihub.v1.ExternalApi()), + ]; + client.descriptors.page.listExternalApis.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.apihub.v1.IExternalApi[] = []; + const iterable = client.listExternalApisAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listExternalApis.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listExternalApis.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listExternalApis with error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListExternalApisRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListExternalApisRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listExternalApis.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listExternalApisAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.apihub.v1.IExternalApi[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listExternalApis.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listExternalApis.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new apihubModule.v1.ApiHubClient({ + auth: googleAuth, + 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 apihubModule.v1.ApiHubClient({ + auth: googleAuth, + 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 apihubModule.v1.ApiHubClient({ + auth: googleAuth, + 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 apihubModule.v1.ApiHubClient({ + auth: googleAuth, + 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 apihubModule.v1.ApiHubClient({ + 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('Path templates', () => { + + describe('api', () => { + const fakePath = "/rendered/path/api"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + api: "apiValue", + }; + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.apiPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.apiPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('apiPath', () => { + const result = client.apiPath("projectValue", "locationValue", "apiValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.apiPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromApiName', () => { + const result = client.matchProjectFromApiName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.apiPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromApiName', () => { + const result = client.matchLocationFromApiName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.apiPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchApiFromApiName', () => { + const result = client.matchApiFromApiName(fakePath); + assert.strictEqual(result, "apiValue"); + assert((client.pathTemplates.apiPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('apiHubInstance', () => { + const fakePath = "/rendered/path/apiHubInstance"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + api_hub_instance: "apiHubInstanceValue", + }; + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.apiHubInstancePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.apiHubInstancePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('apiHubInstancePath', () => { + const result = client.apiHubInstancePath("projectValue", "locationValue", "apiHubInstanceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.apiHubInstancePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromApiHubInstanceName', () => { + const result = client.matchProjectFromApiHubInstanceName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromApiHubInstanceName', () => { + const result = client.matchLocationFromApiHubInstanceName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchApiHubInstanceFromApiHubInstanceName', () => { + const result = client.matchApiHubInstanceFromApiHubInstanceName(fakePath); + assert.strictEqual(result, "apiHubInstanceValue"); + assert((client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('apiOperation', () => { + const fakePath = "/rendered/path/apiOperation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + api: "apiValue", + version: "versionValue", + operation: "operationValue", + }; + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.apiOperationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.apiOperationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('apiOperationPath', () => { + const result = client.apiOperationPath("projectValue", "locationValue", "apiValue", "versionValue", "operationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.apiOperationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromApiOperationName', () => { + const result = client.matchProjectFromApiOperationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromApiOperationName', () => { + const result = client.matchLocationFromApiOperationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchApiFromApiOperationName', () => { + const result = client.matchApiFromApiOperationName(fakePath); + assert.strictEqual(result, "apiValue"); + assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchVersionFromApiOperationName', () => { + const result = client.matchVersionFromApiOperationName(fakePath); + assert.strictEqual(result, "versionValue"); + assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchOperationFromApiOperationName', () => { + const result = client.matchOperationFromApiOperationName(fakePath); + assert.strictEqual(result, "operationValue"); + assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('attribute', () => { + const fakePath = "/rendered/path/attribute"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + attribute: "attributeValue", + }; + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.attributePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.attributePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('attributePath', () => { + const result = client.attributePath("projectValue", "locationValue", "attributeValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.attributePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAttributeName', () => { + const result = client.matchProjectFromAttributeName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.attributePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAttributeName', () => { + const result = client.matchLocationFromAttributeName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.attributePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAttributeFromAttributeName', () => { + const result = client.matchAttributeFromAttributeName(fakePath); + assert.strictEqual(result, "attributeValue"); + assert((client.pathTemplates.attributePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('definition', () => { + const fakePath = "/rendered/path/definition"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + api: "apiValue", + version: "versionValue", + definition: "definitionValue", + }; + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.definitionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.definitionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('definitionPath', () => { + const result = client.definitionPath("projectValue", "locationValue", "apiValue", "versionValue", "definitionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.definitionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDefinitionName', () => { + const result = client.matchProjectFromDefinitionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDefinitionName', () => { + const result = client.matchLocationFromDefinitionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchApiFromDefinitionName', () => { + const result = client.matchApiFromDefinitionName(fakePath); + assert.strictEqual(result, "apiValue"); + assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchVersionFromDefinitionName', () => { + const result = client.matchVersionFromDefinitionName(fakePath); + assert.strictEqual(result, "versionValue"); + assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDefinitionFromDefinitionName', () => { + const result = client.matchDefinitionFromDefinitionName(fakePath); + assert.strictEqual(result, "definitionValue"); + assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dependency', () => { + const fakePath = "/rendered/path/dependency"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dependency: "dependencyValue", + }; + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dependencyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.dependencyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('dependencyPath', () => { + const result = client.dependencyPath("projectValue", "locationValue", "dependencyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.dependencyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDependencyName', () => { + const result = client.matchProjectFromDependencyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.dependencyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDependencyName', () => { + const result = client.matchLocationFromDependencyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.dependencyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDependencyFromDependencyName', () => { + const result = client.matchDependencyFromDependencyName(fakePath); + assert.strictEqual(result, "dependencyValue"); + assert((client.pathTemplates.dependencyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('deployment', () => { + const fakePath = "/rendered/path/deployment"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + deployment: "deploymentValue", + }; + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.deploymentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.deploymentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('deploymentPath', () => { + const result = client.deploymentPath("projectValue", "locationValue", "deploymentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.deploymentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDeploymentName', () => { + const result = client.matchProjectFromDeploymentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDeploymentName', () => { + const result = client.matchLocationFromDeploymentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDeploymentFromDeploymentName', () => { + const result = client.matchDeploymentFromDeploymentName(fakePath); + assert.strictEqual(result, "deploymentValue"); + assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('externalApi', () => { + const fakePath = "/rendered/path/externalApi"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + external_api: "externalApiValue", + }; + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.externalApiPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.externalApiPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('externalApiPath', () => { + const result = client.externalApiPath("projectValue", "locationValue", "externalApiValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.externalApiPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromExternalApiName', () => { + const result = client.matchProjectFromExternalApiName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.externalApiPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromExternalApiName', () => { + const result = client.matchLocationFromExternalApiName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.externalApiPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExternalApiFromExternalApiName', () => { + const result = client.matchExternalApiFromExternalApiName(fakePath); + assert.strictEqual(result, "externalApiValue"); + assert((client.pathTemplates.externalApiPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('hostProjectRegistration', () => { + const fakePath = "/rendered/path/hostProjectRegistration"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + host_project_registration: "hostProjectRegistrationValue", + }; + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.hostProjectRegistrationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.hostProjectRegistrationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('hostProjectRegistrationPath', () => { + const result = client.hostProjectRegistrationPath("projectValue", "locationValue", "hostProjectRegistrationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.hostProjectRegistrationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromHostProjectRegistrationName', () => { + const result = client.matchProjectFromHostProjectRegistrationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.hostProjectRegistrationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromHostProjectRegistrationName', () => { + const result = client.matchLocationFromHostProjectRegistrationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.hostProjectRegistrationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchHostProjectRegistrationFromHostProjectRegistrationName', () => { + const result = client.matchHostProjectRegistrationFromHostProjectRegistrationName(fakePath); + assert.strictEqual(result, "hostProjectRegistrationValue"); + assert((client.pathTemplates.hostProjectRegistrationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('location', () => { + const fakePath = "/rendered/path/location"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + }; + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.locationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.locationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath("projectValue", "locationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('plugin', () => { + const fakePath = "/rendered/path/plugin"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + plugin: "pluginValue", + }; + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.pluginPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.pluginPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('pluginPath', () => { + const result = client.pluginPath("projectValue", "locationValue", "pluginValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.pluginPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromPluginName', () => { + const result = client.matchProjectFromPluginName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.pluginPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromPluginName', () => { + const result = client.matchLocationFromPluginName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.pluginPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPluginFromPluginName', () => { + const result = client.matchPluginFromPluginName(fakePath); + assert.strictEqual(result, "pluginValue"); + assert((client.pathTemplates.pluginPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('project', () => { + const fakePath = "/rendered/path/project"; + const expectedParameters = { + project: "projectValue", + }; + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath("projectValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('runtimeProjectAttachment', () => { + const fakePath = "/rendered/path/runtimeProjectAttachment"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + runtime_project_attachment: "runtimeProjectAttachmentValue", + }; + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.runtimeProjectAttachmentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.runtimeProjectAttachmentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('runtimeProjectAttachmentPath', () => { + const result = client.runtimeProjectAttachmentPath("projectValue", "locationValue", "runtimeProjectAttachmentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromRuntimeProjectAttachmentName', () => { + const result = client.matchProjectFromRuntimeProjectAttachmentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromRuntimeProjectAttachmentName', () => { + const result = client.matchLocationFromRuntimeProjectAttachmentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName', () => { + const result = client.matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName(fakePath); + assert.strictEqual(result, "runtimeProjectAttachmentValue"); + assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('spec', () => { + const fakePath = "/rendered/path/spec"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + api: "apiValue", + version: "versionValue", + spec: "specValue", + }; + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.specPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.specPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('specPath', () => { + const result = client.specPath("projectValue", "locationValue", "apiValue", "versionValue", "specValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.specPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSpecName', () => { + const result = client.matchProjectFromSpecName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSpecName', () => { + const result = client.matchLocationFromSpecName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchApiFromSpecName', () => { + const result = client.matchApiFromSpecName(fakePath); + assert.strictEqual(result, "apiValue"); + assert((client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchVersionFromSpecName', () => { + const result = client.matchVersionFromSpecName(fakePath); + assert.strictEqual(result, "versionValue"); + assert((client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSpecFromSpecName', () => { + const result = client.matchSpecFromSpecName(fakePath); + assert.strictEqual(result, "specValue"); + assert((client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('styleGuide', () => { + const fakePath = "/rendered/path/styleGuide"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + plugin: "pluginValue", + }; + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.styleGuidePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.styleGuidePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('styleGuidePath', () => { + const result = client.styleGuidePath("projectValue", "locationValue", "pluginValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.styleGuidePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromStyleGuideName', () => { + const result = client.matchProjectFromStyleGuideName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.styleGuidePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromStyleGuideName', () => { + const result = client.matchLocationFromStyleGuideName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.styleGuidePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPluginFromStyleGuideName', () => { + const result = client.matchPluginFromStyleGuideName(fakePath); + assert.strictEqual(result, "pluginValue"); + assert((client.pathTemplates.styleGuidePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('version', () => { + const fakePath = "/rendered/path/version"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + api: "apiValue", + version: "versionValue", + }; + const client = new apihubModule.v1.ApiHubClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.versionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.versionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('versionPath', () => { + const result = client.versionPath("projectValue", "locationValue", "apiValue", "versionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.versionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromVersionName', () => { + const result = client.matchProjectFromVersionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromVersionName', () => { + const result = client.matchLocationFromVersionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchApiFromVersionName', () => { + const result = client.matchApiFromVersionName(fakePath); + assert.strictEqual(result, "apiValue"); + assert((client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchVersionFromVersionName', () => { + const result = client.matchVersionFromVersionName(fakePath); + assert.strictEqual(result, "versionValue"); + assert((client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-apihub/v1/test/gapic_host_project_registration_service_v1.ts b/owl-bot-staging/google-cloud-apihub/v1/test/gapic_host_project_registration_service_v1.ts new file mode 100644 index 00000000000..cd39a1696b7 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/test/gapic_host_project_registration_service_v1.ts @@ -0,0 +1,1670 @@ +// Copyright 2024 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, beforeEach, afterEach} from 'mocha'; +import * as hostprojectregistrationserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {GoogleAuth, protobuf, 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 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.HostProjectRegistrationServiceClient', () => { + let googleAuth: GoogleAuth; + beforeEach(() => { + googleAuth = { + getClient: sinon.stub().resolves({ + getRequestHeaders: sinon.stub().resolves({Authorization: 'Bearer SOME_TOKEN'}), + }) + } as unknown as GoogleAuth; + }); + afterEach(() => { + sinon.restore(); + }); + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'apihub.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, "googleapis.com"); + }); + + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient.servicePath; + assert.strictEqual(servicePath, 'apihub.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'apihub.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'apihub.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'apihub.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'apihub.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'apihub.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ + auth: googleAuth, + projectId: 'bogus', + }); + assert.strictEqual(client.hostProjectRegistrationServiceStub, undefined); + await client.initialize(); + assert(client.hostProjectRegistrationServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + assert(client.hostProjectRegistrationServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ + auth: googleAuth, + projectId: 'bogus', + }); + assert.strictEqual(client.hostProjectRegistrationServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ + auth: googleAuth, + 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 hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ + auth: googleAuth, + 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('createHostProjectRegistration', () => { + it('invokes createHostProjectRegistration without error', async () => { + const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateHostProjectRegistrationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.CreateHostProjectRegistrationRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.HostProjectRegistration() + ); + client.innerApiCalls.createHostProjectRegistration = stubSimpleCall(expectedResponse); + const [response] = await client.createHostProjectRegistration(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createHostProjectRegistration as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createHostProjectRegistration as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createHostProjectRegistration without error using callback', async () => { + const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateHostProjectRegistrationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.CreateHostProjectRegistrationRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.HostProjectRegistration() + ); + client.innerApiCalls.createHostProjectRegistration = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createHostProjectRegistration( + request, + (err?: Error|null, result?: protos.google.cloud.apihub.v1.IHostProjectRegistration|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createHostProjectRegistration as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createHostProjectRegistration as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createHostProjectRegistration with error', async () => { + const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateHostProjectRegistrationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.CreateHostProjectRegistrationRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createHostProjectRegistration = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createHostProjectRegistration(request), expectedError); + const actualRequest = (client.innerApiCalls.createHostProjectRegistration as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createHostProjectRegistration as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createHostProjectRegistration with closed client', async () => { + const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateHostProjectRegistrationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.CreateHostProjectRegistrationRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createHostProjectRegistration(request), expectedError); + }); + }); + + describe('getHostProjectRegistration', () => { + it('invokes getHostProjectRegistration without error', async () => { + const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetHostProjectRegistrationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetHostProjectRegistrationRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.HostProjectRegistration() + ); + client.innerApiCalls.getHostProjectRegistration = stubSimpleCall(expectedResponse); + const [response] = await client.getHostProjectRegistration(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getHostProjectRegistration as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getHostProjectRegistration as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getHostProjectRegistration without error using callback', async () => { + const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetHostProjectRegistrationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetHostProjectRegistrationRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.HostProjectRegistration() + ); + client.innerApiCalls.getHostProjectRegistration = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getHostProjectRegistration( + request, + (err?: Error|null, result?: protos.google.cloud.apihub.v1.IHostProjectRegistration|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getHostProjectRegistration as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getHostProjectRegistration as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getHostProjectRegistration with error', async () => { + const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetHostProjectRegistrationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetHostProjectRegistrationRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getHostProjectRegistration = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getHostProjectRegistration(request), expectedError); + const actualRequest = (client.innerApiCalls.getHostProjectRegistration as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getHostProjectRegistration as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getHostProjectRegistration with closed client', async () => { + const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetHostProjectRegistrationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetHostProjectRegistrationRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getHostProjectRegistration(request), expectedError); + }); + }); + + describe('listHostProjectRegistrations', () => { + it('invokes listHostProjectRegistrations without error', async () => { + const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.HostProjectRegistration()), + generateSampleMessage(new protos.google.cloud.apihub.v1.HostProjectRegistration()), + generateSampleMessage(new protos.google.cloud.apihub.v1.HostProjectRegistration()), + ]; + client.innerApiCalls.listHostProjectRegistrations = stubSimpleCall(expectedResponse); + const [response] = await client.listHostProjectRegistrations(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listHostProjectRegistrations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listHostProjectRegistrations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listHostProjectRegistrations without error using callback', async () => { + const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.HostProjectRegistration()), + generateSampleMessage(new protos.google.cloud.apihub.v1.HostProjectRegistration()), + generateSampleMessage(new protos.google.cloud.apihub.v1.HostProjectRegistration()), + ]; + client.innerApiCalls.listHostProjectRegistrations = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listHostProjectRegistrations( + request, + (err?: Error|null, result?: protos.google.cloud.apihub.v1.IHostProjectRegistration[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listHostProjectRegistrations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listHostProjectRegistrations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listHostProjectRegistrations with error', async () => { + const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listHostProjectRegistrations = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listHostProjectRegistrations(request), expectedError); + const actualRequest = (client.innerApiCalls.listHostProjectRegistrations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listHostProjectRegistrations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listHostProjectRegistrationsStream without error', async () => { + const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.HostProjectRegistration()), + generateSampleMessage(new protos.google.cloud.apihub.v1.HostProjectRegistration()), + generateSampleMessage(new protos.google.cloud.apihub.v1.HostProjectRegistration()), + ]; + client.descriptors.page.listHostProjectRegistrations.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listHostProjectRegistrationsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.apihub.v1.HostProjectRegistration[] = []; + stream.on('data', (response: protos.google.cloud.apihub.v1.HostProjectRegistration) => { + 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.listHostProjectRegistrations.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listHostProjectRegistrations, request)); + assert( + (client.descriptors.page.listHostProjectRegistrations.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listHostProjectRegistrationsStream with error', async () => { + const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listHostProjectRegistrations.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listHostProjectRegistrationsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.apihub.v1.HostProjectRegistration[] = []; + stream.on('data', (response: protos.google.cloud.apihub.v1.HostProjectRegistration) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listHostProjectRegistrations.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listHostProjectRegistrations, request)); + assert( + (client.descriptors.page.listHostProjectRegistrations.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listHostProjectRegistrations without error', async () => { + const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.HostProjectRegistration()), + generateSampleMessage(new protos.google.cloud.apihub.v1.HostProjectRegistration()), + generateSampleMessage(new protos.google.cloud.apihub.v1.HostProjectRegistration()), + ]; + client.descriptors.page.listHostProjectRegistrations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.apihub.v1.IHostProjectRegistration[] = []; + const iterable = client.listHostProjectRegistrationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listHostProjectRegistrations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listHostProjectRegistrations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listHostProjectRegistrations with error', async () => { + const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listHostProjectRegistrations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listHostProjectRegistrationsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.apihub.v1.IHostProjectRegistration[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listHostProjectRegistrations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listHostProjectRegistrations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ + auth: googleAuth, + 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 hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ + auth: googleAuth, + 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 hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ + auth: googleAuth, + 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 hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ + auth: googleAuth, + 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 hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ + 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('Path templates', () => { + + describe('api', () => { + const fakePath = "/rendered/path/api"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + api: "apiValue", + }; + const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.apiPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.apiPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('apiPath', () => { + const result = client.apiPath("projectValue", "locationValue", "apiValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.apiPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromApiName', () => { + const result = client.matchProjectFromApiName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.apiPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromApiName', () => { + const result = client.matchLocationFromApiName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.apiPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchApiFromApiName', () => { + const result = client.matchApiFromApiName(fakePath); + assert.strictEqual(result, "apiValue"); + assert((client.pathTemplates.apiPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('apiHubInstance', () => { + const fakePath = "/rendered/path/apiHubInstance"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + api_hub_instance: "apiHubInstanceValue", + }; + const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.apiHubInstancePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.apiHubInstancePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('apiHubInstancePath', () => { + const result = client.apiHubInstancePath("projectValue", "locationValue", "apiHubInstanceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.apiHubInstancePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromApiHubInstanceName', () => { + const result = client.matchProjectFromApiHubInstanceName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromApiHubInstanceName', () => { + const result = client.matchLocationFromApiHubInstanceName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchApiHubInstanceFromApiHubInstanceName', () => { + const result = client.matchApiHubInstanceFromApiHubInstanceName(fakePath); + assert.strictEqual(result, "apiHubInstanceValue"); + assert((client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('apiOperation', () => { + const fakePath = "/rendered/path/apiOperation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + api: "apiValue", + version: "versionValue", + operation: "operationValue", + }; + const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.apiOperationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.apiOperationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('apiOperationPath', () => { + const result = client.apiOperationPath("projectValue", "locationValue", "apiValue", "versionValue", "operationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.apiOperationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromApiOperationName', () => { + const result = client.matchProjectFromApiOperationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromApiOperationName', () => { + const result = client.matchLocationFromApiOperationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchApiFromApiOperationName', () => { + const result = client.matchApiFromApiOperationName(fakePath); + assert.strictEqual(result, "apiValue"); + assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchVersionFromApiOperationName', () => { + const result = client.matchVersionFromApiOperationName(fakePath); + assert.strictEqual(result, "versionValue"); + assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchOperationFromApiOperationName', () => { + const result = client.matchOperationFromApiOperationName(fakePath); + assert.strictEqual(result, "operationValue"); + assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('attribute', () => { + const fakePath = "/rendered/path/attribute"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + attribute: "attributeValue", + }; + const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.attributePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.attributePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('attributePath', () => { + const result = client.attributePath("projectValue", "locationValue", "attributeValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.attributePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAttributeName', () => { + const result = client.matchProjectFromAttributeName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.attributePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAttributeName', () => { + const result = client.matchLocationFromAttributeName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.attributePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAttributeFromAttributeName', () => { + const result = client.matchAttributeFromAttributeName(fakePath); + assert.strictEqual(result, "attributeValue"); + assert((client.pathTemplates.attributePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('definition', () => { + const fakePath = "/rendered/path/definition"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + api: "apiValue", + version: "versionValue", + definition: "definitionValue", + }; + const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.definitionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.definitionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('definitionPath', () => { + const result = client.definitionPath("projectValue", "locationValue", "apiValue", "versionValue", "definitionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.definitionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDefinitionName', () => { + const result = client.matchProjectFromDefinitionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDefinitionName', () => { + const result = client.matchLocationFromDefinitionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchApiFromDefinitionName', () => { + const result = client.matchApiFromDefinitionName(fakePath); + assert.strictEqual(result, "apiValue"); + assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchVersionFromDefinitionName', () => { + const result = client.matchVersionFromDefinitionName(fakePath); + assert.strictEqual(result, "versionValue"); + assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDefinitionFromDefinitionName', () => { + const result = client.matchDefinitionFromDefinitionName(fakePath); + assert.strictEqual(result, "definitionValue"); + assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dependency', () => { + const fakePath = "/rendered/path/dependency"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dependency: "dependencyValue", + }; + const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dependencyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.dependencyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('dependencyPath', () => { + const result = client.dependencyPath("projectValue", "locationValue", "dependencyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.dependencyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDependencyName', () => { + const result = client.matchProjectFromDependencyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.dependencyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDependencyName', () => { + const result = client.matchLocationFromDependencyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.dependencyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDependencyFromDependencyName', () => { + const result = client.matchDependencyFromDependencyName(fakePath); + assert.strictEqual(result, "dependencyValue"); + assert((client.pathTemplates.dependencyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('deployment', () => { + const fakePath = "/rendered/path/deployment"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + deployment: "deploymentValue", + }; + const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.deploymentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.deploymentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('deploymentPath', () => { + const result = client.deploymentPath("projectValue", "locationValue", "deploymentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.deploymentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDeploymentName', () => { + const result = client.matchProjectFromDeploymentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDeploymentName', () => { + const result = client.matchLocationFromDeploymentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDeploymentFromDeploymentName', () => { + const result = client.matchDeploymentFromDeploymentName(fakePath); + assert.strictEqual(result, "deploymentValue"); + assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('externalApi', () => { + const fakePath = "/rendered/path/externalApi"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + external_api: "externalApiValue", + }; + const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.externalApiPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.externalApiPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('externalApiPath', () => { + const result = client.externalApiPath("projectValue", "locationValue", "externalApiValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.externalApiPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromExternalApiName', () => { + const result = client.matchProjectFromExternalApiName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.externalApiPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromExternalApiName', () => { + const result = client.matchLocationFromExternalApiName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.externalApiPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExternalApiFromExternalApiName', () => { + const result = client.matchExternalApiFromExternalApiName(fakePath); + assert.strictEqual(result, "externalApiValue"); + assert((client.pathTemplates.externalApiPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('hostProjectRegistration', () => { + const fakePath = "/rendered/path/hostProjectRegistration"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + host_project_registration: "hostProjectRegistrationValue", + }; + const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.hostProjectRegistrationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.hostProjectRegistrationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('hostProjectRegistrationPath', () => { + const result = client.hostProjectRegistrationPath("projectValue", "locationValue", "hostProjectRegistrationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.hostProjectRegistrationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromHostProjectRegistrationName', () => { + const result = client.matchProjectFromHostProjectRegistrationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.hostProjectRegistrationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromHostProjectRegistrationName', () => { + const result = client.matchLocationFromHostProjectRegistrationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.hostProjectRegistrationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchHostProjectRegistrationFromHostProjectRegistrationName', () => { + const result = client.matchHostProjectRegistrationFromHostProjectRegistrationName(fakePath); + assert.strictEqual(result, "hostProjectRegistrationValue"); + assert((client.pathTemplates.hostProjectRegistrationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('location', () => { + const fakePath = "/rendered/path/location"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + }; + const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.locationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.locationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath("projectValue", "locationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('plugin', () => { + const fakePath = "/rendered/path/plugin"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + plugin: "pluginValue", + }; + const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.pluginPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.pluginPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('pluginPath', () => { + const result = client.pluginPath("projectValue", "locationValue", "pluginValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.pluginPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromPluginName', () => { + const result = client.matchProjectFromPluginName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.pluginPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromPluginName', () => { + const result = client.matchLocationFromPluginName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.pluginPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPluginFromPluginName', () => { + const result = client.matchPluginFromPluginName(fakePath); + assert.strictEqual(result, "pluginValue"); + assert((client.pathTemplates.pluginPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('project', () => { + const fakePath = "/rendered/path/project"; + const expectedParameters = { + project: "projectValue", + }; + const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath("projectValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('runtimeProjectAttachment', () => { + const fakePath = "/rendered/path/runtimeProjectAttachment"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + runtime_project_attachment: "runtimeProjectAttachmentValue", + }; + const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.runtimeProjectAttachmentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.runtimeProjectAttachmentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('runtimeProjectAttachmentPath', () => { + const result = client.runtimeProjectAttachmentPath("projectValue", "locationValue", "runtimeProjectAttachmentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromRuntimeProjectAttachmentName', () => { + const result = client.matchProjectFromRuntimeProjectAttachmentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromRuntimeProjectAttachmentName', () => { + const result = client.matchLocationFromRuntimeProjectAttachmentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName', () => { + const result = client.matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName(fakePath); + assert.strictEqual(result, "runtimeProjectAttachmentValue"); + assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('spec', () => { + const fakePath = "/rendered/path/spec"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + api: "apiValue", + version: "versionValue", + spec: "specValue", + }; + const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.specPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.specPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('specPath', () => { + const result = client.specPath("projectValue", "locationValue", "apiValue", "versionValue", "specValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.specPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSpecName', () => { + const result = client.matchProjectFromSpecName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSpecName', () => { + const result = client.matchLocationFromSpecName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchApiFromSpecName', () => { + const result = client.matchApiFromSpecName(fakePath); + assert.strictEqual(result, "apiValue"); + assert((client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchVersionFromSpecName', () => { + const result = client.matchVersionFromSpecName(fakePath); + assert.strictEqual(result, "versionValue"); + assert((client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSpecFromSpecName', () => { + const result = client.matchSpecFromSpecName(fakePath); + assert.strictEqual(result, "specValue"); + assert((client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('styleGuide', () => { + const fakePath = "/rendered/path/styleGuide"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + plugin: "pluginValue", + }; + const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.styleGuidePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.styleGuidePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('styleGuidePath', () => { + const result = client.styleGuidePath("projectValue", "locationValue", "pluginValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.styleGuidePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromStyleGuideName', () => { + const result = client.matchProjectFromStyleGuideName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.styleGuidePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromStyleGuideName', () => { + const result = client.matchLocationFromStyleGuideName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.styleGuidePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPluginFromStyleGuideName', () => { + const result = client.matchPluginFromStyleGuideName(fakePath); + assert.strictEqual(result, "pluginValue"); + assert((client.pathTemplates.styleGuidePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('version', () => { + const fakePath = "/rendered/path/version"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + api: "apiValue", + version: "versionValue", + }; + const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.versionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.versionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('versionPath', () => { + const result = client.versionPath("projectValue", "locationValue", "apiValue", "versionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.versionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromVersionName', () => { + const result = client.matchProjectFromVersionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromVersionName', () => { + const result = client.matchLocationFromVersionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchApiFromVersionName', () => { + const result = client.matchApiFromVersionName(fakePath); + assert.strictEqual(result, "apiValue"); + assert((client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchVersionFromVersionName', () => { + const result = client.matchVersionFromVersionName(fakePath); + assert.strictEqual(result, "versionValue"); + assert((client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-apihub/v1/test/gapic_linting_service_v1.ts b/owl-bot-staging/google-cloud-apihub/v1/test/gapic_linting_service_v1.ts new file mode 100644 index 00000000000..6c5ed0b34ac --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/test/gapic_linting_service_v1.ts @@ -0,0 +1,1550 @@ +// Copyright 2024 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, beforeEach, afterEach} from 'mocha'; +import * as lintingserviceModule from '../src'; + +import {GoogleAuth, protobuf, 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 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.LintingServiceClient', () => { + let googleAuth: GoogleAuth; + beforeEach(() => { + googleAuth = { + getClient: sinon.stub().resolves({ + getRequestHeaders: sinon.stub().resolves({Authorization: 'Bearer SOME_TOKEN'}), + }) + } as unknown as GoogleAuth; + }); + afterEach(() => { + sinon.restore(); + }); + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new lintingserviceModule.v1.LintingServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'apihub.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new lintingserviceModule.v1.LintingServiceClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, "googleapis.com"); + }); + + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = lintingserviceModule.v1.LintingServiceClient.servicePath; + assert.strictEqual(servicePath, 'apihub.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = lintingserviceModule.v1.LintingServiceClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'apihub.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new lintingserviceModule.v1.LintingServiceClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'apihub.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new lintingserviceModule.v1.LintingServiceClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'apihub.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new lintingserviceModule.v1.LintingServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'apihub.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new lintingserviceModule.v1.LintingServiceClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'apihub.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { new lintingserviceModule.v1.LintingServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = lintingserviceModule.v1.LintingServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new lintingserviceModule.v1.LintingServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new lintingserviceModule.v1.LintingServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new lintingserviceModule.v1.LintingServiceClient({ + auth: googleAuth, + projectId: 'bogus', + }); + assert.strictEqual(client.lintingServiceStub, undefined); + await client.initialize(); + assert(client.lintingServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new lintingserviceModule.v1.LintingServiceClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + assert(client.lintingServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new lintingserviceModule.v1.LintingServiceClient({ + auth: googleAuth, + projectId: 'bogus', + }); + assert.strictEqual(client.lintingServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new lintingserviceModule.v1.LintingServiceClient({ + auth: googleAuth, + 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 lintingserviceModule.v1.LintingServiceClient({ + auth: googleAuth, + 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('getStyleGuide', () => { + it('invokes getStyleGuide without error', async () => { + const client = new lintingserviceModule.v1.LintingServiceClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetStyleGuideRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetStyleGuideRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.StyleGuide() + ); + client.innerApiCalls.getStyleGuide = stubSimpleCall(expectedResponse); + const [response] = await client.getStyleGuide(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getStyleGuide as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getStyleGuide as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getStyleGuide without error using callback', async () => { + const client = new lintingserviceModule.v1.LintingServiceClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetStyleGuideRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetStyleGuideRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.StyleGuide() + ); + client.innerApiCalls.getStyleGuide = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getStyleGuide( + request, + (err?: Error|null, result?: protos.google.cloud.apihub.v1.IStyleGuide|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getStyleGuide as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getStyleGuide as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getStyleGuide with error', async () => { + const client = new lintingserviceModule.v1.LintingServiceClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetStyleGuideRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetStyleGuideRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getStyleGuide = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getStyleGuide(request), expectedError); + const actualRequest = (client.innerApiCalls.getStyleGuide as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getStyleGuide as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getStyleGuide with closed client', async () => { + const client = new lintingserviceModule.v1.LintingServiceClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetStyleGuideRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetStyleGuideRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getStyleGuide(request), expectedError); + }); + }); + + describe('updateStyleGuide', () => { + it('invokes updateStyleGuide without error', async () => { + const client = new lintingserviceModule.v1.LintingServiceClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.UpdateStyleGuideRequest() + ); + request.styleGuide ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.UpdateStyleGuideRequest', ['styleGuide', 'name']); + request.styleGuide.name = defaultValue1; + const expectedHeaderRequestParams = `style_guide.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.StyleGuide() + ); + client.innerApiCalls.updateStyleGuide = stubSimpleCall(expectedResponse); + const [response] = await client.updateStyleGuide(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateStyleGuide as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateStyleGuide as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateStyleGuide without error using callback', async () => { + const client = new lintingserviceModule.v1.LintingServiceClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.UpdateStyleGuideRequest() + ); + request.styleGuide ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.UpdateStyleGuideRequest', ['styleGuide', 'name']); + request.styleGuide.name = defaultValue1; + const expectedHeaderRequestParams = `style_guide.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.StyleGuide() + ); + client.innerApiCalls.updateStyleGuide = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateStyleGuide( + request, + (err?: Error|null, result?: protos.google.cloud.apihub.v1.IStyleGuide|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateStyleGuide as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateStyleGuide as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateStyleGuide with error', async () => { + const client = new lintingserviceModule.v1.LintingServiceClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.UpdateStyleGuideRequest() + ); + request.styleGuide ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.UpdateStyleGuideRequest', ['styleGuide', 'name']); + request.styleGuide.name = defaultValue1; + const expectedHeaderRequestParams = `style_guide.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateStyleGuide = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateStyleGuide(request), expectedError); + const actualRequest = (client.innerApiCalls.updateStyleGuide as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateStyleGuide as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateStyleGuide with closed client', async () => { + const client = new lintingserviceModule.v1.LintingServiceClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.UpdateStyleGuideRequest() + ); + request.styleGuide ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.UpdateStyleGuideRequest', ['styleGuide', 'name']); + request.styleGuide.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateStyleGuide(request), expectedError); + }); + }); + + describe('getStyleGuideContents', () => { + it('invokes getStyleGuideContents without error', async () => { + const client = new lintingserviceModule.v1.LintingServiceClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetStyleGuideContentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetStyleGuideContentsRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.StyleGuideContents() + ); + client.innerApiCalls.getStyleGuideContents = stubSimpleCall(expectedResponse); + const [response] = await client.getStyleGuideContents(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getStyleGuideContents as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getStyleGuideContents as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getStyleGuideContents without error using callback', async () => { + const client = new lintingserviceModule.v1.LintingServiceClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetStyleGuideContentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetStyleGuideContentsRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.StyleGuideContents() + ); + client.innerApiCalls.getStyleGuideContents = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getStyleGuideContents( + request, + (err?: Error|null, result?: protos.google.cloud.apihub.v1.IStyleGuideContents|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getStyleGuideContents as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getStyleGuideContents as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getStyleGuideContents with error', async () => { + const client = new lintingserviceModule.v1.LintingServiceClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetStyleGuideContentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetStyleGuideContentsRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getStyleGuideContents = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getStyleGuideContents(request), expectedError); + const actualRequest = (client.innerApiCalls.getStyleGuideContents as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getStyleGuideContents as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getStyleGuideContents with closed client', async () => { + const client = new lintingserviceModule.v1.LintingServiceClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetStyleGuideContentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetStyleGuideContentsRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getStyleGuideContents(request), expectedError); + }); + }); + + describe('lintSpec', () => { + it('invokes lintSpec without error', async () => { + const client = new lintingserviceModule.v1.LintingServiceClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.LintSpecRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.LintSpecRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.lintSpec = stubSimpleCall(expectedResponse); + const [response] = await client.lintSpec(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.lintSpec as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.lintSpec as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes lintSpec without error using callback', async () => { + const client = new lintingserviceModule.v1.LintingServiceClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.LintSpecRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.LintSpecRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.lintSpec = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.lintSpec( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.lintSpec as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.lintSpec as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes lintSpec with error', async () => { + const client = new lintingserviceModule.v1.LintingServiceClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.LintSpecRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.LintSpecRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.lintSpec = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.lintSpec(request), expectedError); + const actualRequest = (client.innerApiCalls.lintSpec as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.lintSpec as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes lintSpec with closed client', async () => { + const client = new lintingserviceModule.v1.LintingServiceClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.LintSpecRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.LintSpecRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.lintSpec(request), expectedError); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new lintingserviceModule.v1.LintingServiceClient({ + auth: googleAuth, + 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 lintingserviceModule.v1.LintingServiceClient({ + auth: googleAuth, + 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 lintingserviceModule.v1.LintingServiceClient({ + auth: googleAuth, + 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 lintingserviceModule.v1.LintingServiceClient({ + auth: googleAuth, + 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 lintingserviceModule.v1.LintingServiceClient({ + 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('Path templates', () => { + + describe('api', () => { + const fakePath = "/rendered/path/api"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + api: "apiValue", + }; + const client = new lintingserviceModule.v1.LintingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.apiPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.apiPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('apiPath', () => { + const result = client.apiPath("projectValue", "locationValue", "apiValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.apiPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromApiName', () => { + const result = client.matchProjectFromApiName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.apiPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromApiName', () => { + const result = client.matchLocationFromApiName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.apiPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchApiFromApiName', () => { + const result = client.matchApiFromApiName(fakePath); + assert.strictEqual(result, "apiValue"); + assert((client.pathTemplates.apiPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('apiHubInstance', () => { + const fakePath = "/rendered/path/apiHubInstance"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + api_hub_instance: "apiHubInstanceValue", + }; + const client = new lintingserviceModule.v1.LintingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.apiHubInstancePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.apiHubInstancePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('apiHubInstancePath', () => { + const result = client.apiHubInstancePath("projectValue", "locationValue", "apiHubInstanceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.apiHubInstancePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromApiHubInstanceName', () => { + const result = client.matchProjectFromApiHubInstanceName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromApiHubInstanceName', () => { + const result = client.matchLocationFromApiHubInstanceName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchApiHubInstanceFromApiHubInstanceName', () => { + const result = client.matchApiHubInstanceFromApiHubInstanceName(fakePath); + assert.strictEqual(result, "apiHubInstanceValue"); + assert((client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('apiOperation', () => { + const fakePath = "/rendered/path/apiOperation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + api: "apiValue", + version: "versionValue", + operation: "operationValue", + }; + const client = new lintingserviceModule.v1.LintingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.apiOperationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.apiOperationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('apiOperationPath', () => { + const result = client.apiOperationPath("projectValue", "locationValue", "apiValue", "versionValue", "operationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.apiOperationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromApiOperationName', () => { + const result = client.matchProjectFromApiOperationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromApiOperationName', () => { + const result = client.matchLocationFromApiOperationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchApiFromApiOperationName', () => { + const result = client.matchApiFromApiOperationName(fakePath); + assert.strictEqual(result, "apiValue"); + assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchVersionFromApiOperationName', () => { + const result = client.matchVersionFromApiOperationName(fakePath); + assert.strictEqual(result, "versionValue"); + assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchOperationFromApiOperationName', () => { + const result = client.matchOperationFromApiOperationName(fakePath); + assert.strictEqual(result, "operationValue"); + assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('attribute', () => { + const fakePath = "/rendered/path/attribute"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + attribute: "attributeValue", + }; + const client = new lintingserviceModule.v1.LintingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.attributePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.attributePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('attributePath', () => { + const result = client.attributePath("projectValue", "locationValue", "attributeValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.attributePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAttributeName', () => { + const result = client.matchProjectFromAttributeName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.attributePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAttributeName', () => { + const result = client.matchLocationFromAttributeName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.attributePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAttributeFromAttributeName', () => { + const result = client.matchAttributeFromAttributeName(fakePath); + assert.strictEqual(result, "attributeValue"); + assert((client.pathTemplates.attributePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('definition', () => { + const fakePath = "/rendered/path/definition"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + api: "apiValue", + version: "versionValue", + definition: "definitionValue", + }; + const client = new lintingserviceModule.v1.LintingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.definitionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.definitionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('definitionPath', () => { + const result = client.definitionPath("projectValue", "locationValue", "apiValue", "versionValue", "definitionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.definitionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDefinitionName', () => { + const result = client.matchProjectFromDefinitionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDefinitionName', () => { + const result = client.matchLocationFromDefinitionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchApiFromDefinitionName', () => { + const result = client.matchApiFromDefinitionName(fakePath); + assert.strictEqual(result, "apiValue"); + assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchVersionFromDefinitionName', () => { + const result = client.matchVersionFromDefinitionName(fakePath); + assert.strictEqual(result, "versionValue"); + assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDefinitionFromDefinitionName', () => { + const result = client.matchDefinitionFromDefinitionName(fakePath); + assert.strictEqual(result, "definitionValue"); + assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dependency', () => { + const fakePath = "/rendered/path/dependency"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dependency: "dependencyValue", + }; + const client = new lintingserviceModule.v1.LintingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dependencyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.dependencyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('dependencyPath', () => { + const result = client.dependencyPath("projectValue", "locationValue", "dependencyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.dependencyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDependencyName', () => { + const result = client.matchProjectFromDependencyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.dependencyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDependencyName', () => { + const result = client.matchLocationFromDependencyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.dependencyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDependencyFromDependencyName', () => { + const result = client.matchDependencyFromDependencyName(fakePath); + assert.strictEqual(result, "dependencyValue"); + assert((client.pathTemplates.dependencyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('deployment', () => { + const fakePath = "/rendered/path/deployment"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + deployment: "deploymentValue", + }; + const client = new lintingserviceModule.v1.LintingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.deploymentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.deploymentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('deploymentPath', () => { + const result = client.deploymentPath("projectValue", "locationValue", "deploymentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.deploymentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDeploymentName', () => { + const result = client.matchProjectFromDeploymentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDeploymentName', () => { + const result = client.matchLocationFromDeploymentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDeploymentFromDeploymentName', () => { + const result = client.matchDeploymentFromDeploymentName(fakePath); + assert.strictEqual(result, "deploymentValue"); + assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('externalApi', () => { + const fakePath = "/rendered/path/externalApi"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + external_api: "externalApiValue", + }; + const client = new lintingserviceModule.v1.LintingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.externalApiPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.externalApiPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('externalApiPath', () => { + const result = client.externalApiPath("projectValue", "locationValue", "externalApiValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.externalApiPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromExternalApiName', () => { + const result = client.matchProjectFromExternalApiName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.externalApiPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromExternalApiName', () => { + const result = client.matchLocationFromExternalApiName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.externalApiPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExternalApiFromExternalApiName', () => { + const result = client.matchExternalApiFromExternalApiName(fakePath); + assert.strictEqual(result, "externalApiValue"); + assert((client.pathTemplates.externalApiPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('hostProjectRegistration', () => { + const fakePath = "/rendered/path/hostProjectRegistration"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + host_project_registration: "hostProjectRegistrationValue", + }; + const client = new lintingserviceModule.v1.LintingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.hostProjectRegistrationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.hostProjectRegistrationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('hostProjectRegistrationPath', () => { + const result = client.hostProjectRegistrationPath("projectValue", "locationValue", "hostProjectRegistrationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.hostProjectRegistrationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromHostProjectRegistrationName', () => { + const result = client.matchProjectFromHostProjectRegistrationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.hostProjectRegistrationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromHostProjectRegistrationName', () => { + const result = client.matchLocationFromHostProjectRegistrationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.hostProjectRegistrationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchHostProjectRegistrationFromHostProjectRegistrationName', () => { + const result = client.matchHostProjectRegistrationFromHostProjectRegistrationName(fakePath); + assert.strictEqual(result, "hostProjectRegistrationValue"); + assert((client.pathTemplates.hostProjectRegistrationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('plugin', () => { + const fakePath = "/rendered/path/plugin"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + plugin: "pluginValue", + }; + const client = new lintingserviceModule.v1.LintingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.pluginPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.pluginPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('pluginPath', () => { + const result = client.pluginPath("projectValue", "locationValue", "pluginValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.pluginPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromPluginName', () => { + const result = client.matchProjectFromPluginName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.pluginPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromPluginName', () => { + const result = client.matchLocationFromPluginName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.pluginPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPluginFromPluginName', () => { + const result = client.matchPluginFromPluginName(fakePath); + assert.strictEqual(result, "pluginValue"); + assert((client.pathTemplates.pluginPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('runtimeProjectAttachment', () => { + const fakePath = "/rendered/path/runtimeProjectAttachment"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + runtime_project_attachment: "runtimeProjectAttachmentValue", + }; + const client = new lintingserviceModule.v1.LintingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.runtimeProjectAttachmentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.runtimeProjectAttachmentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('runtimeProjectAttachmentPath', () => { + const result = client.runtimeProjectAttachmentPath("projectValue", "locationValue", "runtimeProjectAttachmentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromRuntimeProjectAttachmentName', () => { + const result = client.matchProjectFromRuntimeProjectAttachmentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromRuntimeProjectAttachmentName', () => { + const result = client.matchLocationFromRuntimeProjectAttachmentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName', () => { + const result = client.matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName(fakePath); + assert.strictEqual(result, "runtimeProjectAttachmentValue"); + assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('spec', () => { + const fakePath = "/rendered/path/spec"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + api: "apiValue", + version: "versionValue", + spec: "specValue", + }; + const client = new lintingserviceModule.v1.LintingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.specPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.specPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('specPath', () => { + const result = client.specPath("projectValue", "locationValue", "apiValue", "versionValue", "specValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.specPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSpecName', () => { + const result = client.matchProjectFromSpecName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSpecName', () => { + const result = client.matchLocationFromSpecName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchApiFromSpecName', () => { + const result = client.matchApiFromSpecName(fakePath); + assert.strictEqual(result, "apiValue"); + assert((client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchVersionFromSpecName', () => { + const result = client.matchVersionFromSpecName(fakePath); + assert.strictEqual(result, "versionValue"); + assert((client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSpecFromSpecName', () => { + const result = client.matchSpecFromSpecName(fakePath); + assert.strictEqual(result, "specValue"); + assert((client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('styleGuide', () => { + const fakePath = "/rendered/path/styleGuide"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + plugin: "pluginValue", + }; + const client = new lintingserviceModule.v1.LintingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.styleGuidePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.styleGuidePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('styleGuidePath', () => { + const result = client.styleGuidePath("projectValue", "locationValue", "pluginValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.styleGuidePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromStyleGuideName', () => { + const result = client.matchProjectFromStyleGuideName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.styleGuidePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromStyleGuideName', () => { + const result = client.matchLocationFromStyleGuideName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.styleGuidePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPluginFromStyleGuideName', () => { + const result = client.matchPluginFromStyleGuideName(fakePath); + assert.strictEqual(result, "pluginValue"); + assert((client.pathTemplates.styleGuidePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('version', () => { + const fakePath = "/rendered/path/version"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + api: "apiValue", + version: "versionValue", + }; + const client = new lintingserviceModule.v1.LintingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.versionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.versionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('versionPath', () => { + const result = client.versionPath("projectValue", "locationValue", "apiValue", "versionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.versionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromVersionName', () => { + const result = client.matchProjectFromVersionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromVersionName', () => { + const result = client.matchLocationFromVersionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchApiFromVersionName', () => { + const result = client.matchApiFromVersionName(fakePath); + assert.strictEqual(result, "apiValue"); + assert((client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchVersionFromVersionName', () => { + const result = client.matchVersionFromVersionName(fakePath); + assert.strictEqual(result, "versionValue"); + assert((client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-apihub/v1/test/gapic_provisioning_v1.ts b/owl-bot-staging/google-cloud-apihub/v1/test/gapic_provisioning_v1.ts new file mode 100644 index 00000000000..94980fa3be7 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/test/gapic_provisioning_v1.ts @@ -0,0 +1,1823 @@ +// Copyright 2024 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, beforeEach, afterEach} from 'mocha'; +import * as provisioningModule from '../src'; + +import {GoogleAuth, protobuf, LROperation, operationsProtos, 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 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.ProvisioningClient', () => { + let googleAuth: GoogleAuth; + beforeEach(() => { + googleAuth = { + getClient: sinon.stub().resolves({ + getRequestHeaders: sinon.stub().resolves({Authorization: 'Bearer SOME_TOKEN'}), + }) + } as unknown as GoogleAuth; + }); + afterEach(() => { + sinon.restore(); + }); + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new provisioningModule.v1.ProvisioningClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'apihub.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new provisioningModule.v1.ProvisioningClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, "googleapis.com"); + }); + + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = provisioningModule.v1.ProvisioningClient.servicePath; + assert.strictEqual(servicePath, 'apihub.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = provisioningModule.v1.ProvisioningClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'apihub.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new provisioningModule.v1.ProvisioningClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'apihub.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new provisioningModule.v1.ProvisioningClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'apihub.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new provisioningModule.v1.ProvisioningClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'apihub.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new provisioningModule.v1.ProvisioningClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'apihub.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { new provisioningModule.v1.ProvisioningClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = provisioningModule.v1.ProvisioningClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new provisioningModule.v1.ProvisioningClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new provisioningModule.v1.ProvisioningClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new provisioningModule.v1.ProvisioningClient({ + auth: googleAuth, + projectId: 'bogus', + }); + assert.strictEqual(client.provisioningStub, undefined); + await client.initialize(); + assert(client.provisioningStub); + }); + + it('has close method for the initialized client', done => { + const client = new provisioningModule.v1.ProvisioningClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + assert(client.provisioningStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new provisioningModule.v1.ProvisioningClient({ + auth: googleAuth, + projectId: 'bogus', + }); + assert.strictEqual(client.provisioningStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new provisioningModule.v1.ProvisioningClient({ + auth: googleAuth, + 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 provisioningModule.v1.ProvisioningClient({ + auth: googleAuth, + 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('getApiHubInstance', () => { + it('invokes getApiHubInstance without error', async () => { + const client = new provisioningModule.v1.ProvisioningClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetApiHubInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetApiHubInstanceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.ApiHubInstance() + ); + client.innerApiCalls.getApiHubInstance = stubSimpleCall(expectedResponse); + const [response] = await client.getApiHubInstance(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getApiHubInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getApiHubInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getApiHubInstance without error using callback', async () => { + const client = new provisioningModule.v1.ProvisioningClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetApiHubInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetApiHubInstanceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.ApiHubInstance() + ); + client.innerApiCalls.getApiHubInstance = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getApiHubInstance( + request, + (err?: Error|null, result?: protos.google.cloud.apihub.v1.IApiHubInstance|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getApiHubInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getApiHubInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getApiHubInstance with error', async () => { + const client = new provisioningModule.v1.ProvisioningClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetApiHubInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetApiHubInstanceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getApiHubInstance = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getApiHubInstance(request), expectedError); + const actualRequest = (client.innerApiCalls.getApiHubInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getApiHubInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getApiHubInstance with closed client', async () => { + const client = new provisioningModule.v1.ProvisioningClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetApiHubInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetApiHubInstanceRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getApiHubInstance(request), expectedError); + }); + }); + + describe('lookupApiHubInstance', () => { + it('invokes lookupApiHubInstance without error', async () => { + const client = new provisioningModule.v1.ProvisioningClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.LookupApiHubInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.LookupApiHubInstanceRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.LookupApiHubInstanceResponse() + ); + client.innerApiCalls.lookupApiHubInstance = stubSimpleCall(expectedResponse); + const [response] = await client.lookupApiHubInstance(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.lookupApiHubInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.lookupApiHubInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes lookupApiHubInstance without error using callback', async () => { + const client = new provisioningModule.v1.ProvisioningClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.LookupApiHubInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.LookupApiHubInstanceRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.LookupApiHubInstanceResponse() + ); + client.innerApiCalls.lookupApiHubInstance = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.lookupApiHubInstance( + request, + (err?: Error|null, result?: protos.google.cloud.apihub.v1.ILookupApiHubInstanceResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.lookupApiHubInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.lookupApiHubInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes lookupApiHubInstance with error', async () => { + const client = new provisioningModule.v1.ProvisioningClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.LookupApiHubInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.LookupApiHubInstanceRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.lookupApiHubInstance = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.lookupApiHubInstance(request), expectedError); + const actualRequest = (client.innerApiCalls.lookupApiHubInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.lookupApiHubInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes lookupApiHubInstance with closed client', async () => { + const client = new provisioningModule.v1.ProvisioningClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.LookupApiHubInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.LookupApiHubInstanceRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.lookupApiHubInstance(request), expectedError); + }); + }); + + describe('createApiHubInstance', () => { + it('invokes createApiHubInstance without error', async () => { + const client = new provisioningModule.v1.ProvisioningClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateApiHubInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.CreateApiHubInstanceRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createApiHubInstance = stubLongRunningCall(expectedResponse); + const [operation] = await client.createApiHubInstance(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createApiHubInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createApiHubInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createApiHubInstance without error using callback', async () => { + const client = new provisioningModule.v1.ProvisioningClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateApiHubInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.CreateApiHubInstanceRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createApiHubInstance = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createApiHubInstance( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createApiHubInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createApiHubInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createApiHubInstance with call error', async () => { + const client = new provisioningModule.v1.ProvisioningClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateApiHubInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.CreateApiHubInstanceRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createApiHubInstance = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createApiHubInstance(request), expectedError); + const actualRequest = (client.innerApiCalls.createApiHubInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createApiHubInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createApiHubInstance with LRO error', async () => { + const client = new provisioningModule.v1.ProvisioningClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateApiHubInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.CreateApiHubInstanceRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createApiHubInstance = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createApiHubInstance(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.createApiHubInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createApiHubInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateApiHubInstanceProgress without error', async () => { + const client = new provisioningModule.v1.ProvisioningClient({ + auth: googleAuth, + 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.checkCreateApiHubInstanceProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateApiHubInstanceProgress with error', async () => { + const client = new provisioningModule.v1.ProvisioningClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkCreateApiHubInstanceProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new provisioningModule.v1.ProvisioningClient({ + auth: googleAuth, + 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 provisioningModule.v1.ProvisioningClient({ + auth: googleAuth, + 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 provisioningModule.v1.ProvisioningClient({ + auth: googleAuth, + 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 provisioningModule.v1.ProvisioningClient({ + auth: googleAuth, + 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 provisioningModule.v1.ProvisioningClient({ + 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 provisioningModule.v1.ProvisioningClient({ + auth: googleAuth, + 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 provisioningModule.v1.ProvisioningClient({ + auth: googleAuth, + 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 provisioningModule.v1.ProvisioningClient({ + auth: googleAuth, + 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 provisioningModule.v1.ProvisioningClient({ + auth: googleAuth, + 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 provisioningModule.v1.ProvisioningClient({ + auth: googleAuth, + 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 provisioningModule.v1.ProvisioningClient({ + auth: googleAuth, + 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 provisioningModule.v1.ProvisioningClient({ + auth: googleAuth, + 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 provisioningModule.v1.ProvisioningClient({ + auth: googleAuth, + 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 provisioningModule.v1.ProvisioningClient({ + auth: googleAuth, + 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 provisioningModule.v1.ProvisioningClient({ + auth: googleAuth, + 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 provisioningModule.v1.ProvisioningClient({ + 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('api', () => { + const fakePath = "/rendered/path/api"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + api: "apiValue", + }; + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.apiPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.apiPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('apiPath', () => { + const result = client.apiPath("projectValue", "locationValue", "apiValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.apiPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromApiName', () => { + const result = client.matchProjectFromApiName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.apiPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromApiName', () => { + const result = client.matchLocationFromApiName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.apiPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchApiFromApiName', () => { + const result = client.matchApiFromApiName(fakePath); + assert.strictEqual(result, "apiValue"); + assert((client.pathTemplates.apiPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('apiHubInstance', () => { + const fakePath = "/rendered/path/apiHubInstance"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + api_hub_instance: "apiHubInstanceValue", + }; + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.apiHubInstancePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.apiHubInstancePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('apiHubInstancePath', () => { + const result = client.apiHubInstancePath("projectValue", "locationValue", "apiHubInstanceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.apiHubInstancePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromApiHubInstanceName', () => { + const result = client.matchProjectFromApiHubInstanceName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromApiHubInstanceName', () => { + const result = client.matchLocationFromApiHubInstanceName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchApiHubInstanceFromApiHubInstanceName', () => { + const result = client.matchApiHubInstanceFromApiHubInstanceName(fakePath); + assert.strictEqual(result, "apiHubInstanceValue"); + assert((client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('apiOperation', () => { + const fakePath = "/rendered/path/apiOperation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + api: "apiValue", + version: "versionValue", + operation: "operationValue", + }; + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.apiOperationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.apiOperationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('apiOperationPath', () => { + const result = client.apiOperationPath("projectValue", "locationValue", "apiValue", "versionValue", "operationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.apiOperationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromApiOperationName', () => { + const result = client.matchProjectFromApiOperationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromApiOperationName', () => { + const result = client.matchLocationFromApiOperationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchApiFromApiOperationName', () => { + const result = client.matchApiFromApiOperationName(fakePath); + assert.strictEqual(result, "apiValue"); + assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchVersionFromApiOperationName', () => { + const result = client.matchVersionFromApiOperationName(fakePath); + assert.strictEqual(result, "versionValue"); + assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchOperationFromApiOperationName', () => { + const result = client.matchOperationFromApiOperationName(fakePath); + assert.strictEqual(result, "operationValue"); + assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('attribute', () => { + const fakePath = "/rendered/path/attribute"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + attribute: "attributeValue", + }; + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.attributePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.attributePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('attributePath', () => { + const result = client.attributePath("projectValue", "locationValue", "attributeValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.attributePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAttributeName', () => { + const result = client.matchProjectFromAttributeName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.attributePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAttributeName', () => { + const result = client.matchLocationFromAttributeName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.attributePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAttributeFromAttributeName', () => { + const result = client.matchAttributeFromAttributeName(fakePath); + assert.strictEqual(result, "attributeValue"); + assert((client.pathTemplates.attributePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('definition', () => { + const fakePath = "/rendered/path/definition"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + api: "apiValue", + version: "versionValue", + definition: "definitionValue", + }; + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.definitionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.definitionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('definitionPath', () => { + const result = client.definitionPath("projectValue", "locationValue", "apiValue", "versionValue", "definitionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.definitionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDefinitionName', () => { + const result = client.matchProjectFromDefinitionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDefinitionName', () => { + const result = client.matchLocationFromDefinitionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchApiFromDefinitionName', () => { + const result = client.matchApiFromDefinitionName(fakePath); + assert.strictEqual(result, "apiValue"); + assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchVersionFromDefinitionName', () => { + const result = client.matchVersionFromDefinitionName(fakePath); + assert.strictEqual(result, "versionValue"); + assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDefinitionFromDefinitionName', () => { + const result = client.matchDefinitionFromDefinitionName(fakePath); + assert.strictEqual(result, "definitionValue"); + assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dependency', () => { + const fakePath = "/rendered/path/dependency"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dependency: "dependencyValue", + }; + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dependencyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.dependencyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('dependencyPath', () => { + const result = client.dependencyPath("projectValue", "locationValue", "dependencyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.dependencyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDependencyName', () => { + const result = client.matchProjectFromDependencyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.dependencyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDependencyName', () => { + const result = client.matchLocationFromDependencyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.dependencyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDependencyFromDependencyName', () => { + const result = client.matchDependencyFromDependencyName(fakePath); + assert.strictEqual(result, "dependencyValue"); + assert((client.pathTemplates.dependencyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('deployment', () => { + const fakePath = "/rendered/path/deployment"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + deployment: "deploymentValue", + }; + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.deploymentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.deploymentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('deploymentPath', () => { + const result = client.deploymentPath("projectValue", "locationValue", "deploymentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.deploymentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDeploymentName', () => { + const result = client.matchProjectFromDeploymentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDeploymentName', () => { + const result = client.matchLocationFromDeploymentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDeploymentFromDeploymentName', () => { + const result = client.matchDeploymentFromDeploymentName(fakePath); + assert.strictEqual(result, "deploymentValue"); + assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('externalApi', () => { + const fakePath = "/rendered/path/externalApi"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + external_api: "externalApiValue", + }; + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.externalApiPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.externalApiPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('externalApiPath', () => { + const result = client.externalApiPath("projectValue", "locationValue", "externalApiValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.externalApiPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromExternalApiName', () => { + const result = client.matchProjectFromExternalApiName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.externalApiPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromExternalApiName', () => { + const result = client.matchLocationFromExternalApiName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.externalApiPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExternalApiFromExternalApiName', () => { + const result = client.matchExternalApiFromExternalApiName(fakePath); + assert.strictEqual(result, "externalApiValue"); + assert((client.pathTemplates.externalApiPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('hostProjectRegistration', () => { + const fakePath = "/rendered/path/hostProjectRegistration"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + host_project_registration: "hostProjectRegistrationValue", + }; + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.hostProjectRegistrationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.hostProjectRegistrationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('hostProjectRegistrationPath', () => { + const result = client.hostProjectRegistrationPath("projectValue", "locationValue", "hostProjectRegistrationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.hostProjectRegistrationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromHostProjectRegistrationName', () => { + const result = client.matchProjectFromHostProjectRegistrationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.hostProjectRegistrationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromHostProjectRegistrationName', () => { + const result = client.matchLocationFromHostProjectRegistrationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.hostProjectRegistrationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchHostProjectRegistrationFromHostProjectRegistrationName', () => { + const result = client.matchHostProjectRegistrationFromHostProjectRegistrationName(fakePath); + assert.strictEqual(result, "hostProjectRegistrationValue"); + assert((client.pathTemplates.hostProjectRegistrationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('location', () => { + const fakePath = "/rendered/path/location"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + }; + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.locationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.locationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath("projectValue", "locationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('plugin', () => { + const fakePath = "/rendered/path/plugin"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + plugin: "pluginValue", + }; + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.pluginPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.pluginPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('pluginPath', () => { + const result = client.pluginPath("projectValue", "locationValue", "pluginValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.pluginPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromPluginName', () => { + const result = client.matchProjectFromPluginName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.pluginPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromPluginName', () => { + const result = client.matchLocationFromPluginName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.pluginPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPluginFromPluginName', () => { + const result = client.matchPluginFromPluginName(fakePath); + assert.strictEqual(result, "pluginValue"); + assert((client.pathTemplates.pluginPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('project', () => { + const fakePath = "/rendered/path/project"; + const expectedParameters = { + project: "projectValue", + }; + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath("projectValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('runtimeProjectAttachment', () => { + const fakePath = "/rendered/path/runtimeProjectAttachment"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + runtime_project_attachment: "runtimeProjectAttachmentValue", + }; + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.runtimeProjectAttachmentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.runtimeProjectAttachmentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('runtimeProjectAttachmentPath', () => { + const result = client.runtimeProjectAttachmentPath("projectValue", "locationValue", "runtimeProjectAttachmentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromRuntimeProjectAttachmentName', () => { + const result = client.matchProjectFromRuntimeProjectAttachmentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromRuntimeProjectAttachmentName', () => { + const result = client.matchLocationFromRuntimeProjectAttachmentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName', () => { + const result = client.matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName(fakePath); + assert.strictEqual(result, "runtimeProjectAttachmentValue"); + assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('spec', () => { + const fakePath = "/rendered/path/spec"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + api: "apiValue", + version: "versionValue", + spec: "specValue", + }; + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.specPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.specPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('specPath', () => { + const result = client.specPath("projectValue", "locationValue", "apiValue", "versionValue", "specValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.specPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSpecName', () => { + const result = client.matchProjectFromSpecName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSpecName', () => { + const result = client.matchLocationFromSpecName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchApiFromSpecName', () => { + const result = client.matchApiFromSpecName(fakePath); + assert.strictEqual(result, "apiValue"); + assert((client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchVersionFromSpecName', () => { + const result = client.matchVersionFromSpecName(fakePath); + assert.strictEqual(result, "versionValue"); + assert((client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSpecFromSpecName', () => { + const result = client.matchSpecFromSpecName(fakePath); + assert.strictEqual(result, "specValue"); + assert((client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('styleGuide', () => { + const fakePath = "/rendered/path/styleGuide"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + plugin: "pluginValue", + }; + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.styleGuidePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.styleGuidePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('styleGuidePath', () => { + const result = client.styleGuidePath("projectValue", "locationValue", "pluginValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.styleGuidePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromStyleGuideName', () => { + const result = client.matchProjectFromStyleGuideName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.styleGuidePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromStyleGuideName', () => { + const result = client.matchLocationFromStyleGuideName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.styleGuidePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPluginFromStyleGuideName', () => { + const result = client.matchPluginFromStyleGuideName(fakePath); + assert.strictEqual(result, "pluginValue"); + assert((client.pathTemplates.styleGuidePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('version', () => { + const fakePath = "/rendered/path/version"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + api: "apiValue", + version: "versionValue", + }; + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.versionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.versionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('versionPath', () => { + const result = client.versionPath("projectValue", "locationValue", "apiValue", "versionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.versionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromVersionName', () => { + const result = client.matchProjectFromVersionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromVersionName', () => { + const result = client.matchLocationFromVersionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchApiFromVersionName', () => { + const result = client.matchApiFromVersionName(fakePath); + assert.strictEqual(result, "apiValue"); + assert((client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchVersionFromVersionName', () => { + const result = client.matchVersionFromVersionName(fakePath); + assert.strictEqual(result, "versionValue"); + assert((client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-apihub/v1/test/gapic_runtime_project_attachment_service_v1.ts b/owl-bot-staging/google-cloud-apihub/v1/test/gapic_runtime_project_attachment_service_v1.ts new file mode 100644 index 00000000000..763ccfe58d6 --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/test/gapic_runtime_project_attachment_service_v1.ts @@ -0,0 +1,1886 @@ +// Copyright 2024 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, beforeEach, afterEach} from 'mocha'; +import * as runtimeprojectattachmentserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {GoogleAuth, protobuf, 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 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.RuntimeProjectAttachmentServiceClient', () => { + let googleAuth: GoogleAuth; + beforeEach(() => { + googleAuth = { + getClient: sinon.stub().resolves({ + getRequestHeaders: sinon.stub().resolves({Authorization: 'Bearer SOME_TOKEN'}), + }) + } as unknown as GoogleAuth; + }); + afterEach(() => { + sinon.restore(); + }); + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'apihub.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, "googleapis.com"); + }); + + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient.servicePath; + assert.strictEqual(servicePath, 'apihub.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'apihub.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'apihub.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'apihub.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'apihub.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'apihub.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ + auth: googleAuth, + projectId: 'bogus', + }); + assert.strictEqual(client.runtimeProjectAttachmentServiceStub, undefined); + await client.initialize(); + assert(client.runtimeProjectAttachmentServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + assert(client.runtimeProjectAttachmentServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ + auth: googleAuth, + projectId: 'bogus', + }); + assert.strictEqual(client.runtimeProjectAttachmentServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ + auth: googleAuth, + 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 runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ + auth: googleAuth, + 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('createRuntimeProjectAttachment', () => { + it('invokes createRuntimeProjectAttachment without error', async () => { + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.RuntimeProjectAttachment() + ); + client.innerApiCalls.createRuntimeProjectAttachment = stubSimpleCall(expectedResponse); + const [response] = await client.createRuntimeProjectAttachment(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createRuntimeProjectAttachment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createRuntimeProjectAttachment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createRuntimeProjectAttachment without error using callback', async () => { + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.RuntimeProjectAttachment() + ); + client.innerApiCalls.createRuntimeProjectAttachment = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createRuntimeProjectAttachment( + request, + (err?: Error|null, result?: protos.google.cloud.apihub.v1.IRuntimeProjectAttachment|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createRuntimeProjectAttachment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createRuntimeProjectAttachment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createRuntimeProjectAttachment with error', async () => { + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createRuntimeProjectAttachment = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createRuntimeProjectAttachment(request), expectedError); + const actualRequest = (client.innerApiCalls.createRuntimeProjectAttachment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createRuntimeProjectAttachment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createRuntimeProjectAttachment with closed client', async () => { + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createRuntimeProjectAttachment(request), expectedError); + }); + }); + + describe('getRuntimeProjectAttachment', () => { + it('invokes getRuntimeProjectAttachment without error', async () => { + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.RuntimeProjectAttachment() + ); + client.innerApiCalls.getRuntimeProjectAttachment = stubSimpleCall(expectedResponse); + const [response] = await client.getRuntimeProjectAttachment(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getRuntimeProjectAttachment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getRuntimeProjectAttachment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getRuntimeProjectAttachment without error using callback', async () => { + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.RuntimeProjectAttachment() + ); + client.innerApiCalls.getRuntimeProjectAttachment = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getRuntimeProjectAttachment( + request, + (err?: Error|null, result?: protos.google.cloud.apihub.v1.IRuntimeProjectAttachment|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getRuntimeProjectAttachment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getRuntimeProjectAttachment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getRuntimeProjectAttachment with error', async () => { + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getRuntimeProjectAttachment = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getRuntimeProjectAttachment(request), expectedError); + const actualRequest = (client.innerApiCalls.getRuntimeProjectAttachment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getRuntimeProjectAttachment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getRuntimeProjectAttachment with closed client', async () => { + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getRuntimeProjectAttachment(request), expectedError); + }); + }); + + describe('deleteRuntimeProjectAttachment', () => { + it('invokes deleteRuntimeProjectAttachment without error', async () => { + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteRuntimeProjectAttachment = stubSimpleCall(expectedResponse); + const [response] = await client.deleteRuntimeProjectAttachment(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteRuntimeProjectAttachment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteRuntimeProjectAttachment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteRuntimeProjectAttachment without error using callback', async () => { + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteRuntimeProjectAttachment = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteRuntimeProjectAttachment( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteRuntimeProjectAttachment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteRuntimeProjectAttachment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteRuntimeProjectAttachment with error', async () => { + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteRuntimeProjectAttachment = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteRuntimeProjectAttachment(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteRuntimeProjectAttachment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteRuntimeProjectAttachment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteRuntimeProjectAttachment with closed client', async () => { + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteRuntimeProjectAttachment(request), expectedError); + }); + }); + + describe('lookupRuntimeProjectAttachment', () => { + it('invokes lookupRuntimeProjectAttachment without error', async () => { + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse() + ); + client.innerApiCalls.lookupRuntimeProjectAttachment = stubSimpleCall(expectedResponse); + const [response] = await client.lookupRuntimeProjectAttachment(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.lookupRuntimeProjectAttachment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.lookupRuntimeProjectAttachment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes lookupRuntimeProjectAttachment without error using callback', async () => { + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse() + ); + client.innerApiCalls.lookupRuntimeProjectAttachment = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.lookupRuntimeProjectAttachment( + request, + (err?: Error|null, result?: protos.google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.lookupRuntimeProjectAttachment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.lookupRuntimeProjectAttachment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes lookupRuntimeProjectAttachment with error', async () => { + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.lookupRuntimeProjectAttachment = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.lookupRuntimeProjectAttachment(request), expectedError); + const actualRequest = (client.innerApiCalls.lookupRuntimeProjectAttachment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.lookupRuntimeProjectAttachment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes lookupRuntimeProjectAttachment with closed client', async () => { + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.lookupRuntimeProjectAttachment(request), expectedError); + }); + }); + + describe('listRuntimeProjectAttachments', () => { + it('invokes listRuntimeProjectAttachments without error', async () => { + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.RuntimeProjectAttachment()), + generateSampleMessage(new protos.google.cloud.apihub.v1.RuntimeProjectAttachment()), + generateSampleMessage(new protos.google.cloud.apihub.v1.RuntimeProjectAttachment()), + ]; + client.innerApiCalls.listRuntimeProjectAttachments = stubSimpleCall(expectedResponse); + const [response] = await client.listRuntimeProjectAttachments(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listRuntimeProjectAttachments as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listRuntimeProjectAttachments as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listRuntimeProjectAttachments without error using callback', async () => { + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.RuntimeProjectAttachment()), + generateSampleMessage(new protos.google.cloud.apihub.v1.RuntimeProjectAttachment()), + generateSampleMessage(new protos.google.cloud.apihub.v1.RuntimeProjectAttachment()), + ]; + client.innerApiCalls.listRuntimeProjectAttachments = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listRuntimeProjectAttachments( + request, + (err?: Error|null, result?: protos.google.cloud.apihub.v1.IRuntimeProjectAttachment[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listRuntimeProjectAttachments as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listRuntimeProjectAttachments as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listRuntimeProjectAttachments with error', async () => { + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listRuntimeProjectAttachments = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listRuntimeProjectAttachments(request), expectedError); + const actualRequest = (client.innerApiCalls.listRuntimeProjectAttachments as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listRuntimeProjectAttachments as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listRuntimeProjectAttachmentsStream without error', async () => { + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.RuntimeProjectAttachment()), + generateSampleMessage(new protos.google.cloud.apihub.v1.RuntimeProjectAttachment()), + generateSampleMessage(new protos.google.cloud.apihub.v1.RuntimeProjectAttachment()), + ]; + client.descriptors.page.listRuntimeProjectAttachments.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listRuntimeProjectAttachmentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.apihub.v1.RuntimeProjectAttachment[] = []; + stream.on('data', (response: protos.google.cloud.apihub.v1.RuntimeProjectAttachment) => { + 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.listRuntimeProjectAttachments.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listRuntimeProjectAttachments, request)); + assert( + (client.descriptors.page.listRuntimeProjectAttachments.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listRuntimeProjectAttachmentsStream with error', async () => { + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listRuntimeProjectAttachments.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listRuntimeProjectAttachmentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.apihub.v1.RuntimeProjectAttachment[] = []; + stream.on('data', (response: protos.google.cloud.apihub.v1.RuntimeProjectAttachment) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listRuntimeProjectAttachments.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listRuntimeProjectAttachments, request)); + assert( + (client.descriptors.page.listRuntimeProjectAttachments.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listRuntimeProjectAttachments without error', async () => { + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apihub.v1.RuntimeProjectAttachment()), + generateSampleMessage(new protos.google.cloud.apihub.v1.RuntimeProjectAttachment()), + generateSampleMessage(new protos.google.cloud.apihub.v1.RuntimeProjectAttachment()), + ]; + client.descriptors.page.listRuntimeProjectAttachments.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.apihub.v1.IRuntimeProjectAttachment[] = []; + const iterable = client.listRuntimeProjectAttachmentsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listRuntimeProjectAttachments.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listRuntimeProjectAttachments.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listRuntimeProjectAttachments with error', async () => { + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listRuntimeProjectAttachments.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listRuntimeProjectAttachmentsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.apihub.v1.IRuntimeProjectAttachment[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listRuntimeProjectAttachments.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listRuntimeProjectAttachments.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ + auth: googleAuth, + 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 runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ + auth: googleAuth, + 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 runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ + auth: googleAuth, + 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 runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ + auth: googleAuth, + 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 runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ + 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('Path templates', () => { + + describe('api', () => { + const fakePath = "/rendered/path/api"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + api: "apiValue", + }; + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.apiPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.apiPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('apiPath', () => { + const result = client.apiPath("projectValue", "locationValue", "apiValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.apiPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromApiName', () => { + const result = client.matchProjectFromApiName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.apiPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromApiName', () => { + const result = client.matchLocationFromApiName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.apiPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchApiFromApiName', () => { + const result = client.matchApiFromApiName(fakePath); + assert.strictEqual(result, "apiValue"); + assert((client.pathTemplates.apiPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('apiHubInstance', () => { + const fakePath = "/rendered/path/apiHubInstance"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + api_hub_instance: "apiHubInstanceValue", + }; + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.apiHubInstancePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.apiHubInstancePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('apiHubInstancePath', () => { + const result = client.apiHubInstancePath("projectValue", "locationValue", "apiHubInstanceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.apiHubInstancePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromApiHubInstanceName', () => { + const result = client.matchProjectFromApiHubInstanceName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromApiHubInstanceName', () => { + const result = client.matchLocationFromApiHubInstanceName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchApiHubInstanceFromApiHubInstanceName', () => { + const result = client.matchApiHubInstanceFromApiHubInstanceName(fakePath); + assert.strictEqual(result, "apiHubInstanceValue"); + assert((client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('apiOperation', () => { + const fakePath = "/rendered/path/apiOperation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + api: "apiValue", + version: "versionValue", + operation: "operationValue", + }; + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.apiOperationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.apiOperationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('apiOperationPath', () => { + const result = client.apiOperationPath("projectValue", "locationValue", "apiValue", "versionValue", "operationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.apiOperationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromApiOperationName', () => { + const result = client.matchProjectFromApiOperationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromApiOperationName', () => { + const result = client.matchLocationFromApiOperationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchApiFromApiOperationName', () => { + const result = client.matchApiFromApiOperationName(fakePath); + assert.strictEqual(result, "apiValue"); + assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchVersionFromApiOperationName', () => { + const result = client.matchVersionFromApiOperationName(fakePath); + assert.strictEqual(result, "versionValue"); + assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchOperationFromApiOperationName', () => { + const result = client.matchOperationFromApiOperationName(fakePath); + assert.strictEqual(result, "operationValue"); + assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('attribute', () => { + const fakePath = "/rendered/path/attribute"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + attribute: "attributeValue", + }; + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.attributePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.attributePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('attributePath', () => { + const result = client.attributePath("projectValue", "locationValue", "attributeValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.attributePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAttributeName', () => { + const result = client.matchProjectFromAttributeName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.attributePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAttributeName', () => { + const result = client.matchLocationFromAttributeName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.attributePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAttributeFromAttributeName', () => { + const result = client.matchAttributeFromAttributeName(fakePath); + assert.strictEqual(result, "attributeValue"); + assert((client.pathTemplates.attributePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('definition', () => { + const fakePath = "/rendered/path/definition"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + api: "apiValue", + version: "versionValue", + definition: "definitionValue", + }; + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.definitionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.definitionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('definitionPath', () => { + const result = client.definitionPath("projectValue", "locationValue", "apiValue", "versionValue", "definitionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.definitionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDefinitionName', () => { + const result = client.matchProjectFromDefinitionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDefinitionName', () => { + const result = client.matchLocationFromDefinitionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchApiFromDefinitionName', () => { + const result = client.matchApiFromDefinitionName(fakePath); + assert.strictEqual(result, "apiValue"); + assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchVersionFromDefinitionName', () => { + const result = client.matchVersionFromDefinitionName(fakePath); + assert.strictEqual(result, "versionValue"); + assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDefinitionFromDefinitionName', () => { + const result = client.matchDefinitionFromDefinitionName(fakePath); + assert.strictEqual(result, "definitionValue"); + assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dependency', () => { + const fakePath = "/rendered/path/dependency"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dependency: "dependencyValue", + }; + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dependencyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.dependencyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('dependencyPath', () => { + const result = client.dependencyPath("projectValue", "locationValue", "dependencyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.dependencyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDependencyName', () => { + const result = client.matchProjectFromDependencyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.dependencyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDependencyName', () => { + const result = client.matchLocationFromDependencyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.dependencyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDependencyFromDependencyName', () => { + const result = client.matchDependencyFromDependencyName(fakePath); + assert.strictEqual(result, "dependencyValue"); + assert((client.pathTemplates.dependencyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('deployment', () => { + const fakePath = "/rendered/path/deployment"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + deployment: "deploymentValue", + }; + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.deploymentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.deploymentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('deploymentPath', () => { + const result = client.deploymentPath("projectValue", "locationValue", "deploymentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.deploymentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDeploymentName', () => { + const result = client.matchProjectFromDeploymentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDeploymentName', () => { + const result = client.matchLocationFromDeploymentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDeploymentFromDeploymentName', () => { + const result = client.matchDeploymentFromDeploymentName(fakePath); + assert.strictEqual(result, "deploymentValue"); + assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('externalApi', () => { + const fakePath = "/rendered/path/externalApi"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + external_api: "externalApiValue", + }; + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.externalApiPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.externalApiPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('externalApiPath', () => { + const result = client.externalApiPath("projectValue", "locationValue", "externalApiValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.externalApiPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromExternalApiName', () => { + const result = client.matchProjectFromExternalApiName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.externalApiPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromExternalApiName', () => { + const result = client.matchLocationFromExternalApiName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.externalApiPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExternalApiFromExternalApiName', () => { + const result = client.matchExternalApiFromExternalApiName(fakePath); + assert.strictEqual(result, "externalApiValue"); + assert((client.pathTemplates.externalApiPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('hostProjectRegistration', () => { + const fakePath = "/rendered/path/hostProjectRegistration"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + host_project_registration: "hostProjectRegistrationValue", + }; + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.hostProjectRegistrationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.hostProjectRegistrationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('hostProjectRegistrationPath', () => { + const result = client.hostProjectRegistrationPath("projectValue", "locationValue", "hostProjectRegistrationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.hostProjectRegistrationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromHostProjectRegistrationName', () => { + const result = client.matchProjectFromHostProjectRegistrationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.hostProjectRegistrationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromHostProjectRegistrationName', () => { + const result = client.matchLocationFromHostProjectRegistrationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.hostProjectRegistrationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchHostProjectRegistrationFromHostProjectRegistrationName', () => { + const result = client.matchHostProjectRegistrationFromHostProjectRegistrationName(fakePath); + assert.strictEqual(result, "hostProjectRegistrationValue"); + assert((client.pathTemplates.hostProjectRegistrationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('location', () => { + const fakePath = "/rendered/path/location"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + }; + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.locationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.locationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath("projectValue", "locationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('plugin', () => { + const fakePath = "/rendered/path/plugin"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + plugin: "pluginValue", + }; + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.pluginPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.pluginPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('pluginPath', () => { + const result = client.pluginPath("projectValue", "locationValue", "pluginValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.pluginPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromPluginName', () => { + const result = client.matchProjectFromPluginName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.pluginPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromPluginName', () => { + const result = client.matchLocationFromPluginName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.pluginPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPluginFromPluginName', () => { + const result = client.matchPluginFromPluginName(fakePath); + assert.strictEqual(result, "pluginValue"); + assert((client.pathTemplates.pluginPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('project', () => { + const fakePath = "/rendered/path/project"; + const expectedParameters = { + project: "projectValue", + }; + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath("projectValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('runtimeProjectAttachment', () => { + const fakePath = "/rendered/path/runtimeProjectAttachment"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + runtime_project_attachment: "runtimeProjectAttachmentValue", + }; + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.runtimeProjectAttachmentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.runtimeProjectAttachmentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('runtimeProjectAttachmentPath', () => { + const result = client.runtimeProjectAttachmentPath("projectValue", "locationValue", "runtimeProjectAttachmentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromRuntimeProjectAttachmentName', () => { + const result = client.matchProjectFromRuntimeProjectAttachmentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromRuntimeProjectAttachmentName', () => { + const result = client.matchLocationFromRuntimeProjectAttachmentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName', () => { + const result = client.matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName(fakePath); + assert.strictEqual(result, "runtimeProjectAttachmentValue"); + assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('spec', () => { + const fakePath = "/rendered/path/spec"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + api: "apiValue", + version: "versionValue", + spec: "specValue", + }; + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.specPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.specPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('specPath', () => { + const result = client.specPath("projectValue", "locationValue", "apiValue", "versionValue", "specValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.specPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSpecName', () => { + const result = client.matchProjectFromSpecName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSpecName', () => { + const result = client.matchLocationFromSpecName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchApiFromSpecName', () => { + const result = client.matchApiFromSpecName(fakePath); + assert.strictEqual(result, "apiValue"); + assert((client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchVersionFromSpecName', () => { + const result = client.matchVersionFromSpecName(fakePath); + assert.strictEqual(result, "versionValue"); + assert((client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSpecFromSpecName', () => { + const result = client.matchSpecFromSpecName(fakePath); + assert.strictEqual(result, "specValue"); + assert((client.pathTemplates.specPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('styleGuide', () => { + const fakePath = "/rendered/path/styleGuide"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + plugin: "pluginValue", + }; + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.styleGuidePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.styleGuidePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('styleGuidePath', () => { + const result = client.styleGuidePath("projectValue", "locationValue", "pluginValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.styleGuidePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromStyleGuideName', () => { + const result = client.matchProjectFromStyleGuideName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.styleGuidePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromStyleGuideName', () => { + const result = client.matchLocationFromStyleGuideName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.styleGuidePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPluginFromStyleGuideName', () => { + const result = client.matchPluginFromStyleGuideName(fakePath); + assert.strictEqual(result, "pluginValue"); + assert((client.pathTemplates.styleGuidePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('version', () => { + const fakePath = "/rendered/path/version"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + api: "apiValue", + version: "versionValue", + }; + const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.versionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.versionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('versionPath', () => { + const result = client.versionPath("projectValue", "locationValue", "apiValue", "versionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.versionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromVersionName', () => { + const result = client.matchProjectFromVersionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromVersionName', () => { + const result = client.matchLocationFromVersionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchApiFromVersionName', () => { + const result = client.matchApiFromVersionName(fakePath); + assert.strictEqual(result, "apiValue"); + assert((client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchVersionFromVersionName', () => { + const result = client.matchVersionFromVersionName(fakePath); + assert.strictEqual(result, "versionValue"); + assert((client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-apihub/v1/tsconfig.json b/owl-bot-staging/google-cloud-apihub/v1/tsconfig.json new file mode 100644 index 00000000000..c78f1c884ef --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/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/owl-bot-staging/google-cloud-apihub/v1/webpack.config.js b/owl-bot-staging/google-cloud-apihub/v1/webpack.config.js new file mode 100644 index 00000000000..6b83a6f3e3f --- /dev/null +++ b/owl-bot-staging/google-cloud-apihub/v1/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: 'ApiHub', + filename: './api-hub.js', + }, + node: { + child_process: 'empty', + fs: 'empty', + crypto: 'empty', + }, + resolve: { + alias: { + '../../../package.json': path.resolve(__dirname, 'package.json'), + }, + extensions: ['.js', '.json', '.ts'], + }, + module: { + rules: [ + { + test: /\.tsx?$/, + use: 'ts-loader', + exclude: /node_modules/ + }, + { + test: /node_modules[\\/]@grpc[\\/]grpc-js/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]grpc/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]retry-request/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]https?-proxy-agent/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]gtoken/, + use: 'null-loader' + }, + ], + }, + mode: 'production', +}; From 9f5ec1d70cf1043f870771f53f891925bbcf9db4 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Wed, 4 Sep 2024 21:43:37 +0000 Subject: [PATCH 08/11] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20?= =?UTF-8?q?post-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- .../google-cloud-apihub/v1/.eslintignore | 7 - .../google-cloud-apihub/v1/.eslintrc.json | 3 - .../google-cloud-apihub/v1/.gitignore | 14 - .../google-cloud-apihub/v1/.jsdoc.js | 55 - .../google-cloud-apihub/v1/.mocharc.js | 33 - .../google-cloud-apihub/v1/.prettierrc.js | 22 - .../google-cloud-apihub/v1/README.md | 1 - .../google-cloud-apihub/v1/package.json | 64 - .../cloud/apihub/v1/apihub_service.proto | 1836 - .../cloud/apihub/v1/common_fields.proto | 1297 - .../host_project_registration_service.proto | 207 - .../cloud/apihub/v1/linting_service.proto | 159 - .../cloud/apihub/v1/plugin_service.proto | 148 - .../apihub/v1/provisioning_service.proto | 136 - .../runtime_project_attachment_service.proto | 261 - .../google-cloud-apihub/v1/protos/protos.d.ts | 21434 ------- .../google-cloud-apihub/v1/protos/protos.js | 53441 ---------------- .../google-cloud-apihub/v1/protos/protos.json | 6321 -- .../generated/v1/api_hub.create_api.js | 77 - .../generated/v1/api_hub.create_attribute.js | 78 - .../generated/v1/api_hub.create_deployment.js | 78 - .../v1/api_hub.create_external_api.js | 79 - .../generated/v1/api_hub.create_spec.js | 79 - .../generated/v1/api_hub.create_version.js | 77 - .../generated/v1/api_hub.delete_api.js | 67 - .../generated/v1/api_hub.delete_attribute.js | 63 - .../generated/v1/api_hub.delete_deployment.js | 62 - .../v1/api_hub.delete_external_api.js | 63 - .../generated/v1/api_hub.delete_spec.js | 63 - .../generated/v1/api_hub.delete_version.js | 68 - .../samples/generated/v1/api_hub.get_api.js | 62 - .../generated/v1/api_hub.get_api_operation.js | 63 - .../generated/v1/api_hub.get_attribute.js | 63 - .../generated/v1/api_hub.get_definition.js | 63 - .../generated/v1/api_hub.get_deployment.js | 62 - .../generated/v1/api_hub.get_external_api.js | 63 - .../samples/generated/v1/api_hub.get_spec.js | 63 - .../generated/v1/api_hub.get_spec_contents.js | 63 - .../generated/v1/api_hub.get_version.js | 63 - .../v1/api_hub.list_api_operations.js | 117 - .../samples/generated/v1/api_hub.list_apis.js | 146 - .../generated/v1/api_hub.list_attributes.js | 118 - .../generated/v1/api_hub.list_deployments.js | 133 - .../v1/api_hub.list_external_apis.js | 78 - .../generated/v1/api_hub.list_specs.js | 127 - .../generated/v1/api_hub.list_versions.js | 134 - .../generated/v1/api_hub.search_resources.js | 108 - .../generated/v1/api_hub.update_api.js | 69 - .../generated/v1/api_hub.update_attribute.js | 69 - .../generated/v1/api_hub.update_deployment.js | 69 - .../v1/api_hub.update_external_api.js | 69 - .../generated/v1/api_hub.update_spec.js | 69 - .../generated/v1/api_hub.update_version.js | 69 - .../api_hub_dependencies.create_dependency.js | 77 - .../api_hub_dependencies.delete_dependency.js | 62 - .../v1/api_hub_dependencies.get_dependency.js | 62 - .../api_hub_dependencies.list_dependencies.js | 110 - .../api_hub_dependencies.update_dependency.js | 68 - .../v1/api_hub_plugin.disable_plugin.js | 62 - .../v1/api_hub_plugin.enable_plugin.js | 62 - .../generated/v1/api_hub_plugin.get_plugin.js | 62 - ...ervice.create_host_project_registration.js | 75 - ...n_service.get_host_project_registration.js | 62 - ...service.list_host_project_registrations.js | 100 - .../v1/linting_service.get_style_guide.js | 63 - ...inting_service.get_style_guide_contents.js | 64 - .../generated/v1/linting_service.lint_spec.js | 63 - .../v1/linting_service.update_style_guide.js | 65 - .../provisioning.create_api_hub_instance.js | 76 - .../v1/provisioning.get_api_hub_instance.js | 63 - .../provisioning.lookup_api_hub_instance.js | 64 - ...rvice.create_runtime_project_attachment.js | 75 - ...rvice.delete_runtime_project_attachment.js | 63 - ..._service.get_runtime_project_attachment.js | 63 - ...ervice.list_runtime_project_attachments.js | 100 - ...rvice.lookup_runtime_project_attachment.js | 63 - ...ippet_metadata_google.cloud.apihub.v1.json | 2595 - .../google-cloud-apihub/v1/src/index.ts | 37 - .../v1/src/v1/api_hub_client.ts | 6157 -- .../v1/src/v1/api_hub_client_config.json | 213 - .../v1/src/v1/api_hub_dependencies_client.ts | 1933 - .../api_hub_dependencies_client_config.json | 63 - .../v1/api_hub_dependencies_proto_list.json | 9 - .../v1/src/v1/api_hub_plugin_client.ts | 1469 - .../src/v1/api_hub_plugin_client_config.json | 53 - .../v1/src/v1/api_hub_plugin_proto_list.json | 9 - .../v1/src/v1/api_hub_proto_list.json | 9 - .../v1/src/v1/gapic_metadata.json | 731 - ...ost_project_registration_service_client.ts | 1738 - ...ct_registration_service_client_config.json | 53 - ...oject_registration_service_proto_list.json | 9 - .../google-cloud-apihub/v1/src/v1/index.ts | 25 - .../v1/src/v1/linting_service_client.ts | 1545 - .../src/v1/linting_service_client_config.json | 58 - .../v1/src/v1/linting_service_proto_list.json | 9 - .../v1/src/v1/provisioning_client.ts | 1767 - .../v1/src/v1/provisioning_client_config.json | 53 - .../v1/src/v1/provisioning_proto_list.json | 9 - ...ntime_project_attachment_service_client.ts | 1881 - ...ject_attachment_service_client_config.json | 63 - ...project_attachment_service_proto_list.json | 9 - .../system-test/fixtures/sample/src/index.js | 33 - .../system-test/fixtures/sample/src/index.ts | 68 - .../v1/system-test/install.ts | 49 - .../v1/test/gapic_api_hub_dependencies_v1.ts | 1890 - .../v1/test/gapic_api_hub_plugin_v1.ts | 1438 - .../v1/test/gapic_api_hub_v1.ts | 6109 -- ...ic_host_project_registration_service_v1.ts | 1670 - .../v1/test/gapic_linting_service_v1.ts | 1550 - .../v1/test/gapic_provisioning_v1.ts | 1823 - ...c_runtime_project_attachment_service_v1.ts | 1886 - .../google-cloud-apihub/v1/tsconfig.json | 19 - .../google-cloud-apihub/v1/webpack.config.js | 64 - .../src/v1/api_hub_client.ts | 6 + .../src/v1/api_hub_dependencies_client.ts | 6 + .../src/v1/api_hub_plugin_client.ts | 6 + ...ost_project_registration_service_client.ts | 6 + .../src/v1/linting_service_client.ts | 6 + .../src/v1/provisioning_client.ts | 6 + ...ntime_project_attachment_service_client.ts | 6 + .../test/gapic_api_hub_dependencies_v1.ts | 69 +- .../test/gapic_api_hub_plugin_v1.ts | 59 +- .../test/gapic_api_hub_v1.ts | 267 +- ...ic_host_project_registration_service_v1.ts | 53 +- .../test/gapic_linting_service_v1.ts | 67 +- .../test/gapic_provisioning_v1.ts | 82 +- ...c_runtime_project_attachment_service_v1.ts | 69 +- 127 files changed, 421 insertions(+), 127240 deletions(-) delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/.eslintignore delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/.eslintrc.json delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/.gitignore delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/.jsdoc.js delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/.mocharc.js delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/.prettierrc.js delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/README.md delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/package.json delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/protos/google/cloud/apihub/v1/apihub_service.proto delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/protos/google/cloud/apihub/v1/common_fields.proto delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/protos/google/cloud/apihub/v1/host_project_registration_service.proto delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/protos/google/cloud/apihub/v1/linting_service.proto delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/protos/google/cloud/apihub/v1/plugin_service.proto delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/protos/google/cloud/apihub/v1/provisioning_service.proto delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/protos/google/cloud/apihub/v1/runtime_project_attachment_service.proto delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/protos/protos.d.ts delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/protos/protos.js delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/protos/protos.json delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.create_api.js delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.create_attribute.js delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.create_deployment.js delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.create_external_api.js delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.create_spec.js delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.create_version.js delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.delete_api.js delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.delete_attribute.js delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.delete_deployment.js delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.delete_external_api.js delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.delete_spec.js delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.delete_version.js delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_api.js delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_api_operation.js delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_attribute.js delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_definition.js delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_deployment.js delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_external_api.js delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_spec.js delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_spec_contents.js delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_version.js delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.list_api_operations.js delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.list_apis.js delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.list_attributes.js delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.list_deployments.js delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.list_external_apis.js delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.list_specs.js delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.list_versions.js delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.search_resources.js delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.update_api.js delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.update_attribute.js delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.update_deployment.js delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.update_external_api.js delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.update_spec.js delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.update_version.js delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_dependencies.create_dependency.js delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_dependencies.delete_dependency.js delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_dependencies.get_dependency.js delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_dependencies.list_dependencies.js delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_dependencies.update_dependency.js delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_plugin.disable_plugin.js delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_plugin.enable_plugin.js delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_plugin.get_plugin.js delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/host_project_registration_service.create_host_project_registration.js delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/host_project_registration_service.get_host_project_registration.js delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/host_project_registration_service.list_host_project_registrations.js delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/linting_service.get_style_guide.js delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/linting_service.get_style_guide_contents.js delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/linting_service.lint_spec.js delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/linting_service.update_style_guide.js delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/provisioning.create_api_hub_instance.js delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/provisioning.get_api_hub_instance.js delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/provisioning.lookup_api_hub_instance.js delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/runtime_project_attachment_service.create_runtime_project_attachment.js delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/runtime_project_attachment_service.delete_runtime_project_attachment.js delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/runtime_project_attachment_service.get_runtime_project_attachment.js delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/runtime_project_attachment_service.list_runtime_project_attachments.js delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/runtime_project_attachment_service.lookup_runtime_project_attachment.js delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/snippet_metadata_google.cloud.apihub.v1.json delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/src/index.ts delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_client.ts delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_client_config.json delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_dependencies_client.ts delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_dependencies_client_config.json delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_dependencies_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_plugin_client.ts delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_plugin_client_config.json delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_plugin_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/src/v1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/src/v1/host_project_registration_service_client.ts delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/src/v1/host_project_registration_service_client_config.json delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/src/v1/host_project_registration_service_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/src/v1/index.ts delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/src/v1/linting_service_client.ts delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/src/v1/linting_service_client_config.json delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/src/v1/linting_service_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/src/v1/provisioning_client.ts delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/src/v1/provisioning_client_config.json delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/src/v1/provisioning_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/src/v1/runtime_project_attachment_service_client.ts delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/src/v1/runtime_project_attachment_service_client_config.json delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/src/v1/runtime_project_attachment_service_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/system-test/fixtures/sample/src/index.js delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/system-test/fixtures/sample/src/index.ts delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/system-test/install.ts delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/test/gapic_api_hub_dependencies_v1.ts delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/test/gapic_api_hub_plugin_v1.ts delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/test/gapic_api_hub_v1.ts delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/test/gapic_host_project_registration_service_v1.ts delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/test/gapic_linting_service_v1.ts delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/test/gapic_provisioning_v1.ts delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/test/gapic_runtime_project_attachment_service_v1.ts delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/tsconfig.json delete mode 100644 owl-bot-staging/google-cloud-apihub/v1/webpack.config.js diff --git a/owl-bot-staging/google-cloud-apihub/v1/.eslintignore b/owl-bot-staging/google-cloud-apihub/v1/.eslintignore deleted file mode 100644 index cfc348ec4d1..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/.eslintignore +++ /dev/null @@ -1,7 +0,0 @@ -**/node_modules -**/.coverage -build/ -docs/ -protos/ -system-test/ -samples/generated/ diff --git a/owl-bot-staging/google-cloud-apihub/v1/.eslintrc.json b/owl-bot-staging/google-cloud-apihub/v1/.eslintrc.json deleted file mode 100644 index 78215349546..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./node_modules/gts" -} diff --git a/owl-bot-staging/google-cloud-apihub/v1/.gitignore b/owl-bot-staging/google-cloud-apihub/v1/.gitignore deleted file mode 100644 index d4f03a0df2e..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/.gitignore +++ /dev/null @@ -1,14 +0,0 @@ -**/*.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/owl-bot-staging/google-cloud-apihub/v1/.jsdoc.js b/owl-bot-staging/google-cloud-apihub/v1/.jsdoc.js deleted file mode 100644 index 267f9e6b16e..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/.jsdoc.js +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2024 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 2024 Google LLC', - includeDate: false, - sourceFiles: false, - systemName: '@google-cloud/apihub', - theme: 'lumen', - default: { - outputSourceFiles: false - } - }, - markdown: { - idInHeadings: true - } -}; diff --git a/owl-bot-staging/google-cloud-apihub/v1/.mocharc.js b/owl-bot-staging/google-cloud-apihub/v1/.mocharc.js deleted file mode 100644 index 13b67c34edc..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/.mocharc.js +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2024 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. ** - -const config = { - "enable-source-maps": true, - "throw-deprecation": true, - "timeout": 10000 -} -if (process.env.MOCHA_THROW_DEPRECATION === 'false') { - delete config['throw-deprecation']; -} -if (process.env.MOCHA_REPORTER) { - config.reporter = process.env.MOCHA_REPORTER; -} -if (process.env.MOCHA_REPORTER_OUTPUT) { - config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; -} -module.exports = config diff --git a/owl-bot-staging/google-cloud-apihub/v1/.prettierrc.js b/owl-bot-staging/google-cloud-apihub/v1/.prettierrc.js deleted file mode 100644 index 9a8fd690982..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/.prettierrc.js +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2024 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. ** - - -module.exports = { - ...require('gts/.prettierrc.json') -} diff --git a/owl-bot-staging/google-cloud-apihub/v1/README.md b/owl-bot-staging/google-cloud-apihub/v1/README.md deleted file mode 100644 index dc4fd3e19f6..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/README.md +++ /dev/null @@ -1 +0,0 @@ -Apihub: Nodejs Client diff --git a/owl-bot-staging/google-cloud-apihub/v1/package.json b/owl-bot-staging/google-cloud-apihub/v1/package.json deleted file mode 100644 index 92b7f5f827b..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/package.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "name": "@google-cloud/apihub", - "version": "0.1.0", - "description": "Apihub client for Node.js", - "repository": "googleapis/nodejs-apihub", - "license": "Apache-2.0", - "author": "Google LLC", - "main": "build/src/index.js", - "files": [ - "build/src", - "build/protos" - ], - "keywords": [ - "google apis client", - "google api client", - "google apis", - "google api", - "google", - "google cloud platform", - "google cloud", - "cloud", - "google apihub", - "apihub", - "api hub", - "api hub dependencies", - "api hub plugin", - "host project registration service", - "linting service", - "provisioning", - "runtime project attachment service" - ], - "scripts": { - "clean": "gts clean", - "compile": "tsc -p . && cp -r protos build/ && minifyProtoJson", - "compile-protos": "compileProtos src", - "docs": "jsdoc -c .jsdoc.js", - "fix": "gts fix", - "lint": "gts check", - "prepare": "npm run compile-protos && npm run compile", - "system-test": "c8 mocha build/system-test", - "test": "c8 mocha build/test" - }, - "dependencies": { - "google-gax": "^4.3.4" - }, - "devDependencies": { - "@types/mocha": "^10.0.6", - "@types/node": "^20.12.12", - "@types/sinon": "^10.0.20", - "c8": "^9.1.0", - "gapic-tools": "^0.4.2", - "gts": "5.3.0", - "jsdoc": "^4.0.3", - "jsdoc-fresh": "^3.0.0", - "jsdoc-region-tag": "^3.0.0", - "mocha": "^10.4.0", - "pack-n-play": "^2.0.3", - "sinon": "^15.2.0", - "typescript": "5.1.6" - }, - "engines": { - "node": ">=v14" - } -} diff --git a/owl-bot-staging/google-cloud-apihub/v1/protos/google/cloud/apihub/v1/apihub_service.proto b/owl-bot-staging/google-cloud-apihub/v1/protos/google/cloud/apihub/v1/apihub_service.proto deleted file mode 100644 index bbc89cae32d..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/protos/google/cloud/apihub/v1/apihub_service.proto +++ /dev/null @@ -1,1836 +0,0 @@ -// Copyright 2024 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.apihub.v1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/apihub/v1/common_fields.proto"; -import "google/protobuf/empty.proto"; -import "google/protobuf/field_mask.proto"; - -option csharp_namespace = "Google.Cloud.ApiHub.V1"; -option go_package = "cloud.google.com/go/apihub/apiv1/apihubpb;apihubpb"; -option java_multiple_files = true; -option java_outer_classname = "ApiHubServiceProto"; -option java_package = "com.google.cloud.apihub.v1"; -option php_namespace = "Google\\Cloud\\ApiHub\\V1"; -option ruby_package = "Google::Cloud::ApiHub::V1"; - -// This service provides all methods related to the API hub. -service ApiHub { - option (google.api.default_host) = "apihub.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform"; - - // Create an API resource in the API hub. - // Once an API resource is created, versions can be added to it. - rpc CreateApi(CreateApiRequest) returns (Api) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*}/apis" - body: "api" - }; - option (google.api.method_signature) = "parent,api,api_id"; - } - - // Get API resource details including the API versions contained in it. - rpc GetApi(GetApiRequest) returns (Api) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/apis/*}" - }; - option (google.api.method_signature) = "name"; - } - - // List API resources in the API hub. - rpc ListApis(ListApisRequest) returns (ListApisResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*}/apis" - }; - option (google.api.method_signature) = "parent"; - } - - // Update an API resource in the API hub. The following fields in the - // [API][] can be updated: - // - // * [display_name][google.cloud.apihub.v1.Api.display_name] - // * [description][google.cloud.apihub.v1.Api.description] - // * [owner][google.cloud.apihub.v1.Api.owner] - // * [documentation][google.cloud.apihub.v1.Api.documentation] - // * [target_user][google.cloud.apihub.v1.Api.target_user] - // * [team][google.cloud.apihub.v1.Api.team] - // * [business_unit][google.cloud.apihub.v1.Api.business_unit] - // * [maturity_level][google.cloud.apihub.v1.Api.maturity_level] - // * [attributes][google.cloud.apihub.v1.Api.attributes] - // - // The - // [update_mask][google.cloud.apihub.v1.UpdateApiRequest.update_mask] - // should be used to specify the fields being updated. - // - // Updating the owner field requires complete owner message - // and updates both owner and email fields. - rpc UpdateApi(UpdateApiRequest) returns (Api) { - option (google.api.http) = { - patch: "/v1/{api.name=projects/*/locations/*/apis/*}" - body: "api" - }; - option (google.api.method_signature) = "api,update_mask"; - } - - // Delete an API resource in the API hub. API can only be deleted if all - // underlying versions are deleted. - rpc DeleteApi(DeleteApiRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/locations/*/apis/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Create an API version for an API resource in the API hub. - rpc CreateVersion(CreateVersionRequest) returns (Version) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*/apis/*}/versions" - body: "version" - }; - option (google.api.method_signature) = "parent,version,version_id"; - } - - // Get details about the API version of an API resource. This will include - // information about the specs and operations present in the API - // version as well as the deployments linked to it. - rpc GetVersion(GetVersionRequest) returns (Version) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/apis/*/versions/*}" - }; - option (google.api.method_signature) = "name"; - } - - // List API versions of an API resource in the API hub. - rpc ListVersions(ListVersionsRequest) returns (ListVersionsResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*/apis/*}/versions" - }; - option (google.api.method_signature) = "parent"; - } - - // Update API version. The following fields in the - // [version][google.cloud.apihub.v1.Version] can be updated currently: - // - // * [display_name][google.cloud.apihub.v1.Version.display_name] - // * [description][google.cloud.apihub.v1.Version.description] - // * [documentation][google.cloud.apihub.v1.Version.documentation] - // * [deployments][google.cloud.apihub.v1.Version.deployments] - // * [lifecycle][google.cloud.apihub.v1.Version.lifecycle] - // * [compliance][google.cloud.apihub.v1.Version.compliance] - // * [accreditation][google.cloud.apihub.v1.Version.accreditation] - // * [attributes][google.cloud.apihub.v1.Version.attributes] - // - // The - // [update_mask][google.cloud.apihub.v1.UpdateVersionRequest.update_mask] - // should be used to specify the fields being updated. - rpc UpdateVersion(UpdateVersionRequest) returns (Version) { - option (google.api.http) = { - patch: "/v1/{version.name=projects/*/locations/*/apis/*/versions/*}" - body: "version" - }; - option (google.api.method_signature) = "version,update_mask"; - } - - // Delete an API version. Version can only be deleted if all underlying specs, - // operations, definitions and linked deployments are deleted. - rpc DeleteVersion(DeleteVersionRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/locations/*/apis/*/versions/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Add a spec to an API version in the API hub. - // Multiple specs can be added to an API version. - // Note, while adding a spec, at least one of `contents` or `source_uri` must - // be provided. If `contents` is provided, then `spec_type` must also be - // provided. - // - // On adding a spec with contents to the version, the operations present in it - // will be added to the version.Note that the file contents in the spec should - // be of the same type as defined in the - // `projects/{project}/locations/{location}/attributes/system-spec-type` - // attribute associated with spec resource. Note that specs of various types - // can be uploaded, however parsing of details is supported for OpenAPI spec - // currently. - // - // In order to access the information parsed from the spec, use the - // [GetSpec][google.cloud.apihub.v1.ApiHub.GetSpec] method. - // In order to access the raw contents for a particular spec, use the - // [GetSpecContents][google.cloud.apihub.v1.ApiHub.GetSpecContents] method. - // In order to access the operations parsed from the spec, use the - // [ListAPIOperations][google.cloud.apihub.v1.ApiHub.ListApiOperations] - // method. - rpc CreateSpec(CreateSpecRequest) returns (Spec) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*/apis/*/versions/*}/specs" - body: "spec" - }; - option (google.api.method_signature) = "parent,spec,spec_id"; - } - - // Get details about the information parsed from a spec. - // Note that this method does not return the raw spec contents. - // Use [GetSpecContents][google.cloud.apihub.v1.ApiHub.GetSpecContents] method - // to retrieve the same. - rpc GetSpec(GetSpecRequest) returns (Spec) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Get spec contents. - rpc GetSpecContents(GetSpecContentsRequest) returns (SpecContents) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*}:contents" - }; - option (google.api.method_signature) = "name"; - } - - // List specs corresponding to a particular API resource. - rpc ListSpecs(ListSpecsRequest) returns (ListSpecsResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*/apis/*/versions/*}/specs" - }; - option (google.api.method_signature) = "parent"; - } - - // Update spec. The following fields in the - // [spec][google.cloud.apihub.v1.Spec] can be updated: - // - // * [display_name][google.cloud.apihub.v1.Spec.display_name] - // * [source_uri][google.cloud.apihub.v1.Spec.source_uri] - // * [lint_response][google.cloud.apihub.v1.Spec.lint_response] - // * [attributes][google.cloud.apihub.v1.Spec.attributes] - // * [contents][google.cloud.apihub.v1.Spec.contents] - // * [spec_type][google.cloud.apihub.v1.Spec.spec_type] - // - // In case of an OAS spec, updating spec contents can lead to: - // 1. Creation, deletion and update of operations. - // 2. Creation, deletion and update of definitions. - // 3. Update of other info parsed out from the new spec. - // - // In case of contents or source_uri being present in update mask, spec_type - // must also be present. Also, spec_type can not be present in update mask if - // contents or source_uri is not present. - // - // The - // [update_mask][google.cloud.apihub.v1.UpdateSpecRequest.update_mask] - // should be used to specify the fields being updated. - rpc UpdateSpec(UpdateSpecRequest) returns (Spec) { - option (google.api.http) = { - patch: "/v1/{spec.name=projects/*/locations/*/apis/*/versions/*/specs/*}" - body: "spec" - }; - option (google.api.method_signature) = "spec,update_mask"; - } - - // Delete a spec. - // Deleting a spec will also delete the associated operations from the - // version. - rpc DeleteSpec(DeleteSpecRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Get details about a particular operation in API version. - rpc GetApiOperation(GetApiOperationRequest) returns (ApiOperation) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/apis/*/versions/*/operations/*}" - }; - option (google.api.method_signature) = "name"; - } - - // List operations in an API version. - rpc ListApiOperations(ListApiOperationsRequest) - returns (ListApiOperationsResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*/apis/*/versions/*}/operations" - }; - option (google.api.method_signature) = "parent"; - } - - // Get details about a definition in an API version. - rpc GetDefinition(GetDefinitionRequest) returns (Definition) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/apis/*/versions/*/definitions/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Create a deployment resource in the API hub. - // Once a deployment resource is created, it can be associated with API - // versions. - rpc CreateDeployment(CreateDeploymentRequest) returns (Deployment) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*}/deployments" - body: "deployment" - }; - option (google.api.method_signature) = "parent,deployment,deployment_id"; - } - - // Get details about a deployment and the API versions linked to it. - rpc GetDeployment(GetDeploymentRequest) returns (Deployment) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/deployments/*}" - }; - option (google.api.method_signature) = "name"; - } - - // List deployment resources in the API hub. - rpc ListDeployments(ListDeploymentsRequest) - returns (ListDeploymentsResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*}/deployments" - }; - option (google.api.method_signature) = "parent"; - } - - // Update a deployment resource in the API hub. The following fields in the - // [deployment resource][google.cloud.apihub.v1.Deployment] can be - // updated: - // - // * [display_name][google.cloud.apihub.v1.Deployment.display_name] - // * [description][google.cloud.apihub.v1.Deployment.description] - // * [documentation][google.cloud.apihub.v1.Deployment.documentation] - // * [deployment_type][google.cloud.apihub.v1.Deployment.deployment_type] - // * [resource_uri][google.cloud.apihub.v1.Deployment.resource_uri] - // * [endpoints][google.cloud.apihub.v1.Deployment.endpoints] - // * [slo][google.cloud.apihub.v1.Deployment.slo] - // * [environment][google.cloud.apihub.v1.Deployment.environment] - // * [attributes][google.cloud.apihub.v1.Deployment.attributes] - // - // The - // [update_mask][google.cloud.apihub.v1.UpdateDeploymentRequest.update_mask] - // should be used to specify the fields being updated. - rpc UpdateDeployment(UpdateDeploymentRequest) returns (Deployment) { - option (google.api.http) = { - patch: "/v1/{deployment.name=projects/*/locations/*/deployments/*}" - body: "deployment" - }; - option (google.api.method_signature) = "deployment,update_mask"; - } - - // Delete a deployment resource in the API hub. - rpc DeleteDeployment(DeleteDeploymentRequest) - returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/locations/*/deployments/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Create a user defined attribute. - // - // Certain pre defined attributes are already created by the API hub. These - // attributes will have type as `SYSTEM_DEFINED` and can be listed via - // [ListAttributes][google.cloud.apihub.v1.ApiHub.ListAttributes] method. - // Allowed values for the same can be updated via - // [UpdateAttribute][google.cloud.apihub.v1.ApiHub.UpdateAttribute] method. - rpc CreateAttribute(CreateAttributeRequest) returns (Attribute) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*}/attributes" - body: "attribute" - }; - option (google.api.method_signature) = "parent,attribute,attribute_id"; - } - - // Get details about the attribute. - rpc GetAttribute(GetAttributeRequest) returns (Attribute) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/attributes/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Update the attribute. The following fields in the - // [Attribute resource][google.cloud.apihub.v1.Attribute] can be updated: - // - // * [display_name][google.cloud.apihub.v1.Attribute.display_name] - // The display name can be updated for user defined attributes only. - // * [description][google.cloud.apihub.v1.Attribute.description] - // The description can be updated for user defined attributes only. - // * [allowed_values][google.cloud.apihub.v1.Attribute.allowed_values] - // To update the list of allowed values, clients need to use the fetched list - // of allowed values and add or remove values to or from the same list. - // The mutable allowed values can be updated for both user defined and System - // defined attributes. The immutable allowed values cannot be updated or - // deleted. The updated list of allowed values cannot be empty. If an allowed - // value that is already used by some resource's attribute is deleted, then - // the association between the resource and the attribute value will also be - // deleted. - // * [cardinality][google.cloud.apihub.v1.Attribute.cardinality] - // The cardinality can be updated for user defined attributes only. - // Cardinality can only be increased during an update. - // - // The - // [update_mask][google.cloud.apihub.v1.UpdateAttributeRequest.update_mask] - // should be used to specify the fields being updated. - rpc UpdateAttribute(UpdateAttributeRequest) returns (Attribute) { - option (google.api.http) = { - patch: "/v1/{attribute.name=projects/*/locations/*/attributes/*}" - body: "attribute" - }; - option (google.api.method_signature) = "attribute,update_mask"; - } - - // Delete an attribute. - // - // Note: System defined attributes cannot be deleted. All - // associations of the attribute being deleted with any API hub resource will - // also get deleted. - rpc DeleteAttribute(DeleteAttributeRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/locations/*/attributes/*}" - }; - option (google.api.method_signature) = "name"; - } - - // List all attributes. - rpc ListAttributes(ListAttributesRequest) returns (ListAttributesResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*}/attributes" - }; - option (google.api.method_signature) = "parent"; - } - - // Search across API-Hub resources. - rpc SearchResources(SearchResourcesRequest) - returns (SearchResourcesResponse) { - option (google.api.http) = { - post: "/v1/{location=projects/*/locations/*}:searchResources" - body: "*" - }; - option (google.api.method_signature) = "location,query"; - } - - // Create an External API resource in the API hub. - rpc CreateExternalApi(CreateExternalApiRequest) returns (ExternalApi) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*}/externalApis" - body: "external_api" - }; - option (google.api.method_signature) = - "parent,external_api,external_api_id"; - } - - // Get details about an External API resource in the API hub. - rpc GetExternalApi(GetExternalApiRequest) returns (ExternalApi) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/externalApis/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Update an External API resource in the API hub. The following fields can be - // updated: - // - // * [display_name][google.cloud.apihub.v1.ExternalApi.display_name] - // * [description][google.cloud.apihub.v1.ExternalApi.description] - // * [documentation][google.cloud.apihub.v1.ExternalApi.documentation] - // * [endpoints][google.cloud.apihub.v1.ExternalApi.endpoints] - // * [paths][google.cloud.apihub.v1.ExternalApi.paths] - // - // The - // [update_mask][google.cloud.apihub.v1.UpdateExternalApiRequest.update_mask] - // should be used to specify the fields being updated. - rpc UpdateExternalApi(UpdateExternalApiRequest) returns (ExternalApi) { - option (google.api.http) = { - patch: "/v1/{external_api.name=projects/*/locations/*/externalApis/*}" - body: "external_api" - }; - option (google.api.method_signature) = "external_api,update_mask"; - } - - // Delete an External API resource in the API hub. - rpc DeleteExternalApi(DeleteExternalApiRequest) - returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/locations/*/externalApis/*}" - }; - option (google.api.method_signature) = "name"; - } - - // List External API resources in the API hub. - rpc ListExternalApis(ListExternalApisRequest) - returns (ListExternalApisResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*}/externalApis" - }; - option (google.api.method_signature) = "parent"; - } -} - -// This service provides methods for various operations related to a -// [Dependency][google.cloud.apihub.v1.Dependency] in the API hub. -service ApiHubDependencies { - option (google.api.default_host) = "apihub.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform"; - - // Create a dependency between two entities in the API hub. - rpc CreateDependency(CreateDependencyRequest) returns (Dependency) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*}/dependencies" - body: "dependency" - }; - option (google.api.method_signature) = "parent,dependency,dependency_id"; - } - - // Get details about a dependency resource in the API hub. - rpc GetDependency(GetDependencyRequest) returns (Dependency) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/dependencies/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Update a dependency based on the - // [update_mask][google.cloud.apihub.v1.UpdateDependencyRequest.update_mask] - // provided in the request. - // - // The following fields in the [dependency][google.cloud.apihub.v1.Dependency] - // can be updated: - // * [description][google.cloud.apihub.v1.Dependency.description] - rpc UpdateDependency(UpdateDependencyRequest) returns (Dependency) { - option (google.api.http) = { - patch: "/v1/{dependency.name=projects/*/locations/*/dependencies/*}" - body: "dependency" - }; - option (google.api.method_signature) = "dependency,update_mask"; - } - - // Delete the dependency resource. - rpc DeleteDependency(DeleteDependencyRequest) - returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/locations/*/dependencies/*}" - }; - option (google.api.method_signature) = "name"; - } - - // List dependencies based on the provided filter and pagination parameters. - rpc ListDependencies(ListDependenciesRequest) - returns (ListDependenciesResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*}/dependencies" - }; - option (google.api.method_signature) = "parent"; - } -} - -// The [CreateApi][google.cloud.apihub.v1.ApiHub.CreateApi] method's request. -message CreateApiRequest { - // Required. The parent resource for the API resource. - // Format: `projects/{project}/locations/{location}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "apihub.googleapis.com/Api" - } - ]; - - // Optional. The ID to use for the API resource, which will become the final - // component of the API's resource name. This field is optional. - // - // * If provided, the same will be used. The service will throw an error if - // the specified id is already used by another API resource in the API hub. - // * If not provided, a system generated id will be used. - // - // This value should be 4-500 characters, and valid characters - // are /[a-z][A-Z][0-9]-_/. - string api_id = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Required. The API resource to create. - Api api = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// The [GetApi][google.cloud.apihub.v1.ApiHub.GetApi] method's request. -message GetApiRequest { - // Required. The name of the API resource to retrieve. - // Format: `projects/{project}/locations/{location}/apis/{api}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "apihub.googleapis.com/Api" } - ]; -} - -// The [UpdateApi][google.cloud.apihub.v1.ApiHub.UpdateApi] method's request. -message UpdateApiRequest { - // Required. The API resource to update. - // - // The API resource's `name` field is used to identify the API resource to - // update. - // Format: `projects/{project}/locations/{location}/apis/{api}` - Api api = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The list of fields to update. - google.protobuf.FieldMask update_mask = 2 - [(google.api.field_behavior) = REQUIRED]; -} - -// The [DeleteApi][google.cloud.apihub.v1.ApiHub.DeleteApi] method's request. -message DeleteApiRequest { - // Required. The name of the API resource to delete. - // Format: `projects/{project}/locations/{location}/apis/{api}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "apihub.googleapis.com/Api" } - ]; - - // Optional. If set to true, any versions from this API will also be deleted. - // Otherwise, the request will only work if the API has no versions. - bool force = 2 [(google.api.field_behavior) = OPTIONAL]; -} - -// The [ListApis][google.cloud.apihub.v1.ApiHub.ListApis] method's request. -message ListApisRequest { - // Required. The parent, which owns this collection of API resources. - // Format: `projects/{project}/locations/{location}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "apihub.googleapis.com/Api" - } - ]; - - // Optional. An expression that filters the list of ApiResources. - // - // A filter expression consists of a field name, a comparison - // operator, and a value for filtering. The value must be a string. The - // comparison operator must be one of: `<`, `>`, `:` or `=`. Filters are not - // case sensitive. - // - // The following fields in the `ApiResource` are eligible for filtering: - // - // * `owner.email` - The email of the team which owns the ApiResource. - // Allowed comparison operators: `=`. - // * `create_time` - The time at which the ApiResource was created. The - // value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] - // format. Allowed comparison operators: `>` and `<`. - // * `display_name` - The display name of the ApiResource. Allowed - // comparison operators: `=`. - // * `target_user.enum_values.values.id` - The allowed value id of the - // target users attribute associated with the ApiResource. Allowed - // comparison operator is `:`. - // * `target_user.enum_values.values.display_name` - The allowed value - // display name of the target users attribute associated with the - // ApiResource. Allowed comparison operator is `:`. - // * `team.enum_values.values.id` - The allowed value id of the team - // attribute associated with the ApiResource. Allowed comparison operator is - // `:`. - // * `team.enum_values.values.display_name` - The allowed value display name - // of the team attribute associated with the ApiResource. Allowed comparison - // operator is `:`. - // * `business_unit.enum_values.values.id` - The allowed value id of the - // business unit attribute associated with the ApiResource. Allowed - // comparison operator is `:`. - // * `business_unit.enum_values.values.display_name` - The allowed value - // display name of the business unit attribute associated with the - // ApiResource. Allowed comparison operator is `:`. - // * `maturity_level.enum_values.values.id` - The allowed value id of the - // maturity level attribute associated with the ApiResource. Allowed - // comparison operator is `:`. - // * `maturity_level.enum_values.values.display_name` - The allowed value - // display name of the maturity level attribute associated with the - // ApiResource. Allowed comparison operator is `:`. - // * `api_style.enum_values.values.id` - The allowed value id of the - // api style attribute associated with the ApiResource. Allowed - // comparison operator is `:`. - // * `api_style.enum_values.values.display_name` - The allowed value display - // name of the api style attribute associated with the ApiResource. Allowed - // comparison operator is `:`. - // - // Expressions are combined with either `AND` logic operator or `OR` logical - // operator but not both of them together i.e. only one of the `AND` or `OR` - // operator can be used throughout the filter string and both the operators - // cannot be used together. No other logical operators are supported. At most - // three filter fields are allowed in the filter string and if provided - // more than that then `INVALID_ARGUMENT` error is returned by the API. - // - // Here are a few examples: - // - // * `owner.email = \"apihub@google.com\"` - - The owner team email is - // _apihub@google.com_. - // * `owner.email = \"apihub@google.com\" AND create_time < - // \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - - // The owner team email is _apihub@google.com_ and the api was created - // before _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_. - // * `owner.email = \"apihub@google.com\" OR team.enum_values.values.id: - // apihub-team-id` - The filter string specifies the APIs where the owner - // team email is _apihub@google.com_ or the id of the allowed value - // associated with the team attribute is _apihub-team-id_. - // * `owner.email = \"apihub@google.com\" OR - // team.enum_values.values.display_name: ApiHub Team` - The filter string - // specifies the APIs where the owner team email is _apihub@google.com_ or - // the display name of the allowed value associated with the team attribute - // is `ApiHub Team`. - string filter = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The maximum number of API resources to return. The service may - // return fewer than this value. If unspecified, at most 50 Apis will be - // returned. The maximum value is 1000; values above 1000 will be coerced to - // 1000. - int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A page token, received from a previous `ListApis` call. - // Provide this to retrieve the subsequent page. - // - // When paginating, all other parameters (except page_size) provided to - // `ListApis` must match the call that provided the page token. - string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; -} - -// The [ListApis][google.cloud.apihub.v1.ApiHub.ListApis] method's response. -message ListApisResponse { - // The API resources present in the API hub. - repeated Api apis = 1; - - // A token, which can be sent as `page_token` to retrieve the next page. - // If this field is omitted, there are no subsequent pages. - string next_page_token = 2; -} - -// The [CreateVersion][google.cloud.apihub.v1.ApiHub.CreateVersion] method's -// request. -message CreateVersionRequest { - // Required. The parent resource for API version. - // Format: `projects/{project}/locations/{location}/apis/{api}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "apihub.googleapis.com/Api" } - ]; - - // Optional. The ID to use for the API version, which will become the final - // component of the version's resource name. This field is optional. - // - // * If provided, the same will be used. The service will throw an error if - // the specified id is already used by another version in the API resource. - // * If not provided, a system generated id will be used. - // - // This value should be 4-500 characters, and valid characters - // are /[a-z][A-Z][0-9]-_/. - string version_id = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Required. The version to create. - Version version = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// The [GetVersion][google.cloud.apihub.v1.ApiHub.GetVersion] method's request. -message GetVersionRequest { - // Required. The name of the API version to retrieve. - // Format: - // `projects/{project}/locations/{location}/apis/{api}/versions/{version}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "apihub.googleapis.com/Version" } - ]; -} - -// The [UpdateVersion][google.cloud.apihub.v1.ApiHub.UpdateVersion] method's -// request. -message UpdateVersionRequest { - // Required. The API version to update. - // - // The version's `name` field is used to identify the API version to update. - // Format: - // `projects/{project}/locations/{location}/apis/{api}/versions/{version}` - Version version = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The list of fields to update. - google.protobuf.FieldMask update_mask = 2 - [(google.api.field_behavior) = REQUIRED]; -} - -// The [DeleteVersion][google.cloud.apihub.v1.ApiHub.DeleteVersion] method's -// request. -message DeleteVersionRequest { - // Required. The name of the version to delete. - // Format: - // `projects/{project}/locations/{location}/apis/{api}/versions/{version}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "apihub.googleapis.com/Version" } - ]; - - // Optional. If set to true, any specs from this version will also be deleted. - // Otherwise, the request will only work if the version has no specs. - bool force = 2 [(google.api.field_behavior) = OPTIONAL]; -} - -// The [ListVersions][google.cloud.apihub.v1.ApiHub.ListVersions] method's -// request. -message ListVersionsRequest { - // Required. The parent which owns this collection of API versions i.e., the - // API resource Format: `projects/{project}/locations/{location}/apis/{api}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "apihub.googleapis.com/Version" - } - ]; - - // Optional. An expression that filters the list of Versions. - // - // A filter expression consists of a field name, a comparison - // operator, and a value for filtering. The value must be a string, a - // number, or a boolean. The comparison operator must be one of: `<`, `>` or - // `=`. Filters are not case sensitive. - // - // The following fields in the `Version` are eligible for filtering: - // - // * `display_name` - The display name of the Version. Allowed - // comparison operators: `=`. - // * `create_time` - The time at which the Version was created. The - // value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] - // format. Allowed comparison operators: `>` and `<`. - // * `lifecycle.enum_values.values.id` - The allowed value id of the - // lifecycle attribute associated with the Version. Allowed comparison - // operators: `:`. - // * `lifecycle.enum_values.values.display_name` - The allowed value display - // name of the lifecycle attribute associated with the Version. Allowed - // comparison operators: `:`. - // * `compliance.enum_values.values.id` - The allowed value id of the - // compliances attribute associated with the Version. Allowed comparison - // operators: `:`. - // * `compliance.enum_values.values.display_name` - The allowed value - // display name of the compliances attribute associated with the Version. - // Allowed comparison operators: `:`. - // * `accreditation.enum_values.values.id` - The allowed value id of the - // accreditations attribute associated with the Version. Allowed - // comparison operators: `:`. - // * `accreditation.enum_values.values.display_name` - The allowed value - // display name of the accreditations attribute associated with the Version. - // Allowed comparison operators: `:`. - // - // Expressions are combined with either `AND` logic operator or `OR` logical - // operator but not both of them together i.e. only one of the `AND` or `OR` - // operator can be used throughout the filter string and both the operators - // cannot be used together. No other logical operators are - // supported. At most three filter fields are allowed in the filter - // string and if provided more than that then `INVALID_ARGUMENT` error is - // returned by the API. - // - // Here are a few examples: - // - // * `lifecycle.enum_values.values.id: preview-id` - The filter string - // specifies that the id of the allowed value associated with the lifecycle - // attribute of the Version is _preview-id_. - // * `lifecycle.enum_values.values.display_name: \"Preview Display Name\"` - - // The filter string specifies that the display name of the allowed value - // associated with the lifecycle attribute of the Version is `Preview - // Display Name`. - // * `lifecycle.enum_values.values.id: preview-id AND create_time < - // \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - - // The id of the allowed value associated with the lifecycle attribute of - // the Version is _preview-id_ and it was created before _2021-08-15 - // 14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_. - // * `compliance.enum_values.values.id: gdpr-id OR - // compliance.enum_values.values.id: pci-dss-id` - // - The id of the allowed value associated with the compliance attribute is - // _gdpr-id_ or _pci-dss-id_. - string filter = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The maximum number of versions to return. The service may return - // fewer than this value. If unspecified, at most 50 versions will be - // returned. The maximum value is 1000; values above 1000 will be coerced to - // 1000. - int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A page token, received from a previous `ListVersions` call. - // Provide this to retrieve the subsequent page. - // - // When paginating, all other parameters (except page_size) provided to - // `ListVersions` must match the call that provided the page token. - string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; -} - -// The [ListVersions][google.cloud.apihub.v1.ApiHub.ListVersions] method's -// response. -message ListVersionsResponse { - // The versions corresponding to an API. - repeated Version versions = 1; - - // A token, which can be sent as `page_token` to retrieve the next page. - // If this field is omitted, there are no subsequent pages. - string next_page_token = 2; -} - -// The [CreateSpec][google.cloud.apihub.v1.ApiHub.CreateSpec] method's request. -message CreateSpecRequest { - // Required. The parent resource for Spec. - // Format: - // `projects/{project}/locations/{location}/apis/{api}/versions/{version}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "apihub.googleapis.com/Version" } - ]; - - // Optional. The ID to use for the spec, which will become the final component - // of the spec's resource name. This field is optional. - // - // * If provided, the same will be used. The service will throw an error if - // the specified id is already used by another spec in the API - // resource. - // * If not provided, a system generated id will be used. - // - // This value should be 4-500 characters, and valid characters - // are /[a-z][A-Z][0-9]-_/. - string spec_id = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Required. The spec to create. - Spec spec = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// The [GetSpec][google.cloud.apihub.v1.ApiHub.GetSpec] method's request. -message GetSpecRequest { - // Required. The name of the spec to retrieve. - // Format: - // `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "apihub.googleapis.com/Spec" } - ]; -} - -// The [UpdateSpec][google.cloud.apihub.v1.ApiHub.UpdateSpec] method's request. -message UpdateSpecRequest { - // Required. The spec to update. - // - // The spec's `name` field is used to identify the spec to - // update. Format: - // `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}` - Spec spec = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The list of fields to update. - google.protobuf.FieldMask update_mask = 2 - [(google.api.field_behavior) = REQUIRED]; -} - -// The [DeleteSpec][google.cloud.apihub.v1.ApiHub.DeleteSpec] method's request. -message DeleteSpecRequest { - // Required. The name of the spec to delete. - // Format: - // `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "apihub.googleapis.com/Spec" } - ]; -} - -// The [ListSpecs][ListSpecs] method's request. -message ListSpecsRequest { - // Required. The parent, which owns this collection of specs. - // Format: - // `projects/{project}/locations/{location}/apis/{api}/versions/{version}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "apihub.googleapis.com/Spec" - } - ]; - - // Optional. An expression that filters the list of Specs. - // - // A filter expression consists of a field name, a comparison - // operator, and a value for filtering. The value must be a string. The - // comparison operator must be one of: `<`, `>`, `:` or `=`. Filters are not - // case sensitive. - // - // The following fields in the `Spec` are eligible for filtering: - // - // * `display_name` - The display name of the Spec. Allowed comparison - // operators: `=`. - // * `create_time` - The time at which the Spec was created. The - // value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] - // format. Allowed comparison operators: `>` and `<`. - // * `spec_type.enum_values.values.id` - The allowed value id of the - // spec_type attribute associated with the Spec. Allowed comparison - // operators: `:`. - // * `spec_type.enum_values.values.display_name` - The allowed value display - // name of the spec_type attribute associated with the Spec. Allowed - // comparison operators: `:`. - // * `lint_response.json_values.values` - The json value of the - // lint_response attribute associated with the Spec. Allowed comparison - // operators: `:`. - // * `mime_type` - The MIME type of the Spec. Allowed comparison - // operators: `=`. - // - // Expressions are combined with either `AND` logic operator or `OR` logical - // operator but not both of them together i.e. only one of the `AND` or `OR` - // operator can be used throughout the filter string and both the operators - // cannot be used together. No other logical operators are - // supported. At most three filter fields are allowed in the filter - // string and if provided more than that then `INVALID_ARGUMENT` error is - // returned by the API. - // - // Here are a few examples: - // - // * `spec_type.enum_values.values.id: rest-id` - The filter - // string specifies that the id of the allowed value associated with the - // spec_type attribute is _rest-id_. - // * `spec_type.enum_values.values.display_name: \"Rest Display Name\"` - - // The filter string specifies that the display name of the allowed value - // associated with the spec_type attribute is `Rest Display Name`. - // * `spec_type.enum_values.values.id: grpc-id AND create_time < - // \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - - // The id of the allowed value associated with the spec_type attribute is - // _grpc-id_ and the spec was created before _2021-08-15 14:50:00 UTC_ and - // after _2021-08-10 12:00:00 UTC_. - // * `spec_type.enum_values.values.id: rest-id OR - // spec_type.enum_values.values.id: grpc-id` - // - The id of the allowed value associated with the spec_type attribute is - // _rest-id_ or _grpc-id_. - string filter = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The maximum number of specs to return. The service may return - // fewer than this value. If unspecified, at most 50 specs will be - // returned. The maximum value is 1000; values above 1000 will be coerced to - // 1000. - int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A page token, received from a previous `ListSpecs` call. - // Provide this to retrieve the subsequent page. - // - // When paginating, all other parameters provided to `ListSpecs` must - // match the call that provided the page token. - string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; -} - -// The [ListSpecs][google.cloud.apihub.v1.ApiHub.ListSpecs] method's response. -message ListSpecsResponse { - // The specs corresponding to an API. - repeated Spec specs = 1; - - // A token, which can be sent as `page_token` to retrieve the next page. - // If this field is omitted, there are no subsequent pages. - string next_page_token = 2; -} - -// The [GetSpecContents][google.cloud.apihub.v1.ApiHub.GetSpecContents] method's -// request. -message GetSpecContentsRequest { - // Required. The name of the spec whose contents need to be retrieved. - // Format: - // `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "apihub.googleapis.com/Spec" } - ]; -} - -// The [GetApiOperation][google.cloud.apihub.v1.ApiHub.GetApiOperation] method's -// request. -message GetApiOperationRequest { - // Required. The name of the operation to retrieve. - // Format: - // `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "apihub.googleapis.com/ApiOperation" - } - ]; -} - -// The [ListApiOperations][google.cloud.apihub.v1.ApiHub.ListApiOperations] -// method's request. -message ListApiOperationsRequest { - // Required. The parent which owns this collection of operations i.e., the API - // version. Format: - // `projects/{project}/locations/{location}/apis/{api}/versions/{version}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "apihub.googleapis.com/ApiOperation" - } - ]; - - // Optional. An expression that filters the list of ApiOperations. - // - // A filter expression consists of a field name, a comparison - // operator, and a value for filtering. The value must be a string or a - // boolean. The comparison operator must be one of: `<`, `>` or - // `=`. Filters are not case sensitive. - // - // The following fields in the `ApiOperation` are eligible for filtering: - // * `name` - The ApiOperation resource name. Allowed comparison - // operators: - // `=`. - // * `details.http_operation.path.path` - The http operation's complete path - // relative to server endpoint. Allowed comparison operators: `=`. - // * `details.http_operation.method` - The http operation method type. - // Allowed comparison operators: `=`. - // * `details.deprecated` - Indicates if the ApiOperation is deprecated. - // Allowed values are True / False indicating the deprycation status of the - // ApiOperation. Allowed comparison operators: `=`. - // * `create_time` - The time at which the ApiOperation was created. The - // value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] - // format. Allowed comparison operators: `>` and `<`. - // - // Expressions are combined with either `AND` logic operator or `OR` logical - // operator but not both of them together i.e. only one of the `AND` or `OR` - // operator can be used throughout the filter string and both the operators - // cannot be used together. No other logical operators are supported. At most - // three filter fields are allowed in the filter string and if provided - // more than that then `INVALID_ARGUMENT` error is returned by the API. - // - // Here are a few examples: - // - // * `details.deprecated = True` - The ApiOperation is deprecated. - // * `details.http_operation.method = GET AND create_time < - // \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - - // The method of the http operation of the ApiOperation is _GET_ and the - // spec was created before _2021-08-15 14:50:00 UTC_ and after _2021-08-10 - // 12:00:00 UTC_. - // * `details.http_operation.method = GET OR details.http_operation.method = - // POST`. - The http operation of the method of ApiOperation is _GET_ or - // _POST_. - string filter = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The maximum number of operations to return. The service may - // return fewer than this value. If unspecified, at most 50 operations will be - // returned. The maximum value is 1000; values above 1000 will be coerced to - // 1000. - int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A page token, received from a previous `ListApiOperations` call. - // Provide this to retrieve the subsequent page. - // - // When paginating, all other parameters (except page_size) provided to - // `ListApiOperations` must match the call that provided the page token. - string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; -} - -// The [ListApiOperations][google.cloud.apihub.v1.ApiHub.ListApiOperations] -// method's response. -message ListApiOperationsResponse { - // The operations corresponding to an API version. - // Only following field will be populated in the response: name, - // spec, details.deprecated, details.http_operation.path.path, - // details.http_operation.method and details.documentation.external_uri. - repeated ApiOperation api_operations = 1; - - // A token, which can be sent as `page_token` to retrieve the next page. - // If this field is omitted, there are no subsequent pages. - string next_page_token = 2; -} - -// The [GetDefinition][google.cloud.apihub.v1.ApiHub.GetDefinition] method's -// request. -message GetDefinitionRequest { - // Required. The name of the definition to retrieve. - // Format: - // `projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "apihub.googleapis.com/Definition" - } - ]; -} - -// The [CreateDeployment][google.cloud.apihub.v1.ApiHub.CreateDeployment] -// method's request. -message CreateDeploymentRequest { - // Required. The parent resource for the deployment resource. - // Format: `projects/{project}/locations/{location}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "apihub.googleapis.com/Deployment" - } - ]; - - // Optional. The ID to use for the deployment resource, which will become the - // final component of the deployment's resource name. This field is optional. - // - // * If provided, the same will be used. The service will throw an error if - // the specified id is already used by another deployment resource in the API - // hub. - // * If not provided, a system generated id will be used. - // - // This value should be 4-500 characters, and valid characters - // are /[a-z][A-Z][0-9]-_/. - string deployment_id = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Required. The deployment resource to create. - Deployment deployment = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// The [GetDeployment][google.cloud.apihub.v1.ApiHub.GetDeployment] method's -// request. -message GetDeploymentRequest { - // Required. The name of the deployment resource to retrieve. - // Format: `projects/{project}/locations/{location}/deployments/{deployment}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "apihub.googleapis.com/Deployment" - } - ]; -} - -// The [UpdateDeployment][google.cloud.apihub.v1.ApiHub.UpdateDeployment] -// method's request. -message UpdateDeploymentRequest { - // Required. The deployment resource to update. - // - // The deployment resource's `name` field is used to identify the deployment - // resource to update. - // Format: `projects/{project}/locations/{location}/deployments/{deployment}` - Deployment deployment = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The list of fields to update. - google.protobuf.FieldMask update_mask = 2 - [(google.api.field_behavior) = REQUIRED]; -} - -// The [DeleteDeployment][google.cloud.apihub.v1.ApiHub.DeleteDeployment] -// method's request. -message DeleteDeploymentRequest { - // Required. The name of the deployment resource to delete. - // Format: `projects/{project}/locations/{location}/deployments/{deployment}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "apihub.googleapis.com/Deployment" - } - ]; -} - -// The [ListDeployments][google.cloud.apihub.v1.ApiHub.ListDeployments] method's -// request. -message ListDeploymentsRequest { - // Required. The parent, which owns this collection of deployment resources. - // Format: `projects/{project}/locations/{location}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "apihub.googleapis.com/Deployment" - } - ]; - - // Optional. An expression that filters the list of Deployments. - // - // A filter expression consists of a field name, a comparison - // operator, and a value for filtering. The value must be a string. The - // comparison operator must be one of: `<`, `>` or - // `=`. Filters are not case sensitive. - // - // The following fields in the `Deployments` are eligible for filtering: - // - // * `display_name` - The display name of the Deployment. Allowed - // comparison operators: `=`. - // * `create_time` - The time at which the Deployment was created. The - // value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] - // format. Allowed comparison operators: `>` and `<`. - // * `resource_uri` - A URI to the deployment resource. Allowed - // comparison operators: `=`. - // * `api_versions` - The API versions linked to this deployment. Allowed - // comparison operators: `:`. - // * `deployment_type.enum_values.values.id` - The allowed value id of the - // deployment_type attribute associated with the Deployment. Allowed - // comparison operators: `:`. - // * `deployment_type.enum_values.values.display_name` - The allowed value - // display name of the deployment_type attribute associated with the - // Deployment. Allowed comparison operators: `:`. - // * `slo.string_values.values` -The allowed string value of the slo - // attribute associated with the deployment. Allowed comparison - // operators: `:`. - // * `environment.enum_values.values.id` - The allowed value id of the - // environment attribute associated with the deployment. Allowed - // comparison operators: `:`. - // * `environment.enum_values.values.display_name` - The allowed value - // display name of the environment attribute associated with the deployment. - // Allowed comparison operators: `:`. - // - // Expressions are combined with either `AND` logic operator or `OR` logical - // operator but not both of them together i.e. only one of the `AND` or `OR` - // operator can be used throughout the filter string and both the operators - // cannot be used together. No other logical operators are supported. At most - // three filter fields are allowed in the filter string and if provided - // more than that then `INVALID_ARGUMENT` error is returned by the API. - // - // Here are a few examples: - // - // * `environment.enum_values.values.id: staging-id` - The allowed value id - // of the environment attribute associated with the Deployment is - // _staging-id_. - // * `environment.enum_values.values.display_name: \"Staging Deployment\"` - - // The allowed value display name of the environment attribute associated - // with the Deployment is `Staging Deployment`. - // * `environment.enum_values.values.id: production-id AND create_time < - // \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - - // The allowed value id of the environment attribute associated with the - // Deployment is _production-id_ and Deployment was created before - // _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_. - // * `environment.enum_values.values.id: production-id OR - // slo.string_values.values: \"99.99%\"` - // - The allowed value id of the environment attribute Deployment is - // _production-id_ or string value of the slo attribute is _99.99%_. - string filter = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The maximum number of deployment resources to return. The service - // may return fewer than this value. If unspecified, at most 50 deployments - // will be returned. The maximum value is 1000; values above 1000 will be - // coerced to 1000. - int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A page token, received from a previous `ListDeployments` call. - // Provide this to retrieve the subsequent page. - // - // When paginating, all other parameters (except page_size) provided to - // `ListDeployments` must match the call that provided the page token. - string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; -} - -// The [ListDeployments][google.cloud.apihub.v1.ApiHub.ListDeployments] method's -// response. -message ListDeploymentsResponse { - // The deployment resources present in the API hub. - repeated Deployment deployments = 1; - - // A token, which can be sent as `page_token` to retrieve the next page. - // If this field is omitted, there are no subsequent pages. - string next_page_token = 2; -} - -// The [CreateAttribute][google.cloud.apihub.v1.ApiHub.CreateAttribute] method's -// request. -message CreateAttributeRequest { - // Required. The parent resource for Attribute. - // Format: `projects/{project}/locations/{location}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "apihub.googleapis.com/Attribute" - } - ]; - - // Optional. The ID to use for the attribute, which will become the final - // component of the attribute's resource name. This field is optional. - // - // * If provided, the same will be used. The service will throw an error if - // the specified id is already used by another attribute resource in the API - // hub. - // * If not provided, a system generated id will be used. - // - // This value should be 4-500 characters, and valid characters - // are /[a-z][A-Z][0-9]-_/. - string attribute_id = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Required. The attribute to create. - Attribute attribute = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// The [GetAttribute][google.cloud.apihub.v1.ApiHub.GetAttribute] method's -// request. -message GetAttributeRequest { - // Required. The name of the attribute to retrieve. - // Format: - // `projects/{project}/locations/{location}/attributes/{attribute}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "apihub.googleapis.com/Attribute" - } - ]; -} - -// The [UpdateAttribute][google.cloud.apihub.v1.ApiHub.UpdateAttribute] method's -// request. -message UpdateAttributeRequest { - // Required. The attribute to update. - // - // The attribute's `name` field is used to identify the attribute to update. - // Format: - // `projects/{project}/locations/{location}/attributes/{attribute}` - Attribute attribute = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The list of fields to update. - google.protobuf.FieldMask update_mask = 2 - [(google.api.field_behavior) = REQUIRED]; -} - -// The [DeleteAttribute][google.cloud.apihub.v1.ApiHub.DeleteAttribute] method's -// request. -message DeleteAttributeRequest { - // Required. The name of the attribute to delete. - // Format: - // `projects/{project}/locations/{location}/attributes/{attribute}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "apihub.googleapis.com/Attribute" - } - ]; -} - -// The [ListAttributes][google.cloud.apihub.v1.ApiHub.ListAttributes] method's -// request. -message ListAttributesRequest { - // Required. The parent resource for Attribute. - // Format: `projects/{project}/locations/{location}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "apihub.googleapis.com/Attribute" - } - ]; - - // Optional. An expression that filters the list of Attributes. - // - // A filter expression consists of a field name, a comparison - // operator, and a value for filtering. The value must be a string or a - // boolean. The comparison operator must be one of: `<`, `>` or - // `=`. Filters are not case sensitive. - // - // The following fields in the `Attribute` are eligible for filtering: - // - // * `display_name` - The display name of the Attribute. Allowed - // comparison operators: `=`. - // * `definition_type` - The definition type of the attribute. Allowed - // comparison operators: `=`. - // * `scope` - The scope of the attribute. Allowed comparison operators: - // `=`. - // * `data_type` - The type of the data of the attribute. Allowed - // comparison operators: `=`. - // * `mandatory` - Denotes whether the attribute is mandatory or not. - // Allowed comparison operators: `=`. - // * `create_time` - The time at which the Attribute was created. The - // value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] - // format. Allowed comparison operators: `>` and `<`. - // - // Expressions are combined with either `AND` logic operator or `OR` logical - // operator but not both of them together i.e. only one of the `AND` or `OR` - // operator can be used throughout the filter string and both the operators - // cannot be used together. No other logical operators are - // supported. At most three filter fields are allowed in the filter - // string and if provided more than that then `INVALID_ARGUMENT` error is - // returned by the API. - // - // Here are a few examples: - // - // * `display_name = production` - - The display name of the attribute is - // _production_. - // * `(display_name = production) AND (create_time < - // \"2021-08-15T14:50:00Z\") AND (create_time > \"2021-08-10T12:00:00Z\")` - - // The display name of the attribute is _production_ and the attribute was - // created before _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00 - // UTC_. - // * `display_name = production OR scope = api` - - // The attribute where the display name is _production_ or the scope is - // _api_. - string filter = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The maximum number of attribute resources to return. The service - // may return fewer than this value. If unspecified, at most 50 attributes - // will be returned. The maximum value is 1000; values above 1000 will be - // coerced to 1000. - int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A page token, received from a previous `ListAttributes` call. - // Provide this to retrieve the subsequent page. - // - // When paginating, all other parameters provided to `ListAttributes` must - // match the call that provided the page token. - string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; -} - -// The [ListAttributes][google.cloud.apihub.v1.ApiHub.ListAttributes] method's -// response. -message ListAttributesResponse { - // The list of all attributes. - repeated Attribute attributes = 1; - - // A token, which can be sent as `page_token` to retrieve the next page. - // If this field is omitted, there are no subsequent pages. - string next_page_token = 2; -} - -// The [SearchResources][google.cloud.apihub.v1.ApiHub.SearchResources] method's -// request. -message SearchResourcesRequest { - // Required. The resource name of the location which will be of the type - // `projects/{project_id}/locations/{location_id}`. This field is used to - // identify the instance of API-Hub in which resources should be searched. - string location = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // Required. The free text search query. This query can contain keywords which - // could be related to any detail of the API-Hub resources such display names, - // descriptions, attributes etc. - string query = 2 [(google.api.field_behavior) = REQUIRED]; - - // Optional. An expression that filters the list of search results. - // - // A filter expression consists of a field name, a comparison operator, - // and a value for filtering. The value must be a string, a number, or a - // boolean. The comparison operator must be `=`. Filters are not case - // sensitive. - // - // The following field names are eligible for filtering: - // * `resource_type` - The type of resource in the search results. - // Must be one of the following: `Api`, `ApiOperation`, `Deployment`, - // `Definition`, `Spec` or `Version`. This field can only be specified once - // in the filter. - // - // Here are is an example: - // - // * `resource_type = Api` - The resource_type is _Api_. - string filter = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The maximum number of search results to return. The service may - // return fewer than this value. If unspecified at most 10 search results will - // be returned. If value is negative then `INVALID_ARGUMENT` error is - // returned. The maximum value is 25; values above 25 will be coerced to 25. - // While paginating, you can specify a new page size parameter for each page - // of search results to be listed. - int32 page_size = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A page token, received from a previous - // [SearchResources][SearchResources] - // call. Specify this parameter to retrieve the next page of transactions. - // - // When paginating, you must specify the `page_token` parameter and all the - // other parameters except - // [page_size][google.cloud.apihub.v1.SearchResourcesRequest.page_size] - // should be specified with the same value which was used in the previous - // call. If the other fields are set with a different value than the previous - // call then `INVALID_ARGUMENT` error is returned. - string page_token = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// ApiHubResource is one of the resources such as Api, Operation, Deployment, -// Definition, Spec and Version resources stored in API-Hub. -message ApiHubResource { - oneof resource { - // This represents Api resource in search results. Only name, display_name, - // description and owner fields are populated in search results. - Api api = 1; - - // This represents ApiOperation resource in search results. Only name, - // and description fields are populated in search results. - ApiOperation operation = 2; - - // This represents Deployment resource in search results. Only name, - // display_name and description fields are populated in search results. - Deployment deployment = 3; - - // This represents Spec resource in search results. Only name, - // display_name and description fields are populated in search results. - Spec spec = 4; - - // This represents Definition resource in search results. - // Only name field is populated in search results. - Definition definition = 5; - - // This represents Version resource in search results. Only name, - // display_name and description fields are populated in search results. - Version version = 6; - } -} - -// Represents the search results. -message SearchResult { - // This represents the ApiHubResource. - // Note: Only selected fields of the resources are populated in response. - ApiHubResource resource = 1; -} - -// Response for the -// [SearchResources][google.cloud.apihub.v1.ApiHub.SearchResources] method. -message SearchResourcesResponse { - // List of search results according to the filter and search query specified. - // The order of search results represents the ranking. - repeated SearchResult search_results = 1; - - // Pass this token in the - // [SearchResourcesRequest][google.cloud.apihub.v1.SearchResourcesRequest] - // to continue to list results. If all results have been returned, this field - // is an empty string or not present in the response. - string next_page_token = 2; -} - -// The -// [CreateDependency][google.cloud.apihub.v1.ApiHubDependencies.CreateDependency] -// method's request. -message CreateDependencyRequest { - // Required. The parent resource for the dependency resource. - // Format: `projects/{project}/locations/{location}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "apihub.googleapis.com/Dependency" - } - ]; - - // Optional. The ID to use for the dependency resource, which will become the - // final component of the dependency's resource name. This field is optional. - // * If provided, the same will be used. The service will throw an error if - // duplicate id is provided by the client. - // * If not provided, a system generated id will be used. - // - // This value should be 4-500 characters, and valid characters - // are `[a-z][A-Z][0-9]-_`. - string dependency_id = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Required. The dependency resource to create. - Dependency dependency = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// The [GetDependency][.ApiHubDependencies.GetDependency] -// method's request. -message GetDependencyRequest { - // Required. The name of the dependency resource to retrieve. - // Format: `projects/{project}/locations/{location}/dependencies/{dependency}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "apihub.googleapis.com/Dependency" - } - ]; -} - -// The -// [UpdateDependency][google.cloud.apihub.v1.ApiHubDependencies.UpdateDependency] -// method's request. -message UpdateDependencyRequest { - // Required. The dependency resource to update. - // - // The dependency's `name` field is used to identify the dependency to update. - // Format: `projects/{project}/locations/{location}/dependencies/{dependency}` - Dependency dependency = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The list of fields to update. - google.protobuf.FieldMask update_mask = 2 - [(google.api.field_behavior) = REQUIRED]; -} - -// The -// [DeleteDependency][google.cloud.apihub.v1.ApiHubDependencies.DeleteDependency] -// method's request. -message DeleteDependencyRequest { - // Required. The name of the dependency resource to delete. - // Format: `projects/{project}/locations/{location}/dependencies/{dependency}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "apihub.googleapis.com/Dependency" - } - ]; -} - -// The -// [ListDependencies][google.cloud.apihub.v1.ApiHubDependencies.ListDependencies] -// method's request. -message ListDependenciesRequest { - // Required. The parent which owns this collection of dependency resources. - // Format: `projects/{project}/locations/{location}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "apihub.googleapis.com/Dependency" - } - ]; - - // Optional. An expression that filters the list of Dependencies. - // - // A filter expression consists of a field name, a comparison operator, and - // a value for filtering. The value must be a string. Allowed comparison - // operator is `=`. Filters are not case sensitive. - // - // The following fields in the `Dependency` are eligible for filtering: - // - // * `consumer.operation_resource_name` - The operation resource name for - // the consumer entity involved in a dependency. Allowed comparison - // operators: `=`. - // * `consumer.external_api_resource_name` - The external api resource name - // for the consumer entity involved in a dependency. Allowed comparison - // operators: `=`. - // * `supplier.operation_resource_name` - The operation resource name for - // the supplier entity involved in a dependency. Allowed comparison - // operators: `=`. - // * `supplier.external_api_resource_name` - The external api resource name - // for the supplier entity involved in a dependency. Allowed comparison - // operators: `=`. - // - // Expressions are combined with either `AND` logic operator or `OR` logical - // operator but not both of them together i.e. only one of the `AND` or `OR` - // operator can be used throughout the filter string and both the operators - // cannot be used together. No other logical operators are supported. At most - // three filter fields are allowed in the filter string and if provided - // more than that then `INVALID_ARGUMENT` error is returned by the API. - // - // For example, `consumer.operation_resource_name = - // \"projects/p1/locations/global/apis/a1/versions/v1/operations/o1\" OR - // supplier.operation_resource_name = - // \"projects/p1/locations/global/apis/a1/versions/v1/operations/o1\"` - The - // dependencies with either consumer or supplier operation resource name as - // _projects/p1/locations/global/apis/a1/versions/v1/operations/o1_. - string filter = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The maximum number of dependency resources to return. The service - // may return fewer than this value. If unspecified, at most 50 dependencies - // will be returned. The maximum value is 1000; values above 1000 will be - // coerced to 1000. - int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A page token, received from a previous `ListDependencies` call. - // Provide this to retrieve the subsequent page. - // - // When paginating, all other parameters provided to `ListDependencies` must - // match the call that provided the page token. - string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; -} - -// The -// [ListDependencies][google.cloud.apihub.v1.ApiHubDependencies.ListDependencies] -// method's response. -message ListDependenciesResponse { - // The dependency resources present in the API hub. - // Only following field will be populated in the response: name. - repeated Dependency dependencies = 1; - - // A token, which can be sent as `page_token` to retrieve the next page. - // If this field is omitted, there are no subsequent pages. - string next_page_token = 2; -} - -// The [CreateExternalApi][google.cloud.apihub.v1.ApiHub.CreateExternalApi] -// method's request. -message CreateExternalApiRequest { - // Required. The parent resource for the External API resource. - // Format: `projects/{project}/locations/{location}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "apihub.googleapis.com/ExternalApi" - } - ]; - - // Optional. The ID to use for the External API resource, which will become - // the final component of the External API's resource name. This field is - // optional. - // - // * If provided, the same will be used. The service will throw an error if - // the specified id is already used by another External API resource in the - // API hub. - // * If not provided, a system generated id will be used. - // - // This value should be 4-500 characters, and valid characters - // are /[a-z][A-Z][0-9]-_/. - string external_api_id = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Required. The External API resource to create. - ExternalApi external_api = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// The [GetExternalApi][google.cloud.apihub.v1.ApiHub.GetExternalApi] method's -// request. -message GetExternalApiRequest { - // Required. The name of the External API resource to retrieve. - // Format: - // `projects/{project}/locations/{location}/externalApis/{externalApi}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "apihub.googleapis.com/ExternalApi" - } - ]; -} - -// The [UpdateExternalApi][google.cloud.apihub.v1.ApiHub.UpdateExternalApi] -// method's request. -message UpdateExternalApiRequest { - // Required. The External API resource to update. - // - // The External API resource's `name` field is used to identify the External - // API resource to update. Format: - // `projects/{project}/locations/{location}/externalApis/{externalApi}` - ExternalApi external_api = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The list of fields to update. - google.protobuf.FieldMask update_mask = 2 - [(google.api.field_behavior) = REQUIRED]; -} - -// The [DeleteExternalApi][google.cloud.apihub.v1.ApiHub.DeleteExternalApi] -// method's request. -message DeleteExternalApiRequest { - // Required. The name of the External API resource to delete. - // Format: - // `projects/{project}/locations/{location}/externalApis/{externalApi}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "apihub.googleapis.com/ExternalApi" - } - ]; -} - -// The [ListExternalApis][google.cloud.apihub.v1.ApiHub.ListExternalApis] -// method's request. -message ListExternalApisRequest { - // Required. The parent, which owns this collection of External API resources. - // Format: `projects/{project}/locations/{location}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "apihub.googleapis.com/ExternalApi" - } - ]; - - // Optional. The maximum number of External API resources to return. The - // service may return fewer than this value. If unspecified, at most 50 - // ExternalApis will be returned. The maximum value is 1000; values above 1000 - // will be coerced to 1000. - int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A page token, received from a previous `ListExternalApis` call. - // Provide this to retrieve the subsequent page. - // - // When paginating, all other parameters (except page_size) provided to - // `ListExternalApis` must match the call that provided the page token. - string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; -} - -// The [ListExternalApis][google.cloud.apihub.v1.ApiHub.ListExternalApis] -// method's response. -message ListExternalApisResponse { - // The External API resources present in the API hub. - // Only following fields will be populated in the response: name, - // display_name, documentation.external_uri. - repeated ExternalApi external_apis = 1; - - // A token, which can be sent as `page_token` to retrieve the next page. - // If this field is omitted, there are no subsequent pages. - string next_page_token = 2; -} diff --git a/owl-bot-staging/google-cloud-apihub/v1/protos/google/cloud/apihub/v1/common_fields.proto b/owl-bot-staging/google-cloud-apihub/v1/protos/google/cloud/apihub/v1/common_fields.proto deleted file mode 100644 index 9d1c87f19a1..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/protos/google/cloud/apihub/v1/common_fields.proto +++ /dev/null @@ -1,1297 +0,0 @@ -// Copyright 2024 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.apihub.v1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.ApiHub.V1"; -option go_package = "cloud.google.com/go/apihub/apiv1/apihubpb;apihubpb"; -option java_multiple_files = true; -option java_outer_classname = "CommonFieldsProto"; -option java_package = "com.google.cloud.apihub.v1"; -option php_namespace = "Google\\Cloud\\ApiHub\\V1"; -option ruby_package = "Google::Cloud::ApiHub::V1"; -option (google.api.resource_definition) = { - type: "aiplatform.googleapis.com/Extension" - pattern: "projects/{project}/locations/{location}/extensions/{extension}" -}; - -// Lint state represents success or failure for linting. -enum LintState { - // Lint state unspecified. - LINT_STATE_UNSPECIFIED = 0; - - // Linting was completed successfully. - LINT_STATE_SUCCESS = 1; - - // Linting encountered errors. - LINT_STATE_ERROR = 2; -} - -// Enumeration of linter types. -enum Linter { - // Linter type unspecified. - LINTER_UNSPECIFIED = 0; - - // Linter type spectral. - SPECTRAL = 1; - - // Linter type other. - OTHER = 2; -} - -// Severity of the issue. -enum Severity { - // Severity unspecified. - SEVERITY_UNSPECIFIED = 0; - - // Severity error. - SEVERITY_ERROR = 1; - - // Severity warning. - SEVERITY_WARNING = 2; - - // Severity info. - SEVERITY_INFO = 3; - - // Severity hint. - SEVERITY_HINT = 4; -} - -// An API resource in the API Hub. -message Api { - option (google.api.resource) = { - type: "apihub.googleapis.com/Api" - pattern: "projects/{project}/locations/{location}/apis/{api}" - plural: "apis" - singular: "api" - }; - - // Identifier. The name of the API resource in the API Hub. - // - // Format: - // `projects/{project}/locations/{location}/apis/{api}` - string name = 1 [(google.api.field_behavior) = IDENTIFIER]; - - // Required. The display name of the API resource. - string display_name = 2 [(google.api.field_behavior) = REQUIRED]; - - // Optional. The description of the API resource. - string description = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The documentation for the API resource. - Documentation documentation = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Owner details for the API resource. - Owner owner = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Output only. The list of versions present in an API resource. - // Note: An API resource can be associated with more than 1 version. - // Format is - // `projects/{project}/locations/{location}/apis/{api}/versions/{version}` - repeated string versions = 6 [ - (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.resource_reference) = { type: "apihub.googleapis.com/Version" } - ]; - - // Output only. The time at which the API resource was created. - google.protobuf.Timestamp create_time = 7 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The time at which the API resource was last updated. - google.protobuf.Timestamp update_time = 8 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. The target users for the API. - // This maps to the following system defined attribute: - // `projects/{project}/locations/{location}/attributes/system-target-user` - // attribute. - // The number of values for this attribute will be based on the - // cardinality of the attribute. The same can be retrieved via GetAttribute - // API. All values should be from the list of allowed values defined for the - // attribute. - AttributeValues target_user = 9 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The team owning the API. - // This maps to the following system defined attribute: - // `projects/{project}/locations/{location}/attributes/system-team` - // attribute. - // The number of values for this attribute will be based on the - // cardinality of the attribute. The same can be retrieved via GetAttribute - // API. All values should be from the list of allowed values defined for the - // attribute. - AttributeValues team = 10 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The business unit owning the API. - // This maps to the following system defined attribute: - // `projects/{project}/locations/{location}/attributes/system-business-unit` - // attribute. - // The number of values for this attribute will be based on the - // cardinality of the attribute. The same can be retrieved via GetAttribute - // API. All values should be from the list of allowed values defined for the - // attribute. - AttributeValues business_unit = 11 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The maturity level of the API. - // This maps to the following system defined attribute: - // `projects/{project}/locations/{location}/attributes/system-maturity-level` - // attribute. - // The number of values for this attribute will be based on the - // cardinality of the attribute. The same can be retrieved via GetAttribute - // API. All values should be from the list of allowed values defined for the - // attribute. - AttributeValues maturity_level = 12 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The list of user defined attributes associated with the API - // resource. The key is the attribute name. It will be of the format: - // `projects/{project}/locations/{location}/attributes/{attribute}`. - // The value is the attribute values associated with the resource. - map attributes = 13 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The style of the API. - // This maps to the following system defined attribute: - // `projects/{project}/locations/{location}/attributes/system-api-style` - // attribute. - // The number of values for this attribute will be based on the - // cardinality of the attribute. The same can be retrieved via GetAttribute - // API. All values should be from the list of allowed values defined for the - // attribute. - AttributeValues api_style = 14 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The selected version for an API resource. - // This can be used when special handling is needed on client side for - // particular version of the API. Format is - // `projects/{project}/locations/{location}/apis/{api}/versions/{version}` - string selected_version = 15 [ - (google.api.field_behavior) = OPTIONAL, - (google.api.resource_reference) = { type: "apihub.googleapis.com/Version" } - ]; -} - -// Represents a version of the API resource in API hub. This is also referred -// to as the API version. -message Version { - option (google.api.resource) = { - type: "apihub.googleapis.com/Version" - pattern: "projects/{project}/locations/{location}/apis/{api}/versions/{version}" - plural: "versions" - singular: "version" - }; - - // Identifier. The name of the version. - // - // Format: - // `projects/{project}/locations/{location}/apis/{api}/versions/{version}` - string name = 1 [(google.api.field_behavior) = IDENTIFIER]; - - // Required. The display name of the version. - string display_name = 2 [(google.api.field_behavior) = REQUIRED]; - - // Optional. The description of the version. - string description = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The documentation of the version. - Documentation documentation = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Output only. The specs associated with this version. - // Note that an API version can be associated with multiple specs. - // Format is - // `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}` - repeated string specs = 5 [ - (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.resource_reference) = { type: "apihub.googleapis.com/Spec" } - ]; - - // Output only. The operations contained in the API version. - // These operations will be added to the version when a new spec is - // added or when an existing spec is updated. Format is - // `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}` - repeated string api_operations = 6 [ - (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.resource_reference) = { - type: "apihub.googleapis.com/ApiOperation" - } - ]; - - // Output only. The definitions contained in the API version. - // These definitions will be added to the version when a new spec is - // added or when an existing spec is updated. Format is - // `projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}` - repeated string definitions = 7 [ - (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.resource_reference) = { - type: "apihub.googleapis.com/Definition" - } - ]; - - // Optional. The deployments linked to this API version. - // Note: A particular API version could be deployed to multiple deployments - // (for dev deployment, UAT deployment, etc) - // Format is - // `projects/{project}/locations/{location}/deployments/{deployment}` - repeated string deployments = 8 [ - (google.api.field_behavior) = OPTIONAL, - (google.api.resource_reference) = { - type: "apihub.googleapis.com/Deployment" - } - ]; - - // Output only. The time at which the version was created. - google.protobuf.Timestamp create_time = 9 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The time at which the version was last updated. - google.protobuf.Timestamp update_time = 10 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. The lifecycle of the API version. - // This maps to the following system defined attribute: - // `projects/{project}/locations/{location}/attributes/system-lifecycle` - // attribute. - // The number of values for this attribute will be based on the - // cardinality of the attribute. The same can be retrieved via GetAttribute - // API. All values should be from the list of allowed values defined for the - // attribute. - AttributeValues lifecycle = 11 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The compliance associated with the API version. - // This maps to the following system defined attribute: - // `projects/{project}/locations/{location}/attributes/system-compliance` - // attribute. - // The number of values for this attribute will be based on the - // cardinality of the attribute. The same can be retrieved via GetAttribute - // API. All values should be from the list of allowed values defined for the - // attribute. - AttributeValues compliance = 12 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The accreditations associated with the API version. - // This maps to the following system defined attribute: - // `projects/{project}/locations/{location}/attributes/system-accreditation` - // attribute. - // The number of values for this attribute will be based on the - // cardinality of the attribute. The same can be retrieved via GetAttribute - // API. All values should be from the list of allowed values defined for the - // attribute. - AttributeValues accreditation = 13 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The list of user defined attributes associated with the Version - // resource. The key is the attribute name. It will be of the format: - // `projects/{project}/locations/{location}/attributes/{attribute}`. - // The value is the attribute values associated with the resource. - map attributes = 14 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The selected deployment for a Version resource. - // This can be used when special handling is needed on client side for a - // particular deployment linked to the version. - // Format is - // `projects/{project}/locations/{location}/deployments/{deployment}` - string selected_deployment = 16 [ - (google.api.field_behavior) = OPTIONAL, - (google.api.resource_reference) = { - type: "apihub.googleapis.com/Deployment" - } - ]; -} - -// Represents a spec associated with an API version in the API -// Hub. Note that specs of various types can be uploaded, however -// parsing of details is supported for OpenAPI spec currently. -message Spec { - option (google.api.resource) = { - type: "apihub.googleapis.com/Spec" - pattern: "projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}" - plural: "specs" - singular: "spec" - }; - - // Specifies the parsing mode for API specifications during creation and - // update. - // - `RELAXED`: Parsing errors in the specification content do not fail the - // API call. - // - `STRICT`: Parsing errors in the specification content result in failure - // of the API call. - // If not specified, defaults to `RELAXED`. - enum ParsingMode { - // Defaults to `RELAXED`. - PARSING_MODE_UNSPECIFIED = 0; - - // Parsing of the Spec on create and update is relaxed, meaning that - // parsing errors the spec contents will not fail the API call. - RELAXED = 1; - - // Parsing of the Spec on create and update is strict, meaning that - // parsing errors in the spec contents will fail the API call. - STRICT = 2; - } - - // Identifier. The name of the spec. - // - // Format: - // `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}` - string name = 1 [(google.api.field_behavior) = IDENTIFIER]; - - // Required. The display name of the spec. - // This can contain the file name of the spec. - string display_name = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The type of spec. - // The value should be one of the allowed values defined for - // `projects/{project}/locations/{location}/attributes/system-spec-type` - // attribute. - // The number of values for this attribute will be based on the - // cardinality of the attribute. The same can be retrieved via GetAttribute - // API. - // - // Note, this field is mandatory if content is provided. - AttributeValues spec_type = 3 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Input only. The contents of the uploaded spec. - SpecContents contents = 4 [ - (google.api.field_behavior) = OPTIONAL, - (google.api.field_behavior) = INPUT_ONLY - ]; - - // Output only. Details parsed from the spec. - SpecDetails details = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. The URI of the spec source in case file is uploaded - // from an external version control system. - string source_uri = 6 [(google.api.field_behavior) = OPTIONAL]; - - // Output only. The time at which the spec was created. - google.protobuf.Timestamp create_time = 7 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The time at which the spec was last updated. - google.protobuf.Timestamp update_time = 8 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. The lint response for the spec. - LintResponse lint_response = 9 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The list of user defined attributes associated with the spec. - // The key is the attribute name. It will be of the format: - // `projects/{project}/locations/{location}/attributes/{attribute}`. - // The value is the attribute values associated with the resource. - map attributes = 10 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The documentation of the spec. - // For OpenAPI spec, this will be populated from `externalDocs` in OpenAPI - // spec. - Documentation documentation = 11 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Input only. Enum specifying the parsing mode for OpenAPI - // Specification (OAS) parsing. - ParsingMode parsing_mode = 12 [ - (google.api.field_behavior) = OPTIONAL, - (google.api.field_behavior) = INPUT_ONLY - ]; -} - -// Details of the deployment where APIs are hosted. -// A deployment could represent an Apigee proxy, API gateway, other Google Cloud -// services or non-Google Cloud services as well. A deployment entity is a root -// level entity in the API hub and exists independent of any API. -message Deployment { - option (google.api.resource) = { - type: "apihub.googleapis.com/Deployment" - pattern: "projects/{project}/locations/{location}/deployments/{deployment}" - plural: "deployments" - singular: "deployment" - }; - - // Identifier. The name of the deployment. - // - // Format: - // `projects/{project}/locations/{location}/deployments/{deployment}` - string name = 1 [(google.api.field_behavior) = IDENTIFIER]; - - // Required. The display name of the deployment. - string display_name = 2 [(google.api.field_behavior) = REQUIRED]; - - // Optional. The description of the deployment. - string description = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The documentation of the deployment. - Documentation documentation = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Required. The type of deployment. - // This maps to the following system defined attribute: - // `projects/{project}/locations/{location}/attributes/system-deployment-type` - // attribute. - // The number of values for this attribute will be based on the - // cardinality of the attribute. The same can be retrieved via GetAttribute - // API. All values should be from the list of allowed values defined for the - // attribute. - AttributeValues deployment_type = 5 [(google.api.field_behavior) = REQUIRED]; - - // Required. A URI to the runtime resource. This URI can be used to manage the - // resource. For example, if the runtime resource is of type APIGEE_PROXY, - // then this field will contain the URI to the management UI of the proxy. - string resource_uri = 6 [(google.api.field_behavior) = REQUIRED]; - - // Required. The endpoints at which this deployment resource is listening for - // API requests. This could be a list of complete URIs, hostnames or an IP - // addresses. - repeated string endpoints = 7 [(google.api.field_behavior) = REQUIRED]; - - // Output only. The API versions linked to this deployment. - // Note: A particular deployment could be linked to multiple different API - // versions (of same or different APIs). - repeated string api_versions = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The time at which the deployment was created. - google.protobuf.Timestamp create_time = 9 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The time at which the deployment was last updated. - google.protobuf.Timestamp update_time = 10 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. The SLO for this deployment. - // This maps to the following system defined attribute: - // `projects/{project}/locations/{location}/attributes/system-slo` - // attribute. - // The number of values for this attribute will be based on the - // cardinality of the attribute. The same can be retrieved via GetAttribute - // API. All values should be from the list of allowed values defined for the - // attribute. - AttributeValues slo = 11 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The environment mapping to this deployment. - // This maps to the following system defined attribute: - // `projects/{project}/locations/{location}/attributes/system-environment` - // attribute. - // The number of values for this attribute will be based on the - // cardinality of the attribute. The same can be retrieved via GetAttribute - // API. All values should be from the list of allowed values defined for the - // attribute. - AttributeValues environment = 12 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The list of user defined attributes associated with the - // deployment resource. The key is the attribute name. It will be of the - // format: `projects/{project}/locations/{location}/attributes/{attribute}`. - // The value is the attribute values associated with the resource. - map attributes = 13 - [(google.api.field_behavior) = OPTIONAL]; -} - -// Represents an operation contained in an API version in the API Hub. -// An operation is added/updated/deleted in an API version when a new spec is -// added or an existing spec is updated/deleted in a version. -// Currently, an operation will be created only corresponding to OpenAPI spec as -// parsing is supported for OpenAPI spec. -message ApiOperation { - option (google.api.resource) = { - type: "apihub.googleapis.com/ApiOperation" - pattern: "projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}" - plural: "apiOperations" - singular: "apiOperation" - }; - - // Identifier. The name of the operation. - // - // Format: - // `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}` - string name = 1 [(google.api.field_behavior) = IDENTIFIER]; - - // Output only. The name of the spec from where the operation was parsed. - // Format is - // `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}` - string spec = 2 [ - (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.resource_reference) = { type: "apihub.googleapis.com/Spec" } - ]; - - // Output only. Operation details. - OperationDetails details = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The time at which the operation was created. - google.protobuf.Timestamp create_time = 4 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The time at which the operation was last updated. - google.protobuf.Timestamp update_time = 5 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. The list of user defined attributes associated with the API - // operation resource. The key is the attribute name. It will be of the - // format: `projects/{project}/locations/{location}/attributes/{attribute}`. - // The value is the attribute values associated with the resource. - map attributes = 6 - [(google.api.field_behavior) = OPTIONAL]; -} - -// Represents a definition for example schema, request, response definitions -// contained in an API version. -// A definition is added/updated/deleted in an API version when a new spec is -// added or an existing spec is updated/deleted in a version. Currently, -// definition will be created only corresponding to OpenAPI spec as parsing is -// supported for OpenAPI spec. Also, within OpenAPI spec, only `schema` object -// is supported. -message Definition { - option (google.api.resource) = { - type: "apihub.googleapis.com/Definition" - pattern: "projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}" - plural: "definitions" - singular: "definition" - }; - - // Enumeration of definition types. - enum Type { - // Definition type unspecified. - TYPE_UNSPECIFIED = 0; - - // Definition type schema. - SCHEMA = 1; - } - - oneof value { - // Output only. The value of a schema definition. - Schema schema = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - } - - // Identifier. The name of the definition. - // - // Format: - // `projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}` - string name = 1 [(google.api.field_behavior) = IDENTIFIER]; - - // Output only. The name of the spec from where the definition was parsed. - // Format is - // `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}` - string spec = 2 [ - (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.resource_reference) = { type: "apihub.googleapis.com/Spec" } - ]; - - // Output only. The type of the definition. - Type type = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The time at which the definition was created. - google.protobuf.Timestamp create_time = 5 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The time at which the definition was last updated. - google.protobuf.Timestamp update_time = 6 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. The list of user defined attributes associated with the - // definition resource. The key is the attribute name. It will be of the - // format: `projects/{project}/locations/{location}/attributes/{attribute}`. - // The value is the attribute values associated with the resource. - map attributes = 7 - [(google.api.field_behavior) = OPTIONAL]; -} - -// An attribute in the API Hub. -// An attribute is a name value pair which can be attached to different -// resources in the API hub based on the scope of the attribute. Attributes can -// either be pre-defined by the API Hub or created by users. -message Attribute { - option (google.api.resource) = { - type: "apihub.googleapis.com/Attribute" - pattern: "projects/{project}/locations/{location}/attributes/{attribute}" - plural: "attributes" - singular: "attribute" - }; - - // The value that can be assigned to the attribute when the data type is - // enum. - message AllowedValue { - // Required. The ID of the allowed value. - // * If provided, the same will be used. The service will throw an error if - // the specified id is already used by another allowed value in the same - // attribute resource. - // * If not provided, a system generated id derived from the display name - // will be used. In this case, the service will handle conflict resolution - // by adding a system generated suffix in case of duplicates. - // - // This value should be 4-63 characters, and valid characters - // are /[a-z][0-9]-/. - string id = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The display name of the allowed value. - string display_name = 2 [(google.api.field_behavior) = REQUIRED]; - - // Optional. The detailed description of the allowed value. - string description = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. When set to true, the allowed value cannot be updated or - // deleted by the user. It can only be true for System defined attributes. - bool immutable = 4 [(google.api.field_behavior) = OPTIONAL]; - } - - // Enumeration of attribute definition types. - enum DefinitionType { - // Attribute definition type unspecified. - DEFINITION_TYPE_UNSPECIFIED = 0; - - // The attribute is predefined by the API Hub. Note that only the list of - // allowed values can be updated in this case via UpdateAttribute method. - SYSTEM_DEFINED = 1; - - // The attribute is defined by the user. - USER_DEFINED = 2; - } - - // Enumeration for the scope of the attribute representing the resource in the - // API Hub to which the attribute can be linked. - enum Scope { - // Scope Unspecified. - SCOPE_UNSPECIFIED = 0; - - // Attribute can be linked to an API. - API = 1; - - // Attribute can be linked to an API version. - VERSION = 2; - - // Attribute can be linked to a Spec. - SPEC = 3; - - // Attribute can be linked to an API Operation. - API_OPERATION = 4; - - // Attribute can be linked to a Deployment. - DEPLOYMENT = 5; - - // Attribute can be linked to a Dependency. - DEPENDENCY = 6; - - // Attribute can be linked to a definition. - DEFINITION = 7; - - // Attribute can be linked to a ExternalAPI. - EXTERNAL_API = 8; - - // Attribute can be linked to a Plugin. - PLUGIN = 9; - } - - // Enumeration of attribute's data type. - enum DataType { - // Attribute data type unspecified. - DATA_TYPE_UNSPECIFIED = 0; - - // Attribute's value is of type enum. - ENUM = 1; - - // Attribute's value is of type json. - JSON = 2; - - // Attribute's value is of type string. - STRING = 3; - } - - // Identifier. The name of the attribute in the API Hub. - // - // Format: - // `projects/{project}/locations/{location}/attributes/{attribute}` - string name = 1 [(google.api.field_behavior) = IDENTIFIER]; - - // Required. The display name of the attribute. - string display_name = 2 [(google.api.field_behavior) = REQUIRED]; - - // Optional. The description of the attribute. - string description = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Output only. The definition type of the attribute. - DefinitionType definition_type = 4 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Required. The scope of the attribute. It represents the resource in the API - // Hub to which the attribute can be linked. - Scope scope = 5 [(google.api.field_behavior) = REQUIRED]; - - // Required. The type of the data of the attribute. - DataType data_type = 6 [(google.api.field_behavior) = REQUIRED]; - - // Optional. The list of allowed values when the attribute value is of type - // enum. This is required when the data_type of the attribute is ENUM. The - // maximum number of allowed values of an attribute will be 1000. - repeated AllowedValue allowed_values = 7 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The maximum number of values that the attribute can have when - // associated with an API Hub resource. Cardinality 1 would represent a - // single-valued attribute. It must not be less than 1 or greater than 20. If - // not specified, the cardinality would be set to 1 by default and represent a - // single-valued attribute. - int32 cardinality = 8 [(google.api.field_behavior) = OPTIONAL]; - - // Output only. When mandatory is true, the attribute is mandatory for the - // resource specified in the scope. Only System defined attributes can be - // mandatory. - bool mandatory = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The time at which the attribute was created. - google.protobuf.Timestamp create_time = 10 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The time at which the attribute was last updated. - google.protobuf.Timestamp update_time = 11 - [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// The spec contents. -message SpecContents { - // Required. The contents of the spec. - bytes contents = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The mime type of the content for example application/json, - // application/yaml, application/wsdl etc. - string mime_type = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// SpecDetails contains the details parsed from supported -// spec types. -message SpecDetails { - oneof details { - // Output only. Additional details apart from `OperationDetails` parsed from - // an OpenAPI spec. The OperationDetails parsed from the spec can be - // obtained by using - // [ListAPIOperations][google.cloud.apihub.v1.ApiHub.ListApiOperations] - // method. - OpenApiSpecDetails open_api_spec_details = 2 - [(google.api.field_behavior) = OUTPUT_ONLY]; - } - - // Output only. The description of the spec. - string description = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// OpenApiSpecDetails contains the details parsed from an OpenAPI spec in -// addition to the fields mentioned in -// [SpecDetails][google.cloud.apihub.v1.SpecDetails]. -message OpenApiSpecDetails { - // Enumeration of spec formats. - enum Format { - // SpecFile type unspecified. - FORMAT_UNSPECIFIED = 0; - - // OpenAPI Spec v2.0. - OPEN_API_SPEC_2_0 = 1; - - // OpenAPI Spec v3.0. - OPEN_API_SPEC_3_0 = 2; - - // OpenAPI Spec v3.1. - OPEN_API_SPEC_3_1 = 3; - } - - // Output only. The format of the spec. - Format format = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The version in the spec. - // This maps to `info.version` in OpenAPI spec. - string version = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Owner details for the spec. - // This maps to `info.contact` in OpenAPI spec. - Owner owner = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// The operation details parsed from the spec. -message OperationDetails { - oneof operation { - // The HTTP Operation. - HttpOperation http_operation = 4; - } - - // Output only. Description of the operation behavior. - // For OpenAPI spec, this will map to `operation.description` in the - // spec, in case description is empty, `operation.summary` will be used. - string description = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Additional external documentation for this operation. - // For OpenAPI spec, this will map to `operation.documentation` in the spec. - Documentation documentation = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. For OpenAPI spec, this will be set if `operation.deprecated`is - // marked as `true` in the spec. - bool deprecated = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// The HTTP Operation. -message HttpOperation { - // Enumeration of Method types. - enum Method { - // Method unspecified. - METHOD_UNSPECIFIED = 0; - - // Get Operation type. - GET = 1; - - // Put Operation type. - PUT = 2; - - // Post Operation type. - POST = 3; - - // Delete Operation type. - DELETE = 4; - - // Options Operation type. - OPTIONS = 5; - - // Head Operation type. - HEAD = 6; - - // Patch Operation type. - PATCH = 7; - - // Trace Operation type. - TRACE = 8; - } - - // Output only. The path details for the Operation. - Path path = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Operation method - Method method = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// The path details derived from the spec. -message Path { - // Output only. Complete path relative to server endpoint. - string path = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. A short description for the path applicable to all operations. - string description = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// The schema details derived from the spec. Currently, this entity is supported -// for OpenAPI spec only. -// For OpenAPI spec, this maps to the schema defined in -// the `definitions` section for OpenAPI 2.0 version and in -// `components.schemas` section for OpenAPI 3.0 and 3.1 version. -message Schema { - // Output only. The display name of the schema. - // This will map to the name of the schema in the spec. - string display_name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The raw value of the schema definition corresponding to the - // schema name in the spec. - bytes raw_value = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Owner details. -message Owner { - // Optional. The name of the owner. - string display_name = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Required. The email of the owner. - string email = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Documentation details. -message Documentation { - // Optional. The uri of the externally hosted documentation. - string external_uri = 1 [(google.api.field_behavior) = OPTIONAL]; -} - -// The attribute values associated with resource. -message AttributeValues { - // The attribute values of data type enum. - message EnumAttributeValues { - // Required. The attribute values in case attribute data type is enum. - repeated Attribute.AllowedValue values = 1 - [(google.api.field_behavior) = REQUIRED]; - } - - // The attribute values of data type string or JSON. - message StringAttributeValues { - // Required. The attribute values in case attribute data type is string or - // JSON. - repeated string values = 1 [(google.api.field_behavior) = REQUIRED]; - } - - // The attribute values associated with the resource. - oneof Value { - // The attribute values associated with a resource in case attribute data - // type is enum. - EnumAttributeValues enum_values = 2; - - // The attribute values associated with a resource in case attribute data - // type is string. - StringAttributeValues string_values = 3; - - // The attribute values associated with a resource in case attribute data - // type is JSON. - StringAttributeValues json_values = 4; - } - - // Output only. The name of the attribute. - // Format: projects/{project}/locations/{location}/attributes/{attribute} - string attribute = 1 [ - (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.resource_reference) = { - type: "apihub.googleapis.com/Attribute" - } - ]; -} - -// A dependency resource defined in the API hub describes a dependency directed -// from a consumer to a supplier entity. A dependency can be defined between two -// [Operations][google.cloud.apihub.v1.Operation] or between -// an [Operation][google.cloud.apihub.v1.Operation] and [External -// API][google.cloud.apihub.v1.ExternalApi]. -message Dependency { - option (google.api.resource) = { - type: "apihub.googleapis.com/Dependency" - pattern: "projects/{project}/locations/{location}/dependencies/{dependency}" - plural: "dependencies" - singular: "dependency" - }; - - // Possible states for a dependency. - enum State { - // Default value. This value is unused. - STATE_UNSPECIFIED = 0; - - // Dependency will be in a proposed state when it is newly identified by the - // API hub on its own. - PROPOSED = 1; - - // Dependency will be in a validated state when it is validated by the - // admin or manually created in the API hub. - VALIDATED = 2; - } - - // Possible modes of discovering the dependency. - enum DiscoveryMode { - // Default value. This value is unused. - DISCOVERY_MODE_UNSPECIFIED = 0; - - // Manual mode of discovery when the dependency is defined by the user. - MANUAL = 1; - } - - // Identifier. The name of the dependency in the API Hub. - // - // Format: `projects/{project}/locations/{location}/dependencies/{dependency}` - string name = 1 [(google.api.field_behavior) = IDENTIFIER]; - - // Required. Immutable. The entity acting as the consumer in the dependency. - DependencyEntityReference consumer = 2 [ - (google.api.field_behavior) = IMMUTABLE, - (google.api.field_behavior) = REQUIRED - ]; - - // Required. Immutable. The entity acting as the supplier in the dependency. - DependencyEntityReference supplier = 3 [ - (google.api.field_behavior) = IMMUTABLE, - (google.api.field_behavior) = REQUIRED - ]; - - // Output only. State of the dependency. - State state = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. Human readable description corresponding of the dependency. - string description = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Output only. Discovery mode of the dependency. - DiscoveryMode discovery_mode = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Error details of a dependency if the system has detected it - // internally. - DependencyErrorDetail error_detail = 7 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The time at which the dependency was created. - google.protobuf.Timestamp create_time = 8 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The time at which the dependency was last updated. - google.protobuf.Timestamp update_time = 9 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. The list of user defined attributes associated with the - // dependency resource. The key is the attribute name. It will be of the - // format: `projects/{project}/locations/{location}/attributes/{attribute}`. - // The value is the attribute values associated with the resource. - map attributes = 10 - [(google.api.field_behavior) = OPTIONAL]; -} - -// Reference to an entity participating in a dependency. -message DependencyEntityReference { - // Required. Unique identifier for the participating entity. - oneof identifier { - // The resource name of an operation in the API Hub. - // - // Format: - // `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}` - string operation_resource_name = 2; - - // The resource name of an external API in the API Hub. - // - // Format: - // `projects/{project}/locations/{location}/externalApis/{external_api}` - string external_api_resource_name = 3; - } - - // Output only. Display name of the entity. - string display_name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Details describing error condition of a dependency. -message DependencyErrorDetail { - // Possible values representing an error in the dependency. - enum Error { - // Default value used for no error in the dependency. - ERROR_UNSPECIFIED = 0; - - // Supplier entity has been deleted. - SUPPLIER_NOT_FOUND = 1; - - // Supplier entity has been recreated. - SUPPLIER_RECREATED = 2; - } - - // Optional. Error in the dependency. - Error error = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Timestamp at which the error was found. - google.protobuf.Timestamp error_time = 2 - [(google.api.field_behavior) = OPTIONAL]; -} - -// LintResponse contains the response from the linter. -message LintResponse { - // Count of issues with a given severity. - message SummaryEntry { - // Required. Severity of the issue. - Severity severity = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. Count of issues with the given severity. - int32 count = 2 [(google.api.field_behavior) = REQUIRED]; - } - - // Optional. Array of issues found in the analyzed document. - repeated Issue issues = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Summary of all issue types and counts for each severity level. - repeated SummaryEntry summary = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Required. Lint state represents success or failure for linting. - LintState state = 3 [(google.api.field_behavior) = REQUIRED]; - - // Required. Name of the linting application. - string source = 4 [(google.api.field_behavior) = REQUIRED]; - - // Required. Name of the linter used. - Linter linter = 5 [(google.api.field_behavior) = REQUIRED]; - - // Required. Timestamp when the linting response was generated. - google.protobuf.Timestamp create_time = 6 - [(google.api.field_behavior) = REQUIRED]; -} - -// Issue contains the details of a single issue found by the linter. -message Issue { - // Required. Rule code unique to each rule defined in linter. - string code = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. An array of strings indicating the location in the analyzed - // document where the rule was triggered. - repeated string path = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. Human-readable message describing the issue found by the linter. - string message = 3 [(google.api.field_behavior) = REQUIRED]; - - // Required. Severity level of the rule violation. - Severity severity = 4 [(google.api.field_behavior) = REQUIRED]; - - // Required. Object describing where in the file the issue was found. - Range range = 5 [(google.api.field_behavior) = REQUIRED]; -} - -// Object describing where in the file the issue was found. -message Range { - // Required. Start of the issue. - Point start = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. End of the issue. - Point end = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Point within the file (line and character). -message Point { - // Required. Line number (zero-indexed). - int32 line = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. Character position within the line (zero-indexed). - int32 character = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// 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 been cancelled successfully - // 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]; -} - -// An ApiHubInstance represents the instance resources of the API Hub. -// Currently, only one ApiHub instance is allowed for each project. -message ApiHubInstance { - option (google.api.resource) = { - type: "apihub.googleapis.com/ApiHubInstance" - pattern: "projects/{project}/locations/{location}/apiHubInstances/{api_hub_instance}" - plural: "apiHubInstances" - singular: "apiHubInstance" - }; - - // Available configurations to provision an ApiHub Instance. - message Config { - // Required. The Customer Managed Encryption Key (CMEK) used for data - // encryption. The CMEK name should follow the format of - // `projects/([^/]+)/locations/([^/]+)/keyRings/([^/]+)/cryptoKeys/([^/]+)`, - // where the location must match the instance location. - string cmek_key_name = 1 [(google.api.field_behavior) = REQUIRED]; - } - - // State of the ApiHub Instance. - enum State { - // The default value. This value is used if the state is omitted. - STATE_UNSPECIFIED = 0; - - // The ApiHub instance has not been initialized or has been deleted. - INACTIVE = 1; - - // The ApiHub instance is being created. - CREATING = 2; - - // The ApiHub instance has been created and is ready for use. - ACTIVE = 3; - - // The ApiHub instance is being updated. - UPDATING = 4; - - // The ApiHub instance is being deleted. - DELETING = 5; - - // The ApiHub instance encountered an error during a state change. - FAILED = 6; - } - - // Identifier. Format: - // `projects/{project}/locations/{location}/apiHubInstances/{apiHubInstance}`. - string name = 1 [(google.api.field_behavior) = IDENTIFIER]; - - // Output only. Creation timestamp. - google.protobuf.Timestamp create_time = 2 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Last update timestamp. - google.protobuf.Timestamp update_time = 3 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The current state of the ApiHub instance. - State state = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Extra information about ApiHub instance state. Currently the - // message would be populated when state is `FAILED`. - string state_message = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Required. Config of the ApiHub instance. - Config config = 6 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Instance 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 = 7 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Description of the ApiHub instance. - string description = 8 [(google.api.field_behavior) = OPTIONAL]; -} - -// An external API represents an API being provided by external sources. This -// can be used to model third-party APIs and can be used to define dependencies. -message ExternalApi { - option (google.api.resource) = { - type: "apihub.googleapis.com/ExternalApi" - pattern: "projects/{project}/locations/{location}/externalApis/{external_api}" - plural: "externalApis" - singular: "externalApi" - }; - - // Identifier. Format: - // `projects/{project}/locations/{location}/externalApi/{externalApi}`. - string name = 1 [(google.api.field_behavior) = IDENTIFIER]; - - // Required. Display name of the external API. Max length is 63 characters - // (Unicode Code Points). - string display_name = 2 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Description of the external API. Max length is 2000 characters - // (Unicode Code Points). - string description = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. List of endpoints on which this API is accessible. - repeated string endpoints = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. List of paths served by this API. - repeated string paths = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Documentation of the external API. - Documentation documentation = 6 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The list of user defined attributes associated with the Version - // resource. The key is the attribute name. It will be of the format: - // `projects/{project}/locations/{location}/attributes/{attribute}`. - // The value is the attribute values associated with the resource. - map attributes = 7 - [(google.api.field_behavior) = OPTIONAL]; - - // Output only. Creation timestamp. - google.protobuf.Timestamp create_time = 8 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Last update timestamp. - google.protobuf.Timestamp update_time = 9 - [(google.api.field_behavior) = OUTPUT_ONLY]; -} diff --git a/owl-bot-staging/google-cloud-apihub/v1/protos/google/cloud/apihub/v1/host_project_registration_service.proto b/owl-bot-staging/google-cloud-apihub/v1/protos/google/cloud/apihub/v1/host_project_registration_service.proto deleted file mode 100644 index 2f9f370c870..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/protos/google/cloud/apihub/v1/host_project_registration_service.proto +++ /dev/null @@ -1,207 +0,0 @@ -// Copyright 2024 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.apihub.v1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.ApiHub.V1"; -option go_package = "cloud.google.com/go/apihub/apiv1/apihubpb;apihubpb"; -option java_multiple_files = true; -option java_outer_classname = "HostProjectRegistrationServiceProto"; -option java_package = "com.google.cloud.apihub.v1"; -option php_namespace = "Google\\Cloud\\ApiHub\\V1"; -option ruby_package = "Google::Cloud::ApiHub::V1"; - -// This service is used for managing the host project registrations. -service HostProjectRegistrationService { - option (google.api.default_host) = "apihub.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform"; - - // Create a host project registration. - // A Google cloud project can be registered as a host project if it is not - // attached as a runtime project to another host project. - // A project can be registered as a host project only once. Subsequent - // register calls for the same project will fail. - rpc CreateHostProjectRegistration(CreateHostProjectRegistrationRequest) - returns (HostProjectRegistration) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*}/hostProjectRegistrations" - body: "host_project_registration" - }; - option (google.api.method_signature) = - "parent,host_project_registration,host_project_registration_id"; - } - - // Get a host project registration. - rpc GetHostProjectRegistration(GetHostProjectRegistrationRequest) - returns (HostProjectRegistration) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/hostProjectRegistrations/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists host project registrations. - rpc ListHostProjectRegistrations(ListHostProjectRegistrationsRequest) - returns (ListHostProjectRegistrationsResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*}/hostProjectRegistrations" - }; - option (google.api.method_signature) = "parent"; - } -} - -// The -// [CreateHostProjectRegistration][google.cloud.apihub.v1.HostProjectRegistrationService.CreateHostProjectRegistration] -// method's request. -message CreateHostProjectRegistrationRequest { - // Required. The parent resource for the host project. - // Format: `projects/{project}/locations/{location}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "apihub.googleapis.com/HostProjectRegistration" - } - ]; - - // Required. The ID to use for the Host Project Registration, which will - // become the final component of the host project registration's resource - // name. The ID must be the same as the Google cloud project specified in the - // host_project_registration.gcp_project field. - string host_project_registration_id = 2 - [(google.api.field_behavior) = REQUIRED]; - - // Required. The host project registration to register. - HostProjectRegistration host_project_registration = 3 - [(google.api.field_behavior) = REQUIRED]; -} - -// The -// [GetHostProjectRegistration][google.cloud.apihub.v1.HostProjectRegistrationService.GetHostProjectRegistration] -// method's request. -message GetHostProjectRegistrationRequest { - // Required. Host project registration resource name. - // projects/{project}/locations/{location}/hostProjectRegistrations/{host_project_registration_id} - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "apihub.googleapis.com/HostProjectRegistration" - } - ]; -} - -// The -// [ListHostProjectRegistrations][google.cloud.apihub.v1.HostProjectRegistrationService.ListHostProjectRegistrations] -// method's request. -message ListHostProjectRegistrationsRequest { - // Required. The parent, which owns this collection of host projects. - // Format: `projects/*/locations/*` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "apihub.googleapis.com/HostProjectRegistration" - } - ]; - - // Optional. The maximum number of host project registrations to return. The - // service may return fewer than this value. If unspecified, at most 50 host - // project registrations will be returned. The maximum value is 1000; values - // above 1000 will be coerced to 1000. - int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A page token, received from a previous - // `ListHostProjectRegistrations` call. Provide this to retrieve the - // subsequent page. - // - // When paginating, all other parameters (except page_size) provided to - // `ListHostProjectRegistrations` must match the call that provided the page - // token. - string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. An expression that filters the list of HostProjectRegistrations. - // - // A filter expression consists of a field name, a comparison - // operator, and a value for filtering. The value must be a string. All - // standard operators as documented at https://google.aip.dev/160 are - // supported. - // - // The following fields in the `HostProjectRegistration` are eligible for - // filtering: - // - // * `name` - The name of the HostProjectRegistration. - // * `create_time` - The time at which the HostProjectRegistration was - // created. The value should be in the - // (RFC3339)[https://tools.ietf.org/html/rfc3339] format. - // * `gcp_project` - The Google cloud project associated with the - // HostProjectRegistration. - string filter = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Hint for how to order the results. - string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// The -// [ListHostProjectRegistrations][google.cloud.apihub.v1.HostProjectRegistrationService.ListHostProjectRegistrations] -// method's response. -message ListHostProjectRegistrationsResponse { - // The list of host project registrations. - repeated HostProjectRegistration host_project_registrations = 1; - - // A token, which can be sent as `page_token` to retrieve the next page. - // If this field is omitted, there are no subsequent pages. - string next_page_token = 2; -} - -// Host project registration refers to the registration of a Google cloud -// project with Api Hub as a host project. This is the project where Api Hub is -// provisioned. It acts as the consumer project for the Api Hub instance -// provisioned. Multiple runtime projects can be attached to the host project -// and these attachments define the scope of Api Hub. -message HostProjectRegistration { - option (google.api.resource) = { - type: "apihub.googleapis.com/HostProjectRegistration" - pattern: "projects/{project}/locations/{location}/hostProjectRegistrations/{host_project_registration}" - plural: "hostProjectRegistrations" - singular: "hostProjectRegistration" - }; - - // Identifier. The name of the host project registration. - // Format: - // "projects/{project}/locations/{location}/hostProjectRegistrations/{host_project_registration}". - string name = 1 [(google.api.field_behavior) = IDENTIFIER]; - - // Required. Immutable. Google cloud project name in the format: - // "projects/abc" or "projects/123". As input, project name with either - // project id or number are accepted. As output, this field will contain - // project number. - string gcp_project = 2 [ - (google.api.field_behavior) = REQUIRED, - (google.api.field_behavior) = IMMUTABLE, - (google.api.resource_reference) = { - type: "cloudresourcemanager.googleapis.com/Project" - } - ]; - - // Output only. The time at which the host project registration was created. - google.protobuf.Timestamp create_time = 3 - [(google.api.field_behavior) = OUTPUT_ONLY]; -} diff --git a/owl-bot-staging/google-cloud-apihub/v1/protos/google/cloud/apihub/v1/linting_service.proto b/owl-bot-staging/google-cloud-apihub/v1/protos/google/cloud/apihub/v1/linting_service.proto deleted file mode 100644 index 9001c551a40..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/protos/google/cloud/apihub/v1/linting_service.proto +++ /dev/null @@ -1,159 +0,0 @@ -// Copyright 2024 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.apihub.v1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/apihub/v1/common_fields.proto"; -import "google/protobuf/empty.proto"; -import "google/protobuf/field_mask.proto"; - -option csharp_namespace = "Google.Cloud.ApiHub.V1"; -option go_package = "cloud.google.com/go/apihub/apiv1/apihubpb;apihubpb"; -option java_multiple_files = true; -option java_outer_classname = "LintingServiceProto"; -option java_package = "com.google.cloud.apihub.v1"; -option php_namespace = "Google\\Cloud\\ApiHub\\V1"; -option ruby_package = "Google::Cloud::ApiHub::V1"; - -// This service provides all methods related to the 1p Linter. -service LintingService { - option (google.api.default_host) = "apihub.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform"; - - // Get the style guide being used for linting. - rpc GetStyleGuide(GetStyleGuideRequest) returns (StyleGuide) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/plugins/*/styleGuide}" - }; - option (google.api.method_signature) = "name"; - } - - // Update the styleGuide to be used for liniting in by API hub. - rpc UpdateStyleGuide(UpdateStyleGuideRequest) returns (StyleGuide) { - option (google.api.http) = { - patch: "/v1/{style_guide.name=projects/*/locations/*/plugins/*/styleGuide}" - body: "style_guide" - }; - option (google.api.method_signature) = "style_guide,update_mask"; - } - - // Get the contents of the style guide. - rpc GetStyleGuideContents(GetStyleGuideContentsRequest) - returns (StyleGuideContents) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/plugins/*/styleGuide}:contents" - }; - option (google.api.method_signature) = "name"; - } - - // Lints the requested spec and updates the corresponding API Spec with the - // lint response. This lint response will be available in all subsequent - // Get and List Spec calls to Core service. - rpc LintSpec(LintSpecRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*}:lint" - body: "*" - }; - } -} - -// The [GetStyleGuide][ApiHub.GetStyleGuide] method's request. -message GetStyleGuideRequest { - // Required. The name of the spec to retrieve. - // Format: - // `projects/{project}/locations/{location}/plugins/{plugin}/styleGuide`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "apihub.googleapis.com/StyleGuide" - } - ]; -} - -// The [UpdateStyleGuide][ApiHub.UpdateStyleGuide] method's request. -message UpdateStyleGuideRequest { - // Required. The Style guide resource to update. - StyleGuide style_guide = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. The list of fields to update. - google.protobuf.FieldMask update_mask = 2 - [(google.api.field_behavior) = OPTIONAL]; -} - -// The [GetStyleGuideContents][ApiHub.GetStyleGuideContents] method's request. -message GetStyleGuideContentsRequest { - // Required. The name of the StyleGuide whose contents need to be retrieved. - // There is exactly one style guide resource per project per location. - // The expected format is - // `projects/{project}/locations/{location}/plugins/{plugin}/styleGuide`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "apihub.googleapis.com/StyleGuide" - } - ]; -} - -// The [LintSpec][ApiHub.LintSpec] method's request. -message LintSpecRequest { - // Required. The name of the spec to be linted. - // Format: - // `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "apihub.googleapis.com/Spec" } - ]; -} - -// The style guide contents. -message StyleGuideContents { - // Required. The contents of the style guide. - bytes contents = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The mime type of the content. - string mime_type = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Represents a singleton style guide resource to be used for linting Open API -// specs. -message StyleGuide { - option (google.api.resource) = { - type: "apihub.googleapis.com/StyleGuide" - pattern: "projects/{project}/locations/{location}/plugins/{plugin}/styleGuide" - plural: "styleGuides" - singular: "styleGuide" - }; - - // Identifier. The name of the style guide. - // - // Format: - // `projects/{project}/locations/{location}/plugins/{plugin}/styleGuide` - string name = 1 [(google.api.field_behavior) = IDENTIFIER]; - - // Required. Target linter for the style guide. - Linter linter = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. Input only. The contents of the uploaded style guide. - StyleGuideContents contents = 3 [ - (google.api.field_behavior) = REQUIRED, - (google.api.field_behavior) = INPUT_ONLY - ]; -} diff --git a/owl-bot-staging/google-cloud-apihub/v1/protos/google/cloud/apihub/v1/plugin_service.proto b/owl-bot-staging/google-cloud-apihub/v1/protos/google/cloud/apihub/v1/plugin_service.proto deleted file mode 100644 index 233c0669af0..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/protos/google/cloud/apihub/v1/plugin_service.proto +++ /dev/null @@ -1,148 +0,0 @@ -// Copyright 2024 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.apihub.v1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/apihub/v1/common_fields.proto"; - -option csharp_namespace = "Google.Cloud.ApiHub.V1"; -option go_package = "cloud.google.com/go/apihub/apiv1/apihubpb;apihubpb"; -option java_multiple_files = true; -option java_outer_classname = "PluginServiceProto"; -option java_package = "com.google.cloud.apihub.v1"; -option php_namespace = "Google\\Cloud\\ApiHub\\V1"; -option ruby_package = "Google::Cloud::ApiHub::V1"; - -// This service is used for managing plugins inside the API Hub. -service ApiHubPlugin { - option (google.api.default_host) = "apihub.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform"; - - // Get details about an API Hub plugin. - rpc GetPlugin(GetPluginRequest) returns (Plugin) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/plugins/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Enables a plugin. - // The `state` of the plugin after enabling is `ENABLED` - rpc EnablePlugin(EnablePluginRequest) returns (Plugin) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/plugins/*}:enable" - body: "*" - }; - option (google.api.method_signature) = "name"; - } - - // Disables a plugin. - // The `state` of the plugin after disabling is `DISABLED` - rpc DisablePlugin(DisablePluginRequest) returns (Plugin) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/plugins/*}:disable" - body: "*" - }; - option (google.api.method_signature) = "name"; - } -} - -// A plugin resource in the API Hub. -message Plugin { - option (google.api.resource) = { - type: "apihub.googleapis.com/Plugin" - pattern: "projects/{project}/locations/{location}/plugins/{plugin}" - plural: "plugins" - singular: "plugin" - }; - - // Possible states a plugin can have. Note that this enum may receive new - // values in the future. Consumers are advised to always code against the - // enum values expecting new states can be added later on. - enum State { - // The default value. This value is used if the state is omitted. - STATE_UNSPECIFIED = 0; - - // The plugin is enabled. - ENABLED = 1; - - // The plugin is disabled. - DISABLED = 2; - } - - // Identifier. The name of the plugin. - // Format: `projects/{project}/locations/{location}/plugins/{plugin}` - string name = 1 [(google.api.field_behavior) = IDENTIFIER]; - - // Required. The display name of the plugin. Max length is 50 characters - // (Unicode code points). - string display_name = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The type of the API. - // This maps to the following system defined attribute: - // `projects/{project}/locations/{location}/attributes/system-plugin-type` - // attribute. - // The number of allowed values for this attribute will be based on the - // cardinality of the attribute. The same can be retrieved via GetAttribute - // API. All values should be from the list of allowed values defined for the - // attribute. - AttributeValues type = 3 [(google.api.field_behavior) = REQUIRED]; - - // Optional. The plugin description. Max length is 2000 characters (Unicode - // code points). - string description = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Output only. Represents the state of the plugin. - State state = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// The [GetPlugin][google.cloud.apihub.v1.ApiHubPlugin.GetPlugin] method's -// request. -message GetPluginRequest { - // Required. The name of the plugin to retrieve. - // Format: `projects/{project}/locations/{location}/plugins/{plugin}`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "apihub.googleapis.com/Plugin" } - ]; -} - -// The [EnablePlugin][google.cloud.apihub.v1.ApiHubPlugin.EnablePlugin] method's -// request. -message EnablePluginRequest { - // Required. The name of the plugin to enable. - // Format: `projects/{project}/locations/{location}/plugins/{plugin}`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "apihub.googleapis.com/Plugin" } - ]; -} - -// The [DisablePlugin][google.cloud.apihub.v1.ApiHubPlugin.DisablePlugin] -// method's request. -message DisablePluginRequest { - // Required. The name of the plugin to disable. - // Format: `projects/{project}/locations/{location}/plugins/{plugin}`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "apihub.googleapis.com/Plugin" } - ]; -} diff --git a/owl-bot-staging/google-cloud-apihub/v1/protos/google/cloud/apihub/v1/provisioning_service.proto b/owl-bot-staging/google-cloud-apihub/v1/protos/google/cloud/apihub/v1/provisioning_service.proto deleted file mode 100644 index 2bf39fab779..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/protos/google/cloud/apihub/v1/provisioning_service.proto +++ /dev/null @@ -1,136 +0,0 @@ -// Copyright 2024 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.apihub.v1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/apihub/v1/common_fields.proto"; -import "google/longrunning/operations.proto"; - -option csharp_namespace = "Google.Cloud.ApiHub.V1"; -option go_package = "cloud.google.com/go/apihub/apiv1/apihubpb;apihubpb"; -option java_multiple_files = true; -option java_outer_classname = "ProvisioningServiceProto"; -option java_package = "com.google.cloud.apihub.v1"; -option php_namespace = "Google\\Cloud\\ApiHub\\V1"; -option ruby_package = "Google::Cloud::ApiHub::V1"; - -// This service is used for managing the data plane provisioning of the API hub. -service Provisioning { - option (google.api.default_host) = "apihub.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform"; - - // Provisions instance resources for the API Hub. - rpc CreateApiHubInstance(CreateApiHubInstanceRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*}/apiHubInstances" - body: "api_hub_instance" - }; - option (google.api.method_signature) = - "parent,api_hub_instance,api_hub_instance_id"; - option (google.longrunning.operation_info) = { - response_type: "ApiHubInstance" - metadata_type: "OperationMetadata" - }; - } - - // Gets details of a single API Hub instance. - rpc GetApiHubInstance(GetApiHubInstanceRequest) returns (ApiHubInstance) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/apiHubInstances/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Looks up an Api Hub instance in a given GCP project. There will always be - // only one Api Hub instance for a GCP project across all locations. - rpc LookupApiHubInstance(LookupApiHubInstanceRequest) - returns (LookupApiHubInstanceResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*}/apiHubInstances:lookup" - }; - option (google.api.method_signature) = "parent"; - } -} - -// The -// [CreateApiHubInstance][google.cloud.apihub.v1.Provisioning.CreateApiHubInstance] -// method's request. -message CreateApiHubInstanceRequest { - // Required. The parent resource for the Api Hub instance resource. - // Format: `projects/{project}/locations/{location}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // Optional. Identifier to assign to the Api Hub instance. Must be unique - // within scope of the parent resource. If the field is not provided, system - // generated id will be used. - // - // This value should be 4-40 characters, and valid characters - // are `/[a-z][A-Z][0-9]-_/`. - string api_hub_instance_id = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Required. The ApiHub instance. - ApiHubInstance api_hub_instance = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// The -// [GetApiHubInstance][google.cloud.apihub.v1.Provisioning.GetApiHubInstance] -// method's request. -message GetApiHubInstanceRequest { - // Required. The name of the Api Hub instance to retrieve. - // Format: - // `projects/{project}/locations/{location}/apiHubInstances/{apiHubInstance}`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "apihub.googleapis.com/ApiHubInstance" - } - ]; -} - -// The -// [LookupApiHubInstance][google.cloud.apihub.v1.Provisioning.LookupApiHubInstance] -// method's request. -message LookupApiHubInstanceRequest { - // Required. There will always be only one Api Hub instance for a GCP project - // across all locations. - // The parent resource for the Api Hub instance resource. - // Format: `projects/{project}/locations/{location}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "apihub.googleapis.com/ApiHubInstance" - } - ]; -} - -// The -// [LookupApiHubInstance][google.cloud.apihub.v1.Provisioning.LookupApiHubInstance] -// method's response.` -message LookupApiHubInstanceResponse { - // API Hub instance for a project if it exists, empty otherwise. - ApiHubInstance api_hub_instance = 1; -} diff --git a/owl-bot-staging/google-cloud-apihub/v1/protos/google/cloud/apihub/v1/runtime_project_attachment_service.proto b/owl-bot-staging/google-cloud-apihub/v1/protos/google/cloud/apihub/v1/runtime_project_attachment_service.proto deleted file mode 100644 index 71c361c028a..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/protos/google/cloud/apihub/v1/runtime_project_attachment_service.proto +++ /dev/null @@ -1,261 +0,0 @@ -// Copyright 2024 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.apihub.v1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/protobuf/empty.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.ApiHub.V1"; -option go_package = "cloud.google.com/go/apihub/apiv1/apihubpb;apihubpb"; -option java_multiple_files = true; -option java_outer_classname = "RuntimeProjectAttachmentServiceProto"; -option java_package = "com.google.cloud.apihub.v1"; -option php_namespace = "Google\\Cloud\\ApiHub\\V1"; -option ruby_package = "Google::Cloud::ApiHub::V1"; - -// This service is used for managing the runtime project attachments. -service RuntimeProjectAttachmentService { - option (google.api.default_host) = "apihub.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform"; - - // Attaches a runtime project to the host project. - rpc CreateRuntimeProjectAttachment(CreateRuntimeProjectAttachmentRequest) - returns (RuntimeProjectAttachment) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*}/runtimeProjectAttachments" - body: "runtime_project_attachment" - }; - option (google.api.method_signature) = - "parent,runtime_project_attachment,runtime_project_attachment_id"; - } - - // Gets a runtime project attachment. - rpc GetRuntimeProjectAttachment(GetRuntimeProjectAttachmentRequest) - returns (RuntimeProjectAttachment) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/runtimeProjectAttachments/*}" - }; - option (google.api.method_signature) = "name"; - } - - // List runtime projects attached to the host project. - rpc ListRuntimeProjectAttachments(ListRuntimeProjectAttachmentsRequest) - returns (ListRuntimeProjectAttachmentsResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*}/runtimeProjectAttachments" - }; - option (google.api.method_signature) = "parent"; - } - - // Delete a runtime project attachment in the API Hub. This call will detach - // the runtime project from the host project. - rpc DeleteRuntimeProjectAttachment(DeleteRuntimeProjectAttachmentRequest) - returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/locations/*/runtimeProjectAttachments/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Look up a runtime project attachment. This API can be called in the context - // of any project. - rpc LookupRuntimeProjectAttachment(LookupRuntimeProjectAttachmentRequest) - returns (LookupRuntimeProjectAttachmentResponse) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*}:lookupRuntimeProjectAttachment" - }; - option (google.api.method_signature) = "name"; - } -} - -// The -// [CreateRuntimeProjectAttachment][google.cloud.apihub.v1.RuntimeProjectAttachmentService.CreateRuntimeProjectAttachment] -// method's request. -message CreateRuntimeProjectAttachmentRequest { - // Required. The parent resource for the Runtime Project Attachment. - // Format: `projects/{project}/locations/{location}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "apihub.googleapis.com/RuntimeProjectAttachment" - } - ]; - - // Required. The ID to use for the Runtime Project Attachment, which will - // become the final component of the Runtime Project Attachment's name. The ID - // must be the same as the project ID of the Google cloud project specified in - // the runtime_project_attachment.runtime_project field. - string runtime_project_attachment_id = 2 - [(google.api.field_behavior) = REQUIRED]; - - // Required. The Runtime Project Attachment to create. - RuntimeProjectAttachment runtime_project_attachment = 3 - [(google.api.field_behavior) = REQUIRED]; -} - -// The -// [GetRuntimeProjectAttachment][google.cloud.apihub.v1.RuntimeProjectAttachmentService.GetRuntimeProjectAttachment] -// method's request. -message GetRuntimeProjectAttachmentRequest { - // Required. The name of the API resource to retrieve. - // Format: - // `projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "apihub.googleapis.com/RuntimeProjectAttachment" - } - ]; -} - -// The -// [ListRuntimeProjectAttachments][google.cloud.apihub.v1.RuntimeProjectAttachmentService.ListRuntimeProjectAttachments] -// method's request. -message ListRuntimeProjectAttachmentsRequest { - // Required. The parent, which owns this collection of runtime project - // attachments. Format: `projects/{project}/locations/{location}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "apihub.googleapis.com/RuntimeProjectAttachment" - } - ]; - - // Optional. The maximum number of runtime project attachments to return. The - // service may return fewer than this value. If unspecified, at most 50 - // runtime project attachments will be returned. The maximum value is 1000; - // values above 1000 will be coerced to 1000. - int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A page token, received from a previous - // `ListRuntimeProjectAttachments` call. Provide this to retrieve the - // subsequent page. - // - // When paginating, all other parameters (except page_size) provided to - // `ListRuntimeProjectAttachments` must match the call that provided the page - // token. - string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. An expression that filters the list of RuntimeProjectAttachments. - // - // A filter expression consists of a field name, a comparison - // operator, and a value for filtering. The value must be a string. All - // standard operators as documented at https://google.aip.dev/160 are - // supported. - // - // The following fields in the `RuntimeProjectAttachment` are eligible for - // filtering: - // - // * `name` - The name of the RuntimeProjectAttachment. - // * `create_time` - The time at which the RuntimeProjectAttachment was - // created. The value should be in the - // (RFC3339)[https://tools.ietf.org/html/rfc3339] format. - // * `runtime_project` - The Google cloud project associated with the - // RuntimeProjectAttachment. - string filter = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Hint for how to order the results. - string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// The -// [ListRuntimeProjectAttachments][google.cloud.apihub.v1.RuntimeProjectAttachmentService.ListRuntimeProjectAttachments] -// method's response. -message ListRuntimeProjectAttachmentsResponse { - // List of runtime project attachments. - repeated RuntimeProjectAttachment runtime_project_attachments = 1; - - // A token, which can be sent as `page_token` to retrieve the next page. - // If this field is omitted, there are no subsequent pages. - string next_page_token = 2; -} - -// The -// [DeleteRuntimeProjectAttachment][google.cloud.apihub.v1.RuntimeProjectAttachmentService.DeleteRuntimeProjectAttachment] -// method's request. -message DeleteRuntimeProjectAttachmentRequest { - // Required. The name of the Runtime Project Attachment to delete. - // Format: - // `projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "apihub.googleapis.com/RuntimeProjectAttachment" - } - ]; -} - -// The -// [LookupRuntimeProjectAttachment][google.cloud.apihub.v1.RuntimeProjectAttachmentService.LookupRuntimeProjectAttachment] -// method's request. -message LookupRuntimeProjectAttachmentRequest { - // Required. Runtime project ID to look up runtime project attachment for. - // Lookup happens across all regions. Expected format: - // `projects/{project}/locations/{location}`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; -} - -// The -// [ListRuntimeProjectAttachments][google.cloud.apihub.v1.RuntimeProjectAttachmentService.ListRuntimeProjectAttachments] -// method's response. -message LookupRuntimeProjectAttachmentResponse { - // Runtime project attachment for a project if exists, empty otherwise. - RuntimeProjectAttachment runtime_project_attachment = 1; -} - -// Runtime project attachment represents an attachment from the runtime project -// to the host project. Api Hub looks for deployments in the attached runtime -// projects and creates corresponding resources in Api Hub for the discovered -// deployments. -message RuntimeProjectAttachment { - option (google.api.resource) = { - type: "apihub.googleapis.com/RuntimeProjectAttachment" - pattern: "projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}" - plural: "runtimeProjectAttachments" - singular: "runtimeProjectAttachment" - }; - - // Identifier. The resource name of a runtime project attachment. Format: - // "projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}". - string name = 1 [(google.api.field_behavior) = IDENTIFIER]; - - // Required. Immutable. Google cloud project name in the format: - // "projects/abc" or "projects/123". As input, project name with either - // project id or number are accepted. As output, this field will contain - // project number. - string runtime_project = 2 [ - (google.api.field_behavior) = REQUIRED, - (google.api.field_behavior) = IMMUTABLE, - (google.api.resource_reference) = { - type: "cloudresourcemanager.googleapis.com/Project" - } - ]; - - // Output only. Create time. - google.protobuf.Timestamp create_time = 3 - [(google.api.field_behavior) = OUTPUT_ONLY]; -} diff --git a/owl-bot-staging/google-cloud-apihub/v1/protos/protos.d.ts b/owl-bot-staging/google-cloud-apihub/v1/protos/protos.d.ts deleted file mode 100644 index 0ec6d0a3e62..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/protos/protos.d.ts +++ /dev/null @@ -1,21434 +0,0 @@ -// Copyright 2024 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 apihub. */ - namespace apihub { - - /** Namespace v1. */ - namespace v1 { - - /** Represents an ApiHub */ - class ApiHub extends $protobuf.rpc.Service { - - /** - * Constructs a new ApiHub 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 ApiHub 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): ApiHub; - - /** - * Calls CreateApi. - * @param request CreateApiRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Api - */ - public createApi(request: google.cloud.apihub.v1.ICreateApiRequest, callback: google.cloud.apihub.v1.ApiHub.CreateApiCallback): void; - - /** - * Calls CreateApi. - * @param request CreateApiRequest message or plain object - * @returns Promise - */ - public createApi(request: google.cloud.apihub.v1.ICreateApiRequest): Promise; - - /** - * Calls GetApi. - * @param request GetApiRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Api - */ - public getApi(request: google.cloud.apihub.v1.IGetApiRequest, callback: google.cloud.apihub.v1.ApiHub.GetApiCallback): void; - - /** - * Calls GetApi. - * @param request GetApiRequest message or plain object - * @returns Promise - */ - public getApi(request: google.cloud.apihub.v1.IGetApiRequest): Promise; - - /** - * Calls ListApis. - * @param request ListApisRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListApisResponse - */ - public listApis(request: google.cloud.apihub.v1.IListApisRequest, callback: google.cloud.apihub.v1.ApiHub.ListApisCallback): void; - - /** - * Calls ListApis. - * @param request ListApisRequest message or plain object - * @returns Promise - */ - public listApis(request: google.cloud.apihub.v1.IListApisRequest): Promise; - - /** - * Calls UpdateApi. - * @param request UpdateApiRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Api - */ - public updateApi(request: google.cloud.apihub.v1.IUpdateApiRequest, callback: google.cloud.apihub.v1.ApiHub.UpdateApiCallback): void; - - /** - * Calls UpdateApi. - * @param request UpdateApiRequest message or plain object - * @returns Promise - */ - public updateApi(request: google.cloud.apihub.v1.IUpdateApiRequest): Promise; - - /** - * Calls DeleteApi. - * @param request DeleteApiRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteApi(request: google.cloud.apihub.v1.IDeleteApiRequest, callback: google.cloud.apihub.v1.ApiHub.DeleteApiCallback): void; - - /** - * Calls DeleteApi. - * @param request DeleteApiRequest message or plain object - * @returns Promise - */ - public deleteApi(request: google.cloud.apihub.v1.IDeleteApiRequest): Promise; - - /** - * Calls CreateVersion. - * @param request CreateVersionRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Version - */ - public createVersion(request: google.cloud.apihub.v1.ICreateVersionRequest, callback: google.cloud.apihub.v1.ApiHub.CreateVersionCallback): void; - - /** - * Calls CreateVersion. - * @param request CreateVersionRequest message or plain object - * @returns Promise - */ - public createVersion(request: google.cloud.apihub.v1.ICreateVersionRequest): Promise; - - /** - * Calls GetVersion. - * @param request GetVersionRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Version - */ - public getVersion(request: google.cloud.apihub.v1.IGetVersionRequest, callback: google.cloud.apihub.v1.ApiHub.GetVersionCallback): void; - - /** - * Calls GetVersion. - * @param request GetVersionRequest message or plain object - * @returns Promise - */ - public getVersion(request: google.cloud.apihub.v1.IGetVersionRequest): Promise; - - /** - * Calls ListVersions. - * @param request ListVersionsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListVersionsResponse - */ - public listVersions(request: google.cloud.apihub.v1.IListVersionsRequest, callback: google.cloud.apihub.v1.ApiHub.ListVersionsCallback): void; - - /** - * Calls ListVersions. - * @param request ListVersionsRequest message or plain object - * @returns Promise - */ - public listVersions(request: google.cloud.apihub.v1.IListVersionsRequest): Promise; - - /** - * Calls UpdateVersion. - * @param request UpdateVersionRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Version - */ - public updateVersion(request: google.cloud.apihub.v1.IUpdateVersionRequest, callback: google.cloud.apihub.v1.ApiHub.UpdateVersionCallback): void; - - /** - * Calls UpdateVersion. - * @param request UpdateVersionRequest message or plain object - * @returns Promise - */ - public updateVersion(request: google.cloud.apihub.v1.IUpdateVersionRequest): Promise; - - /** - * Calls DeleteVersion. - * @param request DeleteVersionRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteVersion(request: google.cloud.apihub.v1.IDeleteVersionRequest, callback: google.cloud.apihub.v1.ApiHub.DeleteVersionCallback): void; - - /** - * Calls DeleteVersion. - * @param request DeleteVersionRequest message or plain object - * @returns Promise - */ - public deleteVersion(request: google.cloud.apihub.v1.IDeleteVersionRequest): Promise; - - /** - * Calls CreateSpec. - * @param request CreateSpecRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Spec - */ - public createSpec(request: google.cloud.apihub.v1.ICreateSpecRequest, callback: google.cloud.apihub.v1.ApiHub.CreateSpecCallback): void; - - /** - * Calls CreateSpec. - * @param request CreateSpecRequest message or plain object - * @returns Promise - */ - public createSpec(request: google.cloud.apihub.v1.ICreateSpecRequest): Promise; - - /** - * Calls GetSpec. - * @param request GetSpecRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Spec - */ - public getSpec(request: google.cloud.apihub.v1.IGetSpecRequest, callback: google.cloud.apihub.v1.ApiHub.GetSpecCallback): void; - - /** - * Calls GetSpec. - * @param request GetSpecRequest message or plain object - * @returns Promise - */ - public getSpec(request: google.cloud.apihub.v1.IGetSpecRequest): Promise; - - /** - * Calls GetSpecContents. - * @param request GetSpecContentsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and SpecContents - */ - public getSpecContents(request: google.cloud.apihub.v1.IGetSpecContentsRequest, callback: google.cloud.apihub.v1.ApiHub.GetSpecContentsCallback): void; - - /** - * Calls GetSpecContents. - * @param request GetSpecContentsRequest message or plain object - * @returns Promise - */ - public getSpecContents(request: google.cloud.apihub.v1.IGetSpecContentsRequest): Promise; - - /** - * Calls ListSpecs. - * @param request ListSpecsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListSpecsResponse - */ - public listSpecs(request: google.cloud.apihub.v1.IListSpecsRequest, callback: google.cloud.apihub.v1.ApiHub.ListSpecsCallback): void; - - /** - * Calls ListSpecs. - * @param request ListSpecsRequest message or plain object - * @returns Promise - */ - public listSpecs(request: google.cloud.apihub.v1.IListSpecsRequest): Promise; - - /** - * Calls UpdateSpec. - * @param request UpdateSpecRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Spec - */ - public updateSpec(request: google.cloud.apihub.v1.IUpdateSpecRequest, callback: google.cloud.apihub.v1.ApiHub.UpdateSpecCallback): void; - - /** - * Calls UpdateSpec. - * @param request UpdateSpecRequest message or plain object - * @returns Promise - */ - public updateSpec(request: google.cloud.apihub.v1.IUpdateSpecRequest): Promise; - - /** - * Calls DeleteSpec. - * @param request DeleteSpecRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteSpec(request: google.cloud.apihub.v1.IDeleteSpecRequest, callback: google.cloud.apihub.v1.ApiHub.DeleteSpecCallback): void; - - /** - * Calls DeleteSpec. - * @param request DeleteSpecRequest message or plain object - * @returns Promise - */ - public deleteSpec(request: google.cloud.apihub.v1.IDeleteSpecRequest): Promise; - - /** - * Calls GetApiOperation. - * @param request GetApiOperationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ApiOperation - */ - public getApiOperation(request: google.cloud.apihub.v1.IGetApiOperationRequest, callback: google.cloud.apihub.v1.ApiHub.GetApiOperationCallback): void; - - /** - * Calls GetApiOperation. - * @param request GetApiOperationRequest message or plain object - * @returns Promise - */ - public getApiOperation(request: google.cloud.apihub.v1.IGetApiOperationRequest): Promise; - - /** - * Calls ListApiOperations. - * @param request ListApiOperationsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListApiOperationsResponse - */ - public listApiOperations(request: google.cloud.apihub.v1.IListApiOperationsRequest, callback: google.cloud.apihub.v1.ApiHub.ListApiOperationsCallback): void; - - /** - * Calls ListApiOperations. - * @param request ListApiOperationsRequest message or plain object - * @returns Promise - */ - public listApiOperations(request: google.cloud.apihub.v1.IListApiOperationsRequest): Promise; - - /** - * Calls GetDefinition. - * @param request GetDefinitionRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Definition - */ - public getDefinition(request: google.cloud.apihub.v1.IGetDefinitionRequest, callback: google.cloud.apihub.v1.ApiHub.GetDefinitionCallback): void; - - /** - * Calls GetDefinition. - * @param request GetDefinitionRequest message or plain object - * @returns Promise - */ - public getDefinition(request: google.cloud.apihub.v1.IGetDefinitionRequest): Promise; - - /** - * Calls CreateDeployment. - * @param request CreateDeploymentRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Deployment - */ - public createDeployment(request: google.cloud.apihub.v1.ICreateDeploymentRequest, callback: google.cloud.apihub.v1.ApiHub.CreateDeploymentCallback): void; - - /** - * Calls CreateDeployment. - * @param request CreateDeploymentRequest message or plain object - * @returns Promise - */ - public createDeployment(request: google.cloud.apihub.v1.ICreateDeploymentRequest): Promise; - - /** - * Calls GetDeployment. - * @param request GetDeploymentRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Deployment - */ - public getDeployment(request: google.cloud.apihub.v1.IGetDeploymentRequest, callback: google.cloud.apihub.v1.ApiHub.GetDeploymentCallback): void; - - /** - * Calls GetDeployment. - * @param request GetDeploymentRequest message or plain object - * @returns Promise - */ - public getDeployment(request: google.cloud.apihub.v1.IGetDeploymentRequest): Promise; - - /** - * Calls ListDeployments. - * @param request ListDeploymentsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListDeploymentsResponse - */ - public listDeployments(request: google.cloud.apihub.v1.IListDeploymentsRequest, callback: google.cloud.apihub.v1.ApiHub.ListDeploymentsCallback): void; - - /** - * Calls ListDeployments. - * @param request ListDeploymentsRequest message or plain object - * @returns Promise - */ - public listDeployments(request: google.cloud.apihub.v1.IListDeploymentsRequest): Promise; - - /** - * Calls UpdateDeployment. - * @param request UpdateDeploymentRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Deployment - */ - public updateDeployment(request: google.cloud.apihub.v1.IUpdateDeploymentRequest, callback: google.cloud.apihub.v1.ApiHub.UpdateDeploymentCallback): void; - - /** - * Calls UpdateDeployment. - * @param request UpdateDeploymentRequest message or plain object - * @returns Promise - */ - public updateDeployment(request: google.cloud.apihub.v1.IUpdateDeploymentRequest): Promise; - - /** - * Calls DeleteDeployment. - * @param request DeleteDeploymentRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteDeployment(request: google.cloud.apihub.v1.IDeleteDeploymentRequest, callback: google.cloud.apihub.v1.ApiHub.DeleteDeploymentCallback): void; - - /** - * Calls DeleteDeployment. - * @param request DeleteDeploymentRequest message or plain object - * @returns Promise - */ - public deleteDeployment(request: google.cloud.apihub.v1.IDeleteDeploymentRequest): Promise; - - /** - * Calls CreateAttribute. - * @param request CreateAttributeRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Attribute - */ - public createAttribute(request: google.cloud.apihub.v1.ICreateAttributeRequest, callback: google.cloud.apihub.v1.ApiHub.CreateAttributeCallback): void; - - /** - * Calls CreateAttribute. - * @param request CreateAttributeRequest message or plain object - * @returns Promise - */ - public createAttribute(request: google.cloud.apihub.v1.ICreateAttributeRequest): Promise; - - /** - * Calls GetAttribute. - * @param request GetAttributeRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Attribute - */ - public getAttribute(request: google.cloud.apihub.v1.IGetAttributeRequest, callback: google.cloud.apihub.v1.ApiHub.GetAttributeCallback): void; - - /** - * Calls GetAttribute. - * @param request GetAttributeRequest message or plain object - * @returns Promise - */ - public getAttribute(request: google.cloud.apihub.v1.IGetAttributeRequest): Promise; - - /** - * Calls UpdateAttribute. - * @param request UpdateAttributeRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Attribute - */ - public updateAttribute(request: google.cloud.apihub.v1.IUpdateAttributeRequest, callback: google.cloud.apihub.v1.ApiHub.UpdateAttributeCallback): void; - - /** - * Calls UpdateAttribute. - * @param request UpdateAttributeRequest message or plain object - * @returns Promise - */ - public updateAttribute(request: google.cloud.apihub.v1.IUpdateAttributeRequest): Promise; - - /** - * Calls DeleteAttribute. - * @param request DeleteAttributeRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteAttribute(request: google.cloud.apihub.v1.IDeleteAttributeRequest, callback: google.cloud.apihub.v1.ApiHub.DeleteAttributeCallback): void; - - /** - * Calls DeleteAttribute. - * @param request DeleteAttributeRequest message or plain object - * @returns Promise - */ - public deleteAttribute(request: google.cloud.apihub.v1.IDeleteAttributeRequest): Promise; - - /** - * Calls ListAttributes. - * @param request ListAttributesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListAttributesResponse - */ - public listAttributes(request: google.cloud.apihub.v1.IListAttributesRequest, callback: google.cloud.apihub.v1.ApiHub.ListAttributesCallback): void; - - /** - * Calls ListAttributes. - * @param request ListAttributesRequest message or plain object - * @returns Promise - */ - public listAttributes(request: google.cloud.apihub.v1.IListAttributesRequest): Promise; - - /** - * Calls SearchResources. - * @param request SearchResourcesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and SearchResourcesResponse - */ - public searchResources(request: google.cloud.apihub.v1.ISearchResourcesRequest, callback: google.cloud.apihub.v1.ApiHub.SearchResourcesCallback): void; - - /** - * Calls SearchResources. - * @param request SearchResourcesRequest message or plain object - * @returns Promise - */ - public searchResources(request: google.cloud.apihub.v1.ISearchResourcesRequest): Promise; - - /** - * Calls CreateExternalApi. - * @param request CreateExternalApiRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ExternalApi - */ - public createExternalApi(request: google.cloud.apihub.v1.ICreateExternalApiRequest, callback: google.cloud.apihub.v1.ApiHub.CreateExternalApiCallback): void; - - /** - * Calls CreateExternalApi. - * @param request CreateExternalApiRequest message or plain object - * @returns Promise - */ - public createExternalApi(request: google.cloud.apihub.v1.ICreateExternalApiRequest): Promise; - - /** - * Calls GetExternalApi. - * @param request GetExternalApiRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ExternalApi - */ - public getExternalApi(request: google.cloud.apihub.v1.IGetExternalApiRequest, callback: google.cloud.apihub.v1.ApiHub.GetExternalApiCallback): void; - - /** - * Calls GetExternalApi. - * @param request GetExternalApiRequest message or plain object - * @returns Promise - */ - public getExternalApi(request: google.cloud.apihub.v1.IGetExternalApiRequest): Promise; - - /** - * Calls UpdateExternalApi. - * @param request UpdateExternalApiRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ExternalApi - */ - public updateExternalApi(request: google.cloud.apihub.v1.IUpdateExternalApiRequest, callback: google.cloud.apihub.v1.ApiHub.UpdateExternalApiCallback): void; - - /** - * Calls UpdateExternalApi. - * @param request UpdateExternalApiRequest message or plain object - * @returns Promise - */ - public updateExternalApi(request: google.cloud.apihub.v1.IUpdateExternalApiRequest): Promise; - - /** - * Calls DeleteExternalApi. - * @param request DeleteExternalApiRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteExternalApi(request: google.cloud.apihub.v1.IDeleteExternalApiRequest, callback: google.cloud.apihub.v1.ApiHub.DeleteExternalApiCallback): void; - - /** - * Calls DeleteExternalApi. - * @param request DeleteExternalApiRequest message or plain object - * @returns Promise - */ - public deleteExternalApi(request: google.cloud.apihub.v1.IDeleteExternalApiRequest): Promise; - - /** - * Calls ListExternalApis. - * @param request ListExternalApisRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListExternalApisResponse - */ - public listExternalApis(request: google.cloud.apihub.v1.IListExternalApisRequest, callback: google.cloud.apihub.v1.ApiHub.ListExternalApisCallback): void; - - /** - * Calls ListExternalApis. - * @param request ListExternalApisRequest message or plain object - * @returns Promise - */ - public listExternalApis(request: google.cloud.apihub.v1.IListExternalApisRequest): Promise; - } - - namespace ApiHub { - - /** - * Callback as used by {@link google.cloud.apihub.v1.ApiHub|createApi}. - * @param error Error, if any - * @param [response] Api - */ - type CreateApiCallback = (error: (Error|null), response?: google.cloud.apihub.v1.Api) => void; - - /** - * Callback as used by {@link google.cloud.apihub.v1.ApiHub|getApi}. - * @param error Error, if any - * @param [response] Api - */ - type GetApiCallback = (error: (Error|null), response?: google.cloud.apihub.v1.Api) => void; - - /** - * Callback as used by {@link google.cloud.apihub.v1.ApiHub|listApis}. - * @param error Error, if any - * @param [response] ListApisResponse - */ - type ListApisCallback = (error: (Error|null), response?: google.cloud.apihub.v1.ListApisResponse) => void; - - /** - * Callback as used by {@link google.cloud.apihub.v1.ApiHub|updateApi}. - * @param error Error, if any - * @param [response] Api - */ - type UpdateApiCallback = (error: (Error|null), response?: google.cloud.apihub.v1.Api) => void; - - /** - * Callback as used by {@link google.cloud.apihub.v1.ApiHub|deleteApi}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteApiCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.cloud.apihub.v1.ApiHub|createVersion}. - * @param error Error, if any - * @param [response] Version - */ - type CreateVersionCallback = (error: (Error|null), response?: google.cloud.apihub.v1.Version) => void; - - /** - * Callback as used by {@link google.cloud.apihub.v1.ApiHub|getVersion}. - * @param error Error, if any - * @param [response] Version - */ - type GetVersionCallback = (error: (Error|null), response?: google.cloud.apihub.v1.Version) => void; - - /** - * Callback as used by {@link google.cloud.apihub.v1.ApiHub|listVersions}. - * @param error Error, if any - * @param [response] ListVersionsResponse - */ - type ListVersionsCallback = (error: (Error|null), response?: google.cloud.apihub.v1.ListVersionsResponse) => void; - - /** - * Callback as used by {@link google.cloud.apihub.v1.ApiHub|updateVersion}. - * @param error Error, if any - * @param [response] Version - */ - type UpdateVersionCallback = (error: (Error|null), response?: google.cloud.apihub.v1.Version) => void; - - /** - * Callback as used by {@link google.cloud.apihub.v1.ApiHub|deleteVersion}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteVersionCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.cloud.apihub.v1.ApiHub|createSpec}. - * @param error Error, if any - * @param [response] Spec - */ - type CreateSpecCallback = (error: (Error|null), response?: google.cloud.apihub.v1.Spec) => void; - - /** - * Callback as used by {@link google.cloud.apihub.v1.ApiHub|getSpec}. - * @param error Error, if any - * @param [response] Spec - */ - type GetSpecCallback = (error: (Error|null), response?: google.cloud.apihub.v1.Spec) => void; - - /** - * Callback as used by {@link google.cloud.apihub.v1.ApiHub|getSpecContents}. - * @param error Error, if any - * @param [response] SpecContents - */ - type GetSpecContentsCallback = (error: (Error|null), response?: google.cloud.apihub.v1.SpecContents) => void; - - /** - * Callback as used by {@link google.cloud.apihub.v1.ApiHub|listSpecs}. - * @param error Error, if any - * @param [response] ListSpecsResponse - */ - type ListSpecsCallback = (error: (Error|null), response?: google.cloud.apihub.v1.ListSpecsResponse) => void; - - /** - * Callback as used by {@link google.cloud.apihub.v1.ApiHub|updateSpec}. - * @param error Error, if any - * @param [response] Spec - */ - type UpdateSpecCallback = (error: (Error|null), response?: google.cloud.apihub.v1.Spec) => void; - - /** - * Callback as used by {@link google.cloud.apihub.v1.ApiHub|deleteSpec}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteSpecCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.cloud.apihub.v1.ApiHub|getApiOperation}. - * @param error Error, if any - * @param [response] ApiOperation - */ - type GetApiOperationCallback = (error: (Error|null), response?: google.cloud.apihub.v1.ApiOperation) => void; - - /** - * Callback as used by {@link google.cloud.apihub.v1.ApiHub|listApiOperations}. - * @param error Error, if any - * @param [response] ListApiOperationsResponse - */ - type ListApiOperationsCallback = (error: (Error|null), response?: google.cloud.apihub.v1.ListApiOperationsResponse) => void; - - /** - * Callback as used by {@link google.cloud.apihub.v1.ApiHub|getDefinition}. - * @param error Error, if any - * @param [response] Definition - */ - type GetDefinitionCallback = (error: (Error|null), response?: google.cloud.apihub.v1.Definition) => void; - - /** - * Callback as used by {@link google.cloud.apihub.v1.ApiHub|createDeployment}. - * @param error Error, if any - * @param [response] Deployment - */ - type CreateDeploymentCallback = (error: (Error|null), response?: google.cloud.apihub.v1.Deployment) => void; - - /** - * Callback as used by {@link google.cloud.apihub.v1.ApiHub|getDeployment}. - * @param error Error, if any - * @param [response] Deployment - */ - type GetDeploymentCallback = (error: (Error|null), response?: google.cloud.apihub.v1.Deployment) => void; - - /** - * Callback as used by {@link google.cloud.apihub.v1.ApiHub|listDeployments}. - * @param error Error, if any - * @param [response] ListDeploymentsResponse - */ - type ListDeploymentsCallback = (error: (Error|null), response?: google.cloud.apihub.v1.ListDeploymentsResponse) => void; - - /** - * Callback as used by {@link google.cloud.apihub.v1.ApiHub|updateDeployment}. - * @param error Error, if any - * @param [response] Deployment - */ - type UpdateDeploymentCallback = (error: (Error|null), response?: google.cloud.apihub.v1.Deployment) => void; - - /** - * Callback as used by {@link google.cloud.apihub.v1.ApiHub|deleteDeployment}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteDeploymentCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.cloud.apihub.v1.ApiHub|createAttribute}. - * @param error Error, if any - * @param [response] Attribute - */ - type CreateAttributeCallback = (error: (Error|null), response?: google.cloud.apihub.v1.Attribute) => void; - - /** - * Callback as used by {@link google.cloud.apihub.v1.ApiHub|getAttribute}. - * @param error Error, if any - * @param [response] Attribute - */ - type GetAttributeCallback = (error: (Error|null), response?: google.cloud.apihub.v1.Attribute) => void; - - /** - * Callback as used by {@link google.cloud.apihub.v1.ApiHub|updateAttribute}. - * @param error Error, if any - * @param [response] Attribute - */ - type UpdateAttributeCallback = (error: (Error|null), response?: google.cloud.apihub.v1.Attribute) => void; - - /** - * Callback as used by {@link google.cloud.apihub.v1.ApiHub|deleteAttribute}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteAttributeCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.cloud.apihub.v1.ApiHub|listAttributes}. - * @param error Error, if any - * @param [response] ListAttributesResponse - */ - type ListAttributesCallback = (error: (Error|null), response?: google.cloud.apihub.v1.ListAttributesResponse) => void; - - /** - * Callback as used by {@link google.cloud.apihub.v1.ApiHub|searchResources}. - * @param error Error, if any - * @param [response] SearchResourcesResponse - */ - type SearchResourcesCallback = (error: (Error|null), response?: google.cloud.apihub.v1.SearchResourcesResponse) => void; - - /** - * Callback as used by {@link google.cloud.apihub.v1.ApiHub|createExternalApi}. - * @param error Error, if any - * @param [response] ExternalApi - */ - type CreateExternalApiCallback = (error: (Error|null), response?: google.cloud.apihub.v1.ExternalApi) => void; - - /** - * Callback as used by {@link google.cloud.apihub.v1.ApiHub|getExternalApi}. - * @param error Error, if any - * @param [response] ExternalApi - */ - type GetExternalApiCallback = (error: (Error|null), response?: google.cloud.apihub.v1.ExternalApi) => void; - - /** - * Callback as used by {@link google.cloud.apihub.v1.ApiHub|updateExternalApi}. - * @param error Error, if any - * @param [response] ExternalApi - */ - type UpdateExternalApiCallback = (error: (Error|null), response?: google.cloud.apihub.v1.ExternalApi) => void; - - /** - * Callback as used by {@link google.cloud.apihub.v1.ApiHub|deleteExternalApi}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteExternalApiCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.cloud.apihub.v1.ApiHub|listExternalApis}. - * @param error Error, if any - * @param [response] ListExternalApisResponse - */ - type ListExternalApisCallback = (error: (Error|null), response?: google.cloud.apihub.v1.ListExternalApisResponse) => void; - } - - /** Represents an ApiHubDependencies */ - class ApiHubDependencies extends $protobuf.rpc.Service { - - /** - * Constructs a new ApiHubDependencies 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 ApiHubDependencies 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): ApiHubDependencies; - - /** - * Calls CreateDependency. - * @param request CreateDependencyRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Dependency - */ - public createDependency(request: google.cloud.apihub.v1.ICreateDependencyRequest, callback: google.cloud.apihub.v1.ApiHubDependencies.CreateDependencyCallback): void; - - /** - * Calls CreateDependency. - * @param request CreateDependencyRequest message or plain object - * @returns Promise - */ - public createDependency(request: google.cloud.apihub.v1.ICreateDependencyRequest): Promise; - - /** - * Calls GetDependency. - * @param request GetDependencyRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Dependency - */ - public getDependency(request: google.cloud.apihub.v1.IGetDependencyRequest, callback: google.cloud.apihub.v1.ApiHubDependencies.GetDependencyCallback): void; - - /** - * Calls GetDependency. - * @param request GetDependencyRequest message or plain object - * @returns Promise - */ - public getDependency(request: google.cloud.apihub.v1.IGetDependencyRequest): Promise; - - /** - * Calls UpdateDependency. - * @param request UpdateDependencyRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Dependency - */ - public updateDependency(request: google.cloud.apihub.v1.IUpdateDependencyRequest, callback: google.cloud.apihub.v1.ApiHubDependencies.UpdateDependencyCallback): void; - - /** - * Calls UpdateDependency. - * @param request UpdateDependencyRequest message or plain object - * @returns Promise - */ - public updateDependency(request: google.cloud.apihub.v1.IUpdateDependencyRequest): Promise; - - /** - * Calls DeleteDependency. - * @param request DeleteDependencyRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteDependency(request: google.cloud.apihub.v1.IDeleteDependencyRequest, callback: google.cloud.apihub.v1.ApiHubDependencies.DeleteDependencyCallback): void; - - /** - * Calls DeleteDependency. - * @param request DeleteDependencyRequest message or plain object - * @returns Promise - */ - public deleteDependency(request: google.cloud.apihub.v1.IDeleteDependencyRequest): Promise; - - /** - * Calls ListDependencies. - * @param request ListDependenciesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListDependenciesResponse - */ - public listDependencies(request: google.cloud.apihub.v1.IListDependenciesRequest, callback: google.cloud.apihub.v1.ApiHubDependencies.ListDependenciesCallback): void; - - /** - * Calls ListDependencies. - * @param request ListDependenciesRequest message or plain object - * @returns Promise - */ - public listDependencies(request: google.cloud.apihub.v1.IListDependenciesRequest): Promise; - } - - namespace ApiHubDependencies { - - /** - * Callback as used by {@link google.cloud.apihub.v1.ApiHubDependencies|createDependency}. - * @param error Error, if any - * @param [response] Dependency - */ - type CreateDependencyCallback = (error: (Error|null), response?: google.cloud.apihub.v1.Dependency) => void; - - /** - * Callback as used by {@link google.cloud.apihub.v1.ApiHubDependencies|getDependency}. - * @param error Error, if any - * @param [response] Dependency - */ - type GetDependencyCallback = (error: (Error|null), response?: google.cloud.apihub.v1.Dependency) => void; - - /** - * Callback as used by {@link google.cloud.apihub.v1.ApiHubDependencies|updateDependency}. - * @param error Error, if any - * @param [response] Dependency - */ - type UpdateDependencyCallback = (error: (Error|null), response?: google.cloud.apihub.v1.Dependency) => void; - - /** - * Callback as used by {@link google.cloud.apihub.v1.ApiHubDependencies|deleteDependency}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteDependencyCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.cloud.apihub.v1.ApiHubDependencies|listDependencies}. - * @param error Error, if any - * @param [response] ListDependenciesResponse - */ - type ListDependenciesCallback = (error: (Error|null), response?: google.cloud.apihub.v1.ListDependenciesResponse) => void; - } - - /** Properties of a CreateApiRequest. */ - interface ICreateApiRequest { - - /** CreateApiRequest parent */ - parent?: (string|null); - - /** CreateApiRequest apiId */ - apiId?: (string|null); - - /** CreateApiRequest api */ - api?: (google.cloud.apihub.v1.IApi|null); - } - - /** Represents a CreateApiRequest. */ - class CreateApiRequest implements ICreateApiRequest { - - /** - * Constructs a new CreateApiRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.ICreateApiRequest); - - /** CreateApiRequest parent. */ - public parent: string; - - /** CreateApiRequest apiId. */ - public apiId: string; - - /** CreateApiRequest api. */ - public api?: (google.cloud.apihub.v1.IApi|null); - - /** - * Creates a new CreateApiRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateApiRequest instance - */ - public static create(properties?: google.cloud.apihub.v1.ICreateApiRequest): google.cloud.apihub.v1.CreateApiRequest; - - /** - * Encodes the specified CreateApiRequest message. Does not implicitly {@link google.cloud.apihub.v1.CreateApiRequest.verify|verify} messages. - * @param message CreateApiRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.ICreateApiRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateApiRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.CreateApiRequest.verify|verify} messages. - * @param message CreateApiRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.ICreateApiRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateApiRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateApiRequest - * @throws {Error} If the payload is not 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.apihub.v1.CreateApiRequest; - - /** - * Decodes a CreateApiRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateApiRequest - * @throws {Error} If the payload 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.apihub.v1.CreateApiRequest; - - /** - * Verifies a CreateApiRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateApiRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateApiRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.CreateApiRequest; - - /** - * Creates a plain object from a CreateApiRequest message. Also converts values to other types if specified. - * @param message CreateApiRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.CreateApiRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateApiRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateApiRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetApiRequest. */ - interface IGetApiRequest { - - /** GetApiRequest name */ - name?: (string|null); - } - - /** Represents a GetApiRequest. */ - class GetApiRequest implements IGetApiRequest { - - /** - * Constructs a new GetApiRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.IGetApiRequest); - - /** GetApiRequest name. */ - public name: string; - - /** - * Creates a new GetApiRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetApiRequest instance - */ - public static create(properties?: google.cloud.apihub.v1.IGetApiRequest): google.cloud.apihub.v1.GetApiRequest; - - /** - * Encodes the specified GetApiRequest message. Does not implicitly {@link google.cloud.apihub.v1.GetApiRequest.verify|verify} messages. - * @param message GetApiRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.IGetApiRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetApiRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.GetApiRequest.verify|verify} messages. - * @param message GetApiRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.IGetApiRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetApiRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetApiRequest - * @throws {Error} If the payload is not 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.apihub.v1.GetApiRequest; - - /** - * Decodes a GetApiRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetApiRequest - * @throws {Error} If the payload 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.apihub.v1.GetApiRequest; - - /** - * Verifies a GetApiRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetApiRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetApiRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.GetApiRequest; - - /** - * Creates a plain object from a GetApiRequest message. Also converts values to other types if specified. - * @param message GetApiRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.GetApiRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetApiRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetApiRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateApiRequest. */ - interface IUpdateApiRequest { - - /** UpdateApiRequest api */ - api?: (google.cloud.apihub.v1.IApi|null); - - /** UpdateApiRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - } - - /** Represents an UpdateApiRequest. */ - class UpdateApiRequest implements IUpdateApiRequest { - - /** - * Constructs a new UpdateApiRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.IUpdateApiRequest); - - /** UpdateApiRequest api. */ - public api?: (google.cloud.apihub.v1.IApi|null); - - /** UpdateApiRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** - * Creates a new UpdateApiRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateApiRequest instance - */ - public static create(properties?: google.cloud.apihub.v1.IUpdateApiRequest): google.cloud.apihub.v1.UpdateApiRequest; - - /** - * Encodes the specified UpdateApiRequest message. Does not implicitly {@link google.cloud.apihub.v1.UpdateApiRequest.verify|verify} messages. - * @param message UpdateApiRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.IUpdateApiRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateApiRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.UpdateApiRequest.verify|verify} messages. - * @param message UpdateApiRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.IUpdateApiRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateApiRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateApiRequest - * @throws {Error} If the payload is not 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.apihub.v1.UpdateApiRequest; - - /** - * Decodes an UpdateApiRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateApiRequest - * @throws {Error} If the payload 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.apihub.v1.UpdateApiRequest; - - /** - * Verifies an UpdateApiRequest message. - * @param message Plain 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 UpdateApiRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateApiRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.UpdateApiRequest; - - /** - * Creates a plain object from an UpdateApiRequest message. Also converts values to other types if specified. - * @param message UpdateApiRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.UpdateApiRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateApiRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateApiRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteApiRequest. */ - interface IDeleteApiRequest { - - /** DeleteApiRequest name */ - name?: (string|null); - - /** DeleteApiRequest force */ - force?: (boolean|null); - } - - /** Represents a DeleteApiRequest. */ - class DeleteApiRequest implements IDeleteApiRequest { - - /** - * Constructs a new DeleteApiRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.IDeleteApiRequest); - - /** DeleteApiRequest name. */ - public name: string; - - /** DeleteApiRequest force. */ - public force: boolean; - - /** - * Creates a new DeleteApiRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteApiRequest instance - */ - public static create(properties?: google.cloud.apihub.v1.IDeleteApiRequest): google.cloud.apihub.v1.DeleteApiRequest; - - /** - * Encodes the specified DeleteApiRequest message. Does not implicitly {@link google.cloud.apihub.v1.DeleteApiRequest.verify|verify} messages. - * @param message DeleteApiRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.IDeleteApiRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteApiRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.DeleteApiRequest.verify|verify} messages. - * @param message DeleteApiRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.IDeleteApiRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteApiRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteApiRequest - * @throws {Error} If the payload is not 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.apihub.v1.DeleteApiRequest; - - /** - * Decodes a DeleteApiRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteApiRequest - * @throws {Error} If the payload 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.apihub.v1.DeleteApiRequest; - - /** - * Verifies a DeleteApiRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteApiRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteApiRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.DeleteApiRequest; - - /** - * Creates a plain object from a DeleteApiRequest message. Also converts values to other types if specified. - * @param message DeleteApiRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.DeleteApiRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteApiRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteApiRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListApisRequest. */ - interface IListApisRequest { - - /** ListApisRequest parent */ - parent?: (string|null); - - /** ListApisRequest filter */ - filter?: (string|null); - - /** ListApisRequest pageSize */ - pageSize?: (number|null); - - /** ListApisRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListApisRequest. */ - class ListApisRequest implements IListApisRequest { - - /** - * Constructs a new ListApisRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.IListApisRequest); - - /** ListApisRequest parent. */ - public parent: string; - - /** ListApisRequest filter. */ - public filter: string; - - /** ListApisRequest pageSize. */ - public pageSize: number; - - /** ListApisRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new ListApisRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListApisRequest instance - */ - public static create(properties?: google.cloud.apihub.v1.IListApisRequest): google.cloud.apihub.v1.ListApisRequest; - - /** - * Encodes the specified ListApisRequest message. Does not implicitly {@link google.cloud.apihub.v1.ListApisRequest.verify|verify} messages. - * @param message ListApisRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.IListApisRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListApisRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListApisRequest.verify|verify} messages. - * @param message ListApisRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.IListApisRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListApisRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListApisRequest - * @throws {Error} If the payload is not 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.apihub.v1.ListApisRequest; - - /** - * Decodes a ListApisRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListApisRequest - * @throws {Error} If the payload 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.apihub.v1.ListApisRequest; - - /** - * Verifies a ListApisRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListApisRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListApisRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.ListApisRequest; - - /** - * Creates a plain object from a ListApisRequest message. Also converts values to other types if specified. - * @param message ListApisRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.ListApisRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListApisRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListApisRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListApisResponse. */ - interface IListApisResponse { - - /** ListApisResponse apis */ - apis?: (google.cloud.apihub.v1.IApi[]|null); - - /** ListApisResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListApisResponse. */ - class ListApisResponse implements IListApisResponse { - - /** - * Constructs a new ListApisResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.IListApisResponse); - - /** ListApisResponse apis. */ - public apis: google.cloud.apihub.v1.IApi[]; - - /** ListApisResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListApisResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListApisResponse instance - */ - public static create(properties?: google.cloud.apihub.v1.IListApisResponse): google.cloud.apihub.v1.ListApisResponse; - - /** - * Encodes the specified ListApisResponse message. Does not implicitly {@link google.cloud.apihub.v1.ListApisResponse.verify|verify} messages. - * @param message ListApisResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.IListApisResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListApisResponse message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListApisResponse.verify|verify} messages. - * @param message ListApisResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.IListApisResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListApisResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListApisResponse - * @throws {Error} If the payload is not 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.apihub.v1.ListApisResponse; - - /** - * Decodes a ListApisResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListApisResponse - * @throws {Error} If the payload 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.apihub.v1.ListApisResponse; - - /** - * Verifies a ListApisResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListApisResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListApisResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.ListApisResponse; - - /** - * Creates a plain object from a ListApisResponse message. Also converts values to other types if specified. - * @param message ListApisResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.ListApisResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListApisResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListApisResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CreateVersionRequest. */ - interface ICreateVersionRequest { - - /** CreateVersionRequest parent */ - parent?: (string|null); - - /** CreateVersionRequest versionId */ - versionId?: (string|null); - - /** CreateVersionRequest version */ - version?: (google.cloud.apihub.v1.IVersion|null); - } - - /** Represents a CreateVersionRequest. */ - class CreateVersionRequest implements ICreateVersionRequest { - - /** - * Constructs a new CreateVersionRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.ICreateVersionRequest); - - /** CreateVersionRequest parent. */ - public parent: string; - - /** CreateVersionRequest versionId. */ - public versionId: string; - - /** CreateVersionRequest version. */ - public version?: (google.cloud.apihub.v1.IVersion|null); - - /** - * Creates a new CreateVersionRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateVersionRequest instance - */ - public static create(properties?: google.cloud.apihub.v1.ICreateVersionRequest): google.cloud.apihub.v1.CreateVersionRequest; - - /** - * Encodes the specified CreateVersionRequest message. Does not implicitly {@link google.cloud.apihub.v1.CreateVersionRequest.verify|verify} messages. - * @param message CreateVersionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.ICreateVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateVersionRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.CreateVersionRequest.verify|verify} messages. - * @param message CreateVersionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.ICreateVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateVersionRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateVersionRequest - * @throws {Error} If the payload is not 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.apihub.v1.CreateVersionRequest; - - /** - * Decodes a CreateVersionRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateVersionRequest - * @throws {Error} If the payload 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.apihub.v1.CreateVersionRequest; - - /** - * Verifies a CreateVersionRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateVersionRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateVersionRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.CreateVersionRequest; - - /** - * Creates a plain object from a CreateVersionRequest message. Also converts values to other types if specified. - * @param message CreateVersionRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.CreateVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateVersionRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateVersionRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetVersionRequest. */ - interface IGetVersionRequest { - - /** GetVersionRequest name */ - name?: (string|null); - } - - /** Represents a GetVersionRequest. */ - class GetVersionRequest implements IGetVersionRequest { - - /** - * Constructs a new GetVersionRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.IGetVersionRequest); - - /** GetVersionRequest name. */ - public name: string; - - /** - * Creates a new GetVersionRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetVersionRequest instance - */ - public static create(properties?: google.cloud.apihub.v1.IGetVersionRequest): google.cloud.apihub.v1.GetVersionRequest; - - /** - * Encodes the specified GetVersionRequest message. Does not implicitly {@link google.cloud.apihub.v1.GetVersionRequest.verify|verify} messages. - * @param message GetVersionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.IGetVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetVersionRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.GetVersionRequest.verify|verify} messages. - * @param message GetVersionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.IGetVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetVersionRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetVersionRequest - * @throws {Error} If the payload is not 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.apihub.v1.GetVersionRequest; - - /** - * Decodes a GetVersionRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetVersionRequest - * @throws {Error} If the payload 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.apihub.v1.GetVersionRequest; - - /** - * Verifies a GetVersionRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetVersionRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetVersionRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.GetVersionRequest; - - /** - * Creates a plain object from a GetVersionRequest message. Also converts values to other types if specified. - * @param message GetVersionRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.GetVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetVersionRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetVersionRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateVersionRequest. */ - interface IUpdateVersionRequest { - - /** UpdateVersionRequest version */ - version?: (google.cloud.apihub.v1.IVersion|null); - - /** UpdateVersionRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - } - - /** Represents an UpdateVersionRequest. */ - class UpdateVersionRequest implements IUpdateVersionRequest { - - /** - * Constructs a new UpdateVersionRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.IUpdateVersionRequest); - - /** UpdateVersionRequest version. */ - public version?: (google.cloud.apihub.v1.IVersion|null); - - /** UpdateVersionRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** - * Creates a new UpdateVersionRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateVersionRequest instance - */ - public static create(properties?: google.cloud.apihub.v1.IUpdateVersionRequest): google.cloud.apihub.v1.UpdateVersionRequest; - - /** - * Encodes the specified UpdateVersionRequest message. Does not implicitly {@link google.cloud.apihub.v1.UpdateVersionRequest.verify|verify} messages. - * @param message UpdateVersionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.IUpdateVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateVersionRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.UpdateVersionRequest.verify|verify} messages. - * @param message UpdateVersionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.IUpdateVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateVersionRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateVersionRequest - * @throws {Error} If the payload is not 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.apihub.v1.UpdateVersionRequest; - - /** - * Decodes an UpdateVersionRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateVersionRequest - * @throws {Error} If the payload 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.apihub.v1.UpdateVersionRequest; - - /** - * Verifies an UpdateVersionRequest message. - * @param message Plain 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 UpdateVersionRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateVersionRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.UpdateVersionRequest; - - /** - * Creates a plain object from an UpdateVersionRequest message. Also converts values to other types if specified. - * @param message UpdateVersionRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.UpdateVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateVersionRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateVersionRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteVersionRequest. */ - interface IDeleteVersionRequest { - - /** DeleteVersionRequest name */ - name?: (string|null); - - /** DeleteVersionRequest force */ - force?: (boolean|null); - } - - /** Represents a DeleteVersionRequest. */ - class DeleteVersionRequest implements IDeleteVersionRequest { - - /** - * Constructs a new DeleteVersionRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.IDeleteVersionRequest); - - /** DeleteVersionRequest name. */ - public name: string; - - /** DeleteVersionRequest force. */ - public force: boolean; - - /** - * Creates a new DeleteVersionRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteVersionRequest instance - */ - public static create(properties?: google.cloud.apihub.v1.IDeleteVersionRequest): google.cloud.apihub.v1.DeleteVersionRequest; - - /** - * Encodes the specified DeleteVersionRequest message. Does not implicitly {@link google.cloud.apihub.v1.DeleteVersionRequest.verify|verify} messages. - * @param message DeleteVersionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.IDeleteVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteVersionRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.DeleteVersionRequest.verify|verify} messages. - * @param message DeleteVersionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.IDeleteVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteVersionRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteVersionRequest - * @throws {Error} If the payload is not 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.apihub.v1.DeleteVersionRequest; - - /** - * Decodes a DeleteVersionRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteVersionRequest - * @throws {Error} If the payload 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.apihub.v1.DeleteVersionRequest; - - /** - * Verifies a DeleteVersionRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteVersionRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteVersionRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.DeleteVersionRequest; - - /** - * Creates a plain object from a DeleteVersionRequest message. Also converts values to other types if specified. - * @param message DeleteVersionRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.DeleteVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteVersionRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteVersionRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListVersionsRequest. */ - interface IListVersionsRequest { - - /** ListVersionsRequest parent */ - parent?: (string|null); - - /** ListVersionsRequest filter */ - filter?: (string|null); - - /** ListVersionsRequest pageSize */ - pageSize?: (number|null); - - /** ListVersionsRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListVersionsRequest. */ - class ListVersionsRequest implements IListVersionsRequest { - - /** - * Constructs a new ListVersionsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.IListVersionsRequest); - - /** ListVersionsRequest parent. */ - public parent: string; - - /** ListVersionsRequest filter. */ - public filter: string; - - /** ListVersionsRequest pageSize. */ - public pageSize: number; - - /** ListVersionsRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new ListVersionsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListVersionsRequest instance - */ - public static create(properties?: google.cloud.apihub.v1.IListVersionsRequest): google.cloud.apihub.v1.ListVersionsRequest; - - /** - * Encodes the specified ListVersionsRequest message. Does not implicitly {@link google.cloud.apihub.v1.ListVersionsRequest.verify|verify} messages. - * @param message ListVersionsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.IListVersionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListVersionsRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListVersionsRequest.verify|verify} messages. - * @param message ListVersionsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.IListVersionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListVersionsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListVersionsRequest - * @throws {Error} If the payload is not 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.apihub.v1.ListVersionsRequest; - - /** - * Decodes a ListVersionsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListVersionsRequest - * @throws {Error} If the payload 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.apihub.v1.ListVersionsRequest; - - /** - * Verifies a ListVersionsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListVersionsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListVersionsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.ListVersionsRequest; - - /** - * Creates a plain object from a ListVersionsRequest message. Also converts values to other types if specified. - * @param message ListVersionsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.ListVersionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListVersionsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListVersionsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListVersionsResponse. */ - interface IListVersionsResponse { - - /** ListVersionsResponse versions */ - versions?: (google.cloud.apihub.v1.IVersion[]|null); - - /** ListVersionsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListVersionsResponse. */ - class ListVersionsResponse implements IListVersionsResponse { - - /** - * Constructs a new ListVersionsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.IListVersionsResponse); - - /** ListVersionsResponse versions. */ - public versions: google.cloud.apihub.v1.IVersion[]; - - /** ListVersionsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListVersionsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListVersionsResponse instance - */ - public static create(properties?: google.cloud.apihub.v1.IListVersionsResponse): google.cloud.apihub.v1.ListVersionsResponse; - - /** - * Encodes the specified ListVersionsResponse message. Does not implicitly {@link google.cloud.apihub.v1.ListVersionsResponse.verify|verify} messages. - * @param message ListVersionsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.IListVersionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListVersionsResponse message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListVersionsResponse.verify|verify} messages. - * @param message ListVersionsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.IListVersionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListVersionsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListVersionsResponse - * @throws {Error} If the payload is not 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.apihub.v1.ListVersionsResponse; - - /** - * Decodes a ListVersionsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListVersionsResponse - * @throws {Error} If the payload 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.apihub.v1.ListVersionsResponse; - - /** - * Verifies a ListVersionsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListVersionsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListVersionsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.ListVersionsResponse; - - /** - * Creates a plain object from a ListVersionsResponse message. Also converts values to other types if specified. - * @param message ListVersionsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.ListVersionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListVersionsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListVersionsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CreateSpecRequest. */ - interface ICreateSpecRequest { - - /** CreateSpecRequest parent */ - parent?: (string|null); - - /** CreateSpecRequest specId */ - specId?: (string|null); - - /** CreateSpecRequest spec */ - spec?: (google.cloud.apihub.v1.ISpec|null); - } - - /** Represents a CreateSpecRequest. */ - class CreateSpecRequest implements ICreateSpecRequest { - - /** - * Constructs a new CreateSpecRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.ICreateSpecRequest); - - /** CreateSpecRequest parent. */ - public parent: string; - - /** CreateSpecRequest specId. */ - public specId: string; - - /** CreateSpecRequest spec. */ - public spec?: (google.cloud.apihub.v1.ISpec|null); - - /** - * Creates a new CreateSpecRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateSpecRequest instance - */ - public static create(properties?: google.cloud.apihub.v1.ICreateSpecRequest): google.cloud.apihub.v1.CreateSpecRequest; - - /** - * Encodes the specified CreateSpecRequest message. Does not implicitly {@link google.cloud.apihub.v1.CreateSpecRequest.verify|verify} messages. - * @param message CreateSpecRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.ICreateSpecRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateSpecRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.CreateSpecRequest.verify|verify} messages. - * @param message CreateSpecRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.ICreateSpecRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateSpecRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateSpecRequest - * @throws {Error} If the payload is not 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.apihub.v1.CreateSpecRequest; - - /** - * Decodes a CreateSpecRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateSpecRequest - * @throws {Error} If the payload 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.apihub.v1.CreateSpecRequest; - - /** - * Verifies a CreateSpecRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateSpecRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateSpecRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.CreateSpecRequest; - - /** - * Creates a plain object from a CreateSpecRequest message. Also converts values to other types if specified. - * @param message CreateSpecRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.CreateSpecRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateSpecRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateSpecRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetSpecRequest. */ - interface IGetSpecRequest { - - /** GetSpecRequest name */ - name?: (string|null); - } - - /** Represents a GetSpecRequest. */ - class GetSpecRequest implements IGetSpecRequest { - - /** - * Constructs a new GetSpecRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.IGetSpecRequest); - - /** GetSpecRequest name. */ - public name: string; - - /** - * Creates a new GetSpecRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetSpecRequest instance - */ - public static create(properties?: google.cloud.apihub.v1.IGetSpecRequest): google.cloud.apihub.v1.GetSpecRequest; - - /** - * Encodes the specified GetSpecRequest message. Does not implicitly {@link google.cloud.apihub.v1.GetSpecRequest.verify|verify} messages. - * @param message GetSpecRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.IGetSpecRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetSpecRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.GetSpecRequest.verify|verify} messages. - * @param message GetSpecRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.IGetSpecRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetSpecRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetSpecRequest - * @throws {Error} If the payload is not 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.apihub.v1.GetSpecRequest; - - /** - * Decodes a GetSpecRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetSpecRequest - * @throws {Error} If the payload 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.apihub.v1.GetSpecRequest; - - /** - * Verifies a GetSpecRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetSpecRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetSpecRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.GetSpecRequest; - - /** - * Creates a plain object from a GetSpecRequest message. Also converts values to other types if specified. - * @param message GetSpecRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.GetSpecRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetSpecRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetSpecRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateSpecRequest. */ - interface IUpdateSpecRequest { - - /** UpdateSpecRequest spec */ - spec?: (google.cloud.apihub.v1.ISpec|null); - - /** UpdateSpecRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - } - - /** Represents an UpdateSpecRequest. */ - class UpdateSpecRequest implements IUpdateSpecRequest { - - /** - * Constructs a new UpdateSpecRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.IUpdateSpecRequest); - - /** UpdateSpecRequest spec. */ - public spec?: (google.cloud.apihub.v1.ISpec|null); - - /** UpdateSpecRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** - * Creates a new UpdateSpecRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateSpecRequest instance - */ - public static create(properties?: google.cloud.apihub.v1.IUpdateSpecRequest): google.cloud.apihub.v1.UpdateSpecRequest; - - /** - * Encodes the specified UpdateSpecRequest message. Does not implicitly {@link google.cloud.apihub.v1.UpdateSpecRequest.verify|verify} messages. - * @param message UpdateSpecRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.IUpdateSpecRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateSpecRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.UpdateSpecRequest.verify|verify} messages. - * @param message UpdateSpecRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.IUpdateSpecRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateSpecRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateSpecRequest - * @throws {Error} If the payload is not 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.apihub.v1.UpdateSpecRequest; - - /** - * Decodes an UpdateSpecRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateSpecRequest - * @throws {Error} If the payload 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.apihub.v1.UpdateSpecRequest; - - /** - * Verifies an UpdateSpecRequest message. - * @param message Plain 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 UpdateSpecRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateSpecRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.UpdateSpecRequest; - - /** - * Creates a plain object from an UpdateSpecRequest message. Also converts values to other types if specified. - * @param message UpdateSpecRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.UpdateSpecRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateSpecRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateSpecRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteSpecRequest. */ - interface IDeleteSpecRequest { - - /** DeleteSpecRequest name */ - name?: (string|null); - } - - /** Represents a DeleteSpecRequest. */ - class DeleteSpecRequest implements IDeleteSpecRequest { - - /** - * Constructs a new DeleteSpecRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.IDeleteSpecRequest); - - /** DeleteSpecRequest name. */ - public name: string; - - /** - * Creates a new DeleteSpecRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteSpecRequest instance - */ - public static create(properties?: google.cloud.apihub.v1.IDeleteSpecRequest): google.cloud.apihub.v1.DeleteSpecRequest; - - /** - * Encodes the specified DeleteSpecRequest message. Does not implicitly {@link google.cloud.apihub.v1.DeleteSpecRequest.verify|verify} messages. - * @param message DeleteSpecRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.IDeleteSpecRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteSpecRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.DeleteSpecRequest.verify|verify} messages. - * @param message DeleteSpecRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.IDeleteSpecRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteSpecRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteSpecRequest - * @throws {Error} If the payload is not 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.apihub.v1.DeleteSpecRequest; - - /** - * Decodes a DeleteSpecRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteSpecRequest - * @throws {Error} If the payload 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.apihub.v1.DeleteSpecRequest; - - /** - * Verifies a DeleteSpecRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteSpecRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteSpecRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.DeleteSpecRequest; - - /** - * Creates a plain object from a DeleteSpecRequest message. Also converts values to other types if specified. - * @param message DeleteSpecRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.DeleteSpecRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteSpecRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteSpecRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListSpecsRequest. */ - interface IListSpecsRequest { - - /** ListSpecsRequest parent */ - parent?: (string|null); - - /** ListSpecsRequest filter */ - filter?: (string|null); - - /** ListSpecsRequest pageSize */ - pageSize?: (number|null); - - /** ListSpecsRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListSpecsRequest. */ - class ListSpecsRequest implements IListSpecsRequest { - - /** - * Constructs a new ListSpecsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.IListSpecsRequest); - - /** ListSpecsRequest parent. */ - public parent: string; - - /** ListSpecsRequest filter. */ - public filter: string; - - /** ListSpecsRequest pageSize. */ - public pageSize: number; - - /** ListSpecsRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new ListSpecsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListSpecsRequest instance - */ - public static create(properties?: google.cloud.apihub.v1.IListSpecsRequest): google.cloud.apihub.v1.ListSpecsRequest; - - /** - * Encodes the specified ListSpecsRequest message. Does not implicitly {@link google.cloud.apihub.v1.ListSpecsRequest.verify|verify} messages. - * @param message ListSpecsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.IListSpecsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListSpecsRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListSpecsRequest.verify|verify} messages. - * @param message ListSpecsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.IListSpecsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListSpecsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListSpecsRequest - * @throws {Error} If the payload is not 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.apihub.v1.ListSpecsRequest; - - /** - * Decodes a ListSpecsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListSpecsRequest - * @throws {Error} If the payload 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.apihub.v1.ListSpecsRequest; - - /** - * Verifies a ListSpecsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListSpecsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListSpecsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.ListSpecsRequest; - - /** - * Creates a plain object from a ListSpecsRequest message. Also converts values to other types if specified. - * @param message ListSpecsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.ListSpecsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListSpecsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListSpecsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListSpecsResponse. */ - interface IListSpecsResponse { - - /** ListSpecsResponse specs */ - specs?: (google.cloud.apihub.v1.ISpec[]|null); - - /** ListSpecsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListSpecsResponse. */ - class ListSpecsResponse implements IListSpecsResponse { - - /** - * Constructs a new ListSpecsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.IListSpecsResponse); - - /** ListSpecsResponse specs. */ - public specs: google.cloud.apihub.v1.ISpec[]; - - /** ListSpecsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListSpecsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListSpecsResponse instance - */ - public static create(properties?: google.cloud.apihub.v1.IListSpecsResponse): google.cloud.apihub.v1.ListSpecsResponse; - - /** - * Encodes the specified ListSpecsResponse message. Does not implicitly {@link google.cloud.apihub.v1.ListSpecsResponse.verify|verify} messages. - * @param message ListSpecsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.IListSpecsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListSpecsResponse message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListSpecsResponse.verify|verify} messages. - * @param message ListSpecsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.IListSpecsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListSpecsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListSpecsResponse - * @throws {Error} If the payload is not 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.apihub.v1.ListSpecsResponse; - - /** - * Decodes a ListSpecsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListSpecsResponse - * @throws {Error} If the payload 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.apihub.v1.ListSpecsResponse; - - /** - * Verifies a ListSpecsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListSpecsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListSpecsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.ListSpecsResponse; - - /** - * Creates a plain object from a ListSpecsResponse message. Also converts values to other types if specified. - * @param message ListSpecsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.ListSpecsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListSpecsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListSpecsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetSpecContentsRequest. */ - interface IGetSpecContentsRequest { - - /** GetSpecContentsRequest name */ - name?: (string|null); - } - - /** Represents a GetSpecContentsRequest. */ - class GetSpecContentsRequest implements IGetSpecContentsRequest { - - /** - * Constructs a new GetSpecContentsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.IGetSpecContentsRequest); - - /** GetSpecContentsRequest name. */ - public name: string; - - /** - * Creates a new GetSpecContentsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetSpecContentsRequest instance - */ - public static create(properties?: google.cloud.apihub.v1.IGetSpecContentsRequest): google.cloud.apihub.v1.GetSpecContentsRequest; - - /** - * Encodes the specified GetSpecContentsRequest message. Does not implicitly {@link google.cloud.apihub.v1.GetSpecContentsRequest.verify|verify} messages. - * @param message GetSpecContentsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.IGetSpecContentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetSpecContentsRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.GetSpecContentsRequest.verify|verify} messages. - * @param message GetSpecContentsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.IGetSpecContentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetSpecContentsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetSpecContentsRequest - * @throws {Error} If the payload is not 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.apihub.v1.GetSpecContentsRequest; - - /** - * Decodes a GetSpecContentsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetSpecContentsRequest - * @throws {Error} If the payload 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.apihub.v1.GetSpecContentsRequest; - - /** - * Verifies a GetSpecContentsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetSpecContentsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetSpecContentsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.GetSpecContentsRequest; - - /** - * Creates a plain object from a GetSpecContentsRequest message. Also converts values to other types if specified. - * @param message GetSpecContentsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.GetSpecContentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetSpecContentsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetSpecContentsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetApiOperationRequest. */ - interface IGetApiOperationRequest { - - /** GetApiOperationRequest name */ - name?: (string|null); - } - - /** Represents a GetApiOperationRequest. */ - class GetApiOperationRequest implements IGetApiOperationRequest { - - /** - * Constructs a new GetApiOperationRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.IGetApiOperationRequest); - - /** GetApiOperationRequest name. */ - public name: string; - - /** - * Creates a new GetApiOperationRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetApiOperationRequest instance - */ - public static create(properties?: google.cloud.apihub.v1.IGetApiOperationRequest): google.cloud.apihub.v1.GetApiOperationRequest; - - /** - * Encodes the specified GetApiOperationRequest message. Does not implicitly {@link google.cloud.apihub.v1.GetApiOperationRequest.verify|verify} messages. - * @param message GetApiOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.IGetApiOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetApiOperationRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.GetApiOperationRequest.verify|verify} messages. - * @param message GetApiOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.IGetApiOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetApiOperationRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetApiOperationRequest - * @throws {Error} If the payload is not 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.apihub.v1.GetApiOperationRequest; - - /** - * Decodes a GetApiOperationRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetApiOperationRequest - * @throws {Error} If the payload 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.apihub.v1.GetApiOperationRequest; - - /** - * Verifies a GetApiOperationRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetApiOperationRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetApiOperationRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.GetApiOperationRequest; - - /** - * Creates a plain object from a GetApiOperationRequest message. Also converts values to other types if specified. - * @param message GetApiOperationRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.GetApiOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetApiOperationRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetApiOperationRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListApiOperationsRequest. */ - interface IListApiOperationsRequest { - - /** ListApiOperationsRequest parent */ - parent?: (string|null); - - /** ListApiOperationsRequest filter */ - filter?: (string|null); - - /** ListApiOperationsRequest pageSize */ - pageSize?: (number|null); - - /** ListApiOperationsRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListApiOperationsRequest. */ - class ListApiOperationsRequest implements IListApiOperationsRequest { - - /** - * Constructs a new ListApiOperationsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.IListApiOperationsRequest); - - /** ListApiOperationsRequest parent. */ - public parent: string; - - /** ListApiOperationsRequest filter. */ - public filter: string; - - /** ListApiOperationsRequest pageSize. */ - public pageSize: number; - - /** ListApiOperationsRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new ListApiOperationsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListApiOperationsRequest instance - */ - public static create(properties?: google.cloud.apihub.v1.IListApiOperationsRequest): google.cloud.apihub.v1.ListApiOperationsRequest; - - /** - * Encodes the specified ListApiOperationsRequest message. Does not implicitly {@link google.cloud.apihub.v1.ListApiOperationsRequest.verify|verify} messages. - * @param message ListApiOperationsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.IListApiOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListApiOperationsRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListApiOperationsRequest.verify|verify} messages. - * @param message ListApiOperationsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.IListApiOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListApiOperationsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListApiOperationsRequest - * @throws {Error} If the payload is not 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.apihub.v1.ListApiOperationsRequest; - - /** - * Decodes a ListApiOperationsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListApiOperationsRequest - * @throws {Error} If the payload 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.apihub.v1.ListApiOperationsRequest; - - /** - * Verifies a ListApiOperationsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListApiOperationsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListApiOperationsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.ListApiOperationsRequest; - - /** - * Creates a plain object from a ListApiOperationsRequest message. Also converts values to other types if specified. - * @param message ListApiOperationsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.ListApiOperationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListApiOperationsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListApiOperationsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListApiOperationsResponse. */ - interface IListApiOperationsResponse { - - /** ListApiOperationsResponse apiOperations */ - apiOperations?: (google.cloud.apihub.v1.IApiOperation[]|null); - - /** ListApiOperationsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListApiOperationsResponse. */ - class ListApiOperationsResponse implements IListApiOperationsResponse { - - /** - * Constructs a new ListApiOperationsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.IListApiOperationsResponse); - - /** ListApiOperationsResponse apiOperations. */ - public apiOperations: google.cloud.apihub.v1.IApiOperation[]; - - /** ListApiOperationsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListApiOperationsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListApiOperationsResponse instance - */ - public static create(properties?: google.cloud.apihub.v1.IListApiOperationsResponse): google.cloud.apihub.v1.ListApiOperationsResponse; - - /** - * Encodes the specified ListApiOperationsResponse message. Does not implicitly {@link google.cloud.apihub.v1.ListApiOperationsResponse.verify|verify} messages. - * @param message ListApiOperationsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.IListApiOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListApiOperationsResponse message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListApiOperationsResponse.verify|verify} messages. - * @param message ListApiOperationsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.IListApiOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListApiOperationsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListApiOperationsResponse - * @throws {Error} If the payload is not 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.apihub.v1.ListApiOperationsResponse; - - /** - * Decodes a ListApiOperationsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListApiOperationsResponse - * @throws {Error} If the payload 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.apihub.v1.ListApiOperationsResponse; - - /** - * Verifies a ListApiOperationsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListApiOperationsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListApiOperationsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.ListApiOperationsResponse; - - /** - * Creates a plain object from a ListApiOperationsResponse message. Also converts values to other types if specified. - * @param message ListApiOperationsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.ListApiOperationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListApiOperationsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListApiOperationsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetDefinitionRequest. */ - interface IGetDefinitionRequest { - - /** GetDefinitionRequest name */ - name?: (string|null); - } - - /** Represents a GetDefinitionRequest. */ - class GetDefinitionRequest implements IGetDefinitionRequest { - - /** - * Constructs a new GetDefinitionRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.IGetDefinitionRequest); - - /** GetDefinitionRequest name. */ - public name: string; - - /** - * Creates a new GetDefinitionRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetDefinitionRequest instance - */ - public static create(properties?: google.cloud.apihub.v1.IGetDefinitionRequest): google.cloud.apihub.v1.GetDefinitionRequest; - - /** - * Encodes the specified GetDefinitionRequest message. Does not implicitly {@link google.cloud.apihub.v1.GetDefinitionRequest.verify|verify} messages. - * @param message GetDefinitionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.IGetDefinitionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetDefinitionRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.GetDefinitionRequest.verify|verify} messages. - * @param message GetDefinitionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.IGetDefinitionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetDefinitionRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetDefinitionRequest - * @throws {Error} If the payload is not 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.apihub.v1.GetDefinitionRequest; - - /** - * Decodes a GetDefinitionRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetDefinitionRequest - * @throws {Error} If the payload 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.apihub.v1.GetDefinitionRequest; - - /** - * Verifies a GetDefinitionRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetDefinitionRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetDefinitionRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.GetDefinitionRequest; - - /** - * Creates a plain object from a GetDefinitionRequest message. Also converts values to other types if specified. - * @param message GetDefinitionRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.GetDefinitionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetDefinitionRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetDefinitionRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CreateDeploymentRequest. */ - interface ICreateDeploymentRequest { - - /** CreateDeploymentRequest parent */ - parent?: (string|null); - - /** CreateDeploymentRequest deploymentId */ - deploymentId?: (string|null); - - /** CreateDeploymentRequest deployment */ - deployment?: (google.cloud.apihub.v1.IDeployment|null); - } - - /** Represents a CreateDeploymentRequest. */ - class CreateDeploymentRequest implements ICreateDeploymentRequest { - - /** - * Constructs a new CreateDeploymentRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.ICreateDeploymentRequest); - - /** CreateDeploymentRequest parent. */ - public parent: string; - - /** CreateDeploymentRequest deploymentId. */ - public deploymentId: string; - - /** CreateDeploymentRequest deployment. */ - public deployment?: (google.cloud.apihub.v1.IDeployment|null); - - /** - * Creates a new CreateDeploymentRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateDeploymentRequest instance - */ - public static create(properties?: google.cloud.apihub.v1.ICreateDeploymentRequest): google.cloud.apihub.v1.CreateDeploymentRequest; - - /** - * Encodes the specified CreateDeploymentRequest message. Does not implicitly {@link google.cloud.apihub.v1.CreateDeploymentRequest.verify|verify} messages. - * @param message CreateDeploymentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.ICreateDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.CreateDeploymentRequest.verify|verify} messages. - * @param message CreateDeploymentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.ICreateDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateDeploymentRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateDeploymentRequest - * @throws {Error} If the payload is not 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.apihub.v1.CreateDeploymentRequest; - - /** - * Decodes a CreateDeploymentRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateDeploymentRequest - * @throws {Error} If the payload 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.apihub.v1.CreateDeploymentRequest; - - /** - * Verifies a CreateDeploymentRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateDeploymentRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateDeploymentRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.CreateDeploymentRequest; - - /** - * Creates a plain object from a CreateDeploymentRequest message. Also converts values to other types if specified. - * @param message CreateDeploymentRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.CreateDeploymentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateDeploymentRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateDeploymentRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetDeploymentRequest. */ - interface IGetDeploymentRequest { - - /** GetDeploymentRequest name */ - name?: (string|null); - } - - /** Represents a GetDeploymentRequest. */ - class GetDeploymentRequest implements IGetDeploymentRequest { - - /** - * Constructs a new GetDeploymentRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.IGetDeploymentRequest); - - /** GetDeploymentRequest name. */ - public name: string; - - /** - * Creates a new GetDeploymentRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetDeploymentRequest instance - */ - public static create(properties?: google.cloud.apihub.v1.IGetDeploymentRequest): google.cloud.apihub.v1.GetDeploymentRequest; - - /** - * Encodes the specified GetDeploymentRequest message. Does not implicitly {@link google.cloud.apihub.v1.GetDeploymentRequest.verify|verify} messages. - * @param message GetDeploymentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.IGetDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.GetDeploymentRequest.verify|verify} messages. - * @param message GetDeploymentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.IGetDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetDeploymentRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetDeploymentRequest - * @throws {Error} If the payload is not 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.apihub.v1.GetDeploymentRequest; - - /** - * Decodes a GetDeploymentRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetDeploymentRequest - * @throws {Error} If the payload 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.apihub.v1.GetDeploymentRequest; - - /** - * Verifies a GetDeploymentRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetDeploymentRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetDeploymentRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.GetDeploymentRequest; - - /** - * Creates a plain object from a GetDeploymentRequest message. Also converts values to other types if specified. - * @param message GetDeploymentRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.GetDeploymentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetDeploymentRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetDeploymentRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateDeploymentRequest. */ - interface IUpdateDeploymentRequest { - - /** UpdateDeploymentRequest deployment */ - deployment?: (google.cloud.apihub.v1.IDeployment|null); - - /** UpdateDeploymentRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - } - - /** Represents an UpdateDeploymentRequest. */ - class UpdateDeploymentRequest implements IUpdateDeploymentRequest { - - /** - * Constructs a new UpdateDeploymentRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.IUpdateDeploymentRequest); - - /** UpdateDeploymentRequest deployment. */ - public deployment?: (google.cloud.apihub.v1.IDeployment|null); - - /** UpdateDeploymentRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** - * Creates a new UpdateDeploymentRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateDeploymentRequest instance - */ - public static create(properties?: google.cloud.apihub.v1.IUpdateDeploymentRequest): google.cloud.apihub.v1.UpdateDeploymentRequest; - - /** - * Encodes the specified UpdateDeploymentRequest message. Does not implicitly {@link google.cloud.apihub.v1.UpdateDeploymentRequest.verify|verify} messages. - * @param message UpdateDeploymentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.IUpdateDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.UpdateDeploymentRequest.verify|verify} messages. - * @param message UpdateDeploymentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.IUpdateDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateDeploymentRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateDeploymentRequest - * @throws {Error} If the payload is not 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.apihub.v1.UpdateDeploymentRequest; - - /** - * Decodes an UpdateDeploymentRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateDeploymentRequest - * @throws {Error} If the payload 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.apihub.v1.UpdateDeploymentRequest; - - /** - * Verifies an UpdateDeploymentRequest message. - * @param message Plain 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 UpdateDeploymentRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateDeploymentRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.UpdateDeploymentRequest; - - /** - * Creates a plain object from an UpdateDeploymentRequest message. Also converts values to other types if specified. - * @param message UpdateDeploymentRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.UpdateDeploymentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateDeploymentRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateDeploymentRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteDeploymentRequest. */ - interface IDeleteDeploymentRequest { - - /** DeleteDeploymentRequest name */ - name?: (string|null); - } - - /** Represents a DeleteDeploymentRequest. */ - class DeleteDeploymentRequest implements IDeleteDeploymentRequest { - - /** - * Constructs a new DeleteDeploymentRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.IDeleteDeploymentRequest); - - /** DeleteDeploymentRequest name. */ - public name: string; - - /** - * Creates a new DeleteDeploymentRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteDeploymentRequest instance - */ - public static create(properties?: google.cloud.apihub.v1.IDeleteDeploymentRequest): google.cloud.apihub.v1.DeleteDeploymentRequest; - - /** - * Encodes the specified DeleteDeploymentRequest message. Does not implicitly {@link google.cloud.apihub.v1.DeleteDeploymentRequest.verify|verify} messages. - * @param message DeleteDeploymentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.IDeleteDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.DeleteDeploymentRequest.verify|verify} messages. - * @param message DeleteDeploymentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.IDeleteDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteDeploymentRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteDeploymentRequest - * @throws {Error} If the payload is not 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.apihub.v1.DeleteDeploymentRequest; - - /** - * Decodes a DeleteDeploymentRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteDeploymentRequest - * @throws {Error} If the payload 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.apihub.v1.DeleteDeploymentRequest; - - /** - * Verifies a DeleteDeploymentRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteDeploymentRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteDeploymentRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.DeleteDeploymentRequest; - - /** - * Creates a plain object from a DeleteDeploymentRequest message. Also converts values to other types if specified. - * @param message DeleteDeploymentRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.DeleteDeploymentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteDeploymentRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteDeploymentRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListDeploymentsRequest. */ - interface IListDeploymentsRequest { - - /** ListDeploymentsRequest parent */ - parent?: (string|null); - - /** ListDeploymentsRequest filter */ - filter?: (string|null); - - /** ListDeploymentsRequest pageSize */ - pageSize?: (number|null); - - /** ListDeploymentsRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListDeploymentsRequest. */ - class ListDeploymentsRequest implements IListDeploymentsRequest { - - /** - * Constructs a new ListDeploymentsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.IListDeploymentsRequest); - - /** ListDeploymentsRequest parent. */ - public parent: string; - - /** ListDeploymentsRequest filter. */ - public filter: string; - - /** ListDeploymentsRequest pageSize. */ - public pageSize: number; - - /** ListDeploymentsRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new ListDeploymentsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListDeploymentsRequest instance - */ - public static create(properties?: google.cloud.apihub.v1.IListDeploymentsRequest): google.cloud.apihub.v1.ListDeploymentsRequest; - - /** - * Encodes the specified ListDeploymentsRequest message. Does not implicitly {@link google.cloud.apihub.v1.ListDeploymentsRequest.verify|verify} messages. - * @param message ListDeploymentsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.IListDeploymentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListDeploymentsRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListDeploymentsRequest.verify|verify} messages. - * @param message ListDeploymentsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.IListDeploymentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListDeploymentsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListDeploymentsRequest - * @throws {Error} If the payload is not 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.apihub.v1.ListDeploymentsRequest; - - /** - * Decodes a ListDeploymentsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListDeploymentsRequest - * @throws {Error} If the payload 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.apihub.v1.ListDeploymentsRequest; - - /** - * Verifies a ListDeploymentsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListDeploymentsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListDeploymentsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.ListDeploymentsRequest; - - /** - * Creates a plain object from a ListDeploymentsRequest message. Also converts values to other types if specified. - * @param message ListDeploymentsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.ListDeploymentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListDeploymentsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListDeploymentsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListDeploymentsResponse. */ - interface IListDeploymentsResponse { - - /** ListDeploymentsResponse deployments */ - deployments?: (google.cloud.apihub.v1.IDeployment[]|null); - - /** ListDeploymentsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListDeploymentsResponse. */ - class ListDeploymentsResponse implements IListDeploymentsResponse { - - /** - * Constructs a new ListDeploymentsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.IListDeploymentsResponse); - - /** ListDeploymentsResponse deployments. */ - public deployments: google.cloud.apihub.v1.IDeployment[]; - - /** ListDeploymentsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListDeploymentsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListDeploymentsResponse instance - */ - public static create(properties?: google.cloud.apihub.v1.IListDeploymentsResponse): google.cloud.apihub.v1.ListDeploymentsResponse; - - /** - * Encodes the specified ListDeploymentsResponse message. Does not implicitly {@link google.cloud.apihub.v1.ListDeploymentsResponse.verify|verify} messages. - * @param message ListDeploymentsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.IListDeploymentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListDeploymentsResponse message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListDeploymentsResponse.verify|verify} messages. - * @param message ListDeploymentsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.IListDeploymentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListDeploymentsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListDeploymentsResponse - * @throws {Error} If the payload is not 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.apihub.v1.ListDeploymentsResponse; - - /** - * Decodes a ListDeploymentsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListDeploymentsResponse - * @throws {Error} If the payload 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.apihub.v1.ListDeploymentsResponse; - - /** - * Verifies a ListDeploymentsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListDeploymentsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListDeploymentsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.ListDeploymentsResponse; - - /** - * Creates a plain object from a ListDeploymentsResponse message. Also converts values to other types if specified. - * @param message ListDeploymentsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.ListDeploymentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListDeploymentsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListDeploymentsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CreateAttributeRequest. */ - interface ICreateAttributeRequest { - - /** CreateAttributeRequest parent */ - parent?: (string|null); - - /** CreateAttributeRequest attributeId */ - attributeId?: (string|null); - - /** CreateAttributeRequest attribute */ - attribute?: (google.cloud.apihub.v1.IAttribute|null); - } - - /** Represents a CreateAttributeRequest. */ - class CreateAttributeRequest implements ICreateAttributeRequest { - - /** - * Constructs a new CreateAttributeRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.ICreateAttributeRequest); - - /** CreateAttributeRequest parent. */ - public parent: string; - - /** CreateAttributeRequest attributeId. */ - public attributeId: string; - - /** CreateAttributeRequest attribute. */ - public attribute?: (google.cloud.apihub.v1.IAttribute|null); - - /** - * Creates a new CreateAttributeRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateAttributeRequest instance - */ - public static create(properties?: google.cloud.apihub.v1.ICreateAttributeRequest): google.cloud.apihub.v1.CreateAttributeRequest; - - /** - * Encodes the specified CreateAttributeRequest message. Does not implicitly {@link google.cloud.apihub.v1.CreateAttributeRequest.verify|verify} messages. - * @param message CreateAttributeRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.ICreateAttributeRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateAttributeRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.CreateAttributeRequest.verify|verify} messages. - * @param message CreateAttributeRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.ICreateAttributeRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateAttributeRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateAttributeRequest - * @throws {Error} If the payload is not 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.apihub.v1.CreateAttributeRequest; - - /** - * Decodes a CreateAttributeRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateAttributeRequest - * @throws {Error} If the payload 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.apihub.v1.CreateAttributeRequest; - - /** - * Verifies a CreateAttributeRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateAttributeRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateAttributeRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.CreateAttributeRequest; - - /** - * Creates a plain object from a CreateAttributeRequest message. Also converts values to other types if specified. - * @param message CreateAttributeRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.CreateAttributeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateAttributeRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateAttributeRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetAttributeRequest. */ - interface IGetAttributeRequest { - - /** GetAttributeRequest name */ - name?: (string|null); - } - - /** Represents a GetAttributeRequest. */ - class GetAttributeRequest implements IGetAttributeRequest { - - /** - * Constructs a new GetAttributeRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.IGetAttributeRequest); - - /** GetAttributeRequest name. */ - public name: string; - - /** - * Creates a new GetAttributeRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetAttributeRequest instance - */ - public static create(properties?: google.cloud.apihub.v1.IGetAttributeRequest): google.cloud.apihub.v1.GetAttributeRequest; - - /** - * Encodes the specified GetAttributeRequest message. Does not implicitly {@link google.cloud.apihub.v1.GetAttributeRequest.verify|verify} messages. - * @param message GetAttributeRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.IGetAttributeRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetAttributeRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.GetAttributeRequest.verify|verify} messages. - * @param message GetAttributeRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.IGetAttributeRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetAttributeRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetAttributeRequest - * @throws {Error} If the payload is not 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.apihub.v1.GetAttributeRequest; - - /** - * Decodes a GetAttributeRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetAttributeRequest - * @throws {Error} If the payload 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.apihub.v1.GetAttributeRequest; - - /** - * Verifies a GetAttributeRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetAttributeRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetAttributeRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.GetAttributeRequest; - - /** - * Creates a plain object from a GetAttributeRequest message. Also converts values to other types if specified. - * @param message GetAttributeRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.GetAttributeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetAttributeRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetAttributeRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateAttributeRequest. */ - interface IUpdateAttributeRequest { - - /** UpdateAttributeRequest attribute */ - attribute?: (google.cloud.apihub.v1.IAttribute|null); - - /** UpdateAttributeRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - } - - /** Represents an UpdateAttributeRequest. */ - class UpdateAttributeRequest implements IUpdateAttributeRequest { - - /** - * Constructs a new UpdateAttributeRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.IUpdateAttributeRequest); - - /** UpdateAttributeRequest attribute. */ - public attribute?: (google.cloud.apihub.v1.IAttribute|null); - - /** UpdateAttributeRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** - * Creates a new UpdateAttributeRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateAttributeRequest instance - */ - public static create(properties?: google.cloud.apihub.v1.IUpdateAttributeRequest): google.cloud.apihub.v1.UpdateAttributeRequest; - - /** - * Encodes the specified UpdateAttributeRequest message. Does not implicitly {@link google.cloud.apihub.v1.UpdateAttributeRequest.verify|verify} messages. - * @param message UpdateAttributeRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.IUpdateAttributeRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateAttributeRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.UpdateAttributeRequest.verify|verify} messages. - * @param message UpdateAttributeRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.IUpdateAttributeRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateAttributeRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateAttributeRequest - * @throws {Error} If the payload is not 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.apihub.v1.UpdateAttributeRequest; - - /** - * Decodes an UpdateAttributeRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateAttributeRequest - * @throws {Error} If the payload 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.apihub.v1.UpdateAttributeRequest; - - /** - * Verifies an UpdateAttributeRequest message. - * @param message Plain 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 UpdateAttributeRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateAttributeRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.UpdateAttributeRequest; - - /** - * Creates a plain object from an UpdateAttributeRequest message. Also converts values to other types if specified. - * @param message UpdateAttributeRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.UpdateAttributeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateAttributeRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateAttributeRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteAttributeRequest. */ - interface IDeleteAttributeRequest { - - /** DeleteAttributeRequest name */ - name?: (string|null); - } - - /** Represents a DeleteAttributeRequest. */ - class DeleteAttributeRequest implements IDeleteAttributeRequest { - - /** - * Constructs a new DeleteAttributeRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.IDeleteAttributeRequest); - - /** DeleteAttributeRequest name. */ - public name: string; - - /** - * Creates a new DeleteAttributeRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteAttributeRequest instance - */ - public static create(properties?: google.cloud.apihub.v1.IDeleteAttributeRequest): google.cloud.apihub.v1.DeleteAttributeRequest; - - /** - * Encodes the specified DeleteAttributeRequest message. Does not implicitly {@link google.cloud.apihub.v1.DeleteAttributeRequest.verify|verify} messages. - * @param message DeleteAttributeRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.IDeleteAttributeRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteAttributeRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.DeleteAttributeRequest.verify|verify} messages. - * @param message DeleteAttributeRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.IDeleteAttributeRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteAttributeRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteAttributeRequest - * @throws {Error} If the payload is not 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.apihub.v1.DeleteAttributeRequest; - - /** - * Decodes a DeleteAttributeRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteAttributeRequest - * @throws {Error} If the payload 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.apihub.v1.DeleteAttributeRequest; - - /** - * Verifies a DeleteAttributeRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteAttributeRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteAttributeRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.DeleteAttributeRequest; - - /** - * Creates a plain object from a DeleteAttributeRequest message. Also converts values to other types if specified. - * @param message DeleteAttributeRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.DeleteAttributeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteAttributeRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteAttributeRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListAttributesRequest. */ - interface IListAttributesRequest { - - /** ListAttributesRequest parent */ - parent?: (string|null); - - /** ListAttributesRequest filter */ - filter?: (string|null); - - /** ListAttributesRequest pageSize */ - pageSize?: (number|null); - - /** ListAttributesRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListAttributesRequest. */ - class ListAttributesRequest implements IListAttributesRequest { - - /** - * Constructs a new ListAttributesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.IListAttributesRequest); - - /** ListAttributesRequest parent. */ - public parent: string; - - /** ListAttributesRequest filter. */ - public filter: string; - - /** ListAttributesRequest pageSize. */ - public pageSize: number; - - /** ListAttributesRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new ListAttributesRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListAttributesRequest instance - */ - public static create(properties?: google.cloud.apihub.v1.IListAttributesRequest): google.cloud.apihub.v1.ListAttributesRequest; - - /** - * Encodes the specified ListAttributesRequest message. Does not implicitly {@link google.cloud.apihub.v1.ListAttributesRequest.verify|verify} messages. - * @param message ListAttributesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.IListAttributesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListAttributesRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListAttributesRequest.verify|verify} messages. - * @param message ListAttributesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.IListAttributesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListAttributesRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListAttributesRequest - * @throws {Error} If the payload is not 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.apihub.v1.ListAttributesRequest; - - /** - * Decodes a ListAttributesRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListAttributesRequest - * @throws {Error} If the payload 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.apihub.v1.ListAttributesRequest; - - /** - * Verifies a ListAttributesRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListAttributesRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListAttributesRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.ListAttributesRequest; - - /** - * Creates a plain object from a ListAttributesRequest message. Also converts values to other types if specified. - * @param message ListAttributesRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.ListAttributesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListAttributesRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListAttributesRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListAttributesResponse. */ - interface IListAttributesResponse { - - /** ListAttributesResponse attributes */ - attributes?: (google.cloud.apihub.v1.IAttribute[]|null); - - /** ListAttributesResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListAttributesResponse. */ - class ListAttributesResponse implements IListAttributesResponse { - - /** - * Constructs a new ListAttributesResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.IListAttributesResponse); - - /** ListAttributesResponse attributes. */ - public attributes: google.cloud.apihub.v1.IAttribute[]; - - /** ListAttributesResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListAttributesResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListAttributesResponse instance - */ - public static create(properties?: google.cloud.apihub.v1.IListAttributesResponse): google.cloud.apihub.v1.ListAttributesResponse; - - /** - * Encodes the specified ListAttributesResponse message. Does not implicitly {@link google.cloud.apihub.v1.ListAttributesResponse.verify|verify} messages. - * @param message ListAttributesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.IListAttributesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListAttributesResponse message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListAttributesResponse.verify|verify} messages. - * @param message ListAttributesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.IListAttributesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListAttributesResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListAttributesResponse - * @throws {Error} If the payload is not 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.apihub.v1.ListAttributesResponse; - - /** - * Decodes a ListAttributesResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListAttributesResponse - * @throws {Error} If the payload 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.apihub.v1.ListAttributesResponse; - - /** - * Verifies a ListAttributesResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListAttributesResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListAttributesResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.ListAttributesResponse; - - /** - * Creates a plain object from a ListAttributesResponse message. Also converts values to other types if specified. - * @param message ListAttributesResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.ListAttributesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListAttributesResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListAttributesResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a SearchResourcesRequest. */ - interface ISearchResourcesRequest { - - /** SearchResourcesRequest location */ - location?: (string|null); - - /** SearchResourcesRequest query */ - query?: (string|null); - - /** SearchResourcesRequest filter */ - filter?: (string|null); - - /** SearchResourcesRequest pageSize */ - pageSize?: (number|null); - - /** SearchResourcesRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a SearchResourcesRequest. */ - class SearchResourcesRequest implements ISearchResourcesRequest { - - /** - * Constructs a new SearchResourcesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.ISearchResourcesRequest); - - /** SearchResourcesRequest location. */ - public location: string; - - /** SearchResourcesRequest query. */ - public query: string; - - /** SearchResourcesRequest filter. */ - public filter: string; - - /** SearchResourcesRequest pageSize. */ - public pageSize: number; - - /** SearchResourcesRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new SearchResourcesRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns SearchResourcesRequest instance - */ - public static create(properties?: google.cloud.apihub.v1.ISearchResourcesRequest): google.cloud.apihub.v1.SearchResourcesRequest; - - /** - * Encodes the specified SearchResourcesRequest message. Does not implicitly {@link google.cloud.apihub.v1.SearchResourcesRequest.verify|verify} messages. - * @param message SearchResourcesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.ISearchResourcesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SearchResourcesRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.SearchResourcesRequest.verify|verify} messages. - * @param message SearchResourcesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.ISearchResourcesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SearchResourcesRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SearchResourcesRequest - * @throws {Error} If the payload is not 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.apihub.v1.SearchResourcesRequest; - - /** - * Decodes a SearchResourcesRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SearchResourcesRequest - * @throws {Error} If the payload 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.apihub.v1.SearchResourcesRequest; - - /** - * Verifies a SearchResourcesRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SearchResourcesRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SearchResourcesRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.SearchResourcesRequest; - - /** - * Creates a plain object from a SearchResourcesRequest message. Also converts values to other types if specified. - * @param message SearchResourcesRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.SearchResourcesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SearchResourcesRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SearchResourcesRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an ApiHubResource. */ - interface IApiHubResource { - - /** ApiHubResource api */ - api?: (google.cloud.apihub.v1.IApi|null); - - /** ApiHubResource operation */ - operation?: (google.cloud.apihub.v1.IApiOperation|null); - - /** ApiHubResource deployment */ - deployment?: (google.cloud.apihub.v1.IDeployment|null); - - /** ApiHubResource spec */ - spec?: (google.cloud.apihub.v1.ISpec|null); - - /** ApiHubResource definition */ - definition?: (google.cloud.apihub.v1.IDefinition|null); - - /** ApiHubResource version */ - version?: (google.cloud.apihub.v1.IVersion|null); - } - - /** Represents an ApiHubResource. */ - class ApiHubResource implements IApiHubResource { - - /** - * Constructs a new ApiHubResource. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.IApiHubResource); - - /** ApiHubResource api. */ - public api?: (google.cloud.apihub.v1.IApi|null); - - /** ApiHubResource operation. */ - public operation?: (google.cloud.apihub.v1.IApiOperation|null); - - /** ApiHubResource deployment. */ - public deployment?: (google.cloud.apihub.v1.IDeployment|null); - - /** ApiHubResource spec. */ - public spec?: (google.cloud.apihub.v1.ISpec|null); - - /** ApiHubResource definition. */ - public definition?: (google.cloud.apihub.v1.IDefinition|null); - - /** ApiHubResource version. */ - public version?: (google.cloud.apihub.v1.IVersion|null); - - /** ApiHubResource resource. */ - public resource?: ("api"|"operation"|"deployment"|"spec"|"definition"|"version"); - - /** - * Creates a new ApiHubResource instance using the specified properties. - * @param [properties] Properties to set - * @returns ApiHubResource instance - */ - public static create(properties?: google.cloud.apihub.v1.IApiHubResource): google.cloud.apihub.v1.ApiHubResource; - - /** - * Encodes the specified ApiHubResource message. Does not implicitly {@link google.cloud.apihub.v1.ApiHubResource.verify|verify} messages. - * @param message ApiHubResource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.IApiHubResource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ApiHubResource message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ApiHubResource.verify|verify} messages. - * @param message ApiHubResource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.IApiHubResource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ApiHubResource message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ApiHubResource - * @throws {Error} If the payload is not 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.apihub.v1.ApiHubResource; - - /** - * Decodes an ApiHubResource message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ApiHubResource - * @throws {Error} If the payload 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.apihub.v1.ApiHubResource; - - /** - * Verifies an ApiHubResource message. - * @param message Plain 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 ApiHubResource message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ApiHubResource - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.ApiHubResource; - - /** - * Creates a plain object from an ApiHubResource message. Also converts values to other types if specified. - * @param message ApiHubResource - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.ApiHubResource, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ApiHubResource to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ApiHubResource - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a SearchResult. */ - interface ISearchResult { - - /** SearchResult resource */ - resource?: (google.cloud.apihub.v1.IApiHubResource|null); - } - - /** Represents a SearchResult. */ - class SearchResult implements ISearchResult { - - /** - * Constructs a new SearchResult. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.ISearchResult); - - /** SearchResult resource. */ - public resource?: (google.cloud.apihub.v1.IApiHubResource|null); - - /** - * Creates a new SearchResult instance using the specified properties. - * @param [properties] Properties to set - * @returns SearchResult instance - */ - public static create(properties?: google.cloud.apihub.v1.ISearchResult): google.cloud.apihub.v1.SearchResult; - - /** - * Encodes the specified SearchResult message. Does not implicitly {@link google.cloud.apihub.v1.SearchResult.verify|verify} messages. - * @param message SearchResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.ISearchResult, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SearchResult message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.SearchResult.verify|verify} messages. - * @param message SearchResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.ISearchResult, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SearchResult message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SearchResult - * @throws {Error} If the payload is not 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.apihub.v1.SearchResult; - - /** - * Decodes a SearchResult message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SearchResult - * @throws {Error} If the payload 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.apihub.v1.SearchResult; - - /** - * Verifies a SearchResult message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SearchResult message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SearchResult - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.SearchResult; - - /** - * Creates a plain object from a SearchResult message. Also converts values to other types if specified. - * @param message SearchResult - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.SearchResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SearchResult to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SearchResult - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a SearchResourcesResponse. */ - interface ISearchResourcesResponse { - - /** SearchResourcesResponse searchResults */ - searchResults?: (google.cloud.apihub.v1.ISearchResult[]|null); - - /** SearchResourcesResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a SearchResourcesResponse. */ - class SearchResourcesResponse implements ISearchResourcesResponse { - - /** - * Constructs a new SearchResourcesResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.ISearchResourcesResponse); - - /** SearchResourcesResponse searchResults. */ - public searchResults: google.cloud.apihub.v1.ISearchResult[]; - - /** SearchResourcesResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new SearchResourcesResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns SearchResourcesResponse instance - */ - public static create(properties?: google.cloud.apihub.v1.ISearchResourcesResponse): google.cloud.apihub.v1.SearchResourcesResponse; - - /** - * Encodes the specified SearchResourcesResponse message. Does not implicitly {@link google.cloud.apihub.v1.SearchResourcesResponse.verify|verify} messages. - * @param message SearchResourcesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.ISearchResourcesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SearchResourcesResponse message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.SearchResourcesResponse.verify|verify} messages. - * @param message SearchResourcesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.ISearchResourcesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SearchResourcesResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SearchResourcesResponse - * @throws {Error} If the payload is not 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.apihub.v1.SearchResourcesResponse; - - /** - * Decodes a SearchResourcesResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SearchResourcesResponse - * @throws {Error} If the payload 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.apihub.v1.SearchResourcesResponse; - - /** - * Verifies a SearchResourcesResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SearchResourcesResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SearchResourcesResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.SearchResourcesResponse; - - /** - * Creates a plain object from a SearchResourcesResponse message. Also converts values to other types if specified. - * @param message SearchResourcesResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.SearchResourcesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SearchResourcesResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SearchResourcesResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CreateDependencyRequest. */ - interface ICreateDependencyRequest { - - /** CreateDependencyRequest parent */ - parent?: (string|null); - - /** CreateDependencyRequest dependencyId */ - dependencyId?: (string|null); - - /** CreateDependencyRequest dependency */ - dependency?: (google.cloud.apihub.v1.IDependency|null); - } - - /** Represents a CreateDependencyRequest. */ - class CreateDependencyRequest implements ICreateDependencyRequest { - - /** - * Constructs a new CreateDependencyRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.ICreateDependencyRequest); - - /** CreateDependencyRequest parent. */ - public parent: string; - - /** CreateDependencyRequest dependencyId. */ - public dependencyId: string; - - /** CreateDependencyRequest dependency. */ - public dependency?: (google.cloud.apihub.v1.IDependency|null); - - /** - * Creates a new CreateDependencyRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateDependencyRequest instance - */ - public static create(properties?: google.cloud.apihub.v1.ICreateDependencyRequest): google.cloud.apihub.v1.CreateDependencyRequest; - - /** - * Encodes the specified CreateDependencyRequest message. Does not implicitly {@link google.cloud.apihub.v1.CreateDependencyRequest.verify|verify} messages. - * @param message CreateDependencyRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.ICreateDependencyRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateDependencyRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.CreateDependencyRequest.verify|verify} messages. - * @param message CreateDependencyRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.ICreateDependencyRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateDependencyRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateDependencyRequest - * @throws {Error} If the payload is not 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.apihub.v1.CreateDependencyRequest; - - /** - * Decodes a CreateDependencyRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateDependencyRequest - * @throws {Error} If the payload 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.apihub.v1.CreateDependencyRequest; - - /** - * Verifies a CreateDependencyRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateDependencyRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateDependencyRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.CreateDependencyRequest; - - /** - * Creates a plain object from a CreateDependencyRequest message. Also converts values to other types if specified. - * @param message CreateDependencyRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.CreateDependencyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateDependencyRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateDependencyRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetDependencyRequest. */ - interface IGetDependencyRequest { - - /** GetDependencyRequest name */ - name?: (string|null); - } - - /** Represents a GetDependencyRequest. */ - class GetDependencyRequest implements IGetDependencyRequest { - - /** - * Constructs a new GetDependencyRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.IGetDependencyRequest); - - /** GetDependencyRequest name. */ - public name: string; - - /** - * Creates a new GetDependencyRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetDependencyRequest instance - */ - public static create(properties?: google.cloud.apihub.v1.IGetDependencyRequest): google.cloud.apihub.v1.GetDependencyRequest; - - /** - * Encodes the specified GetDependencyRequest message. Does not implicitly {@link google.cloud.apihub.v1.GetDependencyRequest.verify|verify} messages. - * @param message GetDependencyRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.IGetDependencyRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetDependencyRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.GetDependencyRequest.verify|verify} messages. - * @param message GetDependencyRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.IGetDependencyRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetDependencyRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetDependencyRequest - * @throws {Error} If the payload is not 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.apihub.v1.GetDependencyRequest; - - /** - * Decodes a GetDependencyRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetDependencyRequest - * @throws {Error} If the payload 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.apihub.v1.GetDependencyRequest; - - /** - * Verifies a GetDependencyRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetDependencyRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetDependencyRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.GetDependencyRequest; - - /** - * Creates a plain object from a GetDependencyRequest message. Also converts values to other types if specified. - * @param message GetDependencyRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.GetDependencyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetDependencyRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetDependencyRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateDependencyRequest. */ - interface IUpdateDependencyRequest { - - /** UpdateDependencyRequest dependency */ - dependency?: (google.cloud.apihub.v1.IDependency|null); - - /** UpdateDependencyRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - } - - /** Represents an UpdateDependencyRequest. */ - class UpdateDependencyRequest implements IUpdateDependencyRequest { - - /** - * Constructs a new UpdateDependencyRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.IUpdateDependencyRequest); - - /** UpdateDependencyRequest dependency. */ - public dependency?: (google.cloud.apihub.v1.IDependency|null); - - /** UpdateDependencyRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** - * Creates a new UpdateDependencyRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateDependencyRequest instance - */ - public static create(properties?: google.cloud.apihub.v1.IUpdateDependencyRequest): google.cloud.apihub.v1.UpdateDependencyRequest; - - /** - * Encodes the specified UpdateDependencyRequest message. Does not implicitly {@link google.cloud.apihub.v1.UpdateDependencyRequest.verify|verify} messages. - * @param message UpdateDependencyRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.IUpdateDependencyRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateDependencyRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.UpdateDependencyRequest.verify|verify} messages. - * @param message UpdateDependencyRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.IUpdateDependencyRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateDependencyRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateDependencyRequest - * @throws {Error} If the payload is not 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.apihub.v1.UpdateDependencyRequest; - - /** - * Decodes an UpdateDependencyRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateDependencyRequest - * @throws {Error} If the payload 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.apihub.v1.UpdateDependencyRequest; - - /** - * Verifies an UpdateDependencyRequest message. - * @param message Plain 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 UpdateDependencyRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateDependencyRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.UpdateDependencyRequest; - - /** - * Creates a plain object from an UpdateDependencyRequest message. Also converts values to other types if specified. - * @param message UpdateDependencyRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.UpdateDependencyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateDependencyRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateDependencyRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteDependencyRequest. */ - interface IDeleteDependencyRequest { - - /** DeleteDependencyRequest name */ - name?: (string|null); - } - - /** Represents a DeleteDependencyRequest. */ - class DeleteDependencyRequest implements IDeleteDependencyRequest { - - /** - * Constructs a new DeleteDependencyRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.IDeleteDependencyRequest); - - /** DeleteDependencyRequest name. */ - public name: string; - - /** - * Creates a new DeleteDependencyRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteDependencyRequest instance - */ - public static create(properties?: google.cloud.apihub.v1.IDeleteDependencyRequest): google.cloud.apihub.v1.DeleteDependencyRequest; - - /** - * Encodes the specified DeleteDependencyRequest message. Does not implicitly {@link google.cloud.apihub.v1.DeleteDependencyRequest.verify|verify} messages. - * @param message DeleteDependencyRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.IDeleteDependencyRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteDependencyRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.DeleteDependencyRequest.verify|verify} messages. - * @param message DeleteDependencyRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.IDeleteDependencyRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteDependencyRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteDependencyRequest - * @throws {Error} If the payload is not 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.apihub.v1.DeleteDependencyRequest; - - /** - * Decodes a DeleteDependencyRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteDependencyRequest - * @throws {Error} If the payload 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.apihub.v1.DeleteDependencyRequest; - - /** - * Verifies a DeleteDependencyRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteDependencyRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteDependencyRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.DeleteDependencyRequest; - - /** - * Creates a plain object from a DeleteDependencyRequest message. Also converts values to other types if specified. - * @param message DeleteDependencyRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.DeleteDependencyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteDependencyRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteDependencyRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListDependenciesRequest. */ - interface IListDependenciesRequest { - - /** ListDependenciesRequest parent */ - parent?: (string|null); - - /** ListDependenciesRequest filter */ - filter?: (string|null); - - /** ListDependenciesRequest pageSize */ - pageSize?: (number|null); - - /** ListDependenciesRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListDependenciesRequest. */ - class ListDependenciesRequest implements IListDependenciesRequest { - - /** - * Constructs a new ListDependenciesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.IListDependenciesRequest); - - /** ListDependenciesRequest parent. */ - public parent: string; - - /** ListDependenciesRequest filter. */ - public filter: string; - - /** ListDependenciesRequest pageSize. */ - public pageSize: number; - - /** ListDependenciesRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new ListDependenciesRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListDependenciesRequest instance - */ - public static create(properties?: google.cloud.apihub.v1.IListDependenciesRequest): google.cloud.apihub.v1.ListDependenciesRequest; - - /** - * Encodes the specified ListDependenciesRequest message. Does not implicitly {@link google.cloud.apihub.v1.ListDependenciesRequest.verify|verify} messages. - * @param message ListDependenciesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.IListDependenciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListDependenciesRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListDependenciesRequest.verify|verify} messages. - * @param message ListDependenciesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.IListDependenciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListDependenciesRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListDependenciesRequest - * @throws {Error} If the payload is not 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.apihub.v1.ListDependenciesRequest; - - /** - * Decodes a ListDependenciesRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListDependenciesRequest - * @throws {Error} If the payload 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.apihub.v1.ListDependenciesRequest; - - /** - * Verifies a ListDependenciesRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListDependenciesRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListDependenciesRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.ListDependenciesRequest; - - /** - * Creates a plain object from a ListDependenciesRequest message. Also converts values to other types if specified. - * @param message ListDependenciesRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.ListDependenciesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListDependenciesRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListDependenciesRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListDependenciesResponse. */ - interface IListDependenciesResponse { - - /** ListDependenciesResponse dependencies */ - dependencies?: (google.cloud.apihub.v1.IDependency[]|null); - - /** ListDependenciesResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListDependenciesResponse. */ - class ListDependenciesResponse implements IListDependenciesResponse { - - /** - * Constructs a new ListDependenciesResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.IListDependenciesResponse); - - /** ListDependenciesResponse dependencies. */ - public dependencies: google.cloud.apihub.v1.IDependency[]; - - /** ListDependenciesResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListDependenciesResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListDependenciesResponse instance - */ - public static create(properties?: google.cloud.apihub.v1.IListDependenciesResponse): google.cloud.apihub.v1.ListDependenciesResponse; - - /** - * Encodes the specified ListDependenciesResponse message. Does not implicitly {@link google.cloud.apihub.v1.ListDependenciesResponse.verify|verify} messages. - * @param message ListDependenciesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.IListDependenciesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListDependenciesResponse message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListDependenciesResponse.verify|verify} messages. - * @param message ListDependenciesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.IListDependenciesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListDependenciesResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListDependenciesResponse - * @throws {Error} If the payload is not 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.apihub.v1.ListDependenciesResponse; - - /** - * Decodes a ListDependenciesResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListDependenciesResponse - * @throws {Error} If the payload 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.apihub.v1.ListDependenciesResponse; - - /** - * Verifies a ListDependenciesResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListDependenciesResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListDependenciesResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.ListDependenciesResponse; - - /** - * Creates a plain object from a ListDependenciesResponse message. Also converts values to other types if specified. - * @param message ListDependenciesResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.ListDependenciesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListDependenciesResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListDependenciesResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CreateExternalApiRequest. */ - interface ICreateExternalApiRequest { - - /** CreateExternalApiRequest parent */ - parent?: (string|null); - - /** CreateExternalApiRequest externalApiId */ - externalApiId?: (string|null); - - /** CreateExternalApiRequest externalApi */ - externalApi?: (google.cloud.apihub.v1.IExternalApi|null); - } - - /** Represents a CreateExternalApiRequest. */ - class CreateExternalApiRequest implements ICreateExternalApiRequest { - - /** - * Constructs a new CreateExternalApiRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.ICreateExternalApiRequest); - - /** CreateExternalApiRequest parent. */ - public parent: string; - - /** CreateExternalApiRequest externalApiId. */ - public externalApiId: string; - - /** CreateExternalApiRequest externalApi. */ - public externalApi?: (google.cloud.apihub.v1.IExternalApi|null); - - /** - * Creates a new CreateExternalApiRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateExternalApiRequest instance - */ - public static create(properties?: google.cloud.apihub.v1.ICreateExternalApiRequest): google.cloud.apihub.v1.CreateExternalApiRequest; - - /** - * Encodes the specified CreateExternalApiRequest message. Does not implicitly {@link google.cloud.apihub.v1.CreateExternalApiRequest.verify|verify} messages. - * @param message CreateExternalApiRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.ICreateExternalApiRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateExternalApiRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.CreateExternalApiRequest.verify|verify} messages. - * @param message CreateExternalApiRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.ICreateExternalApiRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateExternalApiRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateExternalApiRequest - * @throws {Error} If the payload is not 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.apihub.v1.CreateExternalApiRequest; - - /** - * Decodes a CreateExternalApiRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateExternalApiRequest - * @throws {Error} If the payload 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.apihub.v1.CreateExternalApiRequest; - - /** - * Verifies a CreateExternalApiRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateExternalApiRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateExternalApiRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.CreateExternalApiRequest; - - /** - * Creates a plain object from a CreateExternalApiRequest message. Also converts values to other types if specified. - * @param message CreateExternalApiRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.CreateExternalApiRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateExternalApiRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateExternalApiRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetExternalApiRequest. */ - interface IGetExternalApiRequest { - - /** GetExternalApiRequest name */ - name?: (string|null); - } - - /** Represents a GetExternalApiRequest. */ - class GetExternalApiRequest implements IGetExternalApiRequest { - - /** - * Constructs a new GetExternalApiRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.IGetExternalApiRequest); - - /** GetExternalApiRequest name. */ - public name: string; - - /** - * Creates a new GetExternalApiRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetExternalApiRequest instance - */ - public static create(properties?: google.cloud.apihub.v1.IGetExternalApiRequest): google.cloud.apihub.v1.GetExternalApiRequest; - - /** - * Encodes the specified GetExternalApiRequest message. Does not implicitly {@link google.cloud.apihub.v1.GetExternalApiRequest.verify|verify} messages. - * @param message GetExternalApiRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.IGetExternalApiRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetExternalApiRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.GetExternalApiRequest.verify|verify} messages. - * @param message GetExternalApiRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.IGetExternalApiRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetExternalApiRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetExternalApiRequest - * @throws {Error} If the payload is not 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.apihub.v1.GetExternalApiRequest; - - /** - * Decodes a GetExternalApiRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetExternalApiRequest - * @throws {Error} If the payload 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.apihub.v1.GetExternalApiRequest; - - /** - * Verifies a GetExternalApiRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetExternalApiRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetExternalApiRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.GetExternalApiRequest; - - /** - * Creates a plain object from a GetExternalApiRequest message. Also converts values to other types if specified. - * @param message GetExternalApiRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.GetExternalApiRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetExternalApiRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetExternalApiRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateExternalApiRequest. */ - interface IUpdateExternalApiRequest { - - /** UpdateExternalApiRequest externalApi */ - externalApi?: (google.cloud.apihub.v1.IExternalApi|null); - - /** UpdateExternalApiRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - } - - /** Represents an UpdateExternalApiRequest. */ - class UpdateExternalApiRequest implements IUpdateExternalApiRequest { - - /** - * Constructs a new UpdateExternalApiRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.IUpdateExternalApiRequest); - - /** UpdateExternalApiRequest externalApi. */ - public externalApi?: (google.cloud.apihub.v1.IExternalApi|null); - - /** UpdateExternalApiRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** - * Creates a new UpdateExternalApiRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateExternalApiRequest instance - */ - public static create(properties?: google.cloud.apihub.v1.IUpdateExternalApiRequest): google.cloud.apihub.v1.UpdateExternalApiRequest; - - /** - * Encodes the specified UpdateExternalApiRequest message. Does not implicitly {@link google.cloud.apihub.v1.UpdateExternalApiRequest.verify|verify} messages. - * @param message UpdateExternalApiRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.IUpdateExternalApiRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateExternalApiRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.UpdateExternalApiRequest.verify|verify} messages. - * @param message UpdateExternalApiRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.IUpdateExternalApiRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateExternalApiRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateExternalApiRequest - * @throws {Error} If the payload is not 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.apihub.v1.UpdateExternalApiRequest; - - /** - * Decodes an UpdateExternalApiRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateExternalApiRequest - * @throws {Error} If the payload 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.apihub.v1.UpdateExternalApiRequest; - - /** - * Verifies an UpdateExternalApiRequest message. - * @param message Plain 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 UpdateExternalApiRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateExternalApiRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.UpdateExternalApiRequest; - - /** - * Creates a plain object from an UpdateExternalApiRequest message. Also converts values to other types if specified. - * @param message UpdateExternalApiRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.UpdateExternalApiRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateExternalApiRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateExternalApiRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteExternalApiRequest. */ - interface IDeleteExternalApiRequest { - - /** DeleteExternalApiRequest name */ - name?: (string|null); - } - - /** Represents a DeleteExternalApiRequest. */ - class DeleteExternalApiRequest implements IDeleteExternalApiRequest { - - /** - * Constructs a new DeleteExternalApiRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.IDeleteExternalApiRequest); - - /** DeleteExternalApiRequest name. */ - public name: string; - - /** - * Creates a new DeleteExternalApiRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteExternalApiRequest instance - */ - public static create(properties?: google.cloud.apihub.v1.IDeleteExternalApiRequest): google.cloud.apihub.v1.DeleteExternalApiRequest; - - /** - * Encodes the specified DeleteExternalApiRequest message. Does not implicitly {@link google.cloud.apihub.v1.DeleteExternalApiRequest.verify|verify} messages. - * @param message DeleteExternalApiRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.IDeleteExternalApiRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteExternalApiRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.DeleteExternalApiRequest.verify|verify} messages. - * @param message DeleteExternalApiRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.IDeleteExternalApiRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteExternalApiRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteExternalApiRequest - * @throws {Error} If the payload is not 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.apihub.v1.DeleteExternalApiRequest; - - /** - * Decodes a DeleteExternalApiRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteExternalApiRequest - * @throws {Error} If the payload 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.apihub.v1.DeleteExternalApiRequest; - - /** - * Verifies a DeleteExternalApiRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteExternalApiRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteExternalApiRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.DeleteExternalApiRequest; - - /** - * Creates a plain object from a DeleteExternalApiRequest message. Also converts values to other types if specified. - * @param message DeleteExternalApiRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.DeleteExternalApiRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteExternalApiRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteExternalApiRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListExternalApisRequest. */ - interface IListExternalApisRequest { - - /** ListExternalApisRequest parent */ - parent?: (string|null); - - /** ListExternalApisRequest pageSize */ - pageSize?: (number|null); - - /** ListExternalApisRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListExternalApisRequest. */ - class ListExternalApisRequest implements IListExternalApisRequest { - - /** - * Constructs a new ListExternalApisRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.IListExternalApisRequest); - - /** ListExternalApisRequest parent. */ - public parent: string; - - /** ListExternalApisRequest pageSize. */ - public pageSize: number; - - /** ListExternalApisRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new ListExternalApisRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListExternalApisRequest instance - */ - public static create(properties?: google.cloud.apihub.v1.IListExternalApisRequest): google.cloud.apihub.v1.ListExternalApisRequest; - - /** - * Encodes the specified ListExternalApisRequest message. Does not implicitly {@link google.cloud.apihub.v1.ListExternalApisRequest.verify|verify} messages. - * @param message ListExternalApisRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.IListExternalApisRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListExternalApisRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListExternalApisRequest.verify|verify} messages. - * @param message ListExternalApisRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.IListExternalApisRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListExternalApisRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListExternalApisRequest - * @throws {Error} If the payload is not 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.apihub.v1.ListExternalApisRequest; - - /** - * Decodes a ListExternalApisRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListExternalApisRequest - * @throws {Error} If the payload 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.apihub.v1.ListExternalApisRequest; - - /** - * Verifies a ListExternalApisRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListExternalApisRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListExternalApisRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.ListExternalApisRequest; - - /** - * Creates a plain object from a ListExternalApisRequest message. Also converts values to other types if specified. - * @param message ListExternalApisRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.ListExternalApisRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListExternalApisRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListExternalApisRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListExternalApisResponse. */ - interface IListExternalApisResponse { - - /** ListExternalApisResponse externalApis */ - externalApis?: (google.cloud.apihub.v1.IExternalApi[]|null); - - /** ListExternalApisResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListExternalApisResponse. */ - class ListExternalApisResponse implements IListExternalApisResponse { - - /** - * Constructs a new ListExternalApisResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.IListExternalApisResponse); - - /** ListExternalApisResponse externalApis. */ - public externalApis: google.cloud.apihub.v1.IExternalApi[]; - - /** ListExternalApisResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListExternalApisResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListExternalApisResponse instance - */ - public static create(properties?: google.cloud.apihub.v1.IListExternalApisResponse): google.cloud.apihub.v1.ListExternalApisResponse; - - /** - * Encodes the specified ListExternalApisResponse message. Does not implicitly {@link google.cloud.apihub.v1.ListExternalApisResponse.verify|verify} messages. - * @param message ListExternalApisResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.IListExternalApisResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListExternalApisResponse message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListExternalApisResponse.verify|verify} messages. - * @param message ListExternalApisResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.IListExternalApisResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListExternalApisResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListExternalApisResponse - * @throws {Error} If the payload is not 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.apihub.v1.ListExternalApisResponse; - - /** - * Decodes a ListExternalApisResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListExternalApisResponse - * @throws {Error} If the payload 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.apihub.v1.ListExternalApisResponse; - - /** - * Verifies a ListExternalApisResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListExternalApisResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListExternalApisResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.ListExternalApisResponse; - - /** - * Creates a plain object from a ListExternalApisResponse message. Also converts values to other types if specified. - * @param message ListExternalApisResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.ListExternalApisResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListExternalApisResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListExternalApisResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** LintState enum. */ - enum LintState { - LINT_STATE_UNSPECIFIED = 0, - LINT_STATE_SUCCESS = 1, - LINT_STATE_ERROR = 2 - } - - /** Linter enum. */ - enum Linter { - LINTER_UNSPECIFIED = 0, - SPECTRAL = 1, - OTHER = 2 - } - - /** Severity enum. */ - enum Severity { - SEVERITY_UNSPECIFIED = 0, - SEVERITY_ERROR = 1, - SEVERITY_WARNING = 2, - SEVERITY_INFO = 3, - SEVERITY_HINT = 4 - } - - /** Properties of an Api. */ - interface IApi { - - /** Api name */ - name?: (string|null); - - /** Api displayName */ - displayName?: (string|null); - - /** Api description */ - description?: (string|null); - - /** Api documentation */ - documentation?: (google.cloud.apihub.v1.IDocumentation|null); - - /** Api owner */ - owner?: (google.cloud.apihub.v1.IOwner|null); - - /** Api versions */ - versions?: (string[]|null); - - /** Api createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** Api updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** Api targetUser */ - targetUser?: (google.cloud.apihub.v1.IAttributeValues|null); - - /** Api team */ - team?: (google.cloud.apihub.v1.IAttributeValues|null); - - /** Api businessUnit */ - businessUnit?: (google.cloud.apihub.v1.IAttributeValues|null); - - /** Api maturityLevel */ - maturityLevel?: (google.cloud.apihub.v1.IAttributeValues|null); - - /** Api attributes */ - attributes?: ({ [k: string]: google.cloud.apihub.v1.IAttributeValues }|null); - - /** Api apiStyle */ - apiStyle?: (google.cloud.apihub.v1.IAttributeValues|null); - - /** Api selectedVersion */ - selectedVersion?: (string|null); - } - - /** Represents an Api. */ - class Api implements IApi { - - /** - * Constructs a new Api. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.IApi); - - /** Api name. */ - public name: string; - - /** Api displayName. */ - public displayName: string; - - /** Api description. */ - public description: string; - - /** Api documentation. */ - public documentation?: (google.cloud.apihub.v1.IDocumentation|null); - - /** Api owner. */ - public owner?: (google.cloud.apihub.v1.IOwner|null); - - /** Api versions. */ - public versions: string[]; - - /** Api createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** Api updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** Api targetUser. */ - public targetUser?: (google.cloud.apihub.v1.IAttributeValues|null); - - /** Api team. */ - public team?: (google.cloud.apihub.v1.IAttributeValues|null); - - /** Api businessUnit. */ - public businessUnit?: (google.cloud.apihub.v1.IAttributeValues|null); - - /** Api maturityLevel. */ - public maturityLevel?: (google.cloud.apihub.v1.IAttributeValues|null); - - /** Api attributes. */ - public attributes: { [k: string]: google.cloud.apihub.v1.IAttributeValues }; - - /** Api apiStyle. */ - public apiStyle?: (google.cloud.apihub.v1.IAttributeValues|null); - - /** Api selectedVersion. */ - public selectedVersion: string; - - /** - * Creates a new Api instance using the specified properties. - * @param [properties] Properties to set - * @returns Api instance - */ - public static create(properties?: google.cloud.apihub.v1.IApi): google.cloud.apihub.v1.Api; - - /** - * Encodes the specified Api message. Does not implicitly {@link google.cloud.apihub.v1.Api.verify|verify} messages. - * @param message Api message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.IApi, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Api message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.Api.verify|verify} messages. - * @param message Api message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.IApi, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Api message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Api - * @throws {Error} If the payload is not 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.apihub.v1.Api; - - /** - * Decodes an Api message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Api - * @throws {Error} If the payload 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.apihub.v1.Api; - - /** - * Verifies an Api message. - * @param message Plain 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 Api message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Api - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.Api; - - /** - * Creates a plain object from an Api message. Also converts values to other types if specified. - * @param message Api - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.Api, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Api to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Api - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Version. */ - interface IVersion { - - /** Version name */ - name?: (string|null); - - /** Version displayName */ - displayName?: (string|null); - - /** Version description */ - description?: (string|null); - - /** Version documentation */ - documentation?: (google.cloud.apihub.v1.IDocumentation|null); - - /** Version specs */ - specs?: (string[]|null); - - /** Version apiOperations */ - apiOperations?: (string[]|null); - - /** Version definitions */ - definitions?: (string[]|null); - - /** Version deployments */ - deployments?: (string[]|null); - - /** Version createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** Version updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** Version lifecycle */ - lifecycle?: (google.cloud.apihub.v1.IAttributeValues|null); - - /** Version compliance */ - compliance?: (google.cloud.apihub.v1.IAttributeValues|null); - - /** Version accreditation */ - accreditation?: (google.cloud.apihub.v1.IAttributeValues|null); - - /** Version attributes */ - attributes?: ({ [k: string]: google.cloud.apihub.v1.IAttributeValues }|null); - - /** Version selectedDeployment */ - selectedDeployment?: (string|null); - } - - /** Represents a Version. */ - class Version implements IVersion { - - /** - * Constructs a new Version. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.IVersion); - - /** Version name. */ - public name: string; - - /** Version displayName. */ - public displayName: string; - - /** Version description. */ - public description: string; - - /** Version documentation. */ - public documentation?: (google.cloud.apihub.v1.IDocumentation|null); - - /** Version specs. */ - public specs: string[]; - - /** Version apiOperations. */ - public apiOperations: string[]; - - /** Version definitions. */ - public definitions: string[]; - - /** Version deployments. */ - public deployments: string[]; - - /** Version createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** Version updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** Version lifecycle. */ - public lifecycle?: (google.cloud.apihub.v1.IAttributeValues|null); - - /** Version compliance. */ - public compliance?: (google.cloud.apihub.v1.IAttributeValues|null); - - /** Version accreditation. */ - public accreditation?: (google.cloud.apihub.v1.IAttributeValues|null); - - /** Version attributes. */ - public attributes: { [k: string]: google.cloud.apihub.v1.IAttributeValues }; - - /** Version selectedDeployment. */ - public selectedDeployment: string; - - /** - * Creates a new Version instance using the specified properties. - * @param [properties] Properties to set - * @returns Version instance - */ - public static create(properties?: google.cloud.apihub.v1.IVersion): google.cloud.apihub.v1.Version; - - /** - * Encodes the specified Version message. Does not implicitly {@link google.cloud.apihub.v1.Version.verify|verify} messages. - * @param message Version message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.IVersion, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Version message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.Version.verify|verify} messages. - * @param message Version message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.IVersion, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Version message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Version - * @throws {Error} If the payload is not 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.apihub.v1.Version; - - /** - * Decodes a Version message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Version - * @throws {Error} If the payload 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.apihub.v1.Version; - - /** - * Verifies a Version message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Version message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Version - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.Version; - - /** - * Creates a plain object from a Version message. Also converts values to other types if specified. - * @param message Version - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.Version, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Version to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Version - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Spec. */ - interface ISpec { - - /** Spec name */ - name?: (string|null); - - /** Spec displayName */ - displayName?: (string|null); - - /** Spec specType */ - specType?: (google.cloud.apihub.v1.IAttributeValues|null); - - /** Spec contents */ - contents?: (google.cloud.apihub.v1.ISpecContents|null); - - /** Spec details */ - details?: (google.cloud.apihub.v1.ISpecDetails|null); - - /** Spec sourceUri */ - sourceUri?: (string|null); - - /** Spec createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** Spec updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** Spec lintResponse */ - lintResponse?: (google.cloud.apihub.v1.ILintResponse|null); - - /** Spec attributes */ - attributes?: ({ [k: string]: google.cloud.apihub.v1.IAttributeValues }|null); - - /** Spec documentation */ - documentation?: (google.cloud.apihub.v1.IDocumentation|null); - - /** Spec parsingMode */ - parsingMode?: (google.cloud.apihub.v1.Spec.ParsingMode|keyof typeof google.cloud.apihub.v1.Spec.ParsingMode|null); - } - - /** Represents a Spec. */ - class Spec implements ISpec { - - /** - * Constructs a new Spec. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.ISpec); - - /** Spec name. */ - public name: string; - - /** Spec displayName. */ - public displayName: string; - - /** Spec specType. */ - public specType?: (google.cloud.apihub.v1.IAttributeValues|null); - - /** Spec contents. */ - public contents?: (google.cloud.apihub.v1.ISpecContents|null); - - /** Spec details. */ - public details?: (google.cloud.apihub.v1.ISpecDetails|null); - - /** Spec sourceUri. */ - public sourceUri: string; - - /** Spec createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** Spec updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** Spec lintResponse. */ - public lintResponse?: (google.cloud.apihub.v1.ILintResponse|null); - - /** Spec attributes. */ - public attributes: { [k: string]: google.cloud.apihub.v1.IAttributeValues }; - - /** Spec documentation. */ - public documentation?: (google.cloud.apihub.v1.IDocumentation|null); - - /** Spec parsingMode. */ - public parsingMode: (google.cloud.apihub.v1.Spec.ParsingMode|keyof typeof google.cloud.apihub.v1.Spec.ParsingMode); - - /** - * Creates a new Spec instance using the specified properties. - * @param [properties] Properties to set - * @returns Spec instance - */ - public static create(properties?: google.cloud.apihub.v1.ISpec): google.cloud.apihub.v1.Spec; - - /** - * Encodes the specified Spec message. Does not implicitly {@link google.cloud.apihub.v1.Spec.verify|verify} messages. - * @param message Spec message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.ISpec, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Spec message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.Spec.verify|verify} messages. - * @param message Spec message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.ISpec, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Spec message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Spec - * @throws {Error} If the payload is not 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.apihub.v1.Spec; - - /** - * Decodes a Spec message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Spec - * @throws {Error} If the payload 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.apihub.v1.Spec; - - /** - * Verifies a Spec message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Spec message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Spec - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.Spec; - - /** - * Creates a plain object from a Spec message. Also converts values to other types if specified. - * @param message Spec - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.Spec, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Spec to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Spec - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Spec { - - /** ParsingMode enum. */ - enum ParsingMode { - PARSING_MODE_UNSPECIFIED = 0, - RELAXED = 1, - STRICT = 2 - } - } - - /** Properties of a Deployment. */ - interface IDeployment { - - /** Deployment name */ - name?: (string|null); - - /** Deployment displayName */ - displayName?: (string|null); - - /** Deployment description */ - description?: (string|null); - - /** Deployment documentation */ - documentation?: (google.cloud.apihub.v1.IDocumentation|null); - - /** Deployment deploymentType */ - deploymentType?: (google.cloud.apihub.v1.IAttributeValues|null); - - /** Deployment resourceUri */ - resourceUri?: (string|null); - - /** Deployment endpoints */ - endpoints?: (string[]|null); - - /** Deployment apiVersions */ - apiVersions?: (string[]|null); - - /** Deployment createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** Deployment updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** Deployment slo */ - slo?: (google.cloud.apihub.v1.IAttributeValues|null); - - /** Deployment environment */ - environment?: (google.cloud.apihub.v1.IAttributeValues|null); - - /** Deployment attributes */ - attributes?: ({ [k: string]: google.cloud.apihub.v1.IAttributeValues }|null); - } - - /** Represents a Deployment. */ - class Deployment implements IDeployment { - - /** - * Constructs a new Deployment. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.IDeployment); - - /** Deployment name. */ - public name: string; - - /** Deployment displayName. */ - public displayName: string; - - /** Deployment description. */ - public description: string; - - /** Deployment documentation. */ - public documentation?: (google.cloud.apihub.v1.IDocumentation|null); - - /** Deployment deploymentType. */ - public deploymentType?: (google.cloud.apihub.v1.IAttributeValues|null); - - /** Deployment resourceUri. */ - public resourceUri: string; - - /** Deployment endpoints. */ - public endpoints: string[]; - - /** Deployment apiVersions. */ - public apiVersions: string[]; - - /** Deployment createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** Deployment updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** Deployment slo. */ - public slo?: (google.cloud.apihub.v1.IAttributeValues|null); - - /** Deployment environment. */ - public environment?: (google.cloud.apihub.v1.IAttributeValues|null); - - /** Deployment attributes. */ - public attributes: { [k: string]: google.cloud.apihub.v1.IAttributeValues }; - - /** - * Creates a new Deployment instance using the specified properties. - * @param [properties] Properties to set - * @returns Deployment instance - */ - public static create(properties?: google.cloud.apihub.v1.IDeployment): google.cloud.apihub.v1.Deployment; - - /** - * Encodes the specified Deployment message. Does not implicitly {@link google.cloud.apihub.v1.Deployment.verify|verify} messages. - * @param message Deployment message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.IDeployment, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Deployment message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.Deployment.verify|verify} messages. - * @param message Deployment message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.IDeployment, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Deployment message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Deployment - * @throws {Error} If the payload is not 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.apihub.v1.Deployment; - - /** - * Decodes a Deployment message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Deployment - * @throws {Error} If the payload 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.apihub.v1.Deployment; - - /** - * Verifies a Deployment message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Deployment message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Deployment - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.Deployment; - - /** - * Creates a plain object from a Deployment message. Also converts values to other types if specified. - * @param message Deployment - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.Deployment, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Deployment to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Deployment - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an ApiOperation. */ - interface IApiOperation { - - /** ApiOperation name */ - name?: (string|null); - - /** ApiOperation spec */ - spec?: (string|null); - - /** ApiOperation details */ - details?: (google.cloud.apihub.v1.IOperationDetails|null); - - /** ApiOperation createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** ApiOperation updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** ApiOperation attributes */ - attributes?: ({ [k: string]: google.cloud.apihub.v1.IAttributeValues }|null); - } - - /** Represents an ApiOperation. */ - class ApiOperation implements IApiOperation { - - /** - * Constructs a new ApiOperation. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.IApiOperation); - - /** ApiOperation name. */ - public name: string; - - /** ApiOperation spec. */ - public spec: string; - - /** ApiOperation details. */ - public details?: (google.cloud.apihub.v1.IOperationDetails|null); - - /** ApiOperation createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** ApiOperation updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** ApiOperation attributes. */ - public attributes: { [k: string]: google.cloud.apihub.v1.IAttributeValues }; - - /** - * Creates a new ApiOperation instance using the specified properties. - * @param [properties] Properties to set - * @returns ApiOperation instance - */ - public static create(properties?: google.cloud.apihub.v1.IApiOperation): google.cloud.apihub.v1.ApiOperation; - - /** - * Encodes the specified ApiOperation message. Does not implicitly {@link google.cloud.apihub.v1.ApiOperation.verify|verify} messages. - * @param message ApiOperation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.IApiOperation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ApiOperation message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ApiOperation.verify|verify} messages. - * @param message ApiOperation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.IApiOperation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ApiOperation message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ApiOperation - * @throws {Error} If the payload is not 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.apihub.v1.ApiOperation; - - /** - * Decodes an ApiOperation message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ApiOperation - * @throws {Error} If the payload 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.apihub.v1.ApiOperation; - - /** - * Verifies an ApiOperation message. - * @param message Plain 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 ApiOperation message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ApiOperation - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.ApiOperation; - - /** - * Creates a plain object from an ApiOperation message. Also converts values to other types if specified. - * @param message ApiOperation - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.ApiOperation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ApiOperation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ApiOperation - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Definition. */ - interface IDefinition { - - /** Definition schema */ - schema?: (google.cloud.apihub.v1.ISchema|null); - - /** Definition name */ - name?: (string|null); - - /** Definition spec */ - spec?: (string|null); - - /** Definition type */ - type?: (google.cloud.apihub.v1.Definition.Type|keyof typeof google.cloud.apihub.v1.Definition.Type|null); - - /** Definition createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** Definition updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** Definition attributes */ - attributes?: ({ [k: string]: google.cloud.apihub.v1.IAttributeValues }|null); - } - - /** Represents a Definition. */ - class Definition implements IDefinition { - - /** - * Constructs a new Definition. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.IDefinition); - - /** Definition schema. */ - public schema?: (google.cloud.apihub.v1.ISchema|null); - - /** Definition name. */ - public name: string; - - /** Definition spec. */ - public spec: string; - - /** Definition type. */ - public type: (google.cloud.apihub.v1.Definition.Type|keyof typeof google.cloud.apihub.v1.Definition.Type); - - /** Definition createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** Definition updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** Definition attributes. */ - public attributes: { [k: string]: google.cloud.apihub.v1.IAttributeValues }; - - /** Definition value. */ - public value?: "schema"; - - /** - * Creates a new Definition instance using the specified properties. - * @param [properties] Properties to set - * @returns Definition instance - */ - public static create(properties?: google.cloud.apihub.v1.IDefinition): google.cloud.apihub.v1.Definition; - - /** - * Encodes the specified Definition message. Does not implicitly {@link google.cloud.apihub.v1.Definition.verify|verify} messages. - * @param message Definition message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.IDefinition, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Definition message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.Definition.verify|verify} messages. - * @param message Definition message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.IDefinition, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Definition message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Definition - * @throws {Error} If the payload is not 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.apihub.v1.Definition; - - /** - * Decodes a Definition message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Definition - * @throws {Error} If the payload 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.apihub.v1.Definition; - - /** - * Verifies a Definition message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Definition message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Definition - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.Definition; - - /** - * Creates a plain object from a Definition message. Also converts values to other types if specified. - * @param message Definition - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.Definition, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Definition to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Definition - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Definition { - - /** Type enum. */ - enum Type { - TYPE_UNSPECIFIED = 0, - SCHEMA = 1 - } - } - - /** Properties of an Attribute. */ - interface IAttribute { - - /** Attribute name */ - name?: (string|null); - - /** Attribute displayName */ - displayName?: (string|null); - - /** Attribute description */ - description?: (string|null); - - /** Attribute definitionType */ - definitionType?: (google.cloud.apihub.v1.Attribute.DefinitionType|keyof typeof google.cloud.apihub.v1.Attribute.DefinitionType|null); - - /** Attribute scope */ - scope?: (google.cloud.apihub.v1.Attribute.Scope|keyof typeof google.cloud.apihub.v1.Attribute.Scope|null); - - /** Attribute dataType */ - dataType?: (google.cloud.apihub.v1.Attribute.DataType|keyof typeof google.cloud.apihub.v1.Attribute.DataType|null); - - /** Attribute allowedValues */ - allowedValues?: (google.cloud.apihub.v1.Attribute.IAllowedValue[]|null); - - /** Attribute cardinality */ - cardinality?: (number|null); - - /** Attribute mandatory */ - mandatory?: (boolean|null); - - /** Attribute createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** Attribute updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents an Attribute. */ - class Attribute implements IAttribute { - - /** - * Constructs a new Attribute. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.IAttribute); - - /** Attribute name. */ - public name: string; - - /** Attribute displayName. */ - public displayName: string; - - /** Attribute description. */ - public description: string; - - /** Attribute definitionType. */ - public definitionType: (google.cloud.apihub.v1.Attribute.DefinitionType|keyof typeof google.cloud.apihub.v1.Attribute.DefinitionType); - - /** Attribute scope. */ - public scope: (google.cloud.apihub.v1.Attribute.Scope|keyof typeof google.cloud.apihub.v1.Attribute.Scope); - - /** Attribute dataType. */ - public dataType: (google.cloud.apihub.v1.Attribute.DataType|keyof typeof google.cloud.apihub.v1.Attribute.DataType); - - /** Attribute allowedValues. */ - public allowedValues: google.cloud.apihub.v1.Attribute.IAllowedValue[]; - - /** Attribute cardinality. */ - public cardinality: number; - - /** Attribute mandatory. */ - public mandatory: boolean; - - /** Attribute createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** Attribute updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new Attribute instance using the specified properties. - * @param [properties] Properties to set - * @returns Attribute instance - */ - public static create(properties?: google.cloud.apihub.v1.IAttribute): google.cloud.apihub.v1.Attribute; - - /** - * Encodes the specified Attribute message. Does not implicitly {@link google.cloud.apihub.v1.Attribute.verify|verify} messages. - * @param message Attribute message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.IAttribute, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Attribute message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.Attribute.verify|verify} messages. - * @param message Attribute message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.IAttribute, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Attribute message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Attribute - * @throws {Error} If the payload is not 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.apihub.v1.Attribute; - - /** - * Decodes an Attribute message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Attribute - * @throws {Error} If the payload 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.apihub.v1.Attribute; - - /** - * Verifies an Attribute message. - * @param message Plain 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 Attribute message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Attribute - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.Attribute; - - /** - * Creates a plain object from an Attribute message. Also converts values to other types if specified. - * @param message Attribute - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.Attribute, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Attribute to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Attribute - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Attribute { - - /** Properties of an AllowedValue. */ - interface IAllowedValue { - - /** AllowedValue id */ - id?: (string|null); - - /** AllowedValue displayName */ - displayName?: (string|null); - - /** AllowedValue description */ - description?: (string|null); - - /** AllowedValue immutable */ - immutable?: (boolean|null); - } - - /** Represents an AllowedValue. */ - class AllowedValue implements IAllowedValue { - - /** - * Constructs a new AllowedValue. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.Attribute.IAllowedValue); - - /** AllowedValue id. */ - public id: string; - - /** AllowedValue displayName. */ - public displayName: string; - - /** AllowedValue description. */ - public description: string; - - /** AllowedValue immutable. */ - public immutable: boolean; - - /** - * Creates a new AllowedValue instance using the specified properties. - * @param [properties] Properties to set - * @returns AllowedValue instance - */ - public static create(properties?: google.cloud.apihub.v1.Attribute.IAllowedValue): google.cloud.apihub.v1.Attribute.AllowedValue; - - /** - * Encodes the specified AllowedValue message. Does not implicitly {@link google.cloud.apihub.v1.Attribute.AllowedValue.verify|verify} messages. - * @param message AllowedValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.Attribute.IAllowedValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AllowedValue message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.Attribute.AllowedValue.verify|verify} messages. - * @param message AllowedValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.Attribute.IAllowedValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AllowedValue message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AllowedValue - * @throws {Error} If the payload is not 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.apihub.v1.Attribute.AllowedValue; - - /** - * Decodes an AllowedValue message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AllowedValue - * @throws {Error} If the payload 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.apihub.v1.Attribute.AllowedValue; - - /** - * Verifies an AllowedValue message. - * @param message Plain 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 AllowedValue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AllowedValue - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.Attribute.AllowedValue; - - /** - * Creates a plain object from an AllowedValue message. Also converts values to other types if specified. - * @param message AllowedValue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.Attribute.AllowedValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AllowedValue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AllowedValue - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** DefinitionType enum. */ - enum DefinitionType { - DEFINITION_TYPE_UNSPECIFIED = 0, - SYSTEM_DEFINED = 1, - USER_DEFINED = 2 - } - - /** Scope enum. */ - enum Scope { - SCOPE_UNSPECIFIED = 0, - API = 1, - VERSION = 2, - SPEC = 3, - API_OPERATION = 4, - DEPLOYMENT = 5, - DEPENDENCY = 6, - DEFINITION = 7, - EXTERNAL_API = 8, - PLUGIN = 9 - } - - /** DataType enum. */ - enum DataType { - DATA_TYPE_UNSPECIFIED = 0, - ENUM = 1, - JSON = 2, - STRING = 3 - } - } - - /** Properties of a SpecContents. */ - interface ISpecContents { - - /** SpecContents contents */ - contents?: (Uint8Array|string|null); - - /** SpecContents mimeType */ - mimeType?: (string|null); - } - - /** Represents a SpecContents. */ - class SpecContents implements ISpecContents { - - /** - * Constructs a new SpecContents. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.ISpecContents); - - /** SpecContents contents. */ - public contents: (Uint8Array|string); - - /** SpecContents mimeType. */ - public mimeType: string; - - /** - * Creates a new SpecContents instance using the specified properties. - * @param [properties] Properties to set - * @returns SpecContents instance - */ - public static create(properties?: google.cloud.apihub.v1.ISpecContents): google.cloud.apihub.v1.SpecContents; - - /** - * Encodes the specified SpecContents message. Does not implicitly {@link google.cloud.apihub.v1.SpecContents.verify|verify} messages. - * @param message SpecContents message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.ISpecContents, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SpecContents message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.SpecContents.verify|verify} messages. - * @param message SpecContents message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.ISpecContents, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SpecContents message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SpecContents - * @throws {Error} If the payload is not 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.apihub.v1.SpecContents; - - /** - * Decodes a SpecContents message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SpecContents - * @throws {Error} If the payload 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.apihub.v1.SpecContents; - - /** - * Verifies a SpecContents message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SpecContents message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SpecContents - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.SpecContents; - - /** - * Creates a plain object from a SpecContents message. Also converts values to other types if specified. - * @param message SpecContents - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.SpecContents, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SpecContents to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SpecContents - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a SpecDetails. */ - interface ISpecDetails { - - /** SpecDetails openApiSpecDetails */ - openApiSpecDetails?: (google.cloud.apihub.v1.IOpenApiSpecDetails|null); - - /** SpecDetails description */ - description?: (string|null); - } - - /** Represents a SpecDetails. */ - class SpecDetails implements ISpecDetails { - - /** - * Constructs a new SpecDetails. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.ISpecDetails); - - /** SpecDetails openApiSpecDetails. */ - public openApiSpecDetails?: (google.cloud.apihub.v1.IOpenApiSpecDetails|null); - - /** SpecDetails description. */ - public description: string; - - /** SpecDetails details. */ - public details?: "openApiSpecDetails"; - - /** - * Creates a new SpecDetails instance using the specified properties. - * @param [properties] Properties to set - * @returns SpecDetails instance - */ - public static create(properties?: google.cloud.apihub.v1.ISpecDetails): google.cloud.apihub.v1.SpecDetails; - - /** - * Encodes the specified SpecDetails message. Does not implicitly {@link google.cloud.apihub.v1.SpecDetails.verify|verify} messages. - * @param message SpecDetails message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.ISpecDetails, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SpecDetails message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.SpecDetails.verify|verify} messages. - * @param message SpecDetails message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.ISpecDetails, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SpecDetails message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SpecDetails - * @throws {Error} If the payload is not 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.apihub.v1.SpecDetails; - - /** - * Decodes a SpecDetails message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SpecDetails - * @throws {Error} If the payload 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.apihub.v1.SpecDetails; - - /** - * Verifies a SpecDetails message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SpecDetails message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SpecDetails - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.SpecDetails; - - /** - * Creates a plain object from a SpecDetails message. Also converts values to other types if specified. - * @param message SpecDetails - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.SpecDetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SpecDetails to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SpecDetails - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an OpenApiSpecDetails. */ - interface IOpenApiSpecDetails { - - /** OpenApiSpecDetails format */ - format?: (google.cloud.apihub.v1.OpenApiSpecDetails.Format|keyof typeof google.cloud.apihub.v1.OpenApiSpecDetails.Format|null); - - /** OpenApiSpecDetails version */ - version?: (string|null); - - /** OpenApiSpecDetails owner */ - owner?: (google.cloud.apihub.v1.IOwner|null); - } - - /** Represents an OpenApiSpecDetails. */ - class OpenApiSpecDetails implements IOpenApiSpecDetails { - - /** - * Constructs a new OpenApiSpecDetails. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.IOpenApiSpecDetails); - - /** OpenApiSpecDetails format. */ - public format: (google.cloud.apihub.v1.OpenApiSpecDetails.Format|keyof typeof google.cloud.apihub.v1.OpenApiSpecDetails.Format); - - /** OpenApiSpecDetails version. */ - public version: string; - - /** OpenApiSpecDetails owner. */ - public owner?: (google.cloud.apihub.v1.IOwner|null); - - /** - * Creates a new OpenApiSpecDetails instance using the specified properties. - * @param [properties] Properties to set - * @returns OpenApiSpecDetails instance - */ - public static create(properties?: google.cloud.apihub.v1.IOpenApiSpecDetails): google.cloud.apihub.v1.OpenApiSpecDetails; - - /** - * Encodes the specified OpenApiSpecDetails message. Does not implicitly {@link google.cloud.apihub.v1.OpenApiSpecDetails.verify|verify} messages. - * @param message OpenApiSpecDetails message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.IOpenApiSpecDetails, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OpenApiSpecDetails message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.OpenApiSpecDetails.verify|verify} messages. - * @param message OpenApiSpecDetails message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.IOpenApiSpecDetails, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OpenApiSpecDetails message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OpenApiSpecDetails - * @throws {Error} If the payload is not 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.apihub.v1.OpenApiSpecDetails; - - /** - * Decodes an OpenApiSpecDetails message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OpenApiSpecDetails - * @throws {Error} If the payload 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.apihub.v1.OpenApiSpecDetails; - - /** - * Verifies an OpenApiSpecDetails message. - * @param message Plain 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 OpenApiSpecDetails message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OpenApiSpecDetails - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.OpenApiSpecDetails; - - /** - * Creates a plain object from an OpenApiSpecDetails message. Also converts values to other types if specified. - * @param message OpenApiSpecDetails - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.OpenApiSpecDetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OpenApiSpecDetails to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for OpenApiSpecDetails - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace OpenApiSpecDetails { - - /** Format enum. */ - enum Format { - FORMAT_UNSPECIFIED = 0, - OPEN_API_SPEC_2_0 = 1, - OPEN_API_SPEC_3_0 = 2, - OPEN_API_SPEC_3_1 = 3 - } - } - - /** Properties of an OperationDetails. */ - interface IOperationDetails { - - /** OperationDetails httpOperation */ - httpOperation?: (google.cloud.apihub.v1.IHttpOperation|null); - - /** OperationDetails description */ - description?: (string|null); - - /** OperationDetails documentation */ - documentation?: (google.cloud.apihub.v1.IDocumentation|null); - - /** OperationDetails deprecated */ - deprecated?: (boolean|null); - } - - /** Represents an OperationDetails. */ - class OperationDetails implements IOperationDetails { - - /** - * Constructs a new OperationDetails. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.IOperationDetails); - - /** OperationDetails httpOperation. */ - public httpOperation?: (google.cloud.apihub.v1.IHttpOperation|null); - - /** OperationDetails description. */ - public description: string; - - /** OperationDetails documentation. */ - public documentation?: (google.cloud.apihub.v1.IDocumentation|null); - - /** OperationDetails deprecated. */ - public deprecated: boolean; - - /** OperationDetails operation. */ - public operation?: "httpOperation"; - - /** - * Creates a new OperationDetails instance using the specified properties. - * @param [properties] Properties to set - * @returns OperationDetails instance - */ - public static create(properties?: google.cloud.apihub.v1.IOperationDetails): google.cloud.apihub.v1.OperationDetails; - - /** - * Encodes the specified OperationDetails message. Does not implicitly {@link google.cloud.apihub.v1.OperationDetails.verify|verify} messages. - * @param message OperationDetails message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.IOperationDetails, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OperationDetails message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.OperationDetails.verify|verify} messages. - * @param message OperationDetails message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.IOperationDetails, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OperationDetails message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OperationDetails - * @throws {Error} If the payload is not 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.apihub.v1.OperationDetails; - - /** - * Decodes an OperationDetails message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OperationDetails - * @throws {Error} If the payload 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.apihub.v1.OperationDetails; - - /** - * Verifies an OperationDetails message. - * @param message Plain 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 OperationDetails message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OperationDetails - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.OperationDetails; - - /** - * Creates a plain object from an OperationDetails message. Also converts values to other types if specified. - * @param message OperationDetails - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.OperationDetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OperationDetails to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for OperationDetails - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a HttpOperation. */ - interface IHttpOperation { - - /** HttpOperation path */ - path?: (google.cloud.apihub.v1.IPath|null); - - /** HttpOperation method */ - method?: (google.cloud.apihub.v1.HttpOperation.Method|keyof typeof google.cloud.apihub.v1.HttpOperation.Method|null); - } - - /** Represents a HttpOperation. */ - class HttpOperation implements IHttpOperation { - - /** - * Constructs a new HttpOperation. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.IHttpOperation); - - /** HttpOperation path. */ - public path?: (google.cloud.apihub.v1.IPath|null); - - /** HttpOperation method. */ - public method: (google.cloud.apihub.v1.HttpOperation.Method|keyof typeof google.cloud.apihub.v1.HttpOperation.Method); - - /** - * Creates a new HttpOperation instance using the specified properties. - * @param [properties] Properties to set - * @returns HttpOperation instance - */ - public static create(properties?: google.cloud.apihub.v1.IHttpOperation): google.cloud.apihub.v1.HttpOperation; - - /** - * Encodes the specified HttpOperation message. Does not implicitly {@link google.cloud.apihub.v1.HttpOperation.verify|verify} messages. - * @param message HttpOperation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.IHttpOperation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified HttpOperation message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.HttpOperation.verify|verify} messages. - * @param message HttpOperation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.IHttpOperation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a HttpOperation message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns HttpOperation - * @throws {Error} If the payload is not 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.apihub.v1.HttpOperation; - - /** - * Decodes a HttpOperation message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns HttpOperation - * @throws {Error} If the payload 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.apihub.v1.HttpOperation; - - /** - * Verifies a HttpOperation message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a HttpOperation message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns HttpOperation - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.HttpOperation; - - /** - * Creates a plain object from a HttpOperation message. Also converts values to other types if specified. - * @param message HttpOperation - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.HttpOperation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this HttpOperation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for HttpOperation - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace HttpOperation { - - /** Method enum. */ - enum Method { - METHOD_UNSPECIFIED = 0, - GET = 1, - PUT = 2, - POST = 3, - DELETE = 4, - OPTIONS = 5, - HEAD = 6, - PATCH = 7, - TRACE = 8 - } - } - - /** Properties of a Path. */ - interface IPath { - - /** Path path */ - path?: (string|null); - - /** Path description */ - description?: (string|null); - } - - /** Represents a Path. */ - class Path implements IPath { - - /** - * Constructs a new Path. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.IPath); - - /** Path path. */ - public path: string; - - /** Path description. */ - public description: string; - - /** - * Creates a new Path instance using the specified properties. - * @param [properties] Properties to set - * @returns Path instance - */ - public static create(properties?: google.cloud.apihub.v1.IPath): google.cloud.apihub.v1.Path; - - /** - * Encodes the specified Path message. Does not implicitly {@link google.cloud.apihub.v1.Path.verify|verify} messages. - * @param message Path message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.IPath, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Path message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.Path.verify|verify} messages. - * @param message Path message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.IPath, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Path message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Path - * @throws {Error} If the payload is not 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.apihub.v1.Path; - - /** - * Decodes a Path message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Path - * @throws {Error} If the payload 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.apihub.v1.Path; - - /** - * Verifies a Path message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Path message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Path - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.Path; - - /** - * Creates a plain object from a Path message. Also converts values to other types if specified. - * @param message Path - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.Path, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Path to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Path - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Schema. */ - interface ISchema { - - /** Schema displayName */ - displayName?: (string|null); - - /** Schema rawValue */ - rawValue?: (Uint8Array|string|null); - } - - /** Represents a Schema. */ - class Schema implements ISchema { - - /** - * Constructs a new Schema. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.ISchema); - - /** Schema displayName. */ - public displayName: string; - - /** Schema rawValue. */ - public rawValue: (Uint8Array|string); - - /** - * Creates a new Schema instance using the specified properties. - * @param [properties] Properties to set - * @returns Schema instance - */ - public static create(properties?: google.cloud.apihub.v1.ISchema): google.cloud.apihub.v1.Schema; - - /** - * Encodes the specified Schema message. Does not implicitly {@link google.cloud.apihub.v1.Schema.verify|verify} messages. - * @param message Schema message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.ISchema, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Schema message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.Schema.verify|verify} messages. - * @param message Schema message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.ISchema, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Schema message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Schema - * @throws {Error} If the payload is not 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.apihub.v1.Schema; - - /** - * Decodes a Schema message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Schema - * @throws {Error} If the payload 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.apihub.v1.Schema; - - /** - * Verifies a Schema message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Schema message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Schema - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.Schema; - - /** - * Creates a plain object from a Schema message. Also converts values to other types if specified. - * @param message Schema - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.Schema, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Schema to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Schema - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an Owner. */ - interface IOwner { - - /** Owner displayName */ - displayName?: (string|null); - - /** Owner email */ - email?: (string|null); - } - - /** Represents an Owner. */ - class Owner implements IOwner { - - /** - * Constructs a new Owner. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.IOwner); - - /** Owner displayName. */ - public displayName: string; - - /** Owner email. */ - public email: string; - - /** - * Creates a new Owner instance using the specified properties. - * @param [properties] Properties to set - * @returns Owner instance - */ - public static create(properties?: google.cloud.apihub.v1.IOwner): google.cloud.apihub.v1.Owner; - - /** - * Encodes the specified Owner message. Does not implicitly {@link google.cloud.apihub.v1.Owner.verify|verify} messages. - * @param message Owner message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.IOwner, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Owner message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.Owner.verify|verify} messages. - * @param message Owner message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.IOwner, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Owner message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Owner - * @throws {Error} If the payload is not 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.apihub.v1.Owner; - - /** - * Decodes an Owner message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Owner - * @throws {Error} If the payload 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.apihub.v1.Owner; - - /** - * Verifies an Owner message. - * @param message Plain 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 Owner message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Owner - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.Owner; - - /** - * Creates a plain object from an Owner message. Also converts values to other types if specified. - * @param message Owner - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.Owner, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Owner to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Owner - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Documentation. */ - interface IDocumentation { - - /** Documentation externalUri */ - externalUri?: (string|null); - } - - /** Represents a Documentation. */ - class Documentation implements IDocumentation { - - /** - * Constructs a new Documentation. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.IDocumentation); - - /** Documentation externalUri. */ - public externalUri: string; - - /** - * Creates a new Documentation instance using the specified properties. - * @param [properties] Properties to set - * @returns Documentation instance - */ - public static create(properties?: google.cloud.apihub.v1.IDocumentation): google.cloud.apihub.v1.Documentation; - - /** - * Encodes the specified Documentation message. Does not implicitly {@link google.cloud.apihub.v1.Documentation.verify|verify} messages. - * @param message Documentation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.IDocumentation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Documentation message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.Documentation.verify|verify} messages. - * @param message Documentation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.IDocumentation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Documentation message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Documentation - * @throws {Error} If the payload is not 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.apihub.v1.Documentation; - - /** - * Decodes a Documentation message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Documentation - * @throws {Error} If the payload 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.apihub.v1.Documentation; - - /** - * Verifies a Documentation message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Documentation message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Documentation - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.Documentation; - - /** - * Creates a plain object from a Documentation message. Also converts values to other types if specified. - * @param message Documentation - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.Documentation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Documentation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Documentation - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an AttributeValues. */ - interface IAttributeValues { - - /** AttributeValues enumValues */ - enumValues?: (google.cloud.apihub.v1.AttributeValues.IEnumAttributeValues|null); - - /** AttributeValues stringValues */ - stringValues?: (google.cloud.apihub.v1.AttributeValues.IStringAttributeValues|null); - - /** AttributeValues jsonValues */ - jsonValues?: (google.cloud.apihub.v1.AttributeValues.IStringAttributeValues|null); - - /** AttributeValues attribute */ - attribute?: (string|null); - } - - /** Represents an AttributeValues. */ - class AttributeValues implements IAttributeValues { - - /** - * Constructs a new AttributeValues. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.IAttributeValues); - - /** AttributeValues enumValues. */ - public enumValues?: (google.cloud.apihub.v1.AttributeValues.IEnumAttributeValues|null); - - /** AttributeValues stringValues. */ - public stringValues?: (google.cloud.apihub.v1.AttributeValues.IStringAttributeValues|null); - - /** AttributeValues jsonValues. */ - public jsonValues?: (google.cloud.apihub.v1.AttributeValues.IStringAttributeValues|null); - - /** AttributeValues attribute. */ - public attribute: string; - - /** AttributeValues Value. */ - public Value?: ("enumValues"|"stringValues"|"jsonValues"); - - /** - * Creates a new AttributeValues instance using the specified properties. - * @param [properties] Properties to set - * @returns AttributeValues instance - */ - public static create(properties?: google.cloud.apihub.v1.IAttributeValues): google.cloud.apihub.v1.AttributeValues; - - /** - * Encodes the specified AttributeValues message. Does not implicitly {@link google.cloud.apihub.v1.AttributeValues.verify|verify} messages. - * @param message AttributeValues message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.IAttributeValues, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AttributeValues message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.AttributeValues.verify|verify} messages. - * @param message AttributeValues message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.IAttributeValues, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AttributeValues message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AttributeValues - * @throws {Error} If the payload is not 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.apihub.v1.AttributeValues; - - /** - * Decodes an AttributeValues message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AttributeValues - * @throws {Error} If the payload 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.apihub.v1.AttributeValues; - - /** - * Verifies an AttributeValues message. - * @param message Plain 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 AttributeValues message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AttributeValues - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.AttributeValues; - - /** - * Creates a plain object from an AttributeValues message. Also converts values to other types if specified. - * @param message AttributeValues - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.AttributeValues, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AttributeValues to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AttributeValues - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace AttributeValues { - - /** Properties of an EnumAttributeValues. */ - interface IEnumAttributeValues { - - /** EnumAttributeValues values */ - values?: (google.cloud.apihub.v1.Attribute.IAllowedValue[]|null); - } - - /** Represents an EnumAttributeValues. */ - class EnumAttributeValues implements IEnumAttributeValues { - - /** - * Constructs a new EnumAttributeValues. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.AttributeValues.IEnumAttributeValues); - - /** EnumAttributeValues values. */ - public values: google.cloud.apihub.v1.Attribute.IAllowedValue[]; - - /** - * Creates a new EnumAttributeValues instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumAttributeValues instance - */ - public static create(properties?: google.cloud.apihub.v1.AttributeValues.IEnumAttributeValues): google.cloud.apihub.v1.AttributeValues.EnumAttributeValues; - - /** - * Encodes the specified EnumAttributeValues message. Does not implicitly {@link google.cloud.apihub.v1.AttributeValues.EnumAttributeValues.verify|verify} messages. - * @param message EnumAttributeValues message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.AttributeValues.IEnumAttributeValues, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumAttributeValues message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.AttributeValues.EnumAttributeValues.verify|verify} messages. - * @param message EnumAttributeValues message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.AttributeValues.IEnumAttributeValues, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumAttributeValues message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumAttributeValues - * @throws {Error} If the payload is not 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.apihub.v1.AttributeValues.EnumAttributeValues; - - /** - * Decodes an EnumAttributeValues message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumAttributeValues - * @throws {Error} If the payload 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.apihub.v1.AttributeValues.EnumAttributeValues; - - /** - * Verifies an EnumAttributeValues message. - * @param message Plain 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 EnumAttributeValues message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumAttributeValues - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.AttributeValues.EnumAttributeValues; - - /** - * Creates a plain object from an EnumAttributeValues message. Also converts values to other types if specified. - * @param message EnumAttributeValues - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.AttributeValues.EnumAttributeValues, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumAttributeValues to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnumAttributeValues - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a StringAttributeValues. */ - interface IStringAttributeValues { - - /** StringAttributeValues values */ - values?: (string[]|null); - } - - /** Represents a StringAttributeValues. */ - class StringAttributeValues implements IStringAttributeValues { - - /** - * Constructs a new StringAttributeValues. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.AttributeValues.IStringAttributeValues); - - /** StringAttributeValues values. */ - public values: string[]; - - /** - * Creates a new StringAttributeValues instance using the specified properties. - * @param [properties] Properties to set - * @returns StringAttributeValues instance - */ - public static create(properties?: google.cloud.apihub.v1.AttributeValues.IStringAttributeValues): google.cloud.apihub.v1.AttributeValues.StringAttributeValues; - - /** - * Encodes the specified StringAttributeValues message. Does not implicitly {@link google.cloud.apihub.v1.AttributeValues.StringAttributeValues.verify|verify} messages. - * @param message StringAttributeValues message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.AttributeValues.IStringAttributeValues, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified StringAttributeValues message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.AttributeValues.StringAttributeValues.verify|verify} messages. - * @param message StringAttributeValues message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.AttributeValues.IStringAttributeValues, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a StringAttributeValues message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns StringAttributeValues - * @throws {Error} If the payload is not 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.apihub.v1.AttributeValues.StringAttributeValues; - - /** - * Decodes a StringAttributeValues message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns StringAttributeValues - * @throws {Error} If the payload 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.apihub.v1.AttributeValues.StringAttributeValues; - - /** - * Verifies a StringAttributeValues message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a StringAttributeValues message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns StringAttributeValues - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.AttributeValues.StringAttributeValues; - - /** - * Creates a plain object from a StringAttributeValues message. Also converts values to other types if specified. - * @param message StringAttributeValues - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.AttributeValues.StringAttributeValues, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this StringAttributeValues to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for StringAttributeValues - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a Dependency. */ - interface IDependency { - - /** Dependency name */ - name?: (string|null); - - /** Dependency consumer */ - consumer?: (google.cloud.apihub.v1.IDependencyEntityReference|null); - - /** Dependency supplier */ - supplier?: (google.cloud.apihub.v1.IDependencyEntityReference|null); - - /** Dependency state */ - state?: (google.cloud.apihub.v1.Dependency.State|keyof typeof google.cloud.apihub.v1.Dependency.State|null); - - /** Dependency description */ - description?: (string|null); - - /** Dependency discoveryMode */ - discoveryMode?: (google.cloud.apihub.v1.Dependency.DiscoveryMode|keyof typeof google.cloud.apihub.v1.Dependency.DiscoveryMode|null); - - /** Dependency errorDetail */ - errorDetail?: (google.cloud.apihub.v1.IDependencyErrorDetail|null); - - /** Dependency createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** Dependency updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** Dependency attributes */ - attributes?: ({ [k: string]: google.cloud.apihub.v1.IAttributeValues }|null); - } - - /** Represents a Dependency. */ - class Dependency implements IDependency { - - /** - * Constructs a new Dependency. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.IDependency); - - /** Dependency name. */ - public name: string; - - /** Dependency consumer. */ - public consumer?: (google.cloud.apihub.v1.IDependencyEntityReference|null); - - /** Dependency supplier. */ - public supplier?: (google.cloud.apihub.v1.IDependencyEntityReference|null); - - /** Dependency state. */ - public state: (google.cloud.apihub.v1.Dependency.State|keyof typeof google.cloud.apihub.v1.Dependency.State); - - /** Dependency description. */ - public description: string; - - /** Dependency discoveryMode. */ - public discoveryMode: (google.cloud.apihub.v1.Dependency.DiscoveryMode|keyof typeof google.cloud.apihub.v1.Dependency.DiscoveryMode); - - /** Dependency errorDetail. */ - public errorDetail?: (google.cloud.apihub.v1.IDependencyErrorDetail|null); - - /** Dependency createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** Dependency updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** Dependency attributes. */ - public attributes: { [k: string]: google.cloud.apihub.v1.IAttributeValues }; - - /** - * Creates a new Dependency instance using the specified properties. - * @param [properties] Properties to set - * @returns Dependency instance - */ - public static create(properties?: google.cloud.apihub.v1.IDependency): google.cloud.apihub.v1.Dependency; - - /** - * Encodes the specified Dependency message. Does not implicitly {@link google.cloud.apihub.v1.Dependency.verify|verify} messages. - * @param message Dependency message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.IDependency, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Dependency message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.Dependency.verify|verify} messages. - * @param message Dependency message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.IDependency, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Dependency message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Dependency - * @throws {Error} If the payload is not 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.apihub.v1.Dependency; - - /** - * Decodes a Dependency message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Dependency - * @throws {Error} If the payload 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.apihub.v1.Dependency; - - /** - * Verifies a Dependency message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Dependency message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Dependency - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.Dependency; - - /** - * Creates a plain object from a Dependency message. Also converts values to other types if specified. - * @param message Dependency - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.Dependency, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Dependency to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Dependency - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Dependency { - - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - PROPOSED = 1, - VALIDATED = 2 - } - - /** DiscoveryMode enum. */ - enum DiscoveryMode { - DISCOVERY_MODE_UNSPECIFIED = 0, - MANUAL = 1 - } - } - - /** Properties of a DependencyEntityReference. */ - interface IDependencyEntityReference { - - /** DependencyEntityReference operationResourceName */ - operationResourceName?: (string|null); - - /** DependencyEntityReference externalApiResourceName */ - externalApiResourceName?: (string|null); - - /** DependencyEntityReference displayName */ - displayName?: (string|null); - } - - /** Represents a DependencyEntityReference. */ - class DependencyEntityReference implements IDependencyEntityReference { - - /** - * Constructs a new DependencyEntityReference. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.IDependencyEntityReference); - - /** DependencyEntityReference operationResourceName. */ - public operationResourceName?: (string|null); - - /** DependencyEntityReference externalApiResourceName. */ - public externalApiResourceName?: (string|null); - - /** DependencyEntityReference displayName. */ - public displayName: string; - - /** DependencyEntityReference identifier. */ - public identifier?: ("operationResourceName"|"externalApiResourceName"); - - /** - * Creates a new DependencyEntityReference instance using the specified properties. - * @param [properties] Properties to set - * @returns DependencyEntityReference instance - */ - public static create(properties?: google.cloud.apihub.v1.IDependencyEntityReference): google.cloud.apihub.v1.DependencyEntityReference; - - /** - * Encodes the specified DependencyEntityReference message. Does not implicitly {@link google.cloud.apihub.v1.DependencyEntityReference.verify|verify} messages. - * @param message DependencyEntityReference message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.IDependencyEntityReference, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DependencyEntityReference message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.DependencyEntityReference.verify|verify} messages. - * @param message DependencyEntityReference message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.IDependencyEntityReference, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DependencyEntityReference message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DependencyEntityReference - * @throws {Error} If the payload is not 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.apihub.v1.DependencyEntityReference; - - /** - * Decodes a DependencyEntityReference message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DependencyEntityReference - * @throws {Error} If the payload 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.apihub.v1.DependencyEntityReference; - - /** - * Verifies a DependencyEntityReference message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DependencyEntityReference message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DependencyEntityReference - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.DependencyEntityReference; - - /** - * Creates a plain object from a DependencyEntityReference message. Also converts values to other types if specified. - * @param message DependencyEntityReference - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.DependencyEntityReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DependencyEntityReference to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DependencyEntityReference - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DependencyErrorDetail. */ - interface IDependencyErrorDetail { - - /** DependencyErrorDetail error */ - error?: (google.cloud.apihub.v1.DependencyErrorDetail.Error|keyof typeof google.cloud.apihub.v1.DependencyErrorDetail.Error|null); - - /** DependencyErrorDetail errorTime */ - errorTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a DependencyErrorDetail. */ - class DependencyErrorDetail implements IDependencyErrorDetail { - - /** - * Constructs a new DependencyErrorDetail. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.IDependencyErrorDetail); - - /** DependencyErrorDetail error. */ - public error: (google.cloud.apihub.v1.DependencyErrorDetail.Error|keyof typeof google.cloud.apihub.v1.DependencyErrorDetail.Error); - - /** DependencyErrorDetail errorTime. */ - public errorTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new DependencyErrorDetail instance using the specified properties. - * @param [properties] Properties to set - * @returns DependencyErrorDetail instance - */ - public static create(properties?: google.cloud.apihub.v1.IDependencyErrorDetail): google.cloud.apihub.v1.DependencyErrorDetail; - - /** - * Encodes the specified DependencyErrorDetail message. Does not implicitly {@link google.cloud.apihub.v1.DependencyErrorDetail.verify|verify} messages. - * @param message DependencyErrorDetail message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.IDependencyErrorDetail, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DependencyErrorDetail message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.DependencyErrorDetail.verify|verify} messages. - * @param message DependencyErrorDetail message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.IDependencyErrorDetail, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DependencyErrorDetail message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DependencyErrorDetail - * @throws {Error} If the payload is not 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.apihub.v1.DependencyErrorDetail; - - /** - * Decodes a DependencyErrorDetail message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DependencyErrorDetail - * @throws {Error} If the payload 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.apihub.v1.DependencyErrorDetail; - - /** - * Verifies a DependencyErrorDetail message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DependencyErrorDetail message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DependencyErrorDetail - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.DependencyErrorDetail; - - /** - * Creates a plain object from a DependencyErrorDetail message. Also converts values to other types if specified. - * @param message DependencyErrorDetail - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.DependencyErrorDetail, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DependencyErrorDetail to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DependencyErrorDetail - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace DependencyErrorDetail { - - /** Error enum. */ - enum Error { - ERROR_UNSPECIFIED = 0, - SUPPLIER_NOT_FOUND = 1, - SUPPLIER_RECREATED = 2 - } - } - - /** Properties of a LintResponse. */ - interface ILintResponse { - - /** LintResponse issues */ - issues?: (google.cloud.apihub.v1.IIssue[]|null); - - /** LintResponse summary */ - summary?: (google.cloud.apihub.v1.LintResponse.ISummaryEntry[]|null); - - /** LintResponse state */ - state?: (google.cloud.apihub.v1.LintState|keyof typeof google.cloud.apihub.v1.LintState|null); - - /** LintResponse source */ - source?: (string|null); - - /** LintResponse linter */ - linter?: (google.cloud.apihub.v1.Linter|keyof typeof google.cloud.apihub.v1.Linter|null); - - /** LintResponse createTime */ - createTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a LintResponse. */ - class LintResponse implements ILintResponse { - - /** - * Constructs a new LintResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.ILintResponse); - - /** LintResponse issues. */ - public issues: google.cloud.apihub.v1.IIssue[]; - - /** LintResponse summary. */ - public summary: google.cloud.apihub.v1.LintResponse.ISummaryEntry[]; - - /** LintResponse state. */ - public state: (google.cloud.apihub.v1.LintState|keyof typeof google.cloud.apihub.v1.LintState); - - /** LintResponse source. */ - public source: string; - - /** LintResponse linter. */ - public linter: (google.cloud.apihub.v1.Linter|keyof typeof google.cloud.apihub.v1.Linter); - - /** LintResponse createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new LintResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns LintResponse instance - */ - public static create(properties?: google.cloud.apihub.v1.ILintResponse): google.cloud.apihub.v1.LintResponse; - - /** - * Encodes the specified LintResponse message. Does not implicitly {@link google.cloud.apihub.v1.LintResponse.verify|verify} messages. - * @param message LintResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.ILintResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified LintResponse message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.LintResponse.verify|verify} messages. - * @param message LintResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.ILintResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a LintResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns LintResponse - * @throws {Error} If the payload is not 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.apihub.v1.LintResponse; - - /** - * Decodes a LintResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns LintResponse - * @throws {Error} If the payload 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.apihub.v1.LintResponse; - - /** - * Verifies a LintResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a LintResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns LintResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.LintResponse; - - /** - * Creates a plain object from a LintResponse message. Also converts values to other types if specified. - * @param message LintResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.LintResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this LintResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for LintResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace LintResponse { - - /** Properties of a SummaryEntry. */ - interface ISummaryEntry { - - /** SummaryEntry severity */ - severity?: (google.cloud.apihub.v1.Severity|keyof typeof google.cloud.apihub.v1.Severity|null); - - /** SummaryEntry count */ - count?: (number|null); - } - - /** Represents a SummaryEntry. */ - class SummaryEntry implements ISummaryEntry { - - /** - * Constructs a new SummaryEntry. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.LintResponse.ISummaryEntry); - - /** SummaryEntry severity. */ - public severity: (google.cloud.apihub.v1.Severity|keyof typeof google.cloud.apihub.v1.Severity); - - /** SummaryEntry count. */ - public count: number; - - /** - * Creates a new SummaryEntry instance using the specified properties. - * @param [properties] Properties to set - * @returns SummaryEntry instance - */ - public static create(properties?: google.cloud.apihub.v1.LintResponse.ISummaryEntry): google.cloud.apihub.v1.LintResponse.SummaryEntry; - - /** - * Encodes the specified SummaryEntry message. Does not implicitly {@link google.cloud.apihub.v1.LintResponse.SummaryEntry.verify|verify} messages. - * @param message SummaryEntry message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.LintResponse.ISummaryEntry, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SummaryEntry message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.LintResponse.SummaryEntry.verify|verify} messages. - * @param message SummaryEntry message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.LintResponse.ISummaryEntry, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SummaryEntry message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SummaryEntry - * @throws {Error} If the payload is not 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.apihub.v1.LintResponse.SummaryEntry; - - /** - * Decodes a SummaryEntry message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SummaryEntry - * @throws {Error} If the payload 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.apihub.v1.LintResponse.SummaryEntry; - - /** - * Verifies a SummaryEntry message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SummaryEntry message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SummaryEntry - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.LintResponse.SummaryEntry; - - /** - * Creates a plain object from a SummaryEntry message. Also converts values to other types if specified. - * @param message SummaryEntry - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.LintResponse.SummaryEntry, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SummaryEntry to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SummaryEntry - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an Issue. */ - interface IIssue { - - /** Issue code */ - code?: (string|null); - - /** Issue path */ - path?: (string[]|null); - - /** Issue message */ - message?: (string|null); - - /** Issue severity */ - severity?: (google.cloud.apihub.v1.Severity|keyof typeof google.cloud.apihub.v1.Severity|null); - - /** Issue range */ - range?: (google.cloud.apihub.v1.IRange|null); - } - - /** Represents an Issue. */ - class Issue implements IIssue { - - /** - * Constructs a new Issue. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.IIssue); - - /** Issue code. */ - public code: string; - - /** Issue path. */ - public path: string[]; - - /** Issue message. */ - public message: string; - - /** Issue severity. */ - public severity: (google.cloud.apihub.v1.Severity|keyof typeof google.cloud.apihub.v1.Severity); - - /** Issue range. */ - public range?: (google.cloud.apihub.v1.IRange|null); - - /** - * Creates a new Issue instance using the specified properties. - * @param [properties] Properties to set - * @returns Issue instance - */ - public static create(properties?: google.cloud.apihub.v1.IIssue): google.cloud.apihub.v1.Issue; - - /** - * Encodes the specified Issue message. Does not implicitly {@link google.cloud.apihub.v1.Issue.verify|verify} messages. - * @param message Issue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.IIssue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Issue message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.Issue.verify|verify} messages. - * @param message Issue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.IIssue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Issue message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Issue - * @throws {Error} If the payload is not 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.apihub.v1.Issue; - - /** - * Decodes an Issue message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Issue - * @throws {Error} If the payload 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.apihub.v1.Issue; - - /** - * Verifies an Issue message. - * @param message Plain 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 Issue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Issue - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.Issue; - - /** - * Creates a plain object from an Issue message. Also converts values to other types if specified. - * @param message Issue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.Issue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Issue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Issue - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Range. */ - interface IRange { - - /** Range start */ - start?: (google.cloud.apihub.v1.IPoint|null); - - /** Range end */ - end?: (google.cloud.apihub.v1.IPoint|null); - } - - /** Represents a Range. */ - class Range implements IRange { - - /** - * Constructs a new Range. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.IRange); - - /** Range start. */ - public start?: (google.cloud.apihub.v1.IPoint|null); - - /** Range end. */ - public end?: (google.cloud.apihub.v1.IPoint|null); - - /** - * Creates a new Range instance using the specified properties. - * @param [properties] Properties to set - * @returns Range instance - */ - public static create(properties?: google.cloud.apihub.v1.IRange): google.cloud.apihub.v1.Range; - - /** - * Encodes the specified Range message. Does not implicitly {@link google.cloud.apihub.v1.Range.verify|verify} messages. - * @param message Range message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.IRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Range message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.Range.verify|verify} messages. - * @param message Range message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.IRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Range message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Range - * @throws {Error} If the payload is not 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.apihub.v1.Range; - - /** - * Decodes a Range message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Range - * @throws {Error} If the payload 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.apihub.v1.Range; - - /** - * Verifies a Range message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Range message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Range - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.Range; - - /** - * Creates a plain object from a Range message. Also converts values to other types if specified. - * @param message Range - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.Range, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Range to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Range - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Point. */ - interface IPoint { - - /** Point line */ - line?: (number|null); - - /** Point character */ - character?: (number|null); - } - - /** Represents a Point. */ - class Point implements IPoint { - - /** - * Constructs a new Point. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.IPoint); - - /** Point line. */ - public line: number; - - /** Point character. */ - public character: number; - - /** - * Creates a new Point instance using the specified properties. - * @param [properties] Properties to set - * @returns Point instance - */ - public static create(properties?: google.cloud.apihub.v1.IPoint): google.cloud.apihub.v1.Point; - - /** - * Encodes the specified Point message. Does not implicitly {@link google.cloud.apihub.v1.Point.verify|verify} messages. - * @param message Point message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.IPoint, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Point message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.Point.verify|verify} messages. - * @param message Point message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.IPoint, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Point message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Point - * @throws {Error} If the payload is not 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.apihub.v1.Point; - - /** - * Decodes a Point message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Point - * @throws {Error} If the payload 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.apihub.v1.Point; - - /** - * Verifies a Point message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Point message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Point - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.Point; - - /** - * Creates a plain object from a Point message. Also converts values to other types if specified. - * @param message Point - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.Point, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Point to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Point - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** 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.apihub.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.apihub.v1.IOperationMetadata): google.cloud.apihub.v1.OperationMetadata; - - /** - * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.apihub.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.apihub.v1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.apihub.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.apihub.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.apihub.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.apihub.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.apihub.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.apihub.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 an ApiHubInstance. */ - interface IApiHubInstance { - - /** ApiHubInstance name */ - name?: (string|null); - - /** ApiHubInstance createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** ApiHubInstance updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** ApiHubInstance state */ - state?: (google.cloud.apihub.v1.ApiHubInstance.State|keyof typeof google.cloud.apihub.v1.ApiHubInstance.State|null); - - /** ApiHubInstance stateMessage */ - stateMessage?: (string|null); - - /** ApiHubInstance config */ - config?: (google.cloud.apihub.v1.ApiHubInstance.IConfig|null); - - /** ApiHubInstance labels */ - labels?: ({ [k: string]: string }|null); - - /** ApiHubInstance description */ - description?: (string|null); - } - - /** Represents an ApiHubInstance. */ - class ApiHubInstance implements IApiHubInstance { - - /** - * Constructs a new ApiHubInstance. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.IApiHubInstance); - - /** ApiHubInstance name. */ - public name: string; - - /** ApiHubInstance createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** ApiHubInstance updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** ApiHubInstance state. */ - public state: (google.cloud.apihub.v1.ApiHubInstance.State|keyof typeof google.cloud.apihub.v1.ApiHubInstance.State); - - /** ApiHubInstance stateMessage. */ - public stateMessage: string; - - /** ApiHubInstance config. */ - public config?: (google.cloud.apihub.v1.ApiHubInstance.IConfig|null); - - /** ApiHubInstance labels. */ - public labels: { [k: string]: string }; - - /** ApiHubInstance description. */ - public description: string; - - /** - * Creates a new ApiHubInstance instance using the specified properties. - * @param [properties] Properties to set - * @returns ApiHubInstance instance - */ - public static create(properties?: google.cloud.apihub.v1.IApiHubInstance): google.cloud.apihub.v1.ApiHubInstance; - - /** - * Encodes the specified ApiHubInstance message. Does not implicitly {@link google.cloud.apihub.v1.ApiHubInstance.verify|verify} messages. - * @param message ApiHubInstance message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.IApiHubInstance, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ApiHubInstance message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ApiHubInstance.verify|verify} messages. - * @param message ApiHubInstance message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.IApiHubInstance, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ApiHubInstance message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ApiHubInstance - * @throws {Error} If the payload is not 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.apihub.v1.ApiHubInstance; - - /** - * Decodes an ApiHubInstance message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ApiHubInstance - * @throws {Error} If the payload 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.apihub.v1.ApiHubInstance; - - /** - * Verifies an ApiHubInstance message. - * @param message Plain 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 ApiHubInstance message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ApiHubInstance - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.ApiHubInstance; - - /** - * Creates a plain object from an ApiHubInstance message. Also converts values to other types if specified. - * @param message ApiHubInstance - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.ApiHubInstance, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ApiHubInstance to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ApiHubInstance - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ApiHubInstance { - - /** Properties of a Config. */ - interface IConfig { - - /** Config cmekKeyName */ - cmekKeyName?: (string|null); - } - - /** Represents a Config. */ - class Config implements IConfig { - - /** - * Constructs a new Config. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.ApiHubInstance.IConfig); - - /** Config cmekKeyName. */ - public cmekKeyName: string; - - /** - * Creates a new Config instance using the specified properties. - * @param [properties] Properties to set - * @returns Config instance - */ - public static create(properties?: google.cloud.apihub.v1.ApiHubInstance.IConfig): google.cloud.apihub.v1.ApiHubInstance.Config; - - /** - * Encodes the specified Config message. Does not implicitly {@link google.cloud.apihub.v1.ApiHubInstance.Config.verify|verify} messages. - * @param message Config message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.ApiHubInstance.IConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Config message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ApiHubInstance.Config.verify|verify} messages. - * @param message Config message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.ApiHubInstance.IConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Config message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Config - * @throws {Error} If the payload is not 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.apihub.v1.ApiHubInstance.Config; - - /** - * Decodes a Config message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Config - * @throws {Error} If the payload 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.apihub.v1.ApiHubInstance.Config; - - /** - * Verifies a Config message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Config message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Config - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.ApiHubInstance.Config; - - /** - * Creates a plain object from a Config message. Also converts values to other types if specified. - * @param message Config - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.ApiHubInstance.Config, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Config to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Config - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - INACTIVE = 1, - CREATING = 2, - ACTIVE = 3, - UPDATING = 4, - DELETING = 5, - FAILED = 6 - } - } - - /** Properties of an ExternalApi. */ - interface IExternalApi { - - /** ExternalApi name */ - name?: (string|null); - - /** ExternalApi displayName */ - displayName?: (string|null); - - /** ExternalApi description */ - description?: (string|null); - - /** ExternalApi endpoints */ - endpoints?: (string[]|null); - - /** ExternalApi paths */ - paths?: (string[]|null); - - /** ExternalApi documentation */ - documentation?: (google.cloud.apihub.v1.IDocumentation|null); - - /** ExternalApi attributes */ - attributes?: ({ [k: string]: google.cloud.apihub.v1.IAttributeValues }|null); - - /** ExternalApi createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** ExternalApi updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents an ExternalApi. */ - class ExternalApi implements IExternalApi { - - /** - * Constructs a new ExternalApi. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.IExternalApi); - - /** ExternalApi name. */ - public name: string; - - /** ExternalApi displayName. */ - public displayName: string; - - /** ExternalApi description. */ - public description: string; - - /** ExternalApi endpoints. */ - public endpoints: string[]; - - /** ExternalApi paths. */ - public paths: string[]; - - /** ExternalApi documentation. */ - public documentation?: (google.cloud.apihub.v1.IDocumentation|null); - - /** ExternalApi attributes. */ - public attributes: { [k: string]: google.cloud.apihub.v1.IAttributeValues }; - - /** ExternalApi createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** ExternalApi updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new ExternalApi instance using the specified properties. - * @param [properties] Properties to set - * @returns ExternalApi instance - */ - public static create(properties?: google.cloud.apihub.v1.IExternalApi): google.cloud.apihub.v1.ExternalApi; - - /** - * Encodes the specified ExternalApi message. Does not implicitly {@link google.cloud.apihub.v1.ExternalApi.verify|verify} messages. - * @param message ExternalApi message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.IExternalApi, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExternalApi message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ExternalApi.verify|verify} messages. - * @param message ExternalApi message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.IExternalApi, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExternalApi message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExternalApi - * @throws {Error} If the payload is not 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.apihub.v1.ExternalApi; - - /** - * Decodes an ExternalApi message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExternalApi - * @throws {Error} If the payload 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.apihub.v1.ExternalApi; - - /** - * Verifies an ExternalApi message. - * @param message Plain 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 ExternalApi message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExternalApi - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.ExternalApi; - - /** - * Creates a plain object from an ExternalApi message. Also converts values to other types if specified. - * @param message ExternalApi - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.ExternalApi, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExternalApi to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ExternalApi - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Represents a HostProjectRegistrationService */ - class HostProjectRegistrationService extends $protobuf.rpc.Service { - - /** - * Constructs a new HostProjectRegistrationService 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 HostProjectRegistrationService 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): HostProjectRegistrationService; - - /** - * Calls CreateHostProjectRegistration. - * @param request CreateHostProjectRegistrationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and HostProjectRegistration - */ - public createHostProjectRegistration(request: google.cloud.apihub.v1.ICreateHostProjectRegistrationRequest, callback: google.cloud.apihub.v1.HostProjectRegistrationService.CreateHostProjectRegistrationCallback): void; - - /** - * Calls CreateHostProjectRegistration. - * @param request CreateHostProjectRegistrationRequest message or plain object - * @returns Promise - */ - public createHostProjectRegistration(request: google.cloud.apihub.v1.ICreateHostProjectRegistrationRequest): Promise; - - /** - * Calls GetHostProjectRegistration. - * @param request GetHostProjectRegistrationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and HostProjectRegistration - */ - public getHostProjectRegistration(request: google.cloud.apihub.v1.IGetHostProjectRegistrationRequest, callback: google.cloud.apihub.v1.HostProjectRegistrationService.GetHostProjectRegistrationCallback): void; - - /** - * Calls GetHostProjectRegistration. - * @param request GetHostProjectRegistrationRequest message or plain object - * @returns Promise - */ - public getHostProjectRegistration(request: google.cloud.apihub.v1.IGetHostProjectRegistrationRequest): Promise; - - /** - * Calls ListHostProjectRegistrations. - * @param request ListHostProjectRegistrationsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListHostProjectRegistrationsResponse - */ - public listHostProjectRegistrations(request: google.cloud.apihub.v1.IListHostProjectRegistrationsRequest, callback: google.cloud.apihub.v1.HostProjectRegistrationService.ListHostProjectRegistrationsCallback): void; - - /** - * Calls ListHostProjectRegistrations. - * @param request ListHostProjectRegistrationsRequest message or plain object - * @returns Promise - */ - public listHostProjectRegistrations(request: google.cloud.apihub.v1.IListHostProjectRegistrationsRequest): Promise; - } - - namespace HostProjectRegistrationService { - - /** - * Callback as used by {@link google.cloud.apihub.v1.HostProjectRegistrationService|createHostProjectRegistration}. - * @param error Error, if any - * @param [response] HostProjectRegistration - */ - type CreateHostProjectRegistrationCallback = (error: (Error|null), response?: google.cloud.apihub.v1.HostProjectRegistration) => void; - - /** - * Callback as used by {@link google.cloud.apihub.v1.HostProjectRegistrationService|getHostProjectRegistration}. - * @param error Error, if any - * @param [response] HostProjectRegistration - */ - type GetHostProjectRegistrationCallback = (error: (Error|null), response?: google.cloud.apihub.v1.HostProjectRegistration) => void; - - /** - * Callback as used by {@link google.cloud.apihub.v1.HostProjectRegistrationService|listHostProjectRegistrations}. - * @param error Error, if any - * @param [response] ListHostProjectRegistrationsResponse - */ - type ListHostProjectRegistrationsCallback = (error: (Error|null), response?: google.cloud.apihub.v1.ListHostProjectRegistrationsResponse) => void; - } - - /** Properties of a CreateHostProjectRegistrationRequest. */ - interface ICreateHostProjectRegistrationRequest { - - /** CreateHostProjectRegistrationRequest parent */ - parent?: (string|null); - - /** CreateHostProjectRegistrationRequest hostProjectRegistrationId */ - hostProjectRegistrationId?: (string|null); - - /** CreateHostProjectRegistrationRequest hostProjectRegistration */ - hostProjectRegistration?: (google.cloud.apihub.v1.IHostProjectRegistration|null); - } - - /** Represents a CreateHostProjectRegistrationRequest. */ - class CreateHostProjectRegistrationRequest implements ICreateHostProjectRegistrationRequest { - - /** - * Constructs a new CreateHostProjectRegistrationRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.ICreateHostProjectRegistrationRequest); - - /** CreateHostProjectRegistrationRequest parent. */ - public parent: string; - - /** CreateHostProjectRegistrationRequest hostProjectRegistrationId. */ - public hostProjectRegistrationId: string; - - /** CreateHostProjectRegistrationRequest hostProjectRegistration. */ - public hostProjectRegistration?: (google.cloud.apihub.v1.IHostProjectRegistration|null); - - /** - * Creates a new CreateHostProjectRegistrationRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateHostProjectRegistrationRequest instance - */ - public static create(properties?: google.cloud.apihub.v1.ICreateHostProjectRegistrationRequest): google.cloud.apihub.v1.CreateHostProjectRegistrationRequest; - - /** - * Encodes the specified CreateHostProjectRegistrationRequest message. Does not implicitly {@link google.cloud.apihub.v1.CreateHostProjectRegistrationRequest.verify|verify} messages. - * @param message CreateHostProjectRegistrationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.ICreateHostProjectRegistrationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateHostProjectRegistrationRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.CreateHostProjectRegistrationRequest.verify|verify} messages. - * @param message CreateHostProjectRegistrationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.ICreateHostProjectRegistrationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateHostProjectRegistrationRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateHostProjectRegistrationRequest - * @throws {Error} If the payload is not 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.apihub.v1.CreateHostProjectRegistrationRequest; - - /** - * Decodes a CreateHostProjectRegistrationRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateHostProjectRegistrationRequest - * @throws {Error} If the payload 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.apihub.v1.CreateHostProjectRegistrationRequest; - - /** - * Verifies a CreateHostProjectRegistrationRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateHostProjectRegistrationRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateHostProjectRegistrationRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.CreateHostProjectRegistrationRequest; - - /** - * Creates a plain object from a CreateHostProjectRegistrationRequest message. Also converts values to other types if specified. - * @param message CreateHostProjectRegistrationRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.CreateHostProjectRegistrationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateHostProjectRegistrationRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateHostProjectRegistrationRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetHostProjectRegistrationRequest. */ - interface IGetHostProjectRegistrationRequest { - - /** GetHostProjectRegistrationRequest name */ - name?: (string|null); - } - - /** Represents a GetHostProjectRegistrationRequest. */ - class GetHostProjectRegistrationRequest implements IGetHostProjectRegistrationRequest { - - /** - * Constructs a new GetHostProjectRegistrationRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.IGetHostProjectRegistrationRequest); - - /** GetHostProjectRegistrationRequest name. */ - public name: string; - - /** - * Creates a new GetHostProjectRegistrationRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetHostProjectRegistrationRequest instance - */ - public static create(properties?: google.cloud.apihub.v1.IGetHostProjectRegistrationRequest): google.cloud.apihub.v1.GetHostProjectRegistrationRequest; - - /** - * Encodes the specified GetHostProjectRegistrationRequest message. Does not implicitly {@link google.cloud.apihub.v1.GetHostProjectRegistrationRequest.verify|verify} messages. - * @param message GetHostProjectRegistrationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.IGetHostProjectRegistrationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetHostProjectRegistrationRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.GetHostProjectRegistrationRequest.verify|verify} messages. - * @param message GetHostProjectRegistrationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.IGetHostProjectRegistrationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetHostProjectRegistrationRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetHostProjectRegistrationRequest - * @throws {Error} If the payload is not 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.apihub.v1.GetHostProjectRegistrationRequest; - - /** - * Decodes a GetHostProjectRegistrationRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetHostProjectRegistrationRequest - * @throws {Error} If the payload 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.apihub.v1.GetHostProjectRegistrationRequest; - - /** - * Verifies a GetHostProjectRegistrationRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetHostProjectRegistrationRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetHostProjectRegistrationRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.GetHostProjectRegistrationRequest; - - /** - * Creates a plain object from a GetHostProjectRegistrationRequest message. Also converts values to other types if specified. - * @param message GetHostProjectRegistrationRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.GetHostProjectRegistrationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetHostProjectRegistrationRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetHostProjectRegistrationRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListHostProjectRegistrationsRequest. */ - interface IListHostProjectRegistrationsRequest { - - /** ListHostProjectRegistrationsRequest parent */ - parent?: (string|null); - - /** ListHostProjectRegistrationsRequest pageSize */ - pageSize?: (number|null); - - /** ListHostProjectRegistrationsRequest pageToken */ - pageToken?: (string|null); - - /** ListHostProjectRegistrationsRequest filter */ - filter?: (string|null); - - /** ListHostProjectRegistrationsRequest orderBy */ - orderBy?: (string|null); - } - - /** Represents a ListHostProjectRegistrationsRequest. */ - class ListHostProjectRegistrationsRequest implements IListHostProjectRegistrationsRequest { - - /** - * Constructs a new ListHostProjectRegistrationsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.IListHostProjectRegistrationsRequest); - - /** ListHostProjectRegistrationsRequest parent. */ - public parent: string; - - /** ListHostProjectRegistrationsRequest pageSize. */ - public pageSize: number; - - /** ListHostProjectRegistrationsRequest pageToken. */ - public pageToken: string; - - /** ListHostProjectRegistrationsRequest filter. */ - public filter: string; - - /** ListHostProjectRegistrationsRequest orderBy. */ - public orderBy: string; - - /** - * Creates a new ListHostProjectRegistrationsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListHostProjectRegistrationsRequest instance - */ - public static create(properties?: google.cloud.apihub.v1.IListHostProjectRegistrationsRequest): google.cloud.apihub.v1.ListHostProjectRegistrationsRequest; - - /** - * Encodes the specified ListHostProjectRegistrationsRequest message. Does not implicitly {@link google.cloud.apihub.v1.ListHostProjectRegistrationsRequest.verify|verify} messages. - * @param message ListHostProjectRegistrationsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.IListHostProjectRegistrationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListHostProjectRegistrationsRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListHostProjectRegistrationsRequest.verify|verify} messages. - * @param message ListHostProjectRegistrationsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.IListHostProjectRegistrationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListHostProjectRegistrationsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListHostProjectRegistrationsRequest - * @throws {Error} If the payload is not 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.apihub.v1.ListHostProjectRegistrationsRequest; - - /** - * Decodes a ListHostProjectRegistrationsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListHostProjectRegistrationsRequest - * @throws {Error} If the payload 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.apihub.v1.ListHostProjectRegistrationsRequest; - - /** - * Verifies a ListHostProjectRegistrationsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListHostProjectRegistrationsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListHostProjectRegistrationsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.ListHostProjectRegistrationsRequest; - - /** - * Creates a plain object from a ListHostProjectRegistrationsRequest message. Also converts values to other types if specified. - * @param message ListHostProjectRegistrationsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.ListHostProjectRegistrationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListHostProjectRegistrationsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListHostProjectRegistrationsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListHostProjectRegistrationsResponse. */ - interface IListHostProjectRegistrationsResponse { - - /** ListHostProjectRegistrationsResponse hostProjectRegistrations */ - hostProjectRegistrations?: (google.cloud.apihub.v1.IHostProjectRegistration[]|null); - - /** ListHostProjectRegistrationsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListHostProjectRegistrationsResponse. */ - class ListHostProjectRegistrationsResponse implements IListHostProjectRegistrationsResponse { - - /** - * Constructs a new ListHostProjectRegistrationsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.IListHostProjectRegistrationsResponse); - - /** ListHostProjectRegistrationsResponse hostProjectRegistrations. */ - public hostProjectRegistrations: google.cloud.apihub.v1.IHostProjectRegistration[]; - - /** ListHostProjectRegistrationsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListHostProjectRegistrationsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListHostProjectRegistrationsResponse instance - */ - public static create(properties?: google.cloud.apihub.v1.IListHostProjectRegistrationsResponse): google.cloud.apihub.v1.ListHostProjectRegistrationsResponse; - - /** - * Encodes the specified ListHostProjectRegistrationsResponse message. Does not implicitly {@link google.cloud.apihub.v1.ListHostProjectRegistrationsResponse.verify|verify} messages. - * @param message ListHostProjectRegistrationsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.IListHostProjectRegistrationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListHostProjectRegistrationsResponse message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListHostProjectRegistrationsResponse.verify|verify} messages. - * @param message ListHostProjectRegistrationsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.IListHostProjectRegistrationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListHostProjectRegistrationsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListHostProjectRegistrationsResponse - * @throws {Error} If the payload is not 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.apihub.v1.ListHostProjectRegistrationsResponse; - - /** - * Decodes a ListHostProjectRegistrationsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListHostProjectRegistrationsResponse - * @throws {Error} If the payload 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.apihub.v1.ListHostProjectRegistrationsResponse; - - /** - * Verifies a ListHostProjectRegistrationsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListHostProjectRegistrationsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListHostProjectRegistrationsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.ListHostProjectRegistrationsResponse; - - /** - * Creates a plain object from a ListHostProjectRegistrationsResponse message. Also converts values to other types if specified. - * @param message ListHostProjectRegistrationsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.ListHostProjectRegistrationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListHostProjectRegistrationsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListHostProjectRegistrationsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a HostProjectRegistration. */ - interface IHostProjectRegistration { - - /** HostProjectRegistration name */ - name?: (string|null); - - /** HostProjectRegistration gcpProject */ - gcpProject?: (string|null); - - /** HostProjectRegistration createTime */ - createTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a HostProjectRegistration. */ - class HostProjectRegistration implements IHostProjectRegistration { - - /** - * Constructs a new HostProjectRegistration. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.IHostProjectRegistration); - - /** HostProjectRegistration name. */ - public name: string; - - /** HostProjectRegistration gcpProject. */ - public gcpProject: string; - - /** HostProjectRegistration createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new HostProjectRegistration instance using the specified properties. - * @param [properties] Properties to set - * @returns HostProjectRegistration instance - */ - public static create(properties?: google.cloud.apihub.v1.IHostProjectRegistration): google.cloud.apihub.v1.HostProjectRegistration; - - /** - * Encodes the specified HostProjectRegistration message. Does not implicitly {@link google.cloud.apihub.v1.HostProjectRegistration.verify|verify} messages. - * @param message HostProjectRegistration message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.IHostProjectRegistration, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified HostProjectRegistration message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.HostProjectRegistration.verify|verify} messages. - * @param message HostProjectRegistration message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.IHostProjectRegistration, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a HostProjectRegistration message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns HostProjectRegistration - * @throws {Error} If the payload is not 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.apihub.v1.HostProjectRegistration; - - /** - * Decodes a HostProjectRegistration message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns HostProjectRegistration - * @throws {Error} If the payload 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.apihub.v1.HostProjectRegistration; - - /** - * Verifies a HostProjectRegistration message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a HostProjectRegistration message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns HostProjectRegistration - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.HostProjectRegistration; - - /** - * Creates a plain object from a HostProjectRegistration message. Also converts values to other types if specified. - * @param message HostProjectRegistration - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.HostProjectRegistration, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this HostProjectRegistration to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for HostProjectRegistration - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Represents a LintingService */ - class LintingService extends $protobuf.rpc.Service { - - /** - * Constructs a new LintingService 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 LintingService 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): LintingService; - - /** - * Calls GetStyleGuide. - * @param request GetStyleGuideRequest message or plain object - * @param callback Node-style callback called with the error, if any, and StyleGuide - */ - public getStyleGuide(request: google.cloud.apihub.v1.IGetStyleGuideRequest, callback: google.cloud.apihub.v1.LintingService.GetStyleGuideCallback): void; - - /** - * Calls GetStyleGuide. - * @param request GetStyleGuideRequest message or plain object - * @returns Promise - */ - public getStyleGuide(request: google.cloud.apihub.v1.IGetStyleGuideRequest): Promise; - - /** - * Calls UpdateStyleGuide. - * @param request UpdateStyleGuideRequest message or plain object - * @param callback Node-style callback called with the error, if any, and StyleGuide - */ - public updateStyleGuide(request: google.cloud.apihub.v1.IUpdateStyleGuideRequest, callback: google.cloud.apihub.v1.LintingService.UpdateStyleGuideCallback): void; - - /** - * Calls UpdateStyleGuide. - * @param request UpdateStyleGuideRequest message or plain object - * @returns Promise - */ - public updateStyleGuide(request: google.cloud.apihub.v1.IUpdateStyleGuideRequest): Promise; - - /** - * Calls GetStyleGuideContents. - * @param request GetStyleGuideContentsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and StyleGuideContents - */ - public getStyleGuideContents(request: google.cloud.apihub.v1.IGetStyleGuideContentsRequest, callback: google.cloud.apihub.v1.LintingService.GetStyleGuideContentsCallback): void; - - /** - * Calls GetStyleGuideContents. - * @param request GetStyleGuideContentsRequest message or plain object - * @returns Promise - */ - public getStyleGuideContents(request: google.cloud.apihub.v1.IGetStyleGuideContentsRequest): Promise; - - /** - * Calls LintSpec. - * @param request LintSpecRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public lintSpec(request: google.cloud.apihub.v1.ILintSpecRequest, callback: google.cloud.apihub.v1.LintingService.LintSpecCallback): void; - - /** - * Calls LintSpec. - * @param request LintSpecRequest message or plain object - * @returns Promise - */ - public lintSpec(request: google.cloud.apihub.v1.ILintSpecRequest): Promise; - } - - namespace LintingService { - - /** - * Callback as used by {@link google.cloud.apihub.v1.LintingService|getStyleGuide}. - * @param error Error, if any - * @param [response] StyleGuide - */ - type GetStyleGuideCallback = (error: (Error|null), response?: google.cloud.apihub.v1.StyleGuide) => void; - - /** - * Callback as used by {@link google.cloud.apihub.v1.LintingService|updateStyleGuide}. - * @param error Error, if any - * @param [response] StyleGuide - */ - type UpdateStyleGuideCallback = (error: (Error|null), response?: google.cloud.apihub.v1.StyleGuide) => void; - - /** - * Callback as used by {@link google.cloud.apihub.v1.LintingService|getStyleGuideContents}. - * @param error Error, if any - * @param [response] StyleGuideContents - */ - type GetStyleGuideContentsCallback = (error: (Error|null), response?: google.cloud.apihub.v1.StyleGuideContents) => void; - - /** - * Callback as used by {@link google.cloud.apihub.v1.LintingService|lintSpec}. - * @param error Error, if any - * @param [response] Empty - */ - type LintSpecCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - } - - /** Properties of a GetStyleGuideRequest. */ - interface IGetStyleGuideRequest { - - /** GetStyleGuideRequest name */ - name?: (string|null); - } - - /** Represents a GetStyleGuideRequest. */ - class GetStyleGuideRequest implements IGetStyleGuideRequest { - - /** - * Constructs a new GetStyleGuideRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.IGetStyleGuideRequest); - - /** GetStyleGuideRequest name. */ - public name: string; - - /** - * Creates a new GetStyleGuideRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetStyleGuideRequest instance - */ - public static create(properties?: google.cloud.apihub.v1.IGetStyleGuideRequest): google.cloud.apihub.v1.GetStyleGuideRequest; - - /** - * Encodes the specified GetStyleGuideRequest message. Does not implicitly {@link google.cloud.apihub.v1.GetStyleGuideRequest.verify|verify} messages. - * @param message GetStyleGuideRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.IGetStyleGuideRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetStyleGuideRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.GetStyleGuideRequest.verify|verify} messages. - * @param message GetStyleGuideRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.IGetStyleGuideRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetStyleGuideRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetStyleGuideRequest - * @throws {Error} If the payload is not 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.apihub.v1.GetStyleGuideRequest; - - /** - * Decodes a GetStyleGuideRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetStyleGuideRequest - * @throws {Error} If the payload 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.apihub.v1.GetStyleGuideRequest; - - /** - * Verifies a GetStyleGuideRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetStyleGuideRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetStyleGuideRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.GetStyleGuideRequest; - - /** - * Creates a plain object from a GetStyleGuideRequest message. Also converts values to other types if specified. - * @param message GetStyleGuideRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.GetStyleGuideRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetStyleGuideRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetStyleGuideRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateStyleGuideRequest. */ - interface IUpdateStyleGuideRequest { - - /** UpdateStyleGuideRequest styleGuide */ - styleGuide?: (google.cloud.apihub.v1.IStyleGuide|null); - - /** UpdateStyleGuideRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - } - - /** Represents an UpdateStyleGuideRequest. */ - class UpdateStyleGuideRequest implements IUpdateStyleGuideRequest { - - /** - * Constructs a new UpdateStyleGuideRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.IUpdateStyleGuideRequest); - - /** UpdateStyleGuideRequest styleGuide. */ - public styleGuide?: (google.cloud.apihub.v1.IStyleGuide|null); - - /** UpdateStyleGuideRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** - * Creates a new UpdateStyleGuideRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateStyleGuideRequest instance - */ - public static create(properties?: google.cloud.apihub.v1.IUpdateStyleGuideRequest): google.cloud.apihub.v1.UpdateStyleGuideRequest; - - /** - * Encodes the specified UpdateStyleGuideRequest message. Does not implicitly {@link google.cloud.apihub.v1.UpdateStyleGuideRequest.verify|verify} messages. - * @param message UpdateStyleGuideRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.IUpdateStyleGuideRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateStyleGuideRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.UpdateStyleGuideRequest.verify|verify} messages. - * @param message UpdateStyleGuideRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.IUpdateStyleGuideRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateStyleGuideRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateStyleGuideRequest - * @throws {Error} If the payload is not 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.apihub.v1.UpdateStyleGuideRequest; - - /** - * Decodes an UpdateStyleGuideRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateStyleGuideRequest - * @throws {Error} If the payload 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.apihub.v1.UpdateStyleGuideRequest; - - /** - * Verifies an UpdateStyleGuideRequest message. - * @param message Plain 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 UpdateStyleGuideRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateStyleGuideRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.UpdateStyleGuideRequest; - - /** - * Creates a plain object from an UpdateStyleGuideRequest message. Also converts values to other types if specified. - * @param message UpdateStyleGuideRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.UpdateStyleGuideRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateStyleGuideRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateStyleGuideRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetStyleGuideContentsRequest. */ - interface IGetStyleGuideContentsRequest { - - /** GetStyleGuideContentsRequest name */ - name?: (string|null); - } - - /** Represents a GetStyleGuideContentsRequest. */ - class GetStyleGuideContentsRequest implements IGetStyleGuideContentsRequest { - - /** - * Constructs a new GetStyleGuideContentsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.IGetStyleGuideContentsRequest); - - /** GetStyleGuideContentsRequest name. */ - public name: string; - - /** - * Creates a new GetStyleGuideContentsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetStyleGuideContentsRequest instance - */ - public static create(properties?: google.cloud.apihub.v1.IGetStyleGuideContentsRequest): google.cloud.apihub.v1.GetStyleGuideContentsRequest; - - /** - * Encodes the specified GetStyleGuideContentsRequest message. Does not implicitly {@link google.cloud.apihub.v1.GetStyleGuideContentsRequest.verify|verify} messages. - * @param message GetStyleGuideContentsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.IGetStyleGuideContentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetStyleGuideContentsRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.GetStyleGuideContentsRequest.verify|verify} messages. - * @param message GetStyleGuideContentsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.IGetStyleGuideContentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetStyleGuideContentsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetStyleGuideContentsRequest - * @throws {Error} If the payload is not 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.apihub.v1.GetStyleGuideContentsRequest; - - /** - * Decodes a GetStyleGuideContentsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetStyleGuideContentsRequest - * @throws {Error} If the payload 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.apihub.v1.GetStyleGuideContentsRequest; - - /** - * Verifies a GetStyleGuideContentsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetStyleGuideContentsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetStyleGuideContentsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.GetStyleGuideContentsRequest; - - /** - * Creates a plain object from a GetStyleGuideContentsRequest message. Also converts values to other types if specified. - * @param message GetStyleGuideContentsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.GetStyleGuideContentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetStyleGuideContentsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetStyleGuideContentsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a LintSpecRequest. */ - interface ILintSpecRequest { - - /** LintSpecRequest name */ - name?: (string|null); - } - - /** Represents a LintSpecRequest. */ - class LintSpecRequest implements ILintSpecRequest { - - /** - * Constructs a new LintSpecRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.ILintSpecRequest); - - /** LintSpecRequest name. */ - public name: string; - - /** - * Creates a new LintSpecRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns LintSpecRequest instance - */ - public static create(properties?: google.cloud.apihub.v1.ILintSpecRequest): google.cloud.apihub.v1.LintSpecRequest; - - /** - * Encodes the specified LintSpecRequest message. Does not implicitly {@link google.cloud.apihub.v1.LintSpecRequest.verify|verify} messages. - * @param message LintSpecRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.ILintSpecRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified LintSpecRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.LintSpecRequest.verify|verify} messages. - * @param message LintSpecRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.ILintSpecRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a LintSpecRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns LintSpecRequest - * @throws {Error} If the payload is not 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.apihub.v1.LintSpecRequest; - - /** - * Decodes a LintSpecRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns LintSpecRequest - * @throws {Error} If the payload 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.apihub.v1.LintSpecRequest; - - /** - * Verifies a LintSpecRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a LintSpecRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns LintSpecRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.LintSpecRequest; - - /** - * Creates a plain object from a LintSpecRequest message. Also converts values to other types if specified. - * @param message LintSpecRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.LintSpecRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this LintSpecRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for LintSpecRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a StyleGuideContents. */ - interface IStyleGuideContents { - - /** StyleGuideContents contents */ - contents?: (Uint8Array|string|null); - - /** StyleGuideContents mimeType */ - mimeType?: (string|null); - } - - /** Represents a StyleGuideContents. */ - class StyleGuideContents implements IStyleGuideContents { - - /** - * Constructs a new StyleGuideContents. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.IStyleGuideContents); - - /** StyleGuideContents contents. */ - public contents: (Uint8Array|string); - - /** StyleGuideContents mimeType. */ - public mimeType: string; - - /** - * Creates a new StyleGuideContents instance using the specified properties. - * @param [properties] Properties to set - * @returns StyleGuideContents instance - */ - public static create(properties?: google.cloud.apihub.v1.IStyleGuideContents): google.cloud.apihub.v1.StyleGuideContents; - - /** - * Encodes the specified StyleGuideContents message. Does not implicitly {@link google.cloud.apihub.v1.StyleGuideContents.verify|verify} messages. - * @param message StyleGuideContents message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.IStyleGuideContents, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified StyleGuideContents message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.StyleGuideContents.verify|verify} messages. - * @param message StyleGuideContents message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.IStyleGuideContents, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a StyleGuideContents message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns StyleGuideContents - * @throws {Error} If the payload is not 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.apihub.v1.StyleGuideContents; - - /** - * Decodes a StyleGuideContents message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns StyleGuideContents - * @throws {Error} If the payload 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.apihub.v1.StyleGuideContents; - - /** - * Verifies a StyleGuideContents message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a StyleGuideContents message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns StyleGuideContents - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.StyleGuideContents; - - /** - * Creates a plain object from a StyleGuideContents message. Also converts values to other types if specified. - * @param message StyleGuideContents - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.StyleGuideContents, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this StyleGuideContents to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for StyleGuideContents - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a StyleGuide. */ - interface IStyleGuide { - - /** StyleGuide name */ - name?: (string|null); - - /** StyleGuide linter */ - linter?: (google.cloud.apihub.v1.Linter|keyof typeof google.cloud.apihub.v1.Linter|null); - - /** StyleGuide contents */ - contents?: (google.cloud.apihub.v1.IStyleGuideContents|null); - } - - /** Represents a StyleGuide. */ - class StyleGuide implements IStyleGuide { - - /** - * Constructs a new StyleGuide. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.IStyleGuide); - - /** StyleGuide name. */ - public name: string; - - /** StyleGuide linter. */ - public linter: (google.cloud.apihub.v1.Linter|keyof typeof google.cloud.apihub.v1.Linter); - - /** StyleGuide contents. */ - public contents?: (google.cloud.apihub.v1.IStyleGuideContents|null); - - /** - * Creates a new StyleGuide instance using the specified properties. - * @param [properties] Properties to set - * @returns StyleGuide instance - */ - public static create(properties?: google.cloud.apihub.v1.IStyleGuide): google.cloud.apihub.v1.StyleGuide; - - /** - * Encodes the specified StyleGuide message. Does not implicitly {@link google.cloud.apihub.v1.StyleGuide.verify|verify} messages. - * @param message StyleGuide message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.IStyleGuide, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified StyleGuide message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.StyleGuide.verify|verify} messages. - * @param message StyleGuide message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.IStyleGuide, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a StyleGuide message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns StyleGuide - * @throws {Error} If the payload is not 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.apihub.v1.StyleGuide; - - /** - * Decodes a StyleGuide message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns StyleGuide - * @throws {Error} If the payload 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.apihub.v1.StyleGuide; - - /** - * Verifies a StyleGuide message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a StyleGuide message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns StyleGuide - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.StyleGuide; - - /** - * Creates a plain object from a StyleGuide message. Also converts values to other types if specified. - * @param message StyleGuide - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.StyleGuide, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this StyleGuide to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for StyleGuide - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Represents an ApiHubPlugin */ - class ApiHubPlugin extends $protobuf.rpc.Service { - - /** - * Constructs a new ApiHubPlugin 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 ApiHubPlugin 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): ApiHubPlugin; - - /** - * Calls GetPlugin. - * @param request GetPluginRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Plugin - */ - public getPlugin(request: google.cloud.apihub.v1.IGetPluginRequest, callback: google.cloud.apihub.v1.ApiHubPlugin.GetPluginCallback): void; - - /** - * Calls GetPlugin. - * @param request GetPluginRequest message or plain object - * @returns Promise - */ - public getPlugin(request: google.cloud.apihub.v1.IGetPluginRequest): Promise; - - /** - * Calls EnablePlugin. - * @param request EnablePluginRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Plugin - */ - public enablePlugin(request: google.cloud.apihub.v1.IEnablePluginRequest, callback: google.cloud.apihub.v1.ApiHubPlugin.EnablePluginCallback): void; - - /** - * Calls EnablePlugin. - * @param request EnablePluginRequest message or plain object - * @returns Promise - */ - public enablePlugin(request: google.cloud.apihub.v1.IEnablePluginRequest): Promise; - - /** - * Calls DisablePlugin. - * @param request DisablePluginRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Plugin - */ - public disablePlugin(request: google.cloud.apihub.v1.IDisablePluginRequest, callback: google.cloud.apihub.v1.ApiHubPlugin.DisablePluginCallback): void; - - /** - * Calls DisablePlugin. - * @param request DisablePluginRequest message or plain object - * @returns Promise - */ - public disablePlugin(request: google.cloud.apihub.v1.IDisablePluginRequest): Promise; - } - - namespace ApiHubPlugin { - - /** - * Callback as used by {@link google.cloud.apihub.v1.ApiHubPlugin|getPlugin}. - * @param error Error, if any - * @param [response] Plugin - */ - type GetPluginCallback = (error: (Error|null), response?: google.cloud.apihub.v1.Plugin) => void; - - /** - * Callback as used by {@link google.cloud.apihub.v1.ApiHubPlugin|enablePlugin}. - * @param error Error, if any - * @param [response] Plugin - */ - type EnablePluginCallback = (error: (Error|null), response?: google.cloud.apihub.v1.Plugin) => void; - - /** - * Callback as used by {@link google.cloud.apihub.v1.ApiHubPlugin|disablePlugin}. - * @param error Error, if any - * @param [response] Plugin - */ - type DisablePluginCallback = (error: (Error|null), response?: google.cloud.apihub.v1.Plugin) => void; - } - - /** Properties of a Plugin. */ - interface IPlugin { - - /** Plugin name */ - name?: (string|null); - - /** Plugin displayName */ - displayName?: (string|null); - - /** Plugin type */ - type?: (google.cloud.apihub.v1.IAttributeValues|null); - - /** Plugin description */ - description?: (string|null); - - /** Plugin state */ - state?: (google.cloud.apihub.v1.Plugin.State|keyof typeof google.cloud.apihub.v1.Plugin.State|null); - } - - /** Represents a Plugin. */ - class Plugin implements IPlugin { - - /** - * Constructs a new Plugin. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.IPlugin); - - /** Plugin name. */ - public name: string; - - /** Plugin displayName. */ - public displayName: string; - - /** Plugin type. */ - public type?: (google.cloud.apihub.v1.IAttributeValues|null); - - /** Plugin description. */ - public description: string; - - /** Plugin state. */ - public state: (google.cloud.apihub.v1.Plugin.State|keyof typeof google.cloud.apihub.v1.Plugin.State); - - /** - * Creates a new Plugin instance using the specified properties. - * @param [properties] Properties to set - * @returns Plugin instance - */ - public static create(properties?: google.cloud.apihub.v1.IPlugin): google.cloud.apihub.v1.Plugin; - - /** - * Encodes the specified Plugin message. Does not implicitly {@link google.cloud.apihub.v1.Plugin.verify|verify} messages. - * @param message Plugin message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.IPlugin, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Plugin message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.Plugin.verify|verify} messages. - * @param message Plugin message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.IPlugin, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Plugin message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Plugin - * @throws {Error} If the payload is not 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.apihub.v1.Plugin; - - /** - * Decodes a Plugin message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Plugin - * @throws {Error} If the payload 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.apihub.v1.Plugin; - - /** - * Verifies a Plugin message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Plugin message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Plugin - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.Plugin; - - /** - * Creates a plain object from a Plugin message. Also converts values to other types if specified. - * @param message Plugin - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.Plugin, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Plugin to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Plugin - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Plugin { - - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - ENABLED = 1, - DISABLED = 2 - } - } - - /** Properties of a GetPluginRequest. */ - interface IGetPluginRequest { - - /** GetPluginRequest name */ - name?: (string|null); - } - - /** Represents a GetPluginRequest. */ - class GetPluginRequest implements IGetPluginRequest { - - /** - * Constructs a new GetPluginRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.IGetPluginRequest); - - /** GetPluginRequest name. */ - public name: string; - - /** - * Creates a new GetPluginRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetPluginRequest instance - */ - public static create(properties?: google.cloud.apihub.v1.IGetPluginRequest): google.cloud.apihub.v1.GetPluginRequest; - - /** - * Encodes the specified GetPluginRequest message. Does not implicitly {@link google.cloud.apihub.v1.GetPluginRequest.verify|verify} messages. - * @param message GetPluginRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.IGetPluginRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetPluginRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.GetPluginRequest.verify|verify} messages. - * @param message GetPluginRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.IGetPluginRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetPluginRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetPluginRequest - * @throws {Error} If the payload is not 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.apihub.v1.GetPluginRequest; - - /** - * Decodes a GetPluginRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetPluginRequest - * @throws {Error} If the payload 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.apihub.v1.GetPluginRequest; - - /** - * Verifies a GetPluginRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetPluginRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetPluginRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.GetPluginRequest; - - /** - * Creates a plain object from a GetPluginRequest message. Also converts values to other types if specified. - * @param message GetPluginRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.GetPluginRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetPluginRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetPluginRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EnablePluginRequest. */ - interface IEnablePluginRequest { - - /** EnablePluginRequest name */ - name?: (string|null); - } - - /** Represents an EnablePluginRequest. */ - class EnablePluginRequest implements IEnablePluginRequest { - - /** - * Constructs a new EnablePluginRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.IEnablePluginRequest); - - /** EnablePluginRequest name. */ - public name: string; - - /** - * Creates a new EnablePluginRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns EnablePluginRequest instance - */ - public static create(properties?: google.cloud.apihub.v1.IEnablePluginRequest): google.cloud.apihub.v1.EnablePluginRequest; - - /** - * Encodes the specified EnablePluginRequest message. Does not implicitly {@link google.cloud.apihub.v1.EnablePluginRequest.verify|verify} messages. - * @param message EnablePluginRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.IEnablePluginRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnablePluginRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.EnablePluginRequest.verify|verify} messages. - * @param message EnablePluginRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.IEnablePluginRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnablePluginRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnablePluginRequest - * @throws {Error} If the payload is not 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.apihub.v1.EnablePluginRequest; - - /** - * Decodes an EnablePluginRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnablePluginRequest - * @throws {Error} If the payload 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.apihub.v1.EnablePluginRequest; - - /** - * Verifies an EnablePluginRequest message. - * @param message Plain 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 EnablePluginRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnablePluginRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.EnablePluginRequest; - - /** - * Creates a plain object from an EnablePluginRequest message. Also converts values to other types if specified. - * @param message EnablePluginRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.EnablePluginRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnablePluginRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnablePluginRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DisablePluginRequest. */ - interface IDisablePluginRequest { - - /** DisablePluginRequest name */ - name?: (string|null); - } - - /** Represents a DisablePluginRequest. */ - class DisablePluginRequest implements IDisablePluginRequest { - - /** - * Constructs a new DisablePluginRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.IDisablePluginRequest); - - /** DisablePluginRequest name. */ - public name: string; - - /** - * Creates a new DisablePluginRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DisablePluginRequest instance - */ - public static create(properties?: google.cloud.apihub.v1.IDisablePluginRequest): google.cloud.apihub.v1.DisablePluginRequest; - - /** - * Encodes the specified DisablePluginRequest message. Does not implicitly {@link google.cloud.apihub.v1.DisablePluginRequest.verify|verify} messages. - * @param message DisablePluginRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.IDisablePluginRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DisablePluginRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.DisablePluginRequest.verify|verify} messages. - * @param message DisablePluginRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.IDisablePluginRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DisablePluginRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DisablePluginRequest - * @throws {Error} If the payload is not 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.apihub.v1.DisablePluginRequest; - - /** - * Decodes a DisablePluginRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DisablePluginRequest - * @throws {Error} If the payload 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.apihub.v1.DisablePluginRequest; - - /** - * Verifies a DisablePluginRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DisablePluginRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DisablePluginRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.DisablePluginRequest; - - /** - * Creates a plain object from a DisablePluginRequest message. Also converts values to other types if specified. - * @param message DisablePluginRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.DisablePluginRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DisablePluginRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DisablePluginRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Represents a Provisioning */ - class Provisioning extends $protobuf.rpc.Service { - - /** - * Constructs a new Provisioning 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 Provisioning 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): Provisioning; - - /** - * Calls CreateApiHubInstance. - * @param request CreateApiHubInstanceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public createApiHubInstance(request: google.cloud.apihub.v1.ICreateApiHubInstanceRequest, callback: google.cloud.apihub.v1.Provisioning.CreateApiHubInstanceCallback): void; - - /** - * Calls CreateApiHubInstance. - * @param request CreateApiHubInstanceRequest message or plain object - * @returns Promise - */ - public createApiHubInstance(request: google.cloud.apihub.v1.ICreateApiHubInstanceRequest): Promise; - - /** - * Calls GetApiHubInstance. - * @param request GetApiHubInstanceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ApiHubInstance - */ - public getApiHubInstance(request: google.cloud.apihub.v1.IGetApiHubInstanceRequest, callback: google.cloud.apihub.v1.Provisioning.GetApiHubInstanceCallback): void; - - /** - * Calls GetApiHubInstance. - * @param request GetApiHubInstanceRequest message or plain object - * @returns Promise - */ - public getApiHubInstance(request: google.cloud.apihub.v1.IGetApiHubInstanceRequest): Promise; - - /** - * Calls LookupApiHubInstance. - * @param request LookupApiHubInstanceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and LookupApiHubInstanceResponse - */ - public lookupApiHubInstance(request: google.cloud.apihub.v1.ILookupApiHubInstanceRequest, callback: google.cloud.apihub.v1.Provisioning.LookupApiHubInstanceCallback): void; - - /** - * Calls LookupApiHubInstance. - * @param request LookupApiHubInstanceRequest message or plain object - * @returns Promise - */ - public lookupApiHubInstance(request: google.cloud.apihub.v1.ILookupApiHubInstanceRequest): Promise; - } - - namespace Provisioning { - - /** - * Callback as used by {@link google.cloud.apihub.v1.Provisioning|createApiHubInstance}. - * @param error Error, if any - * @param [response] Operation - */ - type CreateApiHubInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.apihub.v1.Provisioning|getApiHubInstance}. - * @param error Error, if any - * @param [response] ApiHubInstance - */ - type GetApiHubInstanceCallback = (error: (Error|null), response?: google.cloud.apihub.v1.ApiHubInstance) => void; - - /** - * Callback as used by {@link google.cloud.apihub.v1.Provisioning|lookupApiHubInstance}. - * @param error Error, if any - * @param [response] LookupApiHubInstanceResponse - */ - type LookupApiHubInstanceCallback = (error: (Error|null), response?: google.cloud.apihub.v1.LookupApiHubInstanceResponse) => void; - } - - /** Properties of a CreateApiHubInstanceRequest. */ - interface ICreateApiHubInstanceRequest { - - /** CreateApiHubInstanceRequest parent */ - parent?: (string|null); - - /** CreateApiHubInstanceRequest apiHubInstanceId */ - apiHubInstanceId?: (string|null); - - /** CreateApiHubInstanceRequest apiHubInstance */ - apiHubInstance?: (google.cloud.apihub.v1.IApiHubInstance|null); - } - - /** Represents a CreateApiHubInstanceRequest. */ - class CreateApiHubInstanceRequest implements ICreateApiHubInstanceRequest { - - /** - * Constructs a new CreateApiHubInstanceRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.ICreateApiHubInstanceRequest); - - /** CreateApiHubInstanceRequest parent. */ - public parent: string; - - /** CreateApiHubInstanceRequest apiHubInstanceId. */ - public apiHubInstanceId: string; - - /** CreateApiHubInstanceRequest apiHubInstance. */ - public apiHubInstance?: (google.cloud.apihub.v1.IApiHubInstance|null); - - /** - * Creates a new CreateApiHubInstanceRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateApiHubInstanceRequest instance - */ - public static create(properties?: google.cloud.apihub.v1.ICreateApiHubInstanceRequest): google.cloud.apihub.v1.CreateApiHubInstanceRequest; - - /** - * Encodes the specified CreateApiHubInstanceRequest message. Does not implicitly {@link google.cloud.apihub.v1.CreateApiHubInstanceRequest.verify|verify} messages. - * @param message CreateApiHubInstanceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.ICreateApiHubInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateApiHubInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.CreateApiHubInstanceRequest.verify|verify} messages. - * @param message CreateApiHubInstanceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.ICreateApiHubInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateApiHubInstanceRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateApiHubInstanceRequest - * @throws {Error} If the payload is not 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.apihub.v1.CreateApiHubInstanceRequest; - - /** - * Decodes a CreateApiHubInstanceRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateApiHubInstanceRequest - * @throws {Error} If the payload 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.apihub.v1.CreateApiHubInstanceRequest; - - /** - * Verifies a CreateApiHubInstanceRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateApiHubInstanceRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateApiHubInstanceRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.CreateApiHubInstanceRequest; - - /** - * Creates a plain object from a CreateApiHubInstanceRequest message. Also converts values to other types if specified. - * @param message CreateApiHubInstanceRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.CreateApiHubInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateApiHubInstanceRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateApiHubInstanceRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetApiHubInstanceRequest. */ - interface IGetApiHubInstanceRequest { - - /** GetApiHubInstanceRequest name */ - name?: (string|null); - } - - /** Represents a GetApiHubInstanceRequest. */ - class GetApiHubInstanceRequest implements IGetApiHubInstanceRequest { - - /** - * Constructs a new GetApiHubInstanceRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.IGetApiHubInstanceRequest); - - /** GetApiHubInstanceRequest name. */ - public name: string; - - /** - * Creates a new GetApiHubInstanceRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetApiHubInstanceRequest instance - */ - public static create(properties?: google.cloud.apihub.v1.IGetApiHubInstanceRequest): google.cloud.apihub.v1.GetApiHubInstanceRequest; - - /** - * Encodes the specified GetApiHubInstanceRequest message. Does not implicitly {@link google.cloud.apihub.v1.GetApiHubInstanceRequest.verify|verify} messages. - * @param message GetApiHubInstanceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.IGetApiHubInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetApiHubInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.GetApiHubInstanceRequest.verify|verify} messages. - * @param message GetApiHubInstanceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.IGetApiHubInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetApiHubInstanceRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetApiHubInstanceRequest - * @throws {Error} If the payload is not 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.apihub.v1.GetApiHubInstanceRequest; - - /** - * Decodes a GetApiHubInstanceRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetApiHubInstanceRequest - * @throws {Error} If the payload 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.apihub.v1.GetApiHubInstanceRequest; - - /** - * Verifies a GetApiHubInstanceRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetApiHubInstanceRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetApiHubInstanceRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.GetApiHubInstanceRequest; - - /** - * Creates a plain object from a GetApiHubInstanceRequest message. Also converts values to other types if specified. - * @param message GetApiHubInstanceRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.GetApiHubInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetApiHubInstanceRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetApiHubInstanceRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a LookupApiHubInstanceRequest. */ - interface ILookupApiHubInstanceRequest { - - /** LookupApiHubInstanceRequest parent */ - parent?: (string|null); - } - - /** Represents a LookupApiHubInstanceRequest. */ - class LookupApiHubInstanceRequest implements ILookupApiHubInstanceRequest { - - /** - * Constructs a new LookupApiHubInstanceRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.ILookupApiHubInstanceRequest); - - /** LookupApiHubInstanceRequest parent. */ - public parent: string; - - /** - * Creates a new LookupApiHubInstanceRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns LookupApiHubInstanceRequest instance - */ - public static create(properties?: google.cloud.apihub.v1.ILookupApiHubInstanceRequest): google.cloud.apihub.v1.LookupApiHubInstanceRequest; - - /** - * Encodes the specified LookupApiHubInstanceRequest message. Does not implicitly {@link google.cloud.apihub.v1.LookupApiHubInstanceRequest.verify|verify} messages. - * @param message LookupApiHubInstanceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.ILookupApiHubInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified LookupApiHubInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.LookupApiHubInstanceRequest.verify|verify} messages. - * @param message LookupApiHubInstanceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.ILookupApiHubInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a LookupApiHubInstanceRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns LookupApiHubInstanceRequest - * @throws {Error} If the payload is not 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.apihub.v1.LookupApiHubInstanceRequest; - - /** - * Decodes a LookupApiHubInstanceRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns LookupApiHubInstanceRequest - * @throws {Error} If the payload 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.apihub.v1.LookupApiHubInstanceRequest; - - /** - * Verifies a LookupApiHubInstanceRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a LookupApiHubInstanceRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns LookupApiHubInstanceRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.LookupApiHubInstanceRequest; - - /** - * Creates a plain object from a LookupApiHubInstanceRequest message. Also converts values to other types if specified. - * @param message LookupApiHubInstanceRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.LookupApiHubInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this LookupApiHubInstanceRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for LookupApiHubInstanceRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a LookupApiHubInstanceResponse. */ - interface ILookupApiHubInstanceResponse { - - /** LookupApiHubInstanceResponse apiHubInstance */ - apiHubInstance?: (google.cloud.apihub.v1.IApiHubInstance|null); - } - - /** Represents a LookupApiHubInstanceResponse. */ - class LookupApiHubInstanceResponse implements ILookupApiHubInstanceResponse { - - /** - * Constructs a new LookupApiHubInstanceResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.ILookupApiHubInstanceResponse); - - /** LookupApiHubInstanceResponse apiHubInstance. */ - public apiHubInstance?: (google.cloud.apihub.v1.IApiHubInstance|null); - - /** - * Creates a new LookupApiHubInstanceResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns LookupApiHubInstanceResponse instance - */ - public static create(properties?: google.cloud.apihub.v1.ILookupApiHubInstanceResponse): google.cloud.apihub.v1.LookupApiHubInstanceResponse; - - /** - * Encodes the specified LookupApiHubInstanceResponse message. Does not implicitly {@link google.cloud.apihub.v1.LookupApiHubInstanceResponse.verify|verify} messages. - * @param message LookupApiHubInstanceResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.ILookupApiHubInstanceResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified LookupApiHubInstanceResponse message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.LookupApiHubInstanceResponse.verify|verify} messages. - * @param message LookupApiHubInstanceResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.ILookupApiHubInstanceResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a LookupApiHubInstanceResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns LookupApiHubInstanceResponse - * @throws {Error} If the payload is not 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.apihub.v1.LookupApiHubInstanceResponse; - - /** - * Decodes a LookupApiHubInstanceResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns LookupApiHubInstanceResponse - * @throws {Error} If the payload 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.apihub.v1.LookupApiHubInstanceResponse; - - /** - * Verifies a LookupApiHubInstanceResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a LookupApiHubInstanceResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns LookupApiHubInstanceResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.LookupApiHubInstanceResponse; - - /** - * Creates a plain object from a LookupApiHubInstanceResponse message. Also converts values to other types if specified. - * @param message LookupApiHubInstanceResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.LookupApiHubInstanceResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this LookupApiHubInstanceResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for LookupApiHubInstanceResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Represents a RuntimeProjectAttachmentService */ - class RuntimeProjectAttachmentService extends $protobuf.rpc.Service { - - /** - * Constructs a new RuntimeProjectAttachmentService 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 RuntimeProjectAttachmentService 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): RuntimeProjectAttachmentService; - - /** - * Calls CreateRuntimeProjectAttachment. - * @param request CreateRuntimeProjectAttachmentRequest message or plain object - * @param callback Node-style callback called with the error, if any, and RuntimeProjectAttachment - */ - public createRuntimeProjectAttachment(request: google.cloud.apihub.v1.ICreateRuntimeProjectAttachmentRequest, callback: google.cloud.apihub.v1.RuntimeProjectAttachmentService.CreateRuntimeProjectAttachmentCallback): void; - - /** - * Calls CreateRuntimeProjectAttachment. - * @param request CreateRuntimeProjectAttachmentRequest message or plain object - * @returns Promise - */ - public createRuntimeProjectAttachment(request: google.cloud.apihub.v1.ICreateRuntimeProjectAttachmentRequest): Promise; - - /** - * Calls GetRuntimeProjectAttachment. - * @param request GetRuntimeProjectAttachmentRequest message or plain object - * @param callback Node-style callback called with the error, if any, and RuntimeProjectAttachment - */ - public getRuntimeProjectAttachment(request: google.cloud.apihub.v1.IGetRuntimeProjectAttachmentRequest, callback: google.cloud.apihub.v1.RuntimeProjectAttachmentService.GetRuntimeProjectAttachmentCallback): void; - - /** - * Calls GetRuntimeProjectAttachment. - * @param request GetRuntimeProjectAttachmentRequest message or plain object - * @returns Promise - */ - public getRuntimeProjectAttachment(request: google.cloud.apihub.v1.IGetRuntimeProjectAttachmentRequest): Promise; - - /** - * Calls ListRuntimeProjectAttachments. - * @param request ListRuntimeProjectAttachmentsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListRuntimeProjectAttachmentsResponse - */ - public listRuntimeProjectAttachments(request: google.cloud.apihub.v1.IListRuntimeProjectAttachmentsRequest, callback: google.cloud.apihub.v1.RuntimeProjectAttachmentService.ListRuntimeProjectAttachmentsCallback): void; - - /** - * Calls ListRuntimeProjectAttachments. - * @param request ListRuntimeProjectAttachmentsRequest message or plain object - * @returns Promise - */ - public listRuntimeProjectAttachments(request: google.cloud.apihub.v1.IListRuntimeProjectAttachmentsRequest): Promise; - - /** - * Calls DeleteRuntimeProjectAttachment. - * @param request DeleteRuntimeProjectAttachmentRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteRuntimeProjectAttachment(request: google.cloud.apihub.v1.IDeleteRuntimeProjectAttachmentRequest, callback: google.cloud.apihub.v1.RuntimeProjectAttachmentService.DeleteRuntimeProjectAttachmentCallback): void; - - /** - * Calls DeleteRuntimeProjectAttachment. - * @param request DeleteRuntimeProjectAttachmentRequest message or plain object - * @returns Promise - */ - public deleteRuntimeProjectAttachment(request: google.cloud.apihub.v1.IDeleteRuntimeProjectAttachmentRequest): Promise; - - /** - * Calls LookupRuntimeProjectAttachment. - * @param request LookupRuntimeProjectAttachmentRequest message or plain object - * @param callback Node-style callback called with the error, if any, and LookupRuntimeProjectAttachmentResponse - */ - public lookupRuntimeProjectAttachment(request: google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentRequest, callback: google.cloud.apihub.v1.RuntimeProjectAttachmentService.LookupRuntimeProjectAttachmentCallback): void; - - /** - * Calls LookupRuntimeProjectAttachment. - * @param request LookupRuntimeProjectAttachmentRequest message or plain object - * @returns Promise - */ - public lookupRuntimeProjectAttachment(request: google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentRequest): Promise; - } - - namespace RuntimeProjectAttachmentService { - - /** - * Callback as used by {@link google.cloud.apihub.v1.RuntimeProjectAttachmentService|createRuntimeProjectAttachment}. - * @param error Error, if any - * @param [response] RuntimeProjectAttachment - */ - type CreateRuntimeProjectAttachmentCallback = (error: (Error|null), response?: google.cloud.apihub.v1.RuntimeProjectAttachment) => void; - - /** - * Callback as used by {@link google.cloud.apihub.v1.RuntimeProjectAttachmentService|getRuntimeProjectAttachment}. - * @param error Error, if any - * @param [response] RuntimeProjectAttachment - */ - type GetRuntimeProjectAttachmentCallback = (error: (Error|null), response?: google.cloud.apihub.v1.RuntimeProjectAttachment) => void; - - /** - * Callback as used by {@link google.cloud.apihub.v1.RuntimeProjectAttachmentService|listRuntimeProjectAttachments}. - * @param error Error, if any - * @param [response] ListRuntimeProjectAttachmentsResponse - */ - type ListRuntimeProjectAttachmentsCallback = (error: (Error|null), response?: google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse) => void; - - /** - * Callback as used by {@link google.cloud.apihub.v1.RuntimeProjectAttachmentService|deleteRuntimeProjectAttachment}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteRuntimeProjectAttachmentCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.cloud.apihub.v1.RuntimeProjectAttachmentService|lookupRuntimeProjectAttachment}. - * @param error Error, if any - * @param [response] LookupRuntimeProjectAttachmentResponse - */ - type LookupRuntimeProjectAttachmentCallback = (error: (Error|null), response?: google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse) => void; - } - - /** Properties of a CreateRuntimeProjectAttachmentRequest. */ - interface ICreateRuntimeProjectAttachmentRequest { - - /** CreateRuntimeProjectAttachmentRequest parent */ - parent?: (string|null); - - /** CreateRuntimeProjectAttachmentRequest runtimeProjectAttachmentId */ - runtimeProjectAttachmentId?: (string|null); - - /** CreateRuntimeProjectAttachmentRequest runtimeProjectAttachment */ - runtimeProjectAttachment?: (google.cloud.apihub.v1.IRuntimeProjectAttachment|null); - } - - /** Represents a CreateRuntimeProjectAttachmentRequest. */ - class CreateRuntimeProjectAttachmentRequest implements ICreateRuntimeProjectAttachmentRequest { - - /** - * Constructs a new CreateRuntimeProjectAttachmentRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.ICreateRuntimeProjectAttachmentRequest); - - /** CreateRuntimeProjectAttachmentRequest parent. */ - public parent: string; - - /** CreateRuntimeProjectAttachmentRequest runtimeProjectAttachmentId. */ - public runtimeProjectAttachmentId: string; - - /** CreateRuntimeProjectAttachmentRequest runtimeProjectAttachment. */ - public runtimeProjectAttachment?: (google.cloud.apihub.v1.IRuntimeProjectAttachment|null); - - /** - * Creates a new CreateRuntimeProjectAttachmentRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateRuntimeProjectAttachmentRequest instance - */ - public static create(properties?: google.cloud.apihub.v1.ICreateRuntimeProjectAttachmentRequest): google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest; - - /** - * Encodes the specified CreateRuntimeProjectAttachmentRequest message. Does not implicitly {@link google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest.verify|verify} messages. - * @param message CreateRuntimeProjectAttachmentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.ICreateRuntimeProjectAttachmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateRuntimeProjectAttachmentRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest.verify|verify} messages. - * @param message CreateRuntimeProjectAttachmentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.ICreateRuntimeProjectAttachmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateRuntimeProjectAttachmentRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateRuntimeProjectAttachmentRequest - * @throws {Error} If the payload is not 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.apihub.v1.CreateRuntimeProjectAttachmentRequest; - - /** - * Decodes a CreateRuntimeProjectAttachmentRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateRuntimeProjectAttachmentRequest - * @throws {Error} If the payload 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.apihub.v1.CreateRuntimeProjectAttachmentRequest; - - /** - * Verifies a CreateRuntimeProjectAttachmentRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateRuntimeProjectAttachmentRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateRuntimeProjectAttachmentRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest; - - /** - * Creates a plain object from a CreateRuntimeProjectAttachmentRequest message. Also converts values to other types if specified. - * @param message CreateRuntimeProjectAttachmentRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateRuntimeProjectAttachmentRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateRuntimeProjectAttachmentRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetRuntimeProjectAttachmentRequest. */ - interface IGetRuntimeProjectAttachmentRequest { - - /** GetRuntimeProjectAttachmentRequest name */ - name?: (string|null); - } - - /** Represents a GetRuntimeProjectAttachmentRequest. */ - class GetRuntimeProjectAttachmentRequest implements IGetRuntimeProjectAttachmentRequest { - - /** - * Constructs a new GetRuntimeProjectAttachmentRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.IGetRuntimeProjectAttachmentRequest); - - /** GetRuntimeProjectAttachmentRequest name. */ - public name: string; - - /** - * Creates a new GetRuntimeProjectAttachmentRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetRuntimeProjectAttachmentRequest instance - */ - public static create(properties?: google.cloud.apihub.v1.IGetRuntimeProjectAttachmentRequest): google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest; - - /** - * Encodes the specified GetRuntimeProjectAttachmentRequest message. Does not implicitly {@link google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest.verify|verify} messages. - * @param message GetRuntimeProjectAttachmentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.IGetRuntimeProjectAttachmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetRuntimeProjectAttachmentRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest.verify|verify} messages. - * @param message GetRuntimeProjectAttachmentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.IGetRuntimeProjectAttachmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetRuntimeProjectAttachmentRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetRuntimeProjectAttachmentRequest - * @throws {Error} If the payload is not 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.apihub.v1.GetRuntimeProjectAttachmentRequest; - - /** - * Decodes a GetRuntimeProjectAttachmentRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetRuntimeProjectAttachmentRequest - * @throws {Error} If the payload 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.apihub.v1.GetRuntimeProjectAttachmentRequest; - - /** - * Verifies a GetRuntimeProjectAttachmentRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetRuntimeProjectAttachmentRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetRuntimeProjectAttachmentRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest; - - /** - * Creates a plain object from a GetRuntimeProjectAttachmentRequest message. Also converts values to other types if specified. - * @param message GetRuntimeProjectAttachmentRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetRuntimeProjectAttachmentRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetRuntimeProjectAttachmentRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListRuntimeProjectAttachmentsRequest. */ - interface IListRuntimeProjectAttachmentsRequest { - - /** ListRuntimeProjectAttachmentsRequest parent */ - parent?: (string|null); - - /** ListRuntimeProjectAttachmentsRequest pageSize */ - pageSize?: (number|null); - - /** ListRuntimeProjectAttachmentsRequest pageToken */ - pageToken?: (string|null); - - /** ListRuntimeProjectAttachmentsRequest filter */ - filter?: (string|null); - - /** ListRuntimeProjectAttachmentsRequest orderBy */ - orderBy?: (string|null); - } - - /** Represents a ListRuntimeProjectAttachmentsRequest. */ - class ListRuntimeProjectAttachmentsRequest implements IListRuntimeProjectAttachmentsRequest { - - /** - * Constructs a new ListRuntimeProjectAttachmentsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.IListRuntimeProjectAttachmentsRequest); - - /** ListRuntimeProjectAttachmentsRequest parent. */ - public parent: string; - - /** ListRuntimeProjectAttachmentsRequest pageSize. */ - public pageSize: number; - - /** ListRuntimeProjectAttachmentsRequest pageToken. */ - public pageToken: string; - - /** ListRuntimeProjectAttachmentsRequest filter. */ - public filter: string; - - /** ListRuntimeProjectAttachmentsRequest orderBy. */ - public orderBy: string; - - /** - * Creates a new ListRuntimeProjectAttachmentsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListRuntimeProjectAttachmentsRequest instance - */ - public static create(properties?: google.cloud.apihub.v1.IListRuntimeProjectAttachmentsRequest): google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest; - - /** - * Encodes the specified ListRuntimeProjectAttachmentsRequest message. Does not implicitly {@link google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest.verify|verify} messages. - * @param message ListRuntimeProjectAttachmentsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.IListRuntimeProjectAttachmentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListRuntimeProjectAttachmentsRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest.verify|verify} messages. - * @param message ListRuntimeProjectAttachmentsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.IListRuntimeProjectAttachmentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListRuntimeProjectAttachmentsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListRuntimeProjectAttachmentsRequest - * @throws {Error} If the payload is not 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.apihub.v1.ListRuntimeProjectAttachmentsRequest; - - /** - * Decodes a ListRuntimeProjectAttachmentsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListRuntimeProjectAttachmentsRequest - * @throws {Error} If the payload 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.apihub.v1.ListRuntimeProjectAttachmentsRequest; - - /** - * Verifies a ListRuntimeProjectAttachmentsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListRuntimeProjectAttachmentsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListRuntimeProjectAttachmentsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest; - - /** - * Creates a plain object from a ListRuntimeProjectAttachmentsRequest message. Also converts values to other types if specified. - * @param message ListRuntimeProjectAttachmentsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListRuntimeProjectAttachmentsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListRuntimeProjectAttachmentsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListRuntimeProjectAttachmentsResponse. */ - interface IListRuntimeProjectAttachmentsResponse { - - /** ListRuntimeProjectAttachmentsResponse runtimeProjectAttachments */ - runtimeProjectAttachments?: (google.cloud.apihub.v1.IRuntimeProjectAttachment[]|null); - - /** ListRuntimeProjectAttachmentsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListRuntimeProjectAttachmentsResponse. */ - class ListRuntimeProjectAttachmentsResponse implements IListRuntimeProjectAttachmentsResponse { - - /** - * Constructs a new ListRuntimeProjectAttachmentsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.IListRuntimeProjectAttachmentsResponse); - - /** ListRuntimeProjectAttachmentsResponse runtimeProjectAttachments. */ - public runtimeProjectAttachments: google.cloud.apihub.v1.IRuntimeProjectAttachment[]; - - /** ListRuntimeProjectAttachmentsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListRuntimeProjectAttachmentsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListRuntimeProjectAttachmentsResponse instance - */ - public static create(properties?: google.cloud.apihub.v1.IListRuntimeProjectAttachmentsResponse): google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse; - - /** - * Encodes the specified ListRuntimeProjectAttachmentsResponse message. Does not implicitly {@link google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse.verify|verify} messages. - * @param message ListRuntimeProjectAttachmentsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.IListRuntimeProjectAttachmentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListRuntimeProjectAttachmentsResponse message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse.verify|verify} messages. - * @param message ListRuntimeProjectAttachmentsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.IListRuntimeProjectAttachmentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListRuntimeProjectAttachmentsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListRuntimeProjectAttachmentsResponse - * @throws {Error} If the payload is not 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.apihub.v1.ListRuntimeProjectAttachmentsResponse; - - /** - * Decodes a ListRuntimeProjectAttachmentsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListRuntimeProjectAttachmentsResponse - * @throws {Error} If the payload 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.apihub.v1.ListRuntimeProjectAttachmentsResponse; - - /** - * Verifies a ListRuntimeProjectAttachmentsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListRuntimeProjectAttachmentsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListRuntimeProjectAttachmentsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse; - - /** - * Creates a plain object from a ListRuntimeProjectAttachmentsResponse message. Also converts values to other types if specified. - * @param message ListRuntimeProjectAttachmentsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListRuntimeProjectAttachmentsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListRuntimeProjectAttachmentsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteRuntimeProjectAttachmentRequest. */ - interface IDeleteRuntimeProjectAttachmentRequest { - - /** DeleteRuntimeProjectAttachmentRequest name */ - name?: (string|null); - } - - /** Represents a DeleteRuntimeProjectAttachmentRequest. */ - class DeleteRuntimeProjectAttachmentRequest implements IDeleteRuntimeProjectAttachmentRequest { - - /** - * Constructs a new DeleteRuntimeProjectAttachmentRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.IDeleteRuntimeProjectAttachmentRequest); - - /** DeleteRuntimeProjectAttachmentRequest name. */ - public name: string; - - /** - * Creates a new DeleteRuntimeProjectAttachmentRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteRuntimeProjectAttachmentRequest instance - */ - public static create(properties?: google.cloud.apihub.v1.IDeleteRuntimeProjectAttachmentRequest): google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest; - - /** - * Encodes the specified DeleteRuntimeProjectAttachmentRequest message. Does not implicitly {@link google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest.verify|verify} messages. - * @param message DeleteRuntimeProjectAttachmentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.IDeleteRuntimeProjectAttachmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteRuntimeProjectAttachmentRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest.verify|verify} messages. - * @param message DeleteRuntimeProjectAttachmentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.IDeleteRuntimeProjectAttachmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteRuntimeProjectAttachmentRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteRuntimeProjectAttachmentRequest - * @throws {Error} If the payload is not 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.apihub.v1.DeleteRuntimeProjectAttachmentRequest; - - /** - * Decodes a DeleteRuntimeProjectAttachmentRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteRuntimeProjectAttachmentRequest - * @throws {Error} If the payload 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.apihub.v1.DeleteRuntimeProjectAttachmentRequest; - - /** - * Verifies a DeleteRuntimeProjectAttachmentRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteRuntimeProjectAttachmentRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteRuntimeProjectAttachmentRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest; - - /** - * Creates a plain object from a DeleteRuntimeProjectAttachmentRequest message. Also converts values to other types if specified. - * @param message DeleteRuntimeProjectAttachmentRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteRuntimeProjectAttachmentRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteRuntimeProjectAttachmentRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a LookupRuntimeProjectAttachmentRequest. */ - interface ILookupRuntimeProjectAttachmentRequest { - - /** LookupRuntimeProjectAttachmentRequest name */ - name?: (string|null); - } - - /** Represents a LookupRuntimeProjectAttachmentRequest. */ - class LookupRuntimeProjectAttachmentRequest implements ILookupRuntimeProjectAttachmentRequest { - - /** - * Constructs a new LookupRuntimeProjectAttachmentRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentRequest); - - /** LookupRuntimeProjectAttachmentRequest name. */ - public name: string; - - /** - * Creates a new LookupRuntimeProjectAttachmentRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns LookupRuntimeProjectAttachmentRequest instance - */ - public static create(properties?: google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentRequest): google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest; - - /** - * Encodes the specified LookupRuntimeProjectAttachmentRequest message. Does not implicitly {@link google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest.verify|verify} messages. - * @param message LookupRuntimeProjectAttachmentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified LookupRuntimeProjectAttachmentRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest.verify|verify} messages. - * @param message LookupRuntimeProjectAttachmentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a LookupRuntimeProjectAttachmentRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns LookupRuntimeProjectAttachmentRequest - * @throws {Error} If the payload is not 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.apihub.v1.LookupRuntimeProjectAttachmentRequest; - - /** - * Decodes a LookupRuntimeProjectAttachmentRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns LookupRuntimeProjectAttachmentRequest - * @throws {Error} If the payload 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.apihub.v1.LookupRuntimeProjectAttachmentRequest; - - /** - * Verifies a LookupRuntimeProjectAttachmentRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a LookupRuntimeProjectAttachmentRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns LookupRuntimeProjectAttachmentRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest; - - /** - * Creates a plain object from a LookupRuntimeProjectAttachmentRequest message. Also converts values to other types if specified. - * @param message LookupRuntimeProjectAttachmentRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this LookupRuntimeProjectAttachmentRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for LookupRuntimeProjectAttachmentRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a LookupRuntimeProjectAttachmentResponse. */ - interface ILookupRuntimeProjectAttachmentResponse { - - /** LookupRuntimeProjectAttachmentResponse runtimeProjectAttachment */ - runtimeProjectAttachment?: (google.cloud.apihub.v1.IRuntimeProjectAttachment|null); - } - - /** Represents a LookupRuntimeProjectAttachmentResponse. */ - class LookupRuntimeProjectAttachmentResponse implements ILookupRuntimeProjectAttachmentResponse { - - /** - * Constructs a new LookupRuntimeProjectAttachmentResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentResponse); - - /** LookupRuntimeProjectAttachmentResponse runtimeProjectAttachment. */ - public runtimeProjectAttachment?: (google.cloud.apihub.v1.IRuntimeProjectAttachment|null); - - /** - * Creates a new LookupRuntimeProjectAttachmentResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns LookupRuntimeProjectAttachmentResponse instance - */ - public static create(properties?: google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentResponse): google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse; - - /** - * Encodes the specified LookupRuntimeProjectAttachmentResponse message. Does not implicitly {@link google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse.verify|verify} messages. - * @param message LookupRuntimeProjectAttachmentResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified LookupRuntimeProjectAttachmentResponse message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse.verify|verify} messages. - * @param message LookupRuntimeProjectAttachmentResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a LookupRuntimeProjectAttachmentResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns LookupRuntimeProjectAttachmentResponse - * @throws {Error} If the payload is not 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.apihub.v1.LookupRuntimeProjectAttachmentResponse; - - /** - * Decodes a LookupRuntimeProjectAttachmentResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns LookupRuntimeProjectAttachmentResponse - * @throws {Error} If the payload 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.apihub.v1.LookupRuntimeProjectAttachmentResponse; - - /** - * Verifies a LookupRuntimeProjectAttachmentResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a LookupRuntimeProjectAttachmentResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns LookupRuntimeProjectAttachmentResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse; - - /** - * Creates a plain object from a LookupRuntimeProjectAttachmentResponse message. Also converts values to other types if specified. - * @param message LookupRuntimeProjectAttachmentResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this LookupRuntimeProjectAttachmentResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for LookupRuntimeProjectAttachmentResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RuntimeProjectAttachment. */ - interface IRuntimeProjectAttachment { - - /** RuntimeProjectAttachment name */ - name?: (string|null); - - /** RuntimeProjectAttachment runtimeProject */ - runtimeProject?: (string|null); - - /** RuntimeProjectAttachment createTime */ - createTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a RuntimeProjectAttachment. */ - class RuntimeProjectAttachment implements IRuntimeProjectAttachment { - - /** - * Constructs a new RuntimeProjectAttachment. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.apihub.v1.IRuntimeProjectAttachment); - - /** RuntimeProjectAttachment name. */ - public name: string; - - /** RuntimeProjectAttachment runtimeProject. */ - public runtimeProject: string; - - /** RuntimeProjectAttachment createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new RuntimeProjectAttachment instance using the specified properties. - * @param [properties] Properties to set - * @returns RuntimeProjectAttachment instance - */ - public static create(properties?: google.cloud.apihub.v1.IRuntimeProjectAttachment): google.cloud.apihub.v1.RuntimeProjectAttachment; - - /** - * Encodes the specified RuntimeProjectAttachment message. Does not implicitly {@link google.cloud.apihub.v1.RuntimeProjectAttachment.verify|verify} messages. - * @param message RuntimeProjectAttachment message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.apihub.v1.IRuntimeProjectAttachment, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RuntimeProjectAttachment message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.RuntimeProjectAttachment.verify|verify} messages. - * @param message RuntimeProjectAttachment message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.apihub.v1.IRuntimeProjectAttachment, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RuntimeProjectAttachment message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RuntimeProjectAttachment - * @throws {Error} If the payload is not 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.apihub.v1.RuntimeProjectAttachment; - - /** - * Decodes a RuntimeProjectAttachment message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RuntimeProjectAttachment - * @throws {Error} If the payload 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.apihub.v1.RuntimeProjectAttachment; - - /** - * Verifies a RuntimeProjectAttachment message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RuntimeProjectAttachment message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RuntimeProjectAttachment - */ - public static fromObject(object: { [k: string]: any }): google.cloud.apihub.v1.RuntimeProjectAttachment; - - /** - * Creates a plain object from a RuntimeProjectAttachment message. Also converts values to other types if specified. - * @param message RuntimeProjectAttachment - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.apihub.v1.RuntimeProjectAttachment, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RuntimeProjectAttachment to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RuntimeProjectAttachment - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - } - } - - /** Namespace api. */ - namespace api { - - /** Properties of a Http. */ - interface IHttp { - - /** Http rules */ - rules?: (google.api.IHttpRule[]|null); - - /** Http fullyDecodeReservedExpansion */ - fullyDecodeReservedExpansion?: (boolean|null); - } - - /** Represents a Http. */ - class Http implements IHttp { - - /** - * Constructs a new Http. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IHttp); - - /** Http rules. */ - public rules: google.api.IHttpRule[]; - - /** Http fullyDecodeReservedExpansion. */ - public fullyDecodeReservedExpansion: boolean; - - /** - * Creates a new Http instance using the specified properties. - * @param [properties] Properties to set - * @returns Http instance - */ - public static create(properties?: google.api.IHttp): google.api.Http; - - /** - * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @param message Http message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @param message Http message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Http message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Http - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Http; - - /** - * Decodes a Http message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Http - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Http; - - /** - * Verifies a Http message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Http message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Http - */ - public static fromObject(object: { [k: string]: any }): google.api.Http; - - /** - * Creates a plain object from a Http message. Also converts values to other types if specified. - * @param message Http - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.Http, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Http to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * 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); - - /** Publishing protoReferenceDocumentationUri */ - protoReferenceDocumentationUri?: (string|null); - - /** Publishing restReferenceDocumentationUri */ - restReferenceDocumentationUri?: (string|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[]; - - /** Publishing protoReferenceDocumentationUri. */ - public protoReferenceDocumentationUri: string; - - /** Publishing restReferenceDocumentationUri. */ - public restReferenceDocumentationUri: string; - - /** - * 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); - - /** DotnetSettings renamedServices */ - renamedServices?: ({ [k: string]: string }|null); - - /** DotnetSettings renamedResources */ - renamedResources?: ({ [k: string]: string }|null); - - /** DotnetSettings ignoredResources */ - ignoredResources?: (string[]|null); - - /** DotnetSettings forcedNamespaceAliases */ - forcedNamespaceAliases?: (string[]|null); - - /** DotnetSettings handwrittenSignatures */ - handwrittenSignatures?: (string[]|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); - - /** DotnetSettings renamedServices. */ - public renamedServices: { [k: string]: string }; - - /** DotnetSettings renamedResources. */ - public renamedResources: { [k: string]: string }; - - /** DotnetSettings ignoredResources. */ - public ignoredResources: string[]; - - /** DotnetSettings forcedNamespaceAliases. */ - public forcedNamespaceAliases: string[]; - - /** DotnetSettings handwrittenSignatures. */ - public handwrittenSignatures: string[]; - - /** - * 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); - - /** MethodSettings autoPopulatedFields */ - autoPopulatedFields?: (string[]|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); - - /** MethodSettings autoPopulatedFields. */ - public autoPopulatedFields: string[]; - - /** - * 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, - SHOPPING = 5, - GEO = 6, - GENERATIVE_AI = 7 - } - - /** 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 - } - - /** 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, - IDENTIFIER = 8 - } - - /** 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; - } - } - - /** 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; - } - - /** Edition enum. */ - enum Edition { - EDITION_UNKNOWN = 0, - EDITION_PROTO2 = 998, - EDITION_PROTO3 = 999, - EDITION_2023 = 1000, - EDITION_2024 = 1001, - EDITION_1_TEST_ONLY = 1, - EDITION_2_TEST_ONLY = 2, - EDITION_99997_TEST_ONLY = 99997, - EDITION_99998_TEST_ONLY = 99998, - EDITION_99999_TEST_ONLY = 99999, - EDITION_MAX = 2147483647 - } - - /** 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?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|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: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** - * 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); - - /** ExtensionRangeOptions declaration */ - declaration?: (google.protobuf.ExtensionRangeOptions.IDeclaration[]|null); - - /** ExtensionRangeOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** ExtensionRangeOptions verification */ - verification?: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState|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[]; - - /** ExtensionRangeOptions declaration. */ - public declaration: google.protobuf.ExtensionRangeOptions.IDeclaration[]; - - /** ExtensionRangeOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** ExtensionRangeOptions verification. */ - public verification: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState); - - /** - * 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; - } - - namespace ExtensionRangeOptions { - - /** Properties of a Declaration. */ - interface IDeclaration { - - /** Declaration number */ - number?: (number|null); - - /** Declaration fullName */ - fullName?: (string|null); - - /** Declaration type */ - type?: (string|null); - - /** Declaration reserved */ - reserved?: (boolean|null); - - /** Declaration repeated */ - repeated?: (boolean|null); - } - - /** Represents a Declaration. */ - class Declaration implements IDeclaration { - - /** - * Constructs a new Declaration. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration); - - /** Declaration number. */ - public number: number; - - /** Declaration fullName. */ - public fullName: string; - - /** Declaration type. */ - public type: string; - - /** Declaration reserved. */ - public reserved: boolean; - - /** Declaration repeated. */ - public repeated: boolean; - - /** - * Creates a new Declaration instance using the specified properties. - * @param [properties] Properties to set - * @returns Declaration instance - */ - public static create(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration): google.protobuf.ExtensionRangeOptions.Declaration; - - /** - * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. - * @param message Declaration message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. - * @param message Declaration message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Declaration message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Declaration - * @throws {Error} If the payload is not 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.Declaration; - - /** - * Decodes a Declaration message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Declaration - * @throws {Error} If the payload 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.Declaration; - - /** - * Verifies a Declaration message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Declaration message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Declaration - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions.Declaration; - - /** - * Creates a plain object from a Declaration message. Also converts values to other types if specified. - * @param message Declaration - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ExtensionRangeOptions.Declaration, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Declaration to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Declaration - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** VerificationState enum. */ - enum VerificationState { - DECLARATION = 0, - UNVERIFIED = 1 - } - } - - /** 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_REPEATED = 3, - LABEL_REQUIRED = 2 - } - } - - /** 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 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 features */ - features?: (google.protobuf.IFeatureSet|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 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 features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** 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 features */ - features?: (google.protobuf.IFeatureSet|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 features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** 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 targets */ - targets?: (google.protobuf.FieldOptions.OptionTargetType[]|null); - - /** FieldOptions editionDefaults */ - editionDefaults?: (google.protobuf.FieldOptions.IEditionDefault[]|null); - - /** FieldOptions features */ - features?: (google.protobuf.IFeatureSet|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 targets. */ - public targets: google.protobuf.FieldOptions.OptionTargetType[]; - - /** FieldOptions editionDefaults. */ - public editionDefaults: google.protobuf.FieldOptions.IEditionDefault[]; - - /** FieldOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** 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 EditionDefault. */ - interface IEditionDefault { - - /** EditionDefault edition */ - edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - - /** EditionDefault value */ - value?: (string|null); - } - - /** Represents an EditionDefault. */ - class EditionDefault implements IEditionDefault { - - /** - * Constructs a new EditionDefault. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.FieldOptions.IEditionDefault); - - /** EditionDefault edition. */ - public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** EditionDefault value. */ - public value: string; - - /** - * Creates a new EditionDefault instance using the specified properties. - * @param [properties] Properties to set - * @returns EditionDefault instance - */ - public static create(properties?: google.protobuf.FieldOptions.IEditionDefault): google.protobuf.FieldOptions.EditionDefault; - - /** - * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. - * @param message EditionDefault message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. - * @param message EditionDefault message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EditionDefault message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EditionDefault - * @throws {Error} If the payload is not 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.EditionDefault; - - /** - * Decodes an EditionDefault message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EditionDefault - * @throws {Error} If the payload 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.EditionDefault; - - /** - * Verifies an EditionDefault message. - * @param message Plain 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 EditionDefault message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EditionDefault - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions.EditionDefault; - - /** - * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. - * @param message EditionDefault - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FieldOptions.EditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EditionDefault to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EditionDefault - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an OneofOptions. */ - interface IOneofOptions { - - /** OneofOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** 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 features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** 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 features */ - features?: (google.protobuf.IFeatureSet|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 features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** 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 features */ - features?: (google.protobuf.IFeatureSet|null); - - /** EnumValueOptions debugRedact */ - debugRedact?: (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 features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** EnumValueOptions debugRedact. */ - public debugRedact: 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 features */ - features?: (google.protobuf.IFeatureSet|null); - - /** 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); - - /** ServiceOptions .google.api.apiVersion */ - ".google.api.apiVersion"?: (string|null); - } - - /** Represents a ServiceOptions. */ - class ServiceOptions implements IServiceOptions { - - /** - * Constructs a new ServiceOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IServiceOptions); - - /** ServiceOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** 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 features */ - features?: (google.protobuf.IFeatureSet|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 features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** 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 FeatureSet. */ - interface IFeatureSet { - - /** FeatureSet fieldPresence */ - fieldPresence?: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence|null); - - /** FeatureSet enumType */ - enumType?: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType|null); - - /** FeatureSet repeatedFieldEncoding */ - repeatedFieldEncoding?: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding|null); - - /** FeatureSet utf8Validation */ - utf8Validation?: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation|null); - - /** FeatureSet messageEncoding */ - messageEncoding?: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding|null); - - /** FeatureSet jsonFormat */ - jsonFormat?: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat|null); - } - - /** Represents a FeatureSet. */ - class FeatureSet implements IFeatureSet { - - /** - * Constructs a new FeatureSet. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFeatureSet); - - /** FeatureSet fieldPresence. */ - public fieldPresence: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence); - - /** FeatureSet enumType. */ - public enumType: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType); - - /** FeatureSet repeatedFieldEncoding. */ - public repeatedFieldEncoding: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding); - - /** FeatureSet utf8Validation. */ - public utf8Validation: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation); - - /** FeatureSet messageEncoding. */ - public messageEncoding: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding); - - /** FeatureSet jsonFormat. */ - public jsonFormat: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat); - - /** - * Creates a new FeatureSet instance using the specified properties. - * @param [properties] Properties to set - * @returns FeatureSet instance - */ - public static create(properties?: google.protobuf.IFeatureSet): google.protobuf.FeatureSet; - - /** - * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. - * @param message FeatureSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. - * @param message FeatureSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FeatureSet message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FeatureSet - * @throws {Error} If the payload is not 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.FeatureSet; - - /** - * Decodes a FeatureSet message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FeatureSet - * @throws {Error} If the payload 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.FeatureSet; - - /** - * Verifies a FeatureSet message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FeatureSet - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSet; - - /** - * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. - * @param message FeatureSet - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FeatureSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FeatureSet to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FeatureSet - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FeatureSet { - - /** FieldPresence enum. */ - enum FieldPresence { - FIELD_PRESENCE_UNKNOWN = 0, - EXPLICIT = 1, - IMPLICIT = 2, - LEGACY_REQUIRED = 3 - } - - /** EnumType enum. */ - enum EnumType { - ENUM_TYPE_UNKNOWN = 0, - OPEN = 1, - CLOSED = 2 - } - - /** RepeatedFieldEncoding enum. */ - enum RepeatedFieldEncoding { - REPEATED_FIELD_ENCODING_UNKNOWN = 0, - PACKED = 1, - EXPANDED = 2 - } - - /** Utf8Validation enum. */ - enum Utf8Validation { - UTF8_VALIDATION_UNKNOWN = 0, - VERIFY = 2, - NONE = 3 - } - - /** MessageEncoding enum. */ - enum MessageEncoding { - MESSAGE_ENCODING_UNKNOWN = 0, - LENGTH_PREFIXED = 1, - DELIMITED = 2 - } - - /** JsonFormat enum. */ - enum JsonFormat { - JSON_FORMAT_UNKNOWN = 0, - ALLOW = 1, - LEGACY_BEST_EFFORT = 2 - } - } - - /** Properties of a FeatureSetDefaults. */ - interface IFeatureSetDefaults { - - /** FeatureSetDefaults defaults */ - defaults?: (google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]|null); - - /** FeatureSetDefaults minimumEdition */ - minimumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - - /** FeatureSetDefaults maximumEdition */ - maximumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - } - - /** Represents a FeatureSetDefaults. */ - class FeatureSetDefaults implements IFeatureSetDefaults { - - /** - * Constructs a new FeatureSetDefaults. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFeatureSetDefaults); - - /** FeatureSetDefaults defaults. */ - public defaults: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]; - - /** FeatureSetDefaults minimumEdition. */ - public minimumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** FeatureSetDefaults maximumEdition. */ - public maximumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** - * Creates a new FeatureSetDefaults instance using the specified properties. - * @param [properties] Properties to set - * @returns FeatureSetDefaults instance - */ - public static create(properties?: google.protobuf.IFeatureSetDefaults): google.protobuf.FeatureSetDefaults; - - /** - * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. - * @param message FeatureSetDefaults message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. - * @param message FeatureSetDefaults message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FeatureSetDefaults message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FeatureSetDefaults - * @throws {Error} If the payload is not 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.FeatureSetDefaults; - - /** - * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FeatureSetDefaults - * @throws {Error} If the payload 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.FeatureSetDefaults; - - /** - * Verifies a FeatureSetDefaults message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FeatureSetDefaults - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults; - - /** - * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. - * @param message FeatureSetDefaults - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FeatureSetDefaults, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FeatureSetDefaults to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FeatureSetDefaults - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FeatureSetDefaults { - - /** Properties of a FeatureSetEditionDefault. */ - interface IFeatureSetEditionDefault { - - /** FeatureSetEditionDefault edition */ - edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - - /** FeatureSetEditionDefault features */ - features?: (google.protobuf.IFeatureSet|null); - } - - /** Represents a FeatureSetEditionDefault. */ - class FeatureSetEditionDefault implements IFeatureSetEditionDefault { - - /** - * Constructs a new FeatureSetEditionDefault. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault); - - /** FeatureSetEditionDefault edition. */ - public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** FeatureSetEditionDefault features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** - * Creates a new FeatureSetEditionDefault instance using the specified properties. - * @param [properties] Properties to set - * @returns FeatureSetEditionDefault instance - */ - public static create(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; - - /** - * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. - * @param message FeatureSetEditionDefault message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. - * @param message FeatureSetEditionDefault message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FeatureSetEditionDefault - * @throws {Error} If the payload is not 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.FeatureSetDefaults.FeatureSetEditionDefault; - - /** - * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FeatureSetEditionDefault - * @throws {Error} If the payload 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.FeatureSetDefaults.FeatureSetEditionDefault; - - /** - * Verifies a FeatureSetEditionDefault message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FeatureSetEditionDefault - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; - - /** - * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. - * @param message FeatureSetEditionDefault - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FeatureSetEditionDefault to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FeatureSetEditionDefault - * @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 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 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 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; - } - - /** 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 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; - } - } - - /** 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/owl-bot-staging/google-cloud-apihub/v1/protos/protos.js b/owl-bot-staging/google-cloud-apihub/v1/protos/protos.js deleted file mode 100644 index dafb3c6f8b2..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/protos/protos.js +++ /dev/null @@ -1,53441 +0,0 @@ -// Copyright 2024 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_apihub_protos || ($protobuf.roots._google_cloud_apihub_protos = {}); - - $root.google = (function() { - - /** - * Namespace google. - * @exports google - * @namespace - */ - var google = {}; - - google.cloud = (function() { - - /** - * Namespace cloud. - * @memberof google - * @namespace - */ - var cloud = {}; - - cloud.apihub = (function() { - - /** - * Namespace apihub. - * @memberof google.cloud - * @namespace - */ - var apihub = {}; - - apihub.v1 = (function() { - - /** - * Namespace v1. - * @memberof google.cloud.apihub - * @namespace - */ - var v1 = {}; - - v1.ApiHub = (function() { - - /** - * Constructs a new ApiHub service. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents an ApiHub - * @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 ApiHub(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (ApiHub.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = ApiHub; - - /** - * Creates new ApiHub service using the specified rpc implementation. - * @function create - * @memberof google.cloud.apihub.v1.ApiHub - * @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 {ApiHub} RPC service. Useful where requests and/or responses are streamed. - */ - ApiHub.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.cloud.apihub.v1.ApiHub|createApi}. - * @memberof google.cloud.apihub.v1.ApiHub - * @typedef CreateApiCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.apihub.v1.Api} [response] Api - */ - - /** - * Calls CreateApi. - * @function createApi - * @memberof google.cloud.apihub.v1.ApiHub - * @instance - * @param {google.cloud.apihub.v1.ICreateApiRequest} request CreateApiRequest message or plain object - * @param {google.cloud.apihub.v1.ApiHub.CreateApiCallback} callback Node-style callback called with the error, if any, and Api - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(ApiHub.prototype.createApi = function createApi(request, callback) { - return this.rpcCall(createApi, $root.google.cloud.apihub.v1.CreateApiRequest, $root.google.cloud.apihub.v1.Api, request, callback); - }, "name", { value: "CreateApi" }); - - /** - * Calls CreateApi. - * @function createApi - * @memberof google.cloud.apihub.v1.ApiHub - * @instance - * @param {google.cloud.apihub.v1.ICreateApiRequest} request CreateApiRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.apihub.v1.ApiHub|getApi}. - * @memberof google.cloud.apihub.v1.ApiHub - * @typedef GetApiCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.apihub.v1.Api} [response] Api - */ - - /** - * Calls GetApi. - * @function getApi - * @memberof google.cloud.apihub.v1.ApiHub - * @instance - * @param {google.cloud.apihub.v1.IGetApiRequest} request GetApiRequest message or plain object - * @param {google.cloud.apihub.v1.ApiHub.GetApiCallback} callback Node-style callback called with the error, if any, and Api - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(ApiHub.prototype.getApi = function getApi(request, callback) { - return this.rpcCall(getApi, $root.google.cloud.apihub.v1.GetApiRequest, $root.google.cloud.apihub.v1.Api, request, callback); - }, "name", { value: "GetApi" }); - - /** - * Calls GetApi. - * @function getApi - * @memberof google.cloud.apihub.v1.ApiHub - * @instance - * @param {google.cloud.apihub.v1.IGetApiRequest} request GetApiRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.apihub.v1.ApiHub|listApis}. - * @memberof google.cloud.apihub.v1.ApiHub - * @typedef ListApisCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.apihub.v1.ListApisResponse} [response] ListApisResponse - */ - - /** - * Calls ListApis. - * @function listApis - * @memberof google.cloud.apihub.v1.ApiHub - * @instance - * @param {google.cloud.apihub.v1.IListApisRequest} request ListApisRequest message or plain object - * @param {google.cloud.apihub.v1.ApiHub.ListApisCallback} callback Node-style callback called with the error, if any, and ListApisResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(ApiHub.prototype.listApis = function listApis(request, callback) { - return this.rpcCall(listApis, $root.google.cloud.apihub.v1.ListApisRequest, $root.google.cloud.apihub.v1.ListApisResponse, request, callback); - }, "name", { value: "ListApis" }); - - /** - * Calls ListApis. - * @function listApis - * @memberof google.cloud.apihub.v1.ApiHub - * @instance - * @param {google.cloud.apihub.v1.IListApisRequest} request ListApisRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.apihub.v1.ApiHub|updateApi}. - * @memberof google.cloud.apihub.v1.ApiHub - * @typedef UpdateApiCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.apihub.v1.Api} [response] Api - */ - - /** - * Calls UpdateApi. - * @function updateApi - * @memberof google.cloud.apihub.v1.ApiHub - * @instance - * @param {google.cloud.apihub.v1.IUpdateApiRequest} request UpdateApiRequest message or plain object - * @param {google.cloud.apihub.v1.ApiHub.UpdateApiCallback} callback Node-style callback called with the error, if any, and Api - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(ApiHub.prototype.updateApi = function updateApi(request, callback) { - return this.rpcCall(updateApi, $root.google.cloud.apihub.v1.UpdateApiRequest, $root.google.cloud.apihub.v1.Api, request, callback); - }, "name", { value: "UpdateApi" }); - - /** - * Calls UpdateApi. - * @function updateApi - * @memberof google.cloud.apihub.v1.ApiHub - * @instance - * @param {google.cloud.apihub.v1.IUpdateApiRequest} request UpdateApiRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.apihub.v1.ApiHub|deleteApi}. - * @memberof google.cloud.apihub.v1.ApiHub - * @typedef DeleteApiCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DeleteApi. - * @function deleteApi - * @memberof google.cloud.apihub.v1.ApiHub - * @instance - * @param {google.cloud.apihub.v1.IDeleteApiRequest} request DeleteApiRequest message or plain object - * @param {google.cloud.apihub.v1.ApiHub.DeleteApiCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(ApiHub.prototype.deleteApi = function deleteApi(request, callback) { - return this.rpcCall(deleteApi, $root.google.cloud.apihub.v1.DeleteApiRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteApi" }); - - /** - * Calls DeleteApi. - * @function deleteApi - * @memberof google.cloud.apihub.v1.ApiHub - * @instance - * @param {google.cloud.apihub.v1.IDeleteApiRequest} request DeleteApiRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.apihub.v1.ApiHub|createVersion}. - * @memberof google.cloud.apihub.v1.ApiHub - * @typedef CreateVersionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.apihub.v1.Version} [response] Version - */ - - /** - * Calls CreateVersion. - * @function createVersion - * @memberof google.cloud.apihub.v1.ApiHub - * @instance - * @param {google.cloud.apihub.v1.ICreateVersionRequest} request CreateVersionRequest message or plain object - * @param {google.cloud.apihub.v1.ApiHub.CreateVersionCallback} callback Node-style callback called with the error, if any, and Version - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(ApiHub.prototype.createVersion = function createVersion(request, callback) { - return this.rpcCall(createVersion, $root.google.cloud.apihub.v1.CreateVersionRequest, $root.google.cloud.apihub.v1.Version, request, callback); - }, "name", { value: "CreateVersion" }); - - /** - * Calls CreateVersion. - * @function createVersion - * @memberof google.cloud.apihub.v1.ApiHub - * @instance - * @param {google.cloud.apihub.v1.ICreateVersionRequest} request CreateVersionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.apihub.v1.ApiHub|getVersion}. - * @memberof google.cloud.apihub.v1.ApiHub - * @typedef GetVersionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.apihub.v1.Version} [response] Version - */ - - /** - * Calls GetVersion. - * @function getVersion - * @memberof google.cloud.apihub.v1.ApiHub - * @instance - * @param {google.cloud.apihub.v1.IGetVersionRequest} request GetVersionRequest message or plain object - * @param {google.cloud.apihub.v1.ApiHub.GetVersionCallback} callback Node-style callback called with the error, if any, and Version - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(ApiHub.prototype.getVersion = function getVersion(request, callback) { - return this.rpcCall(getVersion, $root.google.cloud.apihub.v1.GetVersionRequest, $root.google.cloud.apihub.v1.Version, request, callback); - }, "name", { value: "GetVersion" }); - - /** - * Calls GetVersion. - * @function getVersion - * @memberof google.cloud.apihub.v1.ApiHub - * @instance - * @param {google.cloud.apihub.v1.IGetVersionRequest} request GetVersionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.apihub.v1.ApiHub|listVersions}. - * @memberof google.cloud.apihub.v1.ApiHub - * @typedef ListVersionsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.apihub.v1.ListVersionsResponse} [response] ListVersionsResponse - */ - - /** - * Calls ListVersions. - * @function listVersions - * @memberof google.cloud.apihub.v1.ApiHub - * @instance - * @param {google.cloud.apihub.v1.IListVersionsRequest} request ListVersionsRequest message or plain object - * @param {google.cloud.apihub.v1.ApiHub.ListVersionsCallback} callback Node-style callback called with the error, if any, and ListVersionsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(ApiHub.prototype.listVersions = function listVersions(request, callback) { - return this.rpcCall(listVersions, $root.google.cloud.apihub.v1.ListVersionsRequest, $root.google.cloud.apihub.v1.ListVersionsResponse, request, callback); - }, "name", { value: "ListVersions" }); - - /** - * Calls ListVersions. - * @function listVersions - * @memberof google.cloud.apihub.v1.ApiHub - * @instance - * @param {google.cloud.apihub.v1.IListVersionsRequest} request ListVersionsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.apihub.v1.ApiHub|updateVersion}. - * @memberof google.cloud.apihub.v1.ApiHub - * @typedef UpdateVersionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.apihub.v1.Version} [response] Version - */ - - /** - * Calls UpdateVersion. - * @function updateVersion - * @memberof google.cloud.apihub.v1.ApiHub - * @instance - * @param {google.cloud.apihub.v1.IUpdateVersionRequest} request UpdateVersionRequest message or plain object - * @param {google.cloud.apihub.v1.ApiHub.UpdateVersionCallback} callback Node-style callback called with the error, if any, and Version - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(ApiHub.prototype.updateVersion = function updateVersion(request, callback) { - return this.rpcCall(updateVersion, $root.google.cloud.apihub.v1.UpdateVersionRequest, $root.google.cloud.apihub.v1.Version, request, callback); - }, "name", { value: "UpdateVersion" }); - - /** - * Calls UpdateVersion. - * @function updateVersion - * @memberof google.cloud.apihub.v1.ApiHub - * @instance - * @param {google.cloud.apihub.v1.IUpdateVersionRequest} request UpdateVersionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.apihub.v1.ApiHub|deleteVersion}. - * @memberof google.cloud.apihub.v1.ApiHub - * @typedef DeleteVersionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DeleteVersion. - * @function deleteVersion - * @memberof google.cloud.apihub.v1.ApiHub - * @instance - * @param {google.cloud.apihub.v1.IDeleteVersionRequest} request DeleteVersionRequest message or plain object - * @param {google.cloud.apihub.v1.ApiHub.DeleteVersionCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(ApiHub.prototype.deleteVersion = function deleteVersion(request, callback) { - return this.rpcCall(deleteVersion, $root.google.cloud.apihub.v1.DeleteVersionRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteVersion" }); - - /** - * Calls DeleteVersion. - * @function deleteVersion - * @memberof google.cloud.apihub.v1.ApiHub - * @instance - * @param {google.cloud.apihub.v1.IDeleteVersionRequest} request DeleteVersionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.apihub.v1.ApiHub|createSpec}. - * @memberof google.cloud.apihub.v1.ApiHub - * @typedef CreateSpecCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.apihub.v1.Spec} [response] Spec - */ - - /** - * Calls CreateSpec. - * @function createSpec - * @memberof google.cloud.apihub.v1.ApiHub - * @instance - * @param {google.cloud.apihub.v1.ICreateSpecRequest} request CreateSpecRequest message or plain object - * @param {google.cloud.apihub.v1.ApiHub.CreateSpecCallback} callback Node-style callback called with the error, if any, and Spec - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(ApiHub.prototype.createSpec = function createSpec(request, callback) { - return this.rpcCall(createSpec, $root.google.cloud.apihub.v1.CreateSpecRequest, $root.google.cloud.apihub.v1.Spec, request, callback); - }, "name", { value: "CreateSpec" }); - - /** - * Calls CreateSpec. - * @function createSpec - * @memberof google.cloud.apihub.v1.ApiHub - * @instance - * @param {google.cloud.apihub.v1.ICreateSpecRequest} request CreateSpecRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.apihub.v1.ApiHub|getSpec}. - * @memberof google.cloud.apihub.v1.ApiHub - * @typedef GetSpecCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.apihub.v1.Spec} [response] Spec - */ - - /** - * Calls GetSpec. - * @function getSpec - * @memberof google.cloud.apihub.v1.ApiHub - * @instance - * @param {google.cloud.apihub.v1.IGetSpecRequest} request GetSpecRequest message or plain object - * @param {google.cloud.apihub.v1.ApiHub.GetSpecCallback} callback Node-style callback called with the error, if any, and Spec - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(ApiHub.prototype.getSpec = function getSpec(request, callback) { - return this.rpcCall(getSpec, $root.google.cloud.apihub.v1.GetSpecRequest, $root.google.cloud.apihub.v1.Spec, request, callback); - }, "name", { value: "GetSpec" }); - - /** - * Calls GetSpec. - * @function getSpec - * @memberof google.cloud.apihub.v1.ApiHub - * @instance - * @param {google.cloud.apihub.v1.IGetSpecRequest} request GetSpecRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.apihub.v1.ApiHub|getSpecContents}. - * @memberof google.cloud.apihub.v1.ApiHub - * @typedef GetSpecContentsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.apihub.v1.SpecContents} [response] SpecContents - */ - - /** - * Calls GetSpecContents. - * @function getSpecContents - * @memberof google.cloud.apihub.v1.ApiHub - * @instance - * @param {google.cloud.apihub.v1.IGetSpecContentsRequest} request GetSpecContentsRequest message or plain object - * @param {google.cloud.apihub.v1.ApiHub.GetSpecContentsCallback} callback Node-style callback called with the error, if any, and SpecContents - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(ApiHub.prototype.getSpecContents = function getSpecContents(request, callback) { - return this.rpcCall(getSpecContents, $root.google.cloud.apihub.v1.GetSpecContentsRequest, $root.google.cloud.apihub.v1.SpecContents, request, callback); - }, "name", { value: "GetSpecContents" }); - - /** - * Calls GetSpecContents. - * @function getSpecContents - * @memberof google.cloud.apihub.v1.ApiHub - * @instance - * @param {google.cloud.apihub.v1.IGetSpecContentsRequest} request GetSpecContentsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.apihub.v1.ApiHub|listSpecs}. - * @memberof google.cloud.apihub.v1.ApiHub - * @typedef ListSpecsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.apihub.v1.ListSpecsResponse} [response] ListSpecsResponse - */ - - /** - * Calls ListSpecs. - * @function listSpecs - * @memberof google.cloud.apihub.v1.ApiHub - * @instance - * @param {google.cloud.apihub.v1.IListSpecsRequest} request ListSpecsRequest message or plain object - * @param {google.cloud.apihub.v1.ApiHub.ListSpecsCallback} callback Node-style callback called with the error, if any, and ListSpecsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(ApiHub.prototype.listSpecs = function listSpecs(request, callback) { - return this.rpcCall(listSpecs, $root.google.cloud.apihub.v1.ListSpecsRequest, $root.google.cloud.apihub.v1.ListSpecsResponse, request, callback); - }, "name", { value: "ListSpecs" }); - - /** - * Calls ListSpecs. - * @function listSpecs - * @memberof google.cloud.apihub.v1.ApiHub - * @instance - * @param {google.cloud.apihub.v1.IListSpecsRequest} request ListSpecsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.apihub.v1.ApiHub|updateSpec}. - * @memberof google.cloud.apihub.v1.ApiHub - * @typedef UpdateSpecCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.apihub.v1.Spec} [response] Spec - */ - - /** - * Calls UpdateSpec. - * @function updateSpec - * @memberof google.cloud.apihub.v1.ApiHub - * @instance - * @param {google.cloud.apihub.v1.IUpdateSpecRequest} request UpdateSpecRequest message or plain object - * @param {google.cloud.apihub.v1.ApiHub.UpdateSpecCallback} callback Node-style callback called with the error, if any, and Spec - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(ApiHub.prototype.updateSpec = function updateSpec(request, callback) { - return this.rpcCall(updateSpec, $root.google.cloud.apihub.v1.UpdateSpecRequest, $root.google.cloud.apihub.v1.Spec, request, callback); - }, "name", { value: "UpdateSpec" }); - - /** - * Calls UpdateSpec. - * @function updateSpec - * @memberof google.cloud.apihub.v1.ApiHub - * @instance - * @param {google.cloud.apihub.v1.IUpdateSpecRequest} request UpdateSpecRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.apihub.v1.ApiHub|deleteSpec}. - * @memberof google.cloud.apihub.v1.ApiHub - * @typedef DeleteSpecCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DeleteSpec. - * @function deleteSpec - * @memberof google.cloud.apihub.v1.ApiHub - * @instance - * @param {google.cloud.apihub.v1.IDeleteSpecRequest} request DeleteSpecRequest message or plain object - * @param {google.cloud.apihub.v1.ApiHub.DeleteSpecCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(ApiHub.prototype.deleteSpec = function deleteSpec(request, callback) { - return this.rpcCall(deleteSpec, $root.google.cloud.apihub.v1.DeleteSpecRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteSpec" }); - - /** - * Calls DeleteSpec. - * @function deleteSpec - * @memberof google.cloud.apihub.v1.ApiHub - * @instance - * @param {google.cloud.apihub.v1.IDeleteSpecRequest} request DeleteSpecRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.apihub.v1.ApiHub|getApiOperation}. - * @memberof google.cloud.apihub.v1.ApiHub - * @typedef GetApiOperationCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.apihub.v1.ApiOperation} [response] ApiOperation - */ - - /** - * Calls GetApiOperation. - * @function getApiOperation - * @memberof google.cloud.apihub.v1.ApiHub - * @instance - * @param {google.cloud.apihub.v1.IGetApiOperationRequest} request GetApiOperationRequest message or plain object - * @param {google.cloud.apihub.v1.ApiHub.GetApiOperationCallback} callback Node-style callback called with the error, if any, and ApiOperation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(ApiHub.prototype.getApiOperation = function getApiOperation(request, callback) { - return this.rpcCall(getApiOperation, $root.google.cloud.apihub.v1.GetApiOperationRequest, $root.google.cloud.apihub.v1.ApiOperation, request, callback); - }, "name", { value: "GetApiOperation" }); - - /** - * Calls GetApiOperation. - * @function getApiOperation - * @memberof google.cloud.apihub.v1.ApiHub - * @instance - * @param {google.cloud.apihub.v1.IGetApiOperationRequest} request GetApiOperationRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.apihub.v1.ApiHub|listApiOperations}. - * @memberof google.cloud.apihub.v1.ApiHub - * @typedef ListApiOperationsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.apihub.v1.ListApiOperationsResponse} [response] ListApiOperationsResponse - */ - - /** - * Calls ListApiOperations. - * @function listApiOperations - * @memberof google.cloud.apihub.v1.ApiHub - * @instance - * @param {google.cloud.apihub.v1.IListApiOperationsRequest} request ListApiOperationsRequest message or plain object - * @param {google.cloud.apihub.v1.ApiHub.ListApiOperationsCallback} callback Node-style callback called with the error, if any, and ListApiOperationsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(ApiHub.prototype.listApiOperations = function listApiOperations(request, callback) { - return this.rpcCall(listApiOperations, $root.google.cloud.apihub.v1.ListApiOperationsRequest, $root.google.cloud.apihub.v1.ListApiOperationsResponse, request, callback); - }, "name", { value: "ListApiOperations" }); - - /** - * Calls ListApiOperations. - * @function listApiOperations - * @memberof google.cloud.apihub.v1.ApiHub - * @instance - * @param {google.cloud.apihub.v1.IListApiOperationsRequest} request ListApiOperationsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.apihub.v1.ApiHub|getDefinition}. - * @memberof google.cloud.apihub.v1.ApiHub - * @typedef GetDefinitionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.apihub.v1.Definition} [response] Definition - */ - - /** - * Calls GetDefinition. - * @function getDefinition - * @memberof google.cloud.apihub.v1.ApiHub - * @instance - * @param {google.cloud.apihub.v1.IGetDefinitionRequest} request GetDefinitionRequest message or plain object - * @param {google.cloud.apihub.v1.ApiHub.GetDefinitionCallback} callback Node-style callback called with the error, if any, and Definition - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(ApiHub.prototype.getDefinition = function getDefinition(request, callback) { - return this.rpcCall(getDefinition, $root.google.cloud.apihub.v1.GetDefinitionRequest, $root.google.cloud.apihub.v1.Definition, request, callback); - }, "name", { value: "GetDefinition" }); - - /** - * Calls GetDefinition. - * @function getDefinition - * @memberof google.cloud.apihub.v1.ApiHub - * @instance - * @param {google.cloud.apihub.v1.IGetDefinitionRequest} request GetDefinitionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.apihub.v1.ApiHub|createDeployment}. - * @memberof google.cloud.apihub.v1.ApiHub - * @typedef CreateDeploymentCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.apihub.v1.Deployment} [response] Deployment - */ - - /** - * Calls CreateDeployment. - * @function createDeployment - * @memberof google.cloud.apihub.v1.ApiHub - * @instance - * @param {google.cloud.apihub.v1.ICreateDeploymentRequest} request CreateDeploymentRequest message or plain object - * @param {google.cloud.apihub.v1.ApiHub.CreateDeploymentCallback} callback Node-style callback called with the error, if any, and Deployment - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(ApiHub.prototype.createDeployment = function createDeployment(request, callback) { - return this.rpcCall(createDeployment, $root.google.cloud.apihub.v1.CreateDeploymentRequest, $root.google.cloud.apihub.v1.Deployment, request, callback); - }, "name", { value: "CreateDeployment" }); - - /** - * Calls CreateDeployment. - * @function createDeployment - * @memberof google.cloud.apihub.v1.ApiHub - * @instance - * @param {google.cloud.apihub.v1.ICreateDeploymentRequest} request CreateDeploymentRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.apihub.v1.ApiHub|getDeployment}. - * @memberof google.cloud.apihub.v1.ApiHub - * @typedef GetDeploymentCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.apihub.v1.Deployment} [response] Deployment - */ - - /** - * Calls GetDeployment. - * @function getDeployment - * @memberof google.cloud.apihub.v1.ApiHub - * @instance - * @param {google.cloud.apihub.v1.IGetDeploymentRequest} request GetDeploymentRequest message or plain object - * @param {google.cloud.apihub.v1.ApiHub.GetDeploymentCallback} callback Node-style callback called with the error, if any, and Deployment - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(ApiHub.prototype.getDeployment = function getDeployment(request, callback) { - return this.rpcCall(getDeployment, $root.google.cloud.apihub.v1.GetDeploymentRequest, $root.google.cloud.apihub.v1.Deployment, request, callback); - }, "name", { value: "GetDeployment" }); - - /** - * Calls GetDeployment. - * @function getDeployment - * @memberof google.cloud.apihub.v1.ApiHub - * @instance - * @param {google.cloud.apihub.v1.IGetDeploymentRequest} request GetDeploymentRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.apihub.v1.ApiHub|listDeployments}. - * @memberof google.cloud.apihub.v1.ApiHub - * @typedef ListDeploymentsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.apihub.v1.ListDeploymentsResponse} [response] ListDeploymentsResponse - */ - - /** - * Calls ListDeployments. - * @function listDeployments - * @memberof google.cloud.apihub.v1.ApiHub - * @instance - * @param {google.cloud.apihub.v1.IListDeploymentsRequest} request ListDeploymentsRequest message or plain object - * @param {google.cloud.apihub.v1.ApiHub.ListDeploymentsCallback} callback Node-style callback called with the error, if any, and ListDeploymentsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(ApiHub.prototype.listDeployments = function listDeployments(request, callback) { - return this.rpcCall(listDeployments, $root.google.cloud.apihub.v1.ListDeploymentsRequest, $root.google.cloud.apihub.v1.ListDeploymentsResponse, request, callback); - }, "name", { value: "ListDeployments" }); - - /** - * Calls ListDeployments. - * @function listDeployments - * @memberof google.cloud.apihub.v1.ApiHub - * @instance - * @param {google.cloud.apihub.v1.IListDeploymentsRequest} request ListDeploymentsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.apihub.v1.ApiHub|updateDeployment}. - * @memberof google.cloud.apihub.v1.ApiHub - * @typedef UpdateDeploymentCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.apihub.v1.Deployment} [response] Deployment - */ - - /** - * Calls UpdateDeployment. - * @function updateDeployment - * @memberof google.cloud.apihub.v1.ApiHub - * @instance - * @param {google.cloud.apihub.v1.IUpdateDeploymentRequest} request UpdateDeploymentRequest message or plain object - * @param {google.cloud.apihub.v1.ApiHub.UpdateDeploymentCallback} callback Node-style callback called with the error, if any, and Deployment - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(ApiHub.prototype.updateDeployment = function updateDeployment(request, callback) { - return this.rpcCall(updateDeployment, $root.google.cloud.apihub.v1.UpdateDeploymentRequest, $root.google.cloud.apihub.v1.Deployment, request, callback); - }, "name", { value: "UpdateDeployment" }); - - /** - * Calls UpdateDeployment. - * @function updateDeployment - * @memberof google.cloud.apihub.v1.ApiHub - * @instance - * @param {google.cloud.apihub.v1.IUpdateDeploymentRequest} request UpdateDeploymentRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.apihub.v1.ApiHub|deleteDeployment}. - * @memberof google.cloud.apihub.v1.ApiHub - * @typedef DeleteDeploymentCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DeleteDeployment. - * @function deleteDeployment - * @memberof google.cloud.apihub.v1.ApiHub - * @instance - * @param {google.cloud.apihub.v1.IDeleteDeploymentRequest} request DeleteDeploymentRequest message or plain object - * @param {google.cloud.apihub.v1.ApiHub.DeleteDeploymentCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(ApiHub.prototype.deleteDeployment = function deleteDeployment(request, callback) { - return this.rpcCall(deleteDeployment, $root.google.cloud.apihub.v1.DeleteDeploymentRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteDeployment" }); - - /** - * Calls DeleteDeployment. - * @function deleteDeployment - * @memberof google.cloud.apihub.v1.ApiHub - * @instance - * @param {google.cloud.apihub.v1.IDeleteDeploymentRequest} request DeleteDeploymentRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.apihub.v1.ApiHub|createAttribute}. - * @memberof google.cloud.apihub.v1.ApiHub - * @typedef CreateAttributeCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.apihub.v1.Attribute} [response] Attribute - */ - - /** - * Calls CreateAttribute. - * @function createAttribute - * @memberof google.cloud.apihub.v1.ApiHub - * @instance - * @param {google.cloud.apihub.v1.ICreateAttributeRequest} request CreateAttributeRequest message or plain object - * @param {google.cloud.apihub.v1.ApiHub.CreateAttributeCallback} callback Node-style callback called with the error, if any, and Attribute - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(ApiHub.prototype.createAttribute = function createAttribute(request, callback) { - return this.rpcCall(createAttribute, $root.google.cloud.apihub.v1.CreateAttributeRequest, $root.google.cloud.apihub.v1.Attribute, request, callback); - }, "name", { value: "CreateAttribute" }); - - /** - * Calls CreateAttribute. - * @function createAttribute - * @memberof google.cloud.apihub.v1.ApiHub - * @instance - * @param {google.cloud.apihub.v1.ICreateAttributeRequest} request CreateAttributeRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.apihub.v1.ApiHub|getAttribute}. - * @memberof google.cloud.apihub.v1.ApiHub - * @typedef GetAttributeCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.apihub.v1.Attribute} [response] Attribute - */ - - /** - * Calls GetAttribute. - * @function getAttribute - * @memberof google.cloud.apihub.v1.ApiHub - * @instance - * @param {google.cloud.apihub.v1.IGetAttributeRequest} request GetAttributeRequest message or plain object - * @param {google.cloud.apihub.v1.ApiHub.GetAttributeCallback} callback Node-style callback called with the error, if any, and Attribute - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(ApiHub.prototype.getAttribute = function getAttribute(request, callback) { - return this.rpcCall(getAttribute, $root.google.cloud.apihub.v1.GetAttributeRequest, $root.google.cloud.apihub.v1.Attribute, request, callback); - }, "name", { value: "GetAttribute" }); - - /** - * Calls GetAttribute. - * @function getAttribute - * @memberof google.cloud.apihub.v1.ApiHub - * @instance - * @param {google.cloud.apihub.v1.IGetAttributeRequest} request GetAttributeRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.apihub.v1.ApiHub|updateAttribute}. - * @memberof google.cloud.apihub.v1.ApiHub - * @typedef UpdateAttributeCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.apihub.v1.Attribute} [response] Attribute - */ - - /** - * Calls UpdateAttribute. - * @function updateAttribute - * @memberof google.cloud.apihub.v1.ApiHub - * @instance - * @param {google.cloud.apihub.v1.IUpdateAttributeRequest} request UpdateAttributeRequest message or plain object - * @param {google.cloud.apihub.v1.ApiHub.UpdateAttributeCallback} callback Node-style callback called with the error, if any, and Attribute - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(ApiHub.prototype.updateAttribute = function updateAttribute(request, callback) { - return this.rpcCall(updateAttribute, $root.google.cloud.apihub.v1.UpdateAttributeRequest, $root.google.cloud.apihub.v1.Attribute, request, callback); - }, "name", { value: "UpdateAttribute" }); - - /** - * Calls UpdateAttribute. - * @function updateAttribute - * @memberof google.cloud.apihub.v1.ApiHub - * @instance - * @param {google.cloud.apihub.v1.IUpdateAttributeRequest} request UpdateAttributeRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.apihub.v1.ApiHub|deleteAttribute}. - * @memberof google.cloud.apihub.v1.ApiHub - * @typedef DeleteAttributeCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DeleteAttribute. - * @function deleteAttribute - * @memberof google.cloud.apihub.v1.ApiHub - * @instance - * @param {google.cloud.apihub.v1.IDeleteAttributeRequest} request DeleteAttributeRequest message or plain object - * @param {google.cloud.apihub.v1.ApiHub.DeleteAttributeCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(ApiHub.prototype.deleteAttribute = function deleteAttribute(request, callback) { - return this.rpcCall(deleteAttribute, $root.google.cloud.apihub.v1.DeleteAttributeRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteAttribute" }); - - /** - * Calls DeleteAttribute. - * @function deleteAttribute - * @memberof google.cloud.apihub.v1.ApiHub - * @instance - * @param {google.cloud.apihub.v1.IDeleteAttributeRequest} request DeleteAttributeRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.apihub.v1.ApiHub|listAttributes}. - * @memberof google.cloud.apihub.v1.ApiHub - * @typedef ListAttributesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.apihub.v1.ListAttributesResponse} [response] ListAttributesResponse - */ - - /** - * Calls ListAttributes. - * @function listAttributes - * @memberof google.cloud.apihub.v1.ApiHub - * @instance - * @param {google.cloud.apihub.v1.IListAttributesRequest} request ListAttributesRequest message or plain object - * @param {google.cloud.apihub.v1.ApiHub.ListAttributesCallback} callback Node-style callback called with the error, if any, and ListAttributesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(ApiHub.prototype.listAttributes = function listAttributes(request, callback) { - return this.rpcCall(listAttributes, $root.google.cloud.apihub.v1.ListAttributesRequest, $root.google.cloud.apihub.v1.ListAttributesResponse, request, callback); - }, "name", { value: "ListAttributes" }); - - /** - * Calls ListAttributes. - * @function listAttributes - * @memberof google.cloud.apihub.v1.ApiHub - * @instance - * @param {google.cloud.apihub.v1.IListAttributesRequest} request ListAttributesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.apihub.v1.ApiHub|searchResources}. - * @memberof google.cloud.apihub.v1.ApiHub - * @typedef SearchResourcesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.apihub.v1.SearchResourcesResponse} [response] SearchResourcesResponse - */ - - /** - * Calls SearchResources. - * @function searchResources - * @memberof google.cloud.apihub.v1.ApiHub - * @instance - * @param {google.cloud.apihub.v1.ISearchResourcesRequest} request SearchResourcesRequest message or plain object - * @param {google.cloud.apihub.v1.ApiHub.SearchResourcesCallback} callback Node-style callback called with the error, if any, and SearchResourcesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(ApiHub.prototype.searchResources = function searchResources(request, callback) { - return this.rpcCall(searchResources, $root.google.cloud.apihub.v1.SearchResourcesRequest, $root.google.cloud.apihub.v1.SearchResourcesResponse, request, callback); - }, "name", { value: "SearchResources" }); - - /** - * Calls SearchResources. - * @function searchResources - * @memberof google.cloud.apihub.v1.ApiHub - * @instance - * @param {google.cloud.apihub.v1.ISearchResourcesRequest} request SearchResourcesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.apihub.v1.ApiHub|createExternalApi}. - * @memberof google.cloud.apihub.v1.ApiHub - * @typedef CreateExternalApiCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.apihub.v1.ExternalApi} [response] ExternalApi - */ - - /** - * Calls CreateExternalApi. - * @function createExternalApi - * @memberof google.cloud.apihub.v1.ApiHub - * @instance - * @param {google.cloud.apihub.v1.ICreateExternalApiRequest} request CreateExternalApiRequest message or plain object - * @param {google.cloud.apihub.v1.ApiHub.CreateExternalApiCallback} callback Node-style callback called with the error, if any, and ExternalApi - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(ApiHub.prototype.createExternalApi = function createExternalApi(request, callback) { - return this.rpcCall(createExternalApi, $root.google.cloud.apihub.v1.CreateExternalApiRequest, $root.google.cloud.apihub.v1.ExternalApi, request, callback); - }, "name", { value: "CreateExternalApi" }); - - /** - * Calls CreateExternalApi. - * @function createExternalApi - * @memberof google.cloud.apihub.v1.ApiHub - * @instance - * @param {google.cloud.apihub.v1.ICreateExternalApiRequest} request CreateExternalApiRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.apihub.v1.ApiHub|getExternalApi}. - * @memberof google.cloud.apihub.v1.ApiHub - * @typedef GetExternalApiCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.apihub.v1.ExternalApi} [response] ExternalApi - */ - - /** - * Calls GetExternalApi. - * @function getExternalApi - * @memberof google.cloud.apihub.v1.ApiHub - * @instance - * @param {google.cloud.apihub.v1.IGetExternalApiRequest} request GetExternalApiRequest message or plain object - * @param {google.cloud.apihub.v1.ApiHub.GetExternalApiCallback} callback Node-style callback called with the error, if any, and ExternalApi - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(ApiHub.prototype.getExternalApi = function getExternalApi(request, callback) { - return this.rpcCall(getExternalApi, $root.google.cloud.apihub.v1.GetExternalApiRequest, $root.google.cloud.apihub.v1.ExternalApi, request, callback); - }, "name", { value: "GetExternalApi" }); - - /** - * Calls GetExternalApi. - * @function getExternalApi - * @memberof google.cloud.apihub.v1.ApiHub - * @instance - * @param {google.cloud.apihub.v1.IGetExternalApiRequest} request GetExternalApiRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.apihub.v1.ApiHub|updateExternalApi}. - * @memberof google.cloud.apihub.v1.ApiHub - * @typedef UpdateExternalApiCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.apihub.v1.ExternalApi} [response] ExternalApi - */ - - /** - * Calls UpdateExternalApi. - * @function updateExternalApi - * @memberof google.cloud.apihub.v1.ApiHub - * @instance - * @param {google.cloud.apihub.v1.IUpdateExternalApiRequest} request UpdateExternalApiRequest message or plain object - * @param {google.cloud.apihub.v1.ApiHub.UpdateExternalApiCallback} callback Node-style callback called with the error, if any, and ExternalApi - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(ApiHub.prototype.updateExternalApi = function updateExternalApi(request, callback) { - return this.rpcCall(updateExternalApi, $root.google.cloud.apihub.v1.UpdateExternalApiRequest, $root.google.cloud.apihub.v1.ExternalApi, request, callback); - }, "name", { value: "UpdateExternalApi" }); - - /** - * Calls UpdateExternalApi. - * @function updateExternalApi - * @memberof google.cloud.apihub.v1.ApiHub - * @instance - * @param {google.cloud.apihub.v1.IUpdateExternalApiRequest} request UpdateExternalApiRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.apihub.v1.ApiHub|deleteExternalApi}. - * @memberof google.cloud.apihub.v1.ApiHub - * @typedef DeleteExternalApiCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DeleteExternalApi. - * @function deleteExternalApi - * @memberof google.cloud.apihub.v1.ApiHub - * @instance - * @param {google.cloud.apihub.v1.IDeleteExternalApiRequest} request DeleteExternalApiRequest message or plain object - * @param {google.cloud.apihub.v1.ApiHub.DeleteExternalApiCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(ApiHub.prototype.deleteExternalApi = function deleteExternalApi(request, callback) { - return this.rpcCall(deleteExternalApi, $root.google.cloud.apihub.v1.DeleteExternalApiRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteExternalApi" }); - - /** - * Calls DeleteExternalApi. - * @function deleteExternalApi - * @memberof google.cloud.apihub.v1.ApiHub - * @instance - * @param {google.cloud.apihub.v1.IDeleteExternalApiRequest} request DeleteExternalApiRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.apihub.v1.ApiHub|listExternalApis}. - * @memberof google.cloud.apihub.v1.ApiHub - * @typedef ListExternalApisCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.apihub.v1.ListExternalApisResponse} [response] ListExternalApisResponse - */ - - /** - * Calls ListExternalApis. - * @function listExternalApis - * @memberof google.cloud.apihub.v1.ApiHub - * @instance - * @param {google.cloud.apihub.v1.IListExternalApisRequest} request ListExternalApisRequest message or plain object - * @param {google.cloud.apihub.v1.ApiHub.ListExternalApisCallback} callback Node-style callback called with the error, if any, and ListExternalApisResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(ApiHub.prototype.listExternalApis = function listExternalApis(request, callback) { - return this.rpcCall(listExternalApis, $root.google.cloud.apihub.v1.ListExternalApisRequest, $root.google.cloud.apihub.v1.ListExternalApisResponse, request, callback); - }, "name", { value: "ListExternalApis" }); - - /** - * Calls ListExternalApis. - * @function listExternalApis - * @memberof google.cloud.apihub.v1.ApiHub - * @instance - * @param {google.cloud.apihub.v1.IListExternalApisRequest} request ListExternalApisRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return ApiHub; - })(); - - v1.ApiHubDependencies = (function() { - - /** - * Constructs a new ApiHubDependencies service. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents an ApiHubDependencies - * @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 ApiHubDependencies(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (ApiHubDependencies.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = ApiHubDependencies; - - /** - * Creates new ApiHubDependencies service using the specified rpc implementation. - * @function create - * @memberof google.cloud.apihub.v1.ApiHubDependencies - * @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 {ApiHubDependencies} RPC service. Useful where requests and/or responses are streamed. - */ - ApiHubDependencies.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.cloud.apihub.v1.ApiHubDependencies|createDependency}. - * @memberof google.cloud.apihub.v1.ApiHubDependencies - * @typedef CreateDependencyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.apihub.v1.Dependency} [response] Dependency - */ - - /** - * Calls CreateDependency. - * @function createDependency - * @memberof google.cloud.apihub.v1.ApiHubDependencies - * @instance - * @param {google.cloud.apihub.v1.ICreateDependencyRequest} request CreateDependencyRequest message or plain object - * @param {google.cloud.apihub.v1.ApiHubDependencies.CreateDependencyCallback} callback Node-style callback called with the error, if any, and Dependency - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(ApiHubDependencies.prototype.createDependency = function createDependency(request, callback) { - return this.rpcCall(createDependency, $root.google.cloud.apihub.v1.CreateDependencyRequest, $root.google.cloud.apihub.v1.Dependency, request, callback); - }, "name", { value: "CreateDependency" }); - - /** - * Calls CreateDependency. - * @function createDependency - * @memberof google.cloud.apihub.v1.ApiHubDependencies - * @instance - * @param {google.cloud.apihub.v1.ICreateDependencyRequest} request CreateDependencyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.apihub.v1.ApiHubDependencies|getDependency}. - * @memberof google.cloud.apihub.v1.ApiHubDependencies - * @typedef GetDependencyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.apihub.v1.Dependency} [response] Dependency - */ - - /** - * Calls GetDependency. - * @function getDependency - * @memberof google.cloud.apihub.v1.ApiHubDependencies - * @instance - * @param {google.cloud.apihub.v1.IGetDependencyRequest} request GetDependencyRequest message or plain object - * @param {google.cloud.apihub.v1.ApiHubDependencies.GetDependencyCallback} callback Node-style callback called with the error, if any, and Dependency - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(ApiHubDependencies.prototype.getDependency = function getDependency(request, callback) { - return this.rpcCall(getDependency, $root.google.cloud.apihub.v1.GetDependencyRequest, $root.google.cloud.apihub.v1.Dependency, request, callback); - }, "name", { value: "GetDependency" }); - - /** - * Calls GetDependency. - * @function getDependency - * @memberof google.cloud.apihub.v1.ApiHubDependencies - * @instance - * @param {google.cloud.apihub.v1.IGetDependencyRequest} request GetDependencyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.apihub.v1.ApiHubDependencies|updateDependency}. - * @memberof google.cloud.apihub.v1.ApiHubDependencies - * @typedef UpdateDependencyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.apihub.v1.Dependency} [response] Dependency - */ - - /** - * Calls UpdateDependency. - * @function updateDependency - * @memberof google.cloud.apihub.v1.ApiHubDependencies - * @instance - * @param {google.cloud.apihub.v1.IUpdateDependencyRequest} request UpdateDependencyRequest message or plain object - * @param {google.cloud.apihub.v1.ApiHubDependencies.UpdateDependencyCallback} callback Node-style callback called with the error, if any, and Dependency - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(ApiHubDependencies.prototype.updateDependency = function updateDependency(request, callback) { - return this.rpcCall(updateDependency, $root.google.cloud.apihub.v1.UpdateDependencyRequest, $root.google.cloud.apihub.v1.Dependency, request, callback); - }, "name", { value: "UpdateDependency" }); - - /** - * Calls UpdateDependency. - * @function updateDependency - * @memberof google.cloud.apihub.v1.ApiHubDependencies - * @instance - * @param {google.cloud.apihub.v1.IUpdateDependencyRequest} request UpdateDependencyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.apihub.v1.ApiHubDependencies|deleteDependency}. - * @memberof google.cloud.apihub.v1.ApiHubDependencies - * @typedef DeleteDependencyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DeleteDependency. - * @function deleteDependency - * @memberof google.cloud.apihub.v1.ApiHubDependencies - * @instance - * @param {google.cloud.apihub.v1.IDeleteDependencyRequest} request DeleteDependencyRequest message or plain object - * @param {google.cloud.apihub.v1.ApiHubDependencies.DeleteDependencyCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(ApiHubDependencies.prototype.deleteDependency = function deleteDependency(request, callback) { - return this.rpcCall(deleteDependency, $root.google.cloud.apihub.v1.DeleteDependencyRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteDependency" }); - - /** - * Calls DeleteDependency. - * @function deleteDependency - * @memberof google.cloud.apihub.v1.ApiHubDependencies - * @instance - * @param {google.cloud.apihub.v1.IDeleteDependencyRequest} request DeleteDependencyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.apihub.v1.ApiHubDependencies|listDependencies}. - * @memberof google.cloud.apihub.v1.ApiHubDependencies - * @typedef ListDependenciesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.apihub.v1.ListDependenciesResponse} [response] ListDependenciesResponse - */ - - /** - * Calls ListDependencies. - * @function listDependencies - * @memberof google.cloud.apihub.v1.ApiHubDependencies - * @instance - * @param {google.cloud.apihub.v1.IListDependenciesRequest} request ListDependenciesRequest message or plain object - * @param {google.cloud.apihub.v1.ApiHubDependencies.ListDependenciesCallback} callback Node-style callback called with the error, if any, and ListDependenciesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(ApiHubDependencies.prototype.listDependencies = function listDependencies(request, callback) { - return this.rpcCall(listDependencies, $root.google.cloud.apihub.v1.ListDependenciesRequest, $root.google.cloud.apihub.v1.ListDependenciesResponse, request, callback); - }, "name", { value: "ListDependencies" }); - - /** - * Calls ListDependencies. - * @function listDependencies - * @memberof google.cloud.apihub.v1.ApiHubDependencies - * @instance - * @param {google.cloud.apihub.v1.IListDependenciesRequest} request ListDependenciesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return ApiHubDependencies; - })(); - - v1.CreateApiRequest = (function() { - - /** - * Properties of a CreateApiRequest. - * @memberof google.cloud.apihub.v1 - * @interface ICreateApiRequest - * @property {string|null} [parent] CreateApiRequest parent - * @property {string|null} [apiId] CreateApiRequest apiId - * @property {google.cloud.apihub.v1.IApi|null} [api] CreateApiRequest api - */ - - /** - * Constructs a new CreateApiRequest. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents a CreateApiRequest. - * @implements ICreateApiRequest - * @constructor - * @param {google.cloud.apihub.v1.ICreateApiRequest=} [properties] Properties to set - */ - function CreateApiRequest(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]]; - } - - /** - * CreateApiRequest parent. - * @member {string} parent - * @memberof google.cloud.apihub.v1.CreateApiRequest - * @instance - */ - CreateApiRequest.prototype.parent = ""; - - /** - * CreateApiRequest apiId. - * @member {string} apiId - * @memberof google.cloud.apihub.v1.CreateApiRequest - * @instance - */ - CreateApiRequest.prototype.apiId = ""; - - /** - * CreateApiRequest api. - * @member {google.cloud.apihub.v1.IApi|null|undefined} api - * @memberof google.cloud.apihub.v1.CreateApiRequest - * @instance - */ - CreateApiRequest.prototype.api = null; - - /** - * Creates a new CreateApiRequest instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.CreateApiRequest - * @static - * @param {google.cloud.apihub.v1.ICreateApiRequest=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.CreateApiRequest} CreateApiRequest instance - */ - CreateApiRequest.create = function create(properties) { - return new CreateApiRequest(properties); - }; - - /** - * Encodes the specified CreateApiRequest message. Does not implicitly {@link google.cloud.apihub.v1.CreateApiRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.CreateApiRequest - * @static - * @param {google.cloud.apihub.v1.ICreateApiRequest} message CreateApiRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateApiRequest.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.apiId != null && Object.hasOwnProperty.call(message, "apiId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.apiId); - if (message.api != null && Object.hasOwnProperty.call(message, "api")) - $root.google.cloud.apihub.v1.Api.encode(message.api, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CreateApiRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.CreateApiRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.CreateApiRequest - * @static - * @param {google.cloud.apihub.v1.ICreateApiRequest} message CreateApiRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateApiRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateApiRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.CreateApiRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.CreateApiRequest} CreateApiRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateApiRequest.decode = function 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.apihub.v1.CreateApiRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.apiId = reader.string(); - break; - } - case 3: { - message.api = $root.google.cloud.apihub.v1.Api.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateApiRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.CreateApiRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.CreateApiRequest} CreateApiRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateApiRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateApiRequest message. - * @function verify - * @memberof google.cloud.apihub.v1.CreateApiRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateApiRequest.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.apiId != null && message.hasOwnProperty("apiId")) - if (!$util.isString(message.apiId)) - return "apiId: string expected"; - if (message.api != null && message.hasOwnProperty("api")) { - var error = $root.google.cloud.apihub.v1.Api.verify(message.api); - if (error) - return "api." + error; - } - return null; - }; - - /** - * Creates a CreateApiRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.CreateApiRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.CreateApiRequest} CreateApiRequest - */ - CreateApiRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.CreateApiRequest) - return object; - var message = new $root.google.cloud.apihub.v1.CreateApiRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.apiId != null) - message.apiId = String(object.apiId); - if (object.api != null) { - if (typeof object.api !== "object") - throw TypeError(".google.cloud.apihub.v1.CreateApiRequest.api: object expected"); - message.api = $root.google.cloud.apihub.v1.Api.fromObject(object.api); - } - return message; - }; - - /** - * Creates a plain object from a CreateApiRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.CreateApiRequest - * @static - * @param {google.cloud.apihub.v1.CreateApiRequest} message CreateApiRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateApiRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.apiId = ""; - object.api = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.apiId != null && message.hasOwnProperty("apiId")) - object.apiId = message.apiId; - if (message.api != null && message.hasOwnProperty("api")) - object.api = $root.google.cloud.apihub.v1.Api.toObject(message.api, options); - return object; - }; - - /** - * Converts this CreateApiRequest to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.CreateApiRequest - * @instance - * @returns {Object.} JSON object - */ - CreateApiRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateApiRequest - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.CreateApiRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateApiRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.CreateApiRequest"; - }; - - return CreateApiRequest; - })(); - - v1.GetApiRequest = (function() { - - /** - * Properties of a GetApiRequest. - * @memberof google.cloud.apihub.v1 - * @interface IGetApiRequest - * @property {string|null} [name] GetApiRequest name - */ - - /** - * Constructs a new GetApiRequest. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents a GetApiRequest. - * @implements IGetApiRequest - * @constructor - * @param {google.cloud.apihub.v1.IGetApiRequest=} [properties] Properties to set - */ - function GetApiRequest(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]]; - } - - /** - * GetApiRequest name. - * @member {string} name - * @memberof google.cloud.apihub.v1.GetApiRequest - * @instance - */ - GetApiRequest.prototype.name = ""; - - /** - * Creates a new GetApiRequest instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.GetApiRequest - * @static - * @param {google.cloud.apihub.v1.IGetApiRequest=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.GetApiRequest} GetApiRequest instance - */ - GetApiRequest.create = function create(properties) { - return new GetApiRequest(properties); - }; - - /** - * Encodes the specified GetApiRequest message. Does not implicitly {@link google.cloud.apihub.v1.GetApiRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.GetApiRequest - * @static - * @param {google.cloud.apihub.v1.IGetApiRequest} message GetApiRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetApiRequest.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 GetApiRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.GetApiRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.GetApiRequest - * @static - * @param {google.cloud.apihub.v1.IGetApiRequest} message GetApiRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetApiRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetApiRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.GetApiRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.GetApiRequest} GetApiRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetApiRequest.decode = function 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.apihub.v1.GetApiRequest(); - 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 GetApiRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.GetApiRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.GetApiRequest} GetApiRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetApiRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetApiRequest message. - * @function verify - * @memberof google.cloud.apihub.v1.GetApiRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetApiRequest.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 GetApiRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.GetApiRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.GetApiRequest} GetApiRequest - */ - GetApiRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.GetApiRequest) - return object; - var message = new $root.google.cloud.apihub.v1.GetApiRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetApiRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.GetApiRequest - * @static - * @param {google.cloud.apihub.v1.GetApiRequest} message GetApiRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetApiRequest.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 GetApiRequest to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.GetApiRequest - * @instance - * @returns {Object.} JSON object - */ - GetApiRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetApiRequest - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.GetApiRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetApiRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.GetApiRequest"; - }; - - return GetApiRequest; - })(); - - v1.UpdateApiRequest = (function() { - - /** - * Properties of an UpdateApiRequest. - * @memberof google.cloud.apihub.v1 - * @interface IUpdateApiRequest - * @property {google.cloud.apihub.v1.IApi|null} [api] UpdateApiRequest api - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateApiRequest updateMask - */ - - /** - * Constructs a new UpdateApiRequest. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents an UpdateApiRequest. - * @implements IUpdateApiRequest - * @constructor - * @param {google.cloud.apihub.v1.IUpdateApiRequest=} [properties] Properties to set - */ - function UpdateApiRequest(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]]; - } - - /** - * UpdateApiRequest api. - * @member {google.cloud.apihub.v1.IApi|null|undefined} api - * @memberof google.cloud.apihub.v1.UpdateApiRequest - * @instance - */ - UpdateApiRequest.prototype.api = null; - - /** - * UpdateApiRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.apihub.v1.UpdateApiRequest - * @instance - */ - UpdateApiRequest.prototype.updateMask = null; - - /** - * Creates a new UpdateApiRequest instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.UpdateApiRequest - * @static - * @param {google.cloud.apihub.v1.IUpdateApiRequest=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.UpdateApiRequest} UpdateApiRequest instance - */ - UpdateApiRequest.create = function create(properties) { - return new UpdateApiRequest(properties); - }; - - /** - * Encodes the specified UpdateApiRequest message. Does not implicitly {@link google.cloud.apihub.v1.UpdateApiRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.UpdateApiRequest - * @static - * @param {google.cloud.apihub.v1.IUpdateApiRequest} message UpdateApiRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateApiRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.api != null && Object.hasOwnProperty.call(message, "api")) - $root.google.cloud.apihub.v1.Api.encode(message.api, 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 UpdateApiRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.UpdateApiRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.UpdateApiRequest - * @static - * @param {google.cloud.apihub.v1.IUpdateApiRequest} message UpdateApiRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateApiRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateApiRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.UpdateApiRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.UpdateApiRequest} UpdateApiRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateApiRequest.decode = function 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.apihub.v1.UpdateApiRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.api = $root.google.cloud.apihub.v1.Api.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 UpdateApiRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.UpdateApiRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.UpdateApiRequest} UpdateApiRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateApiRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateApiRequest message. - * @function verify - * @memberof google.cloud.apihub.v1.UpdateApiRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateApiRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.api != null && message.hasOwnProperty("api")) { - var error = $root.google.cloud.apihub.v1.Api.verify(message.api); - if (error) - return "api." + 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 UpdateApiRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.UpdateApiRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.UpdateApiRequest} UpdateApiRequest - */ - UpdateApiRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.UpdateApiRequest) - return object; - var message = new $root.google.cloud.apihub.v1.UpdateApiRequest(); - if (object.api != null) { - if (typeof object.api !== "object") - throw TypeError(".google.cloud.apihub.v1.UpdateApiRequest.api: object expected"); - message.api = $root.google.cloud.apihub.v1.Api.fromObject(object.api); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.apihub.v1.UpdateApiRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - return message; - }; - - /** - * Creates a plain object from an UpdateApiRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.UpdateApiRequest - * @static - * @param {google.cloud.apihub.v1.UpdateApiRequest} message UpdateApiRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateApiRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.api = null; - object.updateMask = null; - } - if (message.api != null && message.hasOwnProperty("api")) - object.api = $root.google.cloud.apihub.v1.Api.toObject(message.api, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - return object; - }; - - /** - * Converts this UpdateApiRequest to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.UpdateApiRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateApiRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateApiRequest - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.UpdateApiRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateApiRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.UpdateApiRequest"; - }; - - return UpdateApiRequest; - })(); - - v1.DeleteApiRequest = (function() { - - /** - * Properties of a DeleteApiRequest. - * @memberof google.cloud.apihub.v1 - * @interface IDeleteApiRequest - * @property {string|null} [name] DeleteApiRequest name - * @property {boolean|null} [force] DeleteApiRequest force - */ - - /** - * Constructs a new DeleteApiRequest. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents a DeleteApiRequest. - * @implements IDeleteApiRequest - * @constructor - * @param {google.cloud.apihub.v1.IDeleteApiRequest=} [properties] Properties to set - */ - function DeleteApiRequest(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]]; - } - - /** - * DeleteApiRequest name. - * @member {string} name - * @memberof google.cloud.apihub.v1.DeleteApiRequest - * @instance - */ - DeleteApiRequest.prototype.name = ""; - - /** - * DeleteApiRequest force. - * @member {boolean} force - * @memberof google.cloud.apihub.v1.DeleteApiRequest - * @instance - */ - DeleteApiRequest.prototype.force = false; - - /** - * Creates a new DeleteApiRequest instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.DeleteApiRequest - * @static - * @param {google.cloud.apihub.v1.IDeleteApiRequest=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.DeleteApiRequest} DeleteApiRequest instance - */ - DeleteApiRequest.create = function create(properties) { - return new DeleteApiRequest(properties); - }; - - /** - * Encodes the specified DeleteApiRequest message. Does not implicitly {@link google.cloud.apihub.v1.DeleteApiRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.DeleteApiRequest - * @static - * @param {google.cloud.apihub.v1.IDeleteApiRequest} message DeleteApiRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteApiRequest.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.force != null && Object.hasOwnProperty.call(message, "force")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.force); - return writer; - }; - - /** - * Encodes the specified DeleteApiRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.DeleteApiRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.DeleteApiRequest - * @static - * @param {google.cloud.apihub.v1.IDeleteApiRequest} message DeleteApiRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteApiRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteApiRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.DeleteApiRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.DeleteApiRequest} DeleteApiRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteApiRequest.decode = function 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.apihub.v1.DeleteApiRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.force = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteApiRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.DeleteApiRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.DeleteApiRequest} DeleteApiRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteApiRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteApiRequest message. - * @function verify - * @memberof google.cloud.apihub.v1.DeleteApiRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteApiRequest.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.force != null && message.hasOwnProperty("force")) - if (typeof message.force !== "boolean") - return "force: boolean expected"; - return null; - }; - - /** - * Creates a DeleteApiRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.DeleteApiRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.DeleteApiRequest} DeleteApiRequest - */ - DeleteApiRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.DeleteApiRequest) - return object; - var message = new $root.google.cloud.apihub.v1.DeleteApiRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.force != null) - message.force = Boolean(object.force); - return message; - }; - - /** - * Creates a plain object from a DeleteApiRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.DeleteApiRequest - * @static - * @param {google.cloud.apihub.v1.DeleteApiRequest} message DeleteApiRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteApiRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.force = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.force != null && message.hasOwnProperty("force")) - object.force = message.force; - return object; - }; - - /** - * Converts this DeleteApiRequest to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.DeleteApiRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteApiRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteApiRequest - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.DeleteApiRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteApiRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.DeleteApiRequest"; - }; - - return DeleteApiRequest; - })(); - - v1.ListApisRequest = (function() { - - /** - * Properties of a ListApisRequest. - * @memberof google.cloud.apihub.v1 - * @interface IListApisRequest - * @property {string|null} [parent] ListApisRequest parent - * @property {string|null} [filter] ListApisRequest filter - * @property {number|null} [pageSize] ListApisRequest pageSize - * @property {string|null} [pageToken] ListApisRequest pageToken - */ - - /** - * Constructs a new ListApisRequest. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents a ListApisRequest. - * @implements IListApisRequest - * @constructor - * @param {google.cloud.apihub.v1.IListApisRequest=} [properties] Properties to set - */ - function ListApisRequest(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]]; - } - - /** - * ListApisRequest parent. - * @member {string} parent - * @memberof google.cloud.apihub.v1.ListApisRequest - * @instance - */ - ListApisRequest.prototype.parent = ""; - - /** - * ListApisRequest filter. - * @member {string} filter - * @memberof google.cloud.apihub.v1.ListApisRequest - * @instance - */ - ListApisRequest.prototype.filter = ""; - - /** - * ListApisRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.apihub.v1.ListApisRequest - * @instance - */ - ListApisRequest.prototype.pageSize = 0; - - /** - * ListApisRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.apihub.v1.ListApisRequest - * @instance - */ - ListApisRequest.prototype.pageToken = ""; - - /** - * Creates a new ListApisRequest instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.ListApisRequest - * @static - * @param {google.cloud.apihub.v1.IListApisRequest=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.ListApisRequest} ListApisRequest instance - */ - ListApisRequest.create = function create(properties) { - return new ListApisRequest(properties); - }; - - /** - * Encodes the specified ListApisRequest message. Does not implicitly {@link google.cloud.apihub.v1.ListApisRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.ListApisRequest - * @static - * @param {google.cloud.apihub.v1.IListApisRequest} message ListApisRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListApisRequest.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.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); - return writer; - }; - - /** - * Encodes the specified ListApisRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListApisRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.ListApisRequest - * @static - * @param {google.cloud.apihub.v1.IListApisRequest} message ListApisRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListApisRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListApisRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.ListApisRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.ListApisRequest} ListApisRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListApisRequest.decode = function 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.apihub.v1.ListApisRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.filter = reader.string(); - break; - } - case 3: { - message.pageSize = reader.int32(); - break; - } - case 4: { - message.pageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListApisRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.ListApisRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.ListApisRequest} ListApisRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListApisRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListApisRequest message. - * @function verify - * @memberof google.cloud.apihub.v1.ListApisRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListApisRequest.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.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 ListApisRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.ListApisRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.ListApisRequest} ListApisRequest - */ - ListApisRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.ListApisRequest) - return object; - var message = new $root.google.cloud.apihub.v1.ListApisRequest(); - if (object.parent != null) - message.parent = String(object.parent); - 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 ListApisRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.ListApisRequest - * @static - * @param {google.cloud.apihub.v1.ListApisRequest} message ListApisRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListApisRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.filter = ""; - object.pageSize = 0; - object.pageToken = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - 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; - return object; - }; - - /** - * Converts this ListApisRequest to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.ListApisRequest - * @instance - * @returns {Object.} JSON object - */ - ListApisRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListApisRequest - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.ListApisRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListApisRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.ListApisRequest"; - }; - - return ListApisRequest; - })(); - - v1.ListApisResponse = (function() { - - /** - * Properties of a ListApisResponse. - * @memberof google.cloud.apihub.v1 - * @interface IListApisResponse - * @property {Array.|null} [apis] ListApisResponse apis - * @property {string|null} [nextPageToken] ListApisResponse nextPageToken - */ - - /** - * Constructs a new ListApisResponse. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents a ListApisResponse. - * @implements IListApisResponse - * @constructor - * @param {google.cloud.apihub.v1.IListApisResponse=} [properties] Properties to set - */ - function ListApisResponse(properties) { - this.apis = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListApisResponse apis. - * @member {Array.} apis - * @memberof google.cloud.apihub.v1.ListApisResponse - * @instance - */ - ListApisResponse.prototype.apis = $util.emptyArray; - - /** - * ListApisResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.apihub.v1.ListApisResponse - * @instance - */ - ListApisResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListApisResponse instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.ListApisResponse - * @static - * @param {google.cloud.apihub.v1.IListApisResponse=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.ListApisResponse} ListApisResponse instance - */ - ListApisResponse.create = function create(properties) { - return new ListApisResponse(properties); - }; - - /** - * Encodes the specified ListApisResponse message. Does not implicitly {@link google.cloud.apihub.v1.ListApisResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.ListApisResponse - * @static - * @param {google.cloud.apihub.v1.IListApisResponse} message ListApisResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListApisResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.apis != null && message.apis.length) - for (var i = 0; i < message.apis.length; ++i) - $root.google.cloud.apihub.v1.Api.encode(message.apis[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 ListApisResponse message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListApisResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.ListApisResponse - * @static - * @param {google.cloud.apihub.v1.IListApisResponse} message ListApisResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListApisResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListApisResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.ListApisResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.ListApisResponse} ListApisResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListApisResponse.decode = function 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.apihub.v1.ListApisResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.apis && message.apis.length)) - message.apis = []; - message.apis.push($root.google.cloud.apihub.v1.Api.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListApisResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.ListApisResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.ListApisResponse} ListApisResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListApisResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListApisResponse message. - * @function verify - * @memberof google.cloud.apihub.v1.ListApisResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListApisResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.apis != null && message.hasOwnProperty("apis")) { - if (!Array.isArray(message.apis)) - return "apis: array expected"; - for (var i = 0; i < message.apis.length; ++i) { - var error = $root.google.cloud.apihub.v1.Api.verify(message.apis[i]); - if (error) - return "apis." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListApisResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.ListApisResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.ListApisResponse} ListApisResponse - */ - ListApisResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.ListApisResponse) - return object; - var message = new $root.google.cloud.apihub.v1.ListApisResponse(); - if (object.apis) { - if (!Array.isArray(object.apis)) - throw TypeError(".google.cloud.apihub.v1.ListApisResponse.apis: array expected"); - message.apis = []; - for (var i = 0; i < object.apis.length; ++i) { - if (typeof object.apis[i] !== "object") - throw TypeError(".google.cloud.apihub.v1.ListApisResponse.apis: object expected"); - message.apis[i] = $root.google.cloud.apihub.v1.Api.fromObject(object.apis[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListApisResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.ListApisResponse - * @static - * @param {google.cloud.apihub.v1.ListApisResponse} message ListApisResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListApisResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.apis = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.apis && message.apis.length) { - object.apis = []; - for (var j = 0; j < message.apis.length; ++j) - object.apis[j] = $root.google.cloud.apihub.v1.Api.toObject(message.apis[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListApisResponse to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.ListApisResponse - * @instance - * @returns {Object.} JSON object - */ - ListApisResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListApisResponse - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.ListApisResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListApisResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.ListApisResponse"; - }; - - return ListApisResponse; - })(); - - v1.CreateVersionRequest = (function() { - - /** - * Properties of a CreateVersionRequest. - * @memberof google.cloud.apihub.v1 - * @interface ICreateVersionRequest - * @property {string|null} [parent] CreateVersionRequest parent - * @property {string|null} [versionId] CreateVersionRequest versionId - * @property {google.cloud.apihub.v1.IVersion|null} [version] CreateVersionRequest version - */ - - /** - * Constructs a new CreateVersionRequest. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents a CreateVersionRequest. - * @implements ICreateVersionRequest - * @constructor - * @param {google.cloud.apihub.v1.ICreateVersionRequest=} [properties] Properties to set - */ - function CreateVersionRequest(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]]; - } - - /** - * CreateVersionRequest parent. - * @member {string} parent - * @memberof google.cloud.apihub.v1.CreateVersionRequest - * @instance - */ - CreateVersionRequest.prototype.parent = ""; - - /** - * CreateVersionRequest versionId. - * @member {string} versionId - * @memberof google.cloud.apihub.v1.CreateVersionRequest - * @instance - */ - CreateVersionRequest.prototype.versionId = ""; - - /** - * CreateVersionRequest version. - * @member {google.cloud.apihub.v1.IVersion|null|undefined} version - * @memberof google.cloud.apihub.v1.CreateVersionRequest - * @instance - */ - CreateVersionRequest.prototype.version = null; - - /** - * Creates a new CreateVersionRequest instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.CreateVersionRequest - * @static - * @param {google.cloud.apihub.v1.ICreateVersionRequest=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.CreateVersionRequest} CreateVersionRequest instance - */ - CreateVersionRequest.create = function create(properties) { - return new CreateVersionRequest(properties); - }; - - /** - * Encodes the specified CreateVersionRequest message. Does not implicitly {@link google.cloud.apihub.v1.CreateVersionRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.CreateVersionRequest - * @static - * @param {google.cloud.apihub.v1.ICreateVersionRequest} message CreateVersionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateVersionRequest.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.versionId != null && Object.hasOwnProperty.call(message, "versionId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.versionId); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) - $root.google.cloud.apihub.v1.Version.encode(message.version, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CreateVersionRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.CreateVersionRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.CreateVersionRequest - * @static - * @param {google.cloud.apihub.v1.ICreateVersionRequest} message CreateVersionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateVersionRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.CreateVersionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.CreateVersionRequest} CreateVersionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateVersionRequest.decode = function 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.apihub.v1.CreateVersionRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.versionId = reader.string(); - break; - } - case 3: { - message.version = $root.google.cloud.apihub.v1.Version.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateVersionRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.CreateVersionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.CreateVersionRequest} CreateVersionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateVersionRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateVersionRequest message. - * @function verify - * @memberof google.cloud.apihub.v1.CreateVersionRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateVersionRequest.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.versionId != null && message.hasOwnProperty("versionId")) - if (!$util.isString(message.versionId)) - return "versionId: string expected"; - if (message.version != null && message.hasOwnProperty("version")) { - var error = $root.google.cloud.apihub.v1.Version.verify(message.version); - if (error) - return "version." + error; - } - return null; - }; - - /** - * Creates a CreateVersionRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.CreateVersionRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.CreateVersionRequest} CreateVersionRequest - */ - CreateVersionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.CreateVersionRequest) - return object; - var message = new $root.google.cloud.apihub.v1.CreateVersionRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.versionId != null) - message.versionId = String(object.versionId); - if (object.version != null) { - if (typeof object.version !== "object") - throw TypeError(".google.cloud.apihub.v1.CreateVersionRequest.version: object expected"); - message.version = $root.google.cloud.apihub.v1.Version.fromObject(object.version); - } - return message; - }; - - /** - * Creates a plain object from a CreateVersionRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.CreateVersionRequest - * @static - * @param {google.cloud.apihub.v1.CreateVersionRequest} message CreateVersionRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateVersionRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.versionId = ""; - object.version = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.versionId != null && message.hasOwnProperty("versionId")) - object.versionId = message.versionId; - if (message.version != null && message.hasOwnProperty("version")) - object.version = $root.google.cloud.apihub.v1.Version.toObject(message.version, options); - return object; - }; - - /** - * Converts this CreateVersionRequest to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.CreateVersionRequest - * @instance - * @returns {Object.} JSON object - */ - CreateVersionRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateVersionRequest - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.CreateVersionRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.CreateVersionRequest"; - }; - - return CreateVersionRequest; - })(); - - v1.GetVersionRequest = (function() { - - /** - * Properties of a GetVersionRequest. - * @memberof google.cloud.apihub.v1 - * @interface IGetVersionRequest - * @property {string|null} [name] GetVersionRequest name - */ - - /** - * Constructs a new GetVersionRequest. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents a GetVersionRequest. - * @implements IGetVersionRequest - * @constructor - * @param {google.cloud.apihub.v1.IGetVersionRequest=} [properties] Properties to set - */ - function GetVersionRequest(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]]; - } - - /** - * GetVersionRequest name. - * @member {string} name - * @memberof google.cloud.apihub.v1.GetVersionRequest - * @instance - */ - GetVersionRequest.prototype.name = ""; - - /** - * Creates a new GetVersionRequest instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.GetVersionRequest - * @static - * @param {google.cloud.apihub.v1.IGetVersionRequest=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.GetVersionRequest} GetVersionRequest instance - */ - GetVersionRequest.create = function create(properties) { - return new GetVersionRequest(properties); - }; - - /** - * Encodes the specified GetVersionRequest message. Does not implicitly {@link google.cloud.apihub.v1.GetVersionRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.GetVersionRequest - * @static - * @param {google.cloud.apihub.v1.IGetVersionRequest} message GetVersionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetVersionRequest.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 GetVersionRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.GetVersionRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.GetVersionRequest - * @static - * @param {google.cloud.apihub.v1.IGetVersionRequest} message GetVersionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetVersionRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.GetVersionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.GetVersionRequest} GetVersionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetVersionRequest.decode = function 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.apihub.v1.GetVersionRequest(); - 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 GetVersionRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.GetVersionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.GetVersionRequest} GetVersionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetVersionRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetVersionRequest message. - * @function verify - * @memberof google.cloud.apihub.v1.GetVersionRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetVersionRequest.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 GetVersionRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.GetVersionRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.GetVersionRequest} GetVersionRequest - */ - GetVersionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.GetVersionRequest) - return object; - var message = new $root.google.cloud.apihub.v1.GetVersionRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetVersionRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.GetVersionRequest - * @static - * @param {google.cloud.apihub.v1.GetVersionRequest} message GetVersionRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetVersionRequest.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 GetVersionRequest to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.GetVersionRequest - * @instance - * @returns {Object.} JSON object - */ - GetVersionRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetVersionRequest - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.GetVersionRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.GetVersionRequest"; - }; - - return GetVersionRequest; - })(); - - v1.UpdateVersionRequest = (function() { - - /** - * Properties of an UpdateVersionRequest. - * @memberof google.cloud.apihub.v1 - * @interface IUpdateVersionRequest - * @property {google.cloud.apihub.v1.IVersion|null} [version] UpdateVersionRequest version - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateVersionRequest updateMask - */ - - /** - * Constructs a new UpdateVersionRequest. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents an UpdateVersionRequest. - * @implements IUpdateVersionRequest - * @constructor - * @param {google.cloud.apihub.v1.IUpdateVersionRequest=} [properties] Properties to set - */ - function UpdateVersionRequest(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]]; - } - - /** - * UpdateVersionRequest version. - * @member {google.cloud.apihub.v1.IVersion|null|undefined} version - * @memberof google.cloud.apihub.v1.UpdateVersionRequest - * @instance - */ - UpdateVersionRequest.prototype.version = null; - - /** - * UpdateVersionRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.apihub.v1.UpdateVersionRequest - * @instance - */ - UpdateVersionRequest.prototype.updateMask = null; - - /** - * Creates a new UpdateVersionRequest instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.UpdateVersionRequest - * @static - * @param {google.cloud.apihub.v1.IUpdateVersionRequest=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.UpdateVersionRequest} UpdateVersionRequest instance - */ - UpdateVersionRequest.create = function create(properties) { - return new UpdateVersionRequest(properties); - }; - - /** - * Encodes the specified UpdateVersionRequest message. Does not implicitly {@link google.cloud.apihub.v1.UpdateVersionRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.UpdateVersionRequest - * @static - * @param {google.cloud.apihub.v1.IUpdateVersionRequest} message UpdateVersionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateVersionRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) - $root.google.cloud.apihub.v1.Version.encode(message.version, 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 UpdateVersionRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.UpdateVersionRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.UpdateVersionRequest - * @static - * @param {google.cloud.apihub.v1.IUpdateVersionRequest} message UpdateVersionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateVersionRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.UpdateVersionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.UpdateVersionRequest} UpdateVersionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateVersionRequest.decode = function 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.apihub.v1.UpdateVersionRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.version = $root.google.cloud.apihub.v1.Version.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 UpdateVersionRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.UpdateVersionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.UpdateVersionRequest} UpdateVersionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateVersionRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateVersionRequest message. - * @function verify - * @memberof google.cloud.apihub.v1.UpdateVersionRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateVersionRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.version != null && message.hasOwnProperty("version")) { - var error = $root.google.cloud.apihub.v1.Version.verify(message.version); - if (error) - return "version." + 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 UpdateVersionRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.UpdateVersionRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.UpdateVersionRequest} UpdateVersionRequest - */ - UpdateVersionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.UpdateVersionRequest) - return object; - var message = new $root.google.cloud.apihub.v1.UpdateVersionRequest(); - if (object.version != null) { - if (typeof object.version !== "object") - throw TypeError(".google.cloud.apihub.v1.UpdateVersionRequest.version: object expected"); - message.version = $root.google.cloud.apihub.v1.Version.fromObject(object.version); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.apihub.v1.UpdateVersionRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - return message; - }; - - /** - * Creates a plain object from an UpdateVersionRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.UpdateVersionRequest - * @static - * @param {google.cloud.apihub.v1.UpdateVersionRequest} message UpdateVersionRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateVersionRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.version = null; - object.updateMask = null; - } - if (message.version != null && message.hasOwnProperty("version")) - object.version = $root.google.cloud.apihub.v1.Version.toObject(message.version, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - return object; - }; - - /** - * Converts this UpdateVersionRequest to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.UpdateVersionRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateVersionRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateVersionRequest - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.UpdateVersionRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.UpdateVersionRequest"; - }; - - return UpdateVersionRequest; - })(); - - v1.DeleteVersionRequest = (function() { - - /** - * Properties of a DeleteVersionRequest. - * @memberof google.cloud.apihub.v1 - * @interface IDeleteVersionRequest - * @property {string|null} [name] DeleteVersionRequest name - * @property {boolean|null} [force] DeleteVersionRequest force - */ - - /** - * Constructs a new DeleteVersionRequest. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents a DeleteVersionRequest. - * @implements IDeleteVersionRequest - * @constructor - * @param {google.cloud.apihub.v1.IDeleteVersionRequest=} [properties] Properties to set - */ - function DeleteVersionRequest(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]]; - } - - /** - * DeleteVersionRequest name. - * @member {string} name - * @memberof google.cloud.apihub.v1.DeleteVersionRequest - * @instance - */ - DeleteVersionRequest.prototype.name = ""; - - /** - * DeleteVersionRequest force. - * @member {boolean} force - * @memberof google.cloud.apihub.v1.DeleteVersionRequest - * @instance - */ - DeleteVersionRequest.prototype.force = false; - - /** - * Creates a new DeleteVersionRequest instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.DeleteVersionRequest - * @static - * @param {google.cloud.apihub.v1.IDeleteVersionRequest=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.DeleteVersionRequest} DeleteVersionRequest instance - */ - DeleteVersionRequest.create = function create(properties) { - return new DeleteVersionRequest(properties); - }; - - /** - * Encodes the specified DeleteVersionRequest message. Does not implicitly {@link google.cloud.apihub.v1.DeleteVersionRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.DeleteVersionRequest - * @static - * @param {google.cloud.apihub.v1.IDeleteVersionRequest} message DeleteVersionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteVersionRequest.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.force != null && Object.hasOwnProperty.call(message, "force")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.force); - return writer; - }; - - /** - * Encodes the specified DeleteVersionRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.DeleteVersionRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.DeleteVersionRequest - * @static - * @param {google.cloud.apihub.v1.IDeleteVersionRequest} message DeleteVersionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteVersionRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.DeleteVersionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.DeleteVersionRequest} DeleteVersionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteVersionRequest.decode = function 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.apihub.v1.DeleteVersionRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.force = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteVersionRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.DeleteVersionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.DeleteVersionRequest} DeleteVersionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteVersionRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteVersionRequest message. - * @function verify - * @memberof google.cloud.apihub.v1.DeleteVersionRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteVersionRequest.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.force != null && message.hasOwnProperty("force")) - if (typeof message.force !== "boolean") - return "force: boolean expected"; - return null; - }; - - /** - * Creates a DeleteVersionRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.DeleteVersionRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.DeleteVersionRequest} DeleteVersionRequest - */ - DeleteVersionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.DeleteVersionRequest) - return object; - var message = new $root.google.cloud.apihub.v1.DeleteVersionRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.force != null) - message.force = Boolean(object.force); - return message; - }; - - /** - * Creates a plain object from a DeleteVersionRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.DeleteVersionRequest - * @static - * @param {google.cloud.apihub.v1.DeleteVersionRequest} message DeleteVersionRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteVersionRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.force = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.force != null && message.hasOwnProperty("force")) - object.force = message.force; - return object; - }; - - /** - * Converts this DeleteVersionRequest to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.DeleteVersionRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteVersionRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteVersionRequest - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.DeleteVersionRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.DeleteVersionRequest"; - }; - - return DeleteVersionRequest; - })(); - - v1.ListVersionsRequest = (function() { - - /** - * Properties of a ListVersionsRequest. - * @memberof google.cloud.apihub.v1 - * @interface IListVersionsRequest - * @property {string|null} [parent] ListVersionsRequest parent - * @property {string|null} [filter] ListVersionsRequest filter - * @property {number|null} [pageSize] ListVersionsRequest pageSize - * @property {string|null} [pageToken] ListVersionsRequest pageToken - */ - - /** - * Constructs a new ListVersionsRequest. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents a ListVersionsRequest. - * @implements IListVersionsRequest - * @constructor - * @param {google.cloud.apihub.v1.IListVersionsRequest=} [properties] Properties to set - */ - function ListVersionsRequest(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]]; - } - - /** - * ListVersionsRequest parent. - * @member {string} parent - * @memberof google.cloud.apihub.v1.ListVersionsRequest - * @instance - */ - ListVersionsRequest.prototype.parent = ""; - - /** - * ListVersionsRequest filter. - * @member {string} filter - * @memberof google.cloud.apihub.v1.ListVersionsRequest - * @instance - */ - ListVersionsRequest.prototype.filter = ""; - - /** - * ListVersionsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.apihub.v1.ListVersionsRequest - * @instance - */ - ListVersionsRequest.prototype.pageSize = 0; - - /** - * ListVersionsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.apihub.v1.ListVersionsRequest - * @instance - */ - ListVersionsRequest.prototype.pageToken = ""; - - /** - * Creates a new ListVersionsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.ListVersionsRequest - * @static - * @param {google.cloud.apihub.v1.IListVersionsRequest=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.ListVersionsRequest} ListVersionsRequest instance - */ - ListVersionsRequest.create = function create(properties) { - return new ListVersionsRequest(properties); - }; - - /** - * Encodes the specified ListVersionsRequest message. Does not implicitly {@link google.cloud.apihub.v1.ListVersionsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.ListVersionsRequest - * @static - * @param {google.cloud.apihub.v1.IListVersionsRequest} message ListVersionsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListVersionsRequest.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.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); - return writer; - }; - - /** - * Encodes the specified ListVersionsRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListVersionsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.ListVersionsRequest - * @static - * @param {google.cloud.apihub.v1.IListVersionsRequest} message ListVersionsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListVersionsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListVersionsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.ListVersionsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.ListVersionsRequest} ListVersionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListVersionsRequest.decode = function 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.apihub.v1.ListVersionsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.filter = reader.string(); - break; - } - case 3: { - message.pageSize = reader.int32(); - break; - } - case 4: { - message.pageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListVersionsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.ListVersionsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.ListVersionsRequest} ListVersionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListVersionsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListVersionsRequest message. - * @function verify - * @memberof google.cloud.apihub.v1.ListVersionsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListVersionsRequest.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.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 ListVersionsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.ListVersionsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.ListVersionsRequest} ListVersionsRequest - */ - ListVersionsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.ListVersionsRequest) - return object; - var message = new $root.google.cloud.apihub.v1.ListVersionsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - 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 ListVersionsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.ListVersionsRequest - * @static - * @param {google.cloud.apihub.v1.ListVersionsRequest} message ListVersionsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListVersionsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.filter = ""; - object.pageSize = 0; - object.pageToken = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - 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; - return object; - }; - - /** - * Converts this ListVersionsRequest to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.ListVersionsRequest - * @instance - * @returns {Object.} JSON object - */ - ListVersionsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListVersionsRequest - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.ListVersionsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListVersionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.ListVersionsRequest"; - }; - - return ListVersionsRequest; - })(); - - v1.ListVersionsResponse = (function() { - - /** - * Properties of a ListVersionsResponse. - * @memberof google.cloud.apihub.v1 - * @interface IListVersionsResponse - * @property {Array.|null} [versions] ListVersionsResponse versions - * @property {string|null} [nextPageToken] ListVersionsResponse nextPageToken - */ - - /** - * Constructs a new ListVersionsResponse. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents a ListVersionsResponse. - * @implements IListVersionsResponse - * @constructor - * @param {google.cloud.apihub.v1.IListVersionsResponse=} [properties] Properties to set - */ - function ListVersionsResponse(properties) { - this.versions = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListVersionsResponse versions. - * @member {Array.} versions - * @memberof google.cloud.apihub.v1.ListVersionsResponse - * @instance - */ - ListVersionsResponse.prototype.versions = $util.emptyArray; - - /** - * ListVersionsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.apihub.v1.ListVersionsResponse - * @instance - */ - ListVersionsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListVersionsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.ListVersionsResponse - * @static - * @param {google.cloud.apihub.v1.IListVersionsResponse=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.ListVersionsResponse} ListVersionsResponse instance - */ - ListVersionsResponse.create = function create(properties) { - return new ListVersionsResponse(properties); - }; - - /** - * Encodes the specified ListVersionsResponse message. Does not implicitly {@link google.cloud.apihub.v1.ListVersionsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.ListVersionsResponse - * @static - * @param {google.cloud.apihub.v1.IListVersionsResponse} message ListVersionsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListVersionsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.versions != null && message.versions.length) - for (var i = 0; i < message.versions.length; ++i) - $root.google.cloud.apihub.v1.Version.encode(message.versions[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 ListVersionsResponse message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListVersionsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.ListVersionsResponse - * @static - * @param {google.cloud.apihub.v1.IListVersionsResponse} message ListVersionsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListVersionsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListVersionsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.ListVersionsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.ListVersionsResponse} ListVersionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListVersionsResponse.decode = function 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.apihub.v1.ListVersionsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.versions && message.versions.length)) - message.versions = []; - message.versions.push($root.google.cloud.apihub.v1.Version.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListVersionsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.ListVersionsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.ListVersionsResponse} ListVersionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListVersionsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListVersionsResponse message. - * @function verify - * @memberof google.cloud.apihub.v1.ListVersionsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListVersionsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.versions != null && message.hasOwnProperty("versions")) { - if (!Array.isArray(message.versions)) - return "versions: array expected"; - for (var i = 0; i < message.versions.length; ++i) { - var error = $root.google.cloud.apihub.v1.Version.verify(message.versions[i]); - if (error) - return "versions." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListVersionsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.ListVersionsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.ListVersionsResponse} ListVersionsResponse - */ - ListVersionsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.ListVersionsResponse) - return object; - var message = new $root.google.cloud.apihub.v1.ListVersionsResponse(); - if (object.versions) { - if (!Array.isArray(object.versions)) - throw TypeError(".google.cloud.apihub.v1.ListVersionsResponse.versions: array expected"); - message.versions = []; - for (var i = 0; i < object.versions.length; ++i) { - if (typeof object.versions[i] !== "object") - throw TypeError(".google.cloud.apihub.v1.ListVersionsResponse.versions: object expected"); - message.versions[i] = $root.google.cloud.apihub.v1.Version.fromObject(object.versions[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListVersionsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.ListVersionsResponse - * @static - * @param {google.cloud.apihub.v1.ListVersionsResponse} message ListVersionsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListVersionsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.versions = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.versions && message.versions.length) { - object.versions = []; - for (var j = 0; j < message.versions.length; ++j) - object.versions[j] = $root.google.cloud.apihub.v1.Version.toObject(message.versions[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListVersionsResponse to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.ListVersionsResponse - * @instance - * @returns {Object.} JSON object - */ - ListVersionsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListVersionsResponse - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.ListVersionsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListVersionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.ListVersionsResponse"; - }; - - return ListVersionsResponse; - })(); - - v1.CreateSpecRequest = (function() { - - /** - * Properties of a CreateSpecRequest. - * @memberof google.cloud.apihub.v1 - * @interface ICreateSpecRequest - * @property {string|null} [parent] CreateSpecRequest parent - * @property {string|null} [specId] CreateSpecRequest specId - * @property {google.cloud.apihub.v1.ISpec|null} [spec] CreateSpecRequest spec - */ - - /** - * Constructs a new CreateSpecRequest. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents a CreateSpecRequest. - * @implements ICreateSpecRequest - * @constructor - * @param {google.cloud.apihub.v1.ICreateSpecRequest=} [properties] Properties to set - */ - function CreateSpecRequest(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]]; - } - - /** - * CreateSpecRequest parent. - * @member {string} parent - * @memberof google.cloud.apihub.v1.CreateSpecRequest - * @instance - */ - CreateSpecRequest.prototype.parent = ""; - - /** - * CreateSpecRequest specId. - * @member {string} specId - * @memberof google.cloud.apihub.v1.CreateSpecRequest - * @instance - */ - CreateSpecRequest.prototype.specId = ""; - - /** - * CreateSpecRequest spec. - * @member {google.cloud.apihub.v1.ISpec|null|undefined} spec - * @memberof google.cloud.apihub.v1.CreateSpecRequest - * @instance - */ - CreateSpecRequest.prototype.spec = null; - - /** - * Creates a new CreateSpecRequest instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.CreateSpecRequest - * @static - * @param {google.cloud.apihub.v1.ICreateSpecRequest=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.CreateSpecRequest} CreateSpecRequest instance - */ - CreateSpecRequest.create = function create(properties) { - return new CreateSpecRequest(properties); - }; - - /** - * Encodes the specified CreateSpecRequest message. Does not implicitly {@link google.cloud.apihub.v1.CreateSpecRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.CreateSpecRequest - * @static - * @param {google.cloud.apihub.v1.ICreateSpecRequest} message CreateSpecRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateSpecRequest.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.specId != null && Object.hasOwnProperty.call(message, "specId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.specId); - if (message.spec != null && Object.hasOwnProperty.call(message, "spec")) - $root.google.cloud.apihub.v1.Spec.encode(message.spec, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CreateSpecRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.CreateSpecRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.CreateSpecRequest - * @static - * @param {google.cloud.apihub.v1.ICreateSpecRequest} message CreateSpecRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateSpecRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateSpecRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.CreateSpecRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.CreateSpecRequest} CreateSpecRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateSpecRequest.decode = function 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.apihub.v1.CreateSpecRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.specId = reader.string(); - break; - } - case 3: { - message.spec = $root.google.cloud.apihub.v1.Spec.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateSpecRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.CreateSpecRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.CreateSpecRequest} CreateSpecRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateSpecRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateSpecRequest message. - * @function verify - * @memberof google.cloud.apihub.v1.CreateSpecRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateSpecRequest.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.specId != null && message.hasOwnProperty("specId")) - if (!$util.isString(message.specId)) - return "specId: string expected"; - if (message.spec != null && message.hasOwnProperty("spec")) { - var error = $root.google.cloud.apihub.v1.Spec.verify(message.spec); - if (error) - return "spec." + error; - } - return null; - }; - - /** - * Creates a CreateSpecRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.CreateSpecRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.CreateSpecRequest} CreateSpecRequest - */ - CreateSpecRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.CreateSpecRequest) - return object; - var message = new $root.google.cloud.apihub.v1.CreateSpecRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.specId != null) - message.specId = String(object.specId); - if (object.spec != null) { - if (typeof object.spec !== "object") - throw TypeError(".google.cloud.apihub.v1.CreateSpecRequest.spec: object expected"); - message.spec = $root.google.cloud.apihub.v1.Spec.fromObject(object.spec); - } - return message; - }; - - /** - * Creates a plain object from a CreateSpecRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.CreateSpecRequest - * @static - * @param {google.cloud.apihub.v1.CreateSpecRequest} message CreateSpecRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateSpecRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.specId = ""; - object.spec = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.specId != null && message.hasOwnProperty("specId")) - object.specId = message.specId; - if (message.spec != null && message.hasOwnProperty("spec")) - object.spec = $root.google.cloud.apihub.v1.Spec.toObject(message.spec, options); - return object; - }; - - /** - * Converts this CreateSpecRequest to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.CreateSpecRequest - * @instance - * @returns {Object.} JSON object - */ - CreateSpecRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateSpecRequest - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.CreateSpecRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateSpecRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.CreateSpecRequest"; - }; - - return CreateSpecRequest; - })(); - - v1.GetSpecRequest = (function() { - - /** - * Properties of a GetSpecRequest. - * @memberof google.cloud.apihub.v1 - * @interface IGetSpecRequest - * @property {string|null} [name] GetSpecRequest name - */ - - /** - * Constructs a new GetSpecRequest. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents a GetSpecRequest. - * @implements IGetSpecRequest - * @constructor - * @param {google.cloud.apihub.v1.IGetSpecRequest=} [properties] Properties to set - */ - function GetSpecRequest(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]]; - } - - /** - * GetSpecRequest name. - * @member {string} name - * @memberof google.cloud.apihub.v1.GetSpecRequest - * @instance - */ - GetSpecRequest.prototype.name = ""; - - /** - * Creates a new GetSpecRequest instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.GetSpecRequest - * @static - * @param {google.cloud.apihub.v1.IGetSpecRequest=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.GetSpecRequest} GetSpecRequest instance - */ - GetSpecRequest.create = function create(properties) { - return new GetSpecRequest(properties); - }; - - /** - * Encodes the specified GetSpecRequest message. Does not implicitly {@link google.cloud.apihub.v1.GetSpecRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.GetSpecRequest - * @static - * @param {google.cloud.apihub.v1.IGetSpecRequest} message GetSpecRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetSpecRequest.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 GetSpecRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.GetSpecRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.GetSpecRequest - * @static - * @param {google.cloud.apihub.v1.IGetSpecRequest} message GetSpecRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetSpecRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetSpecRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.GetSpecRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.GetSpecRequest} GetSpecRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetSpecRequest.decode = function 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.apihub.v1.GetSpecRequest(); - 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 GetSpecRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.GetSpecRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.GetSpecRequest} GetSpecRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetSpecRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetSpecRequest message. - * @function verify - * @memberof google.cloud.apihub.v1.GetSpecRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetSpecRequest.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 GetSpecRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.GetSpecRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.GetSpecRequest} GetSpecRequest - */ - GetSpecRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.GetSpecRequest) - return object; - var message = new $root.google.cloud.apihub.v1.GetSpecRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetSpecRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.GetSpecRequest - * @static - * @param {google.cloud.apihub.v1.GetSpecRequest} message GetSpecRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetSpecRequest.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 GetSpecRequest to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.GetSpecRequest - * @instance - * @returns {Object.} JSON object - */ - GetSpecRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetSpecRequest - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.GetSpecRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetSpecRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.GetSpecRequest"; - }; - - return GetSpecRequest; - })(); - - v1.UpdateSpecRequest = (function() { - - /** - * Properties of an UpdateSpecRequest. - * @memberof google.cloud.apihub.v1 - * @interface IUpdateSpecRequest - * @property {google.cloud.apihub.v1.ISpec|null} [spec] UpdateSpecRequest spec - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateSpecRequest updateMask - */ - - /** - * Constructs a new UpdateSpecRequest. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents an UpdateSpecRequest. - * @implements IUpdateSpecRequest - * @constructor - * @param {google.cloud.apihub.v1.IUpdateSpecRequest=} [properties] Properties to set - */ - function UpdateSpecRequest(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]]; - } - - /** - * UpdateSpecRequest spec. - * @member {google.cloud.apihub.v1.ISpec|null|undefined} spec - * @memberof google.cloud.apihub.v1.UpdateSpecRequest - * @instance - */ - UpdateSpecRequest.prototype.spec = null; - - /** - * UpdateSpecRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.apihub.v1.UpdateSpecRequest - * @instance - */ - UpdateSpecRequest.prototype.updateMask = null; - - /** - * Creates a new UpdateSpecRequest instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.UpdateSpecRequest - * @static - * @param {google.cloud.apihub.v1.IUpdateSpecRequest=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.UpdateSpecRequest} UpdateSpecRequest instance - */ - UpdateSpecRequest.create = function create(properties) { - return new UpdateSpecRequest(properties); - }; - - /** - * Encodes the specified UpdateSpecRequest message. Does not implicitly {@link google.cloud.apihub.v1.UpdateSpecRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.UpdateSpecRequest - * @static - * @param {google.cloud.apihub.v1.IUpdateSpecRequest} message UpdateSpecRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateSpecRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.spec != null && Object.hasOwnProperty.call(message, "spec")) - $root.google.cloud.apihub.v1.Spec.encode(message.spec, 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 UpdateSpecRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.UpdateSpecRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.UpdateSpecRequest - * @static - * @param {google.cloud.apihub.v1.IUpdateSpecRequest} message UpdateSpecRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateSpecRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateSpecRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.UpdateSpecRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.UpdateSpecRequest} UpdateSpecRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateSpecRequest.decode = function 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.apihub.v1.UpdateSpecRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.spec = $root.google.cloud.apihub.v1.Spec.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 UpdateSpecRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.UpdateSpecRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.UpdateSpecRequest} UpdateSpecRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateSpecRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateSpecRequest message. - * @function verify - * @memberof google.cloud.apihub.v1.UpdateSpecRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateSpecRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.spec != null && message.hasOwnProperty("spec")) { - var error = $root.google.cloud.apihub.v1.Spec.verify(message.spec); - if (error) - return "spec." + 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 UpdateSpecRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.UpdateSpecRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.UpdateSpecRequest} UpdateSpecRequest - */ - UpdateSpecRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.UpdateSpecRequest) - return object; - var message = new $root.google.cloud.apihub.v1.UpdateSpecRequest(); - if (object.spec != null) { - if (typeof object.spec !== "object") - throw TypeError(".google.cloud.apihub.v1.UpdateSpecRequest.spec: object expected"); - message.spec = $root.google.cloud.apihub.v1.Spec.fromObject(object.spec); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.apihub.v1.UpdateSpecRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - return message; - }; - - /** - * Creates a plain object from an UpdateSpecRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.UpdateSpecRequest - * @static - * @param {google.cloud.apihub.v1.UpdateSpecRequest} message UpdateSpecRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateSpecRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.spec = null; - object.updateMask = null; - } - if (message.spec != null && message.hasOwnProperty("spec")) - object.spec = $root.google.cloud.apihub.v1.Spec.toObject(message.spec, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - return object; - }; - - /** - * Converts this UpdateSpecRequest to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.UpdateSpecRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateSpecRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateSpecRequest - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.UpdateSpecRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateSpecRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.UpdateSpecRequest"; - }; - - return UpdateSpecRequest; - })(); - - v1.DeleteSpecRequest = (function() { - - /** - * Properties of a DeleteSpecRequest. - * @memberof google.cloud.apihub.v1 - * @interface IDeleteSpecRequest - * @property {string|null} [name] DeleteSpecRequest name - */ - - /** - * Constructs a new DeleteSpecRequest. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents a DeleteSpecRequest. - * @implements IDeleteSpecRequest - * @constructor - * @param {google.cloud.apihub.v1.IDeleteSpecRequest=} [properties] Properties to set - */ - function DeleteSpecRequest(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]]; - } - - /** - * DeleteSpecRequest name. - * @member {string} name - * @memberof google.cloud.apihub.v1.DeleteSpecRequest - * @instance - */ - DeleteSpecRequest.prototype.name = ""; - - /** - * Creates a new DeleteSpecRequest instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.DeleteSpecRequest - * @static - * @param {google.cloud.apihub.v1.IDeleteSpecRequest=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.DeleteSpecRequest} DeleteSpecRequest instance - */ - DeleteSpecRequest.create = function create(properties) { - return new DeleteSpecRequest(properties); - }; - - /** - * Encodes the specified DeleteSpecRequest message. Does not implicitly {@link google.cloud.apihub.v1.DeleteSpecRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.DeleteSpecRequest - * @static - * @param {google.cloud.apihub.v1.IDeleteSpecRequest} message DeleteSpecRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteSpecRequest.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 DeleteSpecRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.DeleteSpecRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.DeleteSpecRequest - * @static - * @param {google.cloud.apihub.v1.IDeleteSpecRequest} message DeleteSpecRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteSpecRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteSpecRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.DeleteSpecRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.DeleteSpecRequest} DeleteSpecRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteSpecRequest.decode = function 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.apihub.v1.DeleteSpecRequest(); - 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 DeleteSpecRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.DeleteSpecRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.DeleteSpecRequest} DeleteSpecRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteSpecRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteSpecRequest message. - * @function verify - * @memberof google.cloud.apihub.v1.DeleteSpecRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteSpecRequest.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 DeleteSpecRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.DeleteSpecRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.DeleteSpecRequest} DeleteSpecRequest - */ - DeleteSpecRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.DeleteSpecRequest) - return object; - var message = new $root.google.cloud.apihub.v1.DeleteSpecRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a DeleteSpecRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.DeleteSpecRequest - * @static - * @param {google.cloud.apihub.v1.DeleteSpecRequest} message DeleteSpecRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteSpecRequest.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 DeleteSpecRequest to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.DeleteSpecRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteSpecRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteSpecRequest - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.DeleteSpecRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteSpecRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.DeleteSpecRequest"; - }; - - return DeleteSpecRequest; - })(); - - v1.ListSpecsRequest = (function() { - - /** - * Properties of a ListSpecsRequest. - * @memberof google.cloud.apihub.v1 - * @interface IListSpecsRequest - * @property {string|null} [parent] ListSpecsRequest parent - * @property {string|null} [filter] ListSpecsRequest filter - * @property {number|null} [pageSize] ListSpecsRequest pageSize - * @property {string|null} [pageToken] ListSpecsRequest pageToken - */ - - /** - * Constructs a new ListSpecsRequest. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents a ListSpecsRequest. - * @implements IListSpecsRequest - * @constructor - * @param {google.cloud.apihub.v1.IListSpecsRequest=} [properties] Properties to set - */ - function ListSpecsRequest(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]]; - } - - /** - * ListSpecsRequest parent. - * @member {string} parent - * @memberof google.cloud.apihub.v1.ListSpecsRequest - * @instance - */ - ListSpecsRequest.prototype.parent = ""; - - /** - * ListSpecsRequest filter. - * @member {string} filter - * @memberof google.cloud.apihub.v1.ListSpecsRequest - * @instance - */ - ListSpecsRequest.prototype.filter = ""; - - /** - * ListSpecsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.apihub.v1.ListSpecsRequest - * @instance - */ - ListSpecsRequest.prototype.pageSize = 0; - - /** - * ListSpecsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.apihub.v1.ListSpecsRequest - * @instance - */ - ListSpecsRequest.prototype.pageToken = ""; - - /** - * Creates a new ListSpecsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.ListSpecsRequest - * @static - * @param {google.cloud.apihub.v1.IListSpecsRequest=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.ListSpecsRequest} ListSpecsRequest instance - */ - ListSpecsRequest.create = function create(properties) { - return new ListSpecsRequest(properties); - }; - - /** - * Encodes the specified ListSpecsRequest message. Does not implicitly {@link google.cloud.apihub.v1.ListSpecsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.ListSpecsRequest - * @static - * @param {google.cloud.apihub.v1.IListSpecsRequest} message ListSpecsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListSpecsRequest.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.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); - return writer; - }; - - /** - * Encodes the specified ListSpecsRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListSpecsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.ListSpecsRequest - * @static - * @param {google.cloud.apihub.v1.IListSpecsRequest} message ListSpecsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListSpecsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListSpecsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.ListSpecsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.ListSpecsRequest} ListSpecsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListSpecsRequest.decode = function 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.apihub.v1.ListSpecsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.filter = reader.string(); - break; - } - case 3: { - message.pageSize = reader.int32(); - break; - } - case 4: { - message.pageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListSpecsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.ListSpecsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.ListSpecsRequest} ListSpecsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListSpecsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListSpecsRequest message. - * @function verify - * @memberof google.cloud.apihub.v1.ListSpecsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListSpecsRequest.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.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 ListSpecsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.ListSpecsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.ListSpecsRequest} ListSpecsRequest - */ - ListSpecsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.ListSpecsRequest) - return object; - var message = new $root.google.cloud.apihub.v1.ListSpecsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - 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 ListSpecsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.ListSpecsRequest - * @static - * @param {google.cloud.apihub.v1.ListSpecsRequest} message ListSpecsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListSpecsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.filter = ""; - object.pageSize = 0; - object.pageToken = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - 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; - return object; - }; - - /** - * Converts this ListSpecsRequest to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.ListSpecsRequest - * @instance - * @returns {Object.} JSON object - */ - ListSpecsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListSpecsRequest - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.ListSpecsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListSpecsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.ListSpecsRequest"; - }; - - return ListSpecsRequest; - })(); - - v1.ListSpecsResponse = (function() { - - /** - * Properties of a ListSpecsResponse. - * @memberof google.cloud.apihub.v1 - * @interface IListSpecsResponse - * @property {Array.|null} [specs] ListSpecsResponse specs - * @property {string|null} [nextPageToken] ListSpecsResponse nextPageToken - */ - - /** - * Constructs a new ListSpecsResponse. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents a ListSpecsResponse. - * @implements IListSpecsResponse - * @constructor - * @param {google.cloud.apihub.v1.IListSpecsResponse=} [properties] Properties to set - */ - function ListSpecsResponse(properties) { - this.specs = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListSpecsResponse specs. - * @member {Array.} specs - * @memberof google.cloud.apihub.v1.ListSpecsResponse - * @instance - */ - ListSpecsResponse.prototype.specs = $util.emptyArray; - - /** - * ListSpecsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.apihub.v1.ListSpecsResponse - * @instance - */ - ListSpecsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListSpecsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.ListSpecsResponse - * @static - * @param {google.cloud.apihub.v1.IListSpecsResponse=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.ListSpecsResponse} ListSpecsResponse instance - */ - ListSpecsResponse.create = function create(properties) { - return new ListSpecsResponse(properties); - }; - - /** - * Encodes the specified ListSpecsResponse message. Does not implicitly {@link google.cloud.apihub.v1.ListSpecsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.ListSpecsResponse - * @static - * @param {google.cloud.apihub.v1.IListSpecsResponse} message ListSpecsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListSpecsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.specs != null && message.specs.length) - for (var i = 0; i < message.specs.length; ++i) - $root.google.cloud.apihub.v1.Spec.encode(message.specs[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 ListSpecsResponse message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListSpecsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.ListSpecsResponse - * @static - * @param {google.cloud.apihub.v1.IListSpecsResponse} message ListSpecsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListSpecsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListSpecsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.ListSpecsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.ListSpecsResponse} ListSpecsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListSpecsResponse.decode = function 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.apihub.v1.ListSpecsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.specs && message.specs.length)) - message.specs = []; - message.specs.push($root.google.cloud.apihub.v1.Spec.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListSpecsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.ListSpecsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.ListSpecsResponse} ListSpecsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListSpecsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListSpecsResponse message. - * @function verify - * @memberof google.cloud.apihub.v1.ListSpecsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListSpecsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.specs != null && message.hasOwnProperty("specs")) { - if (!Array.isArray(message.specs)) - return "specs: array expected"; - for (var i = 0; i < message.specs.length; ++i) { - var error = $root.google.cloud.apihub.v1.Spec.verify(message.specs[i]); - if (error) - return "specs." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListSpecsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.ListSpecsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.ListSpecsResponse} ListSpecsResponse - */ - ListSpecsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.ListSpecsResponse) - return object; - var message = new $root.google.cloud.apihub.v1.ListSpecsResponse(); - if (object.specs) { - if (!Array.isArray(object.specs)) - throw TypeError(".google.cloud.apihub.v1.ListSpecsResponse.specs: array expected"); - message.specs = []; - for (var i = 0; i < object.specs.length; ++i) { - if (typeof object.specs[i] !== "object") - throw TypeError(".google.cloud.apihub.v1.ListSpecsResponse.specs: object expected"); - message.specs[i] = $root.google.cloud.apihub.v1.Spec.fromObject(object.specs[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListSpecsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.ListSpecsResponse - * @static - * @param {google.cloud.apihub.v1.ListSpecsResponse} message ListSpecsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListSpecsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.specs = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.specs && message.specs.length) { - object.specs = []; - for (var j = 0; j < message.specs.length; ++j) - object.specs[j] = $root.google.cloud.apihub.v1.Spec.toObject(message.specs[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListSpecsResponse to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.ListSpecsResponse - * @instance - * @returns {Object.} JSON object - */ - ListSpecsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListSpecsResponse - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.ListSpecsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListSpecsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.ListSpecsResponse"; - }; - - return ListSpecsResponse; - })(); - - v1.GetSpecContentsRequest = (function() { - - /** - * Properties of a GetSpecContentsRequest. - * @memberof google.cloud.apihub.v1 - * @interface IGetSpecContentsRequest - * @property {string|null} [name] GetSpecContentsRequest name - */ - - /** - * Constructs a new GetSpecContentsRequest. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents a GetSpecContentsRequest. - * @implements IGetSpecContentsRequest - * @constructor - * @param {google.cloud.apihub.v1.IGetSpecContentsRequest=} [properties] Properties to set - */ - function GetSpecContentsRequest(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]]; - } - - /** - * GetSpecContentsRequest name. - * @member {string} name - * @memberof google.cloud.apihub.v1.GetSpecContentsRequest - * @instance - */ - GetSpecContentsRequest.prototype.name = ""; - - /** - * Creates a new GetSpecContentsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.GetSpecContentsRequest - * @static - * @param {google.cloud.apihub.v1.IGetSpecContentsRequest=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.GetSpecContentsRequest} GetSpecContentsRequest instance - */ - GetSpecContentsRequest.create = function create(properties) { - return new GetSpecContentsRequest(properties); - }; - - /** - * Encodes the specified GetSpecContentsRequest message. Does not implicitly {@link google.cloud.apihub.v1.GetSpecContentsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.GetSpecContentsRequest - * @static - * @param {google.cloud.apihub.v1.IGetSpecContentsRequest} message GetSpecContentsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetSpecContentsRequest.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 GetSpecContentsRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.GetSpecContentsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.GetSpecContentsRequest - * @static - * @param {google.cloud.apihub.v1.IGetSpecContentsRequest} message GetSpecContentsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetSpecContentsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetSpecContentsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.GetSpecContentsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.GetSpecContentsRequest} GetSpecContentsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetSpecContentsRequest.decode = function 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.apihub.v1.GetSpecContentsRequest(); - 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 GetSpecContentsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.GetSpecContentsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.GetSpecContentsRequest} GetSpecContentsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetSpecContentsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetSpecContentsRequest message. - * @function verify - * @memberof google.cloud.apihub.v1.GetSpecContentsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetSpecContentsRequest.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 GetSpecContentsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.GetSpecContentsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.GetSpecContentsRequest} GetSpecContentsRequest - */ - GetSpecContentsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.GetSpecContentsRequest) - return object; - var message = new $root.google.cloud.apihub.v1.GetSpecContentsRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetSpecContentsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.GetSpecContentsRequest - * @static - * @param {google.cloud.apihub.v1.GetSpecContentsRequest} message GetSpecContentsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetSpecContentsRequest.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 GetSpecContentsRequest to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.GetSpecContentsRequest - * @instance - * @returns {Object.} JSON object - */ - GetSpecContentsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetSpecContentsRequest - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.GetSpecContentsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetSpecContentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.GetSpecContentsRequest"; - }; - - return GetSpecContentsRequest; - })(); - - v1.GetApiOperationRequest = (function() { - - /** - * Properties of a GetApiOperationRequest. - * @memberof google.cloud.apihub.v1 - * @interface IGetApiOperationRequest - * @property {string|null} [name] GetApiOperationRequest name - */ - - /** - * Constructs a new GetApiOperationRequest. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents a GetApiOperationRequest. - * @implements IGetApiOperationRequest - * @constructor - * @param {google.cloud.apihub.v1.IGetApiOperationRequest=} [properties] Properties to set - */ - function GetApiOperationRequest(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]]; - } - - /** - * GetApiOperationRequest name. - * @member {string} name - * @memberof google.cloud.apihub.v1.GetApiOperationRequest - * @instance - */ - GetApiOperationRequest.prototype.name = ""; - - /** - * Creates a new GetApiOperationRequest instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.GetApiOperationRequest - * @static - * @param {google.cloud.apihub.v1.IGetApiOperationRequest=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.GetApiOperationRequest} GetApiOperationRequest instance - */ - GetApiOperationRequest.create = function create(properties) { - return new GetApiOperationRequest(properties); - }; - - /** - * Encodes the specified GetApiOperationRequest message. Does not implicitly {@link google.cloud.apihub.v1.GetApiOperationRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.GetApiOperationRequest - * @static - * @param {google.cloud.apihub.v1.IGetApiOperationRequest} message GetApiOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetApiOperationRequest.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 GetApiOperationRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.GetApiOperationRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.GetApiOperationRequest - * @static - * @param {google.cloud.apihub.v1.IGetApiOperationRequest} message GetApiOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetApiOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetApiOperationRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.GetApiOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.GetApiOperationRequest} GetApiOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetApiOperationRequest.decode = function 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.apihub.v1.GetApiOperationRequest(); - 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 GetApiOperationRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.GetApiOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.GetApiOperationRequest} GetApiOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetApiOperationRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetApiOperationRequest message. - * @function verify - * @memberof google.cloud.apihub.v1.GetApiOperationRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetApiOperationRequest.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 GetApiOperationRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.GetApiOperationRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.GetApiOperationRequest} GetApiOperationRequest - */ - GetApiOperationRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.GetApiOperationRequest) - return object; - var message = new $root.google.cloud.apihub.v1.GetApiOperationRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetApiOperationRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.GetApiOperationRequest - * @static - * @param {google.cloud.apihub.v1.GetApiOperationRequest} message GetApiOperationRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetApiOperationRequest.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 GetApiOperationRequest to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.GetApiOperationRequest - * @instance - * @returns {Object.} JSON object - */ - GetApiOperationRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetApiOperationRequest - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.GetApiOperationRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetApiOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.GetApiOperationRequest"; - }; - - return GetApiOperationRequest; - })(); - - v1.ListApiOperationsRequest = (function() { - - /** - * Properties of a ListApiOperationsRequest. - * @memberof google.cloud.apihub.v1 - * @interface IListApiOperationsRequest - * @property {string|null} [parent] ListApiOperationsRequest parent - * @property {string|null} [filter] ListApiOperationsRequest filter - * @property {number|null} [pageSize] ListApiOperationsRequest pageSize - * @property {string|null} [pageToken] ListApiOperationsRequest pageToken - */ - - /** - * Constructs a new ListApiOperationsRequest. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents a ListApiOperationsRequest. - * @implements IListApiOperationsRequest - * @constructor - * @param {google.cloud.apihub.v1.IListApiOperationsRequest=} [properties] Properties to set - */ - function ListApiOperationsRequest(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]]; - } - - /** - * ListApiOperationsRequest parent. - * @member {string} parent - * @memberof google.cloud.apihub.v1.ListApiOperationsRequest - * @instance - */ - ListApiOperationsRequest.prototype.parent = ""; - - /** - * ListApiOperationsRequest filter. - * @member {string} filter - * @memberof google.cloud.apihub.v1.ListApiOperationsRequest - * @instance - */ - ListApiOperationsRequest.prototype.filter = ""; - - /** - * ListApiOperationsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.apihub.v1.ListApiOperationsRequest - * @instance - */ - ListApiOperationsRequest.prototype.pageSize = 0; - - /** - * ListApiOperationsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.apihub.v1.ListApiOperationsRequest - * @instance - */ - ListApiOperationsRequest.prototype.pageToken = ""; - - /** - * Creates a new ListApiOperationsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.ListApiOperationsRequest - * @static - * @param {google.cloud.apihub.v1.IListApiOperationsRequest=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.ListApiOperationsRequest} ListApiOperationsRequest instance - */ - ListApiOperationsRequest.create = function create(properties) { - return new ListApiOperationsRequest(properties); - }; - - /** - * Encodes the specified ListApiOperationsRequest message. Does not implicitly {@link google.cloud.apihub.v1.ListApiOperationsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.ListApiOperationsRequest - * @static - * @param {google.cloud.apihub.v1.IListApiOperationsRequest} message ListApiOperationsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListApiOperationsRequest.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.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); - return writer; - }; - - /** - * Encodes the specified ListApiOperationsRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListApiOperationsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.ListApiOperationsRequest - * @static - * @param {google.cloud.apihub.v1.IListApiOperationsRequest} message ListApiOperationsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListApiOperationsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListApiOperationsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.ListApiOperationsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.ListApiOperationsRequest} ListApiOperationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListApiOperationsRequest.decode = function 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.apihub.v1.ListApiOperationsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.filter = reader.string(); - break; - } - case 3: { - message.pageSize = reader.int32(); - break; - } - case 4: { - message.pageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListApiOperationsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.ListApiOperationsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.ListApiOperationsRequest} ListApiOperationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListApiOperationsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListApiOperationsRequest message. - * @function verify - * @memberof google.cloud.apihub.v1.ListApiOperationsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListApiOperationsRequest.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.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 ListApiOperationsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.ListApiOperationsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.ListApiOperationsRequest} ListApiOperationsRequest - */ - ListApiOperationsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.ListApiOperationsRequest) - return object; - var message = new $root.google.cloud.apihub.v1.ListApiOperationsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - 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 ListApiOperationsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.ListApiOperationsRequest - * @static - * @param {google.cloud.apihub.v1.ListApiOperationsRequest} message ListApiOperationsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListApiOperationsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.filter = ""; - object.pageSize = 0; - object.pageToken = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - 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; - return object; - }; - - /** - * Converts this ListApiOperationsRequest to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.ListApiOperationsRequest - * @instance - * @returns {Object.} JSON object - */ - ListApiOperationsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListApiOperationsRequest - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.ListApiOperationsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListApiOperationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.ListApiOperationsRequest"; - }; - - return ListApiOperationsRequest; - })(); - - v1.ListApiOperationsResponse = (function() { - - /** - * Properties of a ListApiOperationsResponse. - * @memberof google.cloud.apihub.v1 - * @interface IListApiOperationsResponse - * @property {Array.|null} [apiOperations] ListApiOperationsResponse apiOperations - * @property {string|null} [nextPageToken] ListApiOperationsResponse nextPageToken - */ - - /** - * Constructs a new ListApiOperationsResponse. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents a ListApiOperationsResponse. - * @implements IListApiOperationsResponse - * @constructor - * @param {google.cloud.apihub.v1.IListApiOperationsResponse=} [properties] Properties to set - */ - function ListApiOperationsResponse(properties) { - this.apiOperations = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListApiOperationsResponse apiOperations. - * @member {Array.} apiOperations - * @memberof google.cloud.apihub.v1.ListApiOperationsResponse - * @instance - */ - ListApiOperationsResponse.prototype.apiOperations = $util.emptyArray; - - /** - * ListApiOperationsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.apihub.v1.ListApiOperationsResponse - * @instance - */ - ListApiOperationsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListApiOperationsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.ListApiOperationsResponse - * @static - * @param {google.cloud.apihub.v1.IListApiOperationsResponse=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.ListApiOperationsResponse} ListApiOperationsResponse instance - */ - ListApiOperationsResponse.create = function create(properties) { - return new ListApiOperationsResponse(properties); - }; - - /** - * Encodes the specified ListApiOperationsResponse message. Does not implicitly {@link google.cloud.apihub.v1.ListApiOperationsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.ListApiOperationsResponse - * @static - * @param {google.cloud.apihub.v1.IListApiOperationsResponse} message ListApiOperationsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListApiOperationsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.apiOperations != null && message.apiOperations.length) - for (var i = 0; i < message.apiOperations.length; ++i) - $root.google.cloud.apihub.v1.ApiOperation.encode(message.apiOperations[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 ListApiOperationsResponse message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListApiOperationsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.ListApiOperationsResponse - * @static - * @param {google.cloud.apihub.v1.IListApiOperationsResponse} message ListApiOperationsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListApiOperationsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListApiOperationsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.ListApiOperationsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.ListApiOperationsResponse} ListApiOperationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListApiOperationsResponse.decode = function 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.apihub.v1.ListApiOperationsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.apiOperations && message.apiOperations.length)) - message.apiOperations = []; - message.apiOperations.push($root.google.cloud.apihub.v1.ApiOperation.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListApiOperationsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.ListApiOperationsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.ListApiOperationsResponse} ListApiOperationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListApiOperationsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListApiOperationsResponse message. - * @function verify - * @memberof google.cloud.apihub.v1.ListApiOperationsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListApiOperationsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.apiOperations != null && message.hasOwnProperty("apiOperations")) { - if (!Array.isArray(message.apiOperations)) - return "apiOperations: array expected"; - for (var i = 0; i < message.apiOperations.length; ++i) { - var error = $root.google.cloud.apihub.v1.ApiOperation.verify(message.apiOperations[i]); - if (error) - return "apiOperations." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListApiOperationsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.ListApiOperationsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.ListApiOperationsResponse} ListApiOperationsResponse - */ - ListApiOperationsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.ListApiOperationsResponse) - return object; - var message = new $root.google.cloud.apihub.v1.ListApiOperationsResponse(); - if (object.apiOperations) { - if (!Array.isArray(object.apiOperations)) - throw TypeError(".google.cloud.apihub.v1.ListApiOperationsResponse.apiOperations: array expected"); - message.apiOperations = []; - for (var i = 0; i < object.apiOperations.length; ++i) { - if (typeof object.apiOperations[i] !== "object") - throw TypeError(".google.cloud.apihub.v1.ListApiOperationsResponse.apiOperations: object expected"); - message.apiOperations[i] = $root.google.cloud.apihub.v1.ApiOperation.fromObject(object.apiOperations[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListApiOperationsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.ListApiOperationsResponse - * @static - * @param {google.cloud.apihub.v1.ListApiOperationsResponse} message ListApiOperationsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListApiOperationsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.apiOperations = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.apiOperations && message.apiOperations.length) { - object.apiOperations = []; - for (var j = 0; j < message.apiOperations.length; ++j) - object.apiOperations[j] = $root.google.cloud.apihub.v1.ApiOperation.toObject(message.apiOperations[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListApiOperationsResponse to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.ListApiOperationsResponse - * @instance - * @returns {Object.} JSON object - */ - ListApiOperationsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListApiOperationsResponse - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.ListApiOperationsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListApiOperationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.ListApiOperationsResponse"; - }; - - return ListApiOperationsResponse; - })(); - - v1.GetDefinitionRequest = (function() { - - /** - * Properties of a GetDefinitionRequest. - * @memberof google.cloud.apihub.v1 - * @interface IGetDefinitionRequest - * @property {string|null} [name] GetDefinitionRequest name - */ - - /** - * Constructs a new GetDefinitionRequest. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents a GetDefinitionRequest. - * @implements IGetDefinitionRequest - * @constructor - * @param {google.cloud.apihub.v1.IGetDefinitionRequest=} [properties] Properties to set - */ - function GetDefinitionRequest(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]]; - } - - /** - * GetDefinitionRequest name. - * @member {string} name - * @memberof google.cloud.apihub.v1.GetDefinitionRequest - * @instance - */ - GetDefinitionRequest.prototype.name = ""; - - /** - * Creates a new GetDefinitionRequest instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.GetDefinitionRequest - * @static - * @param {google.cloud.apihub.v1.IGetDefinitionRequest=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.GetDefinitionRequest} GetDefinitionRequest instance - */ - GetDefinitionRequest.create = function create(properties) { - return new GetDefinitionRequest(properties); - }; - - /** - * Encodes the specified GetDefinitionRequest message. Does not implicitly {@link google.cloud.apihub.v1.GetDefinitionRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.GetDefinitionRequest - * @static - * @param {google.cloud.apihub.v1.IGetDefinitionRequest} message GetDefinitionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDefinitionRequest.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 GetDefinitionRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.GetDefinitionRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.GetDefinitionRequest - * @static - * @param {google.cloud.apihub.v1.IGetDefinitionRequest} message GetDefinitionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDefinitionRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetDefinitionRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.GetDefinitionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.GetDefinitionRequest} GetDefinitionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDefinitionRequest.decode = function 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.apihub.v1.GetDefinitionRequest(); - 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 GetDefinitionRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.GetDefinitionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.GetDefinitionRequest} GetDefinitionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDefinitionRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetDefinitionRequest message. - * @function verify - * @memberof google.cloud.apihub.v1.GetDefinitionRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetDefinitionRequest.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 GetDefinitionRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.GetDefinitionRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.GetDefinitionRequest} GetDefinitionRequest - */ - GetDefinitionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.GetDefinitionRequest) - return object; - var message = new $root.google.cloud.apihub.v1.GetDefinitionRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetDefinitionRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.GetDefinitionRequest - * @static - * @param {google.cloud.apihub.v1.GetDefinitionRequest} message GetDefinitionRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetDefinitionRequest.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 GetDefinitionRequest to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.GetDefinitionRequest - * @instance - * @returns {Object.} JSON object - */ - GetDefinitionRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetDefinitionRequest - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.GetDefinitionRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetDefinitionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.GetDefinitionRequest"; - }; - - return GetDefinitionRequest; - })(); - - v1.CreateDeploymentRequest = (function() { - - /** - * Properties of a CreateDeploymentRequest. - * @memberof google.cloud.apihub.v1 - * @interface ICreateDeploymentRequest - * @property {string|null} [parent] CreateDeploymentRequest parent - * @property {string|null} [deploymentId] CreateDeploymentRequest deploymentId - * @property {google.cloud.apihub.v1.IDeployment|null} [deployment] CreateDeploymentRequest deployment - */ - - /** - * Constructs a new CreateDeploymentRequest. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents a CreateDeploymentRequest. - * @implements ICreateDeploymentRequest - * @constructor - * @param {google.cloud.apihub.v1.ICreateDeploymentRequest=} [properties] Properties to set - */ - function CreateDeploymentRequest(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]]; - } - - /** - * CreateDeploymentRequest parent. - * @member {string} parent - * @memberof google.cloud.apihub.v1.CreateDeploymentRequest - * @instance - */ - CreateDeploymentRequest.prototype.parent = ""; - - /** - * CreateDeploymentRequest deploymentId. - * @member {string} deploymentId - * @memberof google.cloud.apihub.v1.CreateDeploymentRequest - * @instance - */ - CreateDeploymentRequest.prototype.deploymentId = ""; - - /** - * CreateDeploymentRequest deployment. - * @member {google.cloud.apihub.v1.IDeployment|null|undefined} deployment - * @memberof google.cloud.apihub.v1.CreateDeploymentRequest - * @instance - */ - CreateDeploymentRequest.prototype.deployment = null; - - /** - * Creates a new CreateDeploymentRequest instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.CreateDeploymentRequest - * @static - * @param {google.cloud.apihub.v1.ICreateDeploymentRequest=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.CreateDeploymentRequest} CreateDeploymentRequest instance - */ - CreateDeploymentRequest.create = function create(properties) { - return new CreateDeploymentRequest(properties); - }; - - /** - * Encodes the specified CreateDeploymentRequest message. Does not implicitly {@link google.cloud.apihub.v1.CreateDeploymentRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.CreateDeploymentRequest - * @static - * @param {google.cloud.apihub.v1.ICreateDeploymentRequest} message CreateDeploymentRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateDeploymentRequest.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.deploymentId != null && Object.hasOwnProperty.call(message, "deploymentId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.deploymentId); - if (message.deployment != null && Object.hasOwnProperty.call(message, "deployment")) - $root.google.cloud.apihub.v1.Deployment.encode(message.deployment, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CreateDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.CreateDeploymentRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.CreateDeploymentRequest - * @static - * @param {google.cloud.apihub.v1.ICreateDeploymentRequest} message CreateDeploymentRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateDeploymentRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateDeploymentRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.CreateDeploymentRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.CreateDeploymentRequest} CreateDeploymentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateDeploymentRequest.decode = function 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.apihub.v1.CreateDeploymentRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.deploymentId = reader.string(); - break; - } - case 3: { - message.deployment = $root.google.cloud.apihub.v1.Deployment.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateDeploymentRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.CreateDeploymentRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.CreateDeploymentRequest} CreateDeploymentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateDeploymentRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateDeploymentRequest message. - * @function verify - * @memberof google.cloud.apihub.v1.CreateDeploymentRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateDeploymentRequest.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.deploymentId != null && message.hasOwnProperty("deploymentId")) - if (!$util.isString(message.deploymentId)) - return "deploymentId: string expected"; - if (message.deployment != null && message.hasOwnProperty("deployment")) { - var error = $root.google.cloud.apihub.v1.Deployment.verify(message.deployment); - if (error) - return "deployment." + error; - } - return null; - }; - - /** - * Creates a CreateDeploymentRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.CreateDeploymentRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.CreateDeploymentRequest} CreateDeploymentRequest - */ - CreateDeploymentRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.CreateDeploymentRequest) - return object; - var message = new $root.google.cloud.apihub.v1.CreateDeploymentRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.deploymentId != null) - message.deploymentId = String(object.deploymentId); - if (object.deployment != null) { - if (typeof object.deployment !== "object") - throw TypeError(".google.cloud.apihub.v1.CreateDeploymentRequest.deployment: object expected"); - message.deployment = $root.google.cloud.apihub.v1.Deployment.fromObject(object.deployment); - } - return message; - }; - - /** - * Creates a plain object from a CreateDeploymentRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.CreateDeploymentRequest - * @static - * @param {google.cloud.apihub.v1.CreateDeploymentRequest} message CreateDeploymentRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateDeploymentRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.deploymentId = ""; - object.deployment = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.deploymentId != null && message.hasOwnProperty("deploymentId")) - object.deploymentId = message.deploymentId; - if (message.deployment != null && message.hasOwnProperty("deployment")) - object.deployment = $root.google.cloud.apihub.v1.Deployment.toObject(message.deployment, options); - return object; - }; - - /** - * Converts this CreateDeploymentRequest to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.CreateDeploymentRequest - * @instance - * @returns {Object.} JSON object - */ - CreateDeploymentRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateDeploymentRequest - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.CreateDeploymentRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateDeploymentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.CreateDeploymentRequest"; - }; - - return CreateDeploymentRequest; - })(); - - v1.GetDeploymentRequest = (function() { - - /** - * Properties of a GetDeploymentRequest. - * @memberof google.cloud.apihub.v1 - * @interface IGetDeploymentRequest - * @property {string|null} [name] GetDeploymentRequest name - */ - - /** - * Constructs a new GetDeploymentRequest. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents a GetDeploymentRequest. - * @implements IGetDeploymentRequest - * @constructor - * @param {google.cloud.apihub.v1.IGetDeploymentRequest=} [properties] Properties to set - */ - function GetDeploymentRequest(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]]; - } - - /** - * GetDeploymentRequest name. - * @member {string} name - * @memberof google.cloud.apihub.v1.GetDeploymentRequest - * @instance - */ - GetDeploymentRequest.prototype.name = ""; - - /** - * Creates a new GetDeploymentRequest instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.GetDeploymentRequest - * @static - * @param {google.cloud.apihub.v1.IGetDeploymentRequest=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.GetDeploymentRequest} GetDeploymentRequest instance - */ - GetDeploymentRequest.create = function create(properties) { - return new GetDeploymentRequest(properties); - }; - - /** - * Encodes the specified GetDeploymentRequest message. Does not implicitly {@link google.cloud.apihub.v1.GetDeploymentRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.GetDeploymentRequest - * @static - * @param {google.cloud.apihub.v1.IGetDeploymentRequest} message GetDeploymentRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDeploymentRequest.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 GetDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.GetDeploymentRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.GetDeploymentRequest - * @static - * @param {google.cloud.apihub.v1.IGetDeploymentRequest} message GetDeploymentRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDeploymentRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetDeploymentRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.GetDeploymentRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.GetDeploymentRequest} GetDeploymentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDeploymentRequest.decode = function 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.apihub.v1.GetDeploymentRequest(); - 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 GetDeploymentRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.GetDeploymentRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.GetDeploymentRequest} GetDeploymentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDeploymentRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetDeploymentRequest message. - * @function verify - * @memberof google.cloud.apihub.v1.GetDeploymentRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetDeploymentRequest.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 GetDeploymentRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.GetDeploymentRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.GetDeploymentRequest} GetDeploymentRequest - */ - GetDeploymentRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.GetDeploymentRequest) - return object; - var message = new $root.google.cloud.apihub.v1.GetDeploymentRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetDeploymentRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.GetDeploymentRequest - * @static - * @param {google.cloud.apihub.v1.GetDeploymentRequest} message GetDeploymentRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetDeploymentRequest.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 GetDeploymentRequest to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.GetDeploymentRequest - * @instance - * @returns {Object.} JSON object - */ - GetDeploymentRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetDeploymentRequest - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.GetDeploymentRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetDeploymentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.GetDeploymentRequest"; - }; - - return GetDeploymentRequest; - })(); - - v1.UpdateDeploymentRequest = (function() { - - /** - * Properties of an UpdateDeploymentRequest. - * @memberof google.cloud.apihub.v1 - * @interface IUpdateDeploymentRequest - * @property {google.cloud.apihub.v1.IDeployment|null} [deployment] UpdateDeploymentRequest deployment - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateDeploymentRequest updateMask - */ - - /** - * Constructs a new UpdateDeploymentRequest. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents an UpdateDeploymentRequest. - * @implements IUpdateDeploymentRequest - * @constructor - * @param {google.cloud.apihub.v1.IUpdateDeploymentRequest=} [properties] Properties to set - */ - function UpdateDeploymentRequest(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]]; - } - - /** - * UpdateDeploymentRequest deployment. - * @member {google.cloud.apihub.v1.IDeployment|null|undefined} deployment - * @memberof google.cloud.apihub.v1.UpdateDeploymentRequest - * @instance - */ - UpdateDeploymentRequest.prototype.deployment = null; - - /** - * UpdateDeploymentRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.apihub.v1.UpdateDeploymentRequest - * @instance - */ - UpdateDeploymentRequest.prototype.updateMask = null; - - /** - * Creates a new UpdateDeploymentRequest instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.UpdateDeploymentRequest - * @static - * @param {google.cloud.apihub.v1.IUpdateDeploymentRequest=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.UpdateDeploymentRequest} UpdateDeploymentRequest instance - */ - UpdateDeploymentRequest.create = function create(properties) { - return new UpdateDeploymentRequest(properties); - }; - - /** - * Encodes the specified UpdateDeploymentRequest message. Does not implicitly {@link google.cloud.apihub.v1.UpdateDeploymentRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.UpdateDeploymentRequest - * @static - * @param {google.cloud.apihub.v1.IUpdateDeploymentRequest} message UpdateDeploymentRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateDeploymentRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.deployment != null && Object.hasOwnProperty.call(message, "deployment")) - $root.google.cloud.apihub.v1.Deployment.encode(message.deployment, 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 UpdateDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.UpdateDeploymentRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.UpdateDeploymentRequest - * @static - * @param {google.cloud.apihub.v1.IUpdateDeploymentRequest} message UpdateDeploymentRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateDeploymentRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateDeploymentRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.UpdateDeploymentRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.UpdateDeploymentRequest} UpdateDeploymentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateDeploymentRequest.decode = function 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.apihub.v1.UpdateDeploymentRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.deployment = $root.google.cloud.apihub.v1.Deployment.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 UpdateDeploymentRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.UpdateDeploymentRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.UpdateDeploymentRequest} UpdateDeploymentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateDeploymentRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateDeploymentRequest message. - * @function verify - * @memberof google.cloud.apihub.v1.UpdateDeploymentRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateDeploymentRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.deployment != null && message.hasOwnProperty("deployment")) { - var error = $root.google.cloud.apihub.v1.Deployment.verify(message.deployment); - if (error) - return "deployment." + 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 UpdateDeploymentRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.UpdateDeploymentRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.UpdateDeploymentRequest} UpdateDeploymentRequest - */ - UpdateDeploymentRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.UpdateDeploymentRequest) - return object; - var message = new $root.google.cloud.apihub.v1.UpdateDeploymentRequest(); - if (object.deployment != null) { - if (typeof object.deployment !== "object") - throw TypeError(".google.cloud.apihub.v1.UpdateDeploymentRequest.deployment: object expected"); - message.deployment = $root.google.cloud.apihub.v1.Deployment.fromObject(object.deployment); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.apihub.v1.UpdateDeploymentRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - return message; - }; - - /** - * Creates a plain object from an UpdateDeploymentRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.UpdateDeploymentRequest - * @static - * @param {google.cloud.apihub.v1.UpdateDeploymentRequest} message UpdateDeploymentRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateDeploymentRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.deployment = null; - object.updateMask = null; - } - if (message.deployment != null && message.hasOwnProperty("deployment")) - object.deployment = $root.google.cloud.apihub.v1.Deployment.toObject(message.deployment, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - return object; - }; - - /** - * Converts this UpdateDeploymentRequest to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.UpdateDeploymentRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateDeploymentRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateDeploymentRequest - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.UpdateDeploymentRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateDeploymentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.UpdateDeploymentRequest"; - }; - - return UpdateDeploymentRequest; - })(); - - v1.DeleteDeploymentRequest = (function() { - - /** - * Properties of a DeleteDeploymentRequest. - * @memberof google.cloud.apihub.v1 - * @interface IDeleteDeploymentRequest - * @property {string|null} [name] DeleteDeploymentRequest name - */ - - /** - * Constructs a new DeleteDeploymentRequest. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents a DeleteDeploymentRequest. - * @implements IDeleteDeploymentRequest - * @constructor - * @param {google.cloud.apihub.v1.IDeleteDeploymentRequest=} [properties] Properties to set - */ - function DeleteDeploymentRequest(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]]; - } - - /** - * DeleteDeploymentRequest name. - * @member {string} name - * @memberof google.cloud.apihub.v1.DeleteDeploymentRequest - * @instance - */ - DeleteDeploymentRequest.prototype.name = ""; - - /** - * Creates a new DeleteDeploymentRequest instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.DeleteDeploymentRequest - * @static - * @param {google.cloud.apihub.v1.IDeleteDeploymentRequest=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.DeleteDeploymentRequest} DeleteDeploymentRequest instance - */ - DeleteDeploymentRequest.create = function create(properties) { - return new DeleteDeploymentRequest(properties); - }; - - /** - * Encodes the specified DeleteDeploymentRequest message. Does not implicitly {@link google.cloud.apihub.v1.DeleteDeploymentRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.DeleteDeploymentRequest - * @static - * @param {google.cloud.apihub.v1.IDeleteDeploymentRequest} message DeleteDeploymentRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteDeploymentRequest.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 DeleteDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.DeleteDeploymentRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.DeleteDeploymentRequest - * @static - * @param {google.cloud.apihub.v1.IDeleteDeploymentRequest} message DeleteDeploymentRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteDeploymentRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteDeploymentRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.DeleteDeploymentRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.DeleteDeploymentRequest} DeleteDeploymentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteDeploymentRequest.decode = function 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.apihub.v1.DeleteDeploymentRequest(); - 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 DeleteDeploymentRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.DeleteDeploymentRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.DeleteDeploymentRequest} DeleteDeploymentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteDeploymentRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteDeploymentRequest message. - * @function verify - * @memberof google.cloud.apihub.v1.DeleteDeploymentRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteDeploymentRequest.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 DeleteDeploymentRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.DeleteDeploymentRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.DeleteDeploymentRequest} DeleteDeploymentRequest - */ - DeleteDeploymentRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.DeleteDeploymentRequest) - return object; - var message = new $root.google.cloud.apihub.v1.DeleteDeploymentRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a DeleteDeploymentRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.DeleteDeploymentRequest - * @static - * @param {google.cloud.apihub.v1.DeleteDeploymentRequest} message DeleteDeploymentRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteDeploymentRequest.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 DeleteDeploymentRequest to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.DeleteDeploymentRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteDeploymentRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteDeploymentRequest - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.DeleteDeploymentRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteDeploymentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.DeleteDeploymentRequest"; - }; - - return DeleteDeploymentRequest; - })(); - - v1.ListDeploymentsRequest = (function() { - - /** - * Properties of a ListDeploymentsRequest. - * @memberof google.cloud.apihub.v1 - * @interface IListDeploymentsRequest - * @property {string|null} [parent] ListDeploymentsRequest parent - * @property {string|null} [filter] ListDeploymentsRequest filter - * @property {number|null} [pageSize] ListDeploymentsRequest pageSize - * @property {string|null} [pageToken] ListDeploymentsRequest pageToken - */ - - /** - * Constructs a new ListDeploymentsRequest. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents a ListDeploymentsRequest. - * @implements IListDeploymentsRequest - * @constructor - * @param {google.cloud.apihub.v1.IListDeploymentsRequest=} [properties] Properties to set - */ - function ListDeploymentsRequest(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]]; - } - - /** - * ListDeploymentsRequest parent. - * @member {string} parent - * @memberof google.cloud.apihub.v1.ListDeploymentsRequest - * @instance - */ - ListDeploymentsRequest.prototype.parent = ""; - - /** - * ListDeploymentsRequest filter. - * @member {string} filter - * @memberof google.cloud.apihub.v1.ListDeploymentsRequest - * @instance - */ - ListDeploymentsRequest.prototype.filter = ""; - - /** - * ListDeploymentsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.apihub.v1.ListDeploymentsRequest - * @instance - */ - ListDeploymentsRequest.prototype.pageSize = 0; - - /** - * ListDeploymentsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.apihub.v1.ListDeploymentsRequest - * @instance - */ - ListDeploymentsRequest.prototype.pageToken = ""; - - /** - * Creates a new ListDeploymentsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.ListDeploymentsRequest - * @static - * @param {google.cloud.apihub.v1.IListDeploymentsRequest=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.ListDeploymentsRequest} ListDeploymentsRequest instance - */ - ListDeploymentsRequest.create = function create(properties) { - return new ListDeploymentsRequest(properties); - }; - - /** - * Encodes the specified ListDeploymentsRequest message. Does not implicitly {@link google.cloud.apihub.v1.ListDeploymentsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.ListDeploymentsRequest - * @static - * @param {google.cloud.apihub.v1.IListDeploymentsRequest} message ListDeploymentsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListDeploymentsRequest.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.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); - return writer; - }; - - /** - * Encodes the specified ListDeploymentsRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListDeploymentsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.ListDeploymentsRequest - * @static - * @param {google.cloud.apihub.v1.IListDeploymentsRequest} message ListDeploymentsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListDeploymentsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListDeploymentsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.ListDeploymentsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.ListDeploymentsRequest} ListDeploymentsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListDeploymentsRequest.decode = function 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.apihub.v1.ListDeploymentsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.filter = reader.string(); - break; - } - case 3: { - message.pageSize = reader.int32(); - break; - } - case 4: { - message.pageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListDeploymentsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.ListDeploymentsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.ListDeploymentsRequest} ListDeploymentsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListDeploymentsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListDeploymentsRequest message. - * @function verify - * @memberof google.cloud.apihub.v1.ListDeploymentsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListDeploymentsRequest.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.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 ListDeploymentsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.ListDeploymentsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.ListDeploymentsRequest} ListDeploymentsRequest - */ - ListDeploymentsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.ListDeploymentsRequest) - return object; - var message = new $root.google.cloud.apihub.v1.ListDeploymentsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - 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 ListDeploymentsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.ListDeploymentsRequest - * @static - * @param {google.cloud.apihub.v1.ListDeploymentsRequest} message ListDeploymentsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListDeploymentsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.filter = ""; - object.pageSize = 0; - object.pageToken = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - 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; - return object; - }; - - /** - * Converts this ListDeploymentsRequest to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.ListDeploymentsRequest - * @instance - * @returns {Object.} JSON object - */ - ListDeploymentsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListDeploymentsRequest - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.ListDeploymentsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListDeploymentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.ListDeploymentsRequest"; - }; - - return ListDeploymentsRequest; - })(); - - v1.ListDeploymentsResponse = (function() { - - /** - * Properties of a ListDeploymentsResponse. - * @memberof google.cloud.apihub.v1 - * @interface IListDeploymentsResponse - * @property {Array.|null} [deployments] ListDeploymentsResponse deployments - * @property {string|null} [nextPageToken] ListDeploymentsResponse nextPageToken - */ - - /** - * Constructs a new ListDeploymentsResponse. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents a ListDeploymentsResponse. - * @implements IListDeploymentsResponse - * @constructor - * @param {google.cloud.apihub.v1.IListDeploymentsResponse=} [properties] Properties to set - */ - function ListDeploymentsResponse(properties) { - this.deployments = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListDeploymentsResponse deployments. - * @member {Array.} deployments - * @memberof google.cloud.apihub.v1.ListDeploymentsResponse - * @instance - */ - ListDeploymentsResponse.prototype.deployments = $util.emptyArray; - - /** - * ListDeploymentsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.apihub.v1.ListDeploymentsResponse - * @instance - */ - ListDeploymentsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListDeploymentsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.ListDeploymentsResponse - * @static - * @param {google.cloud.apihub.v1.IListDeploymentsResponse=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.ListDeploymentsResponse} ListDeploymentsResponse instance - */ - ListDeploymentsResponse.create = function create(properties) { - return new ListDeploymentsResponse(properties); - }; - - /** - * Encodes the specified ListDeploymentsResponse message. Does not implicitly {@link google.cloud.apihub.v1.ListDeploymentsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.ListDeploymentsResponse - * @static - * @param {google.cloud.apihub.v1.IListDeploymentsResponse} message ListDeploymentsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListDeploymentsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.deployments != null && message.deployments.length) - for (var i = 0; i < message.deployments.length; ++i) - $root.google.cloud.apihub.v1.Deployment.encode(message.deployments[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 ListDeploymentsResponse message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListDeploymentsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.ListDeploymentsResponse - * @static - * @param {google.cloud.apihub.v1.IListDeploymentsResponse} message ListDeploymentsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListDeploymentsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListDeploymentsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.ListDeploymentsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.ListDeploymentsResponse} ListDeploymentsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListDeploymentsResponse.decode = function 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.apihub.v1.ListDeploymentsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.deployments && message.deployments.length)) - message.deployments = []; - message.deployments.push($root.google.cloud.apihub.v1.Deployment.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListDeploymentsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.ListDeploymentsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.ListDeploymentsResponse} ListDeploymentsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListDeploymentsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListDeploymentsResponse message. - * @function verify - * @memberof google.cloud.apihub.v1.ListDeploymentsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListDeploymentsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.deployments != null && message.hasOwnProperty("deployments")) { - if (!Array.isArray(message.deployments)) - return "deployments: array expected"; - for (var i = 0; i < message.deployments.length; ++i) { - var error = $root.google.cloud.apihub.v1.Deployment.verify(message.deployments[i]); - if (error) - return "deployments." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListDeploymentsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.ListDeploymentsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.ListDeploymentsResponse} ListDeploymentsResponse - */ - ListDeploymentsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.ListDeploymentsResponse) - return object; - var message = new $root.google.cloud.apihub.v1.ListDeploymentsResponse(); - if (object.deployments) { - if (!Array.isArray(object.deployments)) - throw TypeError(".google.cloud.apihub.v1.ListDeploymentsResponse.deployments: array expected"); - message.deployments = []; - for (var i = 0; i < object.deployments.length; ++i) { - if (typeof object.deployments[i] !== "object") - throw TypeError(".google.cloud.apihub.v1.ListDeploymentsResponse.deployments: object expected"); - message.deployments[i] = $root.google.cloud.apihub.v1.Deployment.fromObject(object.deployments[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListDeploymentsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.ListDeploymentsResponse - * @static - * @param {google.cloud.apihub.v1.ListDeploymentsResponse} message ListDeploymentsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListDeploymentsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.deployments = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.deployments && message.deployments.length) { - object.deployments = []; - for (var j = 0; j < message.deployments.length; ++j) - object.deployments[j] = $root.google.cloud.apihub.v1.Deployment.toObject(message.deployments[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListDeploymentsResponse to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.ListDeploymentsResponse - * @instance - * @returns {Object.} JSON object - */ - ListDeploymentsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListDeploymentsResponse - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.ListDeploymentsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListDeploymentsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.ListDeploymentsResponse"; - }; - - return ListDeploymentsResponse; - })(); - - v1.CreateAttributeRequest = (function() { - - /** - * Properties of a CreateAttributeRequest. - * @memberof google.cloud.apihub.v1 - * @interface ICreateAttributeRequest - * @property {string|null} [parent] CreateAttributeRequest parent - * @property {string|null} [attributeId] CreateAttributeRequest attributeId - * @property {google.cloud.apihub.v1.IAttribute|null} [attribute] CreateAttributeRequest attribute - */ - - /** - * Constructs a new CreateAttributeRequest. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents a CreateAttributeRequest. - * @implements ICreateAttributeRequest - * @constructor - * @param {google.cloud.apihub.v1.ICreateAttributeRequest=} [properties] Properties to set - */ - function CreateAttributeRequest(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]]; - } - - /** - * CreateAttributeRequest parent. - * @member {string} parent - * @memberof google.cloud.apihub.v1.CreateAttributeRequest - * @instance - */ - CreateAttributeRequest.prototype.parent = ""; - - /** - * CreateAttributeRequest attributeId. - * @member {string} attributeId - * @memberof google.cloud.apihub.v1.CreateAttributeRequest - * @instance - */ - CreateAttributeRequest.prototype.attributeId = ""; - - /** - * CreateAttributeRequest attribute. - * @member {google.cloud.apihub.v1.IAttribute|null|undefined} attribute - * @memberof google.cloud.apihub.v1.CreateAttributeRequest - * @instance - */ - CreateAttributeRequest.prototype.attribute = null; - - /** - * Creates a new CreateAttributeRequest instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.CreateAttributeRequest - * @static - * @param {google.cloud.apihub.v1.ICreateAttributeRequest=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.CreateAttributeRequest} CreateAttributeRequest instance - */ - CreateAttributeRequest.create = function create(properties) { - return new CreateAttributeRequest(properties); - }; - - /** - * Encodes the specified CreateAttributeRequest message. Does not implicitly {@link google.cloud.apihub.v1.CreateAttributeRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.CreateAttributeRequest - * @static - * @param {google.cloud.apihub.v1.ICreateAttributeRequest} message CreateAttributeRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateAttributeRequest.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.attributeId != null && Object.hasOwnProperty.call(message, "attributeId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.attributeId); - if (message.attribute != null && Object.hasOwnProperty.call(message, "attribute")) - $root.google.cloud.apihub.v1.Attribute.encode(message.attribute, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CreateAttributeRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.CreateAttributeRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.CreateAttributeRequest - * @static - * @param {google.cloud.apihub.v1.ICreateAttributeRequest} message CreateAttributeRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateAttributeRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateAttributeRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.CreateAttributeRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.CreateAttributeRequest} CreateAttributeRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateAttributeRequest.decode = function 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.apihub.v1.CreateAttributeRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.attributeId = reader.string(); - break; - } - case 3: { - message.attribute = $root.google.cloud.apihub.v1.Attribute.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateAttributeRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.CreateAttributeRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.CreateAttributeRequest} CreateAttributeRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateAttributeRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateAttributeRequest message. - * @function verify - * @memberof google.cloud.apihub.v1.CreateAttributeRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateAttributeRequest.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.attributeId != null && message.hasOwnProperty("attributeId")) - if (!$util.isString(message.attributeId)) - return "attributeId: string expected"; - if (message.attribute != null && message.hasOwnProperty("attribute")) { - var error = $root.google.cloud.apihub.v1.Attribute.verify(message.attribute); - if (error) - return "attribute." + error; - } - return null; - }; - - /** - * Creates a CreateAttributeRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.CreateAttributeRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.CreateAttributeRequest} CreateAttributeRequest - */ - CreateAttributeRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.CreateAttributeRequest) - return object; - var message = new $root.google.cloud.apihub.v1.CreateAttributeRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.attributeId != null) - message.attributeId = String(object.attributeId); - if (object.attribute != null) { - if (typeof object.attribute !== "object") - throw TypeError(".google.cloud.apihub.v1.CreateAttributeRequest.attribute: object expected"); - message.attribute = $root.google.cloud.apihub.v1.Attribute.fromObject(object.attribute); - } - return message; - }; - - /** - * Creates a plain object from a CreateAttributeRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.CreateAttributeRequest - * @static - * @param {google.cloud.apihub.v1.CreateAttributeRequest} message CreateAttributeRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateAttributeRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.attributeId = ""; - object.attribute = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.attributeId != null && message.hasOwnProperty("attributeId")) - object.attributeId = message.attributeId; - if (message.attribute != null && message.hasOwnProperty("attribute")) - object.attribute = $root.google.cloud.apihub.v1.Attribute.toObject(message.attribute, options); - return object; - }; - - /** - * Converts this CreateAttributeRequest to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.CreateAttributeRequest - * @instance - * @returns {Object.} JSON object - */ - CreateAttributeRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateAttributeRequest - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.CreateAttributeRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateAttributeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.CreateAttributeRequest"; - }; - - return CreateAttributeRequest; - })(); - - v1.GetAttributeRequest = (function() { - - /** - * Properties of a GetAttributeRequest. - * @memberof google.cloud.apihub.v1 - * @interface IGetAttributeRequest - * @property {string|null} [name] GetAttributeRequest name - */ - - /** - * Constructs a new GetAttributeRequest. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents a GetAttributeRequest. - * @implements IGetAttributeRequest - * @constructor - * @param {google.cloud.apihub.v1.IGetAttributeRequest=} [properties] Properties to set - */ - function GetAttributeRequest(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]]; - } - - /** - * GetAttributeRequest name. - * @member {string} name - * @memberof google.cloud.apihub.v1.GetAttributeRequest - * @instance - */ - GetAttributeRequest.prototype.name = ""; - - /** - * Creates a new GetAttributeRequest instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.GetAttributeRequest - * @static - * @param {google.cloud.apihub.v1.IGetAttributeRequest=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.GetAttributeRequest} GetAttributeRequest instance - */ - GetAttributeRequest.create = function create(properties) { - return new GetAttributeRequest(properties); - }; - - /** - * Encodes the specified GetAttributeRequest message. Does not implicitly {@link google.cloud.apihub.v1.GetAttributeRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.GetAttributeRequest - * @static - * @param {google.cloud.apihub.v1.IGetAttributeRequest} message GetAttributeRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetAttributeRequest.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 GetAttributeRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.GetAttributeRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.GetAttributeRequest - * @static - * @param {google.cloud.apihub.v1.IGetAttributeRequest} message GetAttributeRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetAttributeRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetAttributeRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.GetAttributeRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.GetAttributeRequest} GetAttributeRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetAttributeRequest.decode = function 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.apihub.v1.GetAttributeRequest(); - 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 GetAttributeRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.GetAttributeRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.GetAttributeRequest} GetAttributeRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetAttributeRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetAttributeRequest message. - * @function verify - * @memberof google.cloud.apihub.v1.GetAttributeRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetAttributeRequest.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 GetAttributeRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.GetAttributeRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.GetAttributeRequest} GetAttributeRequest - */ - GetAttributeRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.GetAttributeRequest) - return object; - var message = new $root.google.cloud.apihub.v1.GetAttributeRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetAttributeRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.GetAttributeRequest - * @static - * @param {google.cloud.apihub.v1.GetAttributeRequest} message GetAttributeRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetAttributeRequest.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 GetAttributeRequest to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.GetAttributeRequest - * @instance - * @returns {Object.} JSON object - */ - GetAttributeRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetAttributeRequest - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.GetAttributeRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetAttributeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.GetAttributeRequest"; - }; - - return GetAttributeRequest; - })(); - - v1.UpdateAttributeRequest = (function() { - - /** - * Properties of an UpdateAttributeRequest. - * @memberof google.cloud.apihub.v1 - * @interface IUpdateAttributeRequest - * @property {google.cloud.apihub.v1.IAttribute|null} [attribute] UpdateAttributeRequest attribute - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateAttributeRequest updateMask - */ - - /** - * Constructs a new UpdateAttributeRequest. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents an UpdateAttributeRequest. - * @implements IUpdateAttributeRequest - * @constructor - * @param {google.cloud.apihub.v1.IUpdateAttributeRequest=} [properties] Properties to set - */ - function UpdateAttributeRequest(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]]; - } - - /** - * UpdateAttributeRequest attribute. - * @member {google.cloud.apihub.v1.IAttribute|null|undefined} attribute - * @memberof google.cloud.apihub.v1.UpdateAttributeRequest - * @instance - */ - UpdateAttributeRequest.prototype.attribute = null; - - /** - * UpdateAttributeRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.apihub.v1.UpdateAttributeRequest - * @instance - */ - UpdateAttributeRequest.prototype.updateMask = null; - - /** - * Creates a new UpdateAttributeRequest instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.UpdateAttributeRequest - * @static - * @param {google.cloud.apihub.v1.IUpdateAttributeRequest=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.UpdateAttributeRequest} UpdateAttributeRequest instance - */ - UpdateAttributeRequest.create = function create(properties) { - return new UpdateAttributeRequest(properties); - }; - - /** - * Encodes the specified UpdateAttributeRequest message. Does not implicitly {@link google.cloud.apihub.v1.UpdateAttributeRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.UpdateAttributeRequest - * @static - * @param {google.cloud.apihub.v1.IUpdateAttributeRequest} message UpdateAttributeRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateAttributeRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.attribute != null && Object.hasOwnProperty.call(message, "attribute")) - $root.google.cloud.apihub.v1.Attribute.encode(message.attribute, 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 UpdateAttributeRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.UpdateAttributeRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.UpdateAttributeRequest - * @static - * @param {google.cloud.apihub.v1.IUpdateAttributeRequest} message UpdateAttributeRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateAttributeRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateAttributeRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.UpdateAttributeRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.UpdateAttributeRequest} UpdateAttributeRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateAttributeRequest.decode = function 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.apihub.v1.UpdateAttributeRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.attribute = $root.google.cloud.apihub.v1.Attribute.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 UpdateAttributeRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.UpdateAttributeRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.UpdateAttributeRequest} UpdateAttributeRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateAttributeRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateAttributeRequest message. - * @function verify - * @memberof google.cloud.apihub.v1.UpdateAttributeRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateAttributeRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.attribute != null && message.hasOwnProperty("attribute")) { - var error = $root.google.cloud.apihub.v1.Attribute.verify(message.attribute); - if (error) - return "attribute." + 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 UpdateAttributeRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.UpdateAttributeRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.UpdateAttributeRequest} UpdateAttributeRequest - */ - UpdateAttributeRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.UpdateAttributeRequest) - return object; - var message = new $root.google.cloud.apihub.v1.UpdateAttributeRequest(); - if (object.attribute != null) { - if (typeof object.attribute !== "object") - throw TypeError(".google.cloud.apihub.v1.UpdateAttributeRequest.attribute: object expected"); - message.attribute = $root.google.cloud.apihub.v1.Attribute.fromObject(object.attribute); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.apihub.v1.UpdateAttributeRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - return message; - }; - - /** - * Creates a plain object from an UpdateAttributeRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.UpdateAttributeRequest - * @static - * @param {google.cloud.apihub.v1.UpdateAttributeRequest} message UpdateAttributeRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateAttributeRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.attribute = null; - object.updateMask = null; - } - if (message.attribute != null && message.hasOwnProperty("attribute")) - object.attribute = $root.google.cloud.apihub.v1.Attribute.toObject(message.attribute, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - return object; - }; - - /** - * Converts this UpdateAttributeRequest to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.UpdateAttributeRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateAttributeRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateAttributeRequest - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.UpdateAttributeRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateAttributeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.UpdateAttributeRequest"; - }; - - return UpdateAttributeRequest; - })(); - - v1.DeleteAttributeRequest = (function() { - - /** - * Properties of a DeleteAttributeRequest. - * @memberof google.cloud.apihub.v1 - * @interface IDeleteAttributeRequest - * @property {string|null} [name] DeleteAttributeRequest name - */ - - /** - * Constructs a new DeleteAttributeRequest. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents a DeleteAttributeRequest. - * @implements IDeleteAttributeRequest - * @constructor - * @param {google.cloud.apihub.v1.IDeleteAttributeRequest=} [properties] Properties to set - */ - function DeleteAttributeRequest(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]]; - } - - /** - * DeleteAttributeRequest name. - * @member {string} name - * @memberof google.cloud.apihub.v1.DeleteAttributeRequest - * @instance - */ - DeleteAttributeRequest.prototype.name = ""; - - /** - * Creates a new DeleteAttributeRequest instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.DeleteAttributeRequest - * @static - * @param {google.cloud.apihub.v1.IDeleteAttributeRequest=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.DeleteAttributeRequest} DeleteAttributeRequest instance - */ - DeleteAttributeRequest.create = function create(properties) { - return new DeleteAttributeRequest(properties); - }; - - /** - * Encodes the specified DeleteAttributeRequest message. Does not implicitly {@link google.cloud.apihub.v1.DeleteAttributeRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.DeleteAttributeRequest - * @static - * @param {google.cloud.apihub.v1.IDeleteAttributeRequest} message DeleteAttributeRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteAttributeRequest.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 DeleteAttributeRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.DeleteAttributeRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.DeleteAttributeRequest - * @static - * @param {google.cloud.apihub.v1.IDeleteAttributeRequest} message DeleteAttributeRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteAttributeRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteAttributeRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.DeleteAttributeRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.DeleteAttributeRequest} DeleteAttributeRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteAttributeRequest.decode = function 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.apihub.v1.DeleteAttributeRequest(); - 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 DeleteAttributeRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.DeleteAttributeRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.DeleteAttributeRequest} DeleteAttributeRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteAttributeRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteAttributeRequest message. - * @function verify - * @memberof google.cloud.apihub.v1.DeleteAttributeRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteAttributeRequest.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 DeleteAttributeRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.DeleteAttributeRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.DeleteAttributeRequest} DeleteAttributeRequest - */ - DeleteAttributeRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.DeleteAttributeRequest) - return object; - var message = new $root.google.cloud.apihub.v1.DeleteAttributeRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a DeleteAttributeRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.DeleteAttributeRequest - * @static - * @param {google.cloud.apihub.v1.DeleteAttributeRequest} message DeleteAttributeRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteAttributeRequest.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 DeleteAttributeRequest to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.DeleteAttributeRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteAttributeRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteAttributeRequest - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.DeleteAttributeRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteAttributeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.DeleteAttributeRequest"; - }; - - return DeleteAttributeRequest; - })(); - - v1.ListAttributesRequest = (function() { - - /** - * Properties of a ListAttributesRequest. - * @memberof google.cloud.apihub.v1 - * @interface IListAttributesRequest - * @property {string|null} [parent] ListAttributesRequest parent - * @property {string|null} [filter] ListAttributesRequest filter - * @property {number|null} [pageSize] ListAttributesRequest pageSize - * @property {string|null} [pageToken] ListAttributesRequest pageToken - */ - - /** - * Constructs a new ListAttributesRequest. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents a ListAttributesRequest. - * @implements IListAttributesRequest - * @constructor - * @param {google.cloud.apihub.v1.IListAttributesRequest=} [properties] Properties to set - */ - function ListAttributesRequest(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]]; - } - - /** - * ListAttributesRequest parent. - * @member {string} parent - * @memberof google.cloud.apihub.v1.ListAttributesRequest - * @instance - */ - ListAttributesRequest.prototype.parent = ""; - - /** - * ListAttributesRequest filter. - * @member {string} filter - * @memberof google.cloud.apihub.v1.ListAttributesRequest - * @instance - */ - ListAttributesRequest.prototype.filter = ""; - - /** - * ListAttributesRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.apihub.v1.ListAttributesRequest - * @instance - */ - ListAttributesRequest.prototype.pageSize = 0; - - /** - * ListAttributesRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.apihub.v1.ListAttributesRequest - * @instance - */ - ListAttributesRequest.prototype.pageToken = ""; - - /** - * Creates a new ListAttributesRequest instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.ListAttributesRequest - * @static - * @param {google.cloud.apihub.v1.IListAttributesRequest=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.ListAttributesRequest} ListAttributesRequest instance - */ - ListAttributesRequest.create = function create(properties) { - return new ListAttributesRequest(properties); - }; - - /** - * Encodes the specified ListAttributesRequest message. Does not implicitly {@link google.cloud.apihub.v1.ListAttributesRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.ListAttributesRequest - * @static - * @param {google.cloud.apihub.v1.IListAttributesRequest} message ListAttributesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListAttributesRequest.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.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); - return writer; - }; - - /** - * Encodes the specified ListAttributesRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListAttributesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.ListAttributesRequest - * @static - * @param {google.cloud.apihub.v1.IListAttributesRequest} message ListAttributesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListAttributesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListAttributesRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.ListAttributesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.ListAttributesRequest} ListAttributesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListAttributesRequest.decode = function 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.apihub.v1.ListAttributesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.filter = reader.string(); - break; - } - case 3: { - message.pageSize = reader.int32(); - break; - } - case 4: { - message.pageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListAttributesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.ListAttributesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.ListAttributesRequest} ListAttributesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListAttributesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListAttributesRequest message. - * @function verify - * @memberof google.cloud.apihub.v1.ListAttributesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListAttributesRequest.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.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 ListAttributesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.ListAttributesRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.ListAttributesRequest} ListAttributesRequest - */ - ListAttributesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.ListAttributesRequest) - return object; - var message = new $root.google.cloud.apihub.v1.ListAttributesRequest(); - if (object.parent != null) - message.parent = String(object.parent); - 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 ListAttributesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.ListAttributesRequest - * @static - * @param {google.cloud.apihub.v1.ListAttributesRequest} message ListAttributesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListAttributesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.filter = ""; - object.pageSize = 0; - object.pageToken = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - 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; - return object; - }; - - /** - * Converts this ListAttributesRequest to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.ListAttributesRequest - * @instance - * @returns {Object.} JSON object - */ - ListAttributesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListAttributesRequest - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.ListAttributesRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListAttributesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.ListAttributesRequest"; - }; - - return ListAttributesRequest; - })(); - - v1.ListAttributesResponse = (function() { - - /** - * Properties of a ListAttributesResponse. - * @memberof google.cloud.apihub.v1 - * @interface IListAttributesResponse - * @property {Array.|null} [attributes] ListAttributesResponse attributes - * @property {string|null} [nextPageToken] ListAttributesResponse nextPageToken - */ - - /** - * Constructs a new ListAttributesResponse. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents a ListAttributesResponse. - * @implements IListAttributesResponse - * @constructor - * @param {google.cloud.apihub.v1.IListAttributesResponse=} [properties] Properties to set - */ - function ListAttributesResponse(properties) { - this.attributes = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListAttributesResponse attributes. - * @member {Array.} attributes - * @memberof google.cloud.apihub.v1.ListAttributesResponse - * @instance - */ - ListAttributesResponse.prototype.attributes = $util.emptyArray; - - /** - * ListAttributesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.apihub.v1.ListAttributesResponse - * @instance - */ - ListAttributesResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListAttributesResponse instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.ListAttributesResponse - * @static - * @param {google.cloud.apihub.v1.IListAttributesResponse=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.ListAttributesResponse} ListAttributesResponse instance - */ - ListAttributesResponse.create = function create(properties) { - return new ListAttributesResponse(properties); - }; - - /** - * Encodes the specified ListAttributesResponse message. Does not implicitly {@link google.cloud.apihub.v1.ListAttributesResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.ListAttributesResponse - * @static - * @param {google.cloud.apihub.v1.IListAttributesResponse} message ListAttributesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListAttributesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.attributes != null && message.attributes.length) - for (var i = 0; i < message.attributes.length; ++i) - $root.google.cloud.apihub.v1.Attribute.encode(message.attributes[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 ListAttributesResponse message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListAttributesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.ListAttributesResponse - * @static - * @param {google.cloud.apihub.v1.IListAttributesResponse} message ListAttributesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListAttributesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListAttributesResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.ListAttributesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.ListAttributesResponse} ListAttributesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListAttributesResponse.decode = function 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.apihub.v1.ListAttributesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.attributes && message.attributes.length)) - message.attributes = []; - message.attributes.push($root.google.cloud.apihub.v1.Attribute.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListAttributesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.ListAttributesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.ListAttributesResponse} ListAttributesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListAttributesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListAttributesResponse message. - * @function verify - * @memberof google.cloud.apihub.v1.ListAttributesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListAttributesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.attributes != null && message.hasOwnProperty("attributes")) { - if (!Array.isArray(message.attributes)) - return "attributes: array expected"; - for (var i = 0; i < message.attributes.length; ++i) { - var error = $root.google.cloud.apihub.v1.Attribute.verify(message.attributes[i]); - if (error) - return "attributes." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListAttributesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.ListAttributesResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.ListAttributesResponse} ListAttributesResponse - */ - ListAttributesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.ListAttributesResponse) - return object; - var message = new $root.google.cloud.apihub.v1.ListAttributesResponse(); - if (object.attributes) { - if (!Array.isArray(object.attributes)) - throw TypeError(".google.cloud.apihub.v1.ListAttributesResponse.attributes: array expected"); - message.attributes = []; - for (var i = 0; i < object.attributes.length; ++i) { - if (typeof object.attributes[i] !== "object") - throw TypeError(".google.cloud.apihub.v1.ListAttributesResponse.attributes: object expected"); - message.attributes[i] = $root.google.cloud.apihub.v1.Attribute.fromObject(object.attributes[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListAttributesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.ListAttributesResponse - * @static - * @param {google.cloud.apihub.v1.ListAttributesResponse} message ListAttributesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListAttributesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.attributes = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.attributes && message.attributes.length) { - object.attributes = []; - for (var j = 0; j < message.attributes.length; ++j) - object.attributes[j] = $root.google.cloud.apihub.v1.Attribute.toObject(message.attributes[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListAttributesResponse to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.ListAttributesResponse - * @instance - * @returns {Object.} JSON object - */ - ListAttributesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListAttributesResponse - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.ListAttributesResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListAttributesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.ListAttributesResponse"; - }; - - return ListAttributesResponse; - })(); - - v1.SearchResourcesRequest = (function() { - - /** - * Properties of a SearchResourcesRequest. - * @memberof google.cloud.apihub.v1 - * @interface ISearchResourcesRequest - * @property {string|null} [location] SearchResourcesRequest location - * @property {string|null} [query] SearchResourcesRequest query - * @property {string|null} [filter] SearchResourcesRequest filter - * @property {number|null} [pageSize] SearchResourcesRequest pageSize - * @property {string|null} [pageToken] SearchResourcesRequest pageToken - */ - - /** - * Constructs a new SearchResourcesRequest. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents a SearchResourcesRequest. - * @implements ISearchResourcesRequest - * @constructor - * @param {google.cloud.apihub.v1.ISearchResourcesRequest=} [properties] Properties to set - */ - function SearchResourcesRequest(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]]; - } - - /** - * SearchResourcesRequest location. - * @member {string} location - * @memberof google.cloud.apihub.v1.SearchResourcesRequest - * @instance - */ - SearchResourcesRequest.prototype.location = ""; - - /** - * SearchResourcesRequest query. - * @member {string} query - * @memberof google.cloud.apihub.v1.SearchResourcesRequest - * @instance - */ - SearchResourcesRequest.prototype.query = ""; - - /** - * SearchResourcesRequest filter. - * @member {string} filter - * @memberof google.cloud.apihub.v1.SearchResourcesRequest - * @instance - */ - SearchResourcesRequest.prototype.filter = ""; - - /** - * SearchResourcesRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.apihub.v1.SearchResourcesRequest - * @instance - */ - SearchResourcesRequest.prototype.pageSize = 0; - - /** - * SearchResourcesRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.apihub.v1.SearchResourcesRequest - * @instance - */ - SearchResourcesRequest.prototype.pageToken = ""; - - /** - * Creates a new SearchResourcesRequest instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.SearchResourcesRequest - * @static - * @param {google.cloud.apihub.v1.ISearchResourcesRequest=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.SearchResourcesRequest} SearchResourcesRequest instance - */ - SearchResourcesRequest.create = function create(properties) { - return new SearchResourcesRequest(properties); - }; - - /** - * Encodes the specified SearchResourcesRequest message. Does not implicitly {@link google.cloud.apihub.v1.SearchResourcesRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.SearchResourcesRequest - * @static - * @param {google.cloud.apihub.v1.ISearchResourcesRequest} message SearchResourcesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SearchResourcesRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.location != null && Object.hasOwnProperty.call(message, "location")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.location); - if (message.query != null && Object.hasOwnProperty.call(message, "query")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.query); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.filter); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.pageToken); - return writer; - }; - - /** - * Encodes the specified SearchResourcesRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.SearchResourcesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.SearchResourcesRequest - * @static - * @param {google.cloud.apihub.v1.ISearchResourcesRequest} message SearchResourcesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SearchResourcesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SearchResourcesRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.SearchResourcesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.SearchResourcesRequest} SearchResourcesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SearchResourcesRequest.decode = function 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.apihub.v1.SearchResourcesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.location = reader.string(); - break; - } - case 2: { - message.query = reader.string(); - break; - } - case 3: { - message.filter = reader.string(); - break; - } - case 4: { - message.pageSize = reader.int32(); - break; - } - case 5: { - message.pageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SearchResourcesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.SearchResourcesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.SearchResourcesRequest} SearchResourcesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SearchResourcesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SearchResourcesRequest message. - * @function verify - * @memberof google.cloud.apihub.v1.SearchResourcesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SearchResourcesRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.location != null && message.hasOwnProperty("location")) - if (!$util.isString(message.location)) - return "location: string expected"; - if (message.query != null && message.hasOwnProperty("query")) - if (!$util.isString(message.query)) - return "query: 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 SearchResourcesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.SearchResourcesRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.SearchResourcesRequest} SearchResourcesRequest - */ - SearchResourcesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.SearchResourcesRequest) - return object; - var message = new $root.google.cloud.apihub.v1.SearchResourcesRequest(); - if (object.location != null) - message.location = String(object.location); - if (object.query != null) - message.query = String(object.query); - 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 SearchResourcesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.SearchResourcesRequest - * @static - * @param {google.cloud.apihub.v1.SearchResourcesRequest} message SearchResourcesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SearchResourcesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.location = ""; - object.query = ""; - object.filter = ""; - object.pageSize = 0; - object.pageToken = ""; - } - if (message.location != null && message.hasOwnProperty("location")) - object.location = message.location; - if (message.query != null && message.hasOwnProperty("query")) - object.query = message.query; - 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; - return object; - }; - - /** - * Converts this SearchResourcesRequest to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.SearchResourcesRequest - * @instance - * @returns {Object.} JSON object - */ - SearchResourcesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SearchResourcesRequest - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.SearchResourcesRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SearchResourcesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.SearchResourcesRequest"; - }; - - return SearchResourcesRequest; - })(); - - v1.ApiHubResource = (function() { - - /** - * Properties of an ApiHubResource. - * @memberof google.cloud.apihub.v1 - * @interface IApiHubResource - * @property {google.cloud.apihub.v1.IApi|null} [api] ApiHubResource api - * @property {google.cloud.apihub.v1.IApiOperation|null} [operation] ApiHubResource operation - * @property {google.cloud.apihub.v1.IDeployment|null} [deployment] ApiHubResource deployment - * @property {google.cloud.apihub.v1.ISpec|null} [spec] ApiHubResource spec - * @property {google.cloud.apihub.v1.IDefinition|null} [definition] ApiHubResource definition - * @property {google.cloud.apihub.v1.IVersion|null} [version] ApiHubResource version - */ - - /** - * Constructs a new ApiHubResource. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents an ApiHubResource. - * @implements IApiHubResource - * @constructor - * @param {google.cloud.apihub.v1.IApiHubResource=} [properties] Properties to set - */ - function ApiHubResource(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]]; - } - - /** - * ApiHubResource api. - * @member {google.cloud.apihub.v1.IApi|null|undefined} api - * @memberof google.cloud.apihub.v1.ApiHubResource - * @instance - */ - ApiHubResource.prototype.api = null; - - /** - * ApiHubResource operation. - * @member {google.cloud.apihub.v1.IApiOperation|null|undefined} operation - * @memberof google.cloud.apihub.v1.ApiHubResource - * @instance - */ - ApiHubResource.prototype.operation = null; - - /** - * ApiHubResource deployment. - * @member {google.cloud.apihub.v1.IDeployment|null|undefined} deployment - * @memberof google.cloud.apihub.v1.ApiHubResource - * @instance - */ - ApiHubResource.prototype.deployment = null; - - /** - * ApiHubResource spec. - * @member {google.cloud.apihub.v1.ISpec|null|undefined} spec - * @memberof google.cloud.apihub.v1.ApiHubResource - * @instance - */ - ApiHubResource.prototype.spec = null; - - /** - * ApiHubResource definition. - * @member {google.cloud.apihub.v1.IDefinition|null|undefined} definition - * @memberof google.cloud.apihub.v1.ApiHubResource - * @instance - */ - ApiHubResource.prototype.definition = null; - - /** - * ApiHubResource version. - * @member {google.cloud.apihub.v1.IVersion|null|undefined} version - * @memberof google.cloud.apihub.v1.ApiHubResource - * @instance - */ - ApiHubResource.prototype.version = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * ApiHubResource resource. - * @member {"api"|"operation"|"deployment"|"spec"|"definition"|"version"|undefined} resource - * @memberof google.cloud.apihub.v1.ApiHubResource - * @instance - */ - Object.defineProperty(ApiHubResource.prototype, "resource", { - get: $util.oneOfGetter($oneOfFields = ["api", "operation", "deployment", "spec", "definition", "version"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new ApiHubResource instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.ApiHubResource - * @static - * @param {google.cloud.apihub.v1.IApiHubResource=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.ApiHubResource} ApiHubResource instance - */ - ApiHubResource.create = function create(properties) { - return new ApiHubResource(properties); - }; - - /** - * Encodes the specified ApiHubResource message. Does not implicitly {@link google.cloud.apihub.v1.ApiHubResource.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.ApiHubResource - * @static - * @param {google.cloud.apihub.v1.IApiHubResource} message ApiHubResource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ApiHubResource.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.api != null && Object.hasOwnProperty.call(message, "api")) - $root.google.cloud.apihub.v1.Api.encode(message.api, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.operation != null && Object.hasOwnProperty.call(message, "operation")) - $root.google.cloud.apihub.v1.ApiOperation.encode(message.operation, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.deployment != null && Object.hasOwnProperty.call(message, "deployment")) - $root.google.cloud.apihub.v1.Deployment.encode(message.deployment, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.spec != null && Object.hasOwnProperty.call(message, "spec")) - $root.google.cloud.apihub.v1.Spec.encode(message.spec, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.definition != null && Object.hasOwnProperty.call(message, "definition")) - $root.google.cloud.apihub.v1.Definition.encode(message.definition, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) - $root.google.cloud.apihub.v1.Version.encode(message.version, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ApiHubResource message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ApiHubResource.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.ApiHubResource - * @static - * @param {google.cloud.apihub.v1.IApiHubResource} message ApiHubResource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ApiHubResource.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ApiHubResource message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.ApiHubResource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.ApiHubResource} ApiHubResource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ApiHubResource.decode = function 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.apihub.v1.ApiHubResource(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.api = $root.google.cloud.apihub.v1.Api.decode(reader, reader.uint32()); - break; - } - case 2: { - message.operation = $root.google.cloud.apihub.v1.ApiOperation.decode(reader, reader.uint32()); - break; - } - case 3: { - message.deployment = $root.google.cloud.apihub.v1.Deployment.decode(reader, reader.uint32()); - break; - } - case 4: { - message.spec = $root.google.cloud.apihub.v1.Spec.decode(reader, reader.uint32()); - break; - } - case 5: { - message.definition = $root.google.cloud.apihub.v1.Definition.decode(reader, reader.uint32()); - break; - } - case 6: { - message.version = $root.google.cloud.apihub.v1.Version.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ApiHubResource message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.ApiHubResource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.ApiHubResource} ApiHubResource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ApiHubResource.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ApiHubResource message. - * @function verify - * @memberof google.cloud.apihub.v1.ApiHubResource - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ApiHubResource.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.api != null && message.hasOwnProperty("api")) { - properties.resource = 1; - { - var error = $root.google.cloud.apihub.v1.Api.verify(message.api); - if (error) - return "api." + error; - } - } - if (message.operation != null && message.hasOwnProperty("operation")) { - if (properties.resource === 1) - return "resource: multiple values"; - properties.resource = 1; - { - var error = $root.google.cloud.apihub.v1.ApiOperation.verify(message.operation); - if (error) - return "operation." + error; - } - } - if (message.deployment != null && message.hasOwnProperty("deployment")) { - if (properties.resource === 1) - return "resource: multiple values"; - properties.resource = 1; - { - var error = $root.google.cloud.apihub.v1.Deployment.verify(message.deployment); - if (error) - return "deployment." + error; - } - } - if (message.spec != null && message.hasOwnProperty("spec")) { - if (properties.resource === 1) - return "resource: multiple values"; - properties.resource = 1; - { - var error = $root.google.cloud.apihub.v1.Spec.verify(message.spec); - if (error) - return "spec." + error; - } - } - if (message.definition != null && message.hasOwnProperty("definition")) { - if (properties.resource === 1) - return "resource: multiple values"; - properties.resource = 1; - { - var error = $root.google.cloud.apihub.v1.Definition.verify(message.definition); - if (error) - return "definition." + error; - } - } - if (message.version != null && message.hasOwnProperty("version")) { - if (properties.resource === 1) - return "resource: multiple values"; - properties.resource = 1; - { - var error = $root.google.cloud.apihub.v1.Version.verify(message.version); - if (error) - return "version." + error; - } - } - return null; - }; - - /** - * Creates an ApiHubResource message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.ApiHubResource - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.ApiHubResource} ApiHubResource - */ - ApiHubResource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.ApiHubResource) - return object; - var message = new $root.google.cloud.apihub.v1.ApiHubResource(); - if (object.api != null) { - if (typeof object.api !== "object") - throw TypeError(".google.cloud.apihub.v1.ApiHubResource.api: object expected"); - message.api = $root.google.cloud.apihub.v1.Api.fromObject(object.api); - } - if (object.operation != null) { - if (typeof object.operation !== "object") - throw TypeError(".google.cloud.apihub.v1.ApiHubResource.operation: object expected"); - message.operation = $root.google.cloud.apihub.v1.ApiOperation.fromObject(object.operation); - } - if (object.deployment != null) { - if (typeof object.deployment !== "object") - throw TypeError(".google.cloud.apihub.v1.ApiHubResource.deployment: object expected"); - message.deployment = $root.google.cloud.apihub.v1.Deployment.fromObject(object.deployment); - } - if (object.spec != null) { - if (typeof object.spec !== "object") - throw TypeError(".google.cloud.apihub.v1.ApiHubResource.spec: object expected"); - message.spec = $root.google.cloud.apihub.v1.Spec.fromObject(object.spec); - } - if (object.definition != null) { - if (typeof object.definition !== "object") - throw TypeError(".google.cloud.apihub.v1.ApiHubResource.definition: object expected"); - message.definition = $root.google.cloud.apihub.v1.Definition.fromObject(object.definition); - } - if (object.version != null) { - if (typeof object.version !== "object") - throw TypeError(".google.cloud.apihub.v1.ApiHubResource.version: object expected"); - message.version = $root.google.cloud.apihub.v1.Version.fromObject(object.version); - } - return message; - }; - - /** - * Creates a plain object from an ApiHubResource message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.ApiHubResource - * @static - * @param {google.cloud.apihub.v1.ApiHubResource} message ApiHubResource - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ApiHubResource.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.api != null && message.hasOwnProperty("api")) { - object.api = $root.google.cloud.apihub.v1.Api.toObject(message.api, options); - if (options.oneofs) - object.resource = "api"; - } - if (message.operation != null && message.hasOwnProperty("operation")) { - object.operation = $root.google.cloud.apihub.v1.ApiOperation.toObject(message.operation, options); - if (options.oneofs) - object.resource = "operation"; - } - if (message.deployment != null && message.hasOwnProperty("deployment")) { - object.deployment = $root.google.cloud.apihub.v1.Deployment.toObject(message.deployment, options); - if (options.oneofs) - object.resource = "deployment"; - } - if (message.spec != null && message.hasOwnProperty("spec")) { - object.spec = $root.google.cloud.apihub.v1.Spec.toObject(message.spec, options); - if (options.oneofs) - object.resource = "spec"; - } - if (message.definition != null && message.hasOwnProperty("definition")) { - object.definition = $root.google.cloud.apihub.v1.Definition.toObject(message.definition, options); - if (options.oneofs) - object.resource = "definition"; - } - if (message.version != null && message.hasOwnProperty("version")) { - object.version = $root.google.cloud.apihub.v1.Version.toObject(message.version, options); - if (options.oneofs) - object.resource = "version"; - } - return object; - }; - - /** - * Converts this ApiHubResource to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.ApiHubResource - * @instance - * @returns {Object.} JSON object - */ - ApiHubResource.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ApiHubResource - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.ApiHubResource - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ApiHubResource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.ApiHubResource"; - }; - - return ApiHubResource; - })(); - - v1.SearchResult = (function() { - - /** - * Properties of a SearchResult. - * @memberof google.cloud.apihub.v1 - * @interface ISearchResult - * @property {google.cloud.apihub.v1.IApiHubResource|null} [resource] SearchResult resource - */ - - /** - * Constructs a new SearchResult. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents a SearchResult. - * @implements ISearchResult - * @constructor - * @param {google.cloud.apihub.v1.ISearchResult=} [properties] Properties to set - */ - function SearchResult(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]]; - } - - /** - * SearchResult resource. - * @member {google.cloud.apihub.v1.IApiHubResource|null|undefined} resource - * @memberof google.cloud.apihub.v1.SearchResult - * @instance - */ - SearchResult.prototype.resource = null; - - /** - * Creates a new SearchResult instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.SearchResult - * @static - * @param {google.cloud.apihub.v1.ISearchResult=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.SearchResult} SearchResult instance - */ - SearchResult.create = function create(properties) { - return new SearchResult(properties); - }; - - /** - * Encodes the specified SearchResult message. Does not implicitly {@link google.cloud.apihub.v1.SearchResult.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.SearchResult - * @static - * @param {google.cloud.apihub.v1.ISearchResult} message SearchResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SearchResult.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) - $root.google.cloud.apihub.v1.ApiHubResource.encode(message.resource, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified SearchResult message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.SearchResult.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.SearchResult - * @static - * @param {google.cloud.apihub.v1.ISearchResult} message SearchResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SearchResult.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SearchResult message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.SearchResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.SearchResult} SearchResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SearchResult.decode = function 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.apihub.v1.SearchResult(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.resource = $root.google.cloud.apihub.v1.ApiHubResource.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SearchResult message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.SearchResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.SearchResult} SearchResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SearchResult.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SearchResult message. - * @function verify - * @memberof google.cloud.apihub.v1.SearchResult - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SearchResult.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.resource != null && message.hasOwnProperty("resource")) { - var error = $root.google.cloud.apihub.v1.ApiHubResource.verify(message.resource); - if (error) - return "resource." + error; - } - return null; - }; - - /** - * Creates a SearchResult message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.SearchResult - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.SearchResult} SearchResult - */ - SearchResult.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.SearchResult) - return object; - var message = new $root.google.cloud.apihub.v1.SearchResult(); - if (object.resource != null) { - if (typeof object.resource !== "object") - throw TypeError(".google.cloud.apihub.v1.SearchResult.resource: object expected"); - message.resource = $root.google.cloud.apihub.v1.ApiHubResource.fromObject(object.resource); - } - return message; - }; - - /** - * Creates a plain object from a SearchResult message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.SearchResult - * @static - * @param {google.cloud.apihub.v1.SearchResult} message SearchResult - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SearchResult.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.resource = null; - if (message.resource != null && message.hasOwnProperty("resource")) - object.resource = $root.google.cloud.apihub.v1.ApiHubResource.toObject(message.resource, options); - return object; - }; - - /** - * Converts this SearchResult to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.SearchResult - * @instance - * @returns {Object.} JSON object - */ - SearchResult.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SearchResult - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.SearchResult - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SearchResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.SearchResult"; - }; - - return SearchResult; - })(); - - v1.SearchResourcesResponse = (function() { - - /** - * Properties of a SearchResourcesResponse. - * @memberof google.cloud.apihub.v1 - * @interface ISearchResourcesResponse - * @property {Array.|null} [searchResults] SearchResourcesResponse searchResults - * @property {string|null} [nextPageToken] SearchResourcesResponse nextPageToken - */ - - /** - * Constructs a new SearchResourcesResponse. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents a SearchResourcesResponse. - * @implements ISearchResourcesResponse - * @constructor - * @param {google.cloud.apihub.v1.ISearchResourcesResponse=} [properties] Properties to set - */ - function SearchResourcesResponse(properties) { - this.searchResults = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SearchResourcesResponse searchResults. - * @member {Array.} searchResults - * @memberof google.cloud.apihub.v1.SearchResourcesResponse - * @instance - */ - SearchResourcesResponse.prototype.searchResults = $util.emptyArray; - - /** - * SearchResourcesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.apihub.v1.SearchResourcesResponse - * @instance - */ - SearchResourcesResponse.prototype.nextPageToken = ""; - - /** - * Creates a new SearchResourcesResponse instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.SearchResourcesResponse - * @static - * @param {google.cloud.apihub.v1.ISearchResourcesResponse=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.SearchResourcesResponse} SearchResourcesResponse instance - */ - SearchResourcesResponse.create = function create(properties) { - return new SearchResourcesResponse(properties); - }; - - /** - * Encodes the specified SearchResourcesResponse message. Does not implicitly {@link google.cloud.apihub.v1.SearchResourcesResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.SearchResourcesResponse - * @static - * @param {google.cloud.apihub.v1.ISearchResourcesResponse} message SearchResourcesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SearchResourcesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.searchResults != null && message.searchResults.length) - for (var i = 0; i < message.searchResults.length; ++i) - $root.google.cloud.apihub.v1.SearchResult.encode(message.searchResults[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 SearchResourcesResponse message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.SearchResourcesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.SearchResourcesResponse - * @static - * @param {google.cloud.apihub.v1.ISearchResourcesResponse} message SearchResourcesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SearchResourcesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SearchResourcesResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.SearchResourcesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.SearchResourcesResponse} SearchResourcesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SearchResourcesResponse.decode = function 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.apihub.v1.SearchResourcesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.searchResults && message.searchResults.length)) - message.searchResults = []; - message.searchResults.push($root.google.cloud.apihub.v1.SearchResult.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SearchResourcesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.SearchResourcesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.SearchResourcesResponse} SearchResourcesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SearchResourcesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SearchResourcesResponse message. - * @function verify - * @memberof google.cloud.apihub.v1.SearchResourcesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SearchResourcesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.searchResults != null && message.hasOwnProperty("searchResults")) { - if (!Array.isArray(message.searchResults)) - return "searchResults: array expected"; - for (var i = 0; i < message.searchResults.length; ++i) { - var error = $root.google.cloud.apihub.v1.SearchResult.verify(message.searchResults[i]); - if (error) - return "searchResults." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a SearchResourcesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.SearchResourcesResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.SearchResourcesResponse} SearchResourcesResponse - */ - SearchResourcesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.SearchResourcesResponse) - return object; - var message = new $root.google.cloud.apihub.v1.SearchResourcesResponse(); - if (object.searchResults) { - if (!Array.isArray(object.searchResults)) - throw TypeError(".google.cloud.apihub.v1.SearchResourcesResponse.searchResults: array expected"); - message.searchResults = []; - for (var i = 0; i < object.searchResults.length; ++i) { - if (typeof object.searchResults[i] !== "object") - throw TypeError(".google.cloud.apihub.v1.SearchResourcesResponse.searchResults: object expected"); - message.searchResults[i] = $root.google.cloud.apihub.v1.SearchResult.fromObject(object.searchResults[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a SearchResourcesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.SearchResourcesResponse - * @static - * @param {google.cloud.apihub.v1.SearchResourcesResponse} message SearchResourcesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SearchResourcesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.searchResults = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.searchResults && message.searchResults.length) { - object.searchResults = []; - for (var j = 0; j < message.searchResults.length; ++j) - object.searchResults[j] = $root.google.cloud.apihub.v1.SearchResult.toObject(message.searchResults[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this SearchResourcesResponse to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.SearchResourcesResponse - * @instance - * @returns {Object.} JSON object - */ - SearchResourcesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SearchResourcesResponse - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.SearchResourcesResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SearchResourcesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.SearchResourcesResponse"; - }; - - return SearchResourcesResponse; - })(); - - v1.CreateDependencyRequest = (function() { - - /** - * Properties of a CreateDependencyRequest. - * @memberof google.cloud.apihub.v1 - * @interface ICreateDependencyRequest - * @property {string|null} [parent] CreateDependencyRequest parent - * @property {string|null} [dependencyId] CreateDependencyRequest dependencyId - * @property {google.cloud.apihub.v1.IDependency|null} [dependency] CreateDependencyRequest dependency - */ - - /** - * Constructs a new CreateDependencyRequest. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents a CreateDependencyRequest. - * @implements ICreateDependencyRequest - * @constructor - * @param {google.cloud.apihub.v1.ICreateDependencyRequest=} [properties] Properties to set - */ - function CreateDependencyRequest(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]]; - } - - /** - * CreateDependencyRequest parent. - * @member {string} parent - * @memberof google.cloud.apihub.v1.CreateDependencyRequest - * @instance - */ - CreateDependencyRequest.prototype.parent = ""; - - /** - * CreateDependencyRequest dependencyId. - * @member {string} dependencyId - * @memberof google.cloud.apihub.v1.CreateDependencyRequest - * @instance - */ - CreateDependencyRequest.prototype.dependencyId = ""; - - /** - * CreateDependencyRequest dependency. - * @member {google.cloud.apihub.v1.IDependency|null|undefined} dependency - * @memberof google.cloud.apihub.v1.CreateDependencyRequest - * @instance - */ - CreateDependencyRequest.prototype.dependency = null; - - /** - * Creates a new CreateDependencyRequest instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.CreateDependencyRequest - * @static - * @param {google.cloud.apihub.v1.ICreateDependencyRequest=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.CreateDependencyRequest} CreateDependencyRequest instance - */ - CreateDependencyRequest.create = function create(properties) { - return new CreateDependencyRequest(properties); - }; - - /** - * Encodes the specified CreateDependencyRequest message. Does not implicitly {@link google.cloud.apihub.v1.CreateDependencyRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.CreateDependencyRequest - * @static - * @param {google.cloud.apihub.v1.ICreateDependencyRequest} message CreateDependencyRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateDependencyRequest.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.dependencyId != null && Object.hasOwnProperty.call(message, "dependencyId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.dependencyId); - if (message.dependency != null && Object.hasOwnProperty.call(message, "dependency")) - $root.google.cloud.apihub.v1.Dependency.encode(message.dependency, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CreateDependencyRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.CreateDependencyRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.CreateDependencyRequest - * @static - * @param {google.cloud.apihub.v1.ICreateDependencyRequest} message CreateDependencyRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateDependencyRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateDependencyRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.CreateDependencyRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.CreateDependencyRequest} CreateDependencyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateDependencyRequest.decode = function 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.apihub.v1.CreateDependencyRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.dependencyId = reader.string(); - break; - } - case 3: { - message.dependency = $root.google.cloud.apihub.v1.Dependency.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateDependencyRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.CreateDependencyRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.CreateDependencyRequest} CreateDependencyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateDependencyRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateDependencyRequest message. - * @function verify - * @memberof google.cloud.apihub.v1.CreateDependencyRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateDependencyRequest.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.dependencyId != null && message.hasOwnProperty("dependencyId")) - if (!$util.isString(message.dependencyId)) - return "dependencyId: string expected"; - if (message.dependency != null && message.hasOwnProperty("dependency")) { - var error = $root.google.cloud.apihub.v1.Dependency.verify(message.dependency); - if (error) - return "dependency." + error; - } - return null; - }; - - /** - * Creates a CreateDependencyRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.CreateDependencyRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.CreateDependencyRequest} CreateDependencyRequest - */ - CreateDependencyRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.CreateDependencyRequest) - return object; - var message = new $root.google.cloud.apihub.v1.CreateDependencyRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.dependencyId != null) - message.dependencyId = String(object.dependencyId); - if (object.dependency != null) { - if (typeof object.dependency !== "object") - throw TypeError(".google.cloud.apihub.v1.CreateDependencyRequest.dependency: object expected"); - message.dependency = $root.google.cloud.apihub.v1.Dependency.fromObject(object.dependency); - } - return message; - }; - - /** - * Creates a plain object from a CreateDependencyRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.CreateDependencyRequest - * @static - * @param {google.cloud.apihub.v1.CreateDependencyRequest} message CreateDependencyRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateDependencyRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.dependencyId = ""; - object.dependency = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.dependencyId != null && message.hasOwnProperty("dependencyId")) - object.dependencyId = message.dependencyId; - if (message.dependency != null && message.hasOwnProperty("dependency")) - object.dependency = $root.google.cloud.apihub.v1.Dependency.toObject(message.dependency, options); - return object; - }; - - /** - * Converts this CreateDependencyRequest to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.CreateDependencyRequest - * @instance - * @returns {Object.} JSON object - */ - CreateDependencyRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateDependencyRequest - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.CreateDependencyRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateDependencyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.CreateDependencyRequest"; - }; - - return CreateDependencyRequest; - })(); - - v1.GetDependencyRequest = (function() { - - /** - * Properties of a GetDependencyRequest. - * @memberof google.cloud.apihub.v1 - * @interface IGetDependencyRequest - * @property {string|null} [name] GetDependencyRequest name - */ - - /** - * Constructs a new GetDependencyRequest. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents a GetDependencyRequest. - * @implements IGetDependencyRequest - * @constructor - * @param {google.cloud.apihub.v1.IGetDependencyRequest=} [properties] Properties to set - */ - function GetDependencyRequest(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]]; - } - - /** - * GetDependencyRequest name. - * @member {string} name - * @memberof google.cloud.apihub.v1.GetDependencyRequest - * @instance - */ - GetDependencyRequest.prototype.name = ""; - - /** - * Creates a new GetDependencyRequest instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.GetDependencyRequest - * @static - * @param {google.cloud.apihub.v1.IGetDependencyRequest=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.GetDependencyRequest} GetDependencyRequest instance - */ - GetDependencyRequest.create = function create(properties) { - return new GetDependencyRequest(properties); - }; - - /** - * Encodes the specified GetDependencyRequest message. Does not implicitly {@link google.cloud.apihub.v1.GetDependencyRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.GetDependencyRequest - * @static - * @param {google.cloud.apihub.v1.IGetDependencyRequest} message GetDependencyRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDependencyRequest.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 GetDependencyRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.GetDependencyRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.GetDependencyRequest - * @static - * @param {google.cloud.apihub.v1.IGetDependencyRequest} message GetDependencyRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDependencyRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetDependencyRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.GetDependencyRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.GetDependencyRequest} GetDependencyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDependencyRequest.decode = function 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.apihub.v1.GetDependencyRequest(); - 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 GetDependencyRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.GetDependencyRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.GetDependencyRequest} GetDependencyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDependencyRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetDependencyRequest message. - * @function verify - * @memberof google.cloud.apihub.v1.GetDependencyRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetDependencyRequest.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 GetDependencyRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.GetDependencyRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.GetDependencyRequest} GetDependencyRequest - */ - GetDependencyRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.GetDependencyRequest) - return object; - var message = new $root.google.cloud.apihub.v1.GetDependencyRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetDependencyRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.GetDependencyRequest - * @static - * @param {google.cloud.apihub.v1.GetDependencyRequest} message GetDependencyRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetDependencyRequest.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 GetDependencyRequest to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.GetDependencyRequest - * @instance - * @returns {Object.} JSON object - */ - GetDependencyRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetDependencyRequest - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.GetDependencyRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetDependencyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.GetDependencyRequest"; - }; - - return GetDependencyRequest; - })(); - - v1.UpdateDependencyRequest = (function() { - - /** - * Properties of an UpdateDependencyRequest. - * @memberof google.cloud.apihub.v1 - * @interface IUpdateDependencyRequest - * @property {google.cloud.apihub.v1.IDependency|null} [dependency] UpdateDependencyRequest dependency - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateDependencyRequest updateMask - */ - - /** - * Constructs a new UpdateDependencyRequest. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents an UpdateDependencyRequest. - * @implements IUpdateDependencyRequest - * @constructor - * @param {google.cloud.apihub.v1.IUpdateDependencyRequest=} [properties] Properties to set - */ - function UpdateDependencyRequest(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]]; - } - - /** - * UpdateDependencyRequest dependency. - * @member {google.cloud.apihub.v1.IDependency|null|undefined} dependency - * @memberof google.cloud.apihub.v1.UpdateDependencyRequest - * @instance - */ - UpdateDependencyRequest.prototype.dependency = null; - - /** - * UpdateDependencyRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.apihub.v1.UpdateDependencyRequest - * @instance - */ - UpdateDependencyRequest.prototype.updateMask = null; - - /** - * Creates a new UpdateDependencyRequest instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.UpdateDependencyRequest - * @static - * @param {google.cloud.apihub.v1.IUpdateDependencyRequest=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.UpdateDependencyRequest} UpdateDependencyRequest instance - */ - UpdateDependencyRequest.create = function create(properties) { - return new UpdateDependencyRequest(properties); - }; - - /** - * Encodes the specified UpdateDependencyRequest message. Does not implicitly {@link google.cloud.apihub.v1.UpdateDependencyRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.UpdateDependencyRequest - * @static - * @param {google.cloud.apihub.v1.IUpdateDependencyRequest} message UpdateDependencyRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateDependencyRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.dependency != null && Object.hasOwnProperty.call(message, "dependency")) - $root.google.cloud.apihub.v1.Dependency.encode(message.dependency, 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 UpdateDependencyRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.UpdateDependencyRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.UpdateDependencyRequest - * @static - * @param {google.cloud.apihub.v1.IUpdateDependencyRequest} message UpdateDependencyRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateDependencyRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateDependencyRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.UpdateDependencyRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.UpdateDependencyRequest} UpdateDependencyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateDependencyRequest.decode = function 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.apihub.v1.UpdateDependencyRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.dependency = $root.google.cloud.apihub.v1.Dependency.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 UpdateDependencyRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.UpdateDependencyRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.UpdateDependencyRequest} UpdateDependencyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateDependencyRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateDependencyRequest message. - * @function verify - * @memberof google.cloud.apihub.v1.UpdateDependencyRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateDependencyRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.dependency != null && message.hasOwnProperty("dependency")) { - var error = $root.google.cloud.apihub.v1.Dependency.verify(message.dependency); - if (error) - return "dependency." + 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 UpdateDependencyRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.UpdateDependencyRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.UpdateDependencyRequest} UpdateDependencyRequest - */ - UpdateDependencyRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.UpdateDependencyRequest) - return object; - var message = new $root.google.cloud.apihub.v1.UpdateDependencyRequest(); - if (object.dependency != null) { - if (typeof object.dependency !== "object") - throw TypeError(".google.cloud.apihub.v1.UpdateDependencyRequest.dependency: object expected"); - message.dependency = $root.google.cloud.apihub.v1.Dependency.fromObject(object.dependency); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.apihub.v1.UpdateDependencyRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - return message; - }; - - /** - * Creates a plain object from an UpdateDependencyRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.UpdateDependencyRequest - * @static - * @param {google.cloud.apihub.v1.UpdateDependencyRequest} message UpdateDependencyRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateDependencyRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.dependency = null; - object.updateMask = null; - } - if (message.dependency != null && message.hasOwnProperty("dependency")) - object.dependency = $root.google.cloud.apihub.v1.Dependency.toObject(message.dependency, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - return object; - }; - - /** - * Converts this UpdateDependencyRequest to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.UpdateDependencyRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateDependencyRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateDependencyRequest - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.UpdateDependencyRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateDependencyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.UpdateDependencyRequest"; - }; - - return UpdateDependencyRequest; - })(); - - v1.DeleteDependencyRequest = (function() { - - /** - * Properties of a DeleteDependencyRequest. - * @memberof google.cloud.apihub.v1 - * @interface IDeleteDependencyRequest - * @property {string|null} [name] DeleteDependencyRequest name - */ - - /** - * Constructs a new DeleteDependencyRequest. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents a DeleteDependencyRequest. - * @implements IDeleteDependencyRequest - * @constructor - * @param {google.cloud.apihub.v1.IDeleteDependencyRequest=} [properties] Properties to set - */ - function DeleteDependencyRequest(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]]; - } - - /** - * DeleteDependencyRequest name. - * @member {string} name - * @memberof google.cloud.apihub.v1.DeleteDependencyRequest - * @instance - */ - DeleteDependencyRequest.prototype.name = ""; - - /** - * Creates a new DeleteDependencyRequest instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.DeleteDependencyRequest - * @static - * @param {google.cloud.apihub.v1.IDeleteDependencyRequest=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.DeleteDependencyRequest} DeleteDependencyRequest instance - */ - DeleteDependencyRequest.create = function create(properties) { - return new DeleteDependencyRequest(properties); - }; - - /** - * Encodes the specified DeleteDependencyRequest message. Does not implicitly {@link google.cloud.apihub.v1.DeleteDependencyRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.DeleteDependencyRequest - * @static - * @param {google.cloud.apihub.v1.IDeleteDependencyRequest} message DeleteDependencyRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteDependencyRequest.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 DeleteDependencyRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.DeleteDependencyRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.DeleteDependencyRequest - * @static - * @param {google.cloud.apihub.v1.IDeleteDependencyRequest} message DeleteDependencyRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteDependencyRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteDependencyRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.DeleteDependencyRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.DeleteDependencyRequest} DeleteDependencyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteDependencyRequest.decode = function 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.apihub.v1.DeleteDependencyRequest(); - 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 DeleteDependencyRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.DeleteDependencyRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.DeleteDependencyRequest} DeleteDependencyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteDependencyRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteDependencyRequest message. - * @function verify - * @memberof google.cloud.apihub.v1.DeleteDependencyRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteDependencyRequest.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 DeleteDependencyRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.DeleteDependencyRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.DeleteDependencyRequest} DeleteDependencyRequest - */ - DeleteDependencyRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.DeleteDependencyRequest) - return object; - var message = new $root.google.cloud.apihub.v1.DeleteDependencyRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a DeleteDependencyRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.DeleteDependencyRequest - * @static - * @param {google.cloud.apihub.v1.DeleteDependencyRequest} message DeleteDependencyRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteDependencyRequest.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 DeleteDependencyRequest to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.DeleteDependencyRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteDependencyRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteDependencyRequest - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.DeleteDependencyRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteDependencyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.DeleteDependencyRequest"; - }; - - return DeleteDependencyRequest; - })(); - - v1.ListDependenciesRequest = (function() { - - /** - * Properties of a ListDependenciesRequest. - * @memberof google.cloud.apihub.v1 - * @interface IListDependenciesRequest - * @property {string|null} [parent] ListDependenciesRequest parent - * @property {string|null} [filter] ListDependenciesRequest filter - * @property {number|null} [pageSize] ListDependenciesRequest pageSize - * @property {string|null} [pageToken] ListDependenciesRequest pageToken - */ - - /** - * Constructs a new ListDependenciesRequest. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents a ListDependenciesRequest. - * @implements IListDependenciesRequest - * @constructor - * @param {google.cloud.apihub.v1.IListDependenciesRequest=} [properties] Properties to set - */ - function ListDependenciesRequest(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]]; - } - - /** - * ListDependenciesRequest parent. - * @member {string} parent - * @memberof google.cloud.apihub.v1.ListDependenciesRequest - * @instance - */ - ListDependenciesRequest.prototype.parent = ""; - - /** - * ListDependenciesRequest filter. - * @member {string} filter - * @memberof google.cloud.apihub.v1.ListDependenciesRequest - * @instance - */ - ListDependenciesRequest.prototype.filter = ""; - - /** - * ListDependenciesRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.apihub.v1.ListDependenciesRequest - * @instance - */ - ListDependenciesRequest.prototype.pageSize = 0; - - /** - * ListDependenciesRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.apihub.v1.ListDependenciesRequest - * @instance - */ - ListDependenciesRequest.prototype.pageToken = ""; - - /** - * Creates a new ListDependenciesRequest instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.ListDependenciesRequest - * @static - * @param {google.cloud.apihub.v1.IListDependenciesRequest=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.ListDependenciesRequest} ListDependenciesRequest instance - */ - ListDependenciesRequest.create = function create(properties) { - return new ListDependenciesRequest(properties); - }; - - /** - * Encodes the specified ListDependenciesRequest message. Does not implicitly {@link google.cloud.apihub.v1.ListDependenciesRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.ListDependenciesRequest - * @static - * @param {google.cloud.apihub.v1.IListDependenciesRequest} message ListDependenciesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListDependenciesRequest.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.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); - return writer; - }; - - /** - * Encodes the specified ListDependenciesRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListDependenciesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.ListDependenciesRequest - * @static - * @param {google.cloud.apihub.v1.IListDependenciesRequest} message ListDependenciesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListDependenciesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListDependenciesRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.ListDependenciesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.ListDependenciesRequest} ListDependenciesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListDependenciesRequest.decode = function 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.apihub.v1.ListDependenciesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.filter = reader.string(); - break; - } - case 3: { - message.pageSize = reader.int32(); - break; - } - case 4: { - message.pageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListDependenciesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.ListDependenciesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.ListDependenciesRequest} ListDependenciesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListDependenciesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListDependenciesRequest message. - * @function verify - * @memberof google.cloud.apihub.v1.ListDependenciesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListDependenciesRequest.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.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 ListDependenciesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.ListDependenciesRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.ListDependenciesRequest} ListDependenciesRequest - */ - ListDependenciesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.ListDependenciesRequest) - return object; - var message = new $root.google.cloud.apihub.v1.ListDependenciesRequest(); - if (object.parent != null) - message.parent = String(object.parent); - 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 ListDependenciesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.ListDependenciesRequest - * @static - * @param {google.cloud.apihub.v1.ListDependenciesRequest} message ListDependenciesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListDependenciesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.filter = ""; - object.pageSize = 0; - object.pageToken = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - 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; - return object; - }; - - /** - * Converts this ListDependenciesRequest to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.ListDependenciesRequest - * @instance - * @returns {Object.} JSON object - */ - ListDependenciesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListDependenciesRequest - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.ListDependenciesRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListDependenciesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.ListDependenciesRequest"; - }; - - return ListDependenciesRequest; - })(); - - v1.ListDependenciesResponse = (function() { - - /** - * Properties of a ListDependenciesResponse. - * @memberof google.cloud.apihub.v1 - * @interface IListDependenciesResponse - * @property {Array.|null} [dependencies] ListDependenciesResponse dependencies - * @property {string|null} [nextPageToken] ListDependenciesResponse nextPageToken - */ - - /** - * Constructs a new ListDependenciesResponse. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents a ListDependenciesResponse. - * @implements IListDependenciesResponse - * @constructor - * @param {google.cloud.apihub.v1.IListDependenciesResponse=} [properties] Properties to set - */ - function ListDependenciesResponse(properties) { - this.dependencies = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListDependenciesResponse dependencies. - * @member {Array.} dependencies - * @memberof google.cloud.apihub.v1.ListDependenciesResponse - * @instance - */ - ListDependenciesResponse.prototype.dependencies = $util.emptyArray; - - /** - * ListDependenciesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.apihub.v1.ListDependenciesResponse - * @instance - */ - ListDependenciesResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListDependenciesResponse instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.ListDependenciesResponse - * @static - * @param {google.cloud.apihub.v1.IListDependenciesResponse=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.ListDependenciesResponse} ListDependenciesResponse instance - */ - ListDependenciesResponse.create = function create(properties) { - return new ListDependenciesResponse(properties); - }; - - /** - * Encodes the specified ListDependenciesResponse message. Does not implicitly {@link google.cloud.apihub.v1.ListDependenciesResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.ListDependenciesResponse - * @static - * @param {google.cloud.apihub.v1.IListDependenciesResponse} message ListDependenciesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListDependenciesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.dependencies != null && message.dependencies.length) - for (var i = 0; i < message.dependencies.length; ++i) - $root.google.cloud.apihub.v1.Dependency.encode(message.dependencies[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 ListDependenciesResponse message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListDependenciesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.ListDependenciesResponse - * @static - * @param {google.cloud.apihub.v1.IListDependenciesResponse} message ListDependenciesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListDependenciesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListDependenciesResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.ListDependenciesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.ListDependenciesResponse} ListDependenciesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListDependenciesResponse.decode = function 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.apihub.v1.ListDependenciesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.dependencies && message.dependencies.length)) - message.dependencies = []; - message.dependencies.push($root.google.cloud.apihub.v1.Dependency.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListDependenciesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.ListDependenciesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.ListDependenciesResponse} ListDependenciesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListDependenciesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListDependenciesResponse message. - * @function verify - * @memberof google.cloud.apihub.v1.ListDependenciesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListDependenciesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.dependencies != null && message.hasOwnProperty("dependencies")) { - if (!Array.isArray(message.dependencies)) - return "dependencies: array expected"; - for (var i = 0; i < message.dependencies.length; ++i) { - var error = $root.google.cloud.apihub.v1.Dependency.verify(message.dependencies[i]); - if (error) - return "dependencies." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListDependenciesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.ListDependenciesResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.ListDependenciesResponse} ListDependenciesResponse - */ - ListDependenciesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.ListDependenciesResponse) - return object; - var message = new $root.google.cloud.apihub.v1.ListDependenciesResponse(); - if (object.dependencies) { - if (!Array.isArray(object.dependencies)) - throw TypeError(".google.cloud.apihub.v1.ListDependenciesResponse.dependencies: array expected"); - message.dependencies = []; - for (var i = 0; i < object.dependencies.length; ++i) { - if (typeof object.dependencies[i] !== "object") - throw TypeError(".google.cloud.apihub.v1.ListDependenciesResponse.dependencies: object expected"); - message.dependencies[i] = $root.google.cloud.apihub.v1.Dependency.fromObject(object.dependencies[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListDependenciesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.ListDependenciesResponse - * @static - * @param {google.cloud.apihub.v1.ListDependenciesResponse} message ListDependenciesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListDependenciesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.dependencies = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.dependencies && message.dependencies.length) { - object.dependencies = []; - for (var j = 0; j < message.dependencies.length; ++j) - object.dependencies[j] = $root.google.cloud.apihub.v1.Dependency.toObject(message.dependencies[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListDependenciesResponse to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.ListDependenciesResponse - * @instance - * @returns {Object.} JSON object - */ - ListDependenciesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListDependenciesResponse - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.ListDependenciesResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListDependenciesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.ListDependenciesResponse"; - }; - - return ListDependenciesResponse; - })(); - - v1.CreateExternalApiRequest = (function() { - - /** - * Properties of a CreateExternalApiRequest. - * @memberof google.cloud.apihub.v1 - * @interface ICreateExternalApiRequest - * @property {string|null} [parent] CreateExternalApiRequest parent - * @property {string|null} [externalApiId] CreateExternalApiRequest externalApiId - * @property {google.cloud.apihub.v1.IExternalApi|null} [externalApi] CreateExternalApiRequest externalApi - */ - - /** - * Constructs a new CreateExternalApiRequest. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents a CreateExternalApiRequest. - * @implements ICreateExternalApiRequest - * @constructor - * @param {google.cloud.apihub.v1.ICreateExternalApiRequest=} [properties] Properties to set - */ - function CreateExternalApiRequest(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]]; - } - - /** - * CreateExternalApiRequest parent. - * @member {string} parent - * @memberof google.cloud.apihub.v1.CreateExternalApiRequest - * @instance - */ - CreateExternalApiRequest.prototype.parent = ""; - - /** - * CreateExternalApiRequest externalApiId. - * @member {string} externalApiId - * @memberof google.cloud.apihub.v1.CreateExternalApiRequest - * @instance - */ - CreateExternalApiRequest.prototype.externalApiId = ""; - - /** - * CreateExternalApiRequest externalApi. - * @member {google.cloud.apihub.v1.IExternalApi|null|undefined} externalApi - * @memberof google.cloud.apihub.v1.CreateExternalApiRequest - * @instance - */ - CreateExternalApiRequest.prototype.externalApi = null; - - /** - * Creates a new CreateExternalApiRequest instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.CreateExternalApiRequest - * @static - * @param {google.cloud.apihub.v1.ICreateExternalApiRequest=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.CreateExternalApiRequest} CreateExternalApiRequest instance - */ - CreateExternalApiRequest.create = function create(properties) { - return new CreateExternalApiRequest(properties); - }; - - /** - * Encodes the specified CreateExternalApiRequest message. Does not implicitly {@link google.cloud.apihub.v1.CreateExternalApiRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.CreateExternalApiRequest - * @static - * @param {google.cloud.apihub.v1.ICreateExternalApiRequest} message CreateExternalApiRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateExternalApiRequest.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.externalApiId != null && Object.hasOwnProperty.call(message, "externalApiId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.externalApiId); - if (message.externalApi != null && Object.hasOwnProperty.call(message, "externalApi")) - $root.google.cloud.apihub.v1.ExternalApi.encode(message.externalApi, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CreateExternalApiRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.CreateExternalApiRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.CreateExternalApiRequest - * @static - * @param {google.cloud.apihub.v1.ICreateExternalApiRequest} message CreateExternalApiRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateExternalApiRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateExternalApiRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.CreateExternalApiRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.CreateExternalApiRequest} CreateExternalApiRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateExternalApiRequest.decode = function 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.apihub.v1.CreateExternalApiRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.externalApiId = reader.string(); - break; - } - case 3: { - message.externalApi = $root.google.cloud.apihub.v1.ExternalApi.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateExternalApiRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.CreateExternalApiRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.CreateExternalApiRequest} CreateExternalApiRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateExternalApiRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateExternalApiRequest message. - * @function verify - * @memberof google.cloud.apihub.v1.CreateExternalApiRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateExternalApiRequest.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.externalApiId != null && message.hasOwnProperty("externalApiId")) - if (!$util.isString(message.externalApiId)) - return "externalApiId: string expected"; - if (message.externalApi != null && message.hasOwnProperty("externalApi")) { - var error = $root.google.cloud.apihub.v1.ExternalApi.verify(message.externalApi); - if (error) - return "externalApi." + error; - } - return null; - }; - - /** - * Creates a CreateExternalApiRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.CreateExternalApiRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.CreateExternalApiRequest} CreateExternalApiRequest - */ - CreateExternalApiRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.CreateExternalApiRequest) - return object; - var message = new $root.google.cloud.apihub.v1.CreateExternalApiRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.externalApiId != null) - message.externalApiId = String(object.externalApiId); - if (object.externalApi != null) { - if (typeof object.externalApi !== "object") - throw TypeError(".google.cloud.apihub.v1.CreateExternalApiRequest.externalApi: object expected"); - message.externalApi = $root.google.cloud.apihub.v1.ExternalApi.fromObject(object.externalApi); - } - return message; - }; - - /** - * Creates a plain object from a CreateExternalApiRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.CreateExternalApiRequest - * @static - * @param {google.cloud.apihub.v1.CreateExternalApiRequest} message CreateExternalApiRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateExternalApiRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.externalApiId = ""; - object.externalApi = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.externalApiId != null && message.hasOwnProperty("externalApiId")) - object.externalApiId = message.externalApiId; - if (message.externalApi != null && message.hasOwnProperty("externalApi")) - object.externalApi = $root.google.cloud.apihub.v1.ExternalApi.toObject(message.externalApi, options); - return object; - }; - - /** - * Converts this CreateExternalApiRequest to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.CreateExternalApiRequest - * @instance - * @returns {Object.} JSON object - */ - CreateExternalApiRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateExternalApiRequest - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.CreateExternalApiRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateExternalApiRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.CreateExternalApiRequest"; - }; - - return CreateExternalApiRequest; - })(); - - v1.GetExternalApiRequest = (function() { - - /** - * Properties of a GetExternalApiRequest. - * @memberof google.cloud.apihub.v1 - * @interface IGetExternalApiRequest - * @property {string|null} [name] GetExternalApiRequest name - */ - - /** - * Constructs a new GetExternalApiRequest. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents a GetExternalApiRequest. - * @implements IGetExternalApiRequest - * @constructor - * @param {google.cloud.apihub.v1.IGetExternalApiRequest=} [properties] Properties to set - */ - function GetExternalApiRequest(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]]; - } - - /** - * GetExternalApiRequest name. - * @member {string} name - * @memberof google.cloud.apihub.v1.GetExternalApiRequest - * @instance - */ - GetExternalApiRequest.prototype.name = ""; - - /** - * Creates a new GetExternalApiRequest instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.GetExternalApiRequest - * @static - * @param {google.cloud.apihub.v1.IGetExternalApiRequest=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.GetExternalApiRequest} GetExternalApiRequest instance - */ - GetExternalApiRequest.create = function create(properties) { - return new GetExternalApiRequest(properties); - }; - - /** - * Encodes the specified GetExternalApiRequest message. Does not implicitly {@link google.cloud.apihub.v1.GetExternalApiRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.GetExternalApiRequest - * @static - * @param {google.cloud.apihub.v1.IGetExternalApiRequest} message GetExternalApiRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetExternalApiRequest.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 GetExternalApiRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.GetExternalApiRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.GetExternalApiRequest - * @static - * @param {google.cloud.apihub.v1.IGetExternalApiRequest} message GetExternalApiRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetExternalApiRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetExternalApiRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.GetExternalApiRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.GetExternalApiRequest} GetExternalApiRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetExternalApiRequest.decode = function 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.apihub.v1.GetExternalApiRequest(); - 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 GetExternalApiRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.GetExternalApiRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.GetExternalApiRequest} GetExternalApiRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetExternalApiRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetExternalApiRequest message. - * @function verify - * @memberof google.cloud.apihub.v1.GetExternalApiRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetExternalApiRequest.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 GetExternalApiRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.GetExternalApiRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.GetExternalApiRequest} GetExternalApiRequest - */ - GetExternalApiRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.GetExternalApiRequest) - return object; - var message = new $root.google.cloud.apihub.v1.GetExternalApiRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetExternalApiRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.GetExternalApiRequest - * @static - * @param {google.cloud.apihub.v1.GetExternalApiRequest} message GetExternalApiRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetExternalApiRequest.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 GetExternalApiRequest to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.GetExternalApiRequest - * @instance - * @returns {Object.} JSON object - */ - GetExternalApiRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetExternalApiRequest - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.GetExternalApiRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetExternalApiRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.GetExternalApiRequest"; - }; - - return GetExternalApiRequest; - })(); - - v1.UpdateExternalApiRequest = (function() { - - /** - * Properties of an UpdateExternalApiRequest. - * @memberof google.cloud.apihub.v1 - * @interface IUpdateExternalApiRequest - * @property {google.cloud.apihub.v1.IExternalApi|null} [externalApi] UpdateExternalApiRequest externalApi - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateExternalApiRequest updateMask - */ - - /** - * Constructs a new UpdateExternalApiRequest. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents an UpdateExternalApiRequest. - * @implements IUpdateExternalApiRequest - * @constructor - * @param {google.cloud.apihub.v1.IUpdateExternalApiRequest=} [properties] Properties to set - */ - function UpdateExternalApiRequest(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]]; - } - - /** - * UpdateExternalApiRequest externalApi. - * @member {google.cloud.apihub.v1.IExternalApi|null|undefined} externalApi - * @memberof google.cloud.apihub.v1.UpdateExternalApiRequest - * @instance - */ - UpdateExternalApiRequest.prototype.externalApi = null; - - /** - * UpdateExternalApiRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.apihub.v1.UpdateExternalApiRequest - * @instance - */ - UpdateExternalApiRequest.prototype.updateMask = null; - - /** - * Creates a new UpdateExternalApiRequest instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.UpdateExternalApiRequest - * @static - * @param {google.cloud.apihub.v1.IUpdateExternalApiRequest=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.UpdateExternalApiRequest} UpdateExternalApiRequest instance - */ - UpdateExternalApiRequest.create = function create(properties) { - return new UpdateExternalApiRequest(properties); - }; - - /** - * Encodes the specified UpdateExternalApiRequest message. Does not implicitly {@link google.cloud.apihub.v1.UpdateExternalApiRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.UpdateExternalApiRequest - * @static - * @param {google.cloud.apihub.v1.IUpdateExternalApiRequest} message UpdateExternalApiRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateExternalApiRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.externalApi != null && Object.hasOwnProperty.call(message, "externalApi")) - $root.google.cloud.apihub.v1.ExternalApi.encode(message.externalApi, 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 UpdateExternalApiRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.UpdateExternalApiRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.UpdateExternalApiRequest - * @static - * @param {google.cloud.apihub.v1.IUpdateExternalApiRequest} message UpdateExternalApiRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateExternalApiRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateExternalApiRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.UpdateExternalApiRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.UpdateExternalApiRequest} UpdateExternalApiRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateExternalApiRequest.decode = function 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.apihub.v1.UpdateExternalApiRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.externalApi = $root.google.cloud.apihub.v1.ExternalApi.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 UpdateExternalApiRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.UpdateExternalApiRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.UpdateExternalApiRequest} UpdateExternalApiRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateExternalApiRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateExternalApiRequest message. - * @function verify - * @memberof google.cloud.apihub.v1.UpdateExternalApiRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateExternalApiRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.externalApi != null && message.hasOwnProperty("externalApi")) { - var error = $root.google.cloud.apihub.v1.ExternalApi.verify(message.externalApi); - if (error) - return "externalApi." + 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 UpdateExternalApiRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.UpdateExternalApiRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.UpdateExternalApiRequest} UpdateExternalApiRequest - */ - UpdateExternalApiRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.UpdateExternalApiRequest) - return object; - var message = new $root.google.cloud.apihub.v1.UpdateExternalApiRequest(); - if (object.externalApi != null) { - if (typeof object.externalApi !== "object") - throw TypeError(".google.cloud.apihub.v1.UpdateExternalApiRequest.externalApi: object expected"); - message.externalApi = $root.google.cloud.apihub.v1.ExternalApi.fromObject(object.externalApi); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.apihub.v1.UpdateExternalApiRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - return message; - }; - - /** - * Creates a plain object from an UpdateExternalApiRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.UpdateExternalApiRequest - * @static - * @param {google.cloud.apihub.v1.UpdateExternalApiRequest} message UpdateExternalApiRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateExternalApiRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.externalApi = null; - object.updateMask = null; - } - if (message.externalApi != null && message.hasOwnProperty("externalApi")) - object.externalApi = $root.google.cloud.apihub.v1.ExternalApi.toObject(message.externalApi, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - return object; - }; - - /** - * Converts this UpdateExternalApiRequest to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.UpdateExternalApiRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateExternalApiRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateExternalApiRequest - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.UpdateExternalApiRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateExternalApiRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.UpdateExternalApiRequest"; - }; - - return UpdateExternalApiRequest; - })(); - - v1.DeleteExternalApiRequest = (function() { - - /** - * Properties of a DeleteExternalApiRequest. - * @memberof google.cloud.apihub.v1 - * @interface IDeleteExternalApiRequest - * @property {string|null} [name] DeleteExternalApiRequest name - */ - - /** - * Constructs a new DeleteExternalApiRequest. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents a DeleteExternalApiRequest. - * @implements IDeleteExternalApiRequest - * @constructor - * @param {google.cloud.apihub.v1.IDeleteExternalApiRequest=} [properties] Properties to set - */ - function DeleteExternalApiRequest(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]]; - } - - /** - * DeleteExternalApiRequest name. - * @member {string} name - * @memberof google.cloud.apihub.v1.DeleteExternalApiRequest - * @instance - */ - DeleteExternalApiRequest.prototype.name = ""; - - /** - * Creates a new DeleteExternalApiRequest instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.DeleteExternalApiRequest - * @static - * @param {google.cloud.apihub.v1.IDeleteExternalApiRequest=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.DeleteExternalApiRequest} DeleteExternalApiRequest instance - */ - DeleteExternalApiRequest.create = function create(properties) { - return new DeleteExternalApiRequest(properties); - }; - - /** - * Encodes the specified DeleteExternalApiRequest message. Does not implicitly {@link google.cloud.apihub.v1.DeleteExternalApiRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.DeleteExternalApiRequest - * @static - * @param {google.cloud.apihub.v1.IDeleteExternalApiRequest} message DeleteExternalApiRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteExternalApiRequest.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 DeleteExternalApiRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.DeleteExternalApiRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.DeleteExternalApiRequest - * @static - * @param {google.cloud.apihub.v1.IDeleteExternalApiRequest} message DeleteExternalApiRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteExternalApiRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteExternalApiRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.DeleteExternalApiRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.DeleteExternalApiRequest} DeleteExternalApiRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteExternalApiRequest.decode = function 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.apihub.v1.DeleteExternalApiRequest(); - 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 DeleteExternalApiRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.DeleteExternalApiRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.DeleteExternalApiRequest} DeleteExternalApiRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteExternalApiRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteExternalApiRequest message. - * @function verify - * @memberof google.cloud.apihub.v1.DeleteExternalApiRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteExternalApiRequest.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 DeleteExternalApiRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.DeleteExternalApiRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.DeleteExternalApiRequest} DeleteExternalApiRequest - */ - DeleteExternalApiRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.DeleteExternalApiRequest) - return object; - var message = new $root.google.cloud.apihub.v1.DeleteExternalApiRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a DeleteExternalApiRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.DeleteExternalApiRequest - * @static - * @param {google.cloud.apihub.v1.DeleteExternalApiRequest} message DeleteExternalApiRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteExternalApiRequest.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 DeleteExternalApiRequest to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.DeleteExternalApiRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteExternalApiRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteExternalApiRequest - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.DeleteExternalApiRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteExternalApiRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.DeleteExternalApiRequest"; - }; - - return DeleteExternalApiRequest; - })(); - - v1.ListExternalApisRequest = (function() { - - /** - * Properties of a ListExternalApisRequest. - * @memberof google.cloud.apihub.v1 - * @interface IListExternalApisRequest - * @property {string|null} [parent] ListExternalApisRequest parent - * @property {number|null} [pageSize] ListExternalApisRequest pageSize - * @property {string|null} [pageToken] ListExternalApisRequest pageToken - */ - - /** - * Constructs a new ListExternalApisRequest. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents a ListExternalApisRequest. - * @implements IListExternalApisRequest - * @constructor - * @param {google.cloud.apihub.v1.IListExternalApisRequest=} [properties] Properties to set - */ - function ListExternalApisRequest(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]]; - } - - /** - * ListExternalApisRequest parent. - * @member {string} parent - * @memberof google.cloud.apihub.v1.ListExternalApisRequest - * @instance - */ - ListExternalApisRequest.prototype.parent = ""; - - /** - * ListExternalApisRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.apihub.v1.ListExternalApisRequest - * @instance - */ - ListExternalApisRequest.prototype.pageSize = 0; - - /** - * ListExternalApisRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.apihub.v1.ListExternalApisRequest - * @instance - */ - ListExternalApisRequest.prototype.pageToken = ""; - - /** - * Creates a new ListExternalApisRequest instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.ListExternalApisRequest - * @static - * @param {google.cloud.apihub.v1.IListExternalApisRequest=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.ListExternalApisRequest} ListExternalApisRequest instance - */ - ListExternalApisRequest.create = function create(properties) { - return new ListExternalApisRequest(properties); - }; - - /** - * Encodes the specified ListExternalApisRequest message. Does not implicitly {@link google.cloud.apihub.v1.ListExternalApisRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.ListExternalApisRequest - * @static - * @param {google.cloud.apihub.v1.IListExternalApisRequest} message ListExternalApisRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListExternalApisRequest.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 ListExternalApisRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListExternalApisRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.ListExternalApisRequest - * @static - * @param {google.cloud.apihub.v1.IListExternalApisRequest} message ListExternalApisRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListExternalApisRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListExternalApisRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.ListExternalApisRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.ListExternalApisRequest} ListExternalApisRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListExternalApisRequest.decode = function 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.apihub.v1.ListExternalApisRequest(); - 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 ListExternalApisRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.ListExternalApisRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.ListExternalApisRequest} ListExternalApisRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListExternalApisRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListExternalApisRequest message. - * @function verify - * @memberof google.cloud.apihub.v1.ListExternalApisRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListExternalApisRequest.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 ListExternalApisRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.ListExternalApisRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.ListExternalApisRequest} ListExternalApisRequest - */ - ListExternalApisRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.ListExternalApisRequest) - return object; - var message = new $root.google.cloud.apihub.v1.ListExternalApisRequest(); - 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 ListExternalApisRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.ListExternalApisRequest - * @static - * @param {google.cloud.apihub.v1.ListExternalApisRequest} message ListExternalApisRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListExternalApisRequest.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 ListExternalApisRequest to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.ListExternalApisRequest - * @instance - * @returns {Object.} JSON object - */ - ListExternalApisRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListExternalApisRequest - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.ListExternalApisRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListExternalApisRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.ListExternalApisRequest"; - }; - - return ListExternalApisRequest; - })(); - - v1.ListExternalApisResponse = (function() { - - /** - * Properties of a ListExternalApisResponse. - * @memberof google.cloud.apihub.v1 - * @interface IListExternalApisResponse - * @property {Array.|null} [externalApis] ListExternalApisResponse externalApis - * @property {string|null} [nextPageToken] ListExternalApisResponse nextPageToken - */ - - /** - * Constructs a new ListExternalApisResponse. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents a ListExternalApisResponse. - * @implements IListExternalApisResponse - * @constructor - * @param {google.cloud.apihub.v1.IListExternalApisResponse=} [properties] Properties to set - */ - function ListExternalApisResponse(properties) { - this.externalApis = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListExternalApisResponse externalApis. - * @member {Array.} externalApis - * @memberof google.cloud.apihub.v1.ListExternalApisResponse - * @instance - */ - ListExternalApisResponse.prototype.externalApis = $util.emptyArray; - - /** - * ListExternalApisResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.apihub.v1.ListExternalApisResponse - * @instance - */ - ListExternalApisResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListExternalApisResponse instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.ListExternalApisResponse - * @static - * @param {google.cloud.apihub.v1.IListExternalApisResponse=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.ListExternalApisResponse} ListExternalApisResponse instance - */ - ListExternalApisResponse.create = function create(properties) { - return new ListExternalApisResponse(properties); - }; - - /** - * Encodes the specified ListExternalApisResponse message. Does not implicitly {@link google.cloud.apihub.v1.ListExternalApisResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.ListExternalApisResponse - * @static - * @param {google.cloud.apihub.v1.IListExternalApisResponse} message ListExternalApisResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListExternalApisResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.externalApis != null && message.externalApis.length) - for (var i = 0; i < message.externalApis.length; ++i) - $root.google.cloud.apihub.v1.ExternalApi.encode(message.externalApis[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 ListExternalApisResponse message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListExternalApisResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.ListExternalApisResponse - * @static - * @param {google.cloud.apihub.v1.IListExternalApisResponse} message ListExternalApisResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListExternalApisResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListExternalApisResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.ListExternalApisResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.ListExternalApisResponse} ListExternalApisResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListExternalApisResponse.decode = function 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.apihub.v1.ListExternalApisResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.externalApis && message.externalApis.length)) - message.externalApis = []; - message.externalApis.push($root.google.cloud.apihub.v1.ExternalApi.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListExternalApisResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.ListExternalApisResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.ListExternalApisResponse} ListExternalApisResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListExternalApisResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListExternalApisResponse message. - * @function verify - * @memberof google.cloud.apihub.v1.ListExternalApisResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListExternalApisResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.externalApis != null && message.hasOwnProperty("externalApis")) { - if (!Array.isArray(message.externalApis)) - return "externalApis: array expected"; - for (var i = 0; i < message.externalApis.length; ++i) { - var error = $root.google.cloud.apihub.v1.ExternalApi.verify(message.externalApis[i]); - if (error) - return "externalApis." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListExternalApisResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.ListExternalApisResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.ListExternalApisResponse} ListExternalApisResponse - */ - ListExternalApisResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.ListExternalApisResponse) - return object; - var message = new $root.google.cloud.apihub.v1.ListExternalApisResponse(); - if (object.externalApis) { - if (!Array.isArray(object.externalApis)) - throw TypeError(".google.cloud.apihub.v1.ListExternalApisResponse.externalApis: array expected"); - message.externalApis = []; - for (var i = 0; i < object.externalApis.length; ++i) { - if (typeof object.externalApis[i] !== "object") - throw TypeError(".google.cloud.apihub.v1.ListExternalApisResponse.externalApis: object expected"); - message.externalApis[i] = $root.google.cloud.apihub.v1.ExternalApi.fromObject(object.externalApis[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListExternalApisResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.ListExternalApisResponse - * @static - * @param {google.cloud.apihub.v1.ListExternalApisResponse} message ListExternalApisResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListExternalApisResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.externalApis = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.externalApis && message.externalApis.length) { - object.externalApis = []; - for (var j = 0; j < message.externalApis.length; ++j) - object.externalApis[j] = $root.google.cloud.apihub.v1.ExternalApi.toObject(message.externalApis[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListExternalApisResponse to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.ListExternalApisResponse - * @instance - * @returns {Object.} JSON object - */ - ListExternalApisResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListExternalApisResponse - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.ListExternalApisResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListExternalApisResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.ListExternalApisResponse"; - }; - - return ListExternalApisResponse; - })(); - - /** - * LintState enum. - * @name google.cloud.apihub.v1.LintState - * @enum {number} - * @property {number} LINT_STATE_UNSPECIFIED=0 LINT_STATE_UNSPECIFIED value - * @property {number} LINT_STATE_SUCCESS=1 LINT_STATE_SUCCESS value - * @property {number} LINT_STATE_ERROR=2 LINT_STATE_ERROR value - */ - v1.LintState = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "LINT_STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "LINT_STATE_SUCCESS"] = 1; - values[valuesById[2] = "LINT_STATE_ERROR"] = 2; - return values; - })(); - - /** - * Linter enum. - * @name google.cloud.apihub.v1.Linter - * @enum {number} - * @property {number} LINTER_UNSPECIFIED=0 LINTER_UNSPECIFIED value - * @property {number} SPECTRAL=1 SPECTRAL value - * @property {number} OTHER=2 OTHER value - */ - v1.Linter = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "LINTER_UNSPECIFIED"] = 0; - values[valuesById[1] = "SPECTRAL"] = 1; - values[valuesById[2] = "OTHER"] = 2; - return values; - })(); - - /** - * Severity enum. - * @name google.cloud.apihub.v1.Severity - * @enum {number} - * @property {number} SEVERITY_UNSPECIFIED=0 SEVERITY_UNSPECIFIED value - * @property {number} SEVERITY_ERROR=1 SEVERITY_ERROR value - * @property {number} SEVERITY_WARNING=2 SEVERITY_WARNING value - * @property {number} SEVERITY_INFO=3 SEVERITY_INFO value - * @property {number} SEVERITY_HINT=4 SEVERITY_HINT value - */ - v1.Severity = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "SEVERITY_UNSPECIFIED"] = 0; - values[valuesById[1] = "SEVERITY_ERROR"] = 1; - values[valuesById[2] = "SEVERITY_WARNING"] = 2; - values[valuesById[3] = "SEVERITY_INFO"] = 3; - values[valuesById[4] = "SEVERITY_HINT"] = 4; - return values; - })(); - - v1.Api = (function() { - - /** - * Properties of an Api. - * @memberof google.cloud.apihub.v1 - * @interface IApi - * @property {string|null} [name] Api name - * @property {string|null} [displayName] Api displayName - * @property {string|null} [description] Api description - * @property {google.cloud.apihub.v1.IDocumentation|null} [documentation] Api documentation - * @property {google.cloud.apihub.v1.IOwner|null} [owner] Api owner - * @property {Array.|null} [versions] Api versions - * @property {google.protobuf.ITimestamp|null} [createTime] Api createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] Api updateTime - * @property {google.cloud.apihub.v1.IAttributeValues|null} [targetUser] Api targetUser - * @property {google.cloud.apihub.v1.IAttributeValues|null} [team] Api team - * @property {google.cloud.apihub.v1.IAttributeValues|null} [businessUnit] Api businessUnit - * @property {google.cloud.apihub.v1.IAttributeValues|null} [maturityLevel] Api maturityLevel - * @property {Object.|null} [attributes] Api attributes - * @property {google.cloud.apihub.v1.IAttributeValues|null} [apiStyle] Api apiStyle - * @property {string|null} [selectedVersion] Api selectedVersion - */ - - /** - * Constructs a new Api. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents an Api. - * @implements IApi - * @constructor - * @param {google.cloud.apihub.v1.IApi=} [properties] Properties to set - */ - function Api(properties) { - this.versions = []; - this.attributes = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Api name. - * @member {string} name - * @memberof google.cloud.apihub.v1.Api - * @instance - */ - Api.prototype.name = ""; - - /** - * Api displayName. - * @member {string} displayName - * @memberof google.cloud.apihub.v1.Api - * @instance - */ - Api.prototype.displayName = ""; - - /** - * Api description. - * @member {string} description - * @memberof google.cloud.apihub.v1.Api - * @instance - */ - Api.prototype.description = ""; - - /** - * Api documentation. - * @member {google.cloud.apihub.v1.IDocumentation|null|undefined} documentation - * @memberof google.cloud.apihub.v1.Api - * @instance - */ - Api.prototype.documentation = null; - - /** - * Api owner. - * @member {google.cloud.apihub.v1.IOwner|null|undefined} owner - * @memberof google.cloud.apihub.v1.Api - * @instance - */ - Api.prototype.owner = null; - - /** - * Api versions. - * @member {Array.} versions - * @memberof google.cloud.apihub.v1.Api - * @instance - */ - Api.prototype.versions = $util.emptyArray; - - /** - * Api createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.apihub.v1.Api - * @instance - */ - Api.prototype.createTime = null; - - /** - * Api updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.apihub.v1.Api - * @instance - */ - Api.prototype.updateTime = null; - - /** - * Api targetUser. - * @member {google.cloud.apihub.v1.IAttributeValues|null|undefined} targetUser - * @memberof google.cloud.apihub.v1.Api - * @instance - */ - Api.prototype.targetUser = null; - - /** - * Api team. - * @member {google.cloud.apihub.v1.IAttributeValues|null|undefined} team - * @memberof google.cloud.apihub.v1.Api - * @instance - */ - Api.prototype.team = null; - - /** - * Api businessUnit. - * @member {google.cloud.apihub.v1.IAttributeValues|null|undefined} businessUnit - * @memberof google.cloud.apihub.v1.Api - * @instance - */ - Api.prototype.businessUnit = null; - - /** - * Api maturityLevel. - * @member {google.cloud.apihub.v1.IAttributeValues|null|undefined} maturityLevel - * @memberof google.cloud.apihub.v1.Api - * @instance - */ - Api.prototype.maturityLevel = null; - - /** - * Api attributes. - * @member {Object.} attributes - * @memberof google.cloud.apihub.v1.Api - * @instance - */ - Api.prototype.attributes = $util.emptyObject; - - /** - * Api apiStyle. - * @member {google.cloud.apihub.v1.IAttributeValues|null|undefined} apiStyle - * @memberof google.cloud.apihub.v1.Api - * @instance - */ - Api.prototype.apiStyle = null; - - /** - * Api selectedVersion. - * @member {string} selectedVersion - * @memberof google.cloud.apihub.v1.Api - * @instance - */ - Api.prototype.selectedVersion = ""; - - /** - * Creates a new Api instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.Api - * @static - * @param {google.cloud.apihub.v1.IApi=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.Api} Api instance - */ - Api.create = function create(properties) { - return new Api(properties); - }; - - /** - * Encodes the specified Api message. Does not implicitly {@link google.cloud.apihub.v1.Api.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.Api - * @static - * @param {google.cloud.apihub.v1.IApi} message Api message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Api.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); - if (message.documentation != null && Object.hasOwnProperty.call(message, "documentation")) - $root.google.cloud.apihub.v1.Documentation.encode(message.documentation, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.owner != null && Object.hasOwnProperty.call(message, "owner")) - $root.google.cloud.apihub.v1.Owner.encode(message.owner, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.versions != null && message.versions.length) - for (var i = 0; i < message.versions.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.versions[i]); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.targetUser != null && Object.hasOwnProperty.call(message, "targetUser")) - $root.google.cloud.apihub.v1.AttributeValues.encode(message.targetUser, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.team != null && Object.hasOwnProperty.call(message, "team")) - $root.google.cloud.apihub.v1.AttributeValues.encode(message.team, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.businessUnit != null && Object.hasOwnProperty.call(message, "businessUnit")) - $root.google.cloud.apihub.v1.AttributeValues.encode(message.businessUnit, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.maturityLevel != null && Object.hasOwnProperty.call(message, "maturityLevel")) - $root.google.cloud.apihub.v1.AttributeValues.encode(message.maturityLevel, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - if (message.attributes != null && Object.hasOwnProperty.call(message, "attributes")) - for (var keys = Object.keys(message.attributes), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 13, wireType 2 =*/106).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.cloud.apihub.v1.AttributeValues.encode(message.attributes[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - if (message.apiStyle != null && Object.hasOwnProperty.call(message, "apiStyle")) - $root.google.cloud.apihub.v1.AttributeValues.encode(message.apiStyle, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); - if (message.selectedVersion != null && Object.hasOwnProperty.call(message, "selectedVersion")) - writer.uint32(/* id 15, wireType 2 =*/122).string(message.selectedVersion); - return writer; - }; - - /** - * Encodes the specified Api message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.Api.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.Api - * @static - * @param {google.cloud.apihub.v1.IApi} message Api message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Api.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Api message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.Api - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.Api} Api - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Api.decode = function 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.apihub.v1.Api(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.displayName = reader.string(); - break; - } - case 3: { - message.description = reader.string(); - break; - } - case 4: { - message.documentation = $root.google.cloud.apihub.v1.Documentation.decode(reader, reader.uint32()); - break; - } - case 5: { - message.owner = $root.google.cloud.apihub.v1.Owner.decode(reader, reader.uint32()); - break; - } - case 6: { - if (!(message.versions && message.versions.length)) - message.versions = []; - message.versions.push(reader.string()); - break; - } - case 7: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 8: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 9: { - message.targetUser = $root.google.cloud.apihub.v1.AttributeValues.decode(reader, reader.uint32()); - break; - } - case 10: { - message.team = $root.google.cloud.apihub.v1.AttributeValues.decode(reader, reader.uint32()); - break; - } - case 11: { - message.businessUnit = $root.google.cloud.apihub.v1.AttributeValues.decode(reader, reader.uint32()); - break; - } - case 12: { - message.maturityLevel = $root.google.cloud.apihub.v1.AttributeValues.decode(reader, reader.uint32()); - break; - } - case 13: { - if (message.attributes === $util.emptyObject) - message.attributes = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = null; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = $root.google.cloud.apihub.v1.AttributeValues.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.attributes[key] = value; - break; - } - case 14: { - message.apiStyle = $root.google.cloud.apihub.v1.AttributeValues.decode(reader, reader.uint32()); - break; - } - case 15: { - message.selectedVersion = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Api message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.Api - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.Api} Api - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Api.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Api message. - * @function verify - * @memberof google.cloud.apihub.v1.Api - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Api.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.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.documentation != null && message.hasOwnProperty("documentation")) { - var error = $root.google.cloud.apihub.v1.Documentation.verify(message.documentation); - if (error) - return "documentation." + error; - } - if (message.owner != null && message.hasOwnProperty("owner")) { - var error = $root.google.cloud.apihub.v1.Owner.verify(message.owner); - if (error) - return "owner." + error; - } - if (message.versions != null && message.hasOwnProperty("versions")) { - if (!Array.isArray(message.versions)) - return "versions: array expected"; - for (var i = 0; i < message.versions.length; ++i) - if (!$util.isString(message.versions[i])) - return "versions: 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.targetUser != null && message.hasOwnProperty("targetUser")) { - var error = $root.google.cloud.apihub.v1.AttributeValues.verify(message.targetUser); - if (error) - return "targetUser." + error; - } - if (message.team != null && message.hasOwnProperty("team")) { - var error = $root.google.cloud.apihub.v1.AttributeValues.verify(message.team); - if (error) - return "team." + error; - } - if (message.businessUnit != null && message.hasOwnProperty("businessUnit")) { - var error = $root.google.cloud.apihub.v1.AttributeValues.verify(message.businessUnit); - if (error) - return "businessUnit." + error; - } - if (message.maturityLevel != null && message.hasOwnProperty("maturityLevel")) { - var error = $root.google.cloud.apihub.v1.AttributeValues.verify(message.maturityLevel); - if (error) - return "maturityLevel." + error; - } - if (message.attributes != null && message.hasOwnProperty("attributes")) { - if (!$util.isObject(message.attributes)) - return "attributes: object expected"; - var key = Object.keys(message.attributes); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.cloud.apihub.v1.AttributeValues.verify(message.attributes[key[i]]); - if (error) - return "attributes." + error; - } - } - if (message.apiStyle != null && message.hasOwnProperty("apiStyle")) { - var error = $root.google.cloud.apihub.v1.AttributeValues.verify(message.apiStyle); - if (error) - return "apiStyle." + error; - } - if (message.selectedVersion != null && message.hasOwnProperty("selectedVersion")) - if (!$util.isString(message.selectedVersion)) - return "selectedVersion: string expected"; - return null; - }; - - /** - * Creates an Api message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.Api - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.Api} Api - */ - Api.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.Api) - return object; - var message = new $root.google.cloud.apihub.v1.Api(); - if (object.name != null) - message.name = String(object.name); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.description != null) - message.description = String(object.description); - if (object.documentation != null) { - if (typeof object.documentation !== "object") - throw TypeError(".google.cloud.apihub.v1.Api.documentation: object expected"); - message.documentation = $root.google.cloud.apihub.v1.Documentation.fromObject(object.documentation); - } - if (object.owner != null) { - if (typeof object.owner !== "object") - throw TypeError(".google.cloud.apihub.v1.Api.owner: object expected"); - message.owner = $root.google.cloud.apihub.v1.Owner.fromObject(object.owner); - } - if (object.versions) { - if (!Array.isArray(object.versions)) - throw TypeError(".google.cloud.apihub.v1.Api.versions: array expected"); - message.versions = []; - for (var i = 0; i < object.versions.length; ++i) - message.versions[i] = String(object.versions[i]); - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.apihub.v1.Api.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.apihub.v1.Api.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.targetUser != null) { - if (typeof object.targetUser !== "object") - throw TypeError(".google.cloud.apihub.v1.Api.targetUser: object expected"); - message.targetUser = $root.google.cloud.apihub.v1.AttributeValues.fromObject(object.targetUser); - } - if (object.team != null) { - if (typeof object.team !== "object") - throw TypeError(".google.cloud.apihub.v1.Api.team: object expected"); - message.team = $root.google.cloud.apihub.v1.AttributeValues.fromObject(object.team); - } - if (object.businessUnit != null) { - if (typeof object.businessUnit !== "object") - throw TypeError(".google.cloud.apihub.v1.Api.businessUnit: object expected"); - message.businessUnit = $root.google.cloud.apihub.v1.AttributeValues.fromObject(object.businessUnit); - } - if (object.maturityLevel != null) { - if (typeof object.maturityLevel !== "object") - throw TypeError(".google.cloud.apihub.v1.Api.maturityLevel: object expected"); - message.maturityLevel = $root.google.cloud.apihub.v1.AttributeValues.fromObject(object.maturityLevel); - } - if (object.attributes) { - if (typeof object.attributes !== "object") - throw TypeError(".google.cloud.apihub.v1.Api.attributes: object expected"); - message.attributes = {}; - for (var keys = Object.keys(object.attributes), i = 0; i < keys.length; ++i) { - if (typeof object.attributes[keys[i]] !== "object") - throw TypeError(".google.cloud.apihub.v1.Api.attributes: object expected"); - message.attributes[keys[i]] = $root.google.cloud.apihub.v1.AttributeValues.fromObject(object.attributes[keys[i]]); - } - } - if (object.apiStyle != null) { - if (typeof object.apiStyle !== "object") - throw TypeError(".google.cloud.apihub.v1.Api.apiStyle: object expected"); - message.apiStyle = $root.google.cloud.apihub.v1.AttributeValues.fromObject(object.apiStyle); - } - if (object.selectedVersion != null) - message.selectedVersion = String(object.selectedVersion); - return message; - }; - - /** - * Creates a plain object from an Api message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.Api - * @static - * @param {google.cloud.apihub.v1.Api} message Api - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Api.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.versions = []; - if (options.objects || options.defaults) - object.attributes = {}; - if (options.defaults) { - object.name = ""; - object.displayName = ""; - object.description = ""; - object.documentation = null; - object.owner = null; - object.createTime = null; - object.updateTime = null; - object.targetUser = null; - object.team = null; - object.businessUnit = null; - object.maturityLevel = null; - object.apiStyle = null; - object.selectedVersion = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.documentation != null && message.hasOwnProperty("documentation")) - object.documentation = $root.google.cloud.apihub.v1.Documentation.toObject(message.documentation, options); - if (message.owner != null && message.hasOwnProperty("owner")) - object.owner = $root.google.cloud.apihub.v1.Owner.toObject(message.owner, options); - if (message.versions && message.versions.length) { - object.versions = []; - for (var j = 0; j < message.versions.length; ++j) - object.versions[j] = message.versions[j]; - } - 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); - if (message.targetUser != null && message.hasOwnProperty("targetUser")) - object.targetUser = $root.google.cloud.apihub.v1.AttributeValues.toObject(message.targetUser, options); - if (message.team != null && message.hasOwnProperty("team")) - object.team = $root.google.cloud.apihub.v1.AttributeValues.toObject(message.team, options); - if (message.businessUnit != null && message.hasOwnProperty("businessUnit")) - object.businessUnit = $root.google.cloud.apihub.v1.AttributeValues.toObject(message.businessUnit, options); - if (message.maturityLevel != null && message.hasOwnProperty("maturityLevel")) - object.maturityLevel = $root.google.cloud.apihub.v1.AttributeValues.toObject(message.maturityLevel, options); - var keys2; - if (message.attributes && (keys2 = Object.keys(message.attributes)).length) { - object.attributes = {}; - for (var j = 0; j < keys2.length; ++j) - object.attributes[keys2[j]] = $root.google.cloud.apihub.v1.AttributeValues.toObject(message.attributes[keys2[j]], options); - } - if (message.apiStyle != null && message.hasOwnProperty("apiStyle")) - object.apiStyle = $root.google.cloud.apihub.v1.AttributeValues.toObject(message.apiStyle, options); - if (message.selectedVersion != null && message.hasOwnProperty("selectedVersion")) - object.selectedVersion = message.selectedVersion; - return object; - }; - - /** - * Converts this Api to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.Api - * @instance - * @returns {Object.} JSON object - */ - Api.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Api - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.Api - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Api.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.Api"; - }; - - return Api; - })(); - - v1.Version = (function() { - - /** - * Properties of a Version. - * @memberof google.cloud.apihub.v1 - * @interface IVersion - * @property {string|null} [name] Version name - * @property {string|null} [displayName] Version displayName - * @property {string|null} [description] Version description - * @property {google.cloud.apihub.v1.IDocumentation|null} [documentation] Version documentation - * @property {Array.|null} [specs] Version specs - * @property {Array.|null} [apiOperations] Version apiOperations - * @property {Array.|null} [definitions] Version definitions - * @property {Array.|null} [deployments] Version deployments - * @property {google.protobuf.ITimestamp|null} [createTime] Version createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] Version updateTime - * @property {google.cloud.apihub.v1.IAttributeValues|null} [lifecycle] Version lifecycle - * @property {google.cloud.apihub.v1.IAttributeValues|null} [compliance] Version compliance - * @property {google.cloud.apihub.v1.IAttributeValues|null} [accreditation] Version accreditation - * @property {Object.|null} [attributes] Version attributes - * @property {string|null} [selectedDeployment] Version selectedDeployment - */ - - /** - * Constructs a new Version. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents a Version. - * @implements IVersion - * @constructor - * @param {google.cloud.apihub.v1.IVersion=} [properties] Properties to set - */ - function Version(properties) { - this.specs = []; - this.apiOperations = []; - this.definitions = []; - this.deployments = []; - this.attributes = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Version name. - * @member {string} name - * @memberof google.cloud.apihub.v1.Version - * @instance - */ - Version.prototype.name = ""; - - /** - * Version displayName. - * @member {string} displayName - * @memberof google.cloud.apihub.v1.Version - * @instance - */ - Version.prototype.displayName = ""; - - /** - * Version description. - * @member {string} description - * @memberof google.cloud.apihub.v1.Version - * @instance - */ - Version.prototype.description = ""; - - /** - * Version documentation. - * @member {google.cloud.apihub.v1.IDocumentation|null|undefined} documentation - * @memberof google.cloud.apihub.v1.Version - * @instance - */ - Version.prototype.documentation = null; - - /** - * Version specs. - * @member {Array.} specs - * @memberof google.cloud.apihub.v1.Version - * @instance - */ - Version.prototype.specs = $util.emptyArray; - - /** - * Version apiOperations. - * @member {Array.} apiOperations - * @memberof google.cloud.apihub.v1.Version - * @instance - */ - Version.prototype.apiOperations = $util.emptyArray; - - /** - * Version definitions. - * @member {Array.} definitions - * @memberof google.cloud.apihub.v1.Version - * @instance - */ - Version.prototype.definitions = $util.emptyArray; - - /** - * Version deployments. - * @member {Array.} deployments - * @memberof google.cloud.apihub.v1.Version - * @instance - */ - Version.prototype.deployments = $util.emptyArray; - - /** - * Version createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.apihub.v1.Version - * @instance - */ - Version.prototype.createTime = null; - - /** - * Version updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.apihub.v1.Version - * @instance - */ - Version.prototype.updateTime = null; - - /** - * Version lifecycle. - * @member {google.cloud.apihub.v1.IAttributeValues|null|undefined} lifecycle - * @memberof google.cloud.apihub.v1.Version - * @instance - */ - Version.prototype.lifecycle = null; - - /** - * Version compliance. - * @member {google.cloud.apihub.v1.IAttributeValues|null|undefined} compliance - * @memberof google.cloud.apihub.v1.Version - * @instance - */ - Version.prototype.compliance = null; - - /** - * Version accreditation. - * @member {google.cloud.apihub.v1.IAttributeValues|null|undefined} accreditation - * @memberof google.cloud.apihub.v1.Version - * @instance - */ - Version.prototype.accreditation = null; - - /** - * Version attributes. - * @member {Object.} attributes - * @memberof google.cloud.apihub.v1.Version - * @instance - */ - Version.prototype.attributes = $util.emptyObject; - - /** - * Version selectedDeployment. - * @member {string} selectedDeployment - * @memberof google.cloud.apihub.v1.Version - * @instance - */ - Version.prototype.selectedDeployment = ""; - - /** - * Creates a new Version instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.Version - * @static - * @param {google.cloud.apihub.v1.IVersion=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.Version} Version instance - */ - Version.create = function create(properties) { - return new Version(properties); - }; - - /** - * Encodes the specified Version message. Does not implicitly {@link google.cloud.apihub.v1.Version.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.Version - * @static - * @param {google.cloud.apihub.v1.IVersion} message Version message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Version.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); - if (message.documentation != null && Object.hasOwnProperty.call(message, "documentation")) - $root.google.cloud.apihub.v1.Documentation.encode(message.documentation, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.specs != null && message.specs.length) - for (var i = 0; i < message.specs.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.specs[i]); - if (message.apiOperations != null && message.apiOperations.length) - for (var i = 0; i < message.apiOperations.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.apiOperations[i]); - if (message.definitions != null && message.definitions.length) - for (var i = 0; i < message.definitions.length; ++i) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.definitions[i]); - if (message.deployments != null && message.deployments.length) - for (var i = 0; i < message.deployments.length; ++i) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.deployments[i]); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.lifecycle != null && Object.hasOwnProperty.call(message, "lifecycle")) - $root.google.cloud.apihub.v1.AttributeValues.encode(message.lifecycle, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.compliance != null && Object.hasOwnProperty.call(message, "compliance")) - $root.google.cloud.apihub.v1.AttributeValues.encode(message.compliance, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - if (message.accreditation != null && Object.hasOwnProperty.call(message, "accreditation")) - $root.google.cloud.apihub.v1.AttributeValues.encode(message.accreditation, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); - if (message.attributes != null && Object.hasOwnProperty.call(message, "attributes")) - for (var keys = Object.keys(message.attributes), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 14, wireType 2 =*/114).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.cloud.apihub.v1.AttributeValues.encode(message.attributes[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - if (message.selectedDeployment != null && Object.hasOwnProperty.call(message, "selectedDeployment")) - writer.uint32(/* id 16, wireType 2 =*/130).string(message.selectedDeployment); - return writer; - }; - - /** - * Encodes the specified Version message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.Version.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.Version - * @static - * @param {google.cloud.apihub.v1.IVersion} message Version message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Version.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Version message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.Version - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.Version} Version - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Version.decode = function 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.apihub.v1.Version(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.displayName = reader.string(); - break; - } - case 3: { - message.description = reader.string(); - break; - } - case 4: { - message.documentation = $root.google.cloud.apihub.v1.Documentation.decode(reader, reader.uint32()); - break; - } - case 5: { - if (!(message.specs && message.specs.length)) - message.specs = []; - message.specs.push(reader.string()); - break; - } - case 6: { - if (!(message.apiOperations && message.apiOperations.length)) - message.apiOperations = []; - message.apiOperations.push(reader.string()); - break; - } - case 7: { - if (!(message.definitions && message.definitions.length)) - message.definitions = []; - message.definitions.push(reader.string()); - break; - } - case 8: { - if (!(message.deployments && message.deployments.length)) - message.deployments = []; - message.deployments.push(reader.string()); - break; - } - case 9: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 10: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 11: { - message.lifecycle = $root.google.cloud.apihub.v1.AttributeValues.decode(reader, reader.uint32()); - break; - } - case 12: { - message.compliance = $root.google.cloud.apihub.v1.AttributeValues.decode(reader, reader.uint32()); - break; - } - case 13: { - message.accreditation = $root.google.cloud.apihub.v1.AttributeValues.decode(reader, reader.uint32()); - break; - } - case 14: { - if (message.attributes === $util.emptyObject) - message.attributes = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = null; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = $root.google.cloud.apihub.v1.AttributeValues.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.attributes[key] = value; - break; - } - case 16: { - message.selectedDeployment = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Version message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.Version - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.Version} Version - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Version.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Version message. - * @function verify - * @memberof google.cloud.apihub.v1.Version - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Version.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.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.documentation != null && message.hasOwnProperty("documentation")) { - var error = $root.google.cloud.apihub.v1.Documentation.verify(message.documentation); - if (error) - return "documentation." + error; - } - if (message.specs != null && message.hasOwnProperty("specs")) { - if (!Array.isArray(message.specs)) - return "specs: array expected"; - for (var i = 0; i < message.specs.length; ++i) - if (!$util.isString(message.specs[i])) - return "specs: string[] expected"; - } - if (message.apiOperations != null && message.hasOwnProperty("apiOperations")) { - if (!Array.isArray(message.apiOperations)) - return "apiOperations: array expected"; - for (var i = 0; i < message.apiOperations.length; ++i) - if (!$util.isString(message.apiOperations[i])) - return "apiOperations: string[] expected"; - } - if (message.definitions != null && message.hasOwnProperty("definitions")) { - if (!Array.isArray(message.definitions)) - return "definitions: array expected"; - for (var i = 0; i < message.definitions.length; ++i) - if (!$util.isString(message.definitions[i])) - return "definitions: string[] expected"; - } - if (message.deployments != null && message.hasOwnProperty("deployments")) { - if (!Array.isArray(message.deployments)) - return "deployments: array expected"; - for (var i = 0; i < message.deployments.length; ++i) - if (!$util.isString(message.deployments[i])) - return "deployments: 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.lifecycle != null && message.hasOwnProperty("lifecycle")) { - var error = $root.google.cloud.apihub.v1.AttributeValues.verify(message.lifecycle); - if (error) - return "lifecycle." + error; - } - if (message.compliance != null && message.hasOwnProperty("compliance")) { - var error = $root.google.cloud.apihub.v1.AttributeValues.verify(message.compliance); - if (error) - return "compliance." + error; - } - if (message.accreditation != null && message.hasOwnProperty("accreditation")) { - var error = $root.google.cloud.apihub.v1.AttributeValues.verify(message.accreditation); - if (error) - return "accreditation." + error; - } - if (message.attributes != null && message.hasOwnProperty("attributes")) { - if (!$util.isObject(message.attributes)) - return "attributes: object expected"; - var key = Object.keys(message.attributes); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.cloud.apihub.v1.AttributeValues.verify(message.attributes[key[i]]); - if (error) - return "attributes." + error; - } - } - if (message.selectedDeployment != null && message.hasOwnProperty("selectedDeployment")) - if (!$util.isString(message.selectedDeployment)) - return "selectedDeployment: string expected"; - return null; - }; - - /** - * Creates a Version message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.Version - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.Version} Version - */ - Version.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.Version) - return object; - var message = new $root.google.cloud.apihub.v1.Version(); - if (object.name != null) - message.name = String(object.name); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.description != null) - message.description = String(object.description); - if (object.documentation != null) { - if (typeof object.documentation !== "object") - throw TypeError(".google.cloud.apihub.v1.Version.documentation: object expected"); - message.documentation = $root.google.cloud.apihub.v1.Documentation.fromObject(object.documentation); - } - if (object.specs) { - if (!Array.isArray(object.specs)) - throw TypeError(".google.cloud.apihub.v1.Version.specs: array expected"); - message.specs = []; - for (var i = 0; i < object.specs.length; ++i) - message.specs[i] = String(object.specs[i]); - } - if (object.apiOperations) { - if (!Array.isArray(object.apiOperations)) - throw TypeError(".google.cloud.apihub.v1.Version.apiOperations: array expected"); - message.apiOperations = []; - for (var i = 0; i < object.apiOperations.length; ++i) - message.apiOperations[i] = String(object.apiOperations[i]); - } - if (object.definitions) { - if (!Array.isArray(object.definitions)) - throw TypeError(".google.cloud.apihub.v1.Version.definitions: array expected"); - message.definitions = []; - for (var i = 0; i < object.definitions.length; ++i) - message.definitions[i] = String(object.definitions[i]); - } - if (object.deployments) { - if (!Array.isArray(object.deployments)) - throw TypeError(".google.cloud.apihub.v1.Version.deployments: array expected"); - message.deployments = []; - for (var i = 0; i < object.deployments.length; ++i) - message.deployments[i] = String(object.deployments[i]); - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.apihub.v1.Version.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.apihub.v1.Version.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.lifecycle != null) { - if (typeof object.lifecycle !== "object") - throw TypeError(".google.cloud.apihub.v1.Version.lifecycle: object expected"); - message.lifecycle = $root.google.cloud.apihub.v1.AttributeValues.fromObject(object.lifecycle); - } - if (object.compliance != null) { - if (typeof object.compliance !== "object") - throw TypeError(".google.cloud.apihub.v1.Version.compliance: object expected"); - message.compliance = $root.google.cloud.apihub.v1.AttributeValues.fromObject(object.compliance); - } - if (object.accreditation != null) { - if (typeof object.accreditation !== "object") - throw TypeError(".google.cloud.apihub.v1.Version.accreditation: object expected"); - message.accreditation = $root.google.cloud.apihub.v1.AttributeValues.fromObject(object.accreditation); - } - if (object.attributes) { - if (typeof object.attributes !== "object") - throw TypeError(".google.cloud.apihub.v1.Version.attributes: object expected"); - message.attributes = {}; - for (var keys = Object.keys(object.attributes), i = 0; i < keys.length; ++i) { - if (typeof object.attributes[keys[i]] !== "object") - throw TypeError(".google.cloud.apihub.v1.Version.attributes: object expected"); - message.attributes[keys[i]] = $root.google.cloud.apihub.v1.AttributeValues.fromObject(object.attributes[keys[i]]); - } - } - if (object.selectedDeployment != null) - message.selectedDeployment = String(object.selectedDeployment); - return message; - }; - - /** - * Creates a plain object from a Version message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.Version - * @static - * @param {google.cloud.apihub.v1.Version} message Version - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Version.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.specs = []; - object.apiOperations = []; - object.definitions = []; - object.deployments = []; - } - if (options.objects || options.defaults) - object.attributes = {}; - if (options.defaults) { - object.name = ""; - object.displayName = ""; - object.description = ""; - object.documentation = null; - object.createTime = null; - object.updateTime = null; - object.lifecycle = null; - object.compliance = null; - object.accreditation = null; - object.selectedDeployment = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.documentation != null && message.hasOwnProperty("documentation")) - object.documentation = $root.google.cloud.apihub.v1.Documentation.toObject(message.documentation, options); - if (message.specs && message.specs.length) { - object.specs = []; - for (var j = 0; j < message.specs.length; ++j) - object.specs[j] = message.specs[j]; - } - if (message.apiOperations && message.apiOperations.length) { - object.apiOperations = []; - for (var j = 0; j < message.apiOperations.length; ++j) - object.apiOperations[j] = message.apiOperations[j]; - } - if (message.definitions && message.definitions.length) { - object.definitions = []; - for (var j = 0; j < message.definitions.length; ++j) - object.definitions[j] = message.definitions[j]; - } - if (message.deployments && message.deployments.length) { - object.deployments = []; - for (var j = 0; j < message.deployments.length; ++j) - object.deployments[j] = message.deployments[j]; - } - 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); - if (message.lifecycle != null && message.hasOwnProperty("lifecycle")) - object.lifecycle = $root.google.cloud.apihub.v1.AttributeValues.toObject(message.lifecycle, options); - if (message.compliance != null && message.hasOwnProperty("compliance")) - object.compliance = $root.google.cloud.apihub.v1.AttributeValues.toObject(message.compliance, options); - if (message.accreditation != null && message.hasOwnProperty("accreditation")) - object.accreditation = $root.google.cloud.apihub.v1.AttributeValues.toObject(message.accreditation, options); - var keys2; - if (message.attributes && (keys2 = Object.keys(message.attributes)).length) { - object.attributes = {}; - for (var j = 0; j < keys2.length; ++j) - object.attributes[keys2[j]] = $root.google.cloud.apihub.v1.AttributeValues.toObject(message.attributes[keys2[j]], options); - } - if (message.selectedDeployment != null && message.hasOwnProperty("selectedDeployment")) - object.selectedDeployment = message.selectedDeployment; - return object; - }; - - /** - * Converts this Version to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.Version - * @instance - * @returns {Object.} JSON object - */ - Version.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Version - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.Version - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Version.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.Version"; - }; - - return Version; - })(); - - v1.Spec = (function() { - - /** - * Properties of a Spec. - * @memberof google.cloud.apihub.v1 - * @interface ISpec - * @property {string|null} [name] Spec name - * @property {string|null} [displayName] Spec displayName - * @property {google.cloud.apihub.v1.IAttributeValues|null} [specType] Spec specType - * @property {google.cloud.apihub.v1.ISpecContents|null} [contents] Spec contents - * @property {google.cloud.apihub.v1.ISpecDetails|null} [details] Spec details - * @property {string|null} [sourceUri] Spec sourceUri - * @property {google.protobuf.ITimestamp|null} [createTime] Spec createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] Spec updateTime - * @property {google.cloud.apihub.v1.ILintResponse|null} [lintResponse] Spec lintResponse - * @property {Object.|null} [attributes] Spec attributes - * @property {google.cloud.apihub.v1.IDocumentation|null} [documentation] Spec documentation - * @property {google.cloud.apihub.v1.Spec.ParsingMode|null} [parsingMode] Spec parsingMode - */ - - /** - * Constructs a new Spec. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents a Spec. - * @implements ISpec - * @constructor - * @param {google.cloud.apihub.v1.ISpec=} [properties] Properties to set - */ - function Spec(properties) { - this.attributes = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Spec name. - * @member {string} name - * @memberof google.cloud.apihub.v1.Spec - * @instance - */ - Spec.prototype.name = ""; - - /** - * Spec displayName. - * @member {string} displayName - * @memberof google.cloud.apihub.v1.Spec - * @instance - */ - Spec.prototype.displayName = ""; - - /** - * Spec specType. - * @member {google.cloud.apihub.v1.IAttributeValues|null|undefined} specType - * @memberof google.cloud.apihub.v1.Spec - * @instance - */ - Spec.prototype.specType = null; - - /** - * Spec contents. - * @member {google.cloud.apihub.v1.ISpecContents|null|undefined} contents - * @memberof google.cloud.apihub.v1.Spec - * @instance - */ - Spec.prototype.contents = null; - - /** - * Spec details. - * @member {google.cloud.apihub.v1.ISpecDetails|null|undefined} details - * @memberof google.cloud.apihub.v1.Spec - * @instance - */ - Spec.prototype.details = null; - - /** - * Spec sourceUri. - * @member {string} sourceUri - * @memberof google.cloud.apihub.v1.Spec - * @instance - */ - Spec.prototype.sourceUri = ""; - - /** - * Spec createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.apihub.v1.Spec - * @instance - */ - Spec.prototype.createTime = null; - - /** - * Spec updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.apihub.v1.Spec - * @instance - */ - Spec.prototype.updateTime = null; - - /** - * Spec lintResponse. - * @member {google.cloud.apihub.v1.ILintResponse|null|undefined} lintResponse - * @memberof google.cloud.apihub.v1.Spec - * @instance - */ - Spec.prototype.lintResponse = null; - - /** - * Spec attributes. - * @member {Object.} attributes - * @memberof google.cloud.apihub.v1.Spec - * @instance - */ - Spec.prototype.attributes = $util.emptyObject; - - /** - * Spec documentation. - * @member {google.cloud.apihub.v1.IDocumentation|null|undefined} documentation - * @memberof google.cloud.apihub.v1.Spec - * @instance - */ - Spec.prototype.documentation = null; - - /** - * Spec parsingMode. - * @member {google.cloud.apihub.v1.Spec.ParsingMode} parsingMode - * @memberof google.cloud.apihub.v1.Spec - * @instance - */ - Spec.prototype.parsingMode = 0; - - /** - * Creates a new Spec instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.Spec - * @static - * @param {google.cloud.apihub.v1.ISpec=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.Spec} Spec instance - */ - Spec.create = function create(properties) { - return new Spec(properties); - }; - - /** - * Encodes the specified Spec message. Does not implicitly {@link google.cloud.apihub.v1.Spec.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.Spec - * @static - * @param {google.cloud.apihub.v1.ISpec} message Spec message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Spec.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); - if (message.specType != null && Object.hasOwnProperty.call(message, "specType")) - $root.google.cloud.apihub.v1.AttributeValues.encode(message.specType, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.contents != null && Object.hasOwnProperty.call(message, "contents")) - $root.google.cloud.apihub.v1.SpecContents.encode(message.contents, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.details != null && Object.hasOwnProperty.call(message, "details")) - $root.google.cloud.apihub.v1.SpecDetails.encode(message.details, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.sourceUri != null && Object.hasOwnProperty.call(message, "sourceUri")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.sourceUri); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.lintResponse != null && Object.hasOwnProperty.call(message, "lintResponse")) - $root.google.cloud.apihub.v1.LintResponse.encode(message.lintResponse, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.attributes != null && Object.hasOwnProperty.call(message, "attributes")) - for (var keys = Object.keys(message.attributes), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 10, wireType 2 =*/82).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.cloud.apihub.v1.AttributeValues.encode(message.attributes[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - if (message.documentation != null && Object.hasOwnProperty.call(message, "documentation")) - $root.google.cloud.apihub.v1.Documentation.encode(message.documentation, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.parsingMode != null && Object.hasOwnProperty.call(message, "parsingMode")) - writer.uint32(/* id 12, wireType 0 =*/96).int32(message.parsingMode); - return writer; - }; - - /** - * Encodes the specified Spec message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.Spec.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.Spec - * @static - * @param {google.cloud.apihub.v1.ISpec} message Spec message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Spec.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Spec message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.Spec - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.Spec} Spec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Spec.decode = function 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.apihub.v1.Spec(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.displayName = reader.string(); - break; - } - case 3: { - message.specType = $root.google.cloud.apihub.v1.AttributeValues.decode(reader, reader.uint32()); - break; - } - case 4: { - message.contents = $root.google.cloud.apihub.v1.SpecContents.decode(reader, reader.uint32()); - break; - } - case 5: { - message.details = $root.google.cloud.apihub.v1.SpecDetails.decode(reader, reader.uint32()); - break; - } - case 6: { - message.sourceUri = reader.string(); - break; - } - case 7: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 8: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 9: { - message.lintResponse = $root.google.cloud.apihub.v1.LintResponse.decode(reader, reader.uint32()); - break; - } - case 10: { - if (message.attributes === $util.emptyObject) - message.attributes = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = null; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = $root.google.cloud.apihub.v1.AttributeValues.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.attributes[key] = value; - break; - } - case 11: { - message.documentation = $root.google.cloud.apihub.v1.Documentation.decode(reader, reader.uint32()); - break; - } - case 12: { - message.parsingMode = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Spec message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.Spec - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.Spec} Spec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Spec.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Spec message. - * @function verify - * @memberof google.cloud.apihub.v1.Spec - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Spec.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.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - if (message.specType != null && message.hasOwnProperty("specType")) { - var error = $root.google.cloud.apihub.v1.AttributeValues.verify(message.specType); - if (error) - return "specType." + error; - } - if (message.contents != null && message.hasOwnProperty("contents")) { - var error = $root.google.cloud.apihub.v1.SpecContents.verify(message.contents); - if (error) - return "contents." + error; - } - if (message.details != null && message.hasOwnProperty("details")) { - var error = $root.google.cloud.apihub.v1.SpecDetails.verify(message.details); - if (error) - return "details." + error; - } - if (message.sourceUri != null && message.hasOwnProperty("sourceUri")) - if (!$util.isString(message.sourceUri)) - return "sourceUri: 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.lintResponse != null && message.hasOwnProperty("lintResponse")) { - var error = $root.google.cloud.apihub.v1.LintResponse.verify(message.lintResponse); - if (error) - return "lintResponse." + error; - } - if (message.attributes != null && message.hasOwnProperty("attributes")) { - if (!$util.isObject(message.attributes)) - return "attributes: object expected"; - var key = Object.keys(message.attributes); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.cloud.apihub.v1.AttributeValues.verify(message.attributes[key[i]]); - if (error) - return "attributes." + error; - } - } - if (message.documentation != null && message.hasOwnProperty("documentation")) { - var error = $root.google.cloud.apihub.v1.Documentation.verify(message.documentation); - if (error) - return "documentation." + error; - } - if (message.parsingMode != null && message.hasOwnProperty("parsingMode")) - switch (message.parsingMode) { - default: - return "parsingMode: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates a Spec message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.Spec - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.Spec} Spec - */ - Spec.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.Spec) - return object; - var message = new $root.google.cloud.apihub.v1.Spec(); - if (object.name != null) - message.name = String(object.name); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.specType != null) { - if (typeof object.specType !== "object") - throw TypeError(".google.cloud.apihub.v1.Spec.specType: object expected"); - message.specType = $root.google.cloud.apihub.v1.AttributeValues.fromObject(object.specType); - } - if (object.contents != null) { - if (typeof object.contents !== "object") - throw TypeError(".google.cloud.apihub.v1.Spec.contents: object expected"); - message.contents = $root.google.cloud.apihub.v1.SpecContents.fromObject(object.contents); - } - if (object.details != null) { - if (typeof object.details !== "object") - throw TypeError(".google.cloud.apihub.v1.Spec.details: object expected"); - message.details = $root.google.cloud.apihub.v1.SpecDetails.fromObject(object.details); - } - if (object.sourceUri != null) - message.sourceUri = String(object.sourceUri); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.apihub.v1.Spec.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.apihub.v1.Spec.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.lintResponse != null) { - if (typeof object.lintResponse !== "object") - throw TypeError(".google.cloud.apihub.v1.Spec.lintResponse: object expected"); - message.lintResponse = $root.google.cloud.apihub.v1.LintResponse.fromObject(object.lintResponse); - } - if (object.attributes) { - if (typeof object.attributes !== "object") - throw TypeError(".google.cloud.apihub.v1.Spec.attributes: object expected"); - message.attributes = {}; - for (var keys = Object.keys(object.attributes), i = 0; i < keys.length; ++i) { - if (typeof object.attributes[keys[i]] !== "object") - throw TypeError(".google.cloud.apihub.v1.Spec.attributes: object expected"); - message.attributes[keys[i]] = $root.google.cloud.apihub.v1.AttributeValues.fromObject(object.attributes[keys[i]]); - } - } - if (object.documentation != null) { - if (typeof object.documentation !== "object") - throw TypeError(".google.cloud.apihub.v1.Spec.documentation: object expected"); - message.documentation = $root.google.cloud.apihub.v1.Documentation.fromObject(object.documentation); - } - switch (object.parsingMode) { - default: - if (typeof object.parsingMode === "number") { - message.parsingMode = object.parsingMode; - break; - } - break; - case "PARSING_MODE_UNSPECIFIED": - case 0: - message.parsingMode = 0; - break; - case "RELAXED": - case 1: - message.parsingMode = 1; - break; - case "STRICT": - case 2: - message.parsingMode = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a Spec message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.Spec - * @static - * @param {google.cloud.apihub.v1.Spec} message Spec - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Spec.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.attributes = {}; - if (options.defaults) { - object.name = ""; - object.displayName = ""; - object.specType = null; - object.contents = null; - object.details = null; - object.sourceUri = ""; - object.createTime = null; - object.updateTime = null; - object.lintResponse = null; - object.documentation = null; - object.parsingMode = options.enums === String ? "PARSING_MODE_UNSPECIFIED" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.specType != null && message.hasOwnProperty("specType")) - object.specType = $root.google.cloud.apihub.v1.AttributeValues.toObject(message.specType, options); - if (message.contents != null && message.hasOwnProperty("contents")) - object.contents = $root.google.cloud.apihub.v1.SpecContents.toObject(message.contents, options); - if (message.details != null && message.hasOwnProperty("details")) - object.details = $root.google.cloud.apihub.v1.SpecDetails.toObject(message.details, options); - if (message.sourceUri != null && message.hasOwnProperty("sourceUri")) - object.sourceUri = message.sourceUri; - 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); - if (message.lintResponse != null && message.hasOwnProperty("lintResponse")) - object.lintResponse = $root.google.cloud.apihub.v1.LintResponse.toObject(message.lintResponse, options); - var keys2; - if (message.attributes && (keys2 = Object.keys(message.attributes)).length) { - object.attributes = {}; - for (var j = 0; j < keys2.length; ++j) - object.attributes[keys2[j]] = $root.google.cloud.apihub.v1.AttributeValues.toObject(message.attributes[keys2[j]], options); - } - if (message.documentation != null && message.hasOwnProperty("documentation")) - object.documentation = $root.google.cloud.apihub.v1.Documentation.toObject(message.documentation, options); - if (message.parsingMode != null && message.hasOwnProperty("parsingMode")) - object.parsingMode = options.enums === String ? $root.google.cloud.apihub.v1.Spec.ParsingMode[message.parsingMode] === undefined ? message.parsingMode : $root.google.cloud.apihub.v1.Spec.ParsingMode[message.parsingMode] : message.parsingMode; - return object; - }; - - /** - * Converts this Spec to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.Spec - * @instance - * @returns {Object.} JSON object - */ - Spec.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Spec - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.Spec - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Spec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.Spec"; - }; - - /** - * ParsingMode enum. - * @name google.cloud.apihub.v1.Spec.ParsingMode - * @enum {number} - * @property {number} PARSING_MODE_UNSPECIFIED=0 PARSING_MODE_UNSPECIFIED value - * @property {number} RELAXED=1 RELAXED value - * @property {number} STRICT=2 STRICT value - */ - Spec.ParsingMode = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "PARSING_MODE_UNSPECIFIED"] = 0; - values[valuesById[1] = "RELAXED"] = 1; - values[valuesById[2] = "STRICT"] = 2; - return values; - })(); - - return Spec; - })(); - - v1.Deployment = (function() { - - /** - * Properties of a Deployment. - * @memberof google.cloud.apihub.v1 - * @interface IDeployment - * @property {string|null} [name] Deployment name - * @property {string|null} [displayName] Deployment displayName - * @property {string|null} [description] Deployment description - * @property {google.cloud.apihub.v1.IDocumentation|null} [documentation] Deployment documentation - * @property {google.cloud.apihub.v1.IAttributeValues|null} [deploymentType] Deployment deploymentType - * @property {string|null} [resourceUri] Deployment resourceUri - * @property {Array.|null} [endpoints] Deployment endpoints - * @property {Array.|null} [apiVersions] Deployment apiVersions - * @property {google.protobuf.ITimestamp|null} [createTime] Deployment createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] Deployment updateTime - * @property {google.cloud.apihub.v1.IAttributeValues|null} [slo] Deployment slo - * @property {google.cloud.apihub.v1.IAttributeValues|null} [environment] Deployment environment - * @property {Object.|null} [attributes] Deployment attributes - */ - - /** - * Constructs a new Deployment. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents a Deployment. - * @implements IDeployment - * @constructor - * @param {google.cloud.apihub.v1.IDeployment=} [properties] Properties to set - */ - function Deployment(properties) { - this.endpoints = []; - this.apiVersions = []; - this.attributes = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Deployment name. - * @member {string} name - * @memberof google.cloud.apihub.v1.Deployment - * @instance - */ - Deployment.prototype.name = ""; - - /** - * Deployment displayName. - * @member {string} displayName - * @memberof google.cloud.apihub.v1.Deployment - * @instance - */ - Deployment.prototype.displayName = ""; - - /** - * Deployment description. - * @member {string} description - * @memberof google.cloud.apihub.v1.Deployment - * @instance - */ - Deployment.prototype.description = ""; - - /** - * Deployment documentation. - * @member {google.cloud.apihub.v1.IDocumentation|null|undefined} documentation - * @memberof google.cloud.apihub.v1.Deployment - * @instance - */ - Deployment.prototype.documentation = null; - - /** - * Deployment deploymentType. - * @member {google.cloud.apihub.v1.IAttributeValues|null|undefined} deploymentType - * @memberof google.cloud.apihub.v1.Deployment - * @instance - */ - Deployment.prototype.deploymentType = null; - - /** - * Deployment resourceUri. - * @member {string} resourceUri - * @memberof google.cloud.apihub.v1.Deployment - * @instance - */ - Deployment.prototype.resourceUri = ""; - - /** - * Deployment endpoints. - * @member {Array.} endpoints - * @memberof google.cloud.apihub.v1.Deployment - * @instance - */ - Deployment.prototype.endpoints = $util.emptyArray; - - /** - * Deployment apiVersions. - * @member {Array.} apiVersions - * @memberof google.cloud.apihub.v1.Deployment - * @instance - */ - Deployment.prototype.apiVersions = $util.emptyArray; - - /** - * Deployment createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.apihub.v1.Deployment - * @instance - */ - Deployment.prototype.createTime = null; - - /** - * Deployment updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.apihub.v1.Deployment - * @instance - */ - Deployment.prototype.updateTime = null; - - /** - * Deployment slo. - * @member {google.cloud.apihub.v1.IAttributeValues|null|undefined} slo - * @memberof google.cloud.apihub.v1.Deployment - * @instance - */ - Deployment.prototype.slo = null; - - /** - * Deployment environment. - * @member {google.cloud.apihub.v1.IAttributeValues|null|undefined} environment - * @memberof google.cloud.apihub.v1.Deployment - * @instance - */ - Deployment.prototype.environment = null; - - /** - * Deployment attributes. - * @member {Object.} attributes - * @memberof google.cloud.apihub.v1.Deployment - * @instance - */ - Deployment.prototype.attributes = $util.emptyObject; - - /** - * Creates a new Deployment instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.Deployment - * @static - * @param {google.cloud.apihub.v1.IDeployment=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.Deployment} Deployment instance - */ - Deployment.create = function create(properties) { - return new Deployment(properties); - }; - - /** - * Encodes the specified Deployment message. Does not implicitly {@link google.cloud.apihub.v1.Deployment.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.Deployment - * @static - * @param {google.cloud.apihub.v1.IDeployment} message Deployment message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Deployment.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); - if (message.documentation != null && Object.hasOwnProperty.call(message, "documentation")) - $root.google.cloud.apihub.v1.Documentation.encode(message.documentation, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.deploymentType != null && Object.hasOwnProperty.call(message, "deploymentType")) - $root.google.cloud.apihub.v1.AttributeValues.encode(message.deploymentType, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.resourceUri != null && Object.hasOwnProperty.call(message, "resourceUri")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.resourceUri); - if (message.endpoints != null && message.endpoints.length) - for (var i = 0; i < message.endpoints.length; ++i) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.endpoints[i]); - if (message.apiVersions != null && message.apiVersions.length) - for (var i = 0; i < message.apiVersions.length; ++i) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.apiVersions[i]); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.slo != null && Object.hasOwnProperty.call(message, "slo")) - $root.google.cloud.apihub.v1.AttributeValues.encode(message.slo, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.environment != null && Object.hasOwnProperty.call(message, "environment")) - $root.google.cloud.apihub.v1.AttributeValues.encode(message.environment, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - if (message.attributes != null && Object.hasOwnProperty.call(message, "attributes")) - for (var keys = Object.keys(message.attributes), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 13, wireType 2 =*/106).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.cloud.apihub.v1.AttributeValues.encode(message.attributes[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - return writer; - }; - - /** - * Encodes the specified Deployment message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.Deployment.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.Deployment - * @static - * @param {google.cloud.apihub.v1.IDeployment} message Deployment message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Deployment.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Deployment message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.Deployment - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.Deployment} Deployment - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Deployment.decode = function 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.apihub.v1.Deployment(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.displayName = reader.string(); - break; - } - case 3: { - message.description = reader.string(); - break; - } - case 4: { - message.documentation = $root.google.cloud.apihub.v1.Documentation.decode(reader, reader.uint32()); - break; - } - case 5: { - message.deploymentType = $root.google.cloud.apihub.v1.AttributeValues.decode(reader, reader.uint32()); - break; - } - case 6: { - message.resourceUri = reader.string(); - break; - } - case 7: { - if (!(message.endpoints && message.endpoints.length)) - message.endpoints = []; - message.endpoints.push(reader.string()); - break; - } - case 8: { - if (!(message.apiVersions && message.apiVersions.length)) - message.apiVersions = []; - message.apiVersions.push(reader.string()); - break; - } - case 9: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 10: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 11: { - message.slo = $root.google.cloud.apihub.v1.AttributeValues.decode(reader, reader.uint32()); - break; - } - case 12: { - message.environment = $root.google.cloud.apihub.v1.AttributeValues.decode(reader, reader.uint32()); - break; - } - case 13: { - if (message.attributes === $util.emptyObject) - message.attributes = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = null; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = $root.google.cloud.apihub.v1.AttributeValues.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.attributes[key] = value; - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Deployment message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.Deployment - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.Deployment} Deployment - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Deployment.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Deployment message. - * @function verify - * @memberof google.cloud.apihub.v1.Deployment - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Deployment.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.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.documentation != null && message.hasOwnProperty("documentation")) { - var error = $root.google.cloud.apihub.v1.Documentation.verify(message.documentation); - if (error) - return "documentation." + error; - } - if (message.deploymentType != null && message.hasOwnProperty("deploymentType")) { - var error = $root.google.cloud.apihub.v1.AttributeValues.verify(message.deploymentType); - if (error) - return "deploymentType." + error; - } - if (message.resourceUri != null && message.hasOwnProperty("resourceUri")) - if (!$util.isString(message.resourceUri)) - return "resourceUri: string expected"; - if (message.endpoints != null && message.hasOwnProperty("endpoints")) { - if (!Array.isArray(message.endpoints)) - return "endpoints: array expected"; - for (var i = 0; i < message.endpoints.length; ++i) - if (!$util.isString(message.endpoints[i])) - return "endpoints: string[] expected"; - } - if (message.apiVersions != null && message.hasOwnProperty("apiVersions")) { - if (!Array.isArray(message.apiVersions)) - return "apiVersions: array expected"; - for (var i = 0; i < message.apiVersions.length; ++i) - if (!$util.isString(message.apiVersions[i])) - return "apiVersions: 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.slo != null && message.hasOwnProperty("slo")) { - var error = $root.google.cloud.apihub.v1.AttributeValues.verify(message.slo); - if (error) - return "slo." + error; - } - if (message.environment != null && message.hasOwnProperty("environment")) { - var error = $root.google.cloud.apihub.v1.AttributeValues.verify(message.environment); - if (error) - return "environment." + error; - } - if (message.attributes != null && message.hasOwnProperty("attributes")) { - if (!$util.isObject(message.attributes)) - return "attributes: object expected"; - var key = Object.keys(message.attributes); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.cloud.apihub.v1.AttributeValues.verify(message.attributes[key[i]]); - if (error) - return "attributes." + error; - } - } - return null; - }; - - /** - * Creates a Deployment message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.Deployment - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.Deployment} Deployment - */ - Deployment.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.Deployment) - return object; - var message = new $root.google.cloud.apihub.v1.Deployment(); - if (object.name != null) - message.name = String(object.name); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.description != null) - message.description = String(object.description); - if (object.documentation != null) { - if (typeof object.documentation !== "object") - throw TypeError(".google.cloud.apihub.v1.Deployment.documentation: object expected"); - message.documentation = $root.google.cloud.apihub.v1.Documentation.fromObject(object.documentation); - } - if (object.deploymentType != null) { - if (typeof object.deploymentType !== "object") - throw TypeError(".google.cloud.apihub.v1.Deployment.deploymentType: object expected"); - message.deploymentType = $root.google.cloud.apihub.v1.AttributeValues.fromObject(object.deploymentType); - } - if (object.resourceUri != null) - message.resourceUri = String(object.resourceUri); - if (object.endpoints) { - if (!Array.isArray(object.endpoints)) - throw TypeError(".google.cloud.apihub.v1.Deployment.endpoints: array expected"); - message.endpoints = []; - for (var i = 0; i < object.endpoints.length; ++i) - message.endpoints[i] = String(object.endpoints[i]); - } - if (object.apiVersions) { - if (!Array.isArray(object.apiVersions)) - throw TypeError(".google.cloud.apihub.v1.Deployment.apiVersions: array expected"); - message.apiVersions = []; - for (var i = 0; i < object.apiVersions.length; ++i) - message.apiVersions[i] = String(object.apiVersions[i]); - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.apihub.v1.Deployment.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.apihub.v1.Deployment.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.slo != null) { - if (typeof object.slo !== "object") - throw TypeError(".google.cloud.apihub.v1.Deployment.slo: object expected"); - message.slo = $root.google.cloud.apihub.v1.AttributeValues.fromObject(object.slo); - } - if (object.environment != null) { - if (typeof object.environment !== "object") - throw TypeError(".google.cloud.apihub.v1.Deployment.environment: object expected"); - message.environment = $root.google.cloud.apihub.v1.AttributeValues.fromObject(object.environment); - } - if (object.attributes) { - if (typeof object.attributes !== "object") - throw TypeError(".google.cloud.apihub.v1.Deployment.attributes: object expected"); - message.attributes = {}; - for (var keys = Object.keys(object.attributes), i = 0; i < keys.length; ++i) { - if (typeof object.attributes[keys[i]] !== "object") - throw TypeError(".google.cloud.apihub.v1.Deployment.attributes: object expected"); - message.attributes[keys[i]] = $root.google.cloud.apihub.v1.AttributeValues.fromObject(object.attributes[keys[i]]); - } - } - return message; - }; - - /** - * Creates a plain object from a Deployment message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.Deployment - * @static - * @param {google.cloud.apihub.v1.Deployment} message Deployment - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Deployment.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.endpoints = []; - object.apiVersions = []; - } - if (options.objects || options.defaults) - object.attributes = {}; - if (options.defaults) { - object.name = ""; - object.displayName = ""; - object.description = ""; - object.documentation = null; - object.deploymentType = null; - object.resourceUri = ""; - object.createTime = null; - object.updateTime = null; - object.slo = null; - object.environment = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.documentation != null && message.hasOwnProperty("documentation")) - object.documentation = $root.google.cloud.apihub.v1.Documentation.toObject(message.documentation, options); - if (message.deploymentType != null && message.hasOwnProperty("deploymentType")) - object.deploymentType = $root.google.cloud.apihub.v1.AttributeValues.toObject(message.deploymentType, options); - if (message.resourceUri != null && message.hasOwnProperty("resourceUri")) - object.resourceUri = message.resourceUri; - if (message.endpoints && message.endpoints.length) { - object.endpoints = []; - for (var j = 0; j < message.endpoints.length; ++j) - object.endpoints[j] = message.endpoints[j]; - } - if (message.apiVersions && message.apiVersions.length) { - object.apiVersions = []; - for (var j = 0; j < message.apiVersions.length; ++j) - object.apiVersions[j] = message.apiVersions[j]; - } - 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); - if (message.slo != null && message.hasOwnProperty("slo")) - object.slo = $root.google.cloud.apihub.v1.AttributeValues.toObject(message.slo, options); - if (message.environment != null && message.hasOwnProperty("environment")) - object.environment = $root.google.cloud.apihub.v1.AttributeValues.toObject(message.environment, options); - var keys2; - if (message.attributes && (keys2 = Object.keys(message.attributes)).length) { - object.attributes = {}; - for (var j = 0; j < keys2.length; ++j) - object.attributes[keys2[j]] = $root.google.cloud.apihub.v1.AttributeValues.toObject(message.attributes[keys2[j]], options); - } - return object; - }; - - /** - * Converts this Deployment to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.Deployment - * @instance - * @returns {Object.} JSON object - */ - Deployment.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Deployment - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.Deployment - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Deployment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.Deployment"; - }; - - return Deployment; - })(); - - v1.ApiOperation = (function() { - - /** - * Properties of an ApiOperation. - * @memberof google.cloud.apihub.v1 - * @interface IApiOperation - * @property {string|null} [name] ApiOperation name - * @property {string|null} [spec] ApiOperation spec - * @property {google.cloud.apihub.v1.IOperationDetails|null} [details] ApiOperation details - * @property {google.protobuf.ITimestamp|null} [createTime] ApiOperation createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] ApiOperation updateTime - * @property {Object.|null} [attributes] ApiOperation attributes - */ - - /** - * Constructs a new ApiOperation. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents an ApiOperation. - * @implements IApiOperation - * @constructor - * @param {google.cloud.apihub.v1.IApiOperation=} [properties] Properties to set - */ - function ApiOperation(properties) { - this.attributes = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ApiOperation name. - * @member {string} name - * @memberof google.cloud.apihub.v1.ApiOperation - * @instance - */ - ApiOperation.prototype.name = ""; - - /** - * ApiOperation spec. - * @member {string} spec - * @memberof google.cloud.apihub.v1.ApiOperation - * @instance - */ - ApiOperation.prototype.spec = ""; - - /** - * ApiOperation details. - * @member {google.cloud.apihub.v1.IOperationDetails|null|undefined} details - * @memberof google.cloud.apihub.v1.ApiOperation - * @instance - */ - ApiOperation.prototype.details = null; - - /** - * ApiOperation createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.apihub.v1.ApiOperation - * @instance - */ - ApiOperation.prototype.createTime = null; - - /** - * ApiOperation updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.apihub.v1.ApiOperation - * @instance - */ - ApiOperation.prototype.updateTime = null; - - /** - * ApiOperation attributes. - * @member {Object.} attributes - * @memberof google.cloud.apihub.v1.ApiOperation - * @instance - */ - ApiOperation.prototype.attributes = $util.emptyObject; - - /** - * Creates a new ApiOperation instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.ApiOperation - * @static - * @param {google.cloud.apihub.v1.IApiOperation=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.ApiOperation} ApiOperation instance - */ - ApiOperation.create = function create(properties) { - return new ApiOperation(properties); - }; - - /** - * Encodes the specified ApiOperation message. Does not implicitly {@link google.cloud.apihub.v1.ApiOperation.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.ApiOperation - * @static - * @param {google.cloud.apihub.v1.IApiOperation} message ApiOperation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ApiOperation.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.spec != null && Object.hasOwnProperty.call(message, "spec")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.spec); - if (message.details != null && Object.hasOwnProperty.call(message, "details")) - $root.google.cloud.apihub.v1.OperationDetails.encode(message.details, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.attributes != null && Object.hasOwnProperty.call(message, "attributes")) - for (var keys = Object.keys(message.attributes), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.cloud.apihub.v1.AttributeValues.encode(message.attributes[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - return writer; - }; - - /** - * Encodes the specified ApiOperation message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ApiOperation.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.ApiOperation - * @static - * @param {google.cloud.apihub.v1.IApiOperation} message ApiOperation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ApiOperation.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ApiOperation message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.ApiOperation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.ApiOperation} ApiOperation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ApiOperation.decode = function 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.apihub.v1.ApiOperation(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.spec = reader.string(); - break; - } - case 3: { - message.details = $root.google.cloud.apihub.v1.OperationDetails.decode(reader, reader.uint32()); - break; - } - case 4: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 5: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 6: { - if (message.attributes === $util.emptyObject) - message.attributes = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = null; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = $root.google.cloud.apihub.v1.AttributeValues.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.attributes[key] = value; - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ApiOperation message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.ApiOperation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.ApiOperation} ApiOperation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ApiOperation.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ApiOperation message. - * @function verify - * @memberof google.cloud.apihub.v1.ApiOperation - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ApiOperation.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.spec != null && message.hasOwnProperty("spec")) - if (!$util.isString(message.spec)) - return "spec: string expected"; - if (message.details != null && message.hasOwnProperty("details")) { - var error = $root.google.cloud.apihub.v1.OperationDetails.verify(message.details); - if (error) - return "details." + error; - } - 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.attributes != null && message.hasOwnProperty("attributes")) { - if (!$util.isObject(message.attributes)) - return "attributes: object expected"; - var key = Object.keys(message.attributes); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.cloud.apihub.v1.AttributeValues.verify(message.attributes[key[i]]); - if (error) - return "attributes." + error; - } - } - return null; - }; - - /** - * Creates an ApiOperation message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.ApiOperation - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.ApiOperation} ApiOperation - */ - ApiOperation.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.ApiOperation) - return object; - var message = new $root.google.cloud.apihub.v1.ApiOperation(); - if (object.name != null) - message.name = String(object.name); - if (object.spec != null) - message.spec = String(object.spec); - if (object.details != null) { - if (typeof object.details !== "object") - throw TypeError(".google.cloud.apihub.v1.ApiOperation.details: object expected"); - message.details = $root.google.cloud.apihub.v1.OperationDetails.fromObject(object.details); - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.apihub.v1.ApiOperation.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.apihub.v1.ApiOperation.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.attributes) { - if (typeof object.attributes !== "object") - throw TypeError(".google.cloud.apihub.v1.ApiOperation.attributes: object expected"); - message.attributes = {}; - for (var keys = Object.keys(object.attributes), i = 0; i < keys.length; ++i) { - if (typeof object.attributes[keys[i]] !== "object") - throw TypeError(".google.cloud.apihub.v1.ApiOperation.attributes: object expected"); - message.attributes[keys[i]] = $root.google.cloud.apihub.v1.AttributeValues.fromObject(object.attributes[keys[i]]); - } - } - return message; - }; - - /** - * Creates a plain object from an ApiOperation message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.ApiOperation - * @static - * @param {google.cloud.apihub.v1.ApiOperation} message ApiOperation - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ApiOperation.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.attributes = {}; - if (options.defaults) { - object.name = ""; - object.spec = ""; - object.details = null; - object.createTime = null; - object.updateTime = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.spec != null && message.hasOwnProperty("spec")) - object.spec = message.spec; - if (message.details != null && message.hasOwnProperty("details")) - object.details = $root.google.cloud.apihub.v1.OperationDetails.toObject(message.details, options); - 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.attributes && (keys2 = Object.keys(message.attributes)).length) { - object.attributes = {}; - for (var j = 0; j < keys2.length; ++j) - object.attributes[keys2[j]] = $root.google.cloud.apihub.v1.AttributeValues.toObject(message.attributes[keys2[j]], options); - } - return object; - }; - - /** - * Converts this ApiOperation to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.ApiOperation - * @instance - * @returns {Object.} JSON object - */ - ApiOperation.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ApiOperation - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.ApiOperation - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ApiOperation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.ApiOperation"; - }; - - return ApiOperation; - })(); - - v1.Definition = (function() { - - /** - * Properties of a Definition. - * @memberof google.cloud.apihub.v1 - * @interface IDefinition - * @property {google.cloud.apihub.v1.ISchema|null} [schema] Definition schema - * @property {string|null} [name] Definition name - * @property {string|null} [spec] Definition spec - * @property {google.cloud.apihub.v1.Definition.Type|null} [type] Definition type - * @property {google.protobuf.ITimestamp|null} [createTime] Definition createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] Definition updateTime - * @property {Object.|null} [attributes] Definition attributes - */ - - /** - * Constructs a new Definition. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents a Definition. - * @implements IDefinition - * @constructor - * @param {google.cloud.apihub.v1.IDefinition=} [properties] Properties to set - */ - function Definition(properties) { - this.attributes = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Definition schema. - * @member {google.cloud.apihub.v1.ISchema|null|undefined} schema - * @memberof google.cloud.apihub.v1.Definition - * @instance - */ - Definition.prototype.schema = null; - - /** - * Definition name. - * @member {string} name - * @memberof google.cloud.apihub.v1.Definition - * @instance - */ - Definition.prototype.name = ""; - - /** - * Definition spec. - * @member {string} spec - * @memberof google.cloud.apihub.v1.Definition - * @instance - */ - Definition.prototype.spec = ""; - - /** - * Definition type. - * @member {google.cloud.apihub.v1.Definition.Type} type - * @memberof google.cloud.apihub.v1.Definition - * @instance - */ - Definition.prototype.type = 0; - - /** - * Definition createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.apihub.v1.Definition - * @instance - */ - Definition.prototype.createTime = null; - - /** - * Definition updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.apihub.v1.Definition - * @instance - */ - Definition.prototype.updateTime = null; - - /** - * Definition attributes. - * @member {Object.} attributes - * @memberof google.cloud.apihub.v1.Definition - * @instance - */ - Definition.prototype.attributes = $util.emptyObject; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Definition value. - * @member {"schema"|undefined} value - * @memberof google.cloud.apihub.v1.Definition - * @instance - */ - Object.defineProperty(Definition.prototype, "value", { - get: $util.oneOfGetter($oneOfFields = ["schema"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Definition instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.Definition - * @static - * @param {google.cloud.apihub.v1.IDefinition=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.Definition} Definition instance - */ - Definition.create = function create(properties) { - return new Definition(properties); - }; - - /** - * Encodes the specified Definition message. Does not implicitly {@link google.cloud.apihub.v1.Definition.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.Definition - * @static - * @param {google.cloud.apihub.v1.IDefinition} message Definition message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Definition.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.spec != null && Object.hasOwnProperty.call(message, "spec")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.spec); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.type); - if (message.schema != null && Object.hasOwnProperty.call(message, "schema")) - $root.google.cloud.apihub.v1.Schema.encode(message.schema, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.attributes != null && Object.hasOwnProperty.call(message, "attributes")) - for (var keys = Object.keys(message.attributes), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.cloud.apihub.v1.AttributeValues.encode(message.attributes[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - return writer; - }; - - /** - * Encodes the specified Definition message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.Definition.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.Definition - * @static - * @param {google.cloud.apihub.v1.IDefinition} message Definition message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Definition.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Definition message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.Definition - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.Definition} Definition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Definition.decode = function 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.apihub.v1.Definition(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 4: { - message.schema = $root.google.cloud.apihub.v1.Schema.decode(reader, reader.uint32()); - break; - } - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.spec = reader.string(); - break; - } - case 3: { - message.type = reader.int32(); - break; - } - case 5: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 6: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 7: { - if (message.attributes === $util.emptyObject) - message.attributes = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = null; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = $root.google.cloud.apihub.v1.AttributeValues.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.attributes[key] = value; - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Definition message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.Definition - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.Definition} Definition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Definition.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Definition message. - * @function verify - * @memberof google.cloud.apihub.v1.Definition - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Definition.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.schema != null && message.hasOwnProperty("schema")) { - properties.value = 1; - { - var error = $root.google.cloud.apihub.v1.Schema.verify(message.schema); - if (error) - return "schema." + error; - } - } - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.spec != null && message.hasOwnProperty("spec")) - if (!$util.isString(message.spec)) - return "spec: string expected"; - if (message.type != null && message.hasOwnProperty("type")) - switch (message.type) { - default: - return "type: enum value expected"; - case 0: - case 1: - break; - } - 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.attributes != null && message.hasOwnProperty("attributes")) { - if (!$util.isObject(message.attributes)) - return "attributes: object expected"; - var key = Object.keys(message.attributes); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.cloud.apihub.v1.AttributeValues.verify(message.attributes[key[i]]); - if (error) - return "attributes." + error; - } - } - return null; - }; - - /** - * Creates a Definition message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.Definition - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.Definition} Definition - */ - Definition.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.Definition) - return object; - var message = new $root.google.cloud.apihub.v1.Definition(); - if (object.schema != null) { - if (typeof object.schema !== "object") - throw TypeError(".google.cloud.apihub.v1.Definition.schema: object expected"); - message.schema = $root.google.cloud.apihub.v1.Schema.fromObject(object.schema); - } - if (object.name != null) - message.name = String(object.name); - if (object.spec != null) - message.spec = String(object.spec); - 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 "SCHEMA": - case 1: - message.type = 1; - break; - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.apihub.v1.Definition.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.apihub.v1.Definition.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.attributes) { - if (typeof object.attributes !== "object") - throw TypeError(".google.cloud.apihub.v1.Definition.attributes: object expected"); - message.attributes = {}; - for (var keys = Object.keys(object.attributes), i = 0; i < keys.length; ++i) { - if (typeof object.attributes[keys[i]] !== "object") - throw TypeError(".google.cloud.apihub.v1.Definition.attributes: object expected"); - message.attributes[keys[i]] = $root.google.cloud.apihub.v1.AttributeValues.fromObject(object.attributes[keys[i]]); - } - } - return message; - }; - - /** - * Creates a plain object from a Definition message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.Definition - * @static - * @param {google.cloud.apihub.v1.Definition} message Definition - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Definition.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.attributes = {}; - if (options.defaults) { - object.name = ""; - object.spec = ""; - object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; - object.createTime = null; - object.updateTime = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.spec != null && message.hasOwnProperty("spec")) - object.spec = message.spec; - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.cloud.apihub.v1.Definition.Type[message.type] === undefined ? message.type : $root.google.cloud.apihub.v1.Definition.Type[message.type] : message.type; - if (message.schema != null && message.hasOwnProperty("schema")) { - object.schema = $root.google.cloud.apihub.v1.Schema.toObject(message.schema, options); - if (options.oneofs) - object.value = "schema"; - } - 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.attributes && (keys2 = Object.keys(message.attributes)).length) { - object.attributes = {}; - for (var j = 0; j < keys2.length; ++j) - object.attributes[keys2[j]] = $root.google.cloud.apihub.v1.AttributeValues.toObject(message.attributes[keys2[j]], options); - } - return object; - }; - - /** - * Converts this Definition to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.Definition - * @instance - * @returns {Object.} JSON object - */ - Definition.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Definition - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.Definition - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Definition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.Definition"; - }; - - /** - * Type enum. - * @name google.cloud.apihub.v1.Definition.Type - * @enum {number} - * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value - * @property {number} SCHEMA=1 SCHEMA value - */ - Definition.Type = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "SCHEMA"] = 1; - return values; - })(); - - return Definition; - })(); - - v1.Attribute = (function() { - - /** - * Properties of an Attribute. - * @memberof google.cloud.apihub.v1 - * @interface IAttribute - * @property {string|null} [name] Attribute name - * @property {string|null} [displayName] Attribute displayName - * @property {string|null} [description] Attribute description - * @property {google.cloud.apihub.v1.Attribute.DefinitionType|null} [definitionType] Attribute definitionType - * @property {google.cloud.apihub.v1.Attribute.Scope|null} [scope] Attribute scope - * @property {google.cloud.apihub.v1.Attribute.DataType|null} [dataType] Attribute dataType - * @property {Array.|null} [allowedValues] Attribute allowedValues - * @property {number|null} [cardinality] Attribute cardinality - * @property {boolean|null} [mandatory] Attribute mandatory - * @property {google.protobuf.ITimestamp|null} [createTime] Attribute createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] Attribute updateTime - */ - - /** - * Constructs a new Attribute. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents an Attribute. - * @implements IAttribute - * @constructor - * @param {google.cloud.apihub.v1.IAttribute=} [properties] Properties to set - */ - function Attribute(properties) { - this.allowedValues = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Attribute name. - * @member {string} name - * @memberof google.cloud.apihub.v1.Attribute - * @instance - */ - Attribute.prototype.name = ""; - - /** - * Attribute displayName. - * @member {string} displayName - * @memberof google.cloud.apihub.v1.Attribute - * @instance - */ - Attribute.prototype.displayName = ""; - - /** - * Attribute description. - * @member {string} description - * @memberof google.cloud.apihub.v1.Attribute - * @instance - */ - Attribute.prototype.description = ""; - - /** - * Attribute definitionType. - * @member {google.cloud.apihub.v1.Attribute.DefinitionType} definitionType - * @memberof google.cloud.apihub.v1.Attribute - * @instance - */ - Attribute.prototype.definitionType = 0; - - /** - * Attribute scope. - * @member {google.cloud.apihub.v1.Attribute.Scope} scope - * @memberof google.cloud.apihub.v1.Attribute - * @instance - */ - Attribute.prototype.scope = 0; - - /** - * Attribute dataType. - * @member {google.cloud.apihub.v1.Attribute.DataType} dataType - * @memberof google.cloud.apihub.v1.Attribute - * @instance - */ - Attribute.prototype.dataType = 0; - - /** - * Attribute allowedValues. - * @member {Array.} allowedValues - * @memberof google.cloud.apihub.v1.Attribute - * @instance - */ - Attribute.prototype.allowedValues = $util.emptyArray; - - /** - * Attribute cardinality. - * @member {number} cardinality - * @memberof google.cloud.apihub.v1.Attribute - * @instance - */ - Attribute.prototype.cardinality = 0; - - /** - * Attribute mandatory. - * @member {boolean} mandatory - * @memberof google.cloud.apihub.v1.Attribute - * @instance - */ - Attribute.prototype.mandatory = false; - - /** - * Attribute createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.apihub.v1.Attribute - * @instance - */ - Attribute.prototype.createTime = null; - - /** - * Attribute updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.apihub.v1.Attribute - * @instance - */ - Attribute.prototype.updateTime = null; - - /** - * Creates a new Attribute instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.Attribute - * @static - * @param {google.cloud.apihub.v1.IAttribute=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.Attribute} Attribute instance - */ - Attribute.create = function create(properties) { - return new Attribute(properties); - }; - - /** - * Encodes the specified Attribute message. Does not implicitly {@link google.cloud.apihub.v1.Attribute.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.Attribute - * @static - * @param {google.cloud.apihub.v1.IAttribute} message Attribute message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Attribute.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); - if (message.definitionType != null && Object.hasOwnProperty.call(message, "definitionType")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.definitionType); - if (message.scope != null && Object.hasOwnProperty.call(message, "scope")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.scope); - if (message.dataType != null && Object.hasOwnProperty.call(message, "dataType")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.dataType); - if (message.allowedValues != null && message.allowedValues.length) - for (var i = 0; i < message.allowedValues.length; ++i) - $root.google.cloud.apihub.v1.Attribute.AllowedValue.encode(message.allowedValues[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.cardinality != null && Object.hasOwnProperty.call(message, "cardinality")) - writer.uint32(/* id 8, wireType 0 =*/64).int32(message.cardinality); - if (message.mandatory != null && Object.hasOwnProperty.call(message, "mandatory")) - writer.uint32(/* id 9, wireType 0 =*/72).bool(message.mandatory); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Attribute message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.Attribute.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.Attribute - * @static - * @param {google.cloud.apihub.v1.IAttribute} message Attribute message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Attribute.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Attribute message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.Attribute - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.Attribute} Attribute - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Attribute.decode = function 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.apihub.v1.Attribute(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.displayName = reader.string(); - break; - } - case 3: { - message.description = reader.string(); - break; - } - case 4: { - message.definitionType = reader.int32(); - break; - } - case 5: { - message.scope = reader.int32(); - break; - } - case 6: { - message.dataType = reader.int32(); - break; - } - case 7: { - if (!(message.allowedValues && message.allowedValues.length)) - message.allowedValues = []; - message.allowedValues.push($root.google.cloud.apihub.v1.Attribute.AllowedValue.decode(reader, reader.uint32())); - break; - } - case 8: { - message.cardinality = reader.int32(); - break; - } - case 9: { - message.mandatory = reader.bool(); - break; - } - case 10: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 11: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Attribute message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.Attribute - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.Attribute} Attribute - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Attribute.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Attribute message. - * @function verify - * @memberof google.cloud.apihub.v1.Attribute - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Attribute.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.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.definitionType != null && message.hasOwnProperty("definitionType")) - switch (message.definitionType) { - default: - return "definitionType: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.scope != null && message.hasOwnProperty("scope")) - switch (message.scope) { - default: - return "scope: 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.dataType != null && message.hasOwnProperty("dataType")) - switch (message.dataType) { - default: - return "dataType: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.allowedValues != null && message.hasOwnProperty("allowedValues")) { - if (!Array.isArray(message.allowedValues)) - return "allowedValues: array expected"; - for (var i = 0; i < message.allowedValues.length; ++i) { - var error = $root.google.cloud.apihub.v1.Attribute.AllowedValue.verify(message.allowedValues[i]); - if (error) - return "allowedValues." + error; - } - } - if (message.cardinality != null && message.hasOwnProperty("cardinality")) - if (!$util.isInteger(message.cardinality)) - return "cardinality: integer expected"; - if (message.mandatory != null && message.hasOwnProperty("mandatory")) - if (typeof message.mandatory !== "boolean") - return "mandatory: boolean 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; - } - return null; - }; - - /** - * Creates an Attribute message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.Attribute - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.Attribute} Attribute - */ - Attribute.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.Attribute) - return object; - var message = new $root.google.cloud.apihub.v1.Attribute(); - if (object.name != null) - message.name = String(object.name); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.description != null) - message.description = String(object.description); - switch (object.definitionType) { - default: - if (typeof object.definitionType === "number") { - message.definitionType = object.definitionType; - break; - } - break; - case "DEFINITION_TYPE_UNSPECIFIED": - case 0: - message.definitionType = 0; - break; - case "SYSTEM_DEFINED": - case 1: - message.definitionType = 1; - break; - case "USER_DEFINED": - case 2: - message.definitionType = 2; - break; - } - switch (object.scope) { - default: - if (typeof object.scope === "number") { - message.scope = object.scope; - break; - } - break; - case "SCOPE_UNSPECIFIED": - case 0: - message.scope = 0; - break; - case "API": - case 1: - message.scope = 1; - break; - case "VERSION": - case 2: - message.scope = 2; - break; - case "SPEC": - case 3: - message.scope = 3; - break; - case "API_OPERATION": - case 4: - message.scope = 4; - break; - case "DEPLOYMENT": - case 5: - message.scope = 5; - break; - case "DEPENDENCY": - case 6: - message.scope = 6; - break; - case "DEFINITION": - case 7: - message.scope = 7; - break; - case "EXTERNAL_API": - case 8: - message.scope = 8; - break; - case "PLUGIN": - case 9: - message.scope = 9; - break; - } - 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 "ENUM": - case 1: - message.dataType = 1; - break; - case "JSON": - case 2: - message.dataType = 2; - break; - case "STRING": - case 3: - message.dataType = 3; - break; - } - if (object.allowedValues) { - if (!Array.isArray(object.allowedValues)) - throw TypeError(".google.cloud.apihub.v1.Attribute.allowedValues: array expected"); - message.allowedValues = []; - for (var i = 0; i < object.allowedValues.length; ++i) { - if (typeof object.allowedValues[i] !== "object") - throw TypeError(".google.cloud.apihub.v1.Attribute.allowedValues: object expected"); - message.allowedValues[i] = $root.google.cloud.apihub.v1.Attribute.AllowedValue.fromObject(object.allowedValues[i]); - } - } - if (object.cardinality != null) - message.cardinality = object.cardinality | 0; - if (object.mandatory != null) - message.mandatory = Boolean(object.mandatory); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.apihub.v1.Attribute.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.apihub.v1.Attribute.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - return message; - }; - - /** - * Creates a plain object from an Attribute message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.Attribute - * @static - * @param {google.cloud.apihub.v1.Attribute} message Attribute - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Attribute.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.allowedValues = []; - if (options.defaults) { - object.name = ""; - object.displayName = ""; - object.description = ""; - object.definitionType = options.enums === String ? "DEFINITION_TYPE_UNSPECIFIED" : 0; - object.scope = options.enums === String ? "SCOPE_UNSPECIFIED" : 0; - object.dataType = options.enums === String ? "DATA_TYPE_UNSPECIFIED" : 0; - object.cardinality = 0; - object.mandatory = false; - object.createTime = null; - object.updateTime = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.definitionType != null && message.hasOwnProperty("definitionType")) - object.definitionType = options.enums === String ? $root.google.cloud.apihub.v1.Attribute.DefinitionType[message.definitionType] === undefined ? message.definitionType : $root.google.cloud.apihub.v1.Attribute.DefinitionType[message.definitionType] : message.definitionType; - if (message.scope != null && message.hasOwnProperty("scope")) - object.scope = options.enums === String ? $root.google.cloud.apihub.v1.Attribute.Scope[message.scope] === undefined ? message.scope : $root.google.cloud.apihub.v1.Attribute.Scope[message.scope] : message.scope; - if (message.dataType != null && message.hasOwnProperty("dataType")) - object.dataType = options.enums === String ? $root.google.cloud.apihub.v1.Attribute.DataType[message.dataType] === undefined ? message.dataType : $root.google.cloud.apihub.v1.Attribute.DataType[message.dataType] : message.dataType; - if (message.allowedValues && message.allowedValues.length) { - object.allowedValues = []; - for (var j = 0; j < message.allowedValues.length; ++j) - object.allowedValues[j] = $root.google.cloud.apihub.v1.Attribute.AllowedValue.toObject(message.allowedValues[j], options); - } - if (message.cardinality != null && message.hasOwnProperty("cardinality")) - object.cardinality = message.cardinality; - if (message.mandatory != null && message.hasOwnProperty("mandatory")) - object.mandatory = message.mandatory; - 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); - return object; - }; - - /** - * Converts this Attribute to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.Attribute - * @instance - * @returns {Object.} JSON object - */ - Attribute.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Attribute - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.Attribute - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Attribute.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.Attribute"; - }; - - Attribute.AllowedValue = (function() { - - /** - * Properties of an AllowedValue. - * @memberof google.cloud.apihub.v1.Attribute - * @interface IAllowedValue - * @property {string|null} [id] AllowedValue id - * @property {string|null} [displayName] AllowedValue displayName - * @property {string|null} [description] AllowedValue description - * @property {boolean|null} [immutable] AllowedValue immutable - */ - - /** - * Constructs a new AllowedValue. - * @memberof google.cloud.apihub.v1.Attribute - * @classdesc Represents an AllowedValue. - * @implements IAllowedValue - * @constructor - * @param {google.cloud.apihub.v1.Attribute.IAllowedValue=} [properties] Properties to set - */ - function AllowedValue(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]]; - } - - /** - * AllowedValue id. - * @member {string} id - * @memberof google.cloud.apihub.v1.Attribute.AllowedValue - * @instance - */ - AllowedValue.prototype.id = ""; - - /** - * AllowedValue displayName. - * @member {string} displayName - * @memberof google.cloud.apihub.v1.Attribute.AllowedValue - * @instance - */ - AllowedValue.prototype.displayName = ""; - - /** - * AllowedValue description. - * @member {string} description - * @memberof google.cloud.apihub.v1.Attribute.AllowedValue - * @instance - */ - AllowedValue.prototype.description = ""; - - /** - * AllowedValue immutable. - * @member {boolean} immutable - * @memberof google.cloud.apihub.v1.Attribute.AllowedValue - * @instance - */ - AllowedValue.prototype.immutable = false; - - /** - * Creates a new AllowedValue instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.Attribute.AllowedValue - * @static - * @param {google.cloud.apihub.v1.Attribute.IAllowedValue=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.Attribute.AllowedValue} AllowedValue instance - */ - AllowedValue.create = function create(properties) { - return new AllowedValue(properties); - }; - - /** - * Encodes the specified AllowedValue message. Does not implicitly {@link google.cloud.apihub.v1.Attribute.AllowedValue.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.Attribute.AllowedValue - * @static - * @param {google.cloud.apihub.v1.Attribute.IAllowedValue} message AllowedValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AllowedValue.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); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); - if (message.immutable != null && Object.hasOwnProperty.call(message, "immutable")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.immutable); - return writer; - }; - - /** - * Encodes the specified AllowedValue message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.Attribute.AllowedValue.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.Attribute.AllowedValue - * @static - * @param {google.cloud.apihub.v1.Attribute.IAllowedValue} message AllowedValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AllowedValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AllowedValue message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.Attribute.AllowedValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.Attribute.AllowedValue} AllowedValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AllowedValue.decode = function 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.apihub.v1.Attribute.AllowedValue(); - 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; - } - case 3: { - message.description = reader.string(); - break; - } - case 4: { - message.immutable = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AllowedValue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.Attribute.AllowedValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.Attribute.AllowedValue} AllowedValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AllowedValue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AllowedValue message. - * @function verify - * @memberof google.cloud.apihub.v1.Attribute.AllowedValue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AllowedValue.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"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.immutable != null && message.hasOwnProperty("immutable")) - if (typeof message.immutable !== "boolean") - return "immutable: boolean expected"; - return null; - }; - - /** - * Creates an AllowedValue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.Attribute.AllowedValue - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.Attribute.AllowedValue} AllowedValue - */ - AllowedValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.Attribute.AllowedValue) - return object; - var message = new $root.google.cloud.apihub.v1.Attribute.AllowedValue(); - if (object.id != null) - message.id = String(object.id); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.description != null) - message.description = String(object.description); - if (object.immutable != null) - message.immutable = Boolean(object.immutable); - return message; - }; - - /** - * Creates a plain object from an AllowedValue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.Attribute.AllowedValue - * @static - * @param {google.cloud.apihub.v1.Attribute.AllowedValue} message AllowedValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AllowedValue.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.id = ""; - object.displayName = ""; - object.description = ""; - object.immutable = false; - } - if (message.id != null && message.hasOwnProperty("id")) - object.id = message.id; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.immutable != null && message.hasOwnProperty("immutable")) - object.immutable = message.immutable; - return object; - }; - - /** - * Converts this AllowedValue to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.Attribute.AllowedValue - * @instance - * @returns {Object.} JSON object - */ - AllowedValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AllowedValue - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.Attribute.AllowedValue - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AllowedValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.Attribute.AllowedValue"; - }; - - return AllowedValue; - })(); - - /** - * DefinitionType enum. - * @name google.cloud.apihub.v1.Attribute.DefinitionType - * @enum {number} - * @property {number} DEFINITION_TYPE_UNSPECIFIED=0 DEFINITION_TYPE_UNSPECIFIED value - * @property {number} SYSTEM_DEFINED=1 SYSTEM_DEFINED value - * @property {number} USER_DEFINED=2 USER_DEFINED value - */ - Attribute.DefinitionType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "DEFINITION_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "SYSTEM_DEFINED"] = 1; - values[valuesById[2] = "USER_DEFINED"] = 2; - return values; - })(); - - /** - * Scope enum. - * @name google.cloud.apihub.v1.Attribute.Scope - * @enum {number} - * @property {number} SCOPE_UNSPECIFIED=0 SCOPE_UNSPECIFIED value - * @property {number} API=1 API value - * @property {number} VERSION=2 VERSION value - * @property {number} SPEC=3 SPEC value - * @property {number} API_OPERATION=4 API_OPERATION value - * @property {number} DEPLOYMENT=5 DEPLOYMENT value - * @property {number} DEPENDENCY=6 DEPENDENCY value - * @property {number} DEFINITION=7 DEFINITION value - * @property {number} EXTERNAL_API=8 EXTERNAL_API value - * @property {number} PLUGIN=9 PLUGIN value - */ - Attribute.Scope = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "SCOPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "API"] = 1; - values[valuesById[2] = "VERSION"] = 2; - values[valuesById[3] = "SPEC"] = 3; - values[valuesById[4] = "API_OPERATION"] = 4; - values[valuesById[5] = "DEPLOYMENT"] = 5; - values[valuesById[6] = "DEPENDENCY"] = 6; - values[valuesById[7] = "DEFINITION"] = 7; - values[valuesById[8] = "EXTERNAL_API"] = 8; - values[valuesById[9] = "PLUGIN"] = 9; - return values; - })(); - - /** - * DataType enum. - * @name google.cloud.apihub.v1.Attribute.DataType - * @enum {number} - * @property {number} DATA_TYPE_UNSPECIFIED=0 DATA_TYPE_UNSPECIFIED value - * @property {number} ENUM=1 ENUM value - * @property {number} JSON=2 JSON value - * @property {number} STRING=3 STRING value - */ - Attribute.DataType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "DATA_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "ENUM"] = 1; - values[valuesById[2] = "JSON"] = 2; - values[valuesById[3] = "STRING"] = 3; - return values; - })(); - - return Attribute; - })(); - - v1.SpecContents = (function() { - - /** - * Properties of a SpecContents. - * @memberof google.cloud.apihub.v1 - * @interface ISpecContents - * @property {Uint8Array|null} [contents] SpecContents contents - * @property {string|null} [mimeType] SpecContents mimeType - */ - - /** - * Constructs a new SpecContents. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents a SpecContents. - * @implements ISpecContents - * @constructor - * @param {google.cloud.apihub.v1.ISpecContents=} [properties] Properties to set - */ - function SpecContents(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]]; - } - - /** - * SpecContents contents. - * @member {Uint8Array} contents - * @memberof google.cloud.apihub.v1.SpecContents - * @instance - */ - SpecContents.prototype.contents = $util.newBuffer([]); - - /** - * SpecContents mimeType. - * @member {string} mimeType - * @memberof google.cloud.apihub.v1.SpecContents - * @instance - */ - SpecContents.prototype.mimeType = ""; - - /** - * Creates a new SpecContents instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.SpecContents - * @static - * @param {google.cloud.apihub.v1.ISpecContents=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.SpecContents} SpecContents instance - */ - SpecContents.create = function create(properties) { - return new SpecContents(properties); - }; - - /** - * Encodes the specified SpecContents message. Does not implicitly {@link google.cloud.apihub.v1.SpecContents.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.SpecContents - * @static - * @param {google.cloud.apihub.v1.ISpecContents} message SpecContents message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SpecContents.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.contents != null && Object.hasOwnProperty.call(message, "contents")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.contents); - if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.mimeType); - return writer; - }; - - /** - * Encodes the specified SpecContents message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.SpecContents.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.SpecContents - * @static - * @param {google.cloud.apihub.v1.ISpecContents} message SpecContents message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SpecContents.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SpecContents message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.SpecContents - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.SpecContents} SpecContents - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SpecContents.decode = function 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.apihub.v1.SpecContents(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.contents = reader.bytes(); - break; - } - case 2: { - message.mimeType = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SpecContents message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.SpecContents - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.SpecContents} SpecContents - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SpecContents.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SpecContents message. - * @function verify - * @memberof google.cloud.apihub.v1.SpecContents - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SpecContents.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.contents != null && message.hasOwnProperty("contents")) - if (!(message.contents && typeof message.contents.length === "number" || $util.isString(message.contents))) - return "contents: buffer expected"; - if (message.mimeType != null && message.hasOwnProperty("mimeType")) - if (!$util.isString(message.mimeType)) - return "mimeType: string expected"; - return null; - }; - - /** - * Creates a SpecContents message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.SpecContents - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.SpecContents} SpecContents - */ - SpecContents.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.SpecContents) - return object; - var message = new $root.google.cloud.apihub.v1.SpecContents(); - if (object.contents != null) - if (typeof object.contents === "string") - $util.base64.decode(object.contents, message.contents = $util.newBuffer($util.base64.length(object.contents)), 0); - else if (object.contents.length >= 0) - message.contents = object.contents; - if (object.mimeType != null) - message.mimeType = String(object.mimeType); - return message; - }; - - /** - * Creates a plain object from a SpecContents message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.SpecContents - * @static - * @param {google.cloud.apihub.v1.SpecContents} message SpecContents - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SpecContents.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.contents = ""; - else { - object.contents = []; - if (options.bytes !== Array) - object.contents = $util.newBuffer(object.contents); - } - object.mimeType = ""; - } - if (message.contents != null && message.hasOwnProperty("contents")) - object.contents = options.bytes === String ? $util.base64.encode(message.contents, 0, message.contents.length) : options.bytes === Array ? Array.prototype.slice.call(message.contents) : message.contents; - if (message.mimeType != null && message.hasOwnProperty("mimeType")) - object.mimeType = message.mimeType; - return object; - }; - - /** - * Converts this SpecContents to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.SpecContents - * @instance - * @returns {Object.} JSON object - */ - SpecContents.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SpecContents - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.SpecContents - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SpecContents.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.SpecContents"; - }; - - return SpecContents; - })(); - - v1.SpecDetails = (function() { - - /** - * Properties of a SpecDetails. - * @memberof google.cloud.apihub.v1 - * @interface ISpecDetails - * @property {google.cloud.apihub.v1.IOpenApiSpecDetails|null} [openApiSpecDetails] SpecDetails openApiSpecDetails - * @property {string|null} [description] SpecDetails description - */ - - /** - * Constructs a new SpecDetails. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents a SpecDetails. - * @implements ISpecDetails - * @constructor - * @param {google.cloud.apihub.v1.ISpecDetails=} [properties] Properties to set - */ - function SpecDetails(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]]; - } - - /** - * SpecDetails openApiSpecDetails. - * @member {google.cloud.apihub.v1.IOpenApiSpecDetails|null|undefined} openApiSpecDetails - * @memberof google.cloud.apihub.v1.SpecDetails - * @instance - */ - SpecDetails.prototype.openApiSpecDetails = null; - - /** - * SpecDetails description. - * @member {string} description - * @memberof google.cloud.apihub.v1.SpecDetails - * @instance - */ - SpecDetails.prototype.description = ""; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * SpecDetails details. - * @member {"openApiSpecDetails"|undefined} details - * @memberof google.cloud.apihub.v1.SpecDetails - * @instance - */ - Object.defineProperty(SpecDetails.prototype, "details", { - get: $util.oneOfGetter($oneOfFields = ["openApiSpecDetails"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new SpecDetails instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.SpecDetails - * @static - * @param {google.cloud.apihub.v1.ISpecDetails=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.SpecDetails} SpecDetails instance - */ - SpecDetails.create = function create(properties) { - return new SpecDetails(properties); - }; - - /** - * Encodes the specified SpecDetails message. Does not implicitly {@link google.cloud.apihub.v1.SpecDetails.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.SpecDetails - * @static - * @param {google.cloud.apihub.v1.ISpecDetails} message SpecDetails message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SpecDetails.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.description); - if (message.openApiSpecDetails != null && Object.hasOwnProperty.call(message, "openApiSpecDetails")) - $root.google.cloud.apihub.v1.OpenApiSpecDetails.encode(message.openApiSpecDetails, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified SpecDetails message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.SpecDetails.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.SpecDetails - * @static - * @param {google.cloud.apihub.v1.ISpecDetails} message SpecDetails message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SpecDetails.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SpecDetails message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.SpecDetails - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.SpecDetails} SpecDetails - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SpecDetails.decode = function 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.apihub.v1.SpecDetails(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 2: { - message.openApiSpecDetails = $root.google.cloud.apihub.v1.OpenApiSpecDetails.decode(reader, reader.uint32()); - break; - } - case 1: { - message.description = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SpecDetails message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.SpecDetails - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.SpecDetails} SpecDetails - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SpecDetails.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SpecDetails message. - * @function verify - * @memberof google.cloud.apihub.v1.SpecDetails - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SpecDetails.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.openApiSpecDetails != null && message.hasOwnProperty("openApiSpecDetails")) { - properties.details = 1; - { - var error = $root.google.cloud.apihub.v1.OpenApiSpecDetails.verify(message.openApiSpecDetails); - if (error) - return "openApiSpecDetails." + error; - } - } - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - return null; - }; - - /** - * Creates a SpecDetails message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.SpecDetails - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.SpecDetails} SpecDetails - */ - SpecDetails.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.SpecDetails) - return object; - var message = new $root.google.cloud.apihub.v1.SpecDetails(); - if (object.openApiSpecDetails != null) { - if (typeof object.openApiSpecDetails !== "object") - throw TypeError(".google.cloud.apihub.v1.SpecDetails.openApiSpecDetails: object expected"); - message.openApiSpecDetails = $root.google.cloud.apihub.v1.OpenApiSpecDetails.fromObject(object.openApiSpecDetails); - } - if (object.description != null) - message.description = String(object.description); - return message; - }; - - /** - * Creates a plain object from a SpecDetails message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.SpecDetails - * @static - * @param {google.cloud.apihub.v1.SpecDetails} message SpecDetails - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SpecDetails.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.description = ""; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.openApiSpecDetails != null && message.hasOwnProperty("openApiSpecDetails")) { - object.openApiSpecDetails = $root.google.cloud.apihub.v1.OpenApiSpecDetails.toObject(message.openApiSpecDetails, options); - if (options.oneofs) - object.details = "openApiSpecDetails"; - } - return object; - }; - - /** - * Converts this SpecDetails to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.SpecDetails - * @instance - * @returns {Object.} JSON object - */ - SpecDetails.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SpecDetails - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.SpecDetails - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SpecDetails.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.SpecDetails"; - }; - - return SpecDetails; - })(); - - v1.OpenApiSpecDetails = (function() { - - /** - * Properties of an OpenApiSpecDetails. - * @memberof google.cloud.apihub.v1 - * @interface IOpenApiSpecDetails - * @property {google.cloud.apihub.v1.OpenApiSpecDetails.Format|null} [format] OpenApiSpecDetails format - * @property {string|null} [version] OpenApiSpecDetails version - * @property {google.cloud.apihub.v1.IOwner|null} [owner] OpenApiSpecDetails owner - */ - - /** - * Constructs a new OpenApiSpecDetails. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents an OpenApiSpecDetails. - * @implements IOpenApiSpecDetails - * @constructor - * @param {google.cloud.apihub.v1.IOpenApiSpecDetails=} [properties] Properties to set - */ - function OpenApiSpecDetails(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]]; - } - - /** - * OpenApiSpecDetails format. - * @member {google.cloud.apihub.v1.OpenApiSpecDetails.Format} format - * @memberof google.cloud.apihub.v1.OpenApiSpecDetails - * @instance - */ - OpenApiSpecDetails.prototype.format = 0; - - /** - * OpenApiSpecDetails version. - * @member {string} version - * @memberof google.cloud.apihub.v1.OpenApiSpecDetails - * @instance - */ - OpenApiSpecDetails.prototype.version = ""; - - /** - * OpenApiSpecDetails owner. - * @member {google.cloud.apihub.v1.IOwner|null|undefined} owner - * @memberof google.cloud.apihub.v1.OpenApiSpecDetails - * @instance - */ - OpenApiSpecDetails.prototype.owner = null; - - /** - * Creates a new OpenApiSpecDetails instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.OpenApiSpecDetails - * @static - * @param {google.cloud.apihub.v1.IOpenApiSpecDetails=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.OpenApiSpecDetails} OpenApiSpecDetails instance - */ - OpenApiSpecDetails.create = function create(properties) { - return new OpenApiSpecDetails(properties); - }; - - /** - * Encodes the specified OpenApiSpecDetails message. Does not implicitly {@link google.cloud.apihub.v1.OpenApiSpecDetails.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.OpenApiSpecDetails - * @static - * @param {google.cloud.apihub.v1.IOpenApiSpecDetails} message OpenApiSpecDetails message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OpenApiSpecDetails.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.format != null && Object.hasOwnProperty.call(message, "format")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.format); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.version); - if (message.owner != null && Object.hasOwnProperty.call(message, "owner")) - $root.google.cloud.apihub.v1.Owner.encode(message.owner, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified OpenApiSpecDetails message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.OpenApiSpecDetails.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.OpenApiSpecDetails - * @static - * @param {google.cloud.apihub.v1.IOpenApiSpecDetails} message OpenApiSpecDetails message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OpenApiSpecDetails.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OpenApiSpecDetails message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.OpenApiSpecDetails - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.OpenApiSpecDetails} OpenApiSpecDetails - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OpenApiSpecDetails.decode = function 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.apihub.v1.OpenApiSpecDetails(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.format = reader.int32(); - break; - } - case 2: { - message.version = reader.string(); - break; - } - case 3: { - message.owner = $root.google.cloud.apihub.v1.Owner.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OpenApiSpecDetails message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.OpenApiSpecDetails - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.OpenApiSpecDetails} OpenApiSpecDetails - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OpenApiSpecDetails.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OpenApiSpecDetails message. - * @function verify - * @memberof google.cloud.apihub.v1.OpenApiSpecDetails - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OpenApiSpecDetails.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.format != null && message.hasOwnProperty("format")) - switch (message.format) { - default: - return "format: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.version != null && message.hasOwnProperty("version")) - if (!$util.isString(message.version)) - return "version: string expected"; - if (message.owner != null && message.hasOwnProperty("owner")) { - var error = $root.google.cloud.apihub.v1.Owner.verify(message.owner); - if (error) - return "owner." + error; - } - return null; - }; - - /** - * Creates an OpenApiSpecDetails message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.OpenApiSpecDetails - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.OpenApiSpecDetails} OpenApiSpecDetails - */ - OpenApiSpecDetails.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.OpenApiSpecDetails) - return object; - var message = new $root.google.cloud.apihub.v1.OpenApiSpecDetails(); - switch (object.format) { - default: - if (typeof object.format === "number") { - message.format = object.format; - break; - } - break; - case "FORMAT_UNSPECIFIED": - case 0: - message.format = 0; - break; - case "OPEN_API_SPEC_2_0": - case 1: - message.format = 1; - break; - case "OPEN_API_SPEC_3_0": - case 2: - message.format = 2; - break; - case "OPEN_API_SPEC_3_1": - case 3: - message.format = 3; - break; - } - if (object.version != null) - message.version = String(object.version); - if (object.owner != null) { - if (typeof object.owner !== "object") - throw TypeError(".google.cloud.apihub.v1.OpenApiSpecDetails.owner: object expected"); - message.owner = $root.google.cloud.apihub.v1.Owner.fromObject(object.owner); - } - return message; - }; - - /** - * Creates a plain object from an OpenApiSpecDetails message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.OpenApiSpecDetails - * @static - * @param {google.cloud.apihub.v1.OpenApiSpecDetails} message OpenApiSpecDetails - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OpenApiSpecDetails.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.format = options.enums === String ? "FORMAT_UNSPECIFIED" : 0; - object.version = ""; - object.owner = null; - } - if (message.format != null && message.hasOwnProperty("format")) - object.format = options.enums === String ? $root.google.cloud.apihub.v1.OpenApiSpecDetails.Format[message.format] === undefined ? message.format : $root.google.cloud.apihub.v1.OpenApiSpecDetails.Format[message.format] : message.format; - if (message.version != null && message.hasOwnProperty("version")) - object.version = message.version; - if (message.owner != null && message.hasOwnProperty("owner")) - object.owner = $root.google.cloud.apihub.v1.Owner.toObject(message.owner, options); - return object; - }; - - /** - * Converts this OpenApiSpecDetails to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.OpenApiSpecDetails - * @instance - * @returns {Object.} JSON object - */ - OpenApiSpecDetails.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for OpenApiSpecDetails - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.OpenApiSpecDetails - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OpenApiSpecDetails.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.OpenApiSpecDetails"; - }; - - /** - * Format enum. - * @name google.cloud.apihub.v1.OpenApiSpecDetails.Format - * @enum {number} - * @property {number} FORMAT_UNSPECIFIED=0 FORMAT_UNSPECIFIED value - * @property {number} OPEN_API_SPEC_2_0=1 OPEN_API_SPEC_2_0 value - * @property {number} OPEN_API_SPEC_3_0=2 OPEN_API_SPEC_3_0 value - * @property {number} OPEN_API_SPEC_3_1=3 OPEN_API_SPEC_3_1 value - */ - OpenApiSpecDetails.Format = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "FORMAT_UNSPECIFIED"] = 0; - values[valuesById[1] = "OPEN_API_SPEC_2_0"] = 1; - values[valuesById[2] = "OPEN_API_SPEC_3_0"] = 2; - values[valuesById[3] = "OPEN_API_SPEC_3_1"] = 3; - return values; - })(); - - return OpenApiSpecDetails; - })(); - - v1.OperationDetails = (function() { - - /** - * Properties of an OperationDetails. - * @memberof google.cloud.apihub.v1 - * @interface IOperationDetails - * @property {google.cloud.apihub.v1.IHttpOperation|null} [httpOperation] OperationDetails httpOperation - * @property {string|null} [description] OperationDetails description - * @property {google.cloud.apihub.v1.IDocumentation|null} [documentation] OperationDetails documentation - * @property {boolean|null} [deprecated] OperationDetails deprecated - */ - - /** - * Constructs a new OperationDetails. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents an OperationDetails. - * @implements IOperationDetails - * @constructor - * @param {google.cloud.apihub.v1.IOperationDetails=} [properties] Properties to set - */ - function OperationDetails(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]]; - } - - /** - * OperationDetails httpOperation. - * @member {google.cloud.apihub.v1.IHttpOperation|null|undefined} httpOperation - * @memberof google.cloud.apihub.v1.OperationDetails - * @instance - */ - OperationDetails.prototype.httpOperation = null; - - /** - * OperationDetails description. - * @member {string} description - * @memberof google.cloud.apihub.v1.OperationDetails - * @instance - */ - OperationDetails.prototype.description = ""; - - /** - * OperationDetails documentation. - * @member {google.cloud.apihub.v1.IDocumentation|null|undefined} documentation - * @memberof google.cloud.apihub.v1.OperationDetails - * @instance - */ - OperationDetails.prototype.documentation = null; - - /** - * OperationDetails deprecated. - * @member {boolean} deprecated - * @memberof google.cloud.apihub.v1.OperationDetails - * @instance - */ - OperationDetails.prototype.deprecated = false; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * OperationDetails operation. - * @member {"httpOperation"|undefined} operation - * @memberof google.cloud.apihub.v1.OperationDetails - * @instance - */ - Object.defineProperty(OperationDetails.prototype, "operation", { - get: $util.oneOfGetter($oneOfFields = ["httpOperation"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new OperationDetails instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.OperationDetails - * @static - * @param {google.cloud.apihub.v1.IOperationDetails=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.OperationDetails} OperationDetails instance - */ - OperationDetails.create = function create(properties) { - return new OperationDetails(properties); - }; - - /** - * Encodes the specified OperationDetails message. Does not implicitly {@link google.cloud.apihub.v1.OperationDetails.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.OperationDetails - * @static - * @param {google.cloud.apihub.v1.IOperationDetails} message OperationDetails message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OperationDetails.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.description); - if (message.documentation != null && Object.hasOwnProperty.call(message, "documentation")) - $root.google.cloud.apihub.v1.Documentation.encode(message.documentation, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.httpOperation != null && Object.hasOwnProperty.call(message, "httpOperation")) - $root.google.cloud.apihub.v1.HttpOperation.encode(message.httpOperation, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified OperationDetails message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.OperationDetails.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.OperationDetails - * @static - * @param {google.cloud.apihub.v1.IOperationDetails} message OperationDetails message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OperationDetails.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OperationDetails message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.OperationDetails - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.OperationDetails} OperationDetails - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OperationDetails.decode = function 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.apihub.v1.OperationDetails(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 4: { - message.httpOperation = $root.google.cloud.apihub.v1.HttpOperation.decode(reader, reader.uint32()); - break; - } - case 1: { - message.description = reader.string(); - break; - } - case 2: { - message.documentation = $root.google.cloud.apihub.v1.Documentation.decode(reader, reader.uint32()); - break; - } - case 3: { - message.deprecated = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OperationDetails message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.OperationDetails - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.OperationDetails} OperationDetails - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OperationDetails.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OperationDetails message. - * @function verify - * @memberof google.cloud.apihub.v1.OperationDetails - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OperationDetails.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.httpOperation != null && message.hasOwnProperty("httpOperation")) { - properties.operation = 1; - { - var error = $root.google.cloud.apihub.v1.HttpOperation.verify(message.httpOperation); - if (error) - return "httpOperation." + error; - } - } - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.documentation != null && message.hasOwnProperty("documentation")) { - var error = $root.google.cloud.apihub.v1.Documentation.verify(message.documentation); - if (error) - return "documentation." + error; - } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - return null; - }; - - /** - * Creates an OperationDetails message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.OperationDetails - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.OperationDetails} OperationDetails - */ - OperationDetails.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.OperationDetails) - return object; - var message = new $root.google.cloud.apihub.v1.OperationDetails(); - if (object.httpOperation != null) { - if (typeof object.httpOperation !== "object") - throw TypeError(".google.cloud.apihub.v1.OperationDetails.httpOperation: object expected"); - message.httpOperation = $root.google.cloud.apihub.v1.HttpOperation.fromObject(object.httpOperation); - } - if (object.description != null) - message.description = String(object.description); - if (object.documentation != null) { - if (typeof object.documentation !== "object") - throw TypeError(".google.cloud.apihub.v1.OperationDetails.documentation: object expected"); - message.documentation = $root.google.cloud.apihub.v1.Documentation.fromObject(object.documentation); - } - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - return message; - }; - - /** - * Creates a plain object from an OperationDetails message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.OperationDetails - * @static - * @param {google.cloud.apihub.v1.OperationDetails} message OperationDetails - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OperationDetails.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.description = ""; - object.documentation = null; - object.deprecated = false; - } - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.documentation != null && message.hasOwnProperty("documentation")) - object.documentation = $root.google.cloud.apihub.v1.Documentation.toObject(message.documentation, options); - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.httpOperation != null && message.hasOwnProperty("httpOperation")) { - object.httpOperation = $root.google.cloud.apihub.v1.HttpOperation.toObject(message.httpOperation, options); - if (options.oneofs) - object.operation = "httpOperation"; - } - return object; - }; - - /** - * Converts this OperationDetails to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.OperationDetails - * @instance - * @returns {Object.} JSON object - */ - OperationDetails.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for OperationDetails - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.OperationDetails - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OperationDetails.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.OperationDetails"; - }; - - return OperationDetails; - })(); - - v1.HttpOperation = (function() { - - /** - * Properties of a HttpOperation. - * @memberof google.cloud.apihub.v1 - * @interface IHttpOperation - * @property {google.cloud.apihub.v1.IPath|null} [path] HttpOperation path - * @property {google.cloud.apihub.v1.HttpOperation.Method|null} [method] HttpOperation method - */ - - /** - * Constructs a new HttpOperation. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents a HttpOperation. - * @implements IHttpOperation - * @constructor - * @param {google.cloud.apihub.v1.IHttpOperation=} [properties] Properties to set - */ - function HttpOperation(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]]; - } - - /** - * HttpOperation path. - * @member {google.cloud.apihub.v1.IPath|null|undefined} path - * @memberof google.cloud.apihub.v1.HttpOperation - * @instance - */ - HttpOperation.prototype.path = null; - - /** - * HttpOperation method. - * @member {google.cloud.apihub.v1.HttpOperation.Method} method - * @memberof google.cloud.apihub.v1.HttpOperation - * @instance - */ - HttpOperation.prototype.method = 0; - - /** - * Creates a new HttpOperation instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.HttpOperation - * @static - * @param {google.cloud.apihub.v1.IHttpOperation=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.HttpOperation} HttpOperation instance - */ - HttpOperation.create = function create(properties) { - return new HttpOperation(properties); - }; - - /** - * Encodes the specified HttpOperation message. Does not implicitly {@link google.cloud.apihub.v1.HttpOperation.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.HttpOperation - * @static - * @param {google.cloud.apihub.v1.IHttpOperation} message HttpOperation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HttpOperation.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.path != null && Object.hasOwnProperty.call(message, "path")) - $root.google.cloud.apihub.v1.Path.encode(message.path, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.method != null && Object.hasOwnProperty.call(message, "method")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.method); - return writer; - }; - - /** - * Encodes the specified HttpOperation message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.HttpOperation.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.HttpOperation - * @static - * @param {google.cloud.apihub.v1.IHttpOperation} message HttpOperation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HttpOperation.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a HttpOperation message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.HttpOperation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.HttpOperation} HttpOperation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HttpOperation.decode = function 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.apihub.v1.HttpOperation(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.path = $root.google.cloud.apihub.v1.Path.decode(reader, reader.uint32()); - break; - } - case 2: { - message.method = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a HttpOperation message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.HttpOperation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.HttpOperation} HttpOperation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HttpOperation.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a HttpOperation message. - * @function verify - * @memberof google.cloud.apihub.v1.HttpOperation - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - HttpOperation.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.path != null && message.hasOwnProperty("path")) { - var error = $root.google.cloud.apihub.v1.Path.verify(message.path); - if (error) - return "path." + error; - } - if (message.method != null && message.hasOwnProperty("method")) - switch (message.method) { - default: - return "method: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - break; - } - return null; - }; - - /** - * Creates a HttpOperation message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.HttpOperation - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.HttpOperation} HttpOperation - */ - HttpOperation.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.HttpOperation) - return object; - var message = new $root.google.cloud.apihub.v1.HttpOperation(); - if (object.path != null) { - if (typeof object.path !== "object") - throw TypeError(".google.cloud.apihub.v1.HttpOperation.path: object expected"); - message.path = $root.google.cloud.apihub.v1.Path.fromObject(object.path); - } - switch (object.method) { - default: - if (typeof object.method === "number") { - message.method = object.method; - break; - } - break; - case "METHOD_UNSPECIFIED": - case 0: - message.method = 0; - break; - case "GET": - case 1: - message.method = 1; - break; - case "PUT": - case 2: - message.method = 2; - break; - case "POST": - case 3: - message.method = 3; - break; - case "DELETE": - case 4: - message.method = 4; - break; - case "OPTIONS": - case 5: - message.method = 5; - break; - case "HEAD": - case 6: - message.method = 6; - break; - case "PATCH": - case 7: - message.method = 7; - break; - case "TRACE": - case 8: - message.method = 8; - break; - } - return message; - }; - - /** - * Creates a plain object from a HttpOperation message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.HttpOperation - * @static - * @param {google.cloud.apihub.v1.HttpOperation} message HttpOperation - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - HttpOperation.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.path = null; - object.method = options.enums === String ? "METHOD_UNSPECIFIED" : 0; - } - if (message.path != null && message.hasOwnProperty("path")) - object.path = $root.google.cloud.apihub.v1.Path.toObject(message.path, options); - if (message.method != null && message.hasOwnProperty("method")) - object.method = options.enums === String ? $root.google.cloud.apihub.v1.HttpOperation.Method[message.method] === undefined ? message.method : $root.google.cloud.apihub.v1.HttpOperation.Method[message.method] : message.method; - return object; - }; - - /** - * Converts this HttpOperation to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.HttpOperation - * @instance - * @returns {Object.} JSON object - */ - HttpOperation.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for HttpOperation - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.HttpOperation - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - HttpOperation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.HttpOperation"; - }; - - /** - * Method enum. - * @name google.cloud.apihub.v1.HttpOperation.Method - * @enum {number} - * @property {number} METHOD_UNSPECIFIED=0 METHOD_UNSPECIFIED value - * @property {number} GET=1 GET value - * @property {number} PUT=2 PUT value - * @property {number} POST=3 POST value - * @property {number} DELETE=4 DELETE value - * @property {number} OPTIONS=5 OPTIONS value - * @property {number} HEAD=6 HEAD value - * @property {number} PATCH=7 PATCH value - * @property {number} TRACE=8 TRACE value - */ - HttpOperation.Method = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "METHOD_UNSPECIFIED"] = 0; - values[valuesById[1] = "GET"] = 1; - values[valuesById[2] = "PUT"] = 2; - values[valuesById[3] = "POST"] = 3; - values[valuesById[4] = "DELETE"] = 4; - values[valuesById[5] = "OPTIONS"] = 5; - values[valuesById[6] = "HEAD"] = 6; - values[valuesById[7] = "PATCH"] = 7; - values[valuesById[8] = "TRACE"] = 8; - return values; - })(); - - return HttpOperation; - })(); - - v1.Path = (function() { - - /** - * Properties of a Path. - * @memberof google.cloud.apihub.v1 - * @interface IPath - * @property {string|null} [path] Path path - * @property {string|null} [description] Path description - */ - - /** - * Constructs a new Path. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents a Path. - * @implements IPath - * @constructor - * @param {google.cloud.apihub.v1.IPath=} [properties] Properties to set - */ - function Path(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]]; - } - - /** - * Path path. - * @member {string} path - * @memberof google.cloud.apihub.v1.Path - * @instance - */ - Path.prototype.path = ""; - - /** - * Path description. - * @member {string} description - * @memberof google.cloud.apihub.v1.Path - * @instance - */ - Path.prototype.description = ""; - - /** - * Creates a new Path instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.Path - * @static - * @param {google.cloud.apihub.v1.IPath=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.Path} Path instance - */ - Path.create = function create(properties) { - return new Path(properties); - }; - - /** - * Encodes the specified Path message. Does not implicitly {@link google.cloud.apihub.v1.Path.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.Path - * @static - * @param {google.cloud.apihub.v1.IPath} message Path message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Path.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.path != null && Object.hasOwnProperty.call(message, "path")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.path); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); - return writer; - }; - - /** - * Encodes the specified Path message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.Path.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.Path - * @static - * @param {google.cloud.apihub.v1.IPath} message Path message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Path.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Path message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.Path - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.Path} Path - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Path.decode = function 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.apihub.v1.Path(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.path = reader.string(); - break; - } - case 2: { - message.description = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Path message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.Path - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.Path} Path - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Path.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Path message. - * @function verify - * @memberof google.cloud.apihub.v1.Path - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Path.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.path != null && message.hasOwnProperty("path")) - if (!$util.isString(message.path)) - return "path: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - return null; - }; - - /** - * Creates a Path message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.Path - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.Path} Path - */ - Path.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.Path) - return object; - var message = new $root.google.cloud.apihub.v1.Path(); - if (object.path != null) - message.path = String(object.path); - if (object.description != null) - message.description = String(object.description); - return message; - }; - - /** - * Creates a plain object from a Path message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.Path - * @static - * @param {google.cloud.apihub.v1.Path} message Path - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Path.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.path = ""; - object.description = ""; - } - if (message.path != null && message.hasOwnProperty("path")) - object.path = message.path; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - return object; - }; - - /** - * Converts this Path to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.Path - * @instance - * @returns {Object.} JSON object - */ - Path.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Path - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.Path - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Path.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.Path"; - }; - - return Path; - })(); - - v1.Schema = (function() { - - /** - * Properties of a Schema. - * @memberof google.cloud.apihub.v1 - * @interface ISchema - * @property {string|null} [displayName] Schema displayName - * @property {Uint8Array|null} [rawValue] Schema rawValue - */ - - /** - * Constructs a new Schema. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents a Schema. - * @implements ISchema - * @constructor - * @param {google.cloud.apihub.v1.ISchema=} [properties] Properties to set - */ - function Schema(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]]; - } - - /** - * Schema displayName. - * @member {string} displayName - * @memberof google.cloud.apihub.v1.Schema - * @instance - */ - Schema.prototype.displayName = ""; - - /** - * Schema rawValue. - * @member {Uint8Array} rawValue - * @memberof google.cloud.apihub.v1.Schema - * @instance - */ - Schema.prototype.rawValue = $util.newBuffer([]); - - /** - * Creates a new Schema instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.Schema - * @static - * @param {google.cloud.apihub.v1.ISchema=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.Schema} Schema instance - */ - Schema.create = function create(properties) { - return new Schema(properties); - }; - - /** - * Encodes the specified Schema message. Does not implicitly {@link google.cloud.apihub.v1.Schema.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.Schema - * @static - * @param {google.cloud.apihub.v1.ISchema} message Schema message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Schema.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.displayName); - if (message.rawValue != null && Object.hasOwnProperty.call(message, "rawValue")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.rawValue); - return writer; - }; - - /** - * Encodes the specified Schema message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.Schema.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.Schema - * @static - * @param {google.cloud.apihub.v1.ISchema} message Schema message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Schema.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Schema message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.Schema - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.Schema} Schema - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Schema.decode = function 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.apihub.v1.Schema(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.displayName = reader.string(); - break; - } - case 2: { - message.rawValue = reader.bytes(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Schema message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.Schema - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.Schema} Schema - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Schema.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Schema message. - * @function verify - * @memberof google.cloud.apihub.v1.Schema - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Schema.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - if (message.rawValue != null && message.hasOwnProperty("rawValue")) - if (!(message.rawValue && typeof message.rawValue.length === "number" || $util.isString(message.rawValue))) - return "rawValue: buffer expected"; - return null; - }; - - /** - * Creates a Schema message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.Schema - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.Schema} Schema - */ - Schema.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.Schema) - return object; - var message = new $root.google.cloud.apihub.v1.Schema(); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.rawValue != null) - if (typeof object.rawValue === "string") - $util.base64.decode(object.rawValue, message.rawValue = $util.newBuffer($util.base64.length(object.rawValue)), 0); - else if (object.rawValue.length >= 0) - message.rawValue = object.rawValue; - return message; - }; - - /** - * Creates a plain object from a Schema message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.Schema - * @static - * @param {google.cloud.apihub.v1.Schema} message Schema - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Schema.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.displayName = ""; - if (options.bytes === String) - object.rawValue = ""; - else { - object.rawValue = []; - if (options.bytes !== Array) - object.rawValue = $util.newBuffer(object.rawValue); - } - } - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.rawValue != null && message.hasOwnProperty("rawValue")) - object.rawValue = options.bytes === String ? $util.base64.encode(message.rawValue, 0, message.rawValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.rawValue) : message.rawValue; - return object; - }; - - /** - * Converts this Schema to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.Schema - * @instance - * @returns {Object.} JSON object - */ - Schema.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Schema - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.Schema - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Schema.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.Schema"; - }; - - return Schema; - })(); - - v1.Owner = (function() { - - /** - * Properties of an Owner. - * @memberof google.cloud.apihub.v1 - * @interface IOwner - * @property {string|null} [displayName] Owner displayName - * @property {string|null} [email] Owner email - */ - - /** - * Constructs a new Owner. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents an Owner. - * @implements IOwner - * @constructor - * @param {google.cloud.apihub.v1.IOwner=} [properties] Properties to set - */ - function Owner(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]]; - } - - /** - * Owner displayName. - * @member {string} displayName - * @memberof google.cloud.apihub.v1.Owner - * @instance - */ - Owner.prototype.displayName = ""; - - /** - * Owner email. - * @member {string} email - * @memberof google.cloud.apihub.v1.Owner - * @instance - */ - Owner.prototype.email = ""; - - /** - * Creates a new Owner instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.Owner - * @static - * @param {google.cloud.apihub.v1.IOwner=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.Owner} Owner instance - */ - Owner.create = function create(properties) { - return new Owner(properties); - }; - - /** - * Encodes the specified Owner message. Does not implicitly {@link google.cloud.apihub.v1.Owner.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.Owner - * @static - * @param {google.cloud.apihub.v1.IOwner} message Owner message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Owner.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.displayName); - if (message.email != null && Object.hasOwnProperty.call(message, "email")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.email); - return writer; - }; - - /** - * Encodes the specified Owner message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.Owner.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.Owner - * @static - * @param {google.cloud.apihub.v1.IOwner} message Owner message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Owner.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Owner message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.Owner - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.Owner} Owner - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Owner.decode = function 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.apihub.v1.Owner(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.displayName = reader.string(); - break; - } - case 2: { - message.email = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Owner message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.Owner - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.Owner} Owner - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Owner.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Owner message. - * @function verify - * @memberof google.cloud.apihub.v1.Owner - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Owner.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - if (message.email != null && message.hasOwnProperty("email")) - if (!$util.isString(message.email)) - return "email: string expected"; - return null; - }; - - /** - * Creates an Owner message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.Owner - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.Owner} Owner - */ - Owner.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.Owner) - return object; - var message = new $root.google.cloud.apihub.v1.Owner(); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.email != null) - message.email = String(object.email); - return message; - }; - - /** - * Creates a plain object from an Owner message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.Owner - * @static - * @param {google.cloud.apihub.v1.Owner} message Owner - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Owner.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.displayName = ""; - object.email = ""; - } - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.email != null && message.hasOwnProperty("email")) - object.email = message.email; - return object; - }; - - /** - * Converts this Owner to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.Owner - * @instance - * @returns {Object.} JSON object - */ - Owner.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Owner - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.Owner - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Owner.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.Owner"; - }; - - return Owner; - })(); - - v1.Documentation = (function() { - - /** - * Properties of a Documentation. - * @memberof google.cloud.apihub.v1 - * @interface IDocumentation - * @property {string|null} [externalUri] Documentation externalUri - */ - - /** - * Constructs a new Documentation. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents a Documentation. - * @implements IDocumentation - * @constructor - * @param {google.cloud.apihub.v1.IDocumentation=} [properties] Properties to set - */ - function Documentation(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]]; - } - - /** - * Documentation externalUri. - * @member {string} externalUri - * @memberof google.cloud.apihub.v1.Documentation - * @instance - */ - Documentation.prototype.externalUri = ""; - - /** - * Creates a new Documentation instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.Documentation - * @static - * @param {google.cloud.apihub.v1.IDocumentation=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.Documentation} Documentation instance - */ - Documentation.create = function create(properties) { - return new Documentation(properties); - }; - - /** - * Encodes the specified Documentation message. Does not implicitly {@link google.cloud.apihub.v1.Documentation.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.Documentation - * @static - * @param {google.cloud.apihub.v1.IDocumentation} message Documentation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Documentation.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.externalUri != null && Object.hasOwnProperty.call(message, "externalUri")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.externalUri); - return writer; - }; - - /** - * Encodes the specified Documentation message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.Documentation.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.Documentation - * @static - * @param {google.cloud.apihub.v1.IDocumentation} message Documentation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Documentation.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Documentation message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.Documentation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.Documentation} Documentation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Documentation.decode = function 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.apihub.v1.Documentation(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.externalUri = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Documentation message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.Documentation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.Documentation} Documentation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Documentation.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Documentation message. - * @function verify - * @memberof google.cloud.apihub.v1.Documentation - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Documentation.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.externalUri != null && message.hasOwnProperty("externalUri")) - if (!$util.isString(message.externalUri)) - return "externalUri: string expected"; - return null; - }; - - /** - * Creates a Documentation message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.Documentation - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.Documentation} Documentation - */ - Documentation.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.Documentation) - return object; - var message = new $root.google.cloud.apihub.v1.Documentation(); - if (object.externalUri != null) - message.externalUri = String(object.externalUri); - return message; - }; - - /** - * Creates a plain object from a Documentation message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.Documentation - * @static - * @param {google.cloud.apihub.v1.Documentation} message Documentation - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Documentation.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.externalUri = ""; - if (message.externalUri != null && message.hasOwnProperty("externalUri")) - object.externalUri = message.externalUri; - return object; - }; - - /** - * Converts this Documentation to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.Documentation - * @instance - * @returns {Object.} JSON object - */ - Documentation.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Documentation - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.Documentation - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Documentation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.Documentation"; - }; - - return Documentation; - })(); - - v1.AttributeValues = (function() { - - /** - * Properties of an AttributeValues. - * @memberof google.cloud.apihub.v1 - * @interface IAttributeValues - * @property {google.cloud.apihub.v1.AttributeValues.IEnumAttributeValues|null} [enumValues] AttributeValues enumValues - * @property {google.cloud.apihub.v1.AttributeValues.IStringAttributeValues|null} [stringValues] AttributeValues stringValues - * @property {google.cloud.apihub.v1.AttributeValues.IStringAttributeValues|null} [jsonValues] AttributeValues jsonValues - * @property {string|null} [attribute] AttributeValues attribute - */ - - /** - * Constructs a new AttributeValues. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents an AttributeValues. - * @implements IAttributeValues - * @constructor - * @param {google.cloud.apihub.v1.IAttributeValues=} [properties] Properties to set - */ - function AttributeValues(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]]; - } - - /** - * AttributeValues enumValues. - * @member {google.cloud.apihub.v1.AttributeValues.IEnumAttributeValues|null|undefined} enumValues - * @memberof google.cloud.apihub.v1.AttributeValues - * @instance - */ - AttributeValues.prototype.enumValues = null; - - /** - * AttributeValues stringValues. - * @member {google.cloud.apihub.v1.AttributeValues.IStringAttributeValues|null|undefined} stringValues - * @memberof google.cloud.apihub.v1.AttributeValues - * @instance - */ - AttributeValues.prototype.stringValues = null; - - /** - * AttributeValues jsonValues. - * @member {google.cloud.apihub.v1.AttributeValues.IStringAttributeValues|null|undefined} jsonValues - * @memberof google.cloud.apihub.v1.AttributeValues - * @instance - */ - AttributeValues.prototype.jsonValues = null; - - /** - * AttributeValues attribute. - * @member {string} attribute - * @memberof google.cloud.apihub.v1.AttributeValues - * @instance - */ - AttributeValues.prototype.attribute = ""; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * AttributeValues Value. - * @member {"enumValues"|"stringValues"|"jsonValues"|undefined} Value - * @memberof google.cloud.apihub.v1.AttributeValues - * @instance - */ - Object.defineProperty(AttributeValues.prototype, "Value", { - get: $util.oneOfGetter($oneOfFields = ["enumValues", "stringValues", "jsonValues"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new AttributeValues instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.AttributeValues - * @static - * @param {google.cloud.apihub.v1.IAttributeValues=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.AttributeValues} AttributeValues instance - */ - AttributeValues.create = function create(properties) { - return new AttributeValues(properties); - }; - - /** - * Encodes the specified AttributeValues message. Does not implicitly {@link google.cloud.apihub.v1.AttributeValues.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.AttributeValues - * @static - * @param {google.cloud.apihub.v1.IAttributeValues} message AttributeValues message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AttributeValues.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.attribute != null && Object.hasOwnProperty.call(message, "attribute")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.attribute); - if (message.enumValues != null && Object.hasOwnProperty.call(message, "enumValues")) - $root.google.cloud.apihub.v1.AttributeValues.EnumAttributeValues.encode(message.enumValues, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.stringValues != null && Object.hasOwnProperty.call(message, "stringValues")) - $root.google.cloud.apihub.v1.AttributeValues.StringAttributeValues.encode(message.stringValues, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.jsonValues != null && Object.hasOwnProperty.call(message, "jsonValues")) - $root.google.cloud.apihub.v1.AttributeValues.StringAttributeValues.encode(message.jsonValues, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified AttributeValues message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.AttributeValues.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.AttributeValues - * @static - * @param {google.cloud.apihub.v1.IAttributeValues} message AttributeValues message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AttributeValues.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AttributeValues message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.AttributeValues - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.AttributeValues} AttributeValues - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AttributeValues.decode = function 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.apihub.v1.AttributeValues(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 2: { - message.enumValues = $root.google.cloud.apihub.v1.AttributeValues.EnumAttributeValues.decode(reader, reader.uint32()); - break; - } - case 3: { - message.stringValues = $root.google.cloud.apihub.v1.AttributeValues.StringAttributeValues.decode(reader, reader.uint32()); - break; - } - case 4: { - message.jsonValues = $root.google.cloud.apihub.v1.AttributeValues.StringAttributeValues.decode(reader, reader.uint32()); - break; - } - case 1: { - message.attribute = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AttributeValues message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.AttributeValues - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.AttributeValues} AttributeValues - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AttributeValues.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AttributeValues message. - * @function verify - * @memberof google.cloud.apihub.v1.AttributeValues - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AttributeValues.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.enumValues != null && message.hasOwnProperty("enumValues")) { - properties.Value = 1; - { - var error = $root.google.cloud.apihub.v1.AttributeValues.EnumAttributeValues.verify(message.enumValues); - if (error) - return "enumValues." + error; - } - } - if (message.stringValues != null && message.hasOwnProperty("stringValues")) { - if (properties.Value === 1) - return "Value: multiple values"; - properties.Value = 1; - { - var error = $root.google.cloud.apihub.v1.AttributeValues.StringAttributeValues.verify(message.stringValues); - if (error) - return "stringValues." + error; - } - } - if (message.jsonValues != null && message.hasOwnProperty("jsonValues")) { - if (properties.Value === 1) - return "Value: multiple values"; - properties.Value = 1; - { - var error = $root.google.cloud.apihub.v1.AttributeValues.StringAttributeValues.verify(message.jsonValues); - if (error) - return "jsonValues." + error; - } - } - if (message.attribute != null && message.hasOwnProperty("attribute")) - if (!$util.isString(message.attribute)) - return "attribute: string expected"; - return null; - }; - - /** - * Creates an AttributeValues message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.AttributeValues - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.AttributeValues} AttributeValues - */ - AttributeValues.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.AttributeValues) - return object; - var message = new $root.google.cloud.apihub.v1.AttributeValues(); - if (object.enumValues != null) { - if (typeof object.enumValues !== "object") - throw TypeError(".google.cloud.apihub.v1.AttributeValues.enumValues: object expected"); - message.enumValues = $root.google.cloud.apihub.v1.AttributeValues.EnumAttributeValues.fromObject(object.enumValues); - } - if (object.stringValues != null) { - if (typeof object.stringValues !== "object") - throw TypeError(".google.cloud.apihub.v1.AttributeValues.stringValues: object expected"); - message.stringValues = $root.google.cloud.apihub.v1.AttributeValues.StringAttributeValues.fromObject(object.stringValues); - } - if (object.jsonValues != null) { - if (typeof object.jsonValues !== "object") - throw TypeError(".google.cloud.apihub.v1.AttributeValues.jsonValues: object expected"); - message.jsonValues = $root.google.cloud.apihub.v1.AttributeValues.StringAttributeValues.fromObject(object.jsonValues); - } - if (object.attribute != null) - message.attribute = String(object.attribute); - return message; - }; - - /** - * Creates a plain object from an AttributeValues message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.AttributeValues - * @static - * @param {google.cloud.apihub.v1.AttributeValues} message AttributeValues - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AttributeValues.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.attribute = ""; - if (message.attribute != null && message.hasOwnProperty("attribute")) - object.attribute = message.attribute; - if (message.enumValues != null && message.hasOwnProperty("enumValues")) { - object.enumValues = $root.google.cloud.apihub.v1.AttributeValues.EnumAttributeValues.toObject(message.enumValues, options); - if (options.oneofs) - object.Value = "enumValues"; - } - if (message.stringValues != null && message.hasOwnProperty("stringValues")) { - object.stringValues = $root.google.cloud.apihub.v1.AttributeValues.StringAttributeValues.toObject(message.stringValues, options); - if (options.oneofs) - object.Value = "stringValues"; - } - if (message.jsonValues != null && message.hasOwnProperty("jsonValues")) { - object.jsonValues = $root.google.cloud.apihub.v1.AttributeValues.StringAttributeValues.toObject(message.jsonValues, options); - if (options.oneofs) - object.Value = "jsonValues"; - } - return object; - }; - - /** - * Converts this AttributeValues to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.AttributeValues - * @instance - * @returns {Object.} JSON object - */ - AttributeValues.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AttributeValues - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.AttributeValues - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AttributeValues.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.AttributeValues"; - }; - - AttributeValues.EnumAttributeValues = (function() { - - /** - * Properties of an EnumAttributeValues. - * @memberof google.cloud.apihub.v1.AttributeValues - * @interface IEnumAttributeValues - * @property {Array.|null} [values] EnumAttributeValues values - */ - - /** - * Constructs a new EnumAttributeValues. - * @memberof google.cloud.apihub.v1.AttributeValues - * @classdesc Represents an EnumAttributeValues. - * @implements IEnumAttributeValues - * @constructor - * @param {google.cloud.apihub.v1.AttributeValues.IEnumAttributeValues=} [properties] Properties to set - */ - function EnumAttributeValues(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]]; - } - - /** - * EnumAttributeValues values. - * @member {Array.} values - * @memberof google.cloud.apihub.v1.AttributeValues.EnumAttributeValues - * @instance - */ - EnumAttributeValues.prototype.values = $util.emptyArray; - - /** - * Creates a new EnumAttributeValues instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.AttributeValues.EnumAttributeValues - * @static - * @param {google.cloud.apihub.v1.AttributeValues.IEnumAttributeValues=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.AttributeValues.EnumAttributeValues} EnumAttributeValues instance - */ - EnumAttributeValues.create = function create(properties) { - return new EnumAttributeValues(properties); - }; - - /** - * Encodes the specified EnumAttributeValues message. Does not implicitly {@link google.cloud.apihub.v1.AttributeValues.EnumAttributeValues.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.AttributeValues.EnumAttributeValues - * @static - * @param {google.cloud.apihub.v1.AttributeValues.IEnumAttributeValues} message EnumAttributeValues message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumAttributeValues.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.cloud.apihub.v1.Attribute.AllowedValue.encode(message.values[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EnumAttributeValues message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.AttributeValues.EnumAttributeValues.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.AttributeValues.EnumAttributeValues - * @static - * @param {google.cloud.apihub.v1.AttributeValues.IEnumAttributeValues} message EnumAttributeValues message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumAttributeValues.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumAttributeValues message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.AttributeValues.EnumAttributeValues - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.AttributeValues.EnumAttributeValues} EnumAttributeValues - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumAttributeValues.decode = function 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.apihub.v1.AttributeValues.EnumAttributeValues(); - 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.cloud.apihub.v1.Attribute.AllowedValue.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumAttributeValues message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.AttributeValues.EnumAttributeValues - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.AttributeValues.EnumAttributeValues} EnumAttributeValues - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumAttributeValues.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumAttributeValues message. - * @function verify - * @memberof google.cloud.apihub.v1.AttributeValues.EnumAttributeValues - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumAttributeValues.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.cloud.apihub.v1.Attribute.AllowedValue.verify(message.values[i]); - if (error) - return "values." + error; - } - } - return null; - }; - - /** - * Creates an EnumAttributeValues message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.AttributeValues.EnumAttributeValues - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.AttributeValues.EnumAttributeValues} EnumAttributeValues - */ - EnumAttributeValues.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.AttributeValues.EnumAttributeValues) - return object; - var message = new $root.google.cloud.apihub.v1.AttributeValues.EnumAttributeValues(); - if (object.values) { - if (!Array.isArray(object.values)) - throw TypeError(".google.cloud.apihub.v1.AttributeValues.EnumAttributeValues.values: array expected"); - message.values = []; - for (var i = 0; i < object.values.length; ++i) { - if (typeof object.values[i] !== "object") - throw TypeError(".google.cloud.apihub.v1.AttributeValues.EnumAttributeValues.values: object expected"); - message.values[i] = $root.google.cloud.apihub.v1.Attribute.AllowedValue.fromObject(object.values[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an EnumAttributeValues message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.AttributeValues.EnumAttributeValues - * @static - * @param {google.cloud.apihub.v1.AttributeValues.EnumAttributeValues} message EnumAttributeValues - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumAttributeValues.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.cloud.apihub.v1.Attribute.AllowedValue.toObject(message.values[j], options); - } - return object; - }; - - /** - * Converts this EnumAttributeValues to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.AttributeValues.EnumAttributeValues - * @instance - * @returns {Object.} JSON object - */ - EnumAttributeValues.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnumAttributeValues - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.AttributeValues.EnumAttributeValues - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumAttributeValues.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.AttributeValues.EnumAttributeValues"; - }; - - return EnumAttributeValues; - })(); - - AttributeValues.StringAttributeValues = (function() { - - /** - * Properties of a StringAttributeValues. - * @memberof google.cloud.apihub.v1.AttributeValues - * @interface IStringAttributeValues - * @property {Array.|null} [values] StringAttributeValues values - */ - - /** - * Constructs a new StringAttributeValues. - * @memberof google.cloud.apihub.v1.AttributeValues - * @classdesc Represents a StringAttributeValues. - * @implements IStringAttributeValues - * @constructor - * @param {google.cloud.apihub.v1.AttributeValues.IStringAttributeValues=} [properties] Properties to set - */ - function StringAttributeValues(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]]; - } - - /** - * StringAttributeValues values. - * @member {Array.} values - * @memberof google.cloud.apihub.v1.AttributeValues.StringAttributeValues - * @instance - */ - StringAttributeValues.prototype.values = $util.emptyArray; - - /** - * Creates a new StringAttributeValues instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.AttributeValues.StringAttributeValues - * @static - * @param {google.cloud.apihub.v1.AttributeValues.IStringAttributeValues=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.AttributeValues.StringAttributeValues} StringAttributeValues instance - */ - StringAttributeValues.create = function create(properties) { - return new StringAttributeValues(properties); - }; - - /** - * Encodes the specified StringAttributeValues message. Does not implicitly {@link google.cloud.apihub.v1.AttributeValues.StringAttributeValues.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.AttributeValues.StringAttributeValues - * @static - * @param {google.cloud.apihub.v1.AttributeValues.IStringAttributeValues} message StringAttributeValues message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StringAttributeValues.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) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.values[i]); - return writer; - }; - - /** - * Encodes the specified StringAttributeValues message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.AttributeValues.StringAttributeValues.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.AttributeValues.StringAttributeValues - * @static - * @param {google.cloud.apihub.v1.AttributeValues.IStringAttributeValues} message StringAttributeValues message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StringAttributeValues.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a StringAttributeValues message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.AttributeValues.StringAttributeValues - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.AttributeValues.StringAttributeValues} StringAttributeValues - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StringAttributeValues.decode = function 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.apihub.v1.AttributeValues.StringAttributeValues(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.values && message.values.length)) - message.values = []; - message.values.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a StringAttributeValues message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.AttributeValues.StringAttributeValues - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.AttributeValues.StringAttributeValues} StringAttributeValues - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StringAttributeValues.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a StringAttributeValues message. - * @function verify - * @memberof google.cloud.apihub.v1.AttributeValues.StringAttributeValues - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - StringAttributeValues.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) - if (!$util.isString(message.values[i])) - return "values: string[] expected"; - } - return null; - }; - - /** - * Creates a StringAttributeValues message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.AttributeValues.StringAttributeValues - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.AttributeValues.StringAttributeValues} StringAttributeValues - */ - StringAttributeValues.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.AttributeValues.StringAttributeValues) - return object; - var message = new $root.google.cloud.apihub.v1.AttributeValues.StringAttributeValues(); - if (object.values) { - if (!Array.isArray(object.values)) - throw TypeError(".google.cloud.apihub.v1.AttributeValues.StringAttributeValues.values: array expected"); - message.values = []; - for (var i = 0; i < object.values.length; ++i) - message.values[i] = String(object.values[i]); - } - return message; - }; - - /** - * Creates a plain object from a StringAttributeValues message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.AttributeValues.StringAttributeValues - * @static - * @param {google.cloud.apihub.v1.AttributeValues.StringAttributeValues} message StringAttributeValues - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - StringAttributeValues.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] = message.values[j]; - } - return object; - }; - - /** - * Converts this StringAttributeValues to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.AttributeValues.StringAttributeValues - * @instance - * @returns {Object.} JSON object - */ - StringAttributeValues.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for StringAttributeValues - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.AttributeValues.StringAttributeValues - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - StringAttributeValues.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.AttributeValues.StringAttributeValues"; - }; - - return StringAttributeValues; - })(); - - return AttributeValues; - })(); - - v1.Dependency = (function() { - - /** - * Properties of a Dependency. - * @memberof google.cloud.apihub.v1 - * @interface IDependency - * @property {string|null} [name] Dependency name - * @property {google.cloud.apihub.v1.IDependencyEntityReference|null} [consumer] Dependency consumer - * @property {google.cloud.apihub.v1.IDependencyEntityReference|null} [supplier] Dependency supplier - * @property {google.cloud.apihub.v1.Dependency.State|null} [state] Dependency state - * @property {string|null} [description] Dependency description - * @property {google.cloud.apihub.v1.Dependency.DiscoveryMode|null} [discoveryMode] Dependency discoveryMode - * @property {google.cloud.apihub.v1.IDependencyErrorDetail|null} [errorDetail] Dependency errorDetail - * @property {google.protobuf.ITimestamp|null} [createTime] Dependency createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] Dependency updateTime - * @property {Object.|null} [attributes] Dependency attributes - */ - - /** - * Constructs a new Dependency. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents a Dependency. - * @implements IDependency - * @constructor - * @param {google.cloud.apihub.v1.IDependency=} [properties] Properties to set - */ - function Dependency(properties) { - this.attributes = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Dependency name. - * @member {string} name - * @memberof google.cloud.apihub.v1.Dependency - * @instance - */ - Dependency.prototype.name = ""; - - /** - * Dependency consumer. - * @member {google.cloud.apihub.v1.IDependencyEntityReference|null|undefined} consumer - * @memberof google.cloud.apihub.v1.Dependency - * @instance - */ - Dependency.prototype.consumer = null; - - /** - * Dependency supplier. - * @member {google.cloud.apihub.v1.IDependencyEntityReference|null|undefined} supplier - * @memberof google.cloud.apihub.v1.Dependency - * @instance - */ - Dependency.prototype.supplier = null; - - /** - * Dependency state. - * @member {google.cloud.apihub.v1.Dependency.State} state - * @memberof google.cloud.apihub.v1.Dependency - * @instance - */ - Dependency.prototype.state = 0; - - /** - * Dependency description. - * @member {string} description - * @memberof google.cloud.apihub.v1.Dependency - * @instance - */ - Dependency.prototype.description = ""; - - /** - * Dependency discoveryMode. - * @member {google.cloud.apihub.v1.Dependency.DiscoveryMode} discoveryMode - * @memberof google.cloud.apihub.v1.Dependency - * @instance - */ - Dependency.prototype.discoveryMode = 0; - - /** - * Dependency errorDetail. - * @member {google.cloud.apihub.v1.IDependencyErrorDetail|null|undefined} errorDetail - * @memberof google.cloud.apihub.v1.Dependency - * @instance - */ - Dependency.prototype.errorDetail = null; - - /** - * Dependency createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.apihub.v1.Dependency - * @instance - */ - Dependency.prototype.createTime = null; - - /** - * Dependency updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.apihub.v1.Dependency - * @instance - */ - Dependency.prototype.updateTime = null; - - /** - * Dependency attributes. - * @member {Object.} attributes - * @memberof google.cloud.apihub.v1.Dependency - * @instance - */ - Dependency.prototype.attributes = $util.emptyObject; - - /** - * Creates a new Dependency instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.Dependency - * @static - * @param {google.cloud.apihub.v1.IDependency=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.Dependency} Dependency instance - */ - Dependency.create = function create(properties) { - return new Dependency(properties); - }; - - /** - * Encodes the specified Dependency message. Does not implicitly {@link google.cloud.apihub.v1.Dependency.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.Dependency - * @static - * @param {google.cloud.apihub.v1.IDependency} message Dependency message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Dependency.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.consumer != null && Object.hasOwnProperty.call(message, "consumer")) - $root.google.cloud.apihub.v1.DependencyEntityReference.encode(message.consumer, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.supplier != null && Object.hasOwnProperty.call(message, "supplier")) - $root.google.cloud.apihub.v1.DependencyEntityReference.encode(message.supplier, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.state); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.description); - if (message.discoveryMode != null && Object.hasOwnProperty.call(message, "discoveryMode")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.discoveryMode); - if (message.errorDetail != null && Object.hasOwnProperty.call(message, "errorDetail")) - $root.google.cloud.apihub.v1.DependencyErrorDetail.encode(message.errorDetail, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.attributes != null && Object.hasOwnProperty.call(message, "attributes")) - for (var keys = Object.keys(message.attributes), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 10, wireType 2 =*/82).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.cloud.apihub.v1.AttributeValues.encode(message.attributes[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - return writer; - }; - - /** - * Encodes the specified Dependency message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.Dependency.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.Dependency - * @static - * @param {google.cloud.apihub.v1.IDependency} message Dependency message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Dependency.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Dependency message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.Dependency - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.Dependency} Dependency - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Dependency.decode = function 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.apihub.v1.Dependency(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.consumer = $root.google.cloud.apihub.v1.DependencyEntityReference.decode(reader, reader.uint32()); - break; - } - case 3: { - message.supplier = $root.google.cloud.apihub.v1.DependencyEntityReference.decode(reader, reader.uint32()); - break; - } - case 4: { - message.state = reader.int32(); - break; - } - case 5: { - message.description = reader.string(); - break; - } - case 6: { - message.discoveryMode = reader.int32(); - break; - } - case 7: { - message.errorDetail = $root.google.cloud.apihub.v1.DependencyErrorDetail.decode(reader, reader.uint32()); - break; - } - case 8: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 9: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 10: { - if (message.attributes === $util.emptyObject) - message.attributes = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = null; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = $root.google.cloud.apihub.v1.AttributeValues.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.attributes[key] = value; - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Dependency message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.Dependency - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.Dependency} Dependency - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Dependency.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Dependency message. - * @function verify - * @memberof google.cloud.apihub.v1.Dependency - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Dependency.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.consumer != null && message.hasOwnProperty("consumer")) { - var error = $root.google.cloud.apihub.v1.DependencyEntityReference.verify(message.consumer); - if (error) - return "consumer." + error; - } - if (message.supplier != null && message.hasOwnProperty("supplier")) { - var error = $root.google.cloud.apihub.v1.DependencyEntityReference.verify(message.supplier); - if (error) - return "supplier." + 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.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.discoveryMode != null && message.hasOwnProperty("discoveryMode")) - switch (message.discoveryMode) { - default: - return "discoveryMode: enum value expected"; - case 0: - case 1: - break; - } - if (message.errorDetail != null && message.hasOwnProperty("errorDetail")) { - var error = $root.google.cloud.apihub.v1.DependencyErrorDetail.verify(message.errorDetail); - if (error) - return "errorDetail." + error; - } - 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.attributes != null && message.hasOwnProperty("attributes")) { - if (!$util.isObject(message.attributes)) - return "attributes: object expected"; - var key = Object.keys(message.attributes); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.cloud.apihub.v1.AttributeValues.verify(message.attributes[key[i]]); - if (error) - return "attributes." + error; - } - } - return null; - }; - - /** - * Creates a Dependency message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.Dependency - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.Dependency} Dependency - */ - Dependency.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.Dependency) - return object; - var message = new $root.google.cloud.apihub.v1.Dependency(); - if (object.name != null) - message.name = String(object.name); - if (object.consumer != null) { - if (typeof object.consumer !== "object") - throw TypeError(".google.cloud.apihub.v1.Dependency.consumer: object expected"); - message.consumer = $root.google.cloud.apihub.v1.DependencyEntityReference.fromObject(object.consumer); - } - if (object.supplier != null) { - if (typeof object.supplier !== "object") - throw TypeError(".google.cloud.apihub.v1.Dependency.supplier: object expected"); - message.supplier = $root.google.cloud.apihub.v1.DependencyEntityReference.fromObject(object.supplier); - } - 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 "PROPOSED": - case 1: - message.state = 1; - break; - case "VALIDATED": - case 2: - message.state = 2; - break; - } - if (object.description != null) - message.description = String(object.description); - switch (object.discoveryMode) { - default: - if (typeof object.discoveryMode === "number") { - message.discoveryMode = object.discoveryMode; - break; - } - break; - case "DISCOVERY_MODE_UNSPECIFIED": - case 0: - message.discoveryMode = 0; - break; - case "MANUAL": - case 1: - message.discoveryMode = 1; - break; - } - if (object.errorDetail != null) { - if (typeof object.errorDetail !== "object") - throw TypeError(".google.cloud.apihub.v1.Dependency.errorDetail: object expected"); - message.errorDetail = $root.google.cloud.apihub.v1.DependencyErrorDetail.fromObject(object.errorDetail); - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.apihub.v1.Dependency.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.apihub.v1.Dependency.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.attributes) { - if (typeof object.attributes !== "object") - throw TypeError(".google.cloud.apihub.v1.Dependency.attributes: object expected"); - message.attributes = {}; - for (var keys = Object.keys(object.attributes), i = 0; i < keys.length; ++i) { - if (typeof object.attributes[keys[i]] !== "object") - throw TypeError(".google.cloud.apihub.v1.Dependency.attributes: object expected"); - message.attributes[keys[i]] = $root.google.cloud.apihub.v1.AttributeValues.fromObject(object.attributes[keys[i]]); - } - } - return message; - }; - - /** - * Creates a plain object from a Dependency message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.Dependency - * @static - * @param {google.cloud.apihub.v1.Dependency} message Dependency - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Dependency.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.attributes = {}; - if (options.defaults) { - object.name = ""; - object.consumer = null; - object.supplier = null; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.description = ""; - object.discoveryMode = options.enums === String ? "DISCOVERY_MODE_UNSPECIFIED" : 0; - object.errorDetail = null; - object.createTime = null; - object.updateTime = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.consumer != null && message.hasOwnProperty("consumer")) - object.consumer = $root.google.cloud.apihub.v1.DependencyEntityReference.toObject(message.consumer, options); - if (message.supplier != null && message.hasOwnProperty("supplier")) - object.supplier = $root.google.cloud.apihub.v1.DependencyEntityReference.toObject(message.supplier, options); - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.apihub.v1.Dependency.State[message.state] === undefined ? message.state : $root.google.cloud.apihub.v1.Dependency.State[message.state] : message.state; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.discoveryMode != null && message.hasOwnProperty("discoveryMode")) - object.discoveryMode = options.enums === String ? $root.google.cloud.apihub.v1.Dependency.DiscoveryMode[message.discoveryMode] === undefined ? message.discoveryMode : $root.google.cloud.apihub.v1.Dependency.DiscoveryMode[message.discoveryMode] : message.discoveryMode; - if (message.errorDetail != null && message.hasOwnProperty("errorDetail")) - object.errorDetail = $root.google.cloud.apihub.v1.DependencyErrorDetail.toObject(message.errorDetail, options); - 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.attributes && (keys2 = Object.keys(message.attributes)).length) { - object.attributes = {}; - for (var j = 0; j < keys2.length; ++j) - object.attributes[keys2[j]] = $root.google.cloud.apihub.v1.AttributeValues.toObject(message.attributes[keys2[j]], options); - } - return object; - }; - - /** - * Converts this Dependency to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.Dependency - * @instance - * @returns {Object.} JSON object - */ - Dependency.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Dependency - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.Dependency - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Dependency.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.Dependency"; - }; - - /** - * State enum. - * @name google.cloud.apihub.v1.Dependency.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} PROPOSED=1 PROPOSED value - * @property {number} VALIDATED=2 VALIDATED value - */ - Dependency.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "PROPOSED"] = 1; - values[valuesById[2] = "VALIDATED"] = 2; - return values; - })(); - - /** - * DiscoveryMode enum. - * @name google.cloud.apihub.v1.Dependency.DiscoveryMode - * @enum {number} - * @property {number} DISCOVERY_MODE_UNSPECIFIED=0 DISCOVERY_MODE_UNSPECIFIED value - * @property {number} MANUAL=1 MANUAL value - */ - Dependency.DiscoveryMode = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "DISCOVERY_MODE_UNSPECIFIED"] = 0; - values[valuesById[1] = "MANUAL"] = 1; - return values; - })(); - - return Dependency; - })(); - - v1.DependencyEntityReference = (function() { - - /** - * Properties of a DependencyEntityReference. - * @memberof google.cloud.apihub.v1 - * @interface IDependencyEntityReference - * @property {string|null} [operationResourceName] DependencyEntityReference operationResourceName - * @property {string|null} [externalApiResourceName] DependencyEntityReference externalApiResourceName - * @property {string|null} [displayName] DependencyEntityReference displayName - */ - - /** - * Constructs a new DependencyEntityReference. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents a DependencyEntityReference. - * @implements IDependencyEntityReference - * @constructor - * @param {google.cloud.apihub.v1.IDependencyEntityReference=} [properties] Properties to set - */ - function DependencyEntityReference(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]]; - } - - /** - * DependencyEntityReference operationResourceName. - * @member {string|null|undefined} operationResourceName - * @memberof google.cloud.apihub.v1.DependencyEntityReference - * @instance - */ - DependencyEntityReference.prototype.operationResourceName = null; - - /** - * DependencyEntityReference externalApiResourceName. - * @member {string|null|undefined} externalApiResourceName - * @memberof google.cloud.apihub.v1.DependencyEntityReference - * @instance - */ - DependencyEntityReference.prototype.externalApiResourceName = null; - - /** - * DependencyEntityReference displayName. - * @member {string} displayName - * @memberof google.cloud.apihub.v1.DependencyEntityReference - * @instance - */ - DependencyEntityReference.prototype.displayName = ""; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * DependencyEntityReference identifier. - * @member {"operationResourceName"|"externalApiResourceName"|undefined} identifier - * @memberof google.cloud.apihub.v1.DependencyEntityReference - * @instance - */ - Object.defineProperty(DependencyEntityReference.prototype, "identifier", { - get: $util.oneOfGetter($oneOfFields = ["operationResourceName", "externalApiResourceName"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new DependencyEntityReference instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.DependencyEntityReference - * @static - * @param {google.cloud.apihub.v1.IDependencyEntityReference=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.DependencyEntityReference} DependencyEntityReference instance - */ - DependencyEntityReference.create = function create(properties) { - return new DependencyEntityReference(properties); - }; - - /** - * Encodes the specified DependencyEntityReference message. Does not implicitly {@link google.cloud.apihub.v1.DependencyEntityReference.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.DependencyEntityReference - * @static - * @param {google.cloud.apihub.v1.IDependencyEntityReference} message DependencyEntityReference message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DependencyEntityReference.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.displayName); - if (message.operationResourceName != null && Object.hasOwnProperty.call(message, "operationResourceName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.operationResourceName); - if (message.externalApiResourceName != null && Object.hasOwnProperty.call(message, "externalApiResourceName")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.externalApiResourceName); - return writer; - }; - - /** - * Encodes the specified DependencyEntityReference message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.DependencyEntityReference.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.DependencyEntityReference - * @static - * @param {google.cloud.apihub.v1.IDependencyEntityReference} message DependencyEntityReference message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DependencyEntityReference.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DependencyEntityReference message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.DependencyEntityReference - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.DependencyEntityReference} DependencyEntityReference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DependencyEntityReference.decode = function 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.apihub.v1.DependencyEntityReference(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 2: { - message.operationResourceName = reader.string(); - break; - } - case 3: { - message.externalApiResourceName = reader.string(); - break; - } - case 1: { - message.displayName = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DependencyEntityReference message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.DependencyEntityReference - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.DependencyEntityReference} DependencyEntityReference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DependencyEntityReference.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DependencyEntityReference message. - * @function verify - * @memberof google.cloud.apihub.v1.DependencyEntityReference - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DependencyEntityReference.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.operationResourceName != null && message.hasOwnProperty("operationResourceName")) { - properties.identifier = 1; - if (!$util.isString(message.operationResourceName)) - return "operationResourceName: string expected"; - } - if (message.externalApiResourceName != null && message.hasOwnProperty("externalApiResourceName")) { - if (properties.identifier === 1) - return "identifier: multiple values"; - properties.identifier = 1; - if (!$util.isString(message.externalApiResourceName)) - return "externalApiResourceName: string expected"; - } - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - return null; - }; - - /** - * Creates a DependencyEntityReference message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.DependencyEntityReference - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.DependencyEntityReference} DependencyEntityReference - */ - DependencyEntityReference.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.DependencyEntityReference) - return object; - var message = new $root.google.cloud.apihub.v1.DependencyEntityReference(); - if (object.operationResourceName != null) - message.operationResourceName = String(object.operationResourceName); - if (object.externalApiResourceName != null) - message.externalApiResourceName = String(object.externalApiResourceName); - if (object.displayName != null) - message.displayName = String(object.displayName); - return message; - }; - - /** - * Creates a plain object from a DependencyEntityReference message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.DependencyEntityReference - * @static - * @param {google.cloud.apihub.v1.DependencyEntityReference} message DependencyEntityReference - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DependencyEntityReference.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.displayName = ""; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.operationResourceName != null && message.hasOwnProperty("operationResourceName")) { - object.operationResourceName = message.operationResourceName; - if (options.oneofs) - object.identifier = "operationResourceName"; - } - if (message.externalApiResourceName != null && message.hasOwnProperty("externalApiResourceName")) { - object.externalApiResourceName = message.externalApiResourceName; - if (options.oneofs) - object.identifier = "externalApiResourceName"; - } - return object; - }; - - /** - * Converts this DependencyEntityReference to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.DependencyEntityReference - * @instance - * @returns {Object.} JSON object - */ - DependencyEntityReference.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DependencyEntityReference - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.DependencyEntityReference - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DependencyEntityReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.DependencyEntityReference"; - }; - - return DependencyEntityReference; - })(); - - v1.DependencyErrorDetail = (function() { - - /** - * Properties of a DependencyErrorDetail. - * @memberof google.cloud.apihub.v1 - * @interface IDependencyErrorDetail - * @property {google.cloud.apihub.v1.DependencyErrorDetail.Error|null} [error] DependencyErrorDetail error - * @property {google.protobuf.ITimestamp|null} [errorTime] DependencyErrorDetail errorTime - */ - - /** - * Constructs a new DependencyErrorDetail. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents a DependencyErrorDetail. - * @implements IDependencyErrorDetail - * @constructor - * @param {google.cloud.apihub.v1.IDependencyErrorDetail=} [properties] Properties to set - */ - function DependencyErrorDetail(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]]; - } - - /** - * DependencyErrorDetail error. - * @member {google.cloud.apihub.v1.DependencyErrorDetail.Error} error - * @memberof google.cloud.apihub.v1.DependencyErrorDetail - * @instance - */ - DependencyErrorDetail.prototype.error = 0; - - /** - * DependencyErrorDetail errorTime. - * @member {google.protobuf.ITimestamp|null|undefined} errorTime - * @memberof google.cloud.apihub.v1.DependencyErrorDetail - * @instance - */ - DependencyErrorDetail.prototype.errorTime = null; - - /** - * Creates a new DependencyErrorDetail instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.DependencyErrorDetail - * @static - * @param {google.cloud.apihub.v1.IDependencyErrorDetail=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.DependencyErrorDetail} DependencyErrorDetail instance - */ - DependencyErrorDetail.create = function create(properties) { - return new DependencyErrorDetail(properties); - }; - - /** - * Encodes the specified DependencyErrorDetail message. Does not implicitly {@link google.cloud.apihub.v1.DependencyErrorDetail.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.DependencyErrorDetail - * @static - * @param {google.cloud.apihub.v1.IDependencyErrorDetail} message DependencyErrorDetail message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DependencyErrorDetail.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.error != null && Object.hasOwnProperty.call(message, "error")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.error); - if (message.errorTime != null && Object.hasOwnProperty.call(message, "errorTime")) - $root.google.protobuf.Timestamp.encode(message.errorTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified DependencyErrorDetail message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.DependencyErrorDetail.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.DependencyErrorDetail - * @static - * @param {google.cloud.apihub.v1.IDependencyErrorDetail} message DependencyErrorDetail message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DependencyErrorDetail.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DependencyErrorDetail message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.DependencyErrorDetail - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.DependencyErrorDetail} DependencyErrorDetail - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DependencyErrorDetail.decode = function 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.apihub.v1.DependencyErrorDetail(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.error = reader.int32(); - break; - } - case 2: { - message.errorTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DependencyErrorDetail message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.DependencyErrorDetail - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.DependencyErrorDetail} DependencyErrorDetail - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DependencyErrorDetail.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DependencyErrorDetail message. - * @function verify - * @memberof google.cloud.apihub.v1.DependencyErrorDetail - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DependencyErrorDetail.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.error != null && message.hasOwnProperty("error")) - switch (message.error) { - default: - return "error: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.errorTime != null && message.hasOwnProperty("errorTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.errorTime); - if (error) - return "errorTime." + error; - } - return null; - }; - - /** - * Creates a DependencyErrorDetail message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.DependencyErrorDetail - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.DependencyErrorDetail} DependencyErrorDetail - */ - DependencyErrorDetail.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.DependencyErrorDetail) - return object; - var message = new $root.google.cloud.apihub.v1.DependencyErrorDetail(); - switch (object.error) { - default: - if (typeof object.error === "number") { - message.error = object.error; - break; - } - break; - case "ERROR_UNSPECIFIED": - case 0: - message.error = 0; - break; - case "SUPPLIER_NOT_FOUND": - case 1: - message.error = 1; - break; - case "SUPPLIER_RECREATED": - case 2: - message.error = 2; - break; - } - if (object.errorTime != null) { - if (typeof object.errorTime !== "object") - throw TypeError(".google.cloud.apihub.v1.DependencyErrorDetail.errorTime: object expected"); - message.errorTime = $root.google.protobuf.Timestamp.fromObject(object.errorTime); - } - return message; - }; - - /** - * Creates a plain object from a DependencyErrorDetail message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.DependencyErrorDetail - * @static - * @param {google.cloud.apihub.v1.DependencyErrorDetail} message DependencyErrorDetail - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DependencyErrorDetail.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.error = options.enums === String ? "ERROR_UNSPECIFIED" : 0; - object.errorTime = null; - } - if (message.error != null && message.hasOwnProperty("error")) - object.error = options.enums === String ? $root.google.cloud.apihub.v1.DependencyErrorDetail.Error[message.error] === undefined ? message.error : $root.google.cloud.apihub.v1.DependencyErrorDetail.Error[message.error] : message.error; - if (message.errorTime != null && message.hasOwnProperty("errorTime")) - object.errorTime = $root.google.protobuf.Timestamp.toObject(message.errorTime, options); - return object; - }; - - /** - * Converts this DependencyErrorDetail to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.DependencyErrorDetail - * @instance - * @returns {Object.} JSON object - */ - DependencyErrorDetail.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DependencyErrorDetail - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.DependencyErrorDetail - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DependencyErrorDetail.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.DependencyErrorDetail"; - }; - - /** - * Error enum. - * @name google.cloud.apihub.v1.DependencyErrorDetail.Error - * @enum {number} - * @property {number} ERROR_UNSPECIFIED=0 ERROR_UNSPECIFIED value - * @property {number} SUPPLIER_NOT_FOUND=1 SUPPLIER_NOT_FOUND value - * @property {number} SUPPLIER_RECREATED=2 SUPPLIER_RECREATED value - */ - DependencyErrorDetail.Error = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ERROR_UNSPECIFIED"] = 0; - values[valuesById[1] = "SUPPLIER_NOT_FOUND"] = 1; - values[valuesById[2] = "SUPPLIER_RECREATED"] = 2; - return values; - })(); - - return DependencyErrorDetail; - })(); - - v1.LintResponse = (function() { - - /** - * Properties of a LintResponse. - * @memberof google.cloud.apihub.v1 - * @interface ILintResponse - * @property {Array.|null} [issues] LintResponse issues - * @property {Array.|null} [summary] LintResponse summary - * @property {google.cloud.apihub.v1.LintState|null} [state] LintResponse state - * @property {string|null} [source] LintResponse source - * @property {google.cloud.apihub.v1.Linter|null} [linter] LintResponse linter - * @property {google.protobuf.ITimestamp|null} [createTime] LintResponse createTime - */ - - /** - * Constructs a new LintResponse. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents a LintResponse. - * @implements ILintResponse - * @constructor - * @param {google.cloud.apihub.v1.ILintResponse=} [properties] Properties to set - */ - function LintResponse(properties) { - this.issues = []; - this.summary = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * LintResponse issues. - * @member {Array.} issues - * @memberof google.cloud.apihub.v1.LintResponse - * @instance - */ - LintResponse.prototype.issues = $util.emptyArray; - - /** - * LintResponse summary. - * @member {Array.} summary - * @memberof google.cloud.apihub.v1.LintResponse - * @instance - */ - LintResponse.prototype.summary = $util.emptyArray; - - /** - * LintResponse state. - * @member {google.cloud.apihub.v1.LintState} state - * @memberof google.cloud.apihub.v1.LintResponse - * @instance - */ - LintResponse.prototype.state = 0; - - /** - * LintResponse source. - * @member {string} source - * @memberof google.cloud.apihub.v1.LintResponse - * @instance - */ - LintResponse.prototype.source = ""; - - /** - * LintResponse linter. - * @member {google.cloud.apihub.v1.Linter} linter - * @memberof google.cloud.apihub.v1.LintResponse - * @instance - */ - LintResponse.prototype.linter = 0; - - /** - * LintResponse createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.apihub.v1.LintResponse - * @instance - */ - LintResponse.prototype.createTime = null; - - /** - * Creates a new LintResponse instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.LintResponse - * @static - * @param {google.cloud.apihub.v1.ILintResponse=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.LintResponse} LintResponse instance - */ - LintResponse.create = function create(properties) { - return new LintResponse(properties); - }; - - /** - * Encodes the specified LintResponse message. Does not implicitly {@link google.cloud.apihub.v1.LintResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.LintResponse - * @static - * @param {google.cloud.apihub.v1.ILintResponse} message LintResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LintResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.issues != null && message.issues.length) - for (var i = 0; i < message.issues.length; ++i) - $root.google.cloud.apihub.v1.Issue.encode(message.issues[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.summary != null && message.summary.length) - for (var i = 0; i < message.summary.length; ++i) - $root.google.cloud.apihub.v1.LintResponse.SummaryEntry.encode(message.summary[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.state); - if (message.source != null && Object.hasOwnProperty.call(message, "source")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.source); - if (message.linter != null && Object.hasOwnProperty.call(message, "linter")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.linter); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified LintResponse message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.LintResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.LintResponse - * @static - * @param {google.cloud.apihub.v1.ILintResponse} message LintResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LintResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a LintResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.LintResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.LintResponse} LintResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LintResponse.decode = function 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.apihub.v1.LintResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.issues && message.issues.length)) - message.issues = []; - message.issues.push($root.google.cloud.apihub.v1.Issue.decode(reader, reader.uint32())); - break; - } - case 2: { - if (!(message.summary && message.summary.length)) - message.summary = []; - message.summary.push($root.google.cloud.apihub.v1.LintResponse.SummaryEntry.decode(reader, reader.uint32())); - break; - } - case 3: { - message.state = reader.int32(); - break; - } - case 4: { - message.source = reader.string(); - break; - } - case 5: { - message.linter = reader.int32(); - break; - } - case 6: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a LintResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.LintResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.LintResponse} LintResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LintResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a LintResponse message. - * @function verify - * @memberof google.cloud.apihub.v1.LintResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - LintResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.issues != null && message.hasOwnProperty("issues")) { - if (!Array.isArray(message.issues)) - return "issues: array expected"; - for (var i = 0; i < message.issues.length; ++i) { - var error = $root.google.cloud.apihub.v1.Issue.verify(message.issues[i]); - if (error) - return "issues." + error; - } - } - if (message.summary != null && message.hasOwnProperty("summary")) { - if (!Array.isArray(message.summary)) - return "summary: array expected"; - for (var i = 0; i < message.summary.length; ++i) { - var error = $root.google.cloud.apihub.v1.LintResponse.SummaryEntry.verify(message.summary[i]); - if (error) - return "summary." + 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.source != null && message.hasOwnProperty("source")) - if (!$util.isString(message.source)) - return "source: string expected"; - if (message.linter != null && message.hasOwnProperty("linter")) - switch (message.linter) { - default: - return "linter: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - return null; - }; - - /** - * Creates a LintResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.LintResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.LintResponse} LintResponse - */ - LintResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.LintResponse) - return object; - var message = new $root.google.cloud.apihub.v1.LintResponse(); - if (object.issues) { - if (!Array.isArray(object.issues)) - throw TypeError(".google.cloud.apihub.v1.LintResponse.issues: array expected"); - message.issues = []; - for (var i = 0; i < object.issues.length; ++i) { - if (typeof object.issues[i] !== "object") - throw TypeError(".google.cloud.apihub.v1.LintResponse.issues: object expected"); - message.issues[i] = $root.google.cloud.apihub.v1.Issue.fromObject(object.issues[i]); - } - } - if (object.summary) { - if (!Array.isArray(object.summary)) - throw TypeError(".google.cloud.apihub.v1.LintResponse.summary: array expected"); - message.summary = []; - for (var i = 0; i < object.summary.length; ++i) { - if (typeof object.summary[i] !== "object") - throw TypeError(".google.cloud.apihub.v1.LintResponse.summary: object expected"); - message.summary[i] = $root.google.cloud.apihub.v1.LintResponse.SummaryEntry.fromObject(object.summary[i]); - } - } - switch (object.state) { - default: - if (typeof object.state === "number") { - message.state = object.state; - break; - } - break; - case "LINT_STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "LINT_STATE_SUCCESS": - case 1: - message.state = 1; - break; - case "LINT_STATE_ERROR": - case 2: - message.state = 2; - break; - } - if (object.source != null) - message.source = String(object.source); - switch (object.linter) { - default: - if (typeof object.linter === "number") { - message.linter = object.linter; - break; - } - break; - case "LINTER_UNSPECIFIED": - case 0: - message.linter = 0; - break; - case "SPECTRAL": - case 1: - message.linter = 1; - break; - case "OTHER": - case 2: - message.linter = 2; - break; - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.apihub.v1.LintResponse.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - return message; - }; - - /** - * Creates a plain object from a LintResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.LintResponse - * @static - * @param {google.cloud.apihub.v1.LintResponse} message LintResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LintResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.issues = []; - object.summary = []; - } - if (options.defaults) { - object.state = options.enums === String ? "LINT_STATE_UNSPECIFIED" : 0; - object.source = ""; - object.linter = options.enums === String ? "LINTER_UNSPECIFIED" : 0; - object.createTime = null; - } - if (message.issues && message.issues.length) { - object.issues = []; - for (var j = 0; j < message.issues.length; ++j) - object.issues[j] = $root.google.cloud.apihub.v1.Issue.toObject(message.issues[j], options); - } - if (message.summary && message.summary.length) { - object.summary = []; - for (var j = 0; j < message.summary.length; ++j) - object.summary[j] = $root.google.cloud.apihub.v1.LintResponse.SummaryEntry.toObject(message.summary[j], options); - } - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.apihub.v1.LintState[message.state] === undefined ? message.state : $root.google.cloud.apihub.v1.LintState[message.state] : message.state; - if (message.source != null && message.hasOwnProperty("source")) - object.source = message.source; - if (message.linter != null && message.hasOwnProperty("linter")) - object.linter = options.enums === String ? $root.google.cloud.apihub.v1.Linter[message.linter] === undefined ? message.linter : $root.google.cloud.apihub.v1.Linter[message.linter] : message.linter; - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - return object; - }; - - /** - * Converts this LintResponse to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.LintResponse - * @instance - * @returns {Object.} JSON object - */ - LintResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for LintResponse - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.LintResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - LintResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.LintResponse"; - }; - - LintResponse.SummaryEntry = (function() { - - /** - * Properties of a SummaryEntry. - * @memberof google.cloud.apihub.v1.LintResponse - * @interface ISummaryEntry - * @property {google.cloud.apihub.v1.Severity|null} [severity] SummaryEntry severity - * @property {number|null} [count] SummaryEntry count - */ - - /** - * Constructs a new SummaryEntry. - * @memberof google.cloud.apihub.v1.LintResponse - * @classdesc Represents a SummaryEntry. - * @implements ISummaryEntry - * @constructor - * @param {google.cloud.apihub.v1.LintResponse.ISummaryEntry=} [properties] Properties to set - */ - function SummaryEntry(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]]; - } - - /** - * SummaryEntry severity. - * @member {google.cloud.apihub.v1.Severity} severity - * @memberof google.cloud.apihub.v1.LintResponse.SummaryEntry - * @instance - */ - SummaryEntry.prototype.severity = 0; - - /** - * SummaryEntry count. - * @member {number} count - * @memberof google.cloud.apihub.v1.LintResponse.SummaryEntry - * @instance - */ - SummaryEntry.prototype.count = 0; - - /** - * Creates a new SummaryEntry instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.LintResponse.SummaryEntry - * @static - * @param {google.cloud.apihub.v1.LintResponse.ISummaryEntry=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.LintResponse.SummaryEntry} SummaryEntry instance - */ - SummaryEntry.create = function create(properties) { - return new SummaryEntry(properties); - }; - - /** - * Encodes the specified SummaryEntry message. Does not implicitly {@link google.cloud.apihub.v1.LintResponse.SummaryEntry.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.LintResponse.SummaryEntry - * @static - * @param {google.cloud.apihub.v1.LintResponse.ISummaryEntry} message SummaryEntry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SummaryEntry.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.severity != null && Object.hasOwnProperty.call(message, "severity")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.severity); - if (message.count != null && Object.hasOwnProperty.call(message, "count")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.count); - return writer; - }; - - /** - * Encodes the specified SummaryEntry message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.LintResponse.SummaryEntry.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.LintResponse.SummaryEntry - * @static - * @param {google.cloud.apihub.v1.LintResponse.ISummaryEntry} message SummaryEntry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SummaryEntry.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SummaryEntry message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.LintResponse.SummaryEntry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.LintResponse.SummaryEntry} SummaryEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SummaryEntry.decode = function 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.apihub.v1.LintResponse.SummaryEntry(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.severity = reader.int32(); - break; - } - case 2: { - message.count = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SummaryEntry message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.LintResponse.SummaryEntry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.LintResponse.SummaryEntry} SummaryEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SummaryEntry.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SummaryEntry message. - * @function verify - * @memberof google.cloud.apihub.v1.LintResponse.SummaryEntry - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SummaryEntry.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.severity != null && message.hasOwnProperty("severity")) - switch (message.severity) { - default: - return "severity: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - if (message.count != null && message.hasOwnProperty("count")) - if (!$util.isInteger(message.count)) - return "count: integer expected"; - return null; - }; - - /** - * Creates a SummaryEntry message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.LintResponse.SummaryEntry - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.LintResponse.SummaryEntry} SummaryEntry - */ - SummaryEntry.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.LintResponse.SummaryEntry) - return object; - var message = new $root.google.cloud.apihub.v1.LintResponse.SummaryEntry(); - switch (object.severity) { - default: - if (typeof object.severity === "number") { - message.severity = object.severity; - break; - } - break; - case "SEVERITY_UNSPECIFIED": - case 0: - message.severity = 0; - break; - case "SEVERITY_ERROR": - case 1: - message.severity = 1; - break; - case "SEVERITY_WARNING": - case 2: - message.severity = 2; - break; - case "SEVERITY_INFO": - case 3: - message.severity = 3; - break; - case "SEVERITY_HINT": - case 4: - message.severity = 4; - break; - } - if (object.count != null) - message.count = object.count | 0; - return message; - }; - - /** - * Creates a plain object from a SummaryEntry message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.LintResponse.SummaryEntry - * @static - * @param {google.cloud.apihub.v1.LintResponse.SummaryEntry} message SummaryEntry - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SummaryEntry.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.severity = options.enums === String ? "SEVERITY_UNSPECIFIED" : 0; - object.count = 0; - } - if (message.severity != null && message.hasOwnProperty("severity")) - object.severity = options.enums === String ? $root.google.cloud.apihub.v1.Severity[message.severity] === undefined ? message.severity : $root.google.cloud.apihub.v1.Severity[message.severity] : message.severity; - if (message.count != null && message.hasOwnProperty("count")) - object.count = message.count; - return object; - }; - - /** - * Converts this SummaryEntry to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.LintResponse.SummaryEntry - * @instance - * @returns {Object.} JSON object - */ - SummaryEntry.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SummaryEntry - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.LintResponse.SummaryEntry - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SummaryEntry.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.LintResponse.SummaryEntry"; - }; - - return SummaryEntry; - })(); - - return LintResponse; - })(); - - v1.Issue = (function() { - - /** - * Properties of an Issue. - * @memberof google.cloud.apihub.v1 - * @interface IIssue - * @property {string|null} [code] Issue code - * @property {Array.|null} [path] Issue path - * @property {string|null} [message] Issue message - * @property {google.cloud.apihub.v1.Severity|null} [severity] Issue severity - * @property {google.cloud.apihub.v1.IRange|null} [range] Issue range - */ - - /** - * Constructs a new Issue. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents an Issue. - * @implements IIssue - * @constructor - * @param {google.cloud.apihub.v1.IIssue=} [properties] Properties to set - */ - function Issue(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]]; - } - - /** - * Issue code. - * @member {string} code - * @memberof google.cloud.apihub.v1.Issue - * @instance - */ - Issue.prototype.code = ""; - - /** - * Issue path. - * @member {Array.} path - * @memberof google.cloud.apihub.v1.Issue - * @instance - */ - Issue.prototype.path = $util.emptyArray; - - /** - * Issue message. - * @member {string} message - * @memberof google.cloud.apihub.v1.Issue - * @instance - */ - Issue.prototype.message = ""; - - /** - * Issue severity. - * @member {google.cloud.apihub.v1.Severity} severity - * @memberof google.cloud.apihub.v1.Issue - * @instance - */ - Issue.prototype.severity = 0; - - /** - * Issue range. - * @member {google.cloud.apihub.v1.IRange|null|undefined} range - * @memberof google.cloud.apihub.v1.Issue - * @instance - */ - Issue.prototype.range = null; - - /** - * Creates a new Issue instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.Issue - * @static - * @param {google.cloud.apihub.v1.IIssue=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.Issue} Issue instance - */ - Issue.create = function create(properties) { - return new Issue(properties); - }; - - /** - * Encodes the specified Issue message. Does not implicitly {@link google.cloud.apihub.v1.Issue.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.Issue - * @static - * @param {google.cloud.apihub.v1.IIssue} message Issue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Issue.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.code != null && Object.hasOwnProperty.call(message, "code")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.code); - if (message.path != null && message.path.length) - for (var i = 0; i < message.path.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.path[i]); - if (message.message != null && Object.hasOwnProperty.call(message, "message")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.message); - if (message.severity != null && Object.hasOwnProperty.call(message, "severity")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.severity); - if (message.range != null && Object.hasOwnProperty.call(message, "range")) - $root.google.cloud.apihub.v1.Range.encode(message.range, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Issue message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.Issue.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.Issue - * @static - * @param {google.cloud.apihub.v1.IIssue} message Issue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Issue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Issue message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.Issue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.Issue} Issue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Issue.decode = function 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.apihub.v1.Issue(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.code = reader.string(); - break; - } - case 2: { - if (!(message.path && message.path.length)) - message.path = []; - message.path.push(reader.string()); - break; - } - case 3: { - message.message = reader.string(); - break; - } - case 4: { - message.severity = reader.int32(); - break; - } - case 5: { - message.range = $root.google.cloud.apihub.v1.Range.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Issue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.Issue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.Issue} Issue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Issue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Issue message. - * @function verify - * @memberof google.cloud.apihub.v1.Issue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Issue.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.code != null && message.hasOwnProperty("code")) - if (!$util.isString(message.code)) - return "code: string 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.isString(message.path[i])) - return "path: string[] expected"; - } - if (message.message != null && message.hasOwnProperty("message")) - if (!$util.isString(message.message)) - return "message: string expected"; - if (message.severity != null && message.hasOwnProperty("severity")) - switch (message.severity) { - default: - return "severity: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - if (message.range != null && message.hasOwnProperty("range")) { - var error = $root.google.cloud.apihub.v1.Range.verify(message.range); - if (error) - return "range." + error; - } - return null; - }; - - /** - * Creates an Issue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.Issue - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.Issue} Issue - */ - Issue.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.Issue) - return object; - var message = new $root.google.cloud.apihub.v1.Issue(); - if (object.code != null) - message.code = String(object.code); - if (object.path) { - if (!Array.isArray(object.path)) - throw TypeError(".google.cloud.apihub.v1.Issue.path: array expected"); - message.path = []; - for (var i = 0; i < object.path.length; ++i) - message.path[i] = String(object.path[i]); - } - if (object.message != null) - message.message = String(object.message); - switch (object.severity) { - default: - if (typeof object.severity === "number") { - message.severity = object.severity; - break; - } - break; - case "SEVERITY_UNSPECIFIED": - case 0: - message.severity = 0; - break; - case "SEVERITY_ERROR": - case 1: - message.severity = 1; - break; - case "SEVERITY_WARNING": - case 2: - message.severity = 2; - break; - case "SEVERITY_INFO": - case 3: - message.severity = 3; - break; - case "SEVERITY_HINT": - case 4: - message.severity = 4; - break; - } - if (object.range != null) { - if (typeof object.range !== "object") - throw TypeError(".google.cloud.apihub.v1.Issue.range: object expected"); - message.range = $root.google.cloud.apihub.v1.Range.fromObject(object.range); - } - return message; - }; - - /** - * Creates a plain object from an Issue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.Issue - * @static - * @param {google.cloud.apihub.v1.Issue} message Issue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Issue.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.path = []; - if (options.defaults) { - object.code = ""; - object.message = ""; - object.severity = options.enums === String ? "SEVERITY_UNSPECIFIED" : 0; - object.range = null; - } - if (message.code != null && message.hasOwnProperty("code")) - object.code = message.code; - 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.message != null && message.hasOwnProperty("message")) - object.message = message.message; - if (message.severity != null && message.hasOwnProperty("severity")) - object.severity = options.enums === String ? $root.google.cloud.apihub.v1.Severity[message.severity] === undefined ? message.severity : $root.google.cloud.apihub.v1.Severity[message.severity] : message.severity; - if (message.range != null && message.hasOwnProperty("range")) - object.range = $root.google.cloud.apihub.v1.Range.toObject(message.range, options); - return object; - }; - - /** - * Converts this Issue to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.Issue - * @instance - * @returns {Object.} JSON object - */ - Issue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Issue - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.Issue - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Issue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.Issue"; - }; - - return Issue; - })(); - - v1.Range = (function() { - - /** - * Properties of a Range. - * @memberof google.cloud.apihub.v1 - * @interface IRange - * @property {google.cloud.apihub.v1.IPoint|null} [start] Range start - * @property {google.cloud.apihub.v1.IPoint|null} [end] Range end - */ - - /** - * Constructs a new Range. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents a Range. - * @implements IRange - * @constructor - * @param {google.cloud.apihub.v1.IRange=} [properties] Properties to set - */ - function Range(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]]; - } - - /** - * Range start. - * @member {google.cloud.apihub.v1.IPoint|null|undefined} start - * @memberof google.cloud.apihub.v1.Range - * @instance - */ - Range.prototype.start = null; - - /** - * Range end. - * @member {google.cloud.apihub.v1.IPoint|null|undefined} end - * @memberof google.cloud.apihub.v1.Range - * @instance - */ - Range.prototype.end = null; - - /** - * Creates a new Range instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.Range - * @static - * @param {google.cloud.apihub.v1.IRange=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.Range} Range instance - */ - Range.create = function create(properties) { - return new Range(properties); - }; - - /** - * Encodes the specified Range message. Does not implicitly {@link google.cloud.apihub.v1.Range.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.Range - * @static - * @param {google.cloud.apihub.v1.IRange} message Range message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Range.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.start != null && Object.hasOwnProperty.call(message, "start")) - $root.google.cloud.apihub.v1.Point.encode(message.start, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - $root.google.cloud.apihub.v1.Point.encode(message.end, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Range message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.Range.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.Range - * @static - * @param {google.cloud.apihub.v1.IRange} message Range message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Range.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Range message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.Range - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.Range} Range - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Range.decode = function 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.apihub.v1.Range(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.start = $root.google.cloud.apihub.v1.Point.decode(reader, reader.uint32()); - break; - } - case 2: { - message.end = $root.google.cloud.apihub.v1.Point.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Range message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.Range - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.Range} Range - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Range.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Range message. - * @function verify - * @memberof google.cloud.apihub.v1.Range - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Range.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.start != null && message.hasOwnProperty("start")) { - var error = $root.google.cloud.apihub.v1.Point.verify(message.start); - if (error) - return "start." + error; - } - if (message.end != null && message.hasOwnProperty("end")) { - var error = $root.google.cloud.apihub.v1.Point.verify(message.end); - if (error) - return "end." + error; - } - return null; - }; - - /** - * Creates a Range message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.Range - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.Range} Range - */ - Range.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.Range) - return object; - var message = new $root.google.cloud.apihub.v1.Range(); - if (object.start != null) { - if (typeof object.start !== "object") - throw TypeError(".google.cloud.apihub.v1.Range.start: object expected"); - message.start = $root.google.cloud.apihub.v1.Point.fromObject(object.start); - } - if (object.end != null) { - if (typeof object.end !== "object") - throw TypeError(".google.cloud.apihub.v1.Range.end: object expected"); - message.end = $root.google.cloud.apihub.v1.Point.fromObject(object.end); - } - return message; - }; - - /** - * Creates a plain object from a Range message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.Range - * @static - * @param {google.cloud.apihub.v1.Range} message Range - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Range.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.start = null; - object.end = null; - } - if (message.start != null && message.hasOwnProperty("start")) - object.start = $root.google.cloud.apihub.v1.Point.toObject(message.start, options); - if (message.end != null && message.hasOwnProperty("end")) - object.end = $root.google.cloud.apihub.v1.Point.toObject(message.end, options); - return object; - }; - - /** - * Converts this Range to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.Range - * @instance - * @returns {Object.} JSON object - */ - Range.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Range - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.Range - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Range.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.Range"; - }; - - return Range; - })(); - - v1.Point = (function() { - - /** - * Properties of a Point. - * @memberof google.cloud.apihub.v1 - * @interface IPoint - * @property {number|null} [line] Point line - * @property {number|null} [character] Point character - */ - - /** - * Constructs a new Point. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents a Point. - * @implements IPoint - * @constructor - * @param {google.cloud.apihub.v1.IPoint=} [properties] Properties to set - */ - function Point(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]]; - } - - /** - * Point line. - * @member {number} line - * @memberof google.cloud.apihub.v1.Point - * @instance - */ - Point.prototype.line = 0; - - /** - * Point character. - * @member {number} character - * @memberof google.cloud.apihub.v1.Point - * @instance - */ - Point.prototype.character = 0; - - /** - * Creates a new Point instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.Point - * @static - * @param {google.cloud.apihub.v1.IPoint=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.Point} Point instance - */ - Point.create = function create(properties) { - return new Point(properties); - }; - - /** - * Encodes the specified Point message. Does not implicitly {@link google.cloud.apihub.v1.Point.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.Point - * @static - * @param {google.cloud.apihub.v1.IPoint} message Point message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Point.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.line != null && Object.hasOwnProperty.call(message, "line")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.line); - if (message.character != null && Object.hasOwnProperty.call(message, "character")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.character); - return writer; - }; - - /** - * Encodes the specified Point message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.Point.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.Point - * @static - * @param {google.cloud.apihub.v1.IPoint} message Point message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Point.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Point message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.Point - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.Point} Point - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Point.decode = function 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.apihub.v1.Point(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.line = reader.int32(); - break; - } - case 2: { - message.character = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Point message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.Point - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.Point} Point - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Point.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Point message. - * @function verify - * @memberof google.cloud.apihub.v1.Point - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Point.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.line != null && message.hasOwnProperty("line")) - if (!$util.isInteger(message.line)) - return "line: integer expected"; - if (message.character != null && message.hasOwnProperty("character")) - if (!$util.isInteger(message.character)) - return "character: integer expected"; - return null; - }; - - /** - * Creates a Point message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.Point - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.Point} Point - */ - Point.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.Point) - return object; - var message = new $root.google.cloud.apihub.v1.Point(); - if (object.line != null) - message.line = object.line | 0; - if (object.character != null) - message.character = object.character | 0; - return message; - }; - - /** - * Creates a plain object from a Point message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.Point - * @static - * @param {google.cloud.apihub.v1.Point} message Point - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Point.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.line = 0; - object.character = 0; - } - if (message.line != null && message.hasOwnProperty("line")) - object.line = message.line; - if (message.character != null && message.hasOwnProperty("character")) - object.character = message.character; - return object; - }; - - /** - * Converts this Point to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.Point - * @instance - * @returns {Object.} JSON object - */ - Point.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Point - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.Point - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Point.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.Point"; - }; - - return Point; - })(); - - v1.OperationMetadata = (function() { - - /** - * Properties of an OperationMetadata. - * @memberof google.cloud.apihub.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.apihub.v1 - * @classdesc Represents an OperationMetadata. - * @implements IOperationMetadata - * @constructor - * @param {google.cloud.apihub.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.apihub.v1.OperationMetadata - * @instance - */ - OperationMetadata.prototype.createTime = null; - - /** - * OperationMetadata endTime. - * @member {google.protobuf.ITimestamp|null|undefined} endTime - * @memberof google.cloud.apihub.v1.OperationMetadata - * @instance - */ - OperationMetadata.prototype.endTime = null; - - /** - * OperationMetadata target. - * @member {string} target - * @memberof google.cloud.apihub.v1.OperationMetadata - * @instance - */ - OperationMetadata.prototype.target = ""; - - /** - * OperationMetadata verb. - * @member {string} verb - * @memberof google.cloud.apihub.v1.OperationMetadata - * @instance - */ - OperationMetadata.prototype.verb = ""; - - /** - * OperationMetadata statusMessage. - * @member {string} statusMessage - * @memberof google.cloud.apihub.v1.OperationMetadata - * @instance - */ - OperationMetadata.prototype.statusMessage = ""; - - /** - * OperationMetadata requestedCancellation. - * @member {boolean} requestedCancellation - * @memberof google.cloud.apihub.v1.OperationMetadata - * @instance - */ - OperationMetadata.prototype.requestedCancellation = false; - - /** - * OperationMetadata apiVersion. - * @member {string} apiVersion - * @memberof google.cloud.apihub.v1.OperationMetadata - * @instance - */ - OperationMetadata.prototype.apiVersion = ""; - - /** - * Creates a new OperationMetadata instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.OperationMetadata - * @static - * @param {google.cloud.apihub.v1.IOperationMetadata=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.OperationMetadata} OperationMetadata instance - */ - OperationMetadata.create = function create(properties) { - return new OperationMetadata(properties); - }; - - /** - * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.apihub.v1.OperationMetadata.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.OperationMetadata - * @static - * @param {google.cloud.apihub.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.apihub.v1.OperationMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.OperationMetadata - * @static - * @param {google.cloud.apihub.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.apihub.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.apihub.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.apihub.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.apihub.v1.OperationMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.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.apihub.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.apihub.v1.OperationMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.OperationMetadata} OperationMetadata - */ - OperationMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.OperationMetadata) - return object; - var message = new $root.google.cloud.apihub.v1.OperationMetadata(); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.apihub.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.apihub.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.apihub.v1.OperationMetadata - * @static - * @param {google.cloud.apihub.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.apihub.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.apihub.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.apihub.v1.OperationMetadata"; - }; - - return OperationMetadata; - })(); - - v1.ApiHubInstance = (function() { - - /** - * Properties of an ApiHubInstance. - * @memberof google.cloud.apihub.v1 - * @interface IApiHubInstance - * @property {string|null} [name] ApiHubInstance name - * @property {google.protobuf.ITimestamp|null} [createTime] ApiHubInstance createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] ApiHubInstance updateTime - * @property {google.cloud.apihub.v1.ApiHubInstance.State|null} [state] ApiHubInstance state - * @property {string|null} [stateMessage] ApiHubInstance stateMessage - * @property {google.cloud.apihub.v1.ApiHubInstance.IConfig|null} [config] ApiHubInstance config - * @property {Object.|null} [labels] ApiHubInstance labels - * @property {string|null} [description] ApiHubInstance description - */ - - /** - * Constructs a new ApiHubInstance. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents an ApiHubInstance. - * @implements IApiHubInstance - * @constructor - * @param {google.cloud.apihub.v1.IApiHubInstance=} [properties] Properties to set - */ - function ApiHubInstance(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]]; - } - - /** - * ApiHubInstance name. - * @member {string} name - * @memberof google.cloud.apihub.v1.ApiHubInstance - * @instance - */ - ApiHubInstance.prototype.name = ""; - - /** - * ApiHubInstance createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.apihub.v1.ApiHubInstance - * @instance - */ - ApiHubInstance.prototype.createTime = null; - - /** - * ApiHubInstance updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.apihub.v1.ApiHubInstance - * @instance - */ - ApiHubInstance.prototype.updateTime = null; - - /** - * ApiHubInstance state. - * @member {google.cloud.apihub.v1.ApiHubInstance.State} state - * @memberof google.cloud.apihub.v1.ApiHubInstance - * @instance - */ - ApiHubInstance.prototype.state = 0; - - /** - * ApiHubInstance stateMessage. - * @member {string} stateMessage - * @memberof google.cloud.apihub.v1.ApiHubInstance - * @instance - */ - ApiHubInstance.prototype.stateMessage = ""; - - /** - * ApiHubInstance config. - * @member {google.cloud.apihub.v1.ApiHubInstance.IConfig|null|undefined} config - * @memberof google.cloud.apihub.v1.ApiHubInstance - * @instance - */ - ApiHubInstance.prototype.config = null; - - /** - * ApiHubInstance labels. - * @member {Object.} labels - * @memberof google.cloud.apihub.v1.ApiHubInstance - * @instance - */ - ApiHubInstance.prototype.labels = $util.emptyObject; - - /** - * ApiHubInstance description. - * @member {string} description - * @memberof google.cloud.apihub.v1.ApiHubInstance - * @instance - */ - ApiHubInstance.prototype.description = ""; - - /** - * Creates a new ApiHubInstance instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.ApiHubInstance - * @static - * @param {google.cloud.apihub.v1.IApiHubInstance=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.ApiHubInstance} ApiHubInstance instance - */ - ApiHubInstance.create = function create(properties) { - return new ApiHubInstance(properties); - }; - - /** - * Encodes the specified ApiHubInstance message. Does not implicitly {@link google.cloud.apihub.v1.ApiHubInstance.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.ApiHubInstance - * @static - * @param {google.cloud.apihub.v1.IApiHubInstance} message ApiHubInstance message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ApiHubInstance.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.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.state); - if (message.stateMessage != null && Object.hasOwnProperty.call(message, "stateMessage")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.stateMessage); - if (message.config != null && Object.hasOwnProperty.call(message, "config")) - $root.google.cloud.apihub.v1.ApiHubInstance.Config.encode(message.config, writer.uint32(/* id 6, wireType 2 =*/50).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 7, wireType 2 =*/58).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 8, wireType 2 =*/66).string(message.description); - return writer; - }; - - /** - * Encodes the specified ApiHubInstance message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ApiHubInstance.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.ApiHubInstance - * @static - * @param {google.cloud.apihub.v1.IApiHubInstance} message ApiHubInstance message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ApiHubInstance.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ApiHubInstance message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.ApiHubInstance - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.ApiHubInstance} ApiHubInstance - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ApiHubInstance.decode = function 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.apihub.v1.ApiHubInstance(), 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: { - message.state = reader.int32(); - break; - } - case 5: { - message.stateMessage = reader.string(); - break; - } - case 6: { - message.config = $root.google.cloud.apihub.v1.ApiHubInstance.Config.decode(reader, reader.uint32()); - break; - } - case 7: { - 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 8: { - message.description = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ApiHubInstance message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.ApiHubInstance - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.ApiHubInstance} ApiHubInstance - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ApiHubInstance.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ApiHubInstance message. - * @function verify - * @memberof google.cloud.apihub.v1.ApiHubInstance - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ApiHubInstance.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.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.stateMessage != null && message.hasOwnProperty("stateMessage")) - if (!$util.isString(message.stateMessage)) - return "stateMessage: string expected"; - if (message.config != null && message.hasOwnProperty("config")) { - var error = $root.google.cloud.apihub.v1.ApiHubInstance.Config.verify(message.config); - if (error) - return "config." + 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"; - return null; - }; - - /** - * Creates an ApiHubInstance message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.ApiHubInstance - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.ApiHubInstance} ApiHubInstance - */ - ApiHubInstance.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.ApiHubInstance) - return object; - var message = new $root.google.cloud.apihub.v1.ApiHubInstance(); - if (object.name != null) - message.name = String(object.name); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.apihub.v1.ApiHubInstance.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.apihub.v1.ApiHubInstance.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - 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 "CREATING": - case 2: - message.state = 2; - break; - case "ACTIVE": - case 3: - message.state = 3; - break; - case "UPDATING": - case 4: - message.state = 4; - break; - case "DELETING": - case 5: - message.state = 5; - break; - case "FAILED": - case 6: - message.state = 6; - break; - } - if (object.stateMessage != null) - message.stateMessage = String(object.stateMessage); - if (object.config != null) { - if (typeof object.config !== "object") - throw TypeError(".google.cloud.apihub.v1.ApiHubInstance.config: object expected"); - message.config = $root.google.cloud.apihub.v1.ApiHubInstance.Config.fromObject(object.config); - } - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.apihub.v1.ApiHubInstance.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); - return message; - }; - - /** - * Creates a plain object from an ApiHubInstance message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.ApiHubInstance - * @static - * @param {google.cloud.apihub.v1.ApiHubInstance} message ApiHubInstance - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ApiHubInstance.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.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.stateMessage = ""; - object.config = null; - object.description = ""; - } - 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); - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.apihub.v1.ApiHubInstance.State[message.state] === undefined ? message.state : $root.google.cloud.apihub.v1.ApiHubInstance.State[message.state] : message.state; - if (message.stateMessage != null && message.hasOwnProperty("stateMessage")) - object.stateMessage = message.stateMessage; - if (message.config != null && message.hasOwnProperty("config")) - object.config = $root.google.cloud.apihub.v1.ApiHubInstance.Config.toObject(message.config, 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; - return object; - }; - - /** - * Converts this ApiHubInstance to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.ApiHubInstance - * @instance - * @returns {Object.} JSON object - */ - ApiHubInstance.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ApiHubInstance - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.ApiHubInstance - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ApiHubInstance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.ApiHubInstance"; - }; - - ApiHubInstance.Config = (function() { - - /** - * Properties of a Config. - * @memberof google.cloud.apihub.v1.ApiHubInstance - * @interface IConfig - * @property {string|null} [cmekKeyName] Config cmekKeyName - */ - - /** - * Constructs a new Config. - * @memberof google.cloud.apihub.v1.ApiHubInstance - * @classdesc Represents a Config. - * @implements IConfig - * @constructor - * @param {google.cloud.apihub.v1.ApiHubInstance.IConfig=} [properties] Properties to set - */ - function Config(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]]; - } - - /** - * Config cmekKeyName. - * @member {string} cmekKeyName - * @memberof google.cloud.apihub.v1.ApiHubInstance.Config - * @instance - */ - Config.prototype.cmekKeyName = ""; - - /** - * Creates a new Config instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.ApiHubInstance.Config - * @static - * @param {google.cloud.apihub.v1.ApiHubInstance.IConfig=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.ApiHubInstance.Config} Config instance - */ - Config.create = function create(properties) { - return new Config(properties); - }; - - /** - * Encodes the specified Config message. Does not implicitly {@link google.cloud.apihub.v1.ApiHubInstance.Config.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.ApiHubInstance.Config - * @static - * @param {google.cloud.apihub.v1.ApiHubInstance.IConfig} message Config message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Config.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.cmekKeyName != null && Object.hasOwnProperty.call(message, "cmekKeyName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.cmekKeyName); - return writer; - }; - - /** - * Encodes the specified Config message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ApiHubInstance.Config.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.ApiHubInstance.Config - * @static - * @param {google.cloud.apihub.v1.ApiHubInstance.IConfig} message Config message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Config.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Config message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.ApiHubInstance.Config - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.ApiHubInstance.Config} Config - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Config.decode = function 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.apihub.v1.ApiHubInstance.Config(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.cmekKeyName = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Config message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.ApiHubInstance.Config - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.ApiHubInstance.Config} Config - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Config.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Config message. - * @function verify - * @memberof google.cloud.apihub.v1.ApiHubInstance.Config - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Config.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.cmekKeyName != null && message.hasOwnProperty("cmekKeyName")) - if (!$util.isString(message.cmekKeyName)) - return "cmekKeyName: string expected"; - return null; - }; - - /** - * Creates a Config message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.ApiHubInstance.Config - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.ApiHubInstance.Config} Config - */ - Config.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.ApiHubInstance.Config) - return object; - var message = new $root.google.cloud.apihub.v1.ApiHubInstance.Config(); - if (object.cmekKeyName != null) - message.cmekKeyName = String(object.cmekKeyName); - return message; - }; - - /** - * Creates a plain object from a Config message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.ApiHubInstance.Config - * @static - * @param {google.cloud.apihub.v1.ApiHubInstance.Config} message Config - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Config.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.cmekKeyName = ""; - if (message.cmekKeyName != null && message.hasOwnProperty("cmekKeyName")) - object.cmekKeyName = message.cmekKeyName; - return object; - }; - - /** - * Converts this Config to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.ApiHubInstance.Config - * @instance - * @returns {Object.} JSON object - */ - Config.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Config - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.ApiHubInstance.Config - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Config.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.ApiHubInstance.Config"; - }; - - return Config; - })(); - - /** - * State enum. - * @name google.cloud.apihub.v1.ApiHubInstance.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} INACTIVE=1 INACTIVE value - * @property {number} CREATING=2 CREATING value - * @property {number} ACTIVE=3 ACTIVE value - * @property {number} UPDATING=4 UPDATING value - * @property {number} DELETING=5 DELETING value - * @property {number} FAILED=6 FAILED value - */ - ApiHubInstance.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "INACTIVE"] = 1; - values[valuesById[2] = "CREATING"] = 2; - values[valuesById[3] = "ACTIVE"] = 3; - values[valuesById[4] = "UPDATING"] = 4; - values[valuesById[5] = "DELETING"] = 5; - values[valuesById[6] = "FAILED"] = 6; - return values; - })(); - - return ApiHubInstance; - })(); - - v1.ExternalApi = (function() { - - /** - * Properties of an ExternalApi. - * @memberof google.cloud.apihub.v1 - * @interface IExternalApi - * @property {string|null} [name] ExternalApi name - * @property {string|null} [displayName] ExternalApi displayName - * @property {string|null} [description] ExternalApi description - * @property {Array.|null} [endpoints] ExternalApi endpoints - * @property {Array.|null} [paths] ExternalApi paths - * @property {google.cloud.apihub.v1.IDocumentation|null} [documentation] ExternalApi documentation - * @property {Object.|null} [attributes] ExternalApi attributes - * @property {google.protobuf.ITimestamp|null} [createTime] ExternalApi createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] ExternalApi updateTime - */ - - /** - * Constructs a new ExternalApi. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents an ExternalApi. - * @implements IExternalApi - * @constructor - * @param {google.cloud.apihub.v1.IExternalApi=} [properties] Properties to set - */ - function ExternalApi(properties) { - this.endpoints = []; - this.paths = []; - this.attributes = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ExternalApi name. - * @member {string} name - * @memberof google.cloud.apihub.v1.ExternalApi - * @instance - */ - ExternalApi.prototype.name = ""; - - /** - * ExternalApi displayName. - * @member {string} displayName - * @memberof google.cloud.apihub.v1.ExternalApi - * @instance - */ - ExternalApi.prototype.displayName = ""; - - /** - * ExternalApi description. - * @member {string} description - * @memberof google.cloud.apihub.v1.ExternalApi - * @instance - */ - ExternalApi.prototype.description = ""; - - /** - * ExternalApi endpoints. - * @member {Array.} endpoints - * @memberof google.cloud.apihub.v1.ExternalApi - * @instance - */ - ExternalApi.prototype.endpoints = $util.emptyArray; - - /** - * ExternalApi paths. - * @member {Array.} paths - * @memberof google.cloud.apihub.v1.ExternalApi - * @instance - */ - ExternalApi.prototype.paths = $util.emptyArray; - - /** - * ExternalApi documentation. - * @member {google.cloud.apihub.v1.IDocumentation|null|undefined} documentation - * @memberof google.cloud.apihub.v1.ExternalApi - * @instance - */ - ExternalApi.prototype.documentation = null; - - /** - * ExternalApi attributes. - * @member {Object.} attributes - * @memberof google.cloud.apihub.v1.ExternalApi - * @instance - */ - ExternalApi.prototype.attributes = $util.emptyObject; - - /** - * ExternalApi createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.apihub.v1.ExternalApi - * @instance - */ - ExternalApi.prototype.createTime = null; - - /** - * ExternalApi updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.apihub.v1.ExternalApi - * @instance - */ - ExternalApi.prototype.updateTime = null; - - /** - * Creates a new ExternalApi instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.ExternalApi - * @static - * @param {google.cloud.apihub.v1.IExternalApi=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.ExternalApi} ExternalApi instance - */ - ExternalApi.create = function create(properties) { - return new ExternalApi(properties); - }; - - /** - * Encodes the specified ExternalApi message. Does not implicitly {@link google.cloud.apihub.v1.ExternalApi.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.ExternalApi - * @static - * @param {google.cloud.apihub.v1.IExternalApi} message ExternalApi message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExternalApi.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); - if (message.endpoints != null && message.endpoints.length) - for (var i = 0; i < message.endpoints.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.endpoints[i]); - if (message.paths != null && message.paths.length) - for (var i = 0; i < message.paths.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.paths[i]); - if (message.documentation != null && Object.hasOwnProperty.call(message, "documentation")) - $root.google.cloud.apihub.v1.Documentation.encode(message.documentation, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.attributes != null && Object.hasOwnProperty.call(message, "attributes")) - for (var keys = Object.keys(message.attributes), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.cloud.apihub.v1.AttributeValues.encode(message.attributes[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ExternalApi message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ExternalApi.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.ExternalApi - * @static - * @param {google.cloud.apihub.v1.IExternalApi} message ExternalApi message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExternalApi.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExternalApi message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.ExternalApi - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.ExternalApi} ExternalApi - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExternalApi.decode = function 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.apihub.v1.ExternalApi(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.displayName = reader.string(); - break; - } - case 3: { - message.description = reader.string(); - break; - } - case 4: { - if (!(message.endpoints && message.endpoints.length)) - message.endpoints = []; - message.endpoints.push(reader.string()); - break; - } - case 5: { - if (!(message.paths && message.paths.length)) - message.paths = []; - message.paths.push(reader.string()); - break; - } - case 6: { - message.documentation = $root.google.cloud.apihub.v1.Documentation.decode(reader, reader.uint32()); - break; - } - case 7: { - if (message.attributes === $util.emptyObject) - message.attributes = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = null; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = $root.google.cloud.apihub.v1.AttributeValues.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.attributes[key] = value; - break; - } - case 8: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 9: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ExternalApi message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.ExternalApi - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.ExternalApi} ExternalApi - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExternalApi.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExternalApi message. - * @function verify - * @memberof google.cloud.apihub.v1.ExternalApi - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExternalApi.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.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.endpoints != null && message.hasOwnProperty("endpoints")) { - if (!Array.isArray(message.endpoints)) - return "endpoints: array expected"; - for (var i = 0; i < message.endpoints.length; ++i) - if (!$util.isString(message.endpoints[i])) - return "endpoints: string[] 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"; - } - if (message.documentation != null && message.hasOwnProperty("documentation")) { - var error = $root.google.cloud.apihub.v1.Documentation.verify(message.documentation); - if (error) - return "documentation." + error; - } - if (message.attributes != null && message.hasOwnProperty("attributes")) { - if (!$util.isObject(message.attributes)) - return "attributes: object expected"; - var key = Object.keys(message.attributes); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.cloud.apihub.v1.AttributeValues.verify(message.attributes[key[i]]); - if (error) - return "attributes." + error; - } - } - 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; - } - return null; - }; - - /** - * Creates an ExternalApi message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.ExternalApi - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.ExternalApi} ExternalApi - */ - ExternalApi.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.ExternalApi) - return object; - var message = new $root.google.cloud.apihub.v1.ExternalApi(); - if (object.name != null) - message.name = String(object.name); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.description != null) - message.description = String(object.description); - if (object.endpoints) { - if (!Array.isArray(object.endpoints)) - throw TypeError(".google.cloud.apihub.v1.ExternalApi.endpoints: array expected"); - message.endpoints = []; - for (var i = 0; i < object.endpoints.length; ++i) - message.endpoints[i] = String(object.endpoints[i]); - } - if (object.paths) { - if (!Array.isArray(object.paths)) - throw TypeError(".google.cloud.apihub.v1.ExternalApi.paths: array expected"); - message.paths = []; - for (var i = 0; i < object.paths.length; ++i) - message.paths[i] = String(object.paths[i]); - } - if (object.documentation != null) { - if (typeof object.documentation !== "object") - throw TypeError(".google.cloud.apihub.v1.ExternalApi.documentation: object expected"); - message.documentation = $root.google.cloud.apihub.v1.Documentation.fromObject(object.documentation); - } - if (object.attributes) { - if (typeof object.attributes !== "object") - throw TypeError(".google.cloud.apihub.v1.ExternalApi.attributes: object expected"); - message.attributes = {}; - for (var keys = Object.keys(object.attributes), i = 0; i < keys.length; ++i) { - if (typeof object.attributes[keys[i]] !== "object") - throw TypeError(".google.cloud.apihub.v1.ExternalApi.attributes: object expected"); - message.attributes[keys[i]] = $root.google.cloud.apihub.v1.AttributeValues.fromObject(object.attributes[keys[i]]); - } - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.apihub.v1.ExternalApi.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.apihub.v1.ExternalApi.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - return message; - }; - - /** - * Creates a plain object from an ExternalApi message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.ExternalApi - * @static - * @param {google.cloud.apihub.v1.ExternalApi} message ExternalApi - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExternalApi.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.endpoints = []; - object.paths = []; - } - if (options.objects || options.defaults) - object.attributes = {}; - if (options.defaults) { - object.name = ""; - object.displayName = ""; - object.description = ""; - object.documentation = null; - object.createTime = null; - object.updateTime = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.endpoints && message.endpoints.length) { - object.endpoints = []; - for (var j = 0; j < message.endpoints.length; ++j) - object.endpoints[j] = message.endpoints[j]; - } - if (message.paths && message.paths.length) { - object.paths = []; - for (var j = 0; j < message.paths.length; ++j) - object.paths[j] = message.paths[j]; - } - if (message.documentation != null && message.hasOwnProperty("documentation")) - object.documentation = $root.google.cloud.apihub.v1.Documentation.toObject(message.documentation, options); - var keys2; - if (message.attributes && (keys2 = Object.keys(message.attributes)).length) { - object.attributes = {}; - for (var j = 0; j < keys2.length; ++j) - object.attributes[keys2[j]] = $root.google.cloud.apihub.v1.AttributeValues.toObject(message.attributes[keys2[j]], options); - } - 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); - return object; - }; - - /** - * Converts this ExternalApi to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.ExternalApi - * @instance - * @returns {Object.} JSON object - */ - ExternalApi.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ExternalApi - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.ExternalApi - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExternalApi.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.ExternalApi"; - }; - - return ExternalApi; - })(); - - v1.HostProjectRegistrationService = (function() { - - /** - * Constructs a new HostProjectRegistrationService service. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents a HostProjectRegistrationService - * @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 HostProjectRegistrationService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (HostProjectRegistrationService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = HostProjectRegistrationService; - - /** - * Creates new HostProjectRegistrationService service using the specified rpc implementation. - * @function create - * @memberof google.cloud.apihub.v1.HostProjectRegistrationService - * @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 {HostProjectRegistrationService} RPC service. Useful where requests and/or responses are streamed. - */ - HostProjectRegistrationService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.cloud.apihub.v1.HostProjectRegistrationService|createHostProjectRegistration}. - * @memberof google.cloud.apihub.v1.HostProjectRegistrationService - * @typedef CreateHostProjectRegistrationCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.apihub.v1.HostProjectRegistration} [response] HostProjectRegistration - */ - - /** - * Calls CreateHostProjectRegistration. - * @function createHostProjectRegistration - * @memberof google.cloud.apihub.v1.HostProjectRegistrationService - * @instance - * @param {google.cloud.apihub.v1.ICreateHostProjectRegistrationRequest} request CreateHostProjectRegistrationRequest message or plain object - * @param {google.cloud.apihub.v1.HostProjectRegistrationService.CreateHostProjectRegistrationCallback} callback Node-style callback called with the error, if any, and HostProjectRegistration - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(HostProjectRegistrationService.prototype.createHostProjectRegistration = function createHostProjectRegistration(request, callback) { - return this.rpcCall(createHostProjectRegistration, $root.google.cloud.apihub.v1.CreateHostProjectRegistrationRequest, $root.google.cloud.apihub.v1.HostProjectRegistration, request, callback); - }, "name", { value: "CreateHostProjectRegistration" }); - - /** - * Calls CreateHostProjectRegistration. - * @function createHostProjectRegistration - * @memberof google.cloud.apihub.v1.HostProjectRegistrationService - * @instance - * @param {google.cloud.apihub.v1.ICreateHostProjectRegistrationRequest} request CreateHostProjectRegistrationRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.apihub.v1.HostProjectRegistrationService|getHostProjectRegistration}. - * @memberof google.cloud.apihub.v1.HostProjectRegistrationService - * @typedef GetHostProjectRegistrationCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.apihub.v1.HostProjectRegistration} [response] HostProjectRegistration - */ - - /** - * Calls GetHostProjectRegistration. - * @function getHostProjectRegistration - * @memberof google.cloud.apihub.v1.HostProjectRegistrationService - * @instance - * @param {google.cloud.apihub.v1.IGetHostProjectRegistrationRequest} request GetHostProjectRegistrationRequest message or plain object - * @param {google.cloud.apihub.v1.HostProjectRegistrationService.GetHostProjectRegistrationCallback} callback Node-style callback called with the error, if any, and HostProjectRegistration - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(HostProjectRegistrationService.prototype.getHostProjectRegistration = function getHostProjectRegistration(request, callback) { - return this.rpcCall(getHostProjectRegistration, $root.google.cloud.apihub.v1.GetHostProjectRegistrationRequest, $root.google.cloud.apihub.v1.HostProjectRegistration, request, callback); - }, "name", { value: "GetHostProjectRegistration" }); - - /** - * Calls GetHostProjectRegistration. - * @function getHostProjectRegistration - * @memberof google.cloud.apihub.v1.HostProjectRegistrationService - * @instance - * @param {google.cloud.apihub.v1.IGetHostProjectRegistrationRequest} request GetHostProjectRegistrationRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.apihub.v1.HostProjectRegistrationService|listHostProjectRegistrations}. - * @memberof google.cloud.apihub.v1.HostProjectRegistrationService - * @typedef ListHostProjectRegistrationsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.apihub.v1.ListHostProjectRegistrationsResponse} [response] ListHostProjectRegistrationsResponse - */ - - /** - * Calls ListHostProjectRegistrations. - * @function listHostProjectRegistrations - * @memberof google.cloud.apihub.v1.HostProjectRegistrationService - * @instance - * @param {google.cloud.apihub.v1.IListHostProjectRegistrationsRequest} request ListHostProjectRegistrationsRequest message or plain object - * @param {google.cloud.apihub.v1.HostProjectRegistrationService.ListHostProjectRegistrationsCallback} callback Node-style callback called with the error, if any, and ListHostProjectRegistrationsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(HostProjectRegistrationService.prototype.listHostProjectRegistrations = function listHostProjectRegistrations(request, callback) { - return this.rpcCall(listHostProjectRegistrations, $root.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest, $root.google.cloud.apihub.v1.ListHostProjectRegistrationsResponse, request, callback); - }, "name", { value: "ListHostProjectRegistrations" }); - - /** - * Calls ListHostProjectRegistrations. - * @function listHostProjectRegistrations - * @memberof google.cloud.apihub.v1.HostProjectRegistrationService - * @instance - * @param {google.cloud.apihub.v1.IListHostProjectRegistrationsRequest} request ListHostProjectRegistrationsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return HostProjectRegistrationService; - })(); - - v1.CreateHostProjectRegistrationRequest = (function() { - - /** - * Properties of a CreateHostProjectRegistrationRequest. - * @memberof google.cloud.apihub.v1 - * @interface ICreateHostProjectRegistrationRequest - * @property {string|null} [parent] CreateHostProjectRegistrationRequest parent - * @property {string|null} [hostProjectRegistrationId] CreateHostProjectRegistrationRequest hostProjectRegistrationId - * @property {google.cloud.apihub.v1.IHostProjectRegistration|null} [hostProjectRegistration] CreateHostProjectRegistrationRequest hostProjectRegistration - */ - - /** - * Constructs a new CreateHostProjectRegistrationRequest. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents a CreateHostProjectRegistrationRequest. - * @implements ICreateHostProjectRegistrationRequest - * @constructor - * @param {google.cloud.apihub.v1.ICreateHostProjectRegistrationRequest=} [properties] Properties to set - */ - function CreateHostProjectRegistrationRequest(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]]; - } - - /** - * CreateHostProjectRegistrationRequest parent. - * @member {string} parent - * @memberof google.cloud.apihub.v1.CreateHostProjectRegistrationRequest - * @instance - */ - CreateHostProjectRegistrationRequest.prototype.parent = ""; - - /** - * CreateHostProjectRegistrationRequest hostProjectRegistrationId. - * @member {string} hostProjectRegistrationId - * @memberof google.cloud.apihub.v1.CreateHostProjectRegistrationRequest - * @instance - */ - CreateHostProjectRegistrationRequest.prototype.hostProjectRegistrationId = ""; - - /** - * CreateHostProjectRegistrationRequest hostProjectRegistration. - * @member {google.cloud.apihub.v1.IHostProjectRegistration|null|undefined} hostProjectRegistration - * @memberof google.cloud.apihub.v1.CreateHostProjectRegistrationRequest - * @instance - */ - CreateHostProjectRegistrationRequest.prototype.hostProjectRegistration = null; - - /** - * Creates a new CreateHostProjectRegistrationRequest instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.CreateHostProjectRegistrationRequest - * @static - * @param {google.cloud.apihub.v1.ICreateHostProjectRegistrationRequest=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.CreateHostProjectRegistrationRequest} CreateHostProjectRegistrationRequest instance - */ - CreateHostProjectRegistrationRequest.create = function create(properties) { - return new CreateHostProjectRegistrationRequest(properties); - }; - - /** - * Encodes the specified CreateHostProjectRegistrationRequest message. Does not implicitly {@link google.cloud.apihub.v1.CreateHostProjectRegistrationRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.CreateHostProjectRegistrationRequest - * @static - * @param {google.cloud.apihub.v1.ICreateHostProjectRegistrationRequest} message CreateHostProjectRegistrationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateHostProjectRegistrationRequest.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.hostProjectRegistrationId != null && Object.hasOwnProperty.call(message, "hostProjectRegistrationId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.hostProjectRegistrationId); - if (message.hostProjectRegistration != null && Object.hasOwnProperty.call(message, "hostProjectRegistration")) - $root.google.cloud.apihub.v1.HostProjectRegistration.encode(message.hostProjectRegistration, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CreateHostProjectRegistrationRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.CreateHostProjectRegistrationRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.CreateHostProjectRegistrationRequest - * @static - * @param {google.cloud.apihub.v1.ICreateHostProjectRegistrationRequest} message CreateHostProjectRegistrationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateHostProjectRegistrationRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateHostProjectRegistrationRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.CreateHostProjectRegistrationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.CreateHostProjectRegistrationRequest} CreateHostProjectRegistrationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateHostProjectRegistrationRequest.decode = function 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.apihub.v1.CreateHostProjectRegistrationRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.hostProjectRegistrationId = reader.string(); - break; - } - case 3: { - message.hostProjectRegistration = $root.google.cloud.apihub.v1.HostProjectRegistration.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateHostProjectRegistrationRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.CreateHostProjectRegistrationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.CreateHostProjectRegistrationRequest} CreateHostProjectRegistrationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateHostProjectRegistrationRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateHostProjectRegistrationRequest message. - * @function verify - * @memberof google.cloud.apihub.v1.CreateHostProjectRegistrationRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateHostProjectRegistrationRequest.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.hostProjectRegistrationId != null && message.hasOwnProperty("hostProjectRegistrationId")) - if (!$util.isString(message.hostProjectRegistrationId)) - return "hostProjectRegistrationId: string expected"; - if (message.hostProjectRegistration != null && message.hasOwnProperty("hostProjectRegistration")) { - var error = $root.google.cloud.apihub.v1.HostProjectRegistration.verify(message.hostProjectRegistration); - if (error) - return "hostProjectRegistration." + error; - } - return null; - }; - - /** - * Creates a CreateHostProjectRegistrationRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.CreateHostProjectRegistrationRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.CreateHostProjectRegistrationRequest} CreateHostProjectRegistrationRequest - */ - CreateHostProjectRegistrationRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.CreateHostProjectRegistrationRequest) - return object; - var message = new $root.google.cloud.apihub.v1.CreateHostProjectRegistrationRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.hostProjectRegistrationId != null) - message.hostProjectRegistrationId = String(object.hostProjectRegistrationId); - if (object.hostProjectRegistration != null) { - if (typeof object.hostProjectRegistration !== "object") - throw TypeError(".google.cloud.apihub.v1.CreateHostProjectRegistrationRequest.hostProjectRegistration: object expected"); - message.hostProjectRegistration = $root.google.cloud.apihub.v1.HostProjectRegistration.fromObject(object.hostProjectRegistration); - } - return message; - }; - - /** - * Creates a plain object from a CreateHostProjectRegistrationRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.CreateHostProjectRegistrationRequest - * @static - * @param {google.cloud.apihub.v1.CreateHostProjectRegistrationRequest} message CreateHostProjectRegistrationRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateHostProjectRegistrationRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.hostProjectRegistrationId = ""; - object.hostProjectRegistration = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.hostProjectRegistrationId != null && message.hasOwnProperty("hostProjectRegistrationId")) - object.hostProjectRegistrationId = message.hostProjectRegistrationId; - if (message.hostProjectRegistration != null && message.hasOwnProperty("hostProjectRegistration")) - object.hostProjectRegistration = $root.google.cloud.apihub.v1.HostProjectRegistration.toObject(message.hostProjectRegistration, options); - return object; - }; - - /** - * Converts this CreateHostProjectRegistrationRequest to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.CreateHostProjectRegistrationRequest - * @instance - * @returns {Object.} JSON object - */ - CreateHostProjectRegistrationRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateHostProjectRegistrationRequest - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.CreateHostProjectRegistrationRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateHostProjectRegistrationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.CreateHostProjectRegistrationRequest"; - }; - - return CreateHostProjectRegistrationRequest; - })(); - - v1.GetHostProjectRegistrationRequest = (function() { - - /** - * Properties of a GetHostProjectRegistrationRequest. - * @memberof google.cloud.apihub.v1 - * @interface IGetHostProjectRegistrationRequest - * @property {string|null} [name] GetHostProjectRegistrationRequest name - */ - - /** - * Constructs a new GetHostProjectRegistrationRequest. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents a GetHostProjectRegistrationRequest. - * @implements IGetHostProjectRegistrationRequest - * @constructor - * @param {google.cloud.apihub.v1.IGetHostProjectRegistrationRequest=} [properties] Properties to set - */ - function GetHostProjectRegistrationRequest(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]]; - } - - /** - * GetHostProjectRegistrationRequest name. - * @member {string} name - * @memberof google.cloud.apihub.v1.GetHostProjectRegistrationRequest - * @instance - */ - GetHostProjectRegistrationRequest.prototype.name = ""; - - /** - * Creates a new GetHostProjectRegistrationRequest instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.GetHostProjectRegistrationRequest - * @static - * @param {google.cloud.apihub.v1.IGetHostProjectRegistrationRequest=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.GetHostProjectRegistrationRequest} GetHostProjectRegistrationRequest instance - */ - GetHostProjectRegistrationRequest.create = function create(properties) { - return new GetHostProjectRegistrationRequest(properties); - }; - - /** - * Encodes the specified GetHostProjectRegistrationRequest message. Does not implicitly {@link google.cloud.apihub.v1.GetHostProjectRegistrationRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.GetHostProjectRegistrationRequest - * @static - * @param {google.cloud.apihub.v1.IGetHostProjectRegistrationRequest} message GetHostProjectRegistrationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetHostProjectRegistrationRequest.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 GetHostProjectRegistrationRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.GetHostProjectRegistrationRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.GetHostProjectRegistrationRequest - * @static - * @param {google.cloud.apihub.v1.IGetHostProjectRegistrationRequest} message GetHostProjectRegistrationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetHostProjectRegistrationRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetHostProjectRegistrationRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.GetHostProjectRegistrationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.GetHostProjectRegistrationRequest} GetHostProjectRegistrationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetHostProjectRegistrationRequest.decode = function 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.apihub.v1.GetHostProjectRegistrationRequest(); - 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 GetHostProjectRegistrationRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.GetHostProjectRegistrationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.GetHostProjectRegistrationRequest} GetHostProjectRegistrationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetHostProjectRegistrationRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetHostProjectRegistrationRequest message. - * @function verify - * @memberof google.cloud.apihub.v1.GetHostProjectRegistrationRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetHostProjectRegistrationRequest.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 GetHostProjectRegistrationRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.GetHostProjectRegistrationRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.GetHostProjectRegistrationRequest} GetHostProjectRegistrationRequest - */ - GetHostProjectRegistrationRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.GetHostProjectRegistrationRequest) - return object; - var message = new $root.google.cloud.apihub.v1.GetHostProjectRegistrationRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetHostProjectRegistrationRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.GetHostProjectRegistrationRequest - * @static - * @param {google.cloud.apihub.v1.GetHostProjectRegistrationRequest} message GetHostProjectRegistrationRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetHostProjectRegistrationRequest.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 GetHostProjectRegistrationRequest to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.GetHostProjectRegistrationRequest - * @instance - * @returns {Object.} JSON object - */ - GetHostProjectRegistrationRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetHostProjectRegistrationRequest - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.GetHostProjectRegistrationRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetHostProjectRegistrationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.GetHostProjectRegistrationRequest"; - }; - - return GetHostProjectRegistrationRequest; - })(); - - v1.ListHostProjectRegistrationsRequest = (function() { - - /** - * Properties of a ListHostProjectRegistrationsRequest. - * @memberof google.cloud.apihub.v1 - * @interface IListHostProjectRegistrationsRequest - * @property {string|null} [parent] ListHostProjectRegistrationsRequest parent - * @property {number|null} [pageSize] ListHostProjectRegistrationsRequest pageSize - * @property {string|null} [pageToken] ListHostProjectRegistrationsRequest pageToken - * @property {string|null} [filter] ListHostProjectRegistrationsRequest filter - * @property {string|null} [orderBy] ListHostProjectRegistrationsRequest orderBy - */ - - /** - * Constructs a new ListHostProjectRegistrationsRequest. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents a ListHostProjectRegistrationsRequest. - * @implements IListHostProjectRegistrationsRequest - * @constructor - * @param {google.cloud.apihub.v1.IListHostProjectRegistrationsRequest=} [properties] Properties to set - */ - function ListHostProjectRegistrationsRequest(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]]; - } - - /** - * ListHostProjectRegistrationsRequest parent. - * @member {string} parent - * @memberof google.cloud.apihub.v1.ListHostProjectRegistrationsRequest - * @instance - */ - ListHostProjectRegistrationsRequest.prototype.parent = ""; - - /** - * ListHostProjectRegistrationsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.apihub.v1.ListHostProjectRegistrationsRequest - * @instance - */ - ListHostProjectRegistrationsRequest.prototype.pageSize = 0; - - /** - * ListHostProjectRegistrationsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.apihub.v1.ListHostProjectRegistrationsRequest - * @instance - */ - ListHostProjectRegistrationsRequest.prototype.pageToken = ""; - - /** - * ListHostProjectRegistrationsRequest filter. - * @member {string} filter - * @memberof google.cloud.apihub.v1.ListHostProjectRegistrationsRequest - * @instance - */ - ListHostProjectRegistrationsRequest.prototype.filter = ""; - - /** - * ListHostProjectRegistrationsRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.apihub.v1.ListHostProjectRegistrationsRequest - * @instance - */ - ListHostProjectRegistrationsRequest.prototype.orderBy = ""; - - /** - * Creates a new ListHostProjectRegistrationsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.ListHostProjectRegistrationsRequest - * @static - * @param {google.cloud.apihub.v1.IListHostProjectRegistrationsRequest=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.ListHostProjectRegistrationsRequest} ListHostProjectRegistrationsRequest instance - */ - ListHostProjectRegistrationsRequest.create = function create(properties) { - return new ListHostProjectRegistrationsRequest(properties); - }; - - /** - * Encodes the specified ListHostProjectRegistrationsRequest message. Does not implicitly {@link google.cloud.apihub.v1.ListHostProjectRegistrationsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.ListHostProjectRegistrationsRequest - * @static - * @param {google.cloud.apihub.v1.IListHostProjectRegistrationsRequest} message ListHostProjectRegistrationsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListHostProjectRegistrationsRequest.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); - return writer; - }; - - /** - * Encodes the specified ListHostProjectRegistrationsRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListHostProjectRegistrationsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.ListHostProjectRegistrationsRequest - * @static - * @param {google.cloud.apihub.v1.IListHostProjectRegistrationsRequest} message ListHostProjectRegistrationsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListHostProjectRegistrationsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListHostProjectRegistrationsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.ListHostProjectRegistrationsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.ListHostProjectRegistrationsRequest} ListHostProjectRegistrationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListHostProjectRegistrationsRequest.decode = function 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.apihub.v1.ListHostProjectRegistrationsRequest(); - 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; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListHostProjectRegistrationsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.ListHostProjectRegistrationsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.ListHostProjectRegistrationsRequest} ListHostProjectRegistrationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListHostProjectRegistrationsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListHostProjectRegistrationsRequest message. - * @function verify - * @memberof google.cloud.apihub.v1.ListHostProjectRegistrationsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListHostProjectRegistrationsRequest.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"; - return null; - }; - - /** - * Creates a ListHostProjectRegistrationsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.ListHostProjectRegistrationsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.ListHostProjectRegistrationsRequest} ListHostProjectRegistrationsRequest - */ - ListHostProjectRegistrationsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest) - return object; - var message = new $root.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest(); - 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); - return message; - }; - - /** - * Creates a plain object from a ListHostProjectRegistrationsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.ListHostProjectRegistrationsRequest - * @static - * @param {google.cloud.apihub.v1.ListHostProjectRegistrationsRequest} message ListHostProjectRegistrationsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListHostProjectRegistrationsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - object.filter = ""; - object.orderBy = ""; - } - 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; - return object; - }; - - /** - * Converts this ListHostProjectRegistrationsRequest to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.ListHostProjectRegistrationsRequest - * @instance - * @returns {Object.} JSON object - */ - ListHostProjectRegistrationsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListHostProjectRegistrationsRequest - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.ListHostProjectRegistrationsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListHostProjectRegistrationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.ListHostProjectRegistrationsRequest"; - }; - - return ListHostProjectRegistrationsRequest; - })(); - - v1.ListHostProjectRegistrationsResponse = (function() { - - /** - * Properties of a ListHostProjectRegistrationsResponse. - * @memberof google.cloud.apihub.v1 - * @interface IListHostProjectRegistrationsResponse - * @property {Array.|null} [hostProjectRegistrations] ListHostProjectRegistrationsResponse hostProjectRegistrations - * @property {string|null} [nextPageToken] ListHostProjectRegistrationsResponse nextPageToken - */ - - /** - * Constructs a new ListHostProjectRegistrationsResponse. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents a ListHostProjectRegistrationsResponse. - * @implements IListHostProjectRegistrationsResponse - * @constructor - * @param {google.cloud.apihub.v1.IListHostProjectRegistrationsResponse=} [properties] Properties to set - */ - function ListHostProjectRegistrationsResponse(properties) { - this.hostProjectRegistrations = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListHostProjectRegistrationsResponse hostProjectRegistrations. - * @member {Array.} hostProjectRegistrations - * @memberof google.cloud.apihub.v1.ListHostProjectRegistrationsResponse - * @instance - */ - ListHostProjectRegistrationsResponse.prototype.hostProjectRegistrations = $util.emptyArray; - - /** - * ListHostProjectRegistrationsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.apihub.v1.ListHostProjectRegistrationsResponse - * @instance - */ - ListHostProjectRegistrationsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListHostProjectRegistrationsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.ListHostProjectRegistrationsResponse - * @static - * @param {google.cloud.apihub.v1.IListHostProjectRegistrationsResponse=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.ListHostProjectRegistrationsResponse} ListHostProjectRegistrationsResponse instance - */ - ListHostProjectRegistrationsResponse.create = function create(properties) { - return new ListHostProjectRegistrationsResponse(properties); - }; - - /** - * Encodes the specified ListHostProjectRegistrationsResponse message. Does not implicitly {@link google.cloud.apihub.v1.ListHostProjectRegistrationsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.ListHostProjectRegistrationsResponse - * @static - * @param {google.cloud.apihub.v1.IListHostProjectRegistrationsResponse} message ListHostProjectRegistrationsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListHostProjectRegistrationsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.hostProjectRegistrations != null && message.hostProjectRegistrations.length) - for (var i = 0; i < message.hostProjectRegistrations.length; ++i) - $root.google.cloud.apihub.v1.HostProjectRegistration.encode(message.hostProjectRegistrations[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 ListHostProjectRegistrationsResponse message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListHostProjectRegistrationsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.ListHostProjectRegistrationsResponse - * @static - * @param {google.cloud.apihub.v1.IListHostProjectRegistrationsResponse} message ListHostProjectRegistrationsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListHostProjectRegistrationsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListHostProjectRegistrationsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.ListHostProjectRegistrationsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.ListHostProjectRegistrationsResponse} ListHostProjectRegistrationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListHostProjectRegistrationsResponse.decode = function 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.apihub.v1.ListHostProjectRegistrationsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.hostProjectRegistrations && message.hostProjectRegistrations.length)) - message.hostProjectRegistrations = []; - message.hostProjectRegistrations.push($root.google.cloud.apihub.v1.HostProjectRegistration.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListHostProjectRegistrationsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.ListHostProjectRegistrationsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.ListHostProjectRegistrationsResponse} ListHostProjectRegistrationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListHostProjectRegistrationsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListHostProjectRegistrationsResponse message. - * @function verify - * @memberof google.cloud.apihub.v1.ListHostProjectRegistrationsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListHostProjectRegistrationsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.hostProjectRegistrations != null && message.hasOwnProperty("hostProjectRegistrations")) { - if (!Array.isArray(message.hostProjectRegistrations)) - return "hostProjectRegistrations: array expected"; - for (var i = 0; i < message.hostProjectRegistrations.length; ++i) { - var error = $root.google.cloud.apihub.v1.HostProjectRegistration.verify(message.hostProjectRegistrations[i]); - if (error) - return "hostProjectRegistrations." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListHostProjectRegistrationsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.ListHostProjectRegistrationsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.ListHostProjectRegistrationsResponse} ListHostProjectRegistrationsResponse - */ - ListHostProjectRegistrationsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.ListHostProjectRegistrationsResponse) - return object; - var message = new $root.google.cloud.apihub.v1.ListHostProjectRegistrationsResponse(); - if (object.hostProjectRegistrations) { - if (!Array.isArray(object.hostProjectRegistrations)) - throw TypeError(".google.cloud.apihub.v1.ListHostProjectRegistrationsResponse.hostProjectRegistrations: array expected"); - message.hostProjectRegistrations = []; - for (var i = 0; i < object.hostProjectRegistrations.length; ++i) { - if (typeof object.hostProjectRegistrations[i] !== "object") - throw TypeError(".google.cloud.apihub.v1.ListHostProjectRegistrationsResponse.hostProjectRegistrations: object expected"); - message.hostProjectRegistrations[i] = $root.google.cloud.apihub.v1.HostProjectRegistration.fromObject(object.hostProjectRegistrations[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListHostProjectRegistrationsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.ListHostProjectRegistrationsResponse - * @static - * @param {google.cloud.apihub.v1.ListHostProjectRegistrationsResponse} message ListHostProjectRegistrationsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListHostProjectRegistrationsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.hostProjectRegistrations = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.hostProjectRegistrations && message.hostProjectRegistrations.length) { - object.hostProjectRegistrations = []; - for (var j = 0; j < message.hostProjectRegistrations.length; ++j) - object.hostProjectRegistrations[j] = $root.google.cloud.apihub.v1.HostProjectRegistration.toObject(message.hostProjectRegistrations[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListHostProjectRegistrationsResponse to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.ListHostProjectRegistrationsResponse - * @instance - * @returns {Object.} JSON object - */ - ListHostProjectRegistrationsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListHostProjectRegistrationsResponse - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.ListHostProjectRegistrationsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListHostProjectRegistrationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.ListHostProjectRegistrationsResponse"; - }; - - return ListHostProjectRegistrationsResponse; - })(); - - v1.HostProjectRegistration = (function() { - - /** - * Properties of a HostProjectRegistration. - * @memberof google.cloud.apihub.v1 - * @interface IHostProjectRegistration - * @property {string|null} [name] HostProjectRegistration name - * @property {string|null} [gcpProject] HostProjectRegistration gcpProject - * @property {google.protobuf.ITimestamp|null} [createTime] HostProjectRegistration createTime - */ - - /** - * Constructs a new HostProjectRegistration. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents a HostProjectRegistration. - * @implements IHostProjectRegistration - * @constructor - * @param {google.cloud.apihub.v1.IHostProjectRegistration=} [properties] Properties to set - */ - function HostProjectRegistration(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]]; - } - - /** - * HostProjectRegistration name. - * @member {string} name - * @memberof google.cloud.apihub.v1.HostProjectRegistration - * @instance - */ - HostProjectRegistration.prototype.name = ""; - - /** - * HostProjectRegistration gcpProject. - * @member {string} gcpProject - * @memberof google.cloud.apihub.v1.HostProjectRegistration - * @instance - */ - HostProjectRegistration.prototype.gcpProject = ""; - - /** - * HostProjectRegistration createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.apihub.v1.HostProjectRegistration - * @instance - */ - HostProjectRegistration.prototype.createTime = null; - - /** - * Creates a new HostProjectRegistration instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.HostProjectRegistration - * @static - * @param {google.cloud.apihub.v1.IHostProjectRegistration=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.HostProjectRegistration} HostProjectRegistration instance - */ - HostProjectRegistration.create = function create(properties) { - return new HostProjectRegistration(properties); - }; - - /** - * Encodes the specified HostProjectRegistration message. Does not implicitly {@link google.cloud.apihub.v1.HostProjectRegistration.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.HostProjectRegistration - * @static - * @param {google.cloud.apihub.v1.IHostProjectRegistration} message HostProjectRegistration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HostProjectRegistration.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.gcpProject != null && Object.hasOwnProperty.call(message, "gcpProject")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.gcpProject); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified HostProjectRegistration message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.HostProjectRegistration.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.HostProjectRegistration - * @static - * @param {google.cloud.apihub.v1.IHostProjectRegistration} message HostProjectRegistration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HostProjectRegistration.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a HostProjectRegistration message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.HostProjectRegistration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.HostProjectRegistration} HostProjectRegistration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HostProjectRegistration.decode = function 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.apihub.v1.HostProjectRegistration(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.gcpProject = reader.string(); - break; - } - case 3: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a HostProjectRegistration message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.HostProjectRegistration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.HostProjectRegistration} HostProjectRegistration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HostProjectRegistration.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a HostProjectRegistration message. - * @function verify - * @memberof google.cloud.apihub.v1.HostProjectRegistration - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - HostProjectRegistration.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.gcpProject != null && message.hasOwnProperty("gcpProject")) - if (!$util.isString(message.gcpProject)) - return "gcpProject: string expected"; - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - return null; - }; - - /** - * Creates a HostProjectRegistration message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.HostProjectRegistration - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.HostProjectRegistration} HostProjectRegistration - */ - HostProjectRegistration.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.HostProjectRegistration) - return object; - var message = new $root.google.cloud.apihub.v1.HostProjectRegistration(); - if (object.name != null) - message.name = String(object.name); - if (object.gcpProject != null) - message.gcpProject = String(object.gcpProject); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.apihub.v1.HostProjectRegistration.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - return message; - }; - - /** - * Creates a plain object from a HostProjectRegistration message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.HostProjectRegistration - * @static - * @param {google.cloud.apihub.v1.HostProjectRegistration} message HostProjectRegistration - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - HostProjectRegistration.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.gcpProject = ""; - object.createTime = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.gcpProject != null && message.hasOwnProperty("gcpProject")) - object.gcpProject = message.gcpProject; - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - return object; - }; - - /** - * Converts this HostProjectRegistration to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.HostProjectRegistration - * @instance - * @returns {Object.} JSON object - */ - HostProjectRegistration.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for HostProjectRegistration - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.HostProjectRegistration - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - HostProjectRegistration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.HostProjectRegistration"; - }; - - return HostProjectRegistration; - })(); - - v1.LintingService = (function() { - - /** - * Constructs a new LintingService service. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents a LintingService - * @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 LintingService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (LintingService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = LintingService; - - /** - * Creates new LintingService service using the specified rpc implementation. - * @function create - * @memberof google.cloud.apihub.v1.LintingService - * @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 {LintingService} RPC service. Useful where requests and/or responses are streamed. - */ - LintingService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.cloud.apihub.v1.LintingService|getStyleGuide}. - * @memberof google.cloud.apihub.v1.LintingService - * @typedef GetStyleGuideCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.apihub.v1.StyleGuide} [response] StyleGuide - */ - - /** - * Calls GetStyleGuide. - * @function getStyleGuide - * @memberof google.cloud.apihub.v1.LintingService - * @instance - * @param {google.cloud.apihub.v1.IGetStyleGuideRequest} request GetStyleGuideRequest message or plain object - * @param {google.cloud.apihub.v1.LintingService.GetStyleGuideCallback} callback Node-style callback called with the error, if any, and StyleGuide - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(LintingService.prototype.getStyleGuide = function getStyleGuide(request, callback) { - return this.rpcCall(getStyleGuide, $root.google.cloud.apihub.v1.GetStyleGuideRequest, $root.google.cloud.apihub.v1.StyleGuide, request, callback); - }, "name", { value: "GetStyleGuide" }); - - /** - * Calls GetStyleGuide. - * @function getStyleGuide - * @memberof google.cloud.apihub.v1.LintingService - * @instance - * @param {google.cloud.apihub.v1.IGetStyleGuideRequest} request GetStyleGuideRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.apihub.v1.LintingService|updateStyleGuide}. - * @memberof google.cloud.apihub.v1.LintingService - * @typedef UpdateStyleGuideCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.apihub.v1.StyleGuide} [response] StyleGuide - */ - - /** - * Calls UpdateStyleGuide. - * @function updateStyleGuide - * @memberof google.cloud.apihub.v1.LintingService - * @instance - * @param {google.cloud.apihub.v1.IUpdateStyleGuideRequest} request UpdateStyleGuideRequest message or plain object - * @param {google.cloud.apihub.v1.LintingService.UpdateStyleGuideCallback} callback Node-style callback called with the error, if any, and StyleGuide - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(LintingService.prototype.updateStyleGuide = function updateStyleGuide(request, callback) { - return this.rpcCall(updateStyleGuide, $root.google.cloud.apihub.v1.UpdateStyleGuideRequest, $root.google.cloud.apihub.v1.StyleGuide, request, callback); - }, "name", { value: "UpdateStyleGuide" }); - - /** - * Calls UpdateStyleGuide. - * @function updateStyleGuide - * @memberof google.cloud.apihub.v1.LintingService - * @instance - * @param {google.cloud.apihub.v1.IUpdateStyleGuideRequest} request UpdateStyleGuideRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.apihub.v1.LintingService|getStyleGuideContents}. - * @memberof google.cloud.apihub.v1.LintingService - * @typedef GetStyleGuideContentsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.apihub.v1.StyleGuideContents} [response] StyleGuideContents - */ - - /** - * Calls GetStyleGuideContents. - * @function getStyleGuideContents - * @memberof google.cloud.apihub.v1.LintingService - * @instance - * @param {google.cloud.apihub.v1.IGetStyleGuideContentsRequest} request GetStyleGuideContentsRequest message or plain object - * @param {google.cloud.apihub.v1.LintingService.GetStyleGuideContentsCallback} callback Node-style callback called with the error, if any, and StyleGuideContents - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(LintingService.prototype.getStyleGuideContents = function getStyleGuideContents(request, callback) { - return this.rpcCall(getStyleGuideContents, $root.google.cloud.apihub.v1.GetStyleGuideContentsRequest, $root.google.cloud.apihub.v1.StyleGuideContents, request, callback); - }, "name", { value: "GetStyleGuideContents" }); - - /** - * Calls GetStyleGuideContents. - * @function getStyleGuideContents - * @memberof google.cloud.apihub.v1.LintingService - * @instance - * @param {google.cloud.apihub.v1.IGetStyleGuideContentsRequest} request GetStyleGuideContentsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.apihub.v1.LintingService|lintSpec}. - * @memberof google.cloud.apihub.v1.LintingService - * @typedef LintSpecCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls LintSpec. - * @function lintSpec - * @memberof google.cloud.apihub.v1.LintingService - * @instance - * @param {google.cloud.apihub.v1.ILintSpecRequest} request LintSpecRequest message or plain object - * @param {google.cloud.apihub.v1.LintingService.LintSpecCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(LintingService.prototype.lintSpec = function lintSpec(request, callback) { - return this.rpcCall(lintSpec, $root.google.cloud.apihub.v1.LintSpecRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "LintSpec" }); - - /** - * Calls LintSpec. - * @function lintSpec - * @memberof google.cloud.apihub.v1.LintingService - * @instance - * @param {google.cloud.apihub.v1.ILintSpecRequest} request LintSpecRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return LintingService; - })(); - - v1.GetStyleGuideRequest = (function() { - - /** - * Properties of a GetStyleGuideRequest. - * @memberof google.cloud.apihub.v1 - * @interface IGetStyleGuideRequest - * @property {string|null} [name] GetStyleGuideRequest name - */ - - /** - * Constructs a new GetStyleGuideRequest. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents a GetStyleGuideRequest. - * @implements IGetStyleGuideRequest - * @constructor - * @param {google.cloud.apihub.v1.IGetStyleGuideRequest=} [properties] Properties to set - */ - function GetStyleGuideRequest(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]]; - } - - /** - * GetStyleGuideRequest name. - * @member {string} name - * @memberof google.cloud.apihub.v1.GetStyleGuideRequest - * @instance - */ - GetStyleGuideRequest.prototype.name = ""; - - /** - * Creates a new GetStyleGuideRequest instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.GetStyleGuideRequest - * @static - * @param {google.cloud.apihub.v1.IGetStyleGuideRequest=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.GetStyleGuideRequest} GetStyleGuideRequest instance - */ - GetStyleGuideRequest.create = function create(properties) { - return new GetStyleGuideRequest(properties); - }; - - /** - * Encodes the specified GetStyleGuideRequest message. Does not implicitly {@link google.cloud.apihub.v1.GetStyleGuideRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.GetStyleGuideRequest - * @static - * @param {google.cloud.apihub.v1.IGetStyleGuideRequest} message GetStyleGuideRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetStyleGuideRequest.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 GetStyleGuideRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.GetStyleGuideRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.GetStyleGuideRequest - * @static - * @param {google.cloud.apihub.v1.IGetStyleGuideRequest} message GetStyleGuideRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetStyleGuideRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetStyleGuideRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.GetStyleGuideRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.GetStyleGuideRequest} GetStyleGuideRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetStyleGuideRequest.decode = function 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.apihub.v1.GetStyleGuideRequest(); - 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 GetStyleGuideRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.GetStyleGuideRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.GetStyleGuideRequest} GetStyleGuideRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetStyleGuideRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetStyleGuideRequest message. - * @function verify - * @memberof google.cloud.apihub.v1.GetStyleGuideRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetStyleGuideRequest.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 GetStyleGuideRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.GetStyleGuideRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.GetStyleGuideRequest} GetStyleGuideRequest - */ - GetStyleGuideRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.GetStyleGuideRequest) - return object; - var message = new $root.google.cloud.apihub.v1.GetStyleGuideRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetStyleGuideRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.GetStyleGuideRequest - * @static - * @param {google.cloud.apihub.v1.GetStyleGuideRequest} message GetStyleGuideRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetStyleGuideRequest.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 GetStyleGuideRequest to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.GetStyleGuideRequest - * @instance - * @returns {Object.} JSON object - */ - GetStyleGuideRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetStyleGuideRequest - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.GetStyleGuideRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetStyleGuideRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.GetStyleGuideRequest"; - }; - - return GetStyleGuideRequest; - })(); - - v1.UpdateStyleGuideRequest = (function() { - - /** - * Properties of an UpdateStyleGuideRequest. - * @memberof google.cloud.apihub.v1 - * @interface IUpdateStyleGuideRequest - * @property {google.cloud.apihub.v1.IStyleGuide|null} [styleGuide] UpdateStyleGuideRequest styleGuide - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateStyleGuideRequest updateMask - */ - - /** - * Constructs a new UpdateStyleGuideRequest. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents an UpdateStyleGuideRequest. - * @implements IUpdateStyleGuideRequest - * @constructor - * @param {google.cloud.apihub.v1.IUpdateStyleGuideRequest=} [properties] Properties to set - */ - function UpdateStyleGuideRequest(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]]; - } - - /** - * UpdateStyleGuideRequest styleGuide. - * @member {google.cloud.apihub.v1.IStyleGuide|null|undefined} styleGuide - * @memberof google.cloud.apihub.v1.UpdateStyleGuideRequest - * @instance - */ - UpdateStyleGuideRequest.prototype.styleGuide = null; - - /** - * UpdateStyleGuideRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.apihub.v1.UpdateStyleGuideRequest - * @instance - */ - UpdateStyleGuideRequest.prototype.updateMask = null; - - /** - * Creates a new UpdateStyleGuideRequest instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.UpdateStyleGuideRequest - * @static - * @param {google.cloud.apihub.v1.IUpdateStyleGuideRequest=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.UpdateStyleGuideRequest} UpdateStyleGuideRequest instance - */ - UpdateStyleGuideRequest.create = function create(properties) { - return new UpdateStyleGuideRequest(properties); - }; - - /** - * Encodes the specified UpdateStyleGuideRequest message. Does not implicitly {@link google.cloud.apihub.v1.UpdateStyleGuideRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.UpdateStyleGuideRequest - * @static - * @param {google.cloud.apihub.v1.IUpdateStyleGuideRequest} message UpdateStyleGuideRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateStyleGuideRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.styleGuide != null && Object.hasOwnProperty.call(message, "styleGuide")) - $root.google.cloud.apihub.v1.StyleGuide.encode(message.styleGuide, 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 UpdateStyleGuideRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.UpdateStyleGuideRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.UpdateStyleGuideRequest - * @static - * @param {google.cloud.apihub.v1.IUpdateStyleGuideRequest} message UpdateStyleGuideRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateStyleGuideRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateStyleGuideRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.UpdateStyleGuideRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.UpdateStyleGuideRequest} UpdateStyleGuideRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateStyleGuideRequest.decode = function 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.apihub.v1.UpdateStyleGuideRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.styleGuide = $root.google.cloud.apihub.v1.StyleGuide.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 UpdateStyleGuideRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.UpdateStyleGuideRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.UpdateStyleGuideRequest} UpdateStyleGuideRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateStyleGuideRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateStyleGuideRequest message. - * @function verify - * @memberof google.cloud.apihub.v1.UpdateStyleGuideRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateStyleGuideRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.styleGuide != null && message.hasOwnProperty("styleGuide")) { - var error = $root.google.cloud.apihub.v1.StyleGuide.verify(message.styleGuide); - if (error) - return "styleGuide." + 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 UpdateStyleGuideRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.UpdateStyleGuideRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.UpdateStyleGuideRequest} UpdateStyleGuideRequest - */ - UpdateStyleGuideRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.UpdateStyleGuideRequest) - return object; - var message = new $root.google.cloud.apihub.v1.UpdateStyleGuideRequest(); - if (object.styleGuide != null) { - if (typeof object.styleGuide !== "object") - throw TypeError(".google.cloud.apihub.v1.UpdateStyleGuideRequest.styleGuide: object expected"); - message.styleGuide = $root.google.cloud.apihub.v1.StyleGuide.fromObject(object.styleGuide); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.apihub.v1.UpdateStyleGuideRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - return message; - }; - - /** - * Creates a plain object from an UpdateStyleGuideRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.UpdateStyleGuideRequest - * @static - * @param {google.cloud.apihub.v1.UpdateStyleGuideRequest} message UpdateStyleGuideRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateStyleGuideRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.styleGuide = null; - object.updateMask = null; - } - if (message.styleGuide != null && message.hasOwnProperty("styleGuide")) - object.styleGuide = $root.google.cloud.apihub.v1.StyleGuide.toObject(message.styleGuide, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - return object; - }; - - /** - * Converts this UpdateStyleGuideRequest to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.UpdateStyleGuideRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateStyleGuideRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateStyleGuideRequest - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.UpdateStyleGuideRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateStyleGuideRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.UpdateStyleGuideRequest"; - }; - - return UpdateStyleGuideRequest; - })(); - - v1.GetStyleGuideContentsRequest = (function() { - - /** - * Properties of a GetStyleGuideContentsRequest. - * @memberof google.cloud.apihub.v1 - * @interface IGetStyleGuideContentsRequest - * @property {string|null} [name] GetStyleGuideContentsRequest name - */ - - /** - * Constructs a new GetStyleGuideContentsRequest. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents a GetStyleGuideContentsRequest. - * @implements IGetStyleGuideContentsRequest - * @constructor - * @param {google.cloud.apihub.v1.IGetStyleGuideContentsRequest=} [properties] Properties to set - */ - function GetStyleGuideContentsRequest(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]]; - } - - /** - * GetStyleGuideContentsRequest name. - * @member {string} name - * @memberof google.cloud.apihub.v1.GetStyleGuideContentsRequest - * @instance - */ - GetStyleGuideContentsRequest.prototype.name = ""; - - /** - * Creates a new GetStyleGuideContentsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.GetStyleGuideContentsRequest - * @static - * @param {google.cloud.apihub.v1.IGetStyleGuideContentsRequest=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.GetStyleGuideContentsRequest} GetStyleGuideContentsRequest instance - */ - GetStyleGuideContentsRequest.create = function create(properties) { - return new GetStyleGuideContentsRequest(properties); - }; - - /** - * Encodes the specified GetStyleGuideContentsRequest message. Does not implicitly {@link google.cloud.apihub.v1.GetStyleGuideContentsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.GetStyleGuideContentsRequest - * @static - * @param {google.cloud.apihub.v1.IGetStyleGuideContentsRequest} message GetStyleGuideContentsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetStyleGuideContentsRequest.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 GetStyleGuideContentsRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.GetStyleGuideContentsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.GetStyleGuideContentsRequest - * @static - * @param {google.cloud.apihub.v1.IGetStyleGuideContentsRequest} message GetStyleGuideContentsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetStyleGuideContentsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetStyleGuideContentsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.GetStyleGuideContentsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.GetStyleGuideContentsRequest} GetStyleGuideContentsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetStyleGuideContentsRequest.decode = function 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.apihub.v1.GetStyleGuideContentsRequest(); - 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 GetStyleGuideContentsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.GetStyleGuideContentsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.GetStyleGuideContentsRequest} GetStyleGuideContentsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetStyleGuideContentsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetStyleGuideContentsRequest message. - * @function verify - * @memberof google.cloud.apihub.v1.GetStyleGuideContentsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetStyleGuideContentsRequest.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 GetStyleGuideContentsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.GetStyleGuideContentsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.GetStyleGuideContentsRequest} GetStyleGuideContentsRequest - */ - GetStyleGuideContentsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.GetStyleGuideContentsRequest) - return object; - var message = new $root.google.cloud.apihub.v1.GetStyleGuideContentsRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetStyleGuideContentsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.GetStyleGuideContentsRequest - * @static - * @param {google.cloud.apihub.v1.GetStyleGuideContentsRequest} message GetStyleGuideContentsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetStyleGuideContentsRequest.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 GetStyleGuideContentsRequest to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.GetStyleGuideContentsRequest - * @instance - * @returns {Object.} JSON object - */ - GetStyleGuideContentsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetStyleGuideContentsRequest - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.GetStyleGuideContentsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetStyleGuideContentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.GetStyleGuideContentsRequest"; - }; - - return GetStyleGuideContentsRequest; - })(); - - v1.LintSpecRequest = (function() { - - /** - * Properties of a LintSpecRequest. - * @memberof google.cloud.apihub.v1 - * @interface ILintSpecRequest - * @property {string|null} [name] LintSpecRequest name - */ - - /** - * Constructs a new LintSpecRequest. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents a LintSpecRequest. - * @implements ILintSpecRequest - * @constructor - * @param {google.cloud.apihub.v1.ILintSpecRequest=} [properties] Properties to set - */ - function LintSpecRequest(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]]; - } - - /** - * LintSpecRequest name. - * @member {string} name - * @memberof google.cloud.apihub.v1.LintSpecRequest - * @instance - */ - LintSpecRequest.prototype.name = ""; - - /** - * Creates a new LintSpecRequest instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.LintSpecRequest - * @static - * @param {google.cloud.apihub.v1.ILintSpecRequest=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.LintSpecRequest} LintSpecRequest instance - */ - LintSpecRequest.create = function create(properties) { - return new LintSpecRequest(properties); - }; - - /** - * Encodes the specified LintSpecRequest message. Does not implicitly {@link google.cloud.apihub.v1.LintSpecRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.LintSpecRequest - * @static - * @param {google.cloud.apihub.v1.ILintSpecRequest} message LintSpecRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LintSpecRequest.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 LintSpecRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.LintSpecRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.LintSpecRequest - * @static - * @param {google.cloud.apihub.v1.ILintSpecRequest} message LintSpecRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LintSpecRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a LintSpecRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.LintSpecRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.LintSpecRequest} LintSpecRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LintSpecRequest.decode = function 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.apihub.v1.LintSpecRequest(); - 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 LintSpecRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.LintSpecRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.LintSpecRequest} LintSpecRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LintSpecRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a LintSpecRequest message. - * @function verify - * @memberof google.cloud.apihub.v1.LintSpecRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - LintSpecRequest.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 LintSpecRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.LintSpecRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.LintSpecRequest} LintSpecRequest - */ - LintSpecRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.LintSpecRequest) - return object; - var message = new $root.google.cloud.apihub.v1.LintSpecRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a LintSpecRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.LintSpecRequest - * @static - * @param {google.cloud.apihub.v1.LintSpecRequest} message LintSpecRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LintSpecRequest.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 LintSpecRequest to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.LintSpecRequest - * @instance - * @returns {Object.} JSON object - */ - LintSpecRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for LintSpecRequest - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.LintSpecRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - LintSpecRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.LintSpecRequest"; - }; - - return LintSpecRequest; - })(); - - v1.StyleGuideContents = (function() { - - /** - * Properties of a StyleGuideContents. - * @memberof google.cloud.apihub.v1 - * @interface IStyleGuideContents - * @property {Uint8Array|null} [contents] StyleGuideContents contents - * @property {string|null} [mimeType] StyleGuideContents mimeType - */ - - /** - * Constructs a new StyleGuideContents. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents a StyleGuideContents. - * @implements IStyleGuideContents - * @constructor - * @param {google.cloud.apihub.v1.IStyleGuideContents=} [properties] Properties to set - */ - function StyleGuideContents(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]]; - } - - /** - * StyleGuideContents contents. - * @member {Uint8Array} contents - * @memberof google.cloud.apihub.v1.StyleGuideContents - * @instance - */ - StyleGuideContents.prototype.contents = $util.newBuffer([]); - - /** - * StyleGuideContents mimeType. - * @member {string} mimeType - * @memberof google.cloud.apihub.v1.StyleGuideContents - * @instance - */ - StyleGuideContents.prototype.mimeType = ""; - - /** - * Creates a new StyleGuideContents instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.StyleGuideContents - * @static - * @param {google.cloud.apihub.v1.IStyleGuideContents=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.StyleGuideContents} StyleGuideContents instance - */ - StyleGuideContents.create = function create(properties) { - return new StyleGuideContents(properties); - }; - - /** - * Encodes the specified StyleGuideContents message. Does not implicitly {@link google.cloud.apihub.v1.StyleGuideContents.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.StyleGuideContents - * @static - * @param {google.cloud.apihub.v1.IStyleGuideContents} message StyleGuideContents message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StyleGuideContents.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.contents != null && Object.hasOwnProperty.call(message, "contents")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.contents); - if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.mimeType); - return writer; - }; - - /** - * Encodes the specified StyleGuideContents message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.StyleGuideContents.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.StyleGuideContents - * @static - * @param {google.cloud.apihub.v1.IStyleGuideContents} message StyleGuideContents message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StyleGuideContents.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a StyleGuideContents message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.StyleGuideContents - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.StyleGuideContents} StyleGuideContents - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StyleGuideContents.decode = function 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.apihub.v1.StyleGuideContents(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.contents = reader.bytes(); - break; - } - case 2: { - message.mimeType = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a StyleGuideContents message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.StyleGuideContents - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.StyleGuideContents} StyleGuideContents - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StyleGuideContents.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a StyleGuideContents message. - * @function verify - * @memberof google.cloud.apihub.v1.StyleGuideContents - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - StyleGuideContents.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.contents != null && message.hasOwnProperty("contents")) - if (!(message.contents && typeof message.contents.length === "number" || $util.isString(message.contents))) - return "contents: buffer expected"; - if (message.mimeType != null && message.hasOwnProperty("mimeType")) - if (!$util.isString(message.mimeType)) - return "mimeType: string expected"; - return null; - }; - - /** - * Creates a StyleGuideContents message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.StyleGuideContents - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.StyleGuideContents} StyleGuideContents - */ - StyleGuideContents.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.StyleGuideContents) - return object; - var message = new $root.google.cloud.apihub.v1.StyleGuideContents(); - if (object.contents != null) - if (typeof object.contents === "string") - $util.base64.decode(object.contents, message.contents = $util.newBuffer($util.base64.length(object.contents)), 0); - else if (object.contents.length >= 0) - message.contents = object.contents; - if (object.mimeType != null) - message.mimeType = String(object.mimeType); - return message; - }; - - /** - * Creates a plain object from a StyleGuideContents message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.StyleGuideContents - * @static - * @param {google.cloud.apihub.v1.StyleGuideContents} message StyleGuideContents - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - StyleGuideContents.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.contents = ""; - else { - object.contents = []; - if (options.bytes !== Array) - object.contents = $util.newBuffer(object.contents); - } - object.mimeType = ""; - } - if (message.contents != null && message.hasOwnProperty("contents")) - object.contents = options.bytes === String ? $util.base64.encode(message.contents, 0, message.contents.length) : options.bytes === Array ? Array.prototype.slice.call(message.contents) : message.contents; - if (message.mimeType != null && message.hasOwnProperty("mimeType")) - object.mimeType = message.mimeType; - return object; - }; - - /** - * Converts this StyleGuideContents to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.StyleGuideContents - * @instance - * @returns {Object.} JSON object - */ - StyleGuideContents.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for StyleGuideContents - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.StyleGuideContents - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - StyleGuideContents.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.StyleGuideContents"; - }; - - return StyleGuideContents; - })(); - - v1.StyleGuide = (function() { - - /** - * Properties of a StyleGuide. - * @memberof google.cloud.apihub.v1 - * @interface IStyleGuide - * @property {string|null} [name] StyleGuide name - * @property {google.cloud.apihub.v1.Linter|null} [linter] StyleGuide linter - * @property {google.cloud.apihub.v1.IStyleGuideContents|null} [contents] StyleGuide contents - */ - - /** - * Constructs a new StyleGuide. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents a StyleGuide. - * @implements IStyleGuide - * @constructor - * @param {google.cloud.apihub.v1.IStyleGuide=} [properties] Properties to set - */ - function StyleGuide(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]]; - } - - /** - * StyleGuide name. - * @member {string} name - * @memberof google.cloud.apihub.v1.StyleGuide - * @instance - */ - StyleGuide.prototype.name = ""; - - /** - * StyleGuide linter. - * @member {google.cloud.apihub.v1.Linter} linter - * @memberof google.cloud.apihub.v1.StyleGuide - * @instance - */ - StyleGuide.prototype.linter = 0; - - /** - * StyleGuide contents. - * @member {google.cloud.apihub.v1.IStyleGuideContents|null|undefined} contents - * @memberof google.cloud.apihub.v1.StyleGuide - * @instance - */ - StyleGuide.prototype.contents = null; - - /** - * Creates a new StyleGuide instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.StyleGuide - * @static - * @param {google.cloud.apihub.v1.IStyleGuide=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.StyleGuide} StyleGuide instance - */ - StyleGuide.create = function create(properties) { - return new StyleGuide(properties); - }; - - /** - * Encodes the specified StyleGuide message. Does not implicitly {@link google.cloud.apihub.v1.StyleGuide.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.StyleGuide - * @static - * @param {google.cloud.apihub.v1.IStyleGuide} message StyleGuide message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StyleGuide.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.linter != null && Object.hasOwnProperty.call(message, "linter")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.linter); - if (message.contents != null && Object.hasOwnProperty.call(message, "contents")) - $root.google.cloud.apihub.v1.StyleGuideContents.encode(message.contents, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified StyleGuide message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.StyleGuide.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.StyleGuide - * @static - * @param {google.cloud.apihub.v1.IStyleGuide} message StyleGuide message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StyleGuide.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a StyleGuide message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.StyleGuide - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.StyleGuide} StyleGuide - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StyleGuide.decode = function 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.apihub.v1.StyleGuide(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.linter = reader.int32(); - break; - } - case 3: { - message.contents = $root.google.cloud.apihub.v1.StyleGuideContents.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a StyleGuide message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.StyleGuide - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.StyleGuide} StyleGuide - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StyleGuide.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a StyleGuide message. - * @function verify - * @memberof google.cloud.apihub.v1.StyleGuide - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - StyleGuide.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.linter != null && message.hasOwnProperty("linter")) - switch (message.linter) { - default: - return "linter: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.contents != null && message.hasOwnProperty("contents")) { - var error = $root.google.cloud.apihub.v1.StyleGuideContents.verify(message.contents); - if (error) - return "contents." + error; - } - return null; - }; - - /** - * Creates a StyleGuide message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.StyleGuide - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.StyleGuide} StyleGuide - */ - StyleGuide.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.StyleGuide) - return object; - var message = new $root.google.cloud.apihub.v1.StyleGuide(); - if (object.name != null) - message.name = String(object.name); - switch (object.linter) { - default: - if (typeof object.linter === "number") { - message.linter = object.linter; - break; - } - break; - case "LINTER_UNSPECIFIED": - case 0: - message.linter = 0; - break; - case "SPECTRAL": - case 1: - message.linter = 1; - break; - case "OTHER": - case 2: - message.linter = 2; - break; - } - if (object.contents != null) { - if (typeof object.contents !== "object") - throw TypeError(".google.cloud.apihub.v1.StyleGuide.contents: object expected"); - message.contents = $root.google.cloud.apihub.v1.StyleGuideContents.fromObject(object.contents); - } - return message; - }; - - /** - * Creates a plain object from a StyleGuide message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.StyleGuide - * @static - * @param {google.cloud.apihub.v1.StyleGuide} message StyleGuide - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - StyleGuide.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.linter = options.enums === String ? "LINTER_UNSPECIFIED" : 0; - object.contents = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.linter != null && message.hasOwnProperty("linter")) - object.linter = options.enums === String ? $root.google.cloud.apihub.v1.Linter[message.linter] === undefined ? message.linter : $root.google.cloud.apihub.v1.Linter[message.linter] : message.linter; - if (message.contents != null && message.hasOwnProperty("contents")) - object.contents = $root.google.cloud.apihub.v1.StyleGuideContents.toObject(message.contents, options); - return object; - }; - - /** - * Converts this StyleGuide to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.StyleGuide - * @instance - * @returns {Object.} JSON object - */ - StyleGuide.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for StyleGuide - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.StyleGuide - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - StyleGuide.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.StyleGuide"; - }; - - return StyleGuide; - })(); - - v1.ApiHubPlugin = (function() { - - /** - * Constructs a new ApiHubPlugin service. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents an ApiHubPlugin - * @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 ApiHubPlugin(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (ApiHubPlugin.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = ApiHubPlugin; - - /** - * Creates new ApiHubPlugin service using the specified rpc implementation. - * @function create - * @memberof google.cloud.apihub.v1.ApiHubPlugin - * @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 {ApiHubPlugin} RPC service. Useful where requests and/or responses are streamed. - */ - ApiHubPlugin.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.cloud.apihub.v1.ApiHubPlugin|getPlugin}. - * @memberof google.cloud.apihub.v1.ApiHubPlugin - * @typedef GetPluginCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.apihub.v1.Plugin} [response] Plugin - */ - - /** - * Calls GetPlugin. - * @function getPlugin - * @memberof google.cloud.apihub.v1.ApiHubPlugin - * @instance - * @param {google.cloud.apihub.v1.IGetPluginRequest} request GetPluginRequest message or plain object - * @param {google.cloud.apihub.v1.ApiHubPlugin.GetPluginCallback} callback Node-style callback called with the error, if any, and Plugin - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(ApiHubPlugin.prototype.getPlugin = function getPlugin(request, callback) { - return this.rpcCall(getPlugin, $root.google.cloud.apihub.v1.GetPluginRequest, $root.google.cloud.apihub.v1.Plugin, request, callback); - }, "name", { value: "GetPlugin" }); - - /** - * Calls GetPlugin. - * @function getPlugin - * @memberof google.cloud.apihub.v1.ApiHubPlugin - * @instance - * @param {google.cloud.apihub.v1.IGetPluginRequest} request GetPluginRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.apihub.v1.ApiHubPlugin|enablePlugin}. - * @memberof google.cloud.apihub.v1.ApiHubPlugin - * @typedef EnablePluginCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.apihub.v1.Plugin} [response] Plugin - */ - - /** - * Calls EnablePlugin. - * @function enablePlugin - * @memberof google.cloud.apihub.v1.ApiHubPlugin - * @instance - * @param {google.cloud.apihub.v1.IEnablePluginRequest} request EnablePluginRequest message or plain object - * @param {google.cloud.apihub.v1.ApiHubPlugin.EnablePluginCallback} callback Node-style callback called with the error, if any, and Plugin - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(ApiHubPlugin.prototype.enablePlugin = function enablePlugin(request, callback) { - return this.rpcCall(enablePlugin, $root.google.cloud.apihub.v1.EnablePluginRequest, $root.google.cloud.apihub.v1.Plugin, request, callback); - }, "name", { value: "EnablePlugin" }); - - /** - * Calls EnablePlugin. - * @function enablePlugin - * @memberof google.cloud.apihub.v1.ApiHubPlugin - * @instance - * @param {google.cloud.apihub.v1.IEnablePluginRequest} request EnablePluginRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.apihub.v1.ApiHubPlugin|disablePlugin}. - * @memberof google.cloud.apihub.v1.ApiHubPlugin - * @typedef DisablePluginCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.apihub.v1.Plugin} [response] Plugin - */ - - /** - * Calls DisablePlugin. - * @function disablePlugin - * @memberof google.cloud.apihub.v1.ApiHubPlugin - * @instance - * @param {google.cloud.apihub.v1.IDisablePluginRequest} request DisablePluginRequest message or plain object - * @param {google.cloud.apihub.v1.ApiHubPlugin.DisablePluginCallback} callback Node-style callback called with the error, if any, and Plugin - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(ApiHubPlugin.prototype.disablePlugin = function disablePlugin(request, callback) { - return this.rpcCall(disablePlugin, $root.google.cloud.apihub.v1.DisablePluginRequest, $root.google.cloud.apihub.v1.Plugin, request, callback); - }, "name", { value: "DisablePlugin" }); - - /** - * Calls DisablePlugin. - * @function disablePlugin - * @memberof google.cloud.apihub.v1.ApiHubPlugin - * @instance - * @param {google.cloud.apihub.v1.IDisablePluginRequest} request DisablePluginRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return ApiHubPlugin; - })(); - - v1.Plugin = (function() { - - /** - * Properties of a Plugin. - * @memberof google.cloud.apihub.v1 - * @interface IPlugin - * @property {string|null} [name] Plugin name - * @property {string|null} [displayName] Plugin displayName - * @property {google.cloud.apihub.v1.IAttributeValues|null} [type] Plugin type - * @property {string|null} [description] Plugin description - * @property {google.cloud.apihub.v1.Plugin.State|null} [state] Plugin state - */ - - /** - * Constructs a new Plugin. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents a Plugin. - * @implements IPlugin - * @constructor - * @param {google.cloud.apihub.v1.IPlugin=} [properties] Properties to set - */ - function Plugin(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]]; - } - - /** - * Plugin name. - * @member {string} name - * @memberof google.cloud.apihub.v1.Plugin - * @instance - */ - Plugin.prototype.name = ""; - - /** - * Plugin displayName. - * @member {string} displayName - * @memberof google.cloud.apihub.v1.Plugin - * @instance - */ - Plugin.prototype.displayName = ""; - - /** - * Plugin type. - * @member {google.cloud.apihub.v1.IAttributeValues|null|undefined} type - * @memberof google.cloud.apihub.v1.Plugin - * @instance - */ - Plugin.prototype.type = null; - - /** - * Plugin description. - * @member {string} description - * @memberof google.cloud.apihub.v1.Plugin - * @instance - */ - Plugin.prototype.description = ""; - - /** - * Plugin state. - * @member {google.cloud.apihub.v1.Plugin.State} state - * @memberof google.cloud.apihub.v1.Plugin - * @instance - */ - Plugin.prototype.state = 0; - - /** - * Creates a new Plugin instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.Plugin - * @static - * @param {google.cloud.apihub.v1.IPlugin=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.Plugin} Plugin instance - */ - Plugin.create = function create(properties) { - return new Plugin(properties); - }; - - /** - * Encodes the specified Plugin message. Does not implicitly {@link google.cloud.apihub.v1.Plugin.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.Plugin - * @static - * @param {google.cloud.apihub.v1.IPlugin} message Plugin message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Plugin.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - $root.google.cloud.apihub.v1.AttributeValues.encode(message.type, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.description); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.state); - return writer; - }; - - /** - * Encodes the specified Plugin message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.Plugin.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.Plugin - * @static - * @param {google.cloud.apihub.v1.IPlugin} message Plugin message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Plugin.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Plugin message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.Plugin - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.Plugin} Plugin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Plugin.decode = function 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.apihub.v1.Plugin(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.displayName = reader.string(); - break; - } - case 3: { - message.type = $root.google.cloud.apihub.v1.AttributeValues.decode(reader, reader.uint32()); - break; - } - case 4: { - message.description = reader.string(); - break; - } - case 5: { - message.state = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Plugin message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.Plugin - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.Plugin} Plugin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Plugin.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Plugin message. - * @function verify - * @memberof google.cloud.apihub.v1.Plugin - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Plugin.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.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - if (message.type != null && message.hasOwnProperty("type")) { - var error = $root.google.cloud.apihub.v1.AttributeValues.verify(message.type); - if (error) - return "type." + error; - } - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - 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 Plugin message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.Plugin - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.Plugin} Plugin - */ - Plugin.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.Plugin) - return object; - var message = new $root.google.cloud.apihub.v1.Plugin(); - if (object.name != null) - message.name = String(object.name); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.type != null) { - if (typeof object.type !== "object") - throw TypeError(".google.cloud.apihub.v1.Plugin.type: object expected"); - message.type = $root.google.cloud.apihub.v1.AttributeValues.fromObject(object.type); - } - if (object.description != null) - message.description = String(object.description); - 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 "ENABLED": - case 1: - message.state = 1; - break; - case "DISABLED": - case 2: - message.state = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a Plugin message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.Plugin - * @static - * @param {google.cloud.apihub.v1.Plugin} message Plugin - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Plugin.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.displayName = ""; - object.type = null; - object.description = ""; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.type != null && message.hasOwnProperty("type")) - object.type = $root.google.cloud.apihub.v1.AttributeValues.toObject(message.type, options); - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.apihub.v1.Plugin.State[message.state] === undefined ? message.state : $root.google.cloud.apihub.v1.Plugin.State[message.state] : message.state; - return object; - }; - - /** - * Converts this Plugin to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.Plugin - * @instance - * @returns {Object.} JSON object - */ - Plugin.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Plugin - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.Plugin - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Plugin.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.Plugin"; - }; - - /** - * State enum. - * @name google.cloud.apihub.v1.Plugin.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} ENABLED=1 ENABLED value - * @property {number} DISABLED=2 DISABLED value - */ - Plugin.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "ENABLED"] = 1; - values[valuesById[2] = "DISABLED"] = 2; - return values; - })(); - - return Plugin; - })(); - - v1.GetPluginRequest = (function() { - - /** - * Properties of a GetPluginRequest. - * @memberof google.cloud.apihub.v1 - * @interface IGetPluginRequest - * @property {string|null} [name] GetPluginRequest name - */ - - /** - * Constructs a new GetPluginRequest. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents a GetPluginRequest. - * @implements IGetPluginRequest - * @constructor - * @param {google.cloud.apihub.v1.IGetPluginRequest=} [properties] Properties to set - */ - function GetPluginRequest(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]]; - } - - /** - * GetPluginRequest name. - * @member {string} name - * @memberof google.cloud.apihub.v1.GetPluginRequest - * @instance - */ - GetPluginRequest.prototype.name = ""; - - /** - * Creates a new GetPluginRequest instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.GetPluginRequest - * @static - * @param {google.cloud.apihub.v1.IGetPluginRequest=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.GetPluginRequest} GetPluginRequest instance - */ - GetPluginRequest.create = function create(properties) { - return new GetPluginRequest(properties); - }; - - /** - * Encodes the specified GetPluginRequest message. Does not implicitly {@link google.cloud.apihub.v1.GetPluginRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.GetPluginRequest - * @static - * @param {google.cloud.apihub.v1.IGetPluginRequest} message GetPluginRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetPluginRequest.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 GetPluginRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.GetPluginRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.GetPluginRequest - * @static - * @param {google.cloud.apihub.v1.IGetPluginRequest} message GetPluginRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetPluginRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetPluginRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.GetPluginRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.GetPluginRequest} GetPluginRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetPluginRequest.decode = function 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.apihub.v1.GetPluginRequest(); - 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 GetPluginRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.GetPluginRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.GetPluginRequest} GetPluginRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetPluginRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetPluginRequest message. - * @function verify - * @memberof google.cloud.apihub.v1.GetPluginRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetPluginRequest.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 GetPluginRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.GetPluginRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.GetPluginRequest} GetPluginRequest - */ - GetPluginRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.GetPluginRequest) - return object; - var message = new $root.google.cloud.apihub.v1.GetPluginRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetPluginRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.GetPluginRequest - * @static - * @param {google.cloud.apihub.v1.GetPluginRequest} message GetPluginRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetPluginRequest.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 GetPluginRequest to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.GetPluginRequest - * @instance - * @returns {Object.} JSON object - */ - GetPluginRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetPluginRequest - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.GetPluginRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetPluginRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.GetPluginRequest"; - }; - - return GetPluginRequest; - })(); - - v1.EnablePluginRequest = (function() { - - /** - * Properties of an EnablePluginRequest. - * @memberof google.cloud.apihub.v1 - * @interface IEnablePluginRequest - * @property {string|null} [name] EnablePluginRequest name - */ - - /** - * Constructs a new EnablePluginRequest. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents an EnablePluginRequest. - * @implements IEnablePluginRequest - * @constructor - * @param {google.cloud.apihub.v1.IEnablePluginRequest=} [properties] Properties to set - */ - function EnablePluginRequest(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]]; - } - - /** - * EnablePluginRequest name. - * @member {string} name - * @memberof google.cloud.apihub.v1.EnablePluginRequest - * @instance - */ - EnablePluginRequest.prototype.name = ""; - - /** - * Creates a new EnablePluginRequest instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.EnablePluginRequest - * @static - * @param {google.cloud.apihub.v1.IEnablePluginRequest=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.EnablePluginRequest} EnablePluginRequest instance - */ - EnablePluginRequest.create = function create(properties) { - return new EnablePluginRequest(properties); - }; - - /** - * Encodes the specified EnablePluginRequest message. Does not implicitly {@link google.cloud.apihub.v1.EnablePluginRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.EnablePluginRequest - * @static - * @param {google.cloud.apihub.v1.IEnablePluginRequest} message EnablePluginRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnablePluginRequest.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 EnablePluginRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.EnablePluginRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.EnablePluginRequest - * @static - * @param {google.cloud.apihub.v1.IEnablePluginRequest} message EnablePluginRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnablePluginRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnablePluginRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.EnablePluginRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.EnablePluginRequest} EnablePluginRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnablePluginRequest.decode = function 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.apihub.v1.EnablePluginRequest(); - 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 an EnablePluginRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.EnablePluginRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.EnablePluginRequest} EnablePluginRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnablePluginRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnablePluginRequest message. - * @function verify - * @memberof google.cloud.apihub.v1.EnablePluginRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnablePluginRequest.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 an EnablePluginRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.EnablePluginRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.EnablePluginRequest} EnablePluginRequest - */ - EnablePluginRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.EnablePluginRequest) - return object; - var message = new $root.google.cloud.apihub.v1.EnablePluginRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from an EnablePluginRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.EnablePluginRequest - * @static - * @param {google.cloud.apihub.v1.EnablePluginRequest} message EnablePluginRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnablePluginRequest.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 EnablePluginRequest to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.EnablePluginRequest - * @instance - * @returns {Object.} JSON object - */ - EnablePluginRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnablePluginRequest - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.EnablePluginRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnablePluginRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.EnablePluginRequest"; - }; - - return EnablePluginRequest; - })(); - - v1.DisablePluginRequest = (function() { - - /** - * Properties of a DisablePluginRequest. - * @memberof google.cloud.apihub.v1 - * @interface IDisablePluginRequest - * @property {string|null} [name] DisablePluginRequest name - */ - - /** - * Constructs a new DisablePluginRequest. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents a DisablePluginRequest. - * @implements IDisablePluginRequest - * @constructor - * @param {google.cloud.apihub.v1.IDisablePluginRequest=} [properties] Properties to set - */ - function DisablePluginRequest(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]]; - } - - /** - * DisablePluginRequest name. - * @member {string} name - * @memberof google.cloud.apihub.v1.DisablePluginRequest - * @instance - */ - DisablePluginRequest.prototype.name = ""; - - /** - * Creates a new DisablePluginRequest instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.DisablePluginRequest - * @static - * @param {google.cloud.apihub.v1.IDisablePluginRequest=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.DisablePluginRequest} DisablePluginRequest instance - */ - DisablePluginRequest.create = function create(properties) { - return new DisablePluginRequest(properties); - }; - - /** - * Encodes the specified DisablePluginRequest message. Does not implicitly {@link google.cloud.apihub.v1.DisablePluginRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.DisablePluginRequest - * @static - * @param {google.cloud.apihub.v1.IDisablePluginRequest} message DisablePluginRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DisablePluginRequest.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 DisablePluginRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.DisablePluginRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.DisablePluginRequest - * @static - * @param {google.cloud.apihub.v1.IDisablePluginRequest} message DisablePluginRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DisablePluginRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DisablePluginRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.DisablePluginRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.DisablePluginRequest} DisablePluginRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DisablePluginRequest.decode = function 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.apihub.v1.DisablePluginRequest(); - 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 DisablePluginRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.DisablePluginRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.DisablePluginRequest} DisablePluginRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DisablePluginRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DisablePluginRequest message. - * @function verify - * @memberof google.cloud.apihub.v1.DisablePluginRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DisablePluginRequest.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 DisablePluginRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.DisablePluginRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.DisablePluginRequest} DisablePluginRequest - */ - DisablePluginRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.DisablePluginRequest) - return object; - var message = new $root.google.cloud.apihub.v1.DisablePluginRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a DisablePluginRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.DisablePluginRequest - * @static - * @param {google.cloud.apihub.v1.DisablePluginRequest} message DisablePluginRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DisablePluginRequest.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 DisablePluginRequest to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.DisablePluginRequest - * @instance - * @returns {Object.} JSON object - */ - DisablePluginRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DisablePluginRequest - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.DisablePluginRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DisablePluginRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.DisablePluginRequest"; - }; - - return DisablePluginRequest; - })(); - - v1.Provisioning = (function() { - - /** - * Constructs a new Provisioning service. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents a Provisioning - * @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 Provisioning(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (Provisioning.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Provisioning; - - /** - * Creates new Provisioning service using the specified rpc implementation. - * @function create - * @memberof google.cloud.apihub.v1.Provisioning - * @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 {Provisioning} RPC service. Useful where requests and/or responses are streamed. - */ - Provisioning.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.cloud.apihub.v1.Provisioning|createApiHubInstance}. - * @memberof google.cloud.apihub.v1.Provisioning - * @typedef CreateApiHubInstanceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls CreateApiHubInstance. - * @function createApiHubInstance - * @memberof google.cloud.apihub.v1.Provisioning - * @instance - * @param {google.cloud.apihub.v1.ICreateApiHubInstanceRequest} request CreateApiHubInstanceRequest message or plain object - * @param {google.cloud.apihub.v1.Provisioning.CreateApiHubInstanceCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Provisioning.prototype.createApiHubInstance = function createApiHubInstance(request, callback) { - return this.rpcCall(createApiHubInstance, $root.google.cloud.apihub.v1.CreateApiHubInstanceRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "CreateApiHubInstance" }); - - /** - * Calls CreateApiHubInstance. - * @function createApiHubInstance - * @memberof google.cloud.apihub.v1.Provisioning - * @instance - * @param {google.cloud.apihub.v1.ICreateApiHubInstanceRequest} request CreateApiHubInstanceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.apihub.v1.Provisioning|getApiHubInstance}. - * @memberof google.cloud.apihub.v1.Provisioning - * @typedef GetApiHubInstanceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.apihub.v1.ApiHubInstance} [response] ApiHubInstance - */ - - /** - * Calls GetApiHubInstance. - * @function getApiHubInstance - * @memberof google.cloud.apihub.v1.Provisioning - * @instance - * @param {google.cloud.apihub.v1.IGetApiHubInstanceRequest} request GetApiHubInstanceRequest message or plain object - * @param {google.cloud.apihub.v1.Provisioning.GetApiHubInstanceCallback} callback Node-style callback called with the error, if any, and ApiHubInstance - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Provisioning.prototype.getApiHubInstance = function getApiHubInstance(request, callback) { - return this.rpcCall(getApiHubInstance, $root.google.cloud.apihub.v1.GetApiHubInstanceRequest, $root.google.cloud.apihub.v1.ApiHubInstance, request, callback); - }, "name", { value: "GetApiHubInstance" }); - - /** - * Calls GetApiHubInstance. - * @function getApiHubInstance - * @memberof google.cloud.apihub.v1.Provisioning - * @instance - * @param {google.cloud.apihub.v1.IGetApiHubInstanceRequest} request GetApiHubInstanceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.apihub.v1.Provisioning|lookupApiHubInstance}. - * @memberof google.cloud.apihub.v1.Provisioning - * @typedef LookupApiHubInstanceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.apihub.v1.LookupApiHubInstanceResponse} [response] LookupApiHubInstanceResponse - */ - - /** - * Calls LookupApiHubInstance. - * @function lookupApiHubInstance - * @memberof google.cloud.apihub.v1.Provisioning - * @instance - * @param {google.cloud.apihub.v1.ILookupApiHubInstanceRequest} request LookupApiHubInstanceRequest message or plain object - * @param {google.cloud.apihub.v1.Provisioning.LookupApiHubInstanceCallback} callback Node-style callback called with the error, if any, and LookupApiHubInstanceResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Provisioning.prototype.lookupApiHubInstance = function lookupApiHubInstance(request, callback) { - return this.rpcCall(lookupApiHubInstance, $root.google.cloud.apihub.v1.LookupApiHubInstanceRequest, $root.google.cloud.apihub.v1.LookupApiHubInstanceResponse, request, callback); - }, "name", { value: "LookupApiHubInstance" }); - - /** - * Calls LookupApiHubInstance. - * @function lookupApiHubInstance - * @memberof google.cloud.apihub.v1.Provisioning - * @instance - * @param {google.cloud.apihub.v1.ILookupApiHubInstanceRequest} request LookupApiHubInstanceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return Provisioning; - })(); - - v1.CreateApiHubInstanceRequest = (function() { - - /** - * Properties of a CreateApiHubInstanceRequest. - * @memberof google.cloud.apihub.v1 - * @interface ICreateApiHubInstanceRequest - * @property {string|null} [parent] CreateApiHubInstanceRequest parent - * @property {string|null} [apiHubInstanceId] CreateApiHubInstanceRequest apiHubInstanceId - * @property {google.cloud.apihub.v1.IApiHubInstance|null} [apiHubInstance] CreateApiHubInstanceRequest apiHubInstance - */ - - /** - * Constructs a new CreateApiHubInstanceRequest. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents a CreateApiHubInstanceRequest. - * @implements ICreateApiHubInstanceRequest - * @constructor - * @param {google.cloud.apihub.v1.ICreateApiHubInstanceRequest=} [properties] Properties to set - */ - function CreateApiHubInstanceRequest(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]]; - } - - /** - * CreateApiHubInstanceRequest parent. - * @member {string} parent - * @memberof google.cloud.apihub.v1.CreateApiHubInstanceRequest - * @instance - */ - CreateApiHubInstanceRequest.prototype.parent = ""; - - /** - * CreateApiHubInstanceRequest apiHubInstanceId. - * @member {string} apiHubInstanceId - * @memberof google.cloud.apihub.v1.CreateApiHubInstanceRequest - * @instance - */ - CreateApiHubInstanceRequest.prototype.apiHubInstanceId = ""; - - /** - * CreateApiHubInstanceRequest apiHubInstance. - * @member {google.cloud.apihub.v1.IApiHubInstance|null|undefined} apiHubInstance - * @memberof google.cloud.apihub.v1.CreateApiHubInstanceRequest - * @instance - */ - CreateApiHubInstanceRequest.prototype.apiHubInstance = null; - - /** - * Creates a new CreateApiHubInstanceRequest instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.CreateApiHubInstanceRequest - * @static - * @param {google.cloud.apihub.v1.ICreateApiHubInstanceRequest=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.CreateApiHubInstanceRequest} CreateApiHubInstanceRequest instance - */ - CreateApiHubInstanceRequest.create = function create(properties) { - return new CreateApiHubInstanceRequest(properties); - }; - - /** - * Encodes the specified CreateApiHubInstanceRequest message. Does not implicitly {@link google.cloud.apihub.v1.CreateApiHubInstanceRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.CreateApiHubInstanceRequest - * @static - * @param {google.cloud.apihub.v1.ICreateApiHubInstanceRequest} message CreateApiHubInstanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateApiHubInstanceRequest.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.apiHubInstanceId != null && Object.hasOwnProperty.call(message, "apiHubInstanceId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.apiHubInstanceId); - if (message.apiHubInstance != null && Object.hasOwnProperty.call(message, "apiHubInstance")) - $root.google.cloud.apihub.v1.ApiHubInstance.encode(message.apiHubInstance, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CreateApiHubInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.CreateApiHubInstanceRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.CreateApiHubInstanceRequest - * @static - * @param {google.cloud.apihub.v1.ICreateApiHubInstanceRequest} message CreateApiHubInstanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateApiHubInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateApiHubInstanceRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.CreateApiHubInstanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.CreateApiHubInstanceRequest} CreateApiHubInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateApiHubInstanceRequest.decode = function 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.apihub.v1.CreateApiHubInstanceRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.apiHubInstanceId = reader.string(); - break; - } - case 3: { - message.apiHubInstance = $root.google.cloud.apihub.v1.ApiHubInstance.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateApiHubInstanceRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.CreateApiHubInstanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.CreateApiHubInstanceRequest} CreateApiHubInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateApiHubInstanceRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateApiHubInstanceRequest message. - * @function verify - * @memberof google.cloud.apihub.v1.CreateApiHubInstanceRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateApiHubInstanceRequest.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.apiHubInstanceId != null && message.hasOwnProperty("apiHubInstanceId")) - if (!$util.isString(message.apiHubInstanceId)) - return "apiHubInstanceId: string expected"; - if (message.apiHubInstance != null && message.hasOwnProperty("apiHubInstance")) { - var error = $root.google.cloud.apihub.v1.ApiHubInstance.verify(message.apiHubInstance); - if (error) - return "apiHubInstance." + error; - } - return null; - }; - - /** - * Creates a CreateApiHubInstanceRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.CreateApiHubInstanceRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.CreateApiHubInstanceRequest} CreateApiHubInstanceRequest - */ - CreateApiHubInstanceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.CreateApiHubInstanceRequest) - return object; - var message = new $root.google.cloud.apihub.v1.CreateApiHubInstanceRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.apiHubInstanceId != null) - message.apiHubInstanceId = String(object.apiHubInstanceId); - if (object.apiHubInstance != null) { - if (typeof object.apiHubInstance !== "object") - throw TypeError(".google.cloud.apihub.v1.CreateApiHubInstanceRequest.apiHubInstance: object expected"); - message.apiHubInstance = $root.google.cloud.apihub.v1.ApiHubInstance.fromObject(object.apiHubInstance); - } - return message; - }; - - /** - * Creates a plain object from a CreateApiHubInstanceRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.CreateApiHubInstanceRequest - * @static - * @param {google.cloud.apihub.v1.CreateApiHubInstanceRequest} message CreateApiHubInstanceRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateApiHubInstanceRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.apiHubInstanceId = ""; - object.apiHubInstance = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.apiHubInstanceId != null && message.hasOwnProperty("apiHubInstanceId")) - object.apiHubInstanceId = message.apiHubInstanceId; - if (message.apiHubInstance != null && message.hasOwnProperty("apiHubInstance")) - object.apiHubInstance = $root.google.cloud.apihub.v1.ApiHubInstance.toObject(message.apiHubInstance, options); - return object; - }; - - /** - * Converts this CreateApiHubInstanceRequest to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.CreateApiHubInstanceRequest - * @instance - * @returns {Object.} JSON object - */ - CreateApiHubInstanceRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateApiHubInstanceRequest - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.CreateApiHubInstanceRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateApiHubInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.CreateApiHubInstanceRequest"; - }; - - return CreateApiHubInstanceRequest; - })(); - - v1.GetApiHubInstanceRequest = (function() { - - /** - * Properties of a GetApiHubInstanceRequest. - * @memberof google.cloud.apihub.v1 - * @interface IGetApiHubInstanceRequest - * @property {string|null} [name] GetApiHubInstanceRequest name - */ - - /** - * Constructs a new GetApiHubInstanceRequest. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents a GetApiHubInstanceRequest. - * @implements IGetApiHubInstanceRequest - * @constructor - * @param {google.cloud.apihub.v1.IGetApiHubInstanceRequest=} [properties] Properties to set - */ - function GetApiHubInstanceRequest(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]]; - } - - /** - * GetApiHubInstanceRequest name. - * @member {string} name - * @memberof google.cloud.apihub.v1.GetApiHubInstanceRequest - * @instance - */ - GetApiHubInstanceRequest.prototype.name = ""; - - /** - * Creates a new GetApiHubInstanceRequest instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.GetApiHubInstanceRequest - * @static - * @param {google.cloud.apihub.v1.IGetApiHubInstanceRequest=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.GetApiHubInstanceRequest} GetApiHubInstanceRequest instance - */ - GetApiHubInstanceRequest.create = function create(properties) { - return new GetApiHubInstanceRequest(properties); - }; - - /** - * Encodes the specified GetApiHubInstanceRequest message. Does not implicitly {@link google.cloud.apihub.v1.GetApiHubInstanceRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.GetApiHubInstanceRequest - * @static - * @param {google.cloud.apihub.v1.IGetApiHubInstanceRequest} message GetApiHubInstanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetApiHubInstanceRequest.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 GetApiHubInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.GetApiHubInstanceRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.GetApiHubInstanceRequest - * @static - * @param {google.cloud.apihub.v1.IGetApiHubInstanceRequest} message GetApiHubInstanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetApiHubInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetApiHubInstanceRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.GetApiHubInstanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.GetApiHubInstanceRequest} GetApiHubInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetApiHubInstanceRequest.decode = function 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.apihub.v1.GetApiHubInstanceRequest(); - 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 GetApiHubInstanceRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.GetApiHubInstanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.GetApiHubInstanceRequest} GetApiHubInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetApiHubInstanceRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetApiHubInstanceRequest message. - * @function verify - * @memberof google.cloud.apihub.v1.GetApiHubInstanceRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetApiHubInstanceRequest.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 GetApiHubInstanceRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.GetApiHubInstanceRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.GetApiHubInstanceRequest} GetApiHubInstanceRequest - */ - GetApiHubInstanceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.GetApiHubInstanceRequest) - return object; - var message = new $root.google.cloud.apihub.v1.GetApiHubInstanceRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetApiHubInstanceRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.GetApiHubInstanceRequest - * @static - * @param {google.cloud.apihub.v1.GetApiHubInstanceRequest} message GetApiHubInstanceRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetApiHubInstanceRequest.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 GetApiHubInstanceRequest to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.GetApiHubInstanceRequest - * @instance - * @returns {Object.} JSON object - */ - GetApiHubInstanceRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetApiHubInstanceRequest - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.GetApiHubInstanceRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetApiHubInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.GetApiHubInstanceRequest"; - }; - - return GetApiHubInstanceRequest; - })(); - - v1.LookupApiHubInstanceRequest = (function() { - - /** - * Properties of a LookupApiHubInstanceRequest. - * @memberof google.cloud.apihub.v1 - * @interface ILookupApiHubInstanceRequest - * @property {string|null} [parent] LookupApiHubInstanceRequest parent - */ - - /** - * Constructs a new LookupApiHubInstanceRequest. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents a LookupApiHubInstanceRequest. - * @implements ILookupApiHubInstanceRequest - * @constructor - * @param {google.cloud.apihub.v1.ILookupApiHubInstanceRequest=} [properties] Properties to set - */ - function LookupApiHubInstanceRequest(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]]; - } - - /** - * LookupApiHubInstanceRequest parent. - * @member {string} parent - * @memberof google.cloud.apihub.v1.LookupApiHubInstanceRequest - * @instance - */ - LookupApiHubInstanceRequest.prototype.parent = ""; - - /** - * Creates a new LookupApiHubInstanceRequest instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.LookupApiHubInstanceRequest - * @static - * @param {google.cloud.apihub.v1.ILookupApiHubInstanceRequest=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.LookupApiHubInstanceRequest} LookupApiHubInstanceRequest instance - */ - LookupApiHubInstanceRequest.create = function create(properties) { - return new LookupApiHubInstanceRequest(properties); - }; - - /** - * Encodes the specified LookupApiHubInstanceRequest message. Does not implicitly {@link google.cloud.apihub.v1.LookupApiHubInstanceRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.LookupApiHubInstanceRequest - * @static - * @param {google.cloud.apihub.v1.ILookupApiHubInstanceRequest} message LookupApiHubInstanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LookupApiHubInstanceRequest.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); - return writer; - }; - - /** - * Encodes the specified LookupApiHubInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.LookupApiHubInstanceRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.LookupApiHubInstanceRequest - * @static - * @param {google.cloud.apihub.v1.ILookupApiHubInstanceRequest} message LookupApiHubInstanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LookupApiHubInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a LookupApiHubInstanceRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.LookupApiHubInstanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.LookupApiHubInstanceRequest} LookupApiHubInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LookupApiHubInstanceRequest.decode = function 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.apihub.v1.LookupApiHubInstanceRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a LookupApiHubInstanceRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.LookupApiHubInstanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.LookupApiHubInstanceRequest} LookupApiHubInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LookupApiHubInstanceRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a LookupApiHubInstanceRequest message. - * @function verify - * @memberof google.cloud.apihub.v1.LookupApiHubInstanceRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - LookupApiHubInstanceRequest.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"; - return null; - }; - - /** - * Creates a LookupApiHubInstanceRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.LookupApiHubInstanceRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.LookupApiHubInstanceRequest} LookupApiHubInstanceRequest - */ - LookupApiHubInstanceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.LookupApiHubInstanceRequest) - return object; - var message = new $root.google.cloud.apihub.v1.LookupApiHubInstanceRequest(); - if (object.parent != null) - message.parent = String(object.parent); - return message; - }; - - /** - * Creates a plain object from a LookupApiHubInstanceRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.LookupApiHubInstanceRequest - * @static - * @param {google.cloud.apihub.v1.LookupApiHubInstanceRequest} message LookupApiHubInstanceRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LookupApiHubInstanceRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.parent = ""; - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - return object; - }; - - /** - * Converts this LookupApiHubInstanceRequest to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.LookupApiHubInstanceRequest - * @instance - * @returns {Object.} JSON object - */ - LookupApiHubInstanceRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for LookupApiHubInstanceRequest - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.LookupApiHubInstanceRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - LookupApiHubInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.LookupApiHubInstanceRequest"; - }; - - return LookupApiHubInstanceRequest; - })(); - - v1.LookupApiHubInstanceResponse = (function() { - - /** - * Properties of a LookupApiHubInstanceResponse. - * @memberof google.cloud.apihub.v1 - * @interface ILookupApiHubInstanceResponse - * @property {google.cloud.apihub.v1.IApiHubInstance|null} [apiHubInstance] LookupApiHubInstanceResponse apiHubInstance - */ - - /** - * Constructs a new LookupApiHubInstanceResponse. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents a LookupApiHubInstanceResponse. - * @implements ILookupApiHubInstanceResponse - * @constructor - * @param {google.cloud.apihub.v1.ILookupApiHubInstanceResponse=} [properties] Properties to set - */ - function LookupApiHubInstanceResponse(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]]; - } - - /** - * LookupApiHubInstanceResponse apiHubInstance. - * @member {google.cloud.apihub.v1.IApiHubInstance|null|undefined} apiHubInstance - * @memberof google.cloud.apihub.v1.LookupApiHubInstanceResponse - * @instance - */ - LookupApiHubInstanceResponse.prototype.apiHubInstance = null; - - /** - * Creates a new LookupApiHubInstanceResponse instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.LookupApiHubInstanceResponse - * @static - * @param {google.cloud.apihub.v1.ILookupApiHubInstanceResponse=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.LookupApiHubInstanceResponse} LookupApiHubInstanceResponse instance - */ - LookupApiHubInstanceResponse.create = function create(properties) { - return new LookupApiHubInstanceResponse(properties); - }; - - /** - * Encodes the specified LookupApiHubInstanceResponse message. Does not implicitly {@link google.cloud.apihub.v1.LookupApiHubInstanceResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.LookupApiHubInstanceResponse - * @static - * @param {google.cloud.apihub.v1.ILookupApiHubInstanceResponse} message LookupApiHubInstanceResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LookupApiHubInstanceResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.apiHubInstance != null && Object.hasOwnProperty.call(message, "apiHubInstance")) - $root.google.cloud.apihub.v1.ApiHubInstance.encode(message.apiHubInstance, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified LookupApiHubInstanceResponse message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.LookupApiHubInstanceResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.LookupApiHubInstanceResponse - * @static - * @param {google.cloud.apihub.v1.ILookupApiHubInstanceResponse} message LookupApiHubInstanceResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LookupApiHubInstanceResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a LookupApiHubInstanceResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.LookupApiHubInstanceResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.LookupApiHubInstanceResponse} LookupApiHubInstanceResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LookupApiHubInstanceResponse.decode = function 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.apihub.v1.LookupApiHubInstanceResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.apiHubInstance = $root.google.cloud.apihub.v1.ApiHubInstance.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a LookupApiHubInstanceResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.LookupApiHubInstanceResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.LookupApiHubInstanceResponse} LookupApiHubInstanceResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LookupApiHubInstanceResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a LookupApiHubInstanceResponse message. - * @function verify - * @memberof google.cloud.apihub.v1.LookupApiHubInstanceResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - LookupApiHubInstanceResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.apiHubInstance != null && message.hasOwnProperty("apiHubInstance")) { - var error = $root.google.cloud.apihub.v1.ApiHubInstance.verify(message.apiHubInstance); - if (error) - return "apiHubInstance." + error; - } - return null; - }; - - /** - * Creates a LookupApiHubInstanceResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.LookupApiHubInstanceResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.LookupApiHubInstanceResponse} LookupApiHubInstanceResponse - */ - LookupApiHubInstanceResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.LookupApiHubInstanceResponse) - return object; - var message = new $root.google.cloud.apihub.v1.LookupApiHubInstanceResponse(); - if (object.apiHubInstance != null) { - if (typeof object.apiHubInstance !== "object") - throw TypeError(".google.cloud.apihub.v1.LookupApiHubInstanceResponse.apiHubInstance: object expected"); - message.apiHubInstance = $root.google.cloud.apihub.v1.ApiHubInstance.fromObject(object.apiHubInstance); - } - return message; - }; - - /** - * Creates a plain object from a LookupApiHubInstanceResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.LookupApiHubInstanceResponse - * @static - * @param {google.cloud.apihub.v1.LookupApiHubInstanceResponse} message LookupApiHubInstanceResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LookupApiHubInstanceResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.apiHubInstance = null; - if (message.apiHubInstance != null && message.hasOwnProperty("apiHubInstance")) - object.apiHubInstance = $root.google.cloud.apihub.v1.ApiHubInstance.toObject(message.apiHubInstance, options); - return object; - }; - - /** - * Converts this LookupApiHubInstanceResponse to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.LookupApiHubInstanceResponse - * @instance - * @returns {Object.} JSON object - */ - LookupApiHubInstanceResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for LookupApiHubInstanceResponse - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.LookupApiHubInstanceResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - LookupApiHubInstanceResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.LookupApiHubInstanceResponse"; - }; - - return LookupApiHubInstanceResponse; - })(); - - v1.RuntimeProjectAttachmentService = (function() { - - /** - * Constructs a new RuntimeProjectAttachmentService service. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents a RuntimeProjectAttachmentService - * @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 RuntimeProjectAttachmentService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (RuntimeProjectAttachmentService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = RuntimeProjectAttachmentService; - - /** - * Creates new RuntimeProjectAttachmentService service using the specified rpc implementation. - * @function create - * @memberof google.cloud.apihub.v1.RuntimeProjectAttachmentService - * @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 {RuntimeProjectAttachmentService} RPC service. Useful where requests and/or responses are streamed. - */ - RuntimeProjectAttachmentService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.cloud.apihub.v1.RuntimeProjectAttachmentService|createRuntimeProjectAttachment}. - * @memberof google.cloud.apihub.v1.RuntimeProjectAttachmentService - * @typedef CreateRuntimeProjectAttachmentCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.apihub.v1.RuntimeProjectAttachment} [response] RuntimeProjectAttachment - */ - - /** - * Calls CreateRuntimeProjectAttachment. - * @function createRuntimeProjectAttachment - * @memberof google.cloud.apihub.v1.RuntimeProjectAttachmentService - * @instance - * @param {google.cloud.apihub.v1.ICreateRuntimeProjectAttachmentRequest} request CreateRuntimeProjectAttachmentRequest message or plain object - * @param {google.cloud.apihub.v1.RuntimeProjectAttachmentService.CreateRuntimeProjectAttachmentCallback} callback Node-style callback called with the error, if any, and RuntimeProjectAttachment - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(RuntimeProjectAttachmentService.prototype.createRuntimeProjectAttachment = function createRuntimeProjectAttachment(request, callback) { - return this.rpcCall(createRuntimeProjectAttachment, $root.google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest, $root.google.cloud.apihub.v1.RuntimeProjectAttachment, request, callback); - }, "name", { value: "CreateRuntimeProjectAttachment" }); - - /** - * Calls CreateRuntimeProjectAttachment. - * @function createRuntimeProjectAttachment - * @memberof google.cloud.apihub.v1.RuntimeProjectAttachmentService - * @instance - * @param {google.cloud.apihub.v1.ICreateRuntimeProjectAttachmentRequest} request CreateRuntimeProjectAttachmentRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.apihub.v1.RuntimeProjectAttachmentService|getRuntimeProjectAttachment}. - * @memberof google.cloud.apihub.v1.RuntimeProjectAttachmentService - * @typedef GetRuntimeProjectAttachmentCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.apihub.v1.RuntimeProjectAttachment} [response] RuntimeProjectAttachment - */ - - /** - * Calls GetRuntimeProjectAttachment. - * @function getRuntimeProjectAttachment - * @memberof google.cloud.apihub.v1.RuntimeProjectAttachmentService - * @instance - * @param {google.cloud.apihub.v1.IGetRuntimeProjectAttachmentRequest} request GetRuntimeProjectAttachmentRequest message or plain object - * @param {google.cloud.apihub.v1.RuntimeProjectAttachmentService.GetRuntimeProjectAttachmentCallback} callback Node-style callback called with the error, if any, and RuntimeProjectAttachment - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(RuntimeProjectAttachmentService.prototype.getRuntimeProjectAttachment = function getRuntimeProjectAttachment(request, callback) { - return this.rpcCall(getRuntimeProjectAttachment, $root.google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest, $root.google.cloud.apihub.v1.RuntimeProjectAttachment, request, callback); - }, "name", { value: "GetRuntimeProjectAttachment" }); - - /** - * Calls GetRuntimeProjectAttachment. - * @function getRuntimeProjectAttachment - * @memberof google.cloud.apihub.v1.RuntimeProjectAttachmentService - * @instance - * @param {google.cloud.apihub.v1.IGetRuntimeProjectAttachmentRequest} request GetRuntimeProjectAttachmentRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.apihub.v1.RuntimeProjectAttachmentService|listRuntimeProjectAttachments}. - * @memberof google.cloud.apihub.v1.RuntimeProjectAttachmentService - * @typedef ListRuntimeProjectAttachmentsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse} [response] ListRuntimeProjectAttachmentsResponse - */ - - /** - * Calls ListRuntimeProjectAttachments. - * @function listRuntimeProjectAttachments - * @memberof google.cloud.apihub.v1.RuntimeProjectAttachmentService - * @instance - * @param {google.cloud.apihub.v1.IListRuntimeProjectAttachmentsRequest} request ListRuntimeProjectAttachmentsRequest message or plain object - * @param {google.cloud.apihub.v1.RuntimeProjectAttachmentService.ListRuntimeProjectAttachmentsCallback} callback Node-style callback called with the error, if any, and ListRuntimeProjectAttachmentsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(RuntimeProjectAttachmentService.prototype.listRuntimeProjectAttachments = function listRuntimeProjectAttachments(request, callback) { - return this.rpcCall(listRuntimeProjectAttachments, $root.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest, $root.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse, request, callback); - }, "name", { value: "ListRuntimeProjectAttachments" }); - - /** - * Calls ListRuntimeProjectAttachments. - * @function listRuntimeProjectAttachments - * @memberof google.cloud.apihub.v1.RuntimeProjectAttachmentService - * @instance - * @param {google.cloud.apihub.v1.IListRuntimeProjectAttachmentsRequest} request ListRuntimeProjectAttachmentsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.apihub.v1.RuntimeProjectAttachmentService|deleteRuntimeProjectAttachment}. - * @memberof google.cloud.apihub.v1.RuntimeProjectAttachmentService - * @typedef DeleteRuntimeProjectAttachmentCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DeleteRuntimeProjectAttachment. - * @function deleteRuntimeProjectAttachment - * @memberof google.cloud.apihub.v1.RuntimeProjectAttachmentService - * @instance - * @param {google.cloud.apihub.v1.IDeleteRuntimeProjectAttachmentRequest} request DeleteRuntimeProjectAttachmentRequest message or plain object - * @param {google.cloud.apihub.v1.RuntimeProjectAttachmentService.DeleteRuntimeProjectAttachmentCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(RuntimeProjectAttachmentService.prototype.deleteRuntimeProjectAttachment = function deleteRuntimeProjectAttachment(request, callback) { - return this.rpcCall(deleteRuntimeProjectAttachment, $root.google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteRuntimeProjectAttachment" }); - - /** - * Calls DeleteRuntimeProjectAttachment. - * @function deleteRuntimeProjectAttachment - * @memberof google.cloud.apihub.v1.RuntimeProjectAttachmentService - * @instance - * @param {google.cloud.apihub.v1.IDeleteRuntimeProjectAttachmentRequest} request DeleteRuntimeProjectAttachmentRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.apihub.v1.RuntimeProjectAttachmentService|lookupRuntimeProjectAttachment}. - * @memberof google.cloud.apihub.v1.RuntimeProjectAttachmentService - * @typedef LookupRuntimeProjectAttachmentCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse} [response] LookupRuntimeProjectAttachmentResponse - */ - - /** - * Calls LookupRuntimeProjectAttachment. - * @function lookupRuntimeProjectAttachment - * @memberof google.cloud.apihub.v1.RuntimeProjectAttachmentService - * @instance - * @param {google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentRequest} request LookupRuntimeProjectAttachmentRequest message or plain object - * @param {google.cloud.apihub.v1.RuntimeProjectAttachmentService.LookupRuntimeProjectAttachmentCallback} callback Node-style callback called with the error, if any, and LookupRuntimeProjectAttachmentResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(RuntimeProjectAttachmentService.prototype.lookupRuntimeProjectAttachment = function lookupRuntimeProjectAttachment(request, callback) { - return this.rpcCall(lookupRuntimeProjectAttachment, $root.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest, $root.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse, request, callback); - }, "name", { value: "LookupRuntimeProjectAttachment" }); - - /** - * Calls LookupRuntimeProjectAttachment. - * @function lookupRuntimeProjectAttachment - * @memberof google.cloud.apihub.v1.RuntimeProjectAttachmentService - * @instance - * @param {google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentRequest} request LookupRuntimeProjectAttachmentRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return RuntimeProjectAttachmentService; - })(); - - v1.CreateRuntimeProjectAttachmentRequest = (function() { - - /** - * Properties of a CreateRuntimeProjectAttachmentRequest. - * @memberof google.cloud.apihub.v1 - * @interface ICreateRuntimeProjectAttachmentRequest - * @property {string|null} [parent] CreateRuntimeProjectAttachmentRequest parent - * @property {string|null} [runtimeProjectAttachmentId] CreateRuntimeProjectAttachmentRequest runtimeProjectAttachmentId - * @property {google.cloud.apihub.v1.IRuntimeProjectAttachment|null} [runtimeProjectAttachment] CreateRuntimeProjectAttachmentRequest runtimeProjectAttachment - */ - - /** - * Constructs a new CreateRuntimeProjectAttachmentRequest. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents a CreateRuntimeProjectAttachmentRequest. - * @implements ICreateRuntimeProjectAttachmentRequest - * @constructor - * @param {google.cloud.apihub.v1.ICreateRuntimeProjectAttachmentRequest=} [properties] Properties to set - */ - function CreateRuntimeProjectAttachmentRequest(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]]; - } - - /** - * CreateRuntimeProjectAttachmentRequest parent. - * @member {string} parent - * @memberof google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest - * @instance - */ - CreateRuntimeProjectAttachmentRequest.prototype.parent = ""; - - /** - * CreateRuntimeProjectAttachmentRequest runtimeProjectAttachmentId. - * @member {string} runtimeProjectAttachmentId - * @memberof google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest - * @instance - */ - CreateRuntimeProjectAttachmentRequest.prototype.runtimeProjectAttachmentId = ""; - - /** - * CreateRuntimeProjectAttachmentRequest runtimeProjectAttachment. - * @member {google.cloud.apihub.v1.IRuntimeProjectAttachment|null|undefined} runtimeProjectAttachment - * @memberof google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest - * @instance - */ - CreateRuntimeProjectAttachmentRequest.prototype.runtimeProjectAttachment = null; - - /** - * Creates a new CreateRuntimeProjectAttachmentRequest instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest - * @static - * @param {google.cloud.apihub.v1.ICreateRuntimeProjectAttachmentRequest=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest} CreateRuntimeProjectAttachmentRequest instance - */ - CreateRuntimeProjectAttachmentRequest.create = function create(properties) { - return new CreateRuntimeProjectAttachmentRequest(properties); - }; - - /** - * Encodes the specified CreateRuntimeProjectAttachmentRequest message. Does not implicitly {@link google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest - * @static - * @param {google.cloud.apihub.v1.ICreateRuntimeProjectAttachmentRequest} message CreateRuntimeProjectAttachmentRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateRuntimeProjectAttachmentRequest.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.runtimeProjectAttachmentId != null && Object.hasOwnProperty.call(message, "runtimeProjectAttachmentId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.runtimeProjectAttachmentId); - if (message.runtimeProjectAttachment != null && Object.hasOwnProperty.call(message, "runtimeProjectAttachment")) - $root.google.cloud.apihub.v1.RuntimeProjectAttachment.encode(message.runtimeProjectAttachment, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CreateRuntimeProjectAttachmentRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest - * @static - * @param {google.cloud.apihub.v1.ICreateRuntimeProjectAttachmentRequest} message CreateRuntimeProjectAttachmentRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateRuntimeProjectAttachmentRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateRuntimeProjectAttachmentRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest} CreateRuntimeProjectAttachmentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateRuntimeProjectAttachmentRequest.decode = function 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.apihub.v1.CreateRuntimeProjectAttachmentRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.runtimeProjectAttachmentId = reader.string(); - break; - } - case 3: { - message.runtimeProjectAttachment = $root.google.cloud.apihub.v1.RuntimeProjectAttachment.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateRuntimeProjectAttachmentRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest} CreateRuntimeProjectAttachmentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateRuntimeProjectAttachmentRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateRuntimeProjectAttachmentRequest message. - * @function verify - * @memberof google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateRuntimeProjectAttachmentRequest.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.runtimeProjectAttachmentId != null && message.hasOwnProperty("runtimeProjectAttachmentId")) - if (!$util.isString(message.runtimeProjectAttachmentId)) - return "runtimeProjectAttachmentId: string expected"; - if (message.runtimeProjectAttachment != null && message.hasOwnProperty("runtimeProjectAttachment")) { - var error = $root.google.cloud.apihub.v1.RuntimeProjectAttachment.verify(message.runtimeProjectAttachment); - if (error) - return "runtimeProjectAttachment." + error; - } - return null; - }; - - /** - * Creates a CreateRuntimeProjectAttachmentRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest} CreateRuntimeProjectAttachmentRequest - */ - CreateRuntimeProjectAttachmentRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest) - return object; - var message = new $root.google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.runtimeProjectAttachmentId != null) - message.runtimeProjectAttachmentId = String(object.runtimeProjectAttachmentId); - if (object.runtimeProjectAttachment != null) { - if (typeof object.runtimeProjectAttachment !== "object") - throw TypeError(".google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest.runtimeProjectAttachment: object expected"); - message.runtimeProjectAttachment = $root.google.cloud.apihub.v1.RuntimeProjectAttachment.fromObject(object.runtimeProjectAttachment); - } - return message; - }; - - /** - * Creates a plain object from a CreateRuntimeProjectAttachmentRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest - * @static - * @param {google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest} message CreateRuntimeProjectAttachmentRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateRuntimeProjectAttachmentRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.runtimeProjectAttachmentId = ""; - object.runtimeProjectAttachment = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.runtimeProjectAttachmentId != null && message.hasOwnProperty("runtimeProjectAttachmentId")) - object.runtimeProjectAttachmentId = message.runtimeProjectAttachmentId; - if (message.runtimeProjectAttachment != null && message.hasOwnProperty("runtimeProjectAttachment")) - object.runtimeProjectAttachment = $root.google.cloud.apihub.v1.RuntimeProjectAttachment.toObject(message.runtimeProjectAttachment, options); - return object; - }; - - /** - * Converts this CreateRuntimeProjectAttachmentRequest to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest - * @instance - * @returns {Object.} JSON object - */ - CreateRuntimeProjectAttachmentRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateRuntimeProjectAttachmentRequest - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateRuntimeProjectAttachmentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest"; - }; - - return CreateRuntimeProjectAttachmentRequest; - })(); - - v1.GetRuntimeProjectAttachmentRequest = (function() { - - /** - * Properties of a GetRuntimeProjectAttachmentRequest. - * @memberof google.cloud.apihub.v1 - * @interface IGetRuntimeProjectAttachmentRequest - * @property {string|null} [name] GetRuntimeProjectAttachmentRequest name - */ - - /** - * Constructs a new GetRuntimeProjectAttachmentRequest. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents a GetRuntimeProjectAttachmentRequest. - * @implements IGetRuntimeProjectAttachmentRequest - * @constructor - * @param {google.cloud.apihub.v1.IGetRuntimeProjectAttachmentRequest=} [properties] Properties to set - */ - function GetRuntimeProjectAttachmentRequest(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]]; - } - - /** - * GetRuntimeProjectAttachmentRequest name. - * @member {string} name - * @memberof google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest - * @instance - */ - GetRuntimeProjectAttachmentRequest.prototype.name = ""; - - /** - * Creates a new GetRuntimeProjectAttachmentRequest instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest - * @static - * @param {google.cloud.apihub.v1.IGetRuntimeProjectAttachmentRequest=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest} GetRuntimeProjectAttachmentRequest instance - */ - GetRuntimeProjectAttachmentRequest.create = function create(properties) { - return new GetRuntimeProjectAttachmentRequest(properties); - }; - - /** - * Encodes the specified GetRuntimeProjectAttachmentRequest message. Does not implicitly {@link google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest - * @static - * @param {google.cloud.apihub.v1.IGetRuntimeProjectAttachmentRequest} message GetRuntimeProjectAttachmentRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetRuntimeProjectAttachmentRequest.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 GetRuntimeProjectAttachmentRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest - * @static - * @param {google.cloud.apihub.v1.IGetRuntimeProjectAttachmentRequest} message GetRuntimeProjectAttachmentRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetRuntimeProjectAttachmentRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetRuntimeProjectAttachmentRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest} GetRuntimeProjectAttachmentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetRuntimeProjectAttachmentRequest.decode = function 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.apihub.v1.GetRuntimeProjectAttachmentRequest(); - 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 GetRuntimeProjectAttachmentRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest} GetRuntimeProjectAttachmentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetRuntimeProjectAttachmentRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetRuntimeProjectAttachmentRequest message. - * @function verify - * @memberof google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetRuntimeProjectAttachmentRequest.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 GetRuntimeProjectAttachmentRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest} GetRuntimeProjectAttachmentRequest - */ - GetRuntimeProjectAttachmentRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest) - return object; - var message = new $root.google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetRuntimeProjectAttachmentRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest - * @static - * @param {google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest} message GetRuntimeProjectAttachmentRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetRuntimeProjectAttachmentRequest.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 GetRuntimeProjectAttachmentRequest to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest - * @instance - * @returns {Object.} JSON object - */ - GetRuntimeProjectAttachmentRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetRuntimeProjectAttachmentRequest - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetRuntimeProjectAttachmentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest"; - }; - - return GetRuntimeProjectAttachmentRequest; - })(); - - v1.ListRuntimeProjectAttachmentsRequest = (function() { - - /** - * Properties of a ListRuntimeProjectAttachmentsRequest. - * @memberof google.cloud.apihub.v1 - * @interface IListRuntimeProjectAttachmentsRequest - * @property {string|null} [parent] ListRuntimeProjectAttachmentsRequest parent - * @property {number|null} [pageSize] ListRuntimeProjectAttachmentsRequest pageSize - * @property {string|null} [pageToken] ListRuntimeProjectAttachmentsRequest pageToken - * @property {string|null} [filter] ListRuntimeProjectAttachmentsRequest filter - * @property {string|null} [orderBy] ListRuntimeProjectAttachmentsRequest orderBy - */ - - /** - * Constructs a new ListRuntimeProjectAttachmentsRequest. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents a ListRuntimeProjectAttachmentsRequest. - * @implements IListRuntimeProjectAttachmentsRequest - * @constructor - * @param {google.cloud.apihub.v1.IListRuntimeProjectAttachmentsRequest=} [properties] Properties to set - */ - function ListRuntimeProjectAttachmentsRequest(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]]; - } - - /** - * ListRuntimeProjectAttachmentsRequest parent. - * @member {string} parent - * @memberof google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest - * @instance - */ - ListRuntimeProjectAttachmentsRequest.prototype.parent = ""; - - /** - * ListRuntimeProjectAttachmentsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest - * @instance - */ - ListRuntimeProjectAttachmentsRequest.prototype.pageSize = 0; - - /** - * ListRuntimeProjectAttachmentsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest - * @instance - */ - ListRuntimeProjectAttachmentsRequest.prototype.pageToken = ""; - - /** - * ListRuntimeProjectAttachmentsRequest filter. - * @member {string} filter - * @memberof google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest - * @instance - */ - ListRuntimeProjectAttachmentsRequest.prototype.filter = ""; - - /** - * ListRuntimeProjectAttachmentsRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest - * @instance - */ - ListRuntimeProjectAttachmentsRequest.prototype.orderBy = ""; - - /** - * Creates a new ListRuntimeProjectAttachmentsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest - * @static - * @param {google.cloud.apihub.v1.IListRuntimeProjectAttachmentsRequest=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest} ListRuntimeProjectAttachmentsRequest instance - */ - ListRuntimeProjectAttachmentsRequest.create = function create(properties) { - return new ListRuntimeProjectAttachmentsRequest(properties); - }; - - /** - * Encodes the specified ListRuntimeProjectAttachmentsRequest message. Does not implicitly {@link google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest - * @static - * @param {google.cloud.apihub.v1.IListRuntimeProjectAttachmentsRequest} message ListRuntimeProjectAttachmentsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListRuntimeProjectAttachmentsRequest.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); - return writer; - }; - - /** - * Encodes the specified ListRuntimeProjectAttachmentsRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest - * @static - * @param {google.cloud.apihub.v1.IListRuntimeProjectAttachmentsRequest} message ListRuntimeProjectAttachmentsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListRuntimeProjectAttachmentsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListRuntimeProjectAttachmentsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest} ListRuntimeProjectAttachmentsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListRuntimeProjectAttachmentsRequest.decode = function 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.apihub.v1.ListRuntimeProjectAttachmentsRequest(); - 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; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListRuntimeProjectAttachmentsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest} ListRuntimeProjectAttachmentsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListRuntimeProjectAttachmentsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListRuntimeProjectAttachmentsRequest message. - * @function verify - * @memberof google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListRuntimeProjectAttachmentsRequest.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"; - return null; - }; - - /** - * Creates a ListRuntimeProjectAttachmentsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest} ListRuntimeProjectAttachmentsRequest - */ - ListRuntimeProjectAttachmentsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest) - return object; - var message = new $root.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest(); - 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); - return message; - }; - - /** - * Creates a plain object from a ListRuntimeProjectAttachmentsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest - * @static - * @param {google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest} message ListRuntimeProjectAttachmentsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListRuntimeProjectAttachmentsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - object.filter = ""; - object.orderBy = ""; - } - 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; - return object; - }; - - /** - * Converts this ListRuntimeProjectAttachmentsRequest to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest - * @instance - * @returns {Object.} JSON object - */ - ListRuntimeProjectAttachmentsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListRuntimeProjectAttachmentsRequest - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListRuntimeProjectAttachmentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest"; - }; - - return ListRuntimeProjectAttachmentsRequest; - })(); - - v1.ListRuntimeProjectAttachmentsResponse = (function() { - - /** - * Properties of a ListRuntimeProjectAttachmentsResponse. - * @memberof google.cloud.apihub.v1 - * @interface IListRuntimeProjectAttachmentsResponse - * @property {Array.|null} [runtimeProjectAttachments] ListRuntimeProjectAttachmentsResponse runtimeProjectAttachments - * @property {string|null} [nextPageToken] ListRuntimeProjectAttachmentsResponse nextPageToken - */ - - /** - * Constructs a new ListRuntimeProjectAttachmentsResponse. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents a ListRuntimeProjectAttachmentsResponse. - * @implements IListRuntimeProjectAttachmentsResponse - * @constructor - * @param {google.cloud.apihub.v1.IListRuntimeProjectAttachmentsResponse=} [properties] Properties to set - */ - function ListRuntimeProjectAttachmentsResponse(properties) { - this.runtimeProjectAttachments = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListRuntimeProjectAttachmentsResponse runtimeProjectAttachments. - * @member {Array.} runtimeProjectAttachments - * @memberof google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse - * @instance - */ - ListRuntimeProjectAttachmentsResponse.prototype.runtimeProjectAttachments = $util.emptyArray; - - /** - * ListRuntimeProjectAttachmentsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse - * @instance - */ - ListRuntimeProjectAttachmentsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListRuntimeProjectAttachmentsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse - * @static - * @param {google.cloud.apihub.v1.IListRuntimeProjectAttachmentsResponse=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse} ListRuntimeProjectAttachmentsResponse instance - */ - ListRuntimeProjectAttachmentsResponse.create = function create(properties) { - return new ListRuntimeProjectAttachmentsResponse(properties); - }; - - /** - * Encodes the specified ListRuntimeProjectAttachmentsResponse message. Does not implicitly {@link google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse - * @static - * @param {google.cloud.apihub.v1.IListRuntimeProjectAttachmentsResponse} message ListRuntimeProjectAttachmentsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListRuntimeProjectAttachmentsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.runtimeProjectAttachments != null && message.runtimeProjectAttachments.length) - for (var i = 0; i < message.runtimeProjectAttachments.length; ++i) - $root.google.cloud.apihub.v1.RuntimeProjectAttachment.encode(message.runtimeProjectAttachments[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 ListRuntimeProjectAttachmentsResponse message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse - * @static - * @param {google.cloud.apihub.v1.IListRuntimeProjectAttachmentsResponse} message ListRuntimeProjectAttachmentsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListRuntimeProjectAttachmentsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListRuntimeProjectAttachmentsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse} ListRuntimeProjectAttachmentsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListRuntimeProjectAttachmentsResponse.decode = function 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.apihub.v1.ListRuntimeProjectAttachmentsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.runtimeProjectAttachments && message.runtimeProjectAttachments.length)) - message.runtimeProjectAttachments = []; - message.runtimeProjectAttachments.push($root.google.cloud.apihub.v1.RuntimeProjectAttachment.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListRuntimeProjectAttachmentsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse} ListRuntimeProjectAttachmentsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListRuntimeProjectAttachmentsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListRuntimeProjectAttachmentsResponse message. - * @function verify - * @memberof google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListRuntimeProjectAttachmentsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.runtimeProjectAttachments != null && message.hasOwnProperty("runtimeProjectAttachments")) { - if (!Array.isArray(message.runtimeProjectAttachments)) - return "runtimeProjectAttachments: array expected"; - for (var i = 0; i < message.runtimeProjectAttachments.length; ++i) { - var error = $root.google.cloud.apihub.v1.RuntimeProjectAttachment.verify(message.runtimeProjectAttachments[i]); - if (error) - return "runtimeProjectAttachments." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListRuntimeProjectAttachmentsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse} ListRuntimeProjectAttachmentsResponse - */ - ListRuntimeProjectAttachmentsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse) - return object; - var message = new $root.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse(); - if (object.runtimeProjectAttachments) { - if (!Array.isArray(object.runtimeProjectAttachments)) - throw TypeError(".google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse.runtimeProjectAttachments: array expected"); - message.runtimeProjectAttachments = []; - for (var i = 0; i < object.runtimeProjectAttachments.length; ++i) { - if (typeof object.runtimeProjectAttachments[i] !== "object") - throw TypeError(".google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse.runtimeProjectAttachments: object expected"); - message.runtimeProjectAttachments[i] = $root.google.cloud.apihub.v1.RuntimeProjectAttachment.fromObject(object.runtimeProjectAttachments[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListRuntimeProjectAttachmentsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse - * @static - * @param {google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse} message ListRuntimeProjectAttachmentsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListRuntimeProjectAttachmentsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.runtimeProjectAttachments = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.runtimeProjectAttachments && message.runtimeProjectAttachments.length) { - object.runtimeProjectAttachments = []; - for (var j = 0; j < message.runtimeProjectAttachments.length; ++j) - object.runtimeProjectAttachments[j] = $root.google.cloud.apihub.v1.RuntimeProjectAttachment.toObject(message.runtimeProjectAttachments[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListRuntimeProjectAttachmentsResponse to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse - * @instance - * @returns {Object.} JSON object - */ - ListRuntimeProjectAttachmentsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListRuntimeProjectAttachmentsResponse - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListRuntimeProjectAttachmentsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse"; - }; - - return ListRuntimeProjectAttachmentsResponse; - })(); - - v1.DeleteRuntimeProjectAttachmentRequest = (function() { - - /** - * Properties of a DeleteRuntimeProjectAttachmentRequest. - * @memberof google.cloud.apihub.v1 - * @interface IDeleteRuntimeProjectAttachmentRequest - * @property {string|null} [name] DeleteRuntimeProjectAttachmentRequest name - */ - - /** - * Constructs a new DeleteRuntimeProjectAttachmentRequest. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents a DeleteRuntimeProjectAttachmentRequest. - * @implements IDeleteRuntimeProjectAttachmentRequest - * @constructor - * @param {google.cloud.apihub.v1.IDeleteRuntimeProjectAttachmentRequest=} [properties] Properties to set - */ - function DeleteRuntimeProjectAttachmentRequest(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]]; - } - - /** - * DeleteRuntimeProjectAttachmentRequest name. - * @member {string} name - * @memberof google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest - * @instance - */ - DeleteRuntimeProjectAttachmentRequest.prototype.name = ""; - - /** - * Creates a new DeleteRuntimeProjectAttachmentRequest instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest - * @static - * @param {google.cloud.apihub.v1.IDeleteRuntimeProjectAttachmentRequest=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest} DeleteRuntimeProjectAttachmentRequest instance - */ - DeleteRuntimeProjectAttachmentRequest.create = function create(properties) { - return new DeleteRuntimeProjectAttachmentRequest(properties); - }; - - /** - * Encodes the specified DeleteRuntimeProjectAttachmentRequest message. Does not implicitly {@link google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest - * @static - * @param {google.cloud.apihub.v1.IDeleteRuntimeProjectAttachmentRequest} message DeleteRuntimeProjectAttachmentRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteRuntimeProjectAttachmentRequest.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 DeleteRuntimeProjectAttachmentRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest - * @static - * @param {google.cloud.apihub.v1.IDeleteRuntimeProjectAttachmentRequest} message DeleteRuntimeProjectAttachmentRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteRuntimeProjectAttachmentRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteRuntimeProjectAttachmentRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest} DeleteRuntimeProjectAttachmentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteRuntimeProjectAttachmentRequest.decode = function 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.apihub.v1.DeleteRuntimeProjectAttachmentRequest(); - 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 DeleteRuntimeProjectAttachmentRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest} DeleteRuntimeProjectAttachmentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteRuntimeProjectAttachmentRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteRuntimeProjectAttachmentRequest message. - * @function verify - * @memberof google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteRuntimeProjectAttachmentRequest.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 DeleteRuntimeProjectAttachmentRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest} DeleteRuntimeProjectAttachmentRequest - */ - DeleteRuntimeProjectAttachmentRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest) - return object; - var message = new $root.google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a DeleteRuntimeProjectAttachmentRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest - * @static - * @param {google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest} message DeleteRuntimeProjectAttachmentRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteRuntimeProjectAttachmentRequest.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 DeleteRuntimeProjectAttachmentRequest to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteRuntimeProjectAttachmentRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteRuntimeProjectAttachmentRequest - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteRuntimeProjectAttachmentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest"; - }; - - return DeleteRuntimeProjectAttachmentRequest; - })(); - - v1.LookupRuntimeProjectAttachmentRequest = (function() { - - /** - * Properties of a LookupRuntimeProjectAttachmentRequest. - * @memberof google.cloud.apihub.v1 - * @interface ILookupRuntimeProjectAttachmentRequest - * @property {string|null} [name] LookupRuntimeProjectAttachmentRequest name - */ - - /** - * Constructs a new LookupRuntimeProjectAttachmentRequest. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents a LookupRuntimeProjectAttachmentRequest. - * @implements ILookupRuntimeProjectAttachmentRequest - * @constructor - * @param {google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentRequest=} [properties] Properties to set - */ - function LookupRuntimeProjectAttachmentRequest(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]]; - } - - /** - * LookupRuntimeProjectAttachmentRequest name. - * @member {string} name - * @memberof google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest - * @instance - */ - LookupRuntimeProjectAttachmentRequest.prototype.name = ""; - - /** - * Creates a new LookupRuntimeProjectAttachmentRequest instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest - * @static - * @param {google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentRequest=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest} LookupRuntimeProjectAttachmentRequest instance - */ - LookupRuntimeProjectAttachmentRequest.create = function create(properties) { - return new LookupRuntimeProjectAttachmentRequest(properties); - }; - - /** - * Encodes the specified LookupRuntimeProjectAttachmentRequest message. Does not implicitly {@link google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest - * @static - * @param {google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentRequest} message LookupRuntimeProjectAttachmentRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LookupRuntimeProjectAttachmentRequest.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 LookupRuntimeProjectAttachmentRequest message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest - * @static - * @param {google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentRequest} message LookupRuntimeProjectAttachmentRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LookupRuntimeProjectAttachmentRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a LookupRuntimeProjectAttachmentRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest} LookupRuntimeProjectAttachmentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LookupRuntimeProjectAttachmentRequest.decode = function 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.apihub.v1.LookupRuntimeProjectAttachmentRequest(); - 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 LookupRuntimeProjectAttachmentRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest} LookupRuntimeProjectAttachmentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LookupRuntimeProjectAttachmentRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a LookupRuntimeProjectAttachmentRequest message. - * @function verify - * @memberof google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - LookupRuntimeProjectAttachmentRequest.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 LookupRuntimeProjectAttachmentRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest} LookupRuntimeProjectAttachmentRequest - */ - LookupRuntimeProjectAttachmentRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest) - return object; - var message = new $root.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a LookupRuntimeProjectAttachmentRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest - * @static - * @param {google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest} message LookupRuntimeProjectAttachmentRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LookupRuntimeProjectAttachmentRequest.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 LookupRuntimeProjectAttachmentRequest to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest - * @instance - * @returns {Object.} JSON object - */ - LookupRuntimeProjectAttachmentRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for LookupRuntimeProjectAttachmentRequest - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - LookupRuntimeProjectAttachmentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest"; - }; - - return LookupRuntimeProjectAttachmentRequest; - })(); - - v1.LookupRuntimeProjectAttachmentResponse = (function() { - - /** - * Properties of a LookupRuntimeProjectAttachmentResponse. - * @memberof google.cloud.apihub.v1 - * @interface ILookupRuntimeProjectAttachmentResponse - * @property {google.cloud.apihub.v1.IRuntimeProjectAttachment|null} [runtimeProjectAttachment] LookupRuntimeProjectAttachmentResponse runtimeProjectAttachment - */ - - /** - * Constructs a new LookupRuntimeProjectAttachmentResponse. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents a LookupRuntimeProjectAttachmentResponse. - * @implements ILookupRuntimeProjectAttachmentResponse - * @constructor - * @param {google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentResponse=} [properties] Properties to set - */ - function LookupRuntimeProjectAttachmentResponse(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]]; - } - - /** - * LookupRuntimeProjectAttachmentResponse runtimeProjectAttachment. - * @member {google.cloud.apihub.v1.IRuntimeProjectAttachment|null|undefined} runtimeProjectAttachment - * @memberof google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse - * @instance - */ - LookupRuntimeProjectAttachmentResponse.prototype.runtimeProjectAttachment = null; - - /** - * Creates a new LookupRuntimeProjectAttachmentResponse instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse - * @static - * @param {google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentResponse=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse} LookupRuntimeProjectAttachmentResponse instance - */ - LookupRuntimeProjectAttachmentResponse.create = function create(properties) { - return new LookupRuntimeProjectAttachmentResponse(properties); - }; - - /** - * Encodes the specified LookupRuntimeProjectAttachmentResponse message. Does not implicitly {@link google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse - * @static - * @param {google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentResponse} message LookupRuntimeProjectAttachmentResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LookupRuntimeProjectAttachmentResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.runtimeProjectAttachment != null && Object.hasOwnProperty.call(message, "runtimeProjectAttachment")) - $root.google.cloud.apihub.v1.RuntimeProjectAttachment.encode(message.runtimeProjectAttachment, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified LookupRuntimeProjectAttachmentResponse message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse - * @static - * @param {google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentResponse} message LookupRuntimeProjectAttachmentResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LookupRuntimeProjectAttachmentResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a LookupRuntimeProjectAttachmentResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse} LookupRuntimeProjectAttachmentResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LookupRuntimeProjectAttachmentResponse.decode = function 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.apihub.v1.LookupRuntimeProjectAttachmentResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.runtimeProjectAttachment = $root.google.cloud.apihub.v1.RuntimeProjectAttachment.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a LookupRuntimeProjectAttachmentResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse} LookupRuntimeProjectAttachmentResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LookupRuntimeProjectAttachmentResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a LookupRuntimeProjectAttachmentResponse message. - * @function verify - * @memberof google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - LookupRuntimeProjectAttachmentResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.runtimeProjectAttachment != null && message.hasOwnProperty("runtimeProjectAttachment")) { - var error = $root.google.cloud.apihub.v1.RuntimeProjectAttachment.verify(message.runtimeProjectAttachment); - if (error) - return "runtimeProjectAttachment." + error; - } - return null; - }; - - /** - * Creates a LookupRuntimeProjectAttachmentResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse} LookupRuntimeProjectAttachmentResponse - */ - LookupRuntimeProjectAttachmentResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse) - return object; - var message = new $root.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse(); - if (object.runtimeProjectAttachment != null) { - if (typeof object.runtimeProjectAttachment !== "object") - throw TypeError(".google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse.runtimeProjectAttachment: object expected"); - message.runtimeProjectAttachment = $root.google.cloud.apihub.v1.RuntimeProjectAttachment.fromObject(object.runtimeProjectAttachment); - } - return message; - }; - - /** - * Creates a plain object from a LookupRuntimeProjectAttachmentResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse - * @static - * @param {google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse} message LookupRuntimeProjectAttachmentResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LookupRuntimeProjectAttachmentResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.runtimeProjectAttachment = null; - if (message.runtimeProjectAttachment != null && message.hasOwnProperty("runtimeProjectAttachment")) - object.runtimeProjectAttachment = $root.google.cloud.apihub.v1.RuntimeProjectAttachment.toObject(message.runtimeProjectAttachment, options); - return object; - }; - - /** - * Converts this LookupRuntimeProjectAttachmentResponse to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse - * @instance - * @returns {Object.} JSON object - */ - LookupRuntimeProjectAttachmentResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for LookupRuntimeProjectAttachmentResponse - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - LookupRuntimeProjectAttachmentResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse"; - }; - - return LookupRuntimeProjectAttachmentResponse; - })(); - - v1.RuntimeProjectAttachment = (function() { - - /** - * Properties of a RuntimeProjectAttachment. - * @memberof google.cloud.apihub.v1 - * @interface IRuntimeProjectAttachment - * @property {string|null} [name] RuntimeProjectAttachment name - * @property {string|null} [runtimeProject] RuntimeProjectAttachment runtimeProject - * @property {google.protobuf.ITimestamp|null} [createTime] RuntimeProjectAttachment createTime - */ - - /** - * Constructs a new RuntimeProjectAttachment. - * @memberof google.cloud.apihub.v1 - * @classdesc Represents a RuntimeProjectAttachment. - * @implements IRuntimeProjectAttachment - * @constructor - * @param {google.cloud.apihub.v1.IRuntimeProjectAttachment=} [properties] Properties to set - */ - function RuntimeProjectAttachment(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]]; - } - - /** - * RuntimeProjectAttachment name. - * @member {string} name - * @memberof google.cloud.apihub.v1.RuntimeProjectAttachment - * @instance - */ - RuntimeProjectAttachment.prototype.name = ""; - - /** - * RuntimeProjectAttachment runtimeProject. - * @member {string} runtimeProject - * @memberof google.cloud.apihub.v1.RuntimeProjectAttachment - * @instance - */ - RuntimeProjectAttachment.prototype.runtimeProject = ""; - - /** - * RuntimeProjectAttachment createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.apihub.v1.RuntimeProjectAttachment - * @instance - */ - RuntimeProjectAttachment.prototype.createTime = null; - - /** - * Creates a new RuntimeProjectAttachment instance using the specified properties. - * @function create - * @memberof google.cloud.apihub.v1.RuntimeProjectAttachment - * @static - * @param {google.cloud.apihub.v1.IRuntimeProjectAttachment=} [properties] Properties to set - * @returns {google.cloud.apihub.v1.RuntimeProjectAttachment} RuntimeProjectAttachment instance - */ - RuntimeProjectAttachment.create = function create(properties) { - return new RuntimeProjectAttachment(properties); - }; - - /** - * Encodes the specified RuntimeProjectAttachment message. Does not implicitly {@link google.cloud.apihub.v1.RuntimeProjectAttachment.verify|verify} messages. - * @function encode - * @memberof google.cloud.apihub.v1.RuntimeProjectAttachment - * @static - * @param {google.cloud.apihub.v1.IRuntimeProjectAttachment} message RuntimeProjectAttachment message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RuntimeProjectAttachment.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.runtimeProject != null && Object.hasOwnProperty.call(message, "runtimeProject")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.runtimeProject); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified RuntimeProjectAttachment message, length delimited. Does not implicitly {@link google.cloud.apihub.v1.RuntimeProjectAttachment.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.apihub.v1.RuntimeProjectAttachment - * @static - * @param {google.cloud.apihub.v1.IRuntimeProjectAttachment} message RuntimeProjectAttachment message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RuntimeProjectAttachment.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RuntimeProjectAttachment message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.apihub.v1.RuntimeProjectAttachment - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.apihub.v1.RuntimeProjectAttachment} RuntimeProjectAttachment - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RuntimeProjectAttachment.decode = function 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.apihub.v1.RuntimeProjectAttachment(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.runtimeProject = reader.string(); - break; - } - case 3: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RuntimeProjectAttachment message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.apihub.v1.RuntimeProjectAttachment - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.apihub.v1.RuntimeProjectAttachment} RuntimeProjectAttachment - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RuntimeProjectAttachment.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RuntimeProjectAttachment message. - * @function verify - * @memberof google.cloud.apihub.v1.RuntimeProjectAttachment - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RuntimeProjectAttachment.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.runtimeProject != null && message.hasOwnProperty("runtimeProject")) - if (!$util.isString(message.runtimeProject)) - return "runtimeProject: string expected"; - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - return null; - }; - - /** - * Creates a RuntimeProjectAttachment message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.apihub.v1.RuntimeProjectAttachment - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.apihub.v1.RuntimeProjectAttachment} RuntimeProjectAttachment - */ - RuntimeProjectAttachment.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.apihub.v1.RuntimeProjectAttachment) - return object; - var message = new $root.google.cloud.apihub.v1.RuntimeProjectAttachment(); - if (object.name != null) - message.name = String(object.name); - if (object.runtimeProject != null) - message.runtimeProject = String(object.runtimeProject); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.apihub.v1.RuntimeProjectAttachment.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - return message; - }; - - /** - * Creates a plain object from a RuntimeProjectAttachment message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.apihub.v1.RuntimeProjectAttachment - * @static - * @param {google.cloud.apihub.v1.RuntimeProjectAttachment} message RuntimeProjectAttachment - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RuntimeProjectAttachment.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.runtimeProject = ""; - object.createTime = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.runtimeProject != null && message.hasOwnProperty("runtimeProject")) - object.runtimeProject = message.runtimeProject; - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - return object; - }; - - /** - * Converts this RuntimeProjectAttachment to JSON. - * @function toJSON - * @memberof google.cloud.apihub.v1.RuntimeProjectAttachment - * @instance - * @returns {Object.} JSON object - */ - RuntimeProjectAttachment.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RuntimeProjectAttachment - * @function getTypeUrl - * @memberof google.cloud.apihub.v1.RuntimeProjectAttachment - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RuntimeProjectAttachment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.apihub.v1.RuntimeProjectAttachment"; - }; - - return RuntimeProjectAttachment; - })(); - - return v1; - })(); - - return apihub; - })(); - - return cloud; - })(); - - google.api = (function() { - - /** - * Namespace api. - * @memberof google - * @namespace - */ - var api = {}; - - api.Http = (function() { - - /** - * Properties of a Http. - * @memberof google.api - * @interface IHttp - * @property {Array.|null} [rules] Http rules - * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion - */ - - /** - * Constructs a new Http. - * @memberof google.api - * @classdesc Represents a Http. - * @implements IHttp - * @constructor - * @param {google.api.IHttp=} [properties] Properties to set - */ - function Http(properties) { - this.rules = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Http rules. - * @member {Array.} rules - * @memberof google.api.Http - * @instance - */ - Http.prototype.rules = $util.emptyArray; - - /** - * Http fullyDecodeReservedExpansion. - * @member {boolean} fullyDecodeReservedExpansion - * @memberof google.api.Http - * @instance - */ - Http.prototype.fullyDecodeReservedExpansion = false; - - /** - * Creates a new Http instance using the specified properties. - * @function create - * @memberof google.api.Http - * @static - * @param {google.api.IHttp=} [properties] Properties to set - * @returns {google.api.Http} Http instance - */ - Http.create = function create(properties) { - return new Http(properties); - }; - - /** - * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @function encode - * @memberof google.api.Http - * @static - * @param {google.api.IHttp} message Http message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Http.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.rules != null && message.rules.length) - for (var i = 0; i < message.rules.length; ++i) - $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); - return writer; - }; - - /** - * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.Http - * @static - * @param {google.api.IHttp} message Http message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Http.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Http message from the specified reader or buffer. - * @function decode - * @memberof google.api.Http - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.Http} Http - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Http.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.rules && message.rules.length)) - message.rules = []; - message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); - break; - } - case 2: { - message.fullyDecodeReservedExpansion = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Http message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.Http - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.Http} Http - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Http.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Http message. - * @function verify - * @memberof google.api.Http - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Http.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.rules != null && message.hasOwnProperty("rules")) { - if (!Array.isArray(message.rules)) - return "rules: array expected"; - for (var i = 0; i < message.rules.length; ++i) { - var error = $root.google.api.HttpRule.verify(message.rules[i]); - if (error) - return "rules." + error; - } - } - if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) - if (typeof message.fullyDecodeReservedExpansion !== "boolean") - return "fullyDecodeReservedExpansion: boolean expected"; - return null; - }; - - /** - * Creates a Http message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.Http - * @static - * @param {Object.} object Plain object - * @returns {google.api.Http} Http - */ - Http.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.Http) - return object; - var message = new $root.google.api.Http(); - if (object.rules) { - if (!Array.isArray(object.rules)) - throw TypeError(".google.api.Http.rules: array expected"); - message.rules = []; - for (var i = 0; i < object.rules.length; ++i) { - if (typeof object.rules[i] !== "object") - throw TypeError(".google.api.Http.rules: object expected"); - message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); - } - } - if (object.fullyDecodeReservedExpansion != null) - message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); - return message; - }; - - /** - * Creates a plain object from a Http message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.Http - * @static - * @param {google.api.Http} message Http - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Http.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.rules = []; - if (options.defaults) - object.fullyDecodeReservedExpansion = false; - if (message.rules && message.rules.length) { - object.rules = []; - for (var j = 0; j < message.rules.length; ++j) - object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); - } - if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) - object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; - return object; - }; - - /** - * Converts this Http to JSON. - * @function toJSON - * @memberof google.api.Http - * @instance - * @returns {Object.} JSON object - */ - Http.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * 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 - * @property {string|null} [protoReferenceDocumentationUri] Publishing protoReferenceDocumentationUri - * @property {string|null} [restReferenceDocumentationUri] Publishing restReferenceDocumentationUri - */ - - /** - * 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; - - /** - * Publishing protoReferenceDocumentationUri. - * @member {string} protoReferenceDocumentationUri - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.protoReferenceDocumentationUri = ""; - - /** - * Publishing restReferenceDocumentationUri. - * @member {string} restReferenceDocumentationUri - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.restReferenceDocumentationUri = ""; - - /** - * 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(); - if (message.protoReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "protoReferenceDocumentationUri")) - writer.uint32(/* id 110, wireType 2 =*/882).string(message.protoReferenceDocumentationUri); - if (message.restReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "restReferenceDocumentationUri")) - writer.uint32(/* id 111, wireType 2 =*/890).string(message.restReferenceDocumentationUri); - 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; - } - case 110: { - message.protoReferenceDocumentationUri = reader.string(); - break; - } - case 111: { - message.restReferenceDocumentationUri = reader.string(); - 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: - case 5: - case 6: - case 7: - 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; - } - } - if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) - if (!$util.isString(message.protoReferenceDocumentationUri)) - return "protoReferenceDocumentationUri: string expected"; - if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) - if (!$util.isString(message.restReferenceDocumentationUri)) - return "restReferenceDocumentationUri: string expected"; - 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; - case "SHOPPING": - case 5: - message.organization = 5; - break; - case "GEO": - case 6: - message.organization = 6; - break; - case "GENERATIVE_AI": - case 7: - message.organization = 7; - 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]); - } - } - if (object.protoReferenceDocumentationUri != null) - message.protoReferenceDocumentationUri = String(object.protoReferenceDocumentationUri); - if (object.restReferenceDocumentationUri != null) - message.restReferenceDocumentationUri = String(object.restReferenceDocumentationUri); - 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; - object.protoReferenceDocumentationUri = ""; - object.restReferenceDocumentationUri = ""; - } - 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); - } - if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) - object.protoReferenceDocumentationUri = message.protoReferenceDocumentationUri; - if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) - object.restReferenceDocumentationUri = message.restReferenceDocumentationUri; - 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 - * @property {Object.|null} [renamedServices] DotnetSettings renamedServices - * @property {Object.|null} [renamedResources] DotnetSettings renamedResources - * @property {Array.|null} [ignoredResources] DotnetSettings ignoredResources - * @property {Array.|null} [forcedNamespaceAliases] DotnetSettings forcedNamespaceAliases - * @property {Array.|null} [handwrittenSignatures] DotnetSettings handwrittenSignatures - */ - - /** - * 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) { - this.renamedServices = {}; - this.renamedResources = {}; - this.ignoredResources = []; - this.forcedNamespaceAliases = []; - this.handwrittenSignatures = []; - if (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; - - /** - * DotnetSettings renamedServices. - * @member {Object.} renamedServices - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.renamedServices = $util.emptyObject; - - /** - * DotnetSettings renamedResources. - * @member {Object.} renamedResources - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.renamedResources = $util.emptyObject; - - /** - * DotnetSettings ignoredResources. - * @member {Array.} ignoredResources - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.ignoredResources = $util.emptyArray; - - /** - * DotnetSettings forcedNamespaceAliases. - * @member {Array.} forcedNamespaceAliases - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.forcedNamespaceAliases = $util.emptyArray; - - /** - * DotnetSettings handwrittenSignatures. - * @member {Array.} handwrittenSignatures - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.handwrittenSignatures = $util.emptyArray; - - /** - * 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(); - if (message.renamedServices != null && Object.hasOwnProperty.call(message, "renamedServices")) - for (var keys = Object.keys(message.renamedServices), 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.renamedServices[keys[i]]).ldelim(); - if (message.renamedResources != null && Object.hasOwnProperty.call(message, "renamedResources")) - for (var keys = Object.keys(message.renamedResources), i = 0; i < keys.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedResources[keys[i]]).ldelim(); - if (message.ignoredResources != null && message.ignoredResources.length) - for (var i = 0; i < message.ignoredResources.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.ignoredResources[i]); - if (message.forcedNamespaceAliases != null && message.forcedNamespaceAliases.length) - for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.forcedNamespaceAliases[i]); - if (message.handwrittenSignatures != null && message.handwrittenSignatures.length) - for (var i = 0; i < message.handwrittenSignatures.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.handwrittenSignatures[i]); - 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(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - case 2: { - if (message.renamedServices === $util.emptyObject) - message.renamedServices = {}; - 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.renamedServices[key] = value; - break; - } - case 3: { - if (message.renamedResources === $util.emptyObject) - message.renamedResources = {}; - 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.renamedResources[key] = value; - break; - } - case 4: { - if (!(message.ignoredResources && message.ignoredResources.length)) - message.ignoredResources = []; - message.ignoredResources.push(reader.string()); - break; - } - case 5: { - if (!(message.forcedNamespaceAliases && message.forcedNamespaceAliases.length)) - message.forcedNamespaceAliases = []; - message.forcedNamespaceAliases.push(reader.string()); - break; - } - case 6: { - if (!(message.handwrittenSignatures && message.handwrittenSignatures.length)) - message.handwrittenSignatures = []; - message.handwrittenSignatures.push(reader.string()); - 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; - } - if (message.renamedServices != null && message.hasOwnProperty("renamedServices")) { - if (!$util.isObject(message.renamedServices)) - return "renamedServices: object expected"; - var key = Object.keys(message.renamedServices); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.renamedServices[key[i]])) - return "renamedServices: string{k:string} expected"; - } - if (message.renamedResources != null && message.hasOwnProperty("renamedResources")) { - if (!$util.isObject(message.renamedResources)) - return "renamedResources: object expected"; - var key = Object.keys(message.renamedResources); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.renamedResources[key[i]])) - return "renamedResources: string{k:string} expected"; - } - if (message.ignoredResources != null && message.hasOwnProperty("ignoredResources")) { - if (!Array.isArray(message.ignoredResources)) - return "ignoredResources: array expected"; - for (var i = 0; i < message.ignoredResources.length; ++i) - if (!$util.isString(message.ignoredResources[i])) - return "ignoredResources: string[] expected"; - } - if (message.forcedNamespaceAliases != null && message.hasOwnProperty("forcedNamespaceAliases")) { - if (!Array.isArray(message.forcedNamespaceAliases)) - return "forcedNamespaceAliases: array expected"; - for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) - if (!$util.isString(message.forcedNamespaceAliases[i])) - return "forcedNamespaceAliases: string[] expected"; - } - if (message.handwrittenSignatures != null && message.hasOwnProperty("handwrittenSignatures")) { - if (!Array.isArray(message.handwrittenSignatures)) - return "handwrittenSignatures: array expected"; - for (var i = 0; i < message.handwrittenSignatures.length; ++i) - if (!$util.isString(message.handwrittenSignatures[i])) - return "handwrittenSignatures: string[] expected"; - } - 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); - } - if (object.renamedServices) { - if (typeof object.renamedServices !== "object") - throw TypeError(".google.api.DotnetSettings.renamedServices: object expected"); - message.renamedServices = {}; - for (var keys = Object.keys(object.renamedServices), i = 0; i < keys.length; ++i) - message.renamedServices[keys[i]] = String(object.renamedServices[keys[i]]); - } - if (object.renamedResources) { - if (typeof object.renamedResources !== "object") - throw TypeError(".google.api.DotnetSettings.renamedResources: object expected"); - message.renamedResources = {}; - for (var keys = Object.keys(object.renamedResources), i = 0; i < keys.length; ++i) - message.renamedResources[keys[i]] = String(object.renamedResources[keys[i]]); - } - if (object.ignoredResources) { - if (!Array.isArray(object.ignoredResources)) - throw TypeError(".google.api.DotnetSettings.ignoredResources: array expected"); - message.ignoredResources = []; - for (var i = 0; i < object.ignoredResources.length; ++i) - message.ignoredResources[i] = String(object.ignoredResources[i]); - } - if (object.forcedNamespaceAliases) { - if (!Array.isArray(object.forcedNamespaceAliases)) - throw TypeError(".google.api.DotnetSettings.forcedNamespaceAliases: array expected"); - message.forcedNamespaceAliases = []; - for (var i = 0; i < object.forcedNamespaceAliases.length; ++i) - message.forcedNamespaceAliases[i] = String(object.forcedNamespaceAliases[i]); - } - if (object.handwrittenSignatures) { - if (!Array.isArray(object.handwrittenSignatures)) - throw TypeError(".google.api.DotnetSettings.handwrittenSignatures: array expected"); - message.handwrittenSignatures = []; - for (var i = 0; i < object.handwrittenSignatures.length; ++i) - message.handwrittenSignatures[i] = String(object.handwrittenSignatures[i]); - } - 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.arrays || options.defaults) { - object.ignoredResources = []; - object.forcedNamespaceAliases = []; - object.handwrittenSignatures = []; - } - if (options.objects || options.defaults) { - object.renamedServices = {}; - object.renamedResources = {}; - } - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - var keys2; - if (message.renamedServices && (keys2 = Object.keys(message.renamedServices)).length) { - object.renamedServices = {}; - for (var j = 0; j < keys2.length; ++j) - object.renamedServices[keys2[j]] = message.renamedServices[keys2[j]]; - } - if (message.renamedResources && (keys2 = Object.keys(message.renamedResources)).length) { - object.renamedResources = {}; - for (var j = 0; j < keys2.length; ++j) - object.renamedResources[keys2[j]] = message.renamedResources[keys2[j]]; - } - if (message.ignoredResources && message.ignoredResources.length) { - object.ignoredResources = []; - for (var j = 0; j < message.ignoredResources.length; ++j) - object.ignoredResources[j] = message.ignoredResources[j]; - } - if (message.forcedNamespaceAliases && message.forcedNamespaceAliases.length) { - object.forcedNamespaceAliases = []; - for (var j = 0; j < message.forcedNamespaceAliases.length; ++j) - object.forcedNamespaceAliases[j] = message.forcedNamespaceAliases[j]; - } - if (message.handwrittenSignatures && message.handwrittenSignatures.length) { - object.handwrittenSignatures = []; - for (var j = 0; j < message.handwrittenSignatures.length; ++j) - object.handwrittenSignatures[j] = message.handwrittenSignatures[j]; - } - 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 - * @property {Array.|null} [autoPopulatedFields] MethodSettings autoPopulatedFields - */ - - /** - * 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) { - this.autoPopulatedFields = []; - if (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; - - /** - * MethodSettings autoPopulatedFields. - * @member {Array.} autoPopulatedFields - * @memberof google.api.MethodSettings - * @instance - */ - MethodSettings.prototype.autoPopulatedFields = $util.emptyArray; - - /** - * 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(); - if (message.autoPopulatedFields != null && message.autoPopulatedFields.length) - for (var i = 0; i < message.autoPopulatedFields.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.autoPopulatedFields[i]); - 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; - } - case 3: { - if (!(message.autoPopulatedFields && message.autoPopulatedFields.length)) - message.autoPopulatedFields = []; - message.autoPopulatedFields.push(reader.string()); - 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; - } - if (message.autoPopulatedFields != null && message.hasOwnProperty("autoPopulatedFields")) { - if (!Array.isArray(message.autoPopulatedFields)) - return "autoPopulatedFields: array expected"; - for (var i = 0; i < message.autoPopulatedFields.length; ++i) - if (!$util.isString(message.autoPopulatedFields[i])) - return "autoPopulatedFields: string[] expected"; - } - 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); - } - if (object.autoPopulatedFields) { - if (!Array.isArray(object.autoPopulatedFields)) - throw TypeError(".google.api.MethodSettings.autoPopulatedFields: array expected"); - message.autoPopulatedFields = []; - for (var i = 0; i < object.autoPopulatedFields.length; ++i) - message.autoPopulatedFields[i] = String(object.autoPopulatedFields[i]); - } - 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.arrays || options.defaults) - object.autoPopulatedFields = []; - 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); - if (message.autoPopulatedFields && message.autoPopulatedFields.length) { - object.autoPopulatedFields = []; - for (var j = 0; j < message.autoPopulatedFields.length; ++j) - object.autoPopulatedFields[j] = message.autoPopulatedFields[j]; - } - 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 - * @property {number} SHOPPING=5 SHOPPING value - * @property {number} GEO=6 GEO value - * @property {number} GENERATIVE_AI=7 GENERATIVE_AI 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; - values[valuesById[5] = "SHOPPING"] = 5; - values[valuesById[6] = "GEO"] = 6; - values[valuesById[7] = "GENERATIVE_AI"] = 7; - 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; - })(); - - /** - * 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 - * @property {number} IDENTIFIER=8 IDENTIFIER 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; - values[valuesById[8] = "IDENTIFIER"] = 8; - 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; - })(); - - 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; - })(); - - /** - * Edition enum. - * @name google.protobuf.Edition - * @enum {number} - * @property {number} EDITION_UNKNOWN=0 EDITION_UNKNOWN value - * @property {number} EDITION_PROTO2=998 EDITION_PROTO2 value - * @property {number} EDITION_PROTO3=999 EDITION_PROTO3 value - * @property {number} EDITION_2023=1000 EDITION_2023 value - * @property {number} EDITION_2024=1001 EDITION_2024 value - * @property {number} EDITION_1_TEST_ONLY=1 EDITION_1_TEST_ONLY value - * @property {number} EDITION_2_TEST_ONLY=2 EDITION_2_TEST_ONLY value - * @property {number} EDITION_99997_TEST_ONLY=99997 EDITION_99997_TEST_ONLY value - * @property {number} EDITION_99998_TEST_ONLY=99998 EDITION_99998_TEST_ONLY value - * @property {number} EDITION_99999_TEST_ONLY=99999 EDITION_99999_TEST_ONLY value - * @property {number} EDITION_MAX=2147483647 EDITION_MAX value - */ - protobuf.Edition = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "EDITION_UNKNOWN"] = 0; - values[valuesById[998] = "EDITION_PROTO2"] = 998; - values[valuesById[999] = "EDITION_PROTO3"] = 999; - values[valuesById[1000] = "EDITION_2023"] = 1000; - values[valuesById[1001] = "EDITION_2024"] = 1001; - values[valuesById[1] = "EDITION_1_TEST_ONLY"] = 1; - values[valuesById[2] = "EDITION_2_TEST_ONLY"] = 2; - values[valuesById[99997] = "EDITION_99997_TEST_ONLY"] = 99997; - values[valuesById[99998] = "EDITION_99998_TEST_ONLY"] = 99998; - values[valuesById[99999] = "EDITION_99999_TEST_ONLY"] = 99999; - values[valuesById[2147483647] = "EDITION_MAX"] = 2147483647; - return values; - })(); - - 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 {google.protobuf.Edition|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 {google.protobuf.Edition} edition - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.edition = 0; - - /** - * 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 14, wireType 0 =*/112).int32(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 14: { - message.edition = reader.int32(); - 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")) - switch (message.edition) { - default: - return "edition: enum value expected"; - case 0: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - 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); - switch (object.edition) { - default: - if (typeof object.edition === "number") { - message.edition = object.edition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.edition = 0; - break; - case "EDITION_PROTO2": - case 998: - message.edition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.edition = 999; - break; - case "EDITION_2023": - case 1000: - message.edition = 1000; - break; - case "EDITION_2024": - case 1001: - message.edition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.edition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.edition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.edition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.edition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.edition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.edition = 2147483647; - break; - } - 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 = options.enums === String ? "EDITION_UNKNOWN" : 0; - } - 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 = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.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 - * @property {Array.|null} [declaration] ExtensionRangeOptions declaration - * @property {google.protobuf.IFeatureSet|null} [features] ExtensionRangeOptions features - * @property {google.protobuf.ExtensionRangeOptions.VerificationState|null} [verification] ExtensionRangeOptions verification - */ - - /** - * 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 = []; - this.declaration = []; - if (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; - - /** - * ExtensionRangeOptions declaration. - * @member {Array.} declaration - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - */ - ExtensionRangeOptions.prototype.declaration = $util.emptyArray; - - /** - * ExtensionRangeOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - */ - ExtensionRangeOptions.prototype.features = null; - - /** - * ExtensionRangeOptions verification. - * @member {google.protobuf.ExtensionRangeOptions.VerificationState} verification - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - */ - ExtensionRangeOptions.prototype.verification = 1; - - /** - * 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.declaration != null && message.declaration.length) - for (var i = 0; i < message.declaration.length; ++i) - $root.google.protobuf.ExtensionRangeOptions.Declaration.encode(message.declaration[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.verification != null && Object.hasOwnProperty.call(message, "verification")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.verification); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); - 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; - } - case 2: { - if (!(message.declaration && message.declaration.length)) - message.declaration = []; - message.declaration.push($root.google.protobuf.ExtensionRangeOptions.Declaration.decode(reader, reader.uint32())); - break; - } - case 50: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 3: { - message.verification = reader.int32(); - 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; - } - } - if (message.declaration != null && message.hasOwnProperty("declaration")) { - if (!Array.isArray(message.declaration)) - return "declaration: array expected"; - for (var i = 0; i < message.declaration.length; ++i) { - var error = $root.google.protobuf.ExtensionRangeOptions.Declaration.verify(message.declaration[i]); - if (error) - return "declaration." + error; - } - } - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.verification != null && message.hasOwnProperty("verification")) - switch (message.verification) { - default: - return "verification: enum value expected"; - case 0: - case 1: - break; - } - 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]); - } - } - if (object.declaration) { - if (!Array.isArray(object.declaration)) - throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: array expected"); - message.declaration = []; - for (var i = 0; i < object.declaration.length; ++i) { - if (typeof object.declaration[i] !== "object") - throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: object expected"); - message.declaration[i] = $root.google.protobuf.ExtensionRangeOptions.Declaration.fromObject(object.declaration[i]); - } - } - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.ExtensionRangeOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - switch (object.verification) { - case "DECLARATION": - case 0: - message.verification = 0; - break; - default: - if (typeof object.verification === "number") { - message.verification = object.verification; - break; - } - break; - case "UNVERIFIED": - case 1: - message.verification = 1; - break; - } - 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.declaration = []; - object.uninterpretedOption = []; - } - if (options.defaults) { - object.verification = options.enums === String ? "UNVERIFIED" : 1; - object.features = null; - } - if (message.declaration && message.declaration.length) { - object.declaration = []; - for (var j = 0; j < message.declaration.length; ++j) - object.declaration[j] = $root.google.protobuf.ExtensionRangeOptions.Declaration.toObject(message.declaration[j], options); - } - if (message.verification != null && message.hasOwnProperty("verification")) - object.verification = options.enums === String ? $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] === undefined ? message.verification : $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] : message.verification; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - 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"; - }; - - ExtensionRangeOptions.Declaration = (function() { - - /** - * Properties of a Declaration. - * @memberof google.protobuf.ExtensionRangeOptions - * @interface IDeclaration - * @property {number|null} [number] Declaration number - * @property {string|null} [fullName] Declaration fullName - * @property {string|null} [type] Declaration type - * @property {boolean|null} [reserved] Declaration reserved - * @property {boolean|null} [repeated] Declaration repeated - */ - - /** - * Constructs a new Declaration. - * @memberof google.protobuf.ExtensionRangeOptions - * @classdesc Represents a Declaration. - * @implements IDeclaration - * @constructor - * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set - */ - function Declaration(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]]; - } - - /** - * Declaration number. - * @member {number} number - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.number = 0; - - /** - * Declaration fullName. - * @member {string} fullName - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.fullName = ""; - - /** - * Declaration type. - * @member {string} type - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.type = ""; - - /** - * Declaration reserved. - * @member {boolean} reserved - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.reserved = false; - - /** - * Declaration repeated. - * @member {boolean} repeated - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.repeated = false; - - /** - * Creates a new Declaration instance using the specified properties. - * @function create - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set - * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration instance - */ - Declaration.create = function create(properties) { - return new Declaration(properties); - }; - - /** - * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Declaration.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.number != null && Object.hasOwnProperty.call(message, "number")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.number); - if (message.fullName != null && Object.hasOwnProperty.call(message, "fullName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.fullName); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.type); - if (message.reserved != null && Object.hasOwnProperty.call(message, "reserved")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.reserved); - if (message.repeated != null && Object.hasOwnProperty.call(message, "repeated")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.repeated); - return writer; - }; - - /** - * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Declaration.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Declaration message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Declaration.decode = function 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.Declaration(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.number = reader.int32(); - break; - } - case 2: { - message.fullName = reader.string(); - break; - } - case 3: { - message.type = reader.string(); - break; - } - case 5: { - message.reserved = reader.bool(); - break; - } - case 6: { - message.repeated = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Declaration message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Declaration.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Declaration message. - * @function verify - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Declaration.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.number != null && message.hasOwnProperty("number")) - if (!$util.isInteger(message.number)) - return "number: integer expected"; - if (message.fullName != null && message.hasOwnProperty("fullName")) - if (!$util.isString(message.fullName)) - return "fullName: string expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.reserved != null && message.hasOwnProperty("reserved")) - if (typeof message.reserved !== "boolean") - return "reserved: boolean expected"; - if (message.repeated != null && message.hasOwnProperty("repeated")) - if (typeof message.repeated !== "boolean") - return "repeated: boolean expected"; - return null; - }; - - /** - * Creates a Declaration message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration - */ - Declaration.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ExtensionRangeOptions.Declaration) - return object; - var message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); - if (object.number != null) - message.number = object.number | 0; - if (object.fullName != null) - message.fullName = String(object.fullName); - if (object.type != null) - message.type = String(object.type); - if (object.reserved != null) - message.reserved = Boolean(object.reserved); - if (object.repeated != null) - message.repeated = Boolean(object.repeated); - return message; - }; - - /** - * Creates a plain object from a Declaration message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {google.protobuf.ExtensionRangeOptions.Declaration} message Declaration - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Declaration.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.number = 0; - object.fullName = ""; - object.type = ""; - object.reserved = false; - object.repeated = false; - } - if (message.number != null && message.hasOwnProperty("number")) - object.number = message.number; - if (message.fullName != null && message.hasOwnProperty("fullName")) - object.fullName = message.fullName; - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.reserved != null && message.hasOwnProperty("reserved")) - object.reserved = message.reserved; - if (message.repeated != null && message.hasOwnProperty("repeated")) - object.repeated = message.repeated; - return object; - }; - - /** - * Converts this Declaration to JSON. - * @function toJSON - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - * @returns {Object.} JSON object - */ - Declaration.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Declaration - * @function getTypeUrl - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Declaration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions.Declaration"; - }; - - return Declaration; - })(); - - /** - * VerificationState enum. - * @name google.protobuf.ExtensionRangeOptions.VerificationState - * @enum {number} - * @property {number} DECLARATION=0 DECLARATION value - * @property {number} UNVERIFIED=1 UNVERIFIED value - */ - ExtensionRangeOptions.VerificationState = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "DECLARATION"] = 0; - values[valuesById[1] = "UNVERIFIED"] = 1; - return values; - })(); - - 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 3: - case 2: - 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_REPEATED": - case 3: - message.label = 3; - break; - case "LABEL_REQUIRED": - case 2: - message.label = 2; - 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_REPEATED=3 LABEL_REPEATED value - * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value - */ - FieldDescriptorProto.Label = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[1] = "LABEL_OPTIONAL"] = 1; - values[valuesById[3] = "LABEL_REPEATED"] = 3; - values[valuesById[2] = "LABEL_REQUIRED"] = 2; - 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} [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 {google.protobuf.IFeatureSet|null} [features] FileOptions features - * @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 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 features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.features = null; - - /** - * 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.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.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); - 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 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 50: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - 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.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.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - 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.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.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.FileOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - 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.phpMetadataNamespace = ""; - object.rubyPackage = ""; - object.features = null; - } - 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.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) - object.phpMetadataNamespace = message.phpMetadataNamespace; - if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) - object.rubyPackage = message.rubyPackage; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - 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 {google.protobuf.IFeatureSet|null} [features] MessageOptions features - * @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 features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.features = null; - - /** - * 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.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - 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 12: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - 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.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - 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.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.MessageOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - 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.features = null; - 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.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - 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 {Array.|null} [targets] FieldOptions targets - * @property {Array.|null} [editionDefaults] FieldOptions editionDefaults - * @property {google.protobuf.IFeatureSet|null} [features] FieldOptions features - * @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.targets = []; - this.editionDefaults = []; - 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 targets. - * @member {Array.} targets - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.targets = $util.emptyArray; - - /** - * FieldOptions editionDefaults. - * @member {Array.} editionDefaults - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.editionDefaults = $util.emptyArray; - - /** - * FieldOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.features = null; - - /** - * 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.targets != null && message.targets.length) - for (var i = 0; i < message.targets.length; ++i) - writer.uint32(/* id 19, wireType 0 =*/152).int32(message.targets[i]); - if (message.editionDefaults != null && message.editionDefaults.length) - for (var i = 0; i < message.editionDefaults.length; ++i) - $root.google.protobuf.FieldOptions.EditionDefault.encode(message.editionDefaults[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); - 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) - for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) - writer.uint32(/* id 1052, wireType 0 =*/8416).int32(message[".google.api.fieldBehavior"][i]); - 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 19: { - if (!(message.targets && message.targets.length)) - message.targets = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.targets.push(reader.int32()); - } else - message.targets.push(reader.int32()); - break; - } - case 20: { - if (!(message.editionDefaults && message.editionDefaults.length)) - message.editionDefaults = []; - message.editionDefaults.push($root.google.protobuf.FieldOptions.EditionDefault.decode(reader, reader.uint32())); - break; - } - case 21: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - 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.targets != null && message.hasOwnProperty("targets")) { - if (!Array.isArray(message.targets)) - return "targets: array expected"; - for (var i = 0; i < message.targets.length; ++i) - switch (message.targets[i]) { - default: - return "targets: 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.editionDefaults != null && message.hasOwnProperty("editionDefaults")) { - if (!Array.isArray(message.editionDefaults)) - return "editionDefaults: array expected"; - for (var i = 0; i < message.editionDefaults.length; ++i) { - var error = $root.google.protobuf.FieldOptions.EditionDefault.verify(message.editionDefaults[i]); - if (error) - return "editionDefaults." + error; - } - } - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - 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: - case 8: - 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; - } - if (object.targets) { - if (!Array.isArray(object.targets)) - throw TypeError(".google.protobuf.FieldOptions.targets: array expected"); - message.targets = []; - for (var i = 0; i < object.targets.length; ++i) - switch (object.targets[i]) { - default: - if (typeof object.targets[i] === "number") { - message.targets[i] = object.targets[i]; - break; - } - case "TARGET_TYPE_UNKNOWN": - case 0: - message.targets[i] = 0; - break; - case "TARGET_TYPE_FILE": - case 1: - message.targets[i] = 1; - break; - case "TARGET_TYPE_EXTENSION_RANGE": - case 2: - message.targets[i] = 2; - break; - case "TARGET_TYPE_MESSAGE": - case 3: - message.targets[i] = 3; - break; - case "TARGET_TYPE_FIELD": - case 4: - message.targets[i] = 4; - break; - case "TARGET_TYPE_ONEOF": - case 5: - message.targets[i] = 5; - break; - case "TARGET_TYPE_ENUM": - case 6: - message.targets[i] = 6; - break; - case "TARGET_TYPE_ENUM_ENTRY": - case 7: - message.targets[i] = 7; - break; - case "TARGET_TYPE_SERVICE": - case 8: - message.targets[i] = 8; - break; - case "TARGET_TYPE_METHOD": - case 9: - message.targets[i] = 9; - break; - } - } - if (object.editionDefaults) { - if (!Array.isArray(object.editionDefaults)) - throw TypeError(".google.protobuf.FieldOptions.editionDefaults: array expected"); - message.editionDefaults = []; - for (var i = 0; i < object.editionDefaults.length; ++i) { - if (typeof object.editionDefaults[i] !== "object") - throw TypeError(".google.protobuf.FieldOptions.editionDefaults: object expected"); - message.editionDefaults[i] = $root.google.protobuf.FieldOptions.EditionDefault.fromObject(object.editionDefaults[i]); - } - } - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.FieldOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - 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; - case "IDENTIFIER": - case 8: - message[".google.api.fieldBehavior"][i] = 8; - 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.targets = []; - object.editionDefaults = []; - 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.features = null; - 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.targets && message.targets.length) { - object.targets = []; - for (var j = 0; j < message.targets.length; ++j) - object.targets[j] = options.enums === String ? $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] === undefined ? message.targets[j] : $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] : message.targets[j]; - } - if (message.editionDefaults && message.editionDefaults.length) { - object.editionDefaults = []; - for (var j = 0; j < message.editionDefaults.length; ++j) - object.editionDefaults[j] = $root.google.protobuf.FieldOptions.EditionDefault.toObject(message.editionDefaults[j], options); - } - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - 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; - })(); - - FieldOptions.EditionDefault = (function() { - - /** - * Properties of an EditionDefault. - * @memberof google.protobuf.FieldOptions - * @interface IEditionDefault - * @property {google.protobuf.Edition|null} [edition] EditionDefault edition - * @property {string|null} [value] EditionDefault value - */ - - /** - * Constructs a new EditionDefault. - * @memberof google.protobuf.FieldOptions - * @classdesc Represents an EditionDefault. - * @implements IEditionDefault - * @constructor - * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set - */ - function EditionDefault(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]]; - } - - /** - * EditionDefault edition. - * @member {google.protobuf.Edition} edition - * @memberof google.protobuf.FieldOptions.EditionDefault - * @instance - */ - EditionDefault.prototype.edition = 0; - - /** - * EditionDefault value. - * @member {string} value - * @memberof google.protobuf.FieldOptions.EditionDefault - * @instance - */ - EditionDefault.prototype.value = ""; - - /** - * Creates a new EditionDefault instance using the specified properties. - * @function create - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set - * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault instance - */ - EditionDefault.create = function create(properties) { - return new EditionDefault(properties); - }; - - /** - * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EditionDefault.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); - if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); - return writer; - }; - - /** - * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EditionDefault.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EditionDefault message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EditionDefault.decode = function 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.EditionDefault(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 3: { - message.edition = reader.int32(); - break; - } - case 2: { - message.value = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EditionDefault message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EditionDefault.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EditionDefault message. - * @function verify - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EditionDefault.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.edition != null && message.hasOwnProperty("edition")) - switch (message.edition) { - default: - return "edition: enum value expected"; - case 0: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isString(message.value)) - return "value: string expected"; - return null; - }; - - /** - * Creates an EditionDefault message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault - */ - EditionDefault.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldOptions.EditionDefault) - return object; - var message = new $root.google.protobuf.FieldOptions.EditionDefault(); - switch (object.edition) { - default: - if (typeof object.edition === "number") { - message.edition = object.edition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.edition = 0; - break; - case "EDITION_PROTO2": - case 998: - message.edition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.edition = 999; - break; - case "EDITION_2023": - case 1000: - message.edition = 1000; - break; - case "EDITION_2024": - case 1001: - message.edition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.edition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.edition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.edition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.edition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.edition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.edition = 2147483647; - break; - } - if (object.value != null) - message.value = String(object.value); - return message; - }; - - /** - * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {google.protobuf.FieldOptions.EditionDefault} message EditionDefault - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EditionDefault.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.value = ""; - object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; - } - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - if (message.edition != null && message.hasOwnProperty("edition")) - object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; - return object; - }; - - /** - * Converts this EditionDefault to JSON. - * @function toJSON - * @memberof google.protobuf.FieldOptions.EditionDefault - * @instance - * @returns {Object.} JSON object - */ - EditionDefault.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EditionDefault - * @function getTypeUrl - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FieldOptions.EditionDefault"; - }; - - return EditionDefault; - })(); - - return FieldOptions; - })(); - - protobuf.OneofOptions = (function() { - - /** - * Properties of an OneofOptions. - * @memberof google.protobuf - * @interface IOneofOptions - * @property {google.protobuf.IFeatureSet|null} [features] OneofOptions features - * @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 features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.OneofOptions - * @instance - */ - OneofOptions.prototype.features = null; - - /** - * 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.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - 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 1: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - 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.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - 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.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.OneofOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - 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 (options.defaults) - object.features = null; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - 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 {google.protobuf.IFeatureSet|null} [features] EnumOptions features - * @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 features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.features = null; - - /** - * 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.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - 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 7: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - 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.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - 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.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.EnumOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - 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; - object.features = null; - } - 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.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - 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 {google.protobuf.IFeatureSet|null} [features] EnumValueOptions features - * @property {boolean|null} [debugRedact] EnumValueOptions debugRedact - * @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 features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.features = null; - - /** - * EnumValueOptions debugRedact. - * @member {boolean} debugRedact - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.debugRedact = 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.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.debugRedact); - 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 2: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 3: { - message.debugRedact = 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.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) - if (typeof message.debugRedact !== "boolean") - return "debugRedact: 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.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.EnumValueOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.debugRedact != null) - message.debugRedact = Boolean(object.debugRedact); - 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; - object.features = null; - object.debugRedact = false; - } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) - object.debugRedact = message.debugRedact; - 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 {google.protobuf.IFeatureSet|null} [features] ServiceOptions features - * @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 - * @property {string|null} [".google.api.apiVersion"] ServiceOptions .google.api.apiVersion - */ - - /** - * 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 features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype.features = null; - - /** - * 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"] = ""; - - /** - * ServiceOptions .google.api.apiVersion. - * @member {string} .google.api.apiVersion - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype[".google.api.apiVersion"] = ""; - - /** - * 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.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 34, wireType 2 =*/274).fork()).ldelim(); - 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"]); - if (message[".google.api.apiVersion"] != null && Object.hasOwnProperty.call(message, ".google.api.apiVersion")) - writer.uint32(/* id 525000001, wireType 2 =*/4200000010).string(message[".google.api.apiVersion"]); - 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 34: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 33: { - message.deprecated = reader.bool(); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - case 1049: { - message[".google.api.defaultHost"] = reader.string(); - break; - } - case 1050: { - message[".google.api.oauthScopes"] = reader.string(); - break; - } - case 525000001: { - message[".google.api.apiVersion"] = 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.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - 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"; - if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) - if (!$util.isString(message[".google.api.apiVersion"])) - return ".google.api.apiVersion: 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.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.ServiceOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - 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"]); - if (object[".google.api.apiVersion"] != null) - message[".google.api.apiVersion"] = String(object[".google.api.apiVersion"]); - 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.features = null; - object[".google.api.defaultHost"] = ""; - object[".google.api.oauthScopes"] = ""; - object[".google.api.apiVersion"] = ""; - } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - 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"]; - if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) - object[".google.api.apiVersion"] = message[".google.api.apiVersion"]; - 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 {google.protobuf.IFeatureSet|null} [features] MethodOptions features - * @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 features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype.features = null; - - /** - * 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.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 35, wireType 2 =*/282).fork()).ldelim(); - 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 35: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - 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.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - 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.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.MethodOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - 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.features = null; - 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.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - 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.FeatureSet = (function() { - - /** - * Properties of a FeatureSet. - * @memberof google.protobuf - * @interface IFeatureSet - * @property {google.protobuf.FeatureSet.FieldPresence|null} [fieldPresence] FeatureSet fieldPresence - * @property {google.protobuf.FeatureSet.EnumType|null} [enumType] FeatureSet enumType - * @property {google.protobuf.FeatureSet.RepeatedFieldEncoding|null} [repeatedFieldEncoding] FeatureSet repeatedFieldEncoding - * @property {google.protobuf.FeatureSet.Utf8Validation|null} [utf8Validation] FeatureSet utf8Validation - * @property {google.protobuf.FeatureSet.MessageEncoding|null} [messageEncoding] FeatureSet messageEncoding - * @property {google.protobuf.FeatureSet.JsonFormat|null} [jsonFormat] FeatureSet jsonFormat - */ - - /** - * Constructs a new FeatureSet. - * @memberof google.protobuf - * @classdesc Represents a FeatureSet. - * @implements IFeatureSet - * @constructor - * @param {google.protobuf.IFeatureSet=} [properties] Properties to set - */ - function FeatureSet(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]]; - } - - /** - * FeatureSet fieldPresence. - * @member {google.protobuf.FeatureSet.FieldPresence} fieldPresence - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.fieldPresence = 0; - - /** - * FeatureSet enumType. - * @member {google.protobuf.FeatureSet.EnumType} enumType - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.enumType = 0; - - /** - * FeatureSet repeatedFieldEncoding. - * @member {google.protobuf.FeatureSet.RepeatedFieldEncoding} repeatedFieldEncoding - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.repeatedFieldEncoding = 0; - - /** - * FeatureSet utf8Validation. - * @member {google.protobuf.FeatureSet.Utf8Validation} utf8Validation - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.utf8Validation = 0; - - /** - * FeatureSet messageEncoding. - * @member {google.protobuf.FeatureSet.MessageEncoding} messageEncoding - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.messageEncoding = 0; - - /** - * FeatureSet jsonFormat. - * @member {google.protobuf.FeatureSet.JsonFormat} jsonFormat - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.jsonFormat = 0; - - /** - * Creates a new FeatureSet instance using the specified properties. - * @function create - * @memberof google.protobuf.FeatureSet - * @static - * @param {google.protobuf.IFeatureSet=} [properties] Properties to set - * @returns {google.protobuf.FeatureSet} FeatureSet instance - */ - FeatureSet.create = function create(properties) { - return new FeatureSet(properties); - }; - - /** - * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FeatureSet - * @static - * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSet.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.fieldPresence != null && Object.hasOwnProperty.call(message, "fieldPresence")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.fieldPresence); - if (message.enumType != null && Object.hasOwnProperty.call(message, "enumType")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.enumType); - if (message.repeatedFieldEncoding != null && Object.hasOwnProperty.call(message, "repeatedFieldEncoding")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.repeatedFieldEncoding); - if (message.utf8Validation != null && Object.hasOwnProperty.call(message, "utf8Validation")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.utf8Validation); - if (message.messageEncoding != null && Object.hasOwnProperty.call(message, "messageEncoding")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.messageEncoding); - if (message.jsonFormat != null && Object.hasOwnProperty.call(message, "jsonFormat")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jsonFormat); - return writer; - }; - - /** - * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FeatureSet - * @static - * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSet.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FeatureSet message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FeatureSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FeatureSet} FeatureSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSet.decode = function 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.FeatureSet(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.fieldPresence = reader.int32(); - break; - } - case 2: { - message.enumType = reader.int32(); - break; - } - case 3: { - message.repeatedFieldEncoding = reader.int32(); - break; - } - case 4: { - message.utf8Validation = reader.int32(); - break; - } - case 5: { - message.messageEncoding = reader.int32(); - break; - } - case 6: { - message.jsonFormat = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FeatureSet message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FeatureSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FeatureSet} FeatureSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSet.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FeatureSet message. - * @function verify - * @memberof google.protobuf.FeatureSet - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FeatureSet.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) - switch (message.fieldPresence) { - default: - return "fieldPresence: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.enumType != null && message.hasOwnProperty("enumType")) - switch (message.enumType) { - default: - return "enumType: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) - switch (message.repeatedFieldEncoding) { - default: - return "repeatedFieldEncoding: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) - switch (message.utf8Validation) { - default: - return "utf8Validation: enum value expected"; - case 0: - case 2: - case 3: - break; - } - if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) - switch (message.messageEncoding) { - default: - return "messageEncoding: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) - switch (message.jsonFormat) { - default: - return "jsonFormat: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FeatureSet - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FeatureSet} FeatureSet - */ - FeatureSet.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FeatureSet) - return object; - var message = new $root.google.protobuf.FeatureSet(); - switch (object.fieldPresence) { - default: - if (typeof object.fieldPresence === "number") { - message.fieldPresence = object.fieldPresence; - break; - } - break; - case "FIELD_PRESENCE_UNKNOWN": - case 0: - message.fieldPresence = 0; - break; - case "EXPLICIT": - case 1: - message.fieldPresence = 1; - break; - case "IMPLICIT": - case 2: - message.fieldPresence = 2; - break; - case "LEGACY_REQUIRED": - case 3: - message.fieldPresence = 3; - break; - } - switch (object.enumType) { - default: - if (typeof object.enumType === "number") { - message.enumType = object.enumType; - break; - } - break; - case "ENUM_TYPE_UNKNOWN": - case 0: - message.enumType = 0; - break; - case "OPEN": - case 1: - message.enumType = 1; - break; - case "CLOSED": - case 2: - message.enumType = 2; - break; - } - switch (object.repeatedFieldEncoding) { - default: - if (typeof object.repeatedFieldEncoding === "number") { - message.repeatedFieldEncoding = object.repeatedFieldEncoding; - break; - } - break; - case "REPEATED_FIELD_ENCODING_UNKNOWN": - case 0: - message.repeatedFieldEncoding = 0; - break; - case "PACKED": - case 1: - message.repeatedFieldEncoding = 1; - break; - case "EXPANDED": - case 2: - message.repeatedFieldEncoding = 2; - break; - } - switch (object.utf8Validation) { - default: - if (typeof object.utf8Validation === "number") { - message.utf8Validation = object.utf8Validation; - break; - } - break; - case "UTF8_VALIDATION_UNKNOWN": - case 0: - message.utf8Validation = 0; - break; - case "VERIFY": - case 2: - message.utf8Validation = 2; - break; - case "NONE": - case 3: - message.utf8Validation = 3; - break; - } - switch (object.messageEncoding) { - default: - if (typeof object.messageEncoding === "number") { - message.messageEncoding = object.messageEncoding; - break; - } - break; - case "MESSAGE_ENCODING_UNKNOWN": - case 0: - message.messageEncoding = 0; - break; - case "LENGTH_PREFIXED": - case 1: - message.messageEncoding = 1; - break; - case "DELIMITED": - case 2: - message.messageEncoding = 2; - break; - } - switch (object.jsonFormat) { - default: - if (typeof object.jsonFormat === "number") { - message.jsonFormat = object.jsonFormat; - break; - } - break; - case "JSON_FORMAT_UNKNOWN": - case 0: - message.jsonFormat = 0; - break; - case "ALLOW": - case 1: - message.jsonFormat = 1; - break; - case "LEGACY_BEST_EFFORT": - case 2: - message.jsonFormat = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FeatureSet - * @static - * @param {google.protobuf.FeatureSet} message FeatureSet - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FeatureSet.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.fieldPresence = options.enums === String ? "FIELD_PRESENCE_UNKNOWN" : 0; - object.enumType = options.enums === String ? "ENUM_TYPE_UNKNOWN" : 0; - object.repeatedFieldEncoding = options.enums === String ? "REPEATED_FIELD_ENCODING_UNKNOWN" : 0; - object.utf8Validation = options.enums === String ? "UTF8_VALIDATION_UNKNOWN" : 0; - object.messageEncoding = options.enums === String ? "MESSAGE_ENCODING_UNKNOWN" : 0; - object.jsonFormat = options.enums === String ? "JSON_FORMAT_UNKNOWN" : 0; - } - if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) - object.fieldPresence = options.enums === String ? $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] === undefined ? message.fieldPresence : $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] : message.fieldPresence; - if (message.enumType != null && message.hasOwnProperty("enumType")) - object.enumType = options.enums === String ? $root.google.protobuf.FeatureSet.EnumType[message.enumType] === undefined ? message.enumType : $root.google.protobuf.FeatureSet.EnumType[message.enumType] : message.enumType; - if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) - object.repeatedFieldEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] === undefined ? message.repeatedFieldEncoding : $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] : message.repeatedFieldEncoding; - if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) - object.utf8Validation = options.enums === String ? $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] === undefined ? message.utf8Validation : $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] : message.utf8Validation; - if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) - object.messageEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] === undefined ? message.messageEncoding : $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] : message.messageEncoding; - if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) - object.jsonFormat = options.enums === String ? $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] === undefined ? message.jsonFormat : $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] : message.jsonFormat; - return object; - }; - - /** - * Converts this FeatureSet to JSON. - * @function toJSON - * @memberof google.protobuf.FeatureSet - * @instance - * @returns {Object.} JSON object - */ - FeatureSet.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FeatureSet - * @function getTypeUrl - * @memberof google.protobuf.FeatureSet - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FeatureSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FeatureSet"; - }; - - /** - * FieldPresence enum. - * @name google.protobuf.FeatureSet.FieldPresence - * @enum {number} - * @property {number} FIELD_PRESENCE_UNKNOWN=0 FIELD_PRESENCE_UNKNOWN value - * @property {number} EXPLICIT=1 EXPLICIT value - * @property {number} IMPLICIT=2 IMPLICIT value - * @property {number} LEGACY_REQUIRED=3 LEGACY_REQUIRED value - */ - FeatureSet.FieldPresence = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "FIELD_PRESENCE_UNKNOWN"] = 0; - values[valuesById[1] = "EXPLICIT"] = 1; - values[valuesById[2] = "IMPLICIT"] = 2; - values[valuesById[3] = "LEGACY_REQUIRED"] = 3; - return values; - })(); - - /** - * EnumType enum. - * @name google.protobuf.FeatureSet.EnumType - * @enum {number} - * @property {number} ENUM_TYPE_UNKNOWN=0 ENUM_TYPE_UNKNOWN value - * @property {number} OPEN=1 OPEN value - * @property {number} CLOSED=2 CLOSED value - */ - FeatureSet.EnumType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ENUM_TYPE_UNKNOWN"] = 0; - values[valuesById[1] = "OPEN"] = 1; - values[valuesById[2] = "CLOSED"] = 2; - return values; - })(); - - /** - * RepeatedFieldEncoding enum. - * @name google.protobuf.FeatureSet.RepeatedFieldEncoding - * @enum {number} - * @property {number} REPEATED_FIELD_ENCODING_UNKNOWN=0 REPEATED_FIELD_ENCODING_UNKNOWN value - * @property {number} PACKED=1 PACKED value - * @property {number} EXPANDED=2 EXPANDED value - */ - FeatureSet.RepeatedFieldEncoding = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "REPEATED_FIELD_ENCODING_UNKNOWN"] = 0; - values[valuesById[1] = "PACKED"] = 1; - values[valuesById[2] = "EXPANDED"] = 2; - return values; - })(); - - /** - * Utf8Validation enum. - * @name google.protobuf.FeatureSet.Utf8Validation - * @enum {number} - * @property {number} UTF8_VALIDATION_UNKNOWN=0 UTF8_VALIDATION_UNKNOWN value - * @property {number} VERIFY=2 VERIFY value - * @property {number} NONE=3 NONE value - */ - FeatureSet.Utf8Validation = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "UTF8_VALIDATION_UNKNOWN"] = 0; - values[valuesById[2] = "VERIFY"] = 2; - values[valuesById[3] = "NONE"] = 3; - return values; - })(); - - /** - * MessageEncoding enum. - * @name google.protobuf.FeatureSet.MessageEncoding - * @enum {number} - * @property {number} MESSAGE_ENCODING_UNKNOWN=0 MESSAGE_ENCODING_UNKNOWN value - * @property {number} LENGTH_PREFIXED=1 LENGTH_PREFIXED value - * @property {number} DELIMITED=2 DELIMITED value - */ - FeatureSet.MessageEncoding = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "MESSAGE_ENCODING_UNKNOWN"] = 0; - values[valuesById[1] = "LENGTH_PREFIXED"] = 1; - values[valuesById[2] = "DELIMITED"] = 2; - return values; - })(); - - /** - * JsonFormat enum. - * @name google.protobuf.FeatureSet.JsonFormat - * @enum {number} - * @property {number} JSON_FORMAT_UNKNOWN=0 JSON_FORMAT_UNKNOWN value - * @property {number} ALLOW=1 ALLOW value - * @property {number} LEGACY_BEST_EFFORT=2 LEGACY_BEST_EFFORT value - */ - FeatureSet.JsonFormat = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "JSON_FORMAT_UNKNOWN"] = 0; - values[valuesById[1] = "ALLOW"] = 1; - values[valuesById[2] = "LEGACY_BEST_EFFORT"] = 2; - return values; - })(); - - return FeatureSet; - })(); - - protobuf.FeatureSetDefaults = (function() { - - /** - * Properties of a FeatureSetDefaults. - * @memberof google.protobuf - * @interface IFeatureSetDefaults - * @property {Array.|null} [defaults] FeatureSetDefaults defaults - * @property {google.protobuf.Edition|null} [minimumEdition] FeatureSetDefaults minimumEdition - * @property {google.protobuf.Edition|null} [maximumEdition] FeatureSetDefaults maximumEdition - */ - - /** - * Constructs a new FeatureSetDefaults. - * @memberof google.protobuf - * @classdesc Represents a FeatureSetDefaults. - * @implements IFeatureSetDefaults - * @constructor - * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set - */ - function FeatureSetDefaults(properties) { - this.defaults = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FeatureSetDefaults defaults. - * @member {Array.} defaults - * @memberof google.protobuf.FeatureSetDefaults - * @instance - */ - FeatureSetDefaults.prototype.defaults = $util.emptyArray; - - /** - * FeatureSetDefaults minimumEdition. - * @member {google.protobuf.Edition} minimumEdition - * @memberof google.protobuf.FeatureSetDefaults - * @instance - */ - FeatureSetDefaults.prototype.minimumEdition = 0; - - /** - * FeatureSetDefaults maximumEdition. - * @member {google.protobuf.Edition} maximumEdition - * @memberof google.protobuf.FeatureSetDefaults - * @instance - */ - FeatureSetDefaults.prototype.maximumEdition = 0; - - /** - * Creates a new FeatureSetDefaults instance using the specified properties. - * @function create - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set - * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults instance - */ - FeatureSetDefaults.create = function create(properties) { - return new FeatureSetDefaults(properties); - }; - - /** - * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSetDefaults.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.defaults != null && message.defaults.length) - for (var i = 0; i < message.defaults.length; ++i) - $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.encode(message.defaults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.minimumEdition != null && Object.hasOwnProperty.call(message, "minimumEdition")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.minimumEdition); - if (message.maximumEdition != null && Object.hasOwnProperty.call(message, "maximumEdition")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maximumEdition); - return writer; - }; - - /** - * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSetDefaults.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FeatureSetDefaults message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSetDefaults.decode = function 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.FeatureSetDefaults(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.defaults && message.defaults.length)) - message.defaults = []; - message.defaults.push($root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.decode(reader, reader.uint32())); - break; - } - case 4: { - message.minimumEdition = reader.int32(); - break; - } - case 5: { - message.maximumEdition = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSetDefaults.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FeatureSetDefaults message. - * @function verify - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FeatureSetDefaults.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.defaults != null && message.hasOwnProperty("defaults")) { - if (!Array.isArray(message.defaults)) - return "defaults: array expected"; - for (var i = 0; i < message.defaults.length; ++i) { - var error = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify(message.defaults[i]); - if (error) - return "defaults." + error; - } - } - if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) - switch (message.minimumEdition) { - default: - return "minimumEdition: enum value expected"; - case 0: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) - switch (message.maximumEdition) { - default: - return "maximumEdition: enum value expected"; - case 0: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - return null; - }; - - /** - * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults - */ - FeatureSetDefaults.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FeatureSetDefaults) - return object; - var message = new $root.google.protobuf.FeatureSetDefaults(); - if (object.defaults) { - if (!Array.isArray(object.defaults)) - throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: array expected"); - message.defaults = []; - for (var i = 0; i < object.defaults.length; ++i) { - if (typeof object.defaults[i] !== "object") - throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: object expected"); - message.defaults[i] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.fromObject(object.defaults[i]); - } - } - switch (object.minimumEdition) { - default: - if (typeof object.minimumEdition === "number") { - message.minimumEdition = object.minimumEdition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.minimumEdition = 0; - break; - case "EDITION_PROTO2": - case 998: - message.minimumEdition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.minimumEdition = 999; - break; - case "EDITION_2023": - case 1000: - message.minimumEdition = 1000; - break; - case "EDITION_2024": - case 1001: - message.minimumEdition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.minimumEdition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.minimumEdition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.minimumEdition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.minimumEdition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.minimumEdition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.minimumEdition = 2147483647; - break; - } - switch (object.maximumEdition) { - default: - if (typeof object.maximumEdition === "number") { - message.maximumEdition = object.maximumEdition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.maximumEdition = 0; - break; - case "EDITION_PROTO2": - case 998: - message.maximumEdition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.maximumEdition = 999; - break; - case "EDITION_2023": - case 1000: - message.maximumEdition = 1000; - break; - case "EDITION_2024": - case 1001: - message.maximumEdition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.maximumEdition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.maximumEdition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.maximumEdition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.maximumEdition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.maximumEdition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.maximumEdition = 2147483647; - break; - } - return message; - }; - - /** - * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {google.protobuf.FeatureSetDefaults} message FeatureSetDefaults - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FeatureSetDefaults.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.defaults = []; - if (options.defaults) { - object.minimumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; - object.maximumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; - } - if (message.defaults && message.defaults.length) { - object.defaults = []; - for (var j = 0; j < message.defaults.length; ++j) - object.defaults[j] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.toObject(message.defaults[j], options); - } - if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) - object.minimumEdition = options.enums === String ? $root.google.protobuf.Edition[message.minimumEdition] === undefined ? message.minimumEdition : $root.google.protobuf.Edition[message.minimumEdition] : message.minimumEdition; - if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) - object.maximumEdition = options.enums === String ? $root.google.protobuf.Edition[message.maximumEdition] === undefined ? message.maximumEdition : $root.google.protobuf.Edition[message.maximumEdition] : message.maximumEdition; - return object; - }; - - /** - * Converts this FeatureSetDefaults to JSON. - * @function toJSON - * @memberof google.protobuf.FeatureSetDefaults - * @instance - * @returns {Object.} JSON object - */ - FeatureSetDefaults.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FeatureSetDefaults - * @function getTypeUrl - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FeatureSetDefaults.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults"; - }; - - FeatureSetDefaults.FeatureSetEditionDefault = (function() { - - /** - * Properties of a FeatureSetEditionDefault. - * @memberof google.protobuf.FeatureSetDefaults - * @interface IFeatureSetEditionDefault - * @property {google.protobuf.Edition|null} [edition] FeatureSetEditionDefault edition - * @property {google.protobuf.IFeatureSet|null} [features] FeatureSetEditionDefault features - */ - - /** - * Constructs a new FeatureSetEditionDefault. - * @memberof google.protobuf.FeatureSetDefaults - * @classdesc Represents a FeatureSetEditionDefault. - * @implements IFeatureSetEditionDefault - * @constructor - * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set - */ - function FeatureSetEditionDefault(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]]; - } - - /** - * FeatureSetEditionDefault edition. - * @member {google.protobuf.Edition} edition - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @instance - */ - FeatureSetEditionDefault.prototype.edition = 0; - - /** - * FeatureSetEditionDefault features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @instance - */ - FeatureSetEditionDefault.prototype.features = null; - - /** - * Creates a new FeatureSetEditionDefault instance using the specified properties. - * @function create - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set - * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault instance - */ - FeatureSetEditionDefault.create = function create(properties) { - return new FeatureSetEditionDefault(properties); - }; - - /** - * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSetEditionDefault.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); - return writer; - }; - - /** - * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSetEditionDefault.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSetEditionDefault.decode = function 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.FeatureSetDefaults.FeatureSetEditionDefault(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 3: { - message.edition = reader.int32(); - break; - } - case 2: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSetEditionDefault.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FeatureSetEditionDefault message. - * @function verify - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FeatureSetEditionDefault.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.edition != null && message.hasOwnProperty("edition")) - switch (message.edition) { - default: - return "edition: enum value expected"; - case 0: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - return null; - }; - - /** - * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault - */ - FeatureSetEditionDefault.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault) - return object; - var message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); - switch (object.edition) { - default: - if (typeof object.edition === "number") { - message.edition = object.edition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.edition = 0; - break; - case "EDITION_PROTO2": - case 998: - message.edition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.edition = 999; - break; - case "EDITION_2023": - case 1000: - message.edition = 1000; - break; - case "EDITION_2024": - case 1001: - message.edition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.edition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.edition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.edition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.edition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.edition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.edition = 2147483647; - break; - } - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - return message; - }; - - /** - * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} message FeatureSetEditionDefault - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FeatureSetEditionDefault.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.features = null; - object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; - } - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.edition != null && message.hasOwnProperty("edition")) - object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; - return object; - }; - - /** - * Converts this FeatureSetEditionDefault to JSON. - * @function toJSON - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @instance - * @returns {Object.} JSON object - */ - FeatureSetEditionDefault.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FeatureSetEditionDefault - * @function getTypeUrl - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FeatureSetEditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault"; - }; - - return FeatureSetEditionDefault; - })(); - - return FeatureSetDefaults; - })(); - - 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.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.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.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; - })(); - - 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.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; - })(); - - 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/owl-bot-staging/google-cloud-apihub/v1/protos/protos.json b/owl-bot-staging/google-cloud-apihub/v1/protos/protos.json deleted file mode 100644 index eb17125dfb0..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/protos/protos.json +++ /dev/null @@ -1,6321 +0,0 @@ -{ - "nested": { - "google": { - "nested": { - "cloud": { - "nested": { - "apihub": { - "nested": { - "v1": { - "options": { - "csharp_namespace": "Google.Cloud.ApiHub.V1", - "go_package": "cloud.google.com/go/apihub/apiv1/apihubpb;apihubpb", - "java_multiple_files": true, - "java_outer_classname": "RuntimeProjectAttachmentServiceProto", - "java_package": "com.google.cloud.apihub.v1", - "php_namespace": "Google\\Cloud\\ApiHub\\V1", - "ruby_package": "Google::Cloud::ApiHub::V1", - "(google.api.resource_definition).type": "aiplatform.googleapis.com/Extension", - "(google.api.resource_definition).pattern": "projects/{project}/locations/{location}/extensions/{extension}" - }, - "nested": { - "ApiHub": { - "options": { - "(google.api.default_host)": "apihub.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" - }, - "methods": { - "CreateApi": { - "requestType": "CreateApiRequest", - "responseType": "Api", - "options": { - "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/apis", - "(google.api.http).body": "api", - "(google.api.method_signature)": "parent,api,api_id" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{parent=projects/*/locations/*}/apis", - "body": "api" - } - }, - { - "(google.api.method_signature)": "parent,api,api_id" - } - ] - }, - "GetApi": { - "requestType": "GetApiRequest", - "responseType": "Api", - "options": { - "(google.api.http).get": "/v1/{name=projects/*/locations/*/apis/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=projects/*/locations/*/apis/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ListApis": { - "requestType": "ListApisRequest", - "responseType": "ListApisResponse", - "options": { - "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/apis", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{parent=projects/*/locations/*}/apis" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "UpdateApi": { - "requestType": "UpdateApiRequest", - "responseType": "Api", - "options": { - "(google.api.http).patch": "/v1/{api.name=projects/*/locations/*/apis/*}", - "(google.api.http).body": "api", - "(google.api.method_signature)": "api,update_mask" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v1/{api.name=projects/*/locations/*/apis/*}", - "body": "api" - } - }, - { - "(google.api.method_signature)": "api,update_mask" - } - ] - }, - "DeleteApi": { - "requestType": "DeleteApiRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v1/{name=projects/*/locations/*/apis/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1/{name=projects/*/locations/*/apis/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "CreateVersion": { - "requestType": "CreateVersionRequest", - "responseType": "Version", - "options": { - "(google.api.http).post": "/v1/{parent=projects/*/locations/*/apis/*}/versions", - "(google.api.http).body": "version", - "(google.api.method_signature)": "parent,version,version_id" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{parent=projects/*/locations/*/apis/*}/versions", - "body": "version" - } - }, - { - "(google.api.method_signature)": "parent,version,version_id" - } - ] - }, - "GetVersion": { - "requestType": "GetVersionRequest", - "responseType": "Version", - "options": { - "(google.api.http).get": "/v1/{name=projects/*/locations/*/apis/*/versions/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=projects/*/locations/*/apis/*/versions/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ListVersions": { - "requestType": "ListVersionsRequest", - "responseType": "ListVersionsResponse", - "options": { - "(google.api.http).get": "/v1/{parent=projects/*/locations/*/apis/*}/versions", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{parent=projects/*/locations/*/apis/*}/versions" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "UpdateVersion": { - "requestType": "UpdateVersionRequest", - "responseType": "Version", - "options": { - "(google.api.http).patch": "/v1/{version.name=projects/*/locations/*/apis/*/versions/*}", - "(google.api.http).body": "version", - "(google.api.method_signature)": "version,update_mask" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v1/{version.name=projects/*/locations/*/apis/*/versions/*}", - "body": "version" - } - }, - { - "(google.api.method_signature)": "version,update_mask" - } - ] - }, - "DeleteVersion": { - "requestType": "DeleteVersionRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v1/{name=projects/*/locations/*/apis/*/versions/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1/{name=projects/*/locations/*/apis/*/versions/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "CreateSpec": { - "requestType": "CreateSpecRequest", - "responseType": "Spec", - "options": { - "(google.api.http).post": "/v1/{parent=projects/*/locations/*/apis/*/versions/*}/specs", - "(google.api.http).body": "spec", - "(google.api.method_signature)": "parent,spec,spec_id" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{parent=projects/*/locations/*/apis/*/versions/*}/specs", - "body": "spec" - } - }, - { - "(google.api.method_signature)": "parent,spec,spec_id" - } - ] - }, - "GetSpec": { - "requestType": "GetSpecRequest", - "responseType": "Spec", - "options": { - "(google.api.http).get": "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "GetSpecContents": { - "requestType": "GetSpecContentsRequest", - "responseType": "SpecContents", - "options": { - "(google.api.http).get": "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*}:contents", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*}:contents" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ListSpecs": { - "requestType": "ListSpecsRequest", - "responseType": "ListSpecsResponse", - "options": { - "(google.api.http).get": "/v1/{parent=projects/*/locations/*/apis/*/versions/*}/specs", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{parent=projects/*/locations/*/apis/*/versions/*}/specs" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "UpdateSpec": { - "requestType": "UpdateSpecRequest", - "responseType": "Spec", - "options": { - "(google.api.http).patch": "/v1/{spec.name=projects/*/locations/*/apis/*/versions/*/specs/*}", - "(google.api.http).body": "spec", - "(google.api.method_signature)": "spec,update_mask" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v1/{spec.name=projects/*/locations/*/apis/*/versions/*/specs/*}", - "body": "spec" - } - }, - { - "(google.api.method_signature)": "spec,update_mask" - } - ] - }, - "DeleteSpec": { - "requestType": "DeleteSpecRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "GetApiOperation": { - "requestType": "GetApiOperationRequest", - "responseType": "ApiOperation", - "options": { - "(google.api.http).get": "/v1/{name=projects/*/locations/*/apis/*/versions/*/operations/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=projects/*/locations/*/apis/*/versions/*/operations/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ListApiOperations": { - "requestType": "ListApiOperationsRequest", - "responseType": "ListApiOperationsResponse", - "options": { - "(google.api.http).get": "/v1/{parent=projects/*/locations/*/apis/*/versions/*}/operations", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{parent=projects/*/locations/*/apis/*/versions/*}/operations" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "GetDefinition": { - "requestType": "GetDefinitionRequest", - "responseType": "Definition", - "options": { - "(google.api.http).get": "/v1/{name=projects/*/locations/*/apis/*/versions/*/definitions/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=projects/*/locations/*/apis/*/versions/*/definitions/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "CreateDeployment": { - "requestType": "CreateDeploymentRequest", - "responseType": "Deployment", - "options": { - "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/deployments", - "(google.api.http).body": "deployment", - "(google.api.method_signature)": "parent,deployment,deployment_id" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{parent=projects/*/locations/*}/deployments", - "body": "deployment" - } - }, - { - "(google.api.method_signature)": "parent,deployment,deployment_id" - } - ] - }, - "GetDeployment": { - "requestType": "GetDeploymentRequest", - "responseType": "Deployment", - "options": { - "(google.api.http).get": "/v1/{name=projects/*/locations/*/deployments/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=projects/*/locations/*/deployments/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ListDeployments": { - "requestType": "ListDeploymentsRequest", - "responseType": "ListDeploymentsResponse", - "options": { - "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/deployments", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{parent=projects/*/locations/*}/deployments" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "UpdateDeployment": { - "requestType": "UpdateDeploymentRequest", - "responseType": "Deployment", - "options": { - "(google.api.http).patch": "/v1/{deployment.name=projects/*/locations/*/deployments/*}", - "(google.api.http).body": "deployment", - "(google.api.method_signature)": "deployment,update_mask" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v1/{deployment.name=projects/*/locations/*/deployments/*}", - "body": "deployment" - } - }, - { - "(google.api.method_signature)": "deployment,update_mask" - } - ] - }, - "DeleteDeployment": { - "requestType": "DeleteDeploymentRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v1/{name=projects/*/locations/*/deployments/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1/{name=projects/*/locations/*/deployments/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "CreateAttribute": { - "requestType": "CreateAttributeRequest", - "responseType": "Attribute", - "options": { - "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/attributes", - "(google.api.http).body": "attribute", - "(google.api.method_signature)": "parent,attribute,attribute_id" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{parent=projects/*/locations/*}/attributes", - "body": "attribute" - } - }, - { - "(google.api.method_signature)": "parent,attribute,attribute_id" - } - ] - }, - "GetAttribute": { - "requestType": "GetAttributeRequest", - "responseType": "Attribute", - "options": { - "(google.api.http).get": "/v1/{name=projects/*/locations/*/attributes/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=projects/*/locations/*/attributes/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "UpdateAttribute": { - "requestType": "UpdateAttributeRequest", - "responseType": "Attribute", - "options": { - "(google.api.http).patch": "/v1/{attribute.name=projects/*/locations/*/attributes/*}", - "(google.api.http).body": "attribute", - "(google.api.method_signature)": "attribute,update_mask" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v1/{attribute.name=projects/*/locations/*/attributes/*}", - "body": "attribute" - } - }, - { - "(google.api.method_signature)": "attribute,update_mask" - } - ] - }, - "DeleteAttribute": { - "requestType": "DeleteAttributeRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v1/{name=projects/*/locations/*/attributes/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1/{name=projects/*/locations/*/attributes/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ListAttributes": { - "requestType": "ListAttributesRequest", - "responseType": "ListAttributesResponse", - "options": { - "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/attributes", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{parent=projects/*/locations/*}/attributes" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "SearchResources": { - "requestType": "SearchResourcesRequest", - "responseType": "SearchResourcesResponse", - "options": { - "(google.api.http).post": "/v1/{location=projects/*/locations/*}:searchResources", - "(google.api.http).body": "*", - "(google.api.method_signature)": "location,query" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{location=projects/*/locations/*}:searchResources", - "body": "*" - } - }, - { - "(google.api.method_signature)": "location,query" - } - ] - }, - "CreateExternalApi": { - "requestType": "CreateExternalApiRequest", - "responseType": "ExternalApi", - "options": { - "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/externalApis", - "(google.api.http).body": "external_api", - "(google.api.method_signature)": "parent,external_api,external_api_id" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{parent=projects/*/locations/*}/externalApis", - "body": "external_api" - } - }, - { - "(google.api.method_signature)": "parent,external_api,external_api_id" - } - ] - }, - "GetExternalApi": { - "requestType": "GetExternalApiRequest", - "responseType": "ExternalApi", - "options": { - "(google.api.http).get": "/v1/{name=projects/*/locations/*/externalApis/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=projects/*/locations/*/externalApis/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "UpdateExternalApi": { - "requestType": "UpdateExternalApiRequest", - "responseType": "ExternalApi", - "options": { - "(google.api.http).patch": "/v1/{external_api.name=projects/*/locations/*/externalApis/*}", - "(google.api.http).body": "external_api", - "(google.api.method_signature)": "external_api,update_mask" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v1/{external_api.name=projects/*/locations/*/externalApis/*}", - "body": "external_api" - } - }, - { - "(google.api.method_signature)": "external_api,update_mask" - } - ] - }, - "DeleteExternalApi": { - "requestType": "DeleteExternalApiRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v1/{name=projects/*/locations/*/externalApis/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1/{name=projects/*/locations/*/externalApis/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ListExternalApis": { - "requestType": "ListExternalApisRequest", - "responseType": "ListExternalApisResponse", - "options": { - "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/externalApis", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{parent=projects/*/locations/*}/externalApis" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - } - } - }, - "ApiHubDependencies": { - "options": { - "(google.api.default_host)": "apihub.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" - }, - "methods": { - "CreateDependency": { - "requestType": "CreateDependencyRequest", - "responseType": "Dependency", - "options": { - "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/dependencies", - "(google.api.http).body": "dependency", - "(google.api.method_signature)": "parent,dependency,dependency_id" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{parent=projects/*/locations/*}/dependencies", - "body": "dependency" - } - }, - { - "(google.api.method_signature)": "parent,dependency,dependency_id" - } - ] - }, - "GetDependency": { - "requestType": "GetDependencyRequest", - "responseType": "Dependency", - "options": { - "(google.api.http).get": "/v1/{name=projects/*/locations/*/dependencies/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=projects/*/locations/*/dependencies/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "UpdateDependency": { - "requestType": "UpdateDependencyRequest", - "responseType": "Dependency", - "options": { - "(google.api.http).patch": "/v1/{dependency.name=projects/*/locations/*/dependencies/*}", - "(google.api.http).body": "dependency", - "(google.api.method_signature)": "dependency,update_mask" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v1/{dependency.name=projects/*/locations/*/dependencies/*}", - "body": "dependency" - } - }, - { - "(google.api.method_signature)": "dependency,update_mask" - } - ] - }, - "DeleteDependency": { - "requestType": "DeleteDependencyRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v1/{name=projects/*/locations/*/dependencies/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1/{name=projects/*/locations/*/dependencies/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ListDependencies": { - "requestType": "ListDependenciesRequest", - "responseType": "ListDependenciesResponse", - "options": { - "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/dependencies", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{parent=projects/*/locations/*}/dependencies" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - } - } - }, - "CreateApiRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "apihub.googleapis.com/Api" - } - }, - "apiId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "api": { - "type": "Api", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "GetApiRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "apihub.googleapis.com/Api" - } - } - } - }, - "UpdateApiRequest": { - "fields": { - "api": { - "type": "Api", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "DeleteApiRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "apihub.googleapis.com/Api" - } - }, - "force": { - "type": "bool", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListApisRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "apihub.googleapis.com/Api" - } - }, - "filter": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pageSize": { - "type": "int32", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pageToken": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListApisResponse": { - "fields": { - "apis": { - "rule": "repeated", - "type": "Api", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "CreateVersionRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "apihub.googleapis.com/Api" - } - }, - "versionId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "version": { - "type": "Version", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "GetVersionRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "apihub.googleapis.com/Version" - } - } - } - }, - "UpdateVersionRequest": { - "fields": { - "version": { - "type": "Version", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "DeleteVersionRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "apihub.googleapis.com/Version" - } - }, - "force": { - "type": "bool", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListVersionsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "apihub.googleapis.com/Version" - } - }, - "filter": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pageSize": { - "type": "int32", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pageToken": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListVersionsResponse": { - "fields": { - "versions": { - "rule": "repeated", - "type": "Version", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "CreateSpecRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "apihub.googleapis.com/Version" - } - }, - "specId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "spec": { - "type": "Spec", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "GetSpecRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "apihub.googleapis.com/Spec" - } - } - } - }, - "UpdateSpecRequest": { - "fields": { - "spec": { - "type": "Spec", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "DeleteSpecRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "apihub.googleapis.com/Spec" - } - } - } - }, - "ListSpecsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "apihub.googleapis.com/Spec" - } - }, - "filter": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pageSize": { - "type": "int32", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pageToken": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListSpecsResponse": { - "fields": { - "specs": { - "rule": "repeated", - "type": "Spec", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "GetSpecContentsRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "apihub.googleapis.com/Spec" - } - } - } - }, - "GetApiOperationRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "apihub.googleapis.com/ApiOperation" - } - } - } - }, - "ListApiOperationsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "apihub.googleapis.com/ApiOperation" - } - }, - "filter": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pageSize": { - "type": "int32", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pageToken": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListApiOperationsResponse": { - "fields": { - "apiOperations": { - "rule": "repeated", - "type": "ApiOperation", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "GetDefinitionRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "apihub.googleapis.com/Definition" - } - } - } - }, - "CreateDeploymentRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "apihub.googleapis.com/Deployment" - } - }, - "deploymentId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "deployment": { - "type": "Deployment", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "GetDeploymentRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "apihub.googleapis.com/Deployment" - } - } - } - }, - "UpdateDeploymentRequest": { - "fields": { - "deployment": { - "type": "Deployment", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "DeleteDeploymentRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "apihub.googleapis.com/Deployment" - } - } - } - }, - "ListDeploymentsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "apihub.googleapis.com/Deployment" - } - }, - "filter": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pageSize": { - "type": "int32", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pageToken": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListDeploymentsResponse": { - "fields": { - "deployments": { - "rule": "repeated", - "type": "Deployment", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "CreateAttributeRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "apihub.googleapis.com/Attribute" - } - }, - "attributeId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "attribute": { - "type": "Attribute", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "GetAttributeRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "apihub.googleapis.com/Attribute" - } - } - } - }, - "UpdateAttributeRequest": { - "fields": { - "attribute": { - "type": "Attribute", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "DeleteAttributeRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "apihub.googleapis.com/Attribute" - } - } - } - }, - "ListAttributesRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "apihub.googleapis.com/Attribute" - } - }, - "filter": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pageSize": { - "type": "int32", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pageToken": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListAttributesResponse": { - "fields": { - "attributes": { - "rule": "repeated", - "type": "Attribute", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "SearchResourcesRequest": { - "fields": { - "location": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "locations.googleapis.com/Location" - } - }, - "query": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "filter": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pageSize": { - "type": "int32", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pageToken": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ApiHubResource": { - "oneofs": { - "resource": { - "oneof": [ - "api", - "operation", - "deployment", - "spec", - "definition", - "version" - ] - } - }, - "fields": { - "api": { - "type": "Api", - "id": 1 - }, - "operation": { - "type": "ApiOperation", - "id": 2 - }, - "deployment": { - "type": "Deployment", - "id": 3 - }, - "spec": { - "type": "Spec", - "id": 4 - }, - "definition": { - "type": "Definition", - "id": 5 - }, - "version": { - "type": "Version", - "id": 6 - } - } - }, - "SearchResult": { - "fields": { - "resource": { - "type": "ApiHubResource", - "id": 1 - } - } - }, - "SearchResourcesResponse": { - "fields": { - "searchResults": { - "rule": "repeated", - "type": "SearchResult", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "CreateDependencyRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "apihub.googleapis.com/Dependency" - } - }, - "dependencyId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "dependency": { - "type": "Dependency", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "GetDependencyRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "apihub.googleapis.com/Dependency" - } - } - } - }, - "UpdateDependencyRequest": { - "fields": { - "dependency": { - "type": "Dependency", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "DeleteDependencyRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "apihub.googleapis.com/Dependency" - } - } - } - }, - "ListDependenciesRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "apihub.googleapis.com/Dependency" - } - }, - "filter": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pageSize": { - "type": "int32", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pageToken": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListDependenciesResponse": { - "fields": { - "dependencies": { - "rule": "repeated", - "type": "Dependency", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "CreateExternalApiRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "apihub.googleapis.com/ExternalApi" - } - }, - "externalApiId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "externalApi": { - "type": "ExternalApi", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "GetExternalApiRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "apihub.googleapis.com/ExternalApi" - } - } - } - }, - "UpdateExternalApiRequest": { - "fields": { - "externalApi": { - "type": "ExternalApi", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "DeleteExternalApiRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "apihub.googleapis.com/ExternalApi" - } - } - } - }, - "ListExternalApisRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "apihub.googleapis.com/ExternalApi" - } - }, - "pageSize": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pageToken": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListExternalApisResponse": { - "fields": { - "externalApis": { - "rule": "repeated", - "type": "ExternalApi", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "LintState": { - "values": { - "LINT_STATE_UNSPECIFIED": 0, - "LINT_STATE_SUCCESS": 1, - "LINT_STATE_ERROR": 2 - } - }, - "Linter": { - "values": { - "LINTER_UNSPECIFIED": 0, - "SPECTRAL": 1, - "OTHER": 2 - } - }, - "Severity": { - "values": { - "SEVERITY_UNSPECIFIED": 0, - "SEVERITY_ERROR": 1, - "SEVERITY_WARNING": 2, - "SEVERITY_INFO": 3, - "SEVERITY_HINT": 4 - } - }, - "Api": { - "options": { - "(google.api.resource).type": "apihub.googleapis.com/Api", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/apis/{api}", - "(google.api.resource).plural": "apis", - "(google.api.resource).singular": "api" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IDENTIFIER" - } - }, - "displayName": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "description": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "documentation": { - "type": "Documentation", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "owner": { - "type": "Owner", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "versions": { - "rule": "repeated", - "type": "string", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "(google.api.resource_reference).type": "apihub.googleapis.com/Version" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 7, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 8, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "targetUser": { - "type": "AttributeValues", - "id": 9, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "team": { - "type": "AttributeValues", - "id": 10, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "businessUnit": { - "type": "AttributeValues", - "id": 11, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "maturityLevel": { - "type": "AttributeValues", - "id": 12, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "attributes": { - "keyType": "string", - "type": "AttributeValues", - "id": 13, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "apiStyle": { - "type": "AttributeValues", - "id": 14, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "selectedVersion": { - "type": "string", - "id": 15, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "(google.api.resource_reference).type": "apihub.googleapis.com/Version" - } - } - } - }, - "Version": { - "options": { - "(google.api.resource).type": "apihub.googleapis.com/Version", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/apis/{api}/versions/{version}", - "(google.api.resource).plural": "versions", - "(google.api.resource).singular": "version" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IDENTIFIER" - } - }, - "displayName": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "description": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "documentation": { - "type": "Documentation", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "specs": { - "rule": "repeated", - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "(google.api.resource_reference).type": "apihub.googleapis.com/Spec" - } - }, - "apiOperations": { - "rule": "repeated", - "type": "string", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "(google.api.resource_reference).type": "apihub.googleapis.com/ApiOperation" - } - }, - "definitions": { - "rule": "repeated", - "type": "string", - "id": 7, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "(google.api.resource_reference).type": "apihub.googleapis.com/Definition" - } - }, - "deployments": { - "rule": "repeated", - "type": "string", - "id": 8, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "(google.api.resource_reference).type": "apihub.googleapis.com/Deployment" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 9, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 10, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "lifecycle": { - "type": "AttributeValues", - "id": 11, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "compliance": { - "type": "AttributeValues", - "id": 12, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "accreditation": { - "type": "AttributeValues", - "id": 13, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "attributes": { - "keyType": "string", - "type": "AttributeValues", - "id": 14, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "selectedDeployment": { - "type": "string", - "id": 16, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "(google.api.resource_reference).type": "apihub.googleapis.com/Deployment" - } - } - } - }, - "Spec": { - "options": { - "(google.api.resource).type": "apihub.googleapis.com/Spec", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}", - "(google.api.resource).plural": "specs", - "(google.api.resource).singular": "spec" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IDENTIFIER" - } - }, - "displayName": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "specType": { - "type": "AttributeValues", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "contents": { - "type": "SpecContents", - "id": 4, - "options": { - "(google.api.field_behavior)": "INPUT_ONLY" - } - }, - "details": { - "type": "SpecDetails", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "sourceUri": { - "type": "string", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 7, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 8, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "lintResponse": { - "type": "LintResponse", - "id": 9, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "attributes": { - "keyType": "string", - "type": "AttributeValues", - "id": 10, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "documentation": { - "type": "Documentation", - "id": 11, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "parsingMode": { - "type": "ParsingMode", - "id": 12, - "options": { - "(google.api.field_behavior)": "INPUT_ONLY" - } - } - }, - "nested": { - "ParsingMode": { - "values": { - "PARSING_MODE_UNSPECIFIED": 0, - "RELAXED": 1, - "STRICT": 2 - } - } - } - }, - "Deployment": { - "options": { - "(google.api.resource).type": "apihub.googleapis.com/Deployment", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/deployments/{deployment}", - "(google.api.resource).plural": "deployments", - "(google.api.resource).singular": "deployment" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IDENTIFIER" - } - }, - "displayName": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "description": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "documentation": { - "type": "Documentation", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "deploymentType": { - "type": "AttributeValues", - "id": 5, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "resourceUri": { - "type": "string", - "id": 6, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "endpoints": { - "rule": "repeated", - "type": "string", - "id": 7, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "apiVersions": { - "rule": "repeated", - "type": "string", - "id": 8, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 9, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 10, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "slo": { - "type": "AttributeValues", - "id": 11, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "environment": { - "type": "AttributeValues", - "id": 12, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "attributes": { - "keyType": "string", - "type": "AttributeValues", - "id": 13, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ApiOperation": { - "options": { - "(google.api.resource).type": "apihub.googleapis.com/ApiOperation", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}", - "(google.api.resource).plural": "apiOperations", - "(google.api.resource).singular": "apiOperation" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IDENTIFIER" - } - }, - "spec": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "(google.api.resource_reference).type": "apihub.googleapis.com/Spec" - } - }, - "details": { - "type": "OperationDetails", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "attributes": { - "keyType": "string", - "type": "AttributeValues", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "Definition": { - "options": { - "(google.api.resource).type": "apihub.googleapis.com/Definition", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}", - "(google.api.resource).plural": "definitions", - "(google.api.resource).singular": "definition" - }, - "oneofs": { - "value": { - "oneof": [ - "schema" - ] - } - }, - "fields": { - "schema": { - "type": "Schema", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IDENTIFIER" - } - }, - "spec": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "(google.api.resource_reference).type": "apihub.googleapis.com/Spec" - } - }, - "type": { - "type": "Type", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "attributes": { - "keyType": "string", - "type": "AttributeValues", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "Type": { - "values": { - "TYPE_UNSPECIFIED": 0, - "SCHEMA": 1 - } - } - } - }, - "Attribute": { - "options": { - "(google.api.resource).type": "apihub.googleapis.com/Attribute", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/attributes/{attribute}", - "(google.api.resource).plural": "attributes", - "(google.api.resource).singular": "attribute" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IDENTIFIER" - } - }, - "displayName": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "description": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "definitionType": { - "type": "DefinitionType", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "scope": { - "type": "Scope", - "id": 5, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "dataType": { - "type": "DataType", - "id": 6, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "allowedValues": { - "rule": "repeated", - "type": "AllowedValue", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "cardinality": { - "type": "int32", - "id": 8, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "mandatory": { - "type": "bool", - "id": 9, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 10, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 11, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - }, - "nested": { - "AllowedValue": { - "fields": { - "id": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "displayName": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "description": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "immutable": { - "type": "bool", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "DefinitionType": { - "values": { - "DEFINITION_TYPE_UNSPECIFIED": 0, - "SYSTEM_DEFINED": 1, - "USER_DEFINED": 2 - } - }, - "Scope": { - "values": { - "SCOPE_UNSPECIFIED": 0, - "API": 1, - "VERSION": 2, - "SPEC": 3, - "API_OPERATION": 4, - "DEPLOYMENT": 5, - "DEPENDENCY": 6, - "DEFINITION": 7, - "EXTERNAL_API": 8, - "PLUGIN": 9 - } - }, - "DataType": { - "values": { - "DATA_TYPE_UNSPECIFIED": 0, - "ENUM": 1, - "JSON": 2, - "STRING": 3 - } - } - } - }, - "SpecContents": { - "fields": { - "contents": { - "type": "bytes", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "mimeType": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "SpecDetails": { - "oneofs": { - "details": { - "oneof": [ - "openApiSpecDetails" - ] - } - }, - "fields": { - "openApiSpecDetails": { - "type": "OpenApiSpecDetails", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "description": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "OpenApiSpecDetails": { - "fields": { - "format": { - "type": "Format", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "version": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "owner": { - "type": "Owner", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - }, - "nested": { - "Format": { - "values": { - "FORMAT_UNSPECIFIED": 0, - "OPEN_API_SPEC_2_0": 1, - "OPEN_API_SPEC_3_0": 2, - "OPEN_API_SPEC_3_1": 3 - } - } - } - }, - "OperationDetails": { - "oneofs": { - "operation": { - "oneof": [ - "httpOperation" - ] - } - }, - "fields": { - "httpOperation": { - "type": "HttpOperation", - "id": 4 - }, - "description": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "documentation": { - "type": "Documentation", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "deprecated": { - "type": "bool", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "HttpOperation": { - "fields": { - "path": { - "type": "Path", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "method": { - "type": "Method", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - }, - "nested": { - "Method": { - "values": { - "METHOD_UNSPECIFIED": 0, - "GET": 1, - "PUT": 2, - "POST": 3, - "DELETE": 4, - "OPTIONS": 5, - "HEAD": 6, - "PATCH": 7, - "TRACE": 8 - } - } - } - }, - "Path": { - "fields": { - "path": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "description": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "Schema": { - "fields": { - "displayName": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "rawValue": { - "type": "bytes", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "Owner": { - "fields": { - "displayName": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "email": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "Documentation": { - "fields": { - "externalUri": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "AttributeValues": { - "oneofs": { - "Value": { - "oneof": [ - "enumValues", - "stringValues", - "jsonValues" - ] - } - }, - "fields": { - "enumValues": { - "type": "EnumAttributeValues", - "id": 2 - }, - "stringValues": { - "type": "StringAttributeValues", - "id": 3 - }, - "jsonValues": { - "type": "StringAttributeValues", - "id": 4 - }, - "attribute": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "(google.api.resource_reference).type": "apihub.googleapis.com/Attribute" - } - } - }, - "nested": { - "EnumAttributeValues": { - "fields": { - "values": { - "rule": "repeated", - "type": "Attribute.AllowedValue", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "StringAttributeValues": { - "fields": { - "values": { - "rule": "repeated", - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - } - } - }, - "Dependency": { - "options": { - "(google.api.resource).type": "apihub.googleapis.com/Dependency", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/dependencies/{dependency}", - "(google.api.resource).plural": "dependencies", - "(google.api.resource).singular": "dependency" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IDENTIFIER" - } - }, - "consumer": { - "type": "DependencyEntityReference", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "supplier": { - "type": "DependencyEntityReference", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "state": { - "type": "State", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "description": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "discoveryMode": { - "type": "DiscoveryMode", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "errorDetail": { - "type": "DependencyErrorDetail", - "id": 7, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 8, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 9, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "attributes": { - "keyType": "string", - "type": "AttributeValues", - "id": 10, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "PROPOSED": 1, - "VALIDATED": 2 - } - }, - "DiscoveryMode": { - "values": { - "DISCOVERY_MODE_UNSPECIFIED": 0, - "MANUAL": 1 - } - } - } - }, - "DependencyEntityReference": { - "oneofs": { - "identifier": { - "oneof": [ - "operationResourceName", - "externalApiResourceName" - ] - } - }, - "fields": { - "operationResourceName": { - "type": "string", - "id": 2 - }, - "externalApiResourceName": { - "type": "string", - "id": 3 - }, - "displayName": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "DependencyErrorDetail": { - "fields": { - "error": { - "type": "Error", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "errorTime": { - "type": "google.protobuf.Timestamp", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "Error": { - "values": { - "ERROR_UNSPECIFIED": 0, - "SUPPLIER_NOT_FOUND": 1, - "SUPPLIER_RECREATED": 2 - } - } - } - }, - "LintResponse": { - "fields": { - "issues": { - "rule": "repeated", - "type": "Issue", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "summary": { - "rule": "repeated", - "type": "SummaryEntry", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "state": { - "type": "LintState", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "source": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "linter": { - "type": "Linter", - "id": 5, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 6, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - }, - "nested": { - "SummaryEntry": { - "fields": { - "severity": { - "type": "Severity", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "count": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - } - } - }, - "Issue": { - "fields": { - "code": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "path": { - "rule": "repeated", - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "message": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "severity": { - "type": "Severity", - "id": 4, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "range": { - "type": "Range", - "id": 5, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "Range": { - "fields": { - "start": { - "type": "Point", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "end": { - "type": "Point", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "Point": { - "fields": { - "line": { - "type": "int32", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "character": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "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" - } - } - } - }, - "ApiHubInstance": { - "options": { - "(google.api.resource).type": "apihub.googleapis.com/ApiHubInstance", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/apiHubInstances/{api_hub_instance}", - "(google.api.resource).plural": "apiHubInstances", - "(google.api.resource).singular": "apiHubInstance" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IDENTIFIER" - } - }, - "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" - } - }, - "state": { - "type": "State", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "stateMessage": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "config": { - "type": "Config", - "id": 6, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "description": { - "type": "string", - "id": 8, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "Config": { - "fields": { - "cmekKeyName": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "INACTIVE": 1, - "CREATING": 2, - "ACTIVE": 3, - "UPDATING": 4, - "DELETING": 5, - "FAILED": 6 - } - } - } - }, - "ExternalApi": { - "options": { - "(google.api.resource).type": "apihub.googleapis.com/ExternalApi", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/externalApis/{external_api}", - "(google.api.resource).plural": "externalApis", - "(google.api.resource).singular": "externalApi" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IDENTIFIER" - } - }, - "displayName": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "description": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "endpoints": { - "rule": "repeated", - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "paths": { - "rule": "repeated", - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "documentation": { - "type": "Documentation", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "attributes": { - "keyType": "string", - "type": "AttributeValues", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 8, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 9, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "HostProjectRegistrationService": { - "options": { - "(google.api.default_host)": "apihub.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" - }, - "methods": { - "CreateHostProjectRegistration": { - "requestType": "CreateHostProjectRegistrationRequest", - "responseType": "HostProjectRegistration", - "options": { - "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/hostProjectRegistrations", - "(google.api.http).body": "host_project_registration", - "(google.api.method_signature)": "parent,host_project_registration,host_project_registration_id" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{parent=projects/*/locations/*}/hostProjectRegistrations", - "body": "host_project_registration" - } - }, - { - "(google.api.method_signature)": "parent,host_project_registration,host_project_registration_id" - } - ] - }, - "GetHostProjectRegistration": { - "requestType": "GetHostProjectRegistrationRequest", - "responseType": "HostProjectRegistration", - "options": { - "(google.api.http).get": "/v1/{name=projects/*/locations/*/hostProjectRegistrations/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=projects/*/locations/*/hostProjectRegistrations/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ListHostProjectRegistrations": { - "requestType": "ListHostProjectRegistrationsRequest", - "responseType": "ListHostProjectRegistrationsResponse", - "options": { - "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/hostProjectRegistrations", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{parent=projects/*/locations/*}/hostProjectRegistrations" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - } - } - }, - "CreateHostProjectRegistrationRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "apihub.googleapis.com/HostProjectRegistration" - } - }, - "hostProjectRegistrationId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "hostProjectRegistration": { - "type": "HostProjectRegistration", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "GetHostProjectRegistrationRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "apihub.googleapis.com/HostProjectRegistration" - } - } - } - }, - "ListHostProjectRegistrationsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "apihub.googleapis.com/HostProjectRegistration" - } - }, - "pageSize": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pageToken": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "filter": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "orderBy": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListHostProjectRegistrationsResponse": { - "fields": { - "hostProjectRegistrations": { - "rule": "repeated", - "type": "HostProjectRegistration", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "HostProjectRegistration": { - "options": { - "(google.api.resource).type": "apihub.googleapis.com/HostProjectRegistration", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/hostProjectRegistrations/{host_project_registration}", - "(google.api.resource).plural": "hostProjectRegistrations", - "(google.api.resource).singular": "hostProjectRegistration" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IDENTIFIER" - } - }, - "gcpProject": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "IMMUTABLE", - "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "LintingService": { - "options": { - "(google.api.default_host)": "apihub.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" - }, - "methods": { - "GetStyleGuide": { - "requestType": "GetStyleGuideRequest", - "responseType": "StyleGuide", - "options": { - "(google.api.http).get": "/v1/{name=projects/*/locations/*/plugins/*/styleGuide}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=projects/*/locations/*/plugins/*/styleGuide}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "UpdateStyleGuide": { - "requestType": "UpdateStyleGuideRequest", - "responseType": "StyleGuide", - "options": { - "(google.api.http).patch": "/v1/{style_guide.name=projects/*/locations/*/plugins/*/styleGuide}", - "(google.api.http).body": "style_guide", - "(google.api.method_signature)": "style_guide,update_mask" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v1/{style_guide.name=projects/*/locations/*/plugins/*/styleGuide}", - "body": "style_guide" - } - }, - { - "(google.api.method_signature)": "style_guide,update_mask" - } - ] - }, - "GetStyleGuideContents": { - "requestType": "GetStyleGuideContentsRequest", - "responseType": "StyleGuideContents", - "options": { - "(google.api.http).get": "/v1/{name=projects/*/locations/*/plugins/*/styleGuide}:contents", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=projects/*/locations/*/plugins/*/styleGuide}:contents" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "LintSpec": { - "requestType": "LintSpecRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).post": "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*}:lint", - "(google.api.http).body": "*" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*}:lint", - "body": "*" - } - } - ] - } - } - }, - "GetStyleGuideRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "apihub.googleapis.com/StyleGuide" - } - } - } - }, - "UpdateStyleGuideRequest": { - "fields": { - "styleGuide": { - "type": "StyleGuide", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "GetStyleGuideContentsRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "apihub.googleapis.com/StyleGuide" - } - } - } - }, - "LintSpecRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "apihub.googleapis.com/Spec" - } - } - } - }, - "StyleGuideContents": { - "fields": { - "contents": { - "type": "bytes", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "mimeType": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "StyleGuide": { - "options": { - "(google.api.resource).type": "apihub.googleapis.com/StyleGuide", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/plugins/{plugin}/styleGuide", - "(google.api.resource).plural": "styleGuides", - "(google.api.resource).singular": "styleGuide" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IDENTIFIER" - } - }, - "linter": { - "type": "Linter", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "contents": { - "type": "StyleGuideContents", - "id": 3, - "options": { - "(google.api.field_behavior)": "INPUT_ONLY" - } - } - } - }, - "ApiHubPlugin": { - "options": { - "(google.api.default_host)": "apihub.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" - }, - "methods": { - "GetPlugin": { - "requestType": "GetPluginRequest", - "responseType": "Plugin", - "options": { - "(google.api.http).get": "/v1/{name=projects/*/locations/*/plugins/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=projects/*/locations/*/plugins/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "EnablePlugin": { - "requestType": "EnablePluginRequest", - "responseType": "Plugin", - "options": { - "(google.api.http).post": "/v1/{name=projects/*/locations/*/plugins/*}:enable", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{name=projects/*/locations/*/plugins/*}:enable", - "body": "*" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "DisablePlugin": { - "requestType": "DisablePluginRequest", - "responseType": "Plugin", - "options": { - "(google.api.http).post": "/v1/{name=projects/*/locations/*/plugins/*}:disable", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{name=projects/*/locations/*/plugins/*}:disable", - "body": "*" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - } - } - }, - "Plugin": { - "options": { - "(google.api.resource).type": "apihub.googleapis.com/Plugin", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/plugins/{plugin}", - "(google.api.resource).plural": "plugins", - "(google.api.resource).singular": "plugin" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IDENTIFIER" - } - }, - "displayName": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "type": { - "type": "AttributeValues", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "description": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "state": { - "type": "State", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - }, - "nested": { - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "ENABLED": 1, - "DISABLED": 2 - } - } - } - }, - "GetPluginRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "apihub.googleapis.com/Plugin" - } - } - } - }, - "EnablePluginRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "apihub.googleapis.com/Plugin" - } - } - } - }, - "DisablePluginRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "apihub.googleapis.com/Plugin" - } - } - } - }, - "Provisioning": { - "options": { - "(google.api.default_host)": "apihub.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" - }, - "methods": { - "CreateApiHubInstance": { - "requestType": "CreateApiHubInstanceRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/apiHubInstances", - "(google.api.http).body": "api_hub_instance", - "(google.api.method_signature)": "parent,api_hub_instance,api_hub_instance_id", - "(google.longrunning.operation_info).response_type": "ApiHubInstance", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{parent=projects/*/locations/*}/apiHubInstances", - "body": "api_hub_instance" - } - }, - { - "(google.api.method_signature)": "parent,api_hub_instance,api_hub_instance_id" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "ApiHubInstance", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "GetApiHubInstance": { - "requestType": "GetApiHubInstanceRequest", - "responseType": "ApiHubInstance", - "options": { - "(google.api.http).get": "/v1/{name=projects/*/locations/*/apiHubInstances/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=projects/*/locations/*/apiHubInstances/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "LookupApiHubInstance": { - "requestType": "LookupApiHubInstanceRequest", - "responseType": "LookupApiHubInstanceResponse", - "options": { - "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/apiHubInstances:lookup", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{parent=projects/*/locations/*}/apiHubInstances:lookup" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - } - } - }, - "CreateApiHubInstanceRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "locations.googleapis.com/Location" - } - }, - "apiHubInstanceId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "apiHubInstance": { - "type": "ApiHubInstance", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "GetApiHubInstanceRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "apihub.googleapis.com/ApiHubInstance" - } - } - } - }, - "LookupApiHubInstanceRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "apihub.googleapis.com/ApiHubInstance" - } - } - } - }, - "LookupApiHubInstanceResponse": { - "fields": { - "apiHubInstance": { - "type": "ApiHubInstance", - "id": 1 - } - } - }, - "RuntimeProjectAttachmentService": { - "options": { - "(google.api.default_host)": "apihub.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" - }, - "methods": { - "CreateRuntimeProjectAttachment": { - "requestType": "CreateRuntimeProjectAttachmentRequest", - "responseType": "RuntimeProjectAttachment", - "options": { - "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/runtimeProjectAttachments", - "(google.api.http).body": "runtime_project_attachment", - "(google.api.method_signature)": "parent,runtime_project_attachment,runtime_project_attachment_id" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{parent=projects/*/locations/*}/runtimeProjectAttachments", - "body": "runtime_project_attachment" - } - }, - { - "(google.api.method_signature)": "parent,runtime_project_attachment,runtime_project_attachment_id" - } - ] - }, - "GetRuntimeProjectAttachment": { - "requestType": "GetRuntimeProjectAttachmentRequest", - "responseType": "RuntimeProjectAttachment", - "options": { - "(google.api.http).get": "/v1/{name=projects/*/locations/*/runtimeProjectAttachments/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=projects/*/locations/*/runtimeProjectAttachments/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ListRuntimeProjectAttachments": { - "requestType": "ListRuntimeProjectAttachmentsRequest", - "responseType": "ListRuntimeProjectAttachmentsResponse", - "options": { - "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/runtimeProjectAttachments", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{parent=projects/*/locations/*}/runtimeProjectAttachments" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "DeleteRuntimeProjectAttachment": { - "requestType": "DeleteRuntimeProjectAttachmentRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v1/{name=projects/*/locations/*/runtimeProjectAttachments/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1/{name=projects/*/locations/*/runtimeProjectAttachments/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "LookupRuntimeProjectAttachment": { - "requestType": "LookupRuntimeProjectAttachmentRequest", - "responseType": "LookupRuntimeProjectAttachmentResponse", - "options": { - "(google.api.http).get": "/v1/{name=projects/*/locations/*}:lookupRuntimeProjectAttachment", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=projects/*/locations/*}:lookupRuntimeProjectAttachment" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - } - } - }, - "CreateRuntimeProjectAttachmentRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "apihub.googleapis.com/RuntimeProjectAttachment" - } - }, - "runtimeProjectAttachmentId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "runtimeProjectAttachment": { - "type": "RuntimeProjectAttachment", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "GetRuntimeProjectAttachmentRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "apihub.googleapis.com/RuntimeProjectAttachment" - } - } - } - }, - "ListRuntimeProjectAttachmentsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "apihub.googleapis.com/RuntimeProjectAttachment" - } - }, - "pageSize": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pageToken": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "filter": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "orderBy": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListRuntimeProjectAttachmentsResponse": { - "fields": { - "runtimeProjectAttachments": { - "rule": "repeated", - "type": "RuntimeProjectAttachment", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "DeleteRuntimeProjectAttachmentRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "apihub.googleapis.com/RuntimeProjectAttachment" - } - } - } - }, - "LookupRuntimeProjectAttachmentRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "locations.googleapis.com/Location" - } - } - } - }, - "LookupRuntimeProjectAttachmentResponse": { - "fields": { - "runtimeProjectAttachment": { - "type": "RuntimeProjectAttachment", - "id": 1 - } - } - }, - "RuntimeProjectAttachment": { - "options": { - "(google.api.resource).type": "apihub.googleapis.com/RuntimeProjectAttachment", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}", - "(google.api.resource).plural": "runtimeProjectAttachments", - "(google.api.resource).singular": "runtimeProjectAttachment" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IDENTIFIER" - } - }, - "runtimeProject": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "IMMUTABLE", - "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - } - } - } - } - } - } - }, - "api": { - "options": { - "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", - "java_multiple_files": true, - "java_outer_classname": "ResourceProto", - "java_package": "com.google.api", - "objc_class_prefix": "GAPI", - "cc_enable_arenas": true - }, - "nested": { - "http": { - "type": "HttpRule", - "id": 72295728, - "extend": "google.protobuf.MethodOptions" - }, - "Http": { - "fields": { - "rules": { - "rule": "repeated", - "type": "HttpRule", - "id": 1 - }, - "fullyDecodeReservedExpansion": { - "type": "bool", - "id": 2 - } - } - }, - "HttpRule": { - "oneofs": { - "pattern": { - "oneof": [ - "get", - "put", - "post", - "delete", - "patch", - "custom" - ] - } - }, - "fields": { - "selector": { - "type": "string", - "id": 1 - }, - "get": { - "type": "string", - "id": 2 - }, - "put": { - "type": "string", - "id": 3 - }, - "post": { - "type": "string", - "id": 4 - }, - "delete": { - "type": "string", - "id": 5 - }, - "patch": { - "type": "string", - "id": 6 - }, - "custom": { - "type": "CustomHttpPattern", - "id": 8 - }, - "body": { - "type": "string", - "id": 7 - }, - "responseBody": { - "type": "string", - "id": 12 - }, - "additionalBindings": { - "rule": "repeated", - "type": "HttpRule", - "id": 11 - } - } - }, - "CustomHttpPattern": { - "fields": { - "kind": { - "type": "string", - "id": 1 - }, - "path": { - "type": "string", - "id": 2 - } - } - }, - "methodSignature": { - "rule": "repeated", - "type": "string", - "id": 1051, - "extend": "google.protobuf.MethodOptions" - }, - "defaultHost": { - "type": "string", - "id": 1049, - "extend": "google.protobuf.ServiceOptions" - }, - "oauthScopes": { - "type": "string", - "id": 1050, - "extend": "google.protobuf.ServiceOptions" - }, - "apiVersion": { - "type": "string", - "id": 525000001, - "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 - }, - "protoReferenceDocumentationUri": { - "type": "string", - "id": 110 - }, - "restReferenceDocumentationUri": { - "type": "string", - "id": 111 - } - } - }, - "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 - }, - "renamedServices": { - "keyType": "string", - "type": "string", - "id": 2 - }, - "renamedResources": { - "keyType": "string", - "type": "string", - "id": 3 - }, - "ignoredResources": { - "rule": "repeated", - "type": "string", - "id": 4 - }, - "forcedNamespaceAliases": { - "rule": "repeated", - "type": "string", - "id": 5 - }, - "handwrittenSignatures": { - "rule": "repeated", - "type": "string", - "id": 6 - } - } - }, - "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 - }, - "autoPopulatedFields": { - "rule": "repeated", - "type": "string", - "id": 3 - } - }, - "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, - "SHOPPING": 5, - "GEO": 6, - "GENERATIVE_AI": 7 - } - }, - "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 - } - }, - "fieldBehavior": { - "rule": "repeated", - "type": "google.api.FieldBehavior", - "id": 1052, - "extend": "google.protobuf.FieldOptions", - "options": { - "packed": false - } - }, - "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, - "IDENTIFIER": 8 - } - }, - "resourceReference": { - "type": "google.api.ResourceReference", - "id": 1055, - "extend": "google.protobuf.FieldOptions" - }, - "resourceDefinition": { - "rule": "repeated", - "type": "google.api.ResourceDescriptor", - "id": 1053, - "extend": "google.protobuf.FileOptions" - }, - "resource": { - "type": "google.api.ResourceDescriptor", - "id": 1053, - "extend": "google.protobuf.MessageOptions" - }, - "ResourceDescriptor": { - "fields": { - "type": { - "type": "string", - "id": 1 - }, - "pattern": { - "rule": "repeated", - "type": "string", - "id": 2 - }, - "nameField": { - "type": "string", - "id": 3 - }, - "history": { - "type": "History", - "id": 4 - }, - "plural": { - "type": "string", - "id": 5 - }, - "singular": { - "type": "string", - "id": 6 - }, - "style": { - "rule": "repeated", - "type": "Style", - "id": 10 - } - }, - "nested": { - "History": { - "values": { - "HISTORY_UNSPECIFIED": 0, - "ORIGINALLY_SINGLE_PATTERN": 1, - "FUTURE_MULTI_PATTERN": 2 - } - }, - "Style": { - "values": { - "STYLE_UNSPECIFIED": 0, - "DECLARATIVE_FRIENDLY": 1 - } - } - } - }, - "ResourceReference": { - "fields": { - "type": { - "type": "string", - "id": 1 - }, - "childType": { - "type": "string", - "id": 2 - } - } - } - } - }, - "protobuf": { - "options": { - "go_package": "google.golang.org/protobuf/types/descriptorpb", - "java_package": "com.google.protobuf", - "java_outer_classname": "DescriptorProtos", - "csharp_namespace": "Google.Protobuf.Reflection", - "objc_class_prefix": "GPB", - "cc_enable_arenas": true, - "optimize_for": "SPEED" - }, - "nested": { - "FileDescriptorSet": { - "fields": { - "file": { - "rule": "repeated", - "type": "FileDescriptorProto", - "id": 1 - } - } - }, - "Edition": { - "values": { - "EDITION_UNKNOWN": 0, - "EDITION_PROTO2": 998, - "EDITION_PROTO3": 999, - "EDITION_2023": 1000, - "EDITION_2024": 1001, - "EDITION_1_TEST_ONLY": 1, - "EDITION_2_TEST_ONLY": 2, - "EDITION_99997_TEST_ONLY": 99997, - "EDITION_99998_TEST_ONLY": 99998, - "EDITION_99999_TEST_ONLY": 99999, - "EDITION_MAX": 2147483647 - } - }, - "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": "Edition", - "id": 14 - } - } - }, - "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 - }, - "declaration": { - "rule": "repeated", - "type": "Declaration", - "id": 2, - "options": { - "retention": "RETENTION_SOURCE" - } - }, - "features": { - "type": "FeatureSet", - "id": 50 - }, - "verification": { - "type": "VerificationState", - "id": 3, - "options": { - "default": "UNVERIFIED", - "retention": "RETENTION_SOURCE" - } - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "nested": { - "Declaration": { - "fields": { - "number": { - "type": "int32", - "id": 1 - }, - "fullName": { - "type": "string", - "id": 2 - }, - "type": { - "type": "string", - "id": 3 - }, - "reserved": { - "type": "bool", - "id": 5 - }, - "repeated": { - "type": "bool", - "id": 6 - } - }, - "reserved": [ - [ - 4, - 4 - ] - ] - }, - "VerificationState": { - "values": { - "DECLARATION": 0, - "UNVERIFIED": 1 - } - } - } - }, - "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_REPEATED": 3, - "LABEL_REQUIRED": 2 - } - } - } - }, - "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 - } - }, - "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 - }, - "features": { - "type": "FeatureSet", - "id": 50 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "reserved": [ - [ - 42, - 42 - ], - [ - 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 - } - }, - "features": { - "type": "FeatureSet", - "id": 12 - }, - "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 - }, - "targets": { - "rule": "repeated", - "type": "OptionTargetType", - "id": 19, - "options": { - "packed": false - } - }, - "editionDefaults": { - "rule": "repeated", - "type": "EditionDefault", - "id": 20 - }, - "features": { - "type": "FeatureSet", - "id": 21 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "reserved": [ - [ - 4, - 4 - ], - [ - 18, - 18 - ] - ], - "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 - } - }, - "EditionDefault": { - "fields": { - "edition": { - "type": "Edition", - "id": 3 - }, - "value": { - "type": "string", - "id": 2 - } - } - } - } - }, - "OneofOptions": { - "fields": { - "features": { - "type": "FeatureSet", - "id": 1 - }, - "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 - } - }, - "features": { - "type": "FeatureSet", - "id": 7 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "reserved": [ - [ - 5, - 5 - ] - ] - }, - "EnumValueOptions": { - "fields": { - "deprecated": { - "type": "bool", - "id": 1, - "options": { - "default": false - } - }, - "features": { - "type": "FeatureSet", - "id": 2 - }, - "debugRedact": { - "type": "bool", - "id": 3, - "options": { - "default": false - } - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ] - }, - "ServiceOptions": { - "fields": { - "features": { - "type": "FeatureSet", - "id": 34 - }, - "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" - } - }, - "features": { - "type": "FeatureSet", - "id": 35 - }, - "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 - } - } - } - } - }, - "FeatureSet": { - "fields": { - "fieldPresence": { - "type": "FieldPresence", - "id": 1, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_2023", - "edition_defaults.value": "EXPLICIT" - } - }, - "enumType": { - "type": "EnumType", - "id": 2, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO3", - "edition_defaults.value": "OPEN" - } - }, - "repeatedFieldEncoding": { - "type": "RepeatedFieldEncoding", - "id": 3, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO3", - "edition_defaults.value": "PACKED" - } - }, - "utf8Validation": { - "type": "Utf8Validation", - "id": 4, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO3", - "edition_defaults.value": "VERIFY" - } - }, - "messageEncoding": { - "type": "MessageEncoding", - "id": 5, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO2", - "edition_defaults.value": "LENGTH_PREFIXED" - } - }, - "jsonFormat": { - "type": "JsonFormat", - "id": 6, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO3", - "edition_defaults.value": "ALLOW" - } - } - }, - "extensions": [ - [ - 1000, - 1000 - ], - [ - 1001, - 1001 - ], - [ - 1002, - 1002 - ], - [ - 9990, - 9990 - ], - [ - 9995, - 9999 - ], - [ - 10000, - 10000 - ] - ], - "reserved": [ - [ - 999, - 999 - ] - ], - "nested": { - "FieldPresence": { - "values": { - "FIELD_PRESENCE_UNKNOWN": 0, - "EXPLICIT": 1, - "IMPLICIT": 2, - "LEGACY_REQUIRED": 3 - } - }, - "EnumType": { - "values": { - "ENUM_TYPE_UNKNOWN": 0, - "OPEN": 1, - "CLOSED": 2 - } - }, - "RepeatedFieldEncoding": { - "values": { - "REPEATED_FIELD_ENCODING_UNKNOWN": 0, - "PACKED": 1, - "EXPANDED": 2 - } - }, - "Utf8Validation": { - "values": { - "UTF8_VALIDATION_UNKNOWN": 0, - "VERIFY": 2, - "NONE": 3 - } - }, - "MessageEncoding": { - "values": { - "MESSAGE_ENCODING_UNKNOWN": 0, - "LENGTH_PREFIXED": 1, - "DELIMITED": 2 - } - }, - "JsonFormat": { - "values": { - "JSON_FORMAT_UNKNOWN": 0, - "ALLOW": 1, - "LEGACY_BEST_EFFORT": 2 - } - } - } - }, - "FeatureSetDefaults": { - "fields": { - "defaults": { - "rule": "repeated", - "type": "FeatureSetEditionDefault", - "id": 1 - }, - "minimumEdition": { - "type": "Edition", - "id": 4 - }, - "maximumEdition": { - "type": "Edition", - "id": 5 - } - }, - "nested": { - "FeatureSetEditionDefault": { - "fields": { - "edition": { - "type": "Edition", - "id": 3 - }, - "features": { - "type": "FeatureSet", - "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 - } - } - } - } - } - }, - "Duration": { - "fields": { - "seconds": { - "type": "int64", - "id": 1 - }, - "nanos": { - "type": "int32", - "id": 2 - } - } - }, - "Timestamp": { - "fields": { - "seconds": { - "type": "int64", - "id": 1 - }, - "nanos": { - "type": "int32", - "id": 2 - } - } - }, - "Empty": { - "fields": {} - }, - "FieldMask": { - "fields": { - "paths": { - "rule": "repeated", - "type": "string", - "id": 1 - } - } - }, - "Any": { - "fields": { - "type_url": { - "type": "string", - "id": 1 - }, - "value": { - "type": "bytes", - "id": 2 - } - } - } - } - }, - "longrunning": { - "options": { - "cc_enable_arenas": true, - "csharp_namespace": "Google.LongRunning", - "go_package": "cloud.google.com/go/longrunning/autogen/longrunningpb;longrunningpb", - "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/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.create_api.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.create_api.js deleted file mode 100644 index 8d57347c734..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.create_api.js +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2024 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, api) { - // [START apihub_v1_generated_ApiHub_CreateApi_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 parent resource for the API resource. - * Format: `projects/{project}/locations/{location}` - */ - // const parent = 'abc123' - /** - * Optional. The ID to use for the API resource, which will become the final - * component of the API's resource name. This field is optional. - * * If provided, the same will be used. The service will throw an error if - * the specified id is already used by another API resource in the API hub. - * * If not provided, a system generated id will be used. - * This value should be 4-500 characters, and valid characters - * are /[a-z][A-Z][0-9]-_/. - */ - // const apiId = 'abc123' - /** - * Required. The API resource to create. - */ - // const api = {} - - // Imports the Apihub library - const {ApiHubClient} = require('@google-cloud/apihub').v1; - - // Instantiates a client - const apihubClient = new ApiHubClient(); - - async function callCreateApi() { - // Construct request - const request = { - parent, - api, - }; - - // Run request - const response = await apihubClient.createApi(request); - console.log(response); - } - - callCreateApi(); - // [END apihub_v1_generated_ApiHub_CreateApi_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.create_attribute.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.create_attribute.js deleted file mode 100644 index 63be01f4e72..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.create_attribute.js +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright 2024 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, attribute) { - // [START apihub_v1_generated_ApiHub_CreateAttribute_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 parent resource for Attribute. - * Format: `projects/{project}/locations/{location}` - */ - // const parent = 'abc123' - /** - * Optional. The ID to use for the attribute, which will become the final - * component of the attribute's resource name. This field is optional. - * * If provided, the same will be used. The service will throw an error if - * the specified id is already used by another attribute resource in the API - * hub. - * * If not provided, a system generated id will be used. - * This value should be 4-500 characters, and valid characters - * are /[a-z][A-Z][0-9]-_/. - */ - // const attributeId = 'abc123' - /** - * Required. The attribute to create. - */ - // const attribute = {} - - // Imports the Apihub library - const {ApiHubClient} = require('@google-cloud/apihub').v1; - - // Instantiates a client - const apihubClient = new ApiHubClient(); - - async function callCreateAttribute() { - // Construct request - const request = { - parent, - attribute, - }; - - // Run request - const response = await apihubClient.createAttribute(request); - console.log(response); - } - - callCreateAttribute(); - // [END apihub_v1_generated_ApiHub_CreateAttribute_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.create_deployment.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.create_deployment.js deleted file mode 100644 index a9a8f0206fd..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.create_deployment.js +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright 2024 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, deployment) { - // [START apihub_v1_generated_ApiHub_CreateDeployment_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 parent resource for the deployment resource. - * Format: `projects/{project}/locations/{location}` - */ - // const parent = 'abc123' - /** - * Optional. The ID to use for the deployment resource, which will become the - * final component of the deployment's resource name. This field is optional. - * * If provided, the same will be used. The service will throw an error if - * the specified id is already used by another deployment resource in the API - * hub. - * * If not provided, a system generated id will be used. - * This value should be 4-500 characters, and valid characters - * are /[a-z][A-Z][0-9]-_/. - */ - // const deploymentId = 'abc123' - /** - * Required. The deployment resource to create. - */ - // const deployment = {} - - // Imports the Apihub library - const {ApiHubClient} = require('@google-cloud/apihub').v1; - - // Instantiates a client - const apihubClient = new ApiHubClient(); - - async function callCreateDeployment() { - // Construct request - const request = { - parent, - deployment, - }; - - // Run request - const response = await apihubClient.createDeployment(request); - console.log(response); - } - - callCreateDeployment(); - // [END apihub_v1_generated_ApiHub_CreateDeployment_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.create_external_api.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.create_external_api.js deleted file mode 100644 index 5dc983996b8..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.create_external_api.js +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright 2024 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, externalApi) { - // [START apihub_v1_generated_ApiHub_CreateExternalApi_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 parent resource for the External API resource. - * Format: `projects/{project}/locations/{location}` - */ - // const parent = 'abc123' - /** - * Optional. The ID to use for the External API resource, which will become - * the final component of the External API's resource name. This field is - * optional. - * * If provided, the same will be used. The service will throw an error if - * the specified id is already used by another External API resource in the - * API hub. - * * If not provided, a system generated id will be used. - * This value should be 4-500 characters, and valid characters - * are /[a-z][A-Z][0-9]-_/. - */ - // const externalApiId = 'abc123' - /** - * Required. The External API resource to create. - */ - // const externalApi = {} - - // Imports the Apihub library - const {ApiHubClient} = require('@google-cloud/apihub').v1; - - // Instantiates a client - const apihubClient = new ApiHubClient(); - - async function callCreateExternalApi() { - // Construct request - const request = { - parent, - externalApi, - }; - - // Run request - const response = await apihubClient.createExternalApi(request); - console.log(response); - } - - callCreateExternalApi(); - // [END apihub_v1_generated_ApiHub_CreateExternalApi_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.create_spec.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.create_spec.js deleted file mode 100644 index e4df15ade6e..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.create_spec.js +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright 2024 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, spec) { - // [START apihub_v1_generated_ApiHub_CreateSpec_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 parent resource for Spec. - * Format: - * `projects/{project}/locations/{location}/apis/{api}/versions/{version}` - */ - // const parent = 'abc123' - /** - * Optional. The ID to use for the spec, which will become the final component - * of the spec's resource name. This field is optional. - * * If provided, the same will be used. The service will throw an error if - * the specified id is already used by another spec in the API - * resource. - * * If not provided, a system generated id will be used. - * This value should be 4-500 characters, and valid characters - * are /[a-z][A-Z][0-9]-_/. - */ - // const specId = 'abc123' - /** - * Required. The spec to create. - */ - // const spec = {} - - // Imports the Apihub library - const {ApiHubClient} = require('@google-cloud/apihub').v1; - - // Instantiates a client - const apihubClient = new ApiHubClient(); - - async function callCreateSpec() { - // Construct request - const request = { - parent, - spec, - }; - - // Run request - const response = await apihubClient.createSpec(request); - console.log(response); - } - - callCreateSpec(); - // [END apihub_v1_generated_ApiHub_CreateSpec_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.create_version.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.create_version.js deleted file mode 100644 index 6fa6ebd5a01..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.create_version.js +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2024 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, version) { - // [START apihub_v1_generated_ApiHub_CreateVersion_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 parent resource for API version. - * Format: `projects/{project}/locations/{location}/apis/{api}` - */ - // const parent = 'abc123' - /** - * Optional. The ID to use for the API version, which will become the final - * component of the version's resource name. This field is optional. - * * If provided, the same will be used. The service will throw an error if - * the specified id is already used by another version in the API resource. - * * If not provided, a system generated id will be used. - * This value should be 4-500 characters, and valid characters - * are /[a-z][A-Z][0-9]-_/. - */ - // const versionId = 'abc123' - /** - * Required. The version to create. - */ - // const version = {} - - // Imports the Apihub library - const {ApiHubClient} = require('@google-cloud/apihub').v1; - - // Instantiates a client - const apihubClient = new ApiHubClient(); - - async function callCreateVersion() { - // Construct request - const request = { - parent, - version, - }; - - // Run request - const response = await apihubClient.createVersion(request); - console.log(response); - } - - callCreateVersion(); - // [END apihub_v1_generated_ApiHub_CreateVersion_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.delete_api.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.delete_api.js deleted file mode 100644 index ac76db4aeb5..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.delete_api.js +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2024 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 apihub_v1_generated_ApiHub_DeleteApi_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 name of the API resource to delete. - * Format: `projects/{project}/locations/{location}/apis/{api}` - */ - // const name = 'abc123' - /** - * Optional. If set to true, any versions from this API will also be deleted. - * Otherwise, the request will only work if the API has no versions. - */ - // const force = true - - // Imports the Apihub library - const {ApiHubClient} = require('@google-cloud/apihub').v1; - - // Instantiates a client - const apihubClient = new ApiHubClient(); - - async function callDeleteApi() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await apihubClient.deleteApi(request); - console.log(response); - } - - callDeleteApi(); - // [END apihub_v1_generated_ApiHub_DeleteApi_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.delete_attribute.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.delete_attribute.js deleted file mode 100644 index a5986ba91ef..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.delete_attribute.js +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2024 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 apihub_v1_generated_ApiHub_DeleteAttribute_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 name of the attribute to delete. - * Format: - * `projects/{project}/locations/{location}/attributes/{attribute}` - */ - // const name = 'abc123' - - // Imports the Apihub library - const {ApiHubClient} = require('@google-cloud/apihub').v1; - - // Instantiates a client - const apihubClient = new ApiHubClient(); - - async function callDeleteAttribute() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await apihubClient.deleteAttribute(request); - console.log(response); - } - - callDeleteAttribute(); - // [END apihub_v1_generated_ApiHub_DeleteAttribute_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.delete_deployment.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.delete_deployment.js deleted file mode 100644 index 43ef2d12495..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.delete_deployment.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2024 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 apihub_v1_generated_ApiHub_DeleteDeployment_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 name of the deployment resource to delete. - * Format: `projects/{project}/locations/{location}/deployments/{deployment}` - */ - // const name = 'abc123' - - // Imports the Apihub library - const {ApiHubClient} = require('@google-cloud/apihub').v1; - - // Instantiates a client - const apihubClient = new ApiHubClient(); - - async function callDeleteDeployment() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await apihubClient.deleteDeployment(request); - console.log(response); - } - - callDeleteDeployment(); - // [END apihub_v1_generated_ApiHub_DeleteDeployment_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.delete_external_api.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.delete_external_api.js deleted file mode 100644 index 6951b8ea877..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.delete_external_api.js +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2024 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 apihub_v1_generated_ApiHub_DeleteExternalApi_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 name of the External API resource to delete. - * Format: - * `projects/{project}/locations/{location}/externalApis/{externalApi}` - */ - // const name = 'abc123' - - // Imports the Apihub library - const {ApiHubClient} = require('@google-cloud/apihub').v1; - - // Instantiates a client - const apihubClient = new ApiHubClient(); - - async function callDeleteExternalApi() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await apihubClient.deleteExternalApi(request); - console.log(response); - } - - callDeleteExternalApi(); - // [END apihub_v1_generated_ApiHub_DeleteExternalApi_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.delete_spec.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.delete_spec.js deleted file mode 100644 index c3b4b211c32..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.delete_spec.js +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2024 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 apihub_v1_generated_ApiHub_DeleteSpec_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 name of the spec to delete. - * Format: - * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}` - */ - // const name = 'abc123' - - // Imports the Apihub library - const {ApiHubClient} = require('@google-cloud/apihub').v1; - - // Instantiates a client - const apihubClient = new ApiHubClient(); - - async function callDeleteSpec() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await apihubClient.deleteSpec(request); - console.log(response); - } - - callDeleteSpec(); - // [END apihub_v1_generated_ApiHub_DeleteSpec_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.delete_version.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.delete_version.js deleted file mode 100644 index 739fdc5f184..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.delete_version.js +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright 2024 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 apihub_v1_generated_ApiHub_DeleteVersion_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 name of the version to delete. - * Format: - * `projects/{project}/locations/{location}/apis/{api}/versions/{version}` - */ - // const name = 'abc123' - /** - * Optional. If set to true, any specs from this version will also be deleted. - * Otherwise, the request will only work if the version has no specs. - */ - // const force = true - - // Imports the Apihub library - const {ApiHubClient} = require('@google-cloud/apihub').v1; - - // Instantiates a client - const apihubClient = new ApiHubClient(); - - async function callDeleteVersion() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await apihubClient.deleteVersion(request); - console.log(response); - } - - callDeleteVersion(); - // [END apihub_v1_generated_ApiHub_DeleteVersion_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_api.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_api.js deleted file mode 100644 index b081d9156d5..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_api.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2024 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 apihub_v1_generated_ApiHub_GetApi_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 name of the API resource to retrieve. - * Format: `projects/{project}/locations/{location}/apis/{api}` - */ - // const name = 'abc123' - - // Imports the Apihub library - const {ApiHubClient} = require('@google-cloud/apihub').v1; - - // Instantiates a client - const apihubClient = new ApiHubClient(); - - async function callGetApi() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await apihubClient.getApi(request); - console.log(response); - } - - callGetApi(); - // [END apihub_v1_generated_ApiHub_GetApi_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_api_operation.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_api_operation.js deleted file mode 100644 index 19ffe7726e7..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_api_operation.js +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2024 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 apihub_v1_generated_ApiHub_GetApiOperation_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 name of the operation to retrieve. - * Format: - * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}` - */ - // const name = 'abc123' - - // Imports the Apihub library - const {ApiHubClient} = require('@google-cloud/apihub').v1; - - // Instantiates a client - const apihubClient = new ApiHubClient(); - - async function callGetApiOperation() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await apihubClient.getApiOperation(request); - console.log(response); - } - - callGetApiOperation(); - // [END apihub_v1_generated_ApiHub_GetApiOperation_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_attribute.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_attribute.js deleted file mode 100644 index 6bb116e01cf..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_attribute.js +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2024 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 apihub_v1_generated_ApiHub_GetAttribute_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 name of the attribute to retrieve. - * Format: - * `projects/{project}/locations/{location}/attributes/{attribute}` - */ - // const name = 'abc123' - - // Imports the Apihub library - const {ApiHubClient} = require('@google-cloud/apihub').v1; - - // Instantiates a client - const apihubClient = new ApiHubClient(); - - async function callGetAttribute() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await apihubClient.getAttribute(request); - console.log(response); - } - - callGetAttribute(); - // [END apihub_v1_generated_ApiHub_GetAttribute_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_definition.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_definition.js deleted file mode 100644 index 4ee68bb3bc8..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_definition.js +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2024 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 apihub_v1_generated_ApiHub_GetDefinition_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 name of the definition to retrieve. - * Format: - * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}` - */ - // const name = 'abc123' - - // Imports the Apihub library - const {ApiHubClient} = require('@google-cloud/apihub').v1; - - // Instantiates a client - const apihubClient = new ApiHubClient(); - - async function callGetDefinition() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await apihubClient.getDefinition(request); - console.log(response); - } - - callGetDefinition(); - // [END apihub_v1_generated_ApiHub_GetDefinition_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_deployment.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_deployment.js deleted file mode 100644 index ce254e76c5b..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_deployment.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2024 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 apihub_v1_generated_ApiHub_GetDeployment_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 name of the deployment resource to retrieve. - * Format: `projects/{project}/locations/{location}/deployments/{deployment}` - */ - // const name = 'abc123' - - // Imports the Apihub library - const {ApiHubClient} = require('@google-cloud/apihub').v1; - - // Instantiates a client - const apihubClient = new ApiHubClient(); - - async function callGetDeployment() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await apihubClient.getDeployment(request); - console.log(response); - } - - callGetDeployment(); - // [END apihub_v1_generated_ApiHub_GetDeployment_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_external_api.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_external_api.js deleted file mode 100644 index 7d23feb11a7..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_external_api.js +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2024 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 apihub_v1_generated_ApiHub_GetExternalApi_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 name of the External API resource to retrieve. - * Format: - * `projects/{project}/locations/{location}/externalApis/{externalApi}` - */ - // const name = 'abc123' - - // Imports the Apihub library - const {ApiHubClient} = require('@google-cloud/apihub').v1; - - // Instantiates a client - const apihubClient = new ApiHubClient(); - - async function callGetExternalApi() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await apihubClient.getExternalApi(request); - console.log(response); - } - - callGetExternalApi(); - // [END apihub_v1_generated_ApiHub_GetExternalApi_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_spec.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_spec.js deleted file mode 100644 index 03f4c0bb701..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_spec.js +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2024 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 apihub_v1_generated_ApiHub_GetSpec_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 name of the spec to retrieve. - * Format: - * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}` - */ - // const name = 'abc123' - - // Imports the Apihub library - const {ApiHubClient} = require('@google-cloud/apihub').v1; - - // Instantiates a client - const apihubClient = new ApiHubClient(); - - async function callGetSpec() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await apihubClient.getSpec(request); - console.log(response); - } - - callGetSpec(); - // [END apihub_v1_generated_ApiHub_GetSpec_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_spec_contents.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_spec_contents.js deleted file mode 100644 index 865e39c5a2c..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_spec_contents.js +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2024 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 apihub_v1_generated_ApiHub_GetSpecContents_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 name of the spec whose contents need to be retrieved. - * Format: - * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}` - */ - // const name = 'abc123' - - // Imports the Apihub library - const {ApiHubClient} = require('@google-cloud/apihub').v1; - - // Instantiates a client - const apihubClient = new ApiHubClient(); - - async function callGetSpecContents() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await apihubClient.getSpecContents(request); - console.log(response); - } - - callGetSpecContents(); - // [END apihub_v1_generated_ApiHub_GetSpecContents_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_version.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_version.js deleted file mode 100644 index 9bc61d725db..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.get_version.js +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2024 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 apihub_v1_generated_ApiHub_GetVersion_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 name of the API version to retrieve. - * Format: - * `projects/{project}/locations/{location}/apis/{api}/versions/{version}` - */ - // const name = 'abc123' - - // Imports the Apihub library - const {ApiHubClient} = require('@google-cloud/apihub').v1; - - // Instantiates a client - const apihubClient = new ApiHubClient(); - - async function callGetVersion() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await apihubClient.getVersion(request); - console.log(response); - } - - callGetVersion(); - // [END apihub_v1_generated_ApiHub_GetVersion_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.list_api_operations.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.list_api_operations.js deleted file mode 100644 index 2ec1dd7597a..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.list_api_operations.js +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright 2024 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 apihub_v1_generated_ApiHub_ListApiOperations_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 parent which owns this collection of operations i.e., the API - * version. Format: - * `projects/{project}/locations/{location}/apis/{api}/versions/{version}` - */ - // const parent = 'abc123' - /** - * Optional. An expression that filters the list of ApiOperations. - * A filter expression consists of a field name, a comparison - * operator, and a value for filtering. The value must be a string or a - * boolean. The comparison operator must be one of: `<`, `>` or - * `=`. Filters are not case sensitive. - * The following fields in the `ApiOperation` are eligible for filtering: - * * `name` - The ApiOperation resource name. Allowed comparison - * operators: - * `=`. - * * `details.http_operation.path.path` - The http operation's complete path - * relative to server endpoint. Allowed comparison operators: `=`. - * * `details.http_operation.method` - The http operation method type. - * Allowed comparison operators: `=`. - * * `details.deprecated` - Indicates if the ApiOperation is deprecated. - * Allowed values are True / False indicating the deprycation status of the - * ApiOperation. Allowed comparison operators: `=`. - * * `create_time` - The time at which the ApiOperation was created. The - * value should be in the (RFC3339)https://tools.ietf.org/html/rfc3339 - * format. Allowed comparison operators: `>` and `<`. - * Expressions are combined with either `AND` logic operator or `OR` logical - * operator but not both of them together i.e. only one of the `AND` or `OR` - * operator can be used throughout the filter string and both the operators - * cannot be used together. No other logical operators are supported. At most - * three filter fields are allowed in the filter string and if provided - * more than that then `INVALID_ARGUMENT` error is returned by the API. - * Here are a few examples: - * * `details.deprecated = True` - The ApiOperation is deprecated. - * * `details.http_operation.method = GET AND create_time < - * \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - - * The method of the http operation of the ApiOperation is _GET_ and the - * spec was created before _2021-08-15 14:50:00 UTC_ and after _2021-08-10 - * 12:00:00 UTC_. - * * `details.http_operation.method = GET OR details.http_operation.method = - * POST`. - The http operation of the method of ApiOperation is _GET_ or - * _POST_. - */ - // const filter = 'abc123' - /** - * Optional. The maximum number of operations to return. The service may - * return fewer than this value. If unspecified, at most 50 operations will be - * returned. The maximum value is 1000; values above 1000 will be coerced to - * 1000. - */ - // const pageSize = 1234 - /** - * Optional. A page token, received from a previous `ListApiOperations` call. - * Provide this to retrieve the subsequent page. - * When paginating, all other parameters (except page_size) provided to - * `ListApiOperations` must match the call that provided the page token. - */ - // const pageToken = 'abc123' - - // Imports the Apihub library - const {ApiHubClient} = require('@google-cloud/apihub').v1; - - // Instantiates a client - const apihubClient = new ApiHubClient(); - - async function callListApiOperations() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = apihubClient.listApiOperationsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListApiOperations(); - // [END apihub_v1_generated_ApiHub_ListApiOperations_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.list_apis.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.list_apis.js deleted file mode 100644 index 30285b75116..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.list_apis.js +++ /dev/null @@ -1,146 +0,0 @@ -// Copyright 2024 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 apihub_v1_generated_ApiHub_ListApis_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 parent, which owns this collection of API resources. - * Format: `projects/{project}/locations/{location}` - */ - // const parent = 'abc123' - /** - * Optional. An expression that filters the list of ApiResources. - * A filter expression consists of a field name, a comparison - * operator, and a value for filtering. The value must be a string. The - * comparison operator must be one of: `<`, `>`, `:` or `=`. Filters are not - * case sensitive. - * The following fields in the `ApiResource` are eligible for filtering: - * * `owner.email` - The email of the team which owns the ApiResource. - * Allowed comparison operators: `=`. - * * `create_time` - The time at which the ApiResource was created. The - * value should be in the (RFC3339)https://tools.ietf.org/html/rfc3339 - * format. Allowed comparison operators: `>` and `<`. - * * `display_name` - The display name of the ApiResource. Allowed - * comparison operators: `=`. - * * `target_user.enum_values.values.id` - The allowed value id of the - * target users attribute associated with the ApiResource. Allowed - * comparison operator is `:`. - * * `target_user.enum_values.values.display_name` - The allowed value - * display name of the target users attribute associated with the - * ApiResource. Allowed comparison operator is `:`. - * * `team.enum_values.values.id` - The allowed value id of the team - * attribute associated with the ApiResource. Allowed comparison operator is - * `:`. - * * `team.enum_values.values.display_name` - The allowed value display name - * of the team attribute associated with the ApiResource. Allowed comparison - * operator is `:`. - * * `business_unit.enum_values.values.id` - The allowed value id of the - * business unit attribute associated with the ApiResource. Allowed - * comparison operator is `:`. - * * `business_unit.enum_values.values.display_name` - The allowed value - * display name of the business unit attribute associated with the - * ApiResource. Allowed comparison operator is `:`. - * * `maturity_level.enum_values.values.id` - The allowed value id of the - * maturity level attribute associated with the ApiResource. Allowed - * comparison operator is `:`. - * * `maturity_level.enum_values.values.display_name` - The allowed value - * display name of the maturity level attribute associated with the - * ApiResource. Allowed comparison operator is `:`. - * * `api_style.enum_values.values.id` - The allowed value id of the - * api style attribute associated with the ApiResource. Allowed - * comparison operator is `:`. - * * `api_style.enum_values.values.display_name` - The allowed value display - * name of the api style attribute associated with the ApiResource. Allowed - * comparison operator is `:`. - * Expressions are combined with either `AND` logic operator or `OR` logical - * operator but not both of them together i.e. only one of the `AND` or `OR` - * operator can be used throughout the filter string and both the operators - * cannot be used together. No other logical operators are supported. At most - * three filter fields are allowed in the filter string and if provided - * more than that then `INVALID_ARGUMENT` error is returned by the API. - * Here are a few examples: - * * `owner.email = \"apihub@google.com\"` - - The owner team email is - * _apihub@google.com_. - * * `owner.email = \"apihub@google.com\" AND create_time < - * \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - - * The owner team email is _apihub@google.com_ and the api was created - * before _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_. - * * `owner.email = \"apihub@google.com\" OR team.enum_values.values.id: - * apihub-team-id` - The filter string specifies the APIs where the owner - * team email is _apihub@google.com_ or the id of the allowed value - * associated with the team attribute is _apihub-team-id_. - * * `owner.email = \"apihub@google.com\" OR - * team.enum_values.values.display_name: ApiHub Team` - The filter string - * specifies the APIs where the owner team email is _apihub@google.com_ or - * the display name of the allowed value associated with the team attribute - * is `ApiHub Team`. - */ - // const filter = 'abc123' - /** - * Optional. The maximum number of API resources to return. The service may - * return fewer than this value. If unspecified, at most 50 Apis will be - * returned. The maximum value is 1000; values above 1000 will be coerced to - * 1000. - */ - // const pageSize = 1234 - /** - * Optional. A page token, received from a previous `ListApis` call. - * Provide this to retrieve the subsequent page. - * When paginating, all other parameters (except page_size) provided to - * `ListApis` must match the call that provided the page token. - */ - // const pageToken = 'abc123' - - // Imports the Apihub library - const {ApiHubClient} = require('@google-cloud/apihub').v1; - - // Instantiates a client - const apihubClient = new ApiHubClient(); - - async function callListApis() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = apihubClient.listApisAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListApis(); - // [END apihub_v1_generated_ApiHub_ListApis_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.list_attributes.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.list_attributes.js deleted file mode 100644 index cb24939e9dd..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.list_attributes.js +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright 2024 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 apihub_v1_generated_ApiHub_ListAttributes_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 parent resource for Attribute. - * Format: `projects/{project}/locations/{location}` - */ - // const parent = 'abc123' - /** - * Optional. An expression that filters the list of Attributes. - * A filter expression consists of a field name, a comparison - * operator, and a value for filtering. The value must be a string or a - * boolean. The comparison operator must be one of: `<`, `>` or - * `=`. Filters are not case sensitive. - * The following fields in the `Attribute` are eligible for filtering: - * * `display_name` - The display name of the Attribute. Allowed - * comparison operators: `=`. - * * `definition_type` - The definition type of the attribute. Allowed - * comparison operators: `=`. - * * `scope` - The scope of the attribute. Allowed comparison operators: - * `=`. - * * `data_type` - The type of the data of the attribute. Allowed - * comparison operators: `=`. - * * `mandatory` - Denotes whether the attribute is mandatory or not. - * Allowed comparison operators: `=`. - * * `create_time` - The time at which the Attribute was created. The - * value should be in the (RFC3339)https://tools.ietf.org/html/rfc3339 - * format. Allowed comparison operators: `>` and `<`. - * Expressions are combined with either `AND` logic operator or `OR` logical - * operator but not both of them together i.e. only one of the `AND` or `OR` - * operator can be used throughout the filter string and both the operators - * cannot be used together. No other logical operators are - * supported. At most three filter fields are allowed in the filter - * string and if provided more than that then `INVALID_ARGUMENT` error is - * returned by the API. - * Here are a few examples: - * * `display_name = production` - - The display name of the attribute is - * _production_. - * * `(display_name = production) AND (create_time < - * \"2021-08-15T14:50:00Z\") AND (create_time > \"2021-08-10T12:00:00Z\")` - - * The display name of the attribute is _production_ and the attribute was - * created before _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00 - * UTC_. - * * `display_name = production OR scope = api` - - * The attribute where the display name is _production_ or the scope is - * _api_. - */ - // const filter = 'abc123' - /** - * Optional. The maximum number of attribute resources to return. The service - * may return fewer than this value. If unspecified, at most 50 attributes - * will be returned. The maximum value is 1000; values above 1000 will be - * coerced to 1000. - */ - // const pageSize = 1234 - /** - * Optional. A page token, received from a previous `ListAttributes` call. - * Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to `ListAttributes` must - * match the call that provided the page token. - */ - // const pageToken = 'abc123' - - // Imports the Apihub library - const {ApiHubClient} = require('@google-cloud/apihub').v1; - - // Instantiates a client - const apihubClient = new ApiHubClient(); - - async function callListAttributes() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = apihubClient.listAttributesAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListAttributes(); - // [END apihub_v1_generated_ApiHub_ListAttributes_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.list_deployments.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.list_deployments.js deleted file mode 100644 index ff07c1a2522..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.list_deployments.js +++ /dev/null @@ -1,133 +0,0 @@ -// Copyright 2024 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 apihub_v1_generated_ApiHub_ListDeployments_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 parent, which owns this collection of deployment resources. - * Format: `projects/{project}/locations/{location}` - */ - // const parent = 'abc123' - /** - * Optional. An expression that filters the list of Deployments. - * A filter expression consists of a field name, a comparison - * operator, and a value for filtering. The value must be a string. The - * comparison operator must be one of: `<`, `>` or - * `=`. Filters are not case sensitive. - * The following fields in the `Deployments` are eligible for filtering: - * * `display_name` - The display name of the Deployment. Allowed - * comparison operators: `=`. - * * `create_time` - The time at which the Deployment was created. The - * value should be in the (RFC3339)https://tools.ietf.org/html/rfc3339 - * format. Allowed comparison operators: `>` and `<`. - * * `resource_uri` - A URI to the deployment resource. Allowed - * comparison operators: `=`. - * * `api_versions` - The API versions linked to this deployment. Allowed - * comparison operators: `:`. - * * `deployment_type.enum_values.values.id` - The allowed value id of the - * deployment_type attribute associated with the Deployment. Allowed - * comparison operators: `:`. - * * `deployment_type.enum_values.values.display_name` - The allowed value - * display name of the deployment_type attribute associated with the - * Deployment. Allowed comparison operators: `:`. - * * `slo.string_values.values` -The allowed string value of the slo - * attribute associated with the deployment. Allowed comparison - * operators: `:`. - * * `environment.enum_values.values.id` - The allowed value id of the - * environment attribute associated with the deployment. Allowed - * comparison operators: `:`. - * * `environment.enum_values.values.display_name` - The allowed value - * display name of the environment attribute associated with the deployment. - * Allowed comparison operators: `:`. - * Expressions are combined with either `AND` logic operator or `OR` logical - * operator but not both of them together i.e. only one of the `AND` or `OR` - * operator can be used throughout the filter string and both the operators - * cannot be used together. No other logical operators are supported. At most - * three filter fields are allowed in the filter string and if provided - * more than that then `INVALID_ARGUMENT` error is returned by the API. - * Here are a few examples: - * * `environment.enum_values.values.id: staging-id` - The allowed value id - * of the environment attribute associated with the Deployment is - * _staging-id_. - * * `environment.enum_values.values.display_name: \"Staging Deployment\"` - - * The allowed value display name of the environment attribute associated - * with the Deployment is `Staging Deployment`. - * * `environment.enum_values.values.id: production-id AND create_time < - * \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - - * The allowed value id of the environment attribute associated with the - * Deployment is _production-id_ and Deployment was created before - * _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_. - * * `environment.enum_values.values.id: production-id OR - * slo.string_values.values: \"99.99%\"` - * - The allowed value id of the environment attribute Deployment is - * _production-id_ or string value of the slo attribute is _99.99%_. - */ - // const filter = 'abc123' - /** - * Optional. The maximum number of deployment resources to return. The service - * may return fewer than this value. If unspecified, at most 50 deployments - * will be returned. The maximum value is 1000; values above 1000 will be - * coerced to 1000. - */ - // const pageSize = 1234 - /** - * Optional. A page token, received from a previous `ListDeployments` call. - * Provide this to retrieve the subsequent page. - * When paginating, all other parameters (except page_size) provided to - * `ListDeployments` must match the call that provided the page token. - */ - // const pageToken = 'abc123' - - // Imports the Apihub library - const {ApiHubClient} = require('@google-cloud/apihub').v1; - - // Instantiates a client - const apihubClient = new ApiHubClient(); - - async function callListDeployments() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = apihubClient.listDeploymentsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListDeployments(); - // [END apihub_v1_generated_ApiHub_ListDeployments_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.list_external_apis.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.list_external_apis.js deleted file mode 100644 index 1b74031251b..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.list_external_apis.js +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright 2024 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 apihub_v1_generated_ApiHub_ListExternalApis_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 parent, which owns this collection of External API resources. - * Format: `projects/{project}/locations/{location}` - */ - // const parent = 'abc123' - /** - * Optional. The maximum number of External API resources to return. The - * service may return fewer than this value. If unspecified, at most 50 - * ExternalApis will be returned. The maximum value is 1000; values above 1000 - * will be coerced to 1000. - */ - // const pageSize = 1234 - /** - * Optional. A page token, received from a previous `ListExternalApis` call. - * Provide this to retrieve the subsequent page. - * When paginating, all other parameters (except page_size) provided to - * `ListExternalApis` must match the call that provided the page token. - */ - // const pageToken = 'abc123' - - // Imports the Apihub library - const {ApiHubClient} = require('@google-cloud/apihub').v1; - - // Instantiates a client - const apihubClient = new ApiHubClient(); - - async function callListExternalApis() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = apihubClient.listExternalApisAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListExternalApis(); - // [END apihub_v1_generated_ApiHub_ListExternalApis_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.list_specs.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.list_specs.js deleted file mode 100644 index 4c61c8a0f80..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.list_specs.js +++ /dev/null @@ -1,127 +0,0 @@ -// Copyright 2024 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 apihub_v1_generated_ApiHub_ListSpecs_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 parent, which owns this collection of specs. - * Format: - * `projects/{project}/locations/{location}/apis/{api}/versions/{version}` - */ - // const parent = 'abc123' - /** - * Optional. An expression that filters the list of Specs. - * A filter expression consists of a field name, a comparison - * operator, and a value for filtering. The value must be a string. The - * comparison operator must be one of: `<`, `>`, `:` or `=`. Filters are not - * case sensitive. - * The following fields in the `Spec` are eligible for filtering: - * * `display_name` - The display name of the Spec. Allowed comparison - * operators: `=`. - * * `create_time` - The time at which the Spec was created. The - * value should be in the (RFC3339)https://tools.ietf.org/html/rfc3339 - * format. Allowed comparison operators: `>` and `<`. - * * `spec_type.enum_values.values.id` - The allowed value id of the - * spec_type attribute associated with the Spec. Allowed comparison - * operators: `:`. - * * `spec_type.enum_values.values.display_name` - The allowed value display - * name of the spec_type attribute associated with the Spec. Allowed - * comparison operators: `:`. - * * `lint_response.json_values.values` - The json value of the - * lint_response attribute associated with the Spec. Allowed comparison - * operators: `:`. - * * `mime_type` - The MIME type of the Spec. Allowed comparison - * operators: `=`. - * Expressions are combined with either `AND` logic operator or `OR` logical - * operator but not both of them together i.e. only one of the `AND` or `OR` - * operator can be used throughout the filter string and both the operators - * cannot be used together. No other logical operators are - * supported. At most three filter fields are allowed in the filter - * string and if provided more than that then `INVALID_ARGUMENT` error is - * returned by the API. - * Here are a few examples: - * * `spec_type.enum_values.values.id: rest-id` - The filter - * string specifies that the id of the allowed value associated with the - * spec_type attribute is _rest-id_. - * * `spec_type.enum_values.values.display_name: \"Rest Display Name\"` - - * The filter string specifies that the display name of the allowed value - * associated with the spec_type attribute is `Rest Display Name`. - * * `spec_type.enum_values.values.id: grpc-id AND create_time < - * \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - - * The id of the allowed value associated with the spec_type attribute is - * _grpc-id_ and the spec was created before _2021-08-15 14:50:00 UTC_ and - * after _2021-08-10 12:00:00 UTC_. - * * `spec_type.enum_values.values.id: rest-id OR - * spec_type.enum_values.values.id: grpc-id` - * - The id of the allowed value associated with the spec_type attribute is - * _rest-id_ or _grpc-id_. - */ - // const filter = 'abc123' - /** - * Optional. The maximum number of specs to return. The service may return - * fewer than this value. If unspecified, at most 50 specs will be - * returned. The maximum value is 1000; values above 1000 will be coerced to - * 1000. - */ - // const pageSize = 1234 - /** - * Optional. A page token, received from a previous `ListSpecs` call. - * Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to `ListSpecs` must - * match the call that provided the page token. - */ - // const pageToken = 'abc123' - - // Imports the Apihub library - const {ApiHubClient} = require('@google-cloud/apihub').v1; - - // Instantiates a client - const apihubClient = new ApiHubClient(); - - async function callListSpecs() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = apihubClient.listSpecsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListSpecs(); - // [END apihub_v1_generated_ApiHub_ListSpecs_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.list_versions.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.list_versions.js deleted file mode 100644 index 9c3a25c5038..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.list_versions.js +++ /dev/null @@ -1,134 +0,0 @@ -// Copyright 2024 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 apihub_v1_generated_ApiHub_ListVersions_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 parent which owns this collection of API versions i.e., the - * API resource Format: `projects/{project}/locations/{location}/apis/{api}` - */ - // const parent = 'abc123' - /** - * Optional. An expression that filters the list of Versions. - * A filter expression consists of a field name, a comparison - * operator, and a value for filtering. The value must be a string, a - * number, or a boolean. The comparison operator must be one of: `<`, `>` or - * `=`. Filters are not case sensitive. - * The following fields in the `Version` are eligible for filtering: - * * `display_name` - The display name of the Version. Allowed - * comparison operators: `=`. - * * `create_time` - The time at which the Version was created. The - * value should be in the (RFC3339)https://tools.ietf.org/html/rfc3339 - * format. Allowed comparison operators: `>` and `<`. - * * `lifecycle.enum_values.values.id` - The allowed value id of the - * lifecycle attribute associated with the Version. Allowed comparison - * operators: `:`. - * * `lifecycle.enum_values.values.display_name` - The allowed value display - * name of the lifecycle attribute associated with the Version. Allowed - * comparison operators: `:`. - * * `compliance.enum_values.values.id` - The allowed value id of the - * compliances attribute associated with the Version. Allowed comparison - * operators: `:`. - * * `compliance.enum_values.values.display_name` - The allowed value - * display name of the compliances attribute associated with the Version. - * Allowed comparison operators: `:`. - * * `accreditation.enum_values.values.id` - The allowed value id of the - * accreditations attribute associated with the Version. Allowed - * comparison operators: `:`. - * * `accreditation.enum_values.values.display_name` - The allowed value - * display name of the accreditations attribute associated with the Version. - * Allowed comparison operators: `:`. - * Expressions are combined with either `AND` logic operator or `OR` logical - * operator but not both of them together i.e. only one of the `AND` or `OR` - * operator can be used throughout the filter string and both the operators - * cannot be used together. No other logical operators are - * supported. At most three filter fields are allowed in the filter - * string and if provided more than that then `INVALID_ARGUMENT` error is - * returned by the API. - * Here are a few examples: - * * `lifecycle.enum_values.values.id: preview-id` - The filter string - * specifies that the id of the allowed value associated with the lifecycle - * attribute of the Version is _preview-id_. - * * `lifecycle.enum_values.values.display_name: \"Preview Display Name\"` - - * The filter string specifies that the display name of the allowed value - * associated with the lifecycle attribute of the Version is `Preview - * Display Name`. - * * `lifecycle.enum_values.values.id: preview-id AND create_time < - * \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - - * The id of the allowed value associated with the lifecycle attribute of - * the Version is _preview-id_ and it was created before _2021-08-15 - * 14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_. - * * `compliance.enum_values.values.id: gdpr-id OR - * compliance.enum_values.values.id: pci-dss-id` - * - The id of the allowed value associated with the compliance attribute is - * _gdpr-id_ or _pci-dss-id_. - */ - // const filter = 'abc123' - /** - * Optional. The maximum number of versions to return. The service may return - * fewer than this value. If unspecified, at most 50 versions will be - * returned. The maximum value is 1000; values above 1000 will be coerced to - * 1000. - */ - // const pageSize = 1234 - /** - * Optional. A page token, received from a previous `ListVersions` call. - * Provide this to retrieve the subsequent page. - * When paginating, all other parameters (except page_size) provided to - * `ListVersions` must match the call that provided the page token. - */ - // const pageToken = 'abc123' - - // Imports the Apihub library - const {ApiHubClient} = require('@google-cloud/apihub').v1; - - // Instantiates a client - const apihubClient = new ApiHubClient(); - - async function callListVersions() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = apihubClient.listVersionsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListVersions(); - // [END apihub_v1_generated_ApiHub_ListVersions_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.search_resources.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.search_resources.js deleted file mode 100644 index 620468d7230..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.search_resources.js +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright 2024 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(location, query) { - // [START apihub_v1_generated_ApiHub_SearchResources_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 location which will be of the type - * `projects/{project_id}/locations/{location_id}`. This field is used to - * identify the instance of API-Hub in which resources should be searched. - */ - // const location = 'abc123' - /** - * Required. The free text search query. This query can contain keywords which - * could be related to any detail of the API-Hub resources such display names, - * descriptions, attributes etc. - */ - // const query = 'abc123' - /** - * Optional. An expression that filters the list of search results. - * A filter expression consists of a field name, a comparison operator, - * and a value for filtering. The value must be a string, a number, or a - * boolean. The comparison operator must be `=`. Filters are not case - * sensitive. - * The following field names are eligible for filtering: - * * `resource_type` - The type of resource in the search results. - * Must be one of the following: `Api`, `ApiOperation`, `Deployment`, - * `Definition`, `Spec` or `Version`. This field can only be specified once - * in the filter. - * Here are is an example: - * * `resource_type = Api` - The resource_type is _Api_. - */ - // const filter = 'abc123' - /** - * Optional. The maximum number of search results to return. The service may - * return fewer than this value. If unspecified at most 10 search results will - * be returned. If value is negative then `INVALID_ARGUMENT` error is - * returned. The maximum value is 25; values above 25 will be coerced to 25. - * While paginating, you can specify a new page size parameter for each page - * of search results to be listed. - */ - // const pageSize = 1234 - /** - * Optional. A page token, received from a previous - * SearchResources SearchResources - * call. Specify this parameter to retrieve the next page of transactions. - * When paginating, you must specify the `page_token` parameter and all the - * other parameters except - * page_size google.cloud.apihub.v1.SearchResourcesRequest.page_size - * should be specified with the same value which was used in the previous - * call. If the other fields are set with a different value than the previous - * call then `INVALID_ARGUMENT` error is returned. - */ - // const pageToken = 'abc123' - - // Imports the Apihub library - const {ApiHubClient} = require('@google-cloud/apihub').v1; - - // Instantiates a client - const apihubClient = new ApiHubClient(); - - async function callSearchResources() { - // Construct request - const request = { - location, - query, - }; - - // Run request - const iterable = apihubClient.searchResourcesAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callSearchResources(); - // [END apihub_v1_generated_ApiHub_SearchResources_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.update_api.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.update_api.js deleted file mode 100644 index de22a319390..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.update_api.js +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright 2024 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(api, updateMask) { - // [START apihub_v1_generated_ApiHub_UpdateApi_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 API resource to update. - * The API resource's `name` field is used to identify the API resource to - * update. - * Format: `projects/{project}/locations/{location}/apis/{api}` - */ - // const api = {} - /** - * Required. The list of fields to update. - */ - // const updateMask = {} - - // Imports the Apihub library - const {ApiHubClient} = require('@google-cloud/apihub').v1; - - // Instantiates a client - const apihubClient = new ApiHubClient(); - - async function callUpdateApi() { - // Construct request - const request = { - api, - updateMask, - }; - - // Run request - const response = await apihubClient.updateApi(request); - console.log(response); - } - - callUpdateApi(); - // [END apihub_v1_generated_ApiHub_UpdateApi_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.update_attribute.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.update_attribute.js deleted file mode 100644 index d9981224b6b..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.update_attribute.js +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright 2024 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(attribute, updateMask) { - // [START apihub_v1_generated_ApiHub_UpdateAttribute_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 attribute to update. - * The attribute's `name` field is used to identify the attribute to update. - * Format: - * `projects/{project}/locations/{location}/attributes/{attribute}` - */ - // const attribute = {} - /** - * Required. The list of fields to update. - */ - // const updateMask = {} - - // Imports the Apihub library - const {ApiHubClient} = require('@google-cloud/apihub').v1; - - // Instantiates a client - const apihubClient = new ApiHubClient(); - - async function callUpdateAttribute() { - // Construct request - const request = { - attribute, - updateMask, - }; - - // Run request - const response = await apihubClient.updateAttribute(request); - console.log(response); - } - - callUpdateAttribute(); - // [END apihub_v1_generated_ApiHub_UpdateAttribute_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.update_deployment.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.update_deployment.js deleted file mode 100644 index 451b90c3b7a..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.update_deployment.js +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright 2024 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(deployment, updateMask) { - // [START apihub_v1_generated_ApiHub_UpdateDeployment_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 deployment resource to update. - * The deployment resource's `name` field is used to identify the deployment - * resource to update. - * Format: `projects/{project}/locations/{location}/deployments/{deployment}` - */ - // const deployment = {} - /** - * Required. The list of fields to update. - */ - // const updateMask = {} - - // Imports the Apihub library - const {ApiHubClient} = require('@google-cloud/apihub').v1; - - // Instantiates a client - const apihubClient = new ApiHubClient(); - - async function callUpdateDeployment() { - // Construct request - const request = { - deployment, - updateMask, - }; - - // Run request - const response = await apihubClient.updateDeployment(request); - console.log(response); - } - - callUpdateDeployment(); - // [END apihub_v1_generated_ApiHub_UpdateDeployment_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.update_external_api.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.update_external_api.js deleted file mode 100644 index b5b266771e7..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.update_external_api.js +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright 2024 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(externalApi, updateMask) { - // [START apihub_v1_generated_ApiHub_UpdateExternalApi_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 External API resource to update. - * The External API resource's `name` field is used to identify the External - * API resource to update. Format: - * `projects/{project}/locations/{location}/externalApis/{externalApi}` - */ - // const externalApi = {} - /** - * Required. The list of fields to update. - */ - // const updateMask = {} - - // Imports the Apihub library - const {ApiHubClient} = require('@google-cloud/apihub').v1; - - // Instantiates a client - const apihubClient = new ApiHubClient(); - - async function callUpdateExternalApi() { - // Construct request - const request = { - externalApi, - updateMask, - }; - - // Run request - const response = await apihubClient.updateExternalApi(request); - console.log(response); - } - - callUpdateExternalApi(); - // [END apihub_v1_generated_ApiHub_UpdateExternalApi_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.update_spec.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.update_spec.js deleted file mode 100644 index aa5452961ad..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.update_spec.js +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright 2024 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(spec, updateMask) { - // [START apihub_v1_generated_ApiHub_UpdateSpec_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 spec to update. - * The spec's `name` field is used to identify the spec to - * update. Format: - * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}` - */ - // const spec = {} - /** - * Required. The list of fields to update. - */ - // const updateMask = {} - - // Imports the Apihub library - const {ApiHubClient} = require('@google-cloud/apihub').v1; - - // Instantiates a client - const apihubClient = new ApiHubClient(); - - async function callUpdateSpec() { - // Construct request - const request = { - spec, - updateMask, - }; - - // Run request - const response = await apihubClient.updateSpec(request); - console.log(response); - } - - callUpdateSpec(); - // [END apihub_v1_generated_ApiHub_UpdateSpec_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.update_version.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.update_version.js deleted file mode 100644 index 6192934a974..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub.update_version.js +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright 2024 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(version, updateMask) { - // [START apihub_v1_generated_ApiHub_UpdateVersion_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 API version to update. - * The version's `name` field is used to identify the API version to update. - * Format: - * `projects/{project}/locations/{location}/apis/{api}/versions/{version}` - */ - // const version = {} - /** - * Required. The list of fields to update. - */ - // const updateMask = {} - - // Imports the Apihub library - const {ApiHubClient} = require('@google-cloud/apihub').v1; - - // Instantiates a client - const apihubClient = new ApiHubClient(); - - async function callUpdateVersion() { - // Construct request - const request = { - version, - updateMask, - }; - - // Run request - const response = await apihubClient.updateVersion(request); - console.log(response); - } - - callUpdateVersion(); - // [END apihub_v1_generated_ApiHub_UpdateVersion_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_dependencies.create_dependency.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_dependencies.create_dependency.js deleted file mode 100644 index 44adc875150..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_dependencies.create_dependency.js +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2024 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, dependency) { - // [START apihub_v1_generated_ApiHubDependencies_CreateDependency_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 parent resource for the dependency resource. - * Format: `projects/{project}/locations/{location}` - */ - // const parent = 'abc123' - /** - * Optional. The ID to use for the dependency resource, which will become the - * final component of the dependency's resource name. This field is optional. - * * If provided, the same will be used. The service will throw an error if - * duplicate id is provided by the client. - * * If not provided, a system generated id will be used. - * This value should be 4-500 characters, and valid characters - * are `[a-z][A-Z][0-9]-_`. - */ - // const dependencyId = 'abc123' - /** - * Required. The dependency resource to create. - */ - // const dependency = {} - - // Imports the Apihub library - const {ApiHubDependenciesClient} = require('@google-cloud/apihub').v1; - - // Instantiates a client - const apihubClient = new ApiHubDependenciesClient(); - - async function callCreateDependency() { - // Construct request - const request = { - parent, - dependency, - }; - - // Run request - const response = await apihubClient.createDependency(request); - console.log(response); - } - - callCreateDependency(); - // [END apihub_v1_generated_ApiHubDependencies_CreateDependency_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_dependencies.delete_dependency.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_dependencies.delete_dependency.js deleted file mode 100644 index 560558e238a..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_dependencies.delete_dependency.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2024 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 apihub_v1_generated_ApiHubDependencies_DeleteDependency_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 name of the dependency resource to delete. - * Format: `projects/{project}/locations/{location}/dependencies/{dependency}` - */ - // const name = 'abc123' - - // Imports the Apihub library - const {ApiHubDependenciesClient} = require('@google-cloud/apihub').v1; - - // Instantiates a client - const apihubClient = new ApiHubDependenciesClient(); - - async function callDeleteDependency() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await apihubClient.deleteDependency(request); - console.log(response); - } - - callDeleteDependency(); - // [END apihub_v1_generated_ApiHubDependencies_DeleteDependency_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_dependencies.get_dependency.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_dependencies.get_dependency.js deleted file mode 100644 index 134880e3111..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_dependencies.get_dependency.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2024 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 apihub_v1_generated_ApiHubDependencies_GetDependency_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 name of the dependency resource to retrieve. - * Format: `projects/{project}/locations/{location}/dependencies/{dependency}` - */ - // const name = 'abc123' - - // Imports the Apihub library - const {ApiHubDependenciesClient} = require('@google-cloud/apihub').v1; - - // Instantiates a client - const apihubClient = new ApiHubDependenciesClient(); - - async function callGetDependency() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await apihubClient.getDependency(request); - console.log(response); - } - - callGetDependency(); - // [END apihub_v1_generated_ApiHubDependencies_GetDependency_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_dependencies.list_dependencies.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_dependencies.list_dependencies.js deleted file mode 100644 index ed499d709cc..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_dependencies.list_dependencies.js +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright 2024 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 apihub_v1_generated_ApiHubDependencies_ListDependencies_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 parent which owns this collection of dependency resources. - * Format: `projects/{project}/locations/{location}` - */ - // const parent = 'abc123' - /** - * Optional. An expression that filters the list of Dependencies. - * A filter expression consists of a field name, a comparison operator, and - * a value for filtering. The value must be a string. Allowed comparison - * operator is `=`. Filters are not case sensitive. - * The following fields in the `Dependency` are eligible for filtering: - * * `consumer.operation_resource_name` - The operation resource name for - * the consumer entity involved in a dependency. Allowed comparison - * operators: `=`. - * * `consumer.external_api_resource_name` - The external api resource name - * for the consumer entity involved in a dependency. Allowed comparison - * operators: `=`. - * * `supplier.operation_resource_name` - The operation resource name for - * the supplier entity involved in a dependency. Allowed comparison - * operators: `=`. - * * `supplier.external_api_resource_name` - The external api resource name - * for the supplier entity involved in a dependency. Allowed comparison - * operators: `=`. - * Expressions are combined with either `AND` logic operator or `OR` logical - * operator but not both of them together i.e. only one of the `AND` or `OR` - * operator can be used throughout the filter string and both the operators - * cannot be used together. No other logical operators are supported. At most - * three filter fields are allowed in the filter string and if provided - * more than that then `INVALID_ARGUMENT` error is returned by the API. - * For example, `consumer.operation_resource_name = - * \"projects/p1/locations/global/apis/a1/versions/v1/operations/o1\" OR - * supplier.operation_resource_name = - * \"projects/p1/locations/global/apis/a1/versions/v1/operations/o1\"` - The - * dependencies with either consumer or supplier operation resource name as - * _projects/p1/locations/global/apis/a1/versions/v1/operations/o1_. - */ - // const filter = 'abc123' - /** - * Optional. The maximum number of dependency resources to return. The service - * may return fewer than this value. If unspecified, at most 50 dependencies - * will be returned. The maximum value is 1000; values above 1000 will be - * coerced to 1000. - */ - // const pageSize = 1234 - /** - * Optional. A page token, received from a previous `ListDependencies` call. - * Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to `ListDependencies` must - * match the call that provided the page token. - */ - // const pageToken = 'abc123' - - // Imports the Apihub library - const {ApiHubDependenciesClient} = require('@google-cloud/apihub').v1; - - // Instantiates a client - const apihubClient = new ApiHubDependenciesClient(); - - async function callListDependencies() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = apihubClient.listDependenciesAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListDependencies(); - // [END apihub_v1_generated_ApiHubDependencies_ListDependencies_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_dependencies.update_dependency.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_dependencies.update_dependency.js deleted file mode 100644 index c73bc482027..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_dependencies.update_dependency.js +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright 2024 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(dependency, updateMask) { - // [START apihub_v1_generated_ApiHubDependencies_UpdateDependency_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 dependency resource to update. - * The dependency's `name` field is used to identify the dependency to update. - * Format: `projects/{project}/locations/{location}/dependencies/{dependency}` - */ - // const dependency = {} - /** - * Required. The list of fields to update. - */ - // const updateMask = {} - - // Imports the Apihub library - const {ApiHubDependenciesClient} = require('@google-cloud/apihub').v1; - - // Instantiates a client - const apihubClient = new ApiHubDependenciesClient(); - - async function callUpdateDependency() { - // Construct request - const request = { - dependency, - updateMask, - }; - - // Run request - const response = await apihubClient.updateDependency(request); - console.log(response); - } - - callUpdateDependency(); - // [END apihub_v1_generated_ApiHubDependencies_UpdateDependency_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_plugin.disable_plugin.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_plugin.disable_plugin.js deleted file mode 100644 index 6ee7f42f8bf..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_plugin.disable_plugin.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2024 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 apihub_v1_generated_ApiHubPlugin_DisablePlugin_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 name of the plugin to disable. - * Format: `projects/{project}/locations/{location}/plugins/{plugin}`. - */ - // const name = 'abc123' - - // Imports the Apihub library - const {ApiHubPluginClient} = require('@google-cloud/apihub').v1; - - // Instantiates a client - const apihubClient = new ApiHubPluginClient(); - - async function callDisablePlugin() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await apihubClient.disablePlugin(request); - console.log(response); - } - - callDisablePlugin(); - // [END apihub_v1_generated_ApiHubPlugin_DisablePlugin_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_plugin.enable_plugin.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_plugin.enable_plugin.js deleted file mode 100644 index 54fa6296533..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_plugin.enable_plugin.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2024 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 apihub_v1_generated_ApiHubPlugin_EnablePlugin_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 name of the plugin to enable. - * Format: `projects/{project}/locations/{location}/plugins/{plugin}`. - */ - // const name = 'abc123' - - // Imports the Apihub library - const {ApiHubPluginClient} = require('@google-cloud/apihub').v1; - - // Instantiates a client - const apihubClient = new ApiHubPluginClient(); - - async function callEnablePlugin() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await apihubClient.enablePlugin(request); - console.log(response); - } - - callEnablePlugin(); - // [END apihub_v1_generated_ApiHubPlugin_EnablePlugin_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_plugin.get_plugin.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_plugin.get_plugin.js deleted file mode 100644 index 0cc7e786529..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/api_hub_plugin.get_plugin.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2024 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 apihub_v1_generated_ApiHubPlugin_GetPlugin_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 name of the plugin to retrieve. - * Format: `projects/{project}/locations/{location}/plugins/{plugin}`. - */ - // const name = 'abc123' - - // Imports the Apihub library - const {ApiHubPluginClient} = require('@google-cloud/apihub').v1; - - // Instantiates a client - const apihubClient = new ApiHubPluginClient(); - - async function callGetPlugin() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await apihubClient.getPlugin(request); - console.log(response); - } - - callGetPlugin(); - // [END apihub_v1_generated_ApiHubPlugin_GetPlugin_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/host_project_registration_service.create_host_project_registration.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/host_project_registration_service.create_host_project_registration.js deleted file mode 100644 index 001d00a9ba7..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/host_project_registration_service.create_host_project_registration.js +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright 2024 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, hostProjectRegistrationId, hostProjectRegistration) { - // [START apihub_v1_generated_HostProjectRegistrationService_CreateHostProjectRegistration_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 parent resource for the host project. - * Format: `projects/{project}/locations/{location}` - */ - // const parent = 'abc123' - /** - * Required. The ID to use for the Host Project Registration, which will - * become the final component of the host project registration's resource - * name. The ID must be the same as the Google cloud project specified in the - * host_project_registration.gcp_project field. - */ - // const hostProjectRegistrationId = 'abc123' - /** - * Required. The host project registration to register. - */ - // const hostProjectRegistration = {} - - // Imports the Apihub library - const {HostProjectRegistrationServiceClient} = require('@google-cloud/apihub').v1; - - // Instantiates a client - const apihubClient = new HostProjectRegistrationServiceClient(); - - async function callCreateHostProjectRegistration() { - // Construct request - const request = { - parent, - hostProjectRegistrationId, - hostProjectRegistration, - }; - - // Run request - const response = await apihubClient.createHostProjectRegistration(request); - console.log(response); - } - - callCreateHostProjectRegistration(); - // [END apihub_v1_generated_HostProjectRegistrationService_CreateHostProjectRegistration_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/host_project_registration_service.get_host_project_registration.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/host_project_registration_service.get_host_project_registration.js deleted file mode 100644 index d574c2fdfd9..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/host_project_registration_service.get_host_project_registration.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2024 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 apihub_v1_generated_HostProjectRegistrationService_GetHostProjectRegistration_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. Host project registration resource name. - * projects/{project}/locations/{location}/hostProjectRegistrations/{host_project_registration_id} - */ - // const name = 'abc123' - - // Imports the Apihub library - const {HostProjectRegistrationServiceClient} = require('@google-cloud/apihub').v1; - - // Instantiates a client - const apihubClient = new HostProjectRegistrationServiceClient(); - - async function callGetHostProjectRegistration() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await apihubClient.getHostProjectRegistration(request); - console.log(response); - } - - callGetHostProjectRegistration(); - // [END apihub_v1_generated_HostProjectRegistrationService_GetHostProjectRegistration_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/host_project_registration_service.list_host_project_registrations.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/host_project_registration_service.list_host_project_registrations.js deleted file mode 100644 index 8b31dd40890..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/host_project_registration_service.list_host_project_registrations.js +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright 2024 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 apihub_v1_generated_HostProjectRegistrationService_ListHostProjectRegistrations_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 parent, which owns this collection of host projects. - * Format: `projects/* /locations/*` - */ - // const parent = 'abc123' - /** - * Optional. The maximum number of host project registrations to return. The - * service may return fewer than this value. If unspecified, at most 50 host - * project registrations will be returned. The maximum value is 1000; values - * above 1000 will be coerced to 1000. - */ - // const pageSize = 1234 - /** - * Optional. A page token, received from a previous - * `ListHostProjectRegistrations` call. Provide this to retrieve the - * subsequent page. - * When paginating, all other parameters (except page_size) provided to - * `ListHostProjectRegistrations` must match the call that provided the page - * token. - */ - // const pageToken = 'abc123' - /** - * Optional. An expression that filters the list of HostProjectRegistrations. - * A filter expression consists of a field name, a comparison - * operator, and a value for filtering. The value must be a string. All - * standard operators as documented at https://google.aip.dev/160 are - * supported. - * The following fields in the `HostProjectRegistration` are eligible for - * filtering: - * * `name` - The name of the HostProjectRegistration. - * * `create_time` - The time at which the HostProjectRegistration was - * created. The value should be in the - * (RFC3339)https://tools.ietf.org/html/rfc3339 format. - * * `gcp_project` - The Google cloud project associated with the - * HostProjectRegistration. - */ - // const filter = 'abc123' - /** - * Optional. Hint for how to order the results. - */ - // const orderBy = 'abc123' - - // Imports the Apihub library - const {HostProjectRegistrationServiceClient} = require('@google-cloud/apihub').v1; - - // Instantiates a client - const apihubClient = new HostProjectRegistrationServiceClient(); - - async function callListHostProjectRegistrations() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = apihubClient.listHostProjectRegistrationsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListHostProjectRegistrations(); - // [END apihub_v1_generated_HostProjectRegistrationService_ListHostProjectRegistrations_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/linting_service.get_style_guide.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/linting_service.get_style_guide.js deleted file mode 100644 index 7d1f96bcc46..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/linting_service.get_style_guide.js +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2024 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 apihub_v1_generated_LintingService_GetStyleGuide_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 name of the spec to retrieve. - * Format: - * `projects/{project}/locations/{location}/plugins/{plugin}/styleGuide`. - */ - // const name = 'abc123' - - // Imports the Apihub library - const {LintingServiceClient} = require('@google-cloud/apihub').v1; - - // Instantiates a client - const apihubClient = new LintingServiceClient(); - - async function callGetStyleGuide() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await apihubClient.getStyleGuide(request); - console.log(response); - } - - callGetStyleGuide(); - // [END apihub_v1_generated_LintingService_GetStyleGuide_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/linting_service.get_style_guide_contents.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/linting_service.get_style_guide_contents.js deleted file mode 100644 index 43a14577418..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/linting_service.get_style_guide_contents.js +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2024 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 apihub_v1_generated_LintingService_GetStyleGuideContents_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 name of the StyleGuide whose contents need to be retrieved. - * There is exactly one style guide resource per project per location. - * The expected format is - * `projects/{project}/locations/{location}/plugins/{plugin}/styleGuide`. - */ - // const name = 'abc123' - - // Imports the Apihub library - const {LintingServiceClient} = require('@google-cloud/apihub').v1; - - // Instantiates a client - const apihubClient = new LintingServiceClient(); - - async function callGetStyleGuideContents() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await apihubClient.getStyleGuideContents(request); - console.log(response); - } - - callGetStyleGuideContents(); - // [END apihub_v1_generated_LintingService_GetStyleGuideContents_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/linting_service.lint_spec.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/linting_service.lint_spec.js deleted file mode 100644 index d1327648d85..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/linting_service.lint_spec.js +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2024 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 apihub_v1_generated_LintingService_LintSpec_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 name of the spec to be linted. - * Format: - * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}` - */ - // const name = 'abc123' - - // Imports the Apihub library - const {LintingServiceClient} = require('@google-cloud/apihub').v1; - - // Instantiates a client - const apihubClient = new LintingServiceClient(); - - async function callLintSpec() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await apihubClient.lintSpec(request); - console.log(response); - } - - callLintSpec(); - // [END apihub_v1_generated_LintingService_LintSpec_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/linting_service.update_style_guide.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/linting_service.update_style_guide.js deleted file mode 100644 index 7232754ad9a..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/linting_service.update_style_guide.js +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright 2024 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(styleGuide) { - // [START apihub_v1_generated_LintingService_UpdateStyleGuide_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 Style guide resource to update. - */ - // const styleGuide = {} - /** - * Optional. The list of fields to update. - */ - // const updateMask = {} - - // Imports the Apihub library - const {LintingServiceClient} = require('@google-cloud/apihub').v1; - - // Instantiates a client - const apihubClient = new LintingServiceClient(); - - async function callUpdateStyleGuide() { - // Construct request - const request = { - styleGuide, - }; - - // Run request - const response = await apihubClient.updateStyleGuide(request); - console.log(response); - } - - callUpdateStyleGuide(); - // [END apihub_v1_generated_LintingService_UpdateStyleGuide_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/provisioning.create_api_hub_instance.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/provisioning.create_api_hub_instance.js deleted file mode 100644 index 2e55a19872d..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/provisioning.create_api_hub_instance.js +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright 2024 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, apiHubInstance) { - // [START apihub_v1_generated_Provisioning_CreateApiHubInstance_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 parent resource for the Api Hub instance resource. - * Format: `projects/{project}/locations/{location}` - */ - // const parent = 'abc123' - /** - * Optional. Identifier to assign to the Api Hub instance. Must be unique - * within scope of the parent resource. If the field is not provided, system - * generated id will be used. - * This value should be 4-40 characters, and valid characters - * are `/[a-z][A-Z][0-9]-_/`. - */ - // const apiHubInstanceId = 'abc123' - /** - * Required. The ApiHub instance. - */ - // const apiHubInstance = {} - - // Imports the Apihub library - const {ProvisioningClient} = require('@google-cloud/apihub').v1; - - // Instantiates a client - const apihubClient = new ProvisioningClient(); - - async function callCreateApiHubInstance() { - // Construct request - const request = { - parent, - apiHubInstance, - }; - - // Run request - const [operation] = await apihubClient.createApiHubInstance(request); - const [response] = await operation.promise(); - console.log(response); - } - - callCreateApiHubInstance(); - // [END apihub_v1_generated_Provisioning_CreateApiHubInstance_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/provisioning.get_api_hub_instance.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/provisioning.get_api_hub_instance.js deleted file mode 100644 index a735a2af5a6..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/provisioning.get_api_hub_instance.js +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2024 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 apihub_v1_generated_Provisioning_GetApiHubInstance_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 name of the Api Hub instance to retrieve. - * Format: - * `projects/{project}/locations/{location}/apiHubInstances/{apiHubInstance}`. - */ - // const name = 'abc123' - - // Imports the Apihub library - const {ProvisioningClient} = require('@google-cloud/apihub').v1; - - // Instantiates a client - const apihubClient = new ProvisioningClient(); - - async function callGetApiHubInstance() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await apihubClient.getApiHubInstance(request); - console.log(response); - } - - callGetApiHubInstance(); - // [END apihub_v1_generated_Provisioning_GetApiHubInstance_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/provisioning.lookup_api_hub_instance.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/provisioning.lookup_api_hub_instance.js deleted file mode 100644 index c521c44746c..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/provisioning.lookup_api_hub_instance.js +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2024 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 apihub_v1_generated_Provisioning_LookupApiHubInstance_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. There will always be only one Api Hub instance for a GCP project - * across all locations. - * The parent resource for the Api Hub instance resource. - * Format: `projects/{project}/locations/{location}` - */ - // const parent = 'abc123' - - // Imports the Apihub library - const {ProvisioningClient} = require('@google-cloud/apihub').v1; - - // Instantiates a client - const apihubClient = new ProvisioningClient(); - - async function callLookupApiHubInstance() { - // Construct request - const request = { - parent, - }; - - // Run request - const response = await apihubClient.lookupApiHubInstance(request); - console.log(response); - } - - callLookupApiHubInstance(); - // [END apihub_v1_generated_Provisioning_LookupApiHubInstance_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/runtime_project_attachment_service.create_runtime_project_attachment.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/runtime_project_attachment_service.create_runtime_project_attachment.js deleted file mode 100644 index 031f5a951a5..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/runtime_project_attachment_service.create_runtime_project_attachment.js +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright 2024 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, runtimeProjectAttachmentId, runtimeProjectAttachment) { - // [START apihub_v1_generated_RuntimeProjectAttachmentService_CreateRuntimeProjectAttachment_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 parent resource for the Runtime Project Attachment. - * Format: `projects/{project}/locations/{location}` - */ - // const parent = 'abc123' - /** - * Required. The ID to use for the Runtime Project Attachment, which will - * become the final component of the Runtime Project Attachment's name. The ID - * must be the same as the project ID of the Google cloud project specified in - * the runtime_project_attachment.runtime_project field. - */ - // const runtimeProjectAttachmentId = 'abc123' - /** - * Required. The Runtime Project Attachment to create. - */ - // const runtimeProjectAttachment = {} - - // Imports the Apihub library - const {RuntimeProjectAttachmentServiceClient} = require('@google-cloud/apihub').v1; - - // Instantiates a client - const apihubClient = new RuntimeProjectAttachmentServiceClient(); - - async function callCreateRuntimeProjectAttachment() { - // Construct request - const request = { - parent, - runtimeProjectAttachmentId, - runtimeProjectAttachment, - }; - - // Run request - const response = await apihubClient.createRuntimeProjectAttachment(request); - console.log(response); - } - - callCreateRuntimeProjectAttachment(); - // [END apihub_v1_generated_RuntimeProjectAttachmentService_CreateRuntimeProjectAttachment_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/runtime_project_attachment_service.delete_runtime_project_attachment.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/runtime_project_attachment_service.delete_runtime_project_attachment.js deleted file mode 100644 index 5950ad165a2..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/runtime_project_attachment_service.delete_runtime_project_attachment.js +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2024 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 apihub_v1_generated_RuntimeProjectAttachmentService_DeleteRuntimeProjectAttachment_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 name of the Runtime Project Attachment to delete. - * Format: - * `projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}` - */ - // const name = 'abc123' - - // Imports the Apihub library - const {RuntimeProjectAttachmentServiceClient} = require('@google-cloud/apihub').v1; - - // Instantiates a client - const apihubClient = new RuntimeProjectAttachmentServiceClient(); - - async function callDeleteRuntimeProjectAttachment() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await apihubClient.deleteRuntimeProjectAttachment(request); - console.log(response); - } - - callDeleteRuntimeProjectAttachment(); - // [END apihub_v1_generated_RuntimeProjectAttachmentService_DeleteRuntimeProjectAttachment_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/runtime_project_attachment_service.get_runtime_project_attachment.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/runtime_project_attachment_service.get_runtime_project_attachment.js deleted file mode 100644 index 1f4bacb7174..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/runtime_project_attachment_service.get_runtime_project_attachment.js +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2024 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 apihub_v1_generated_RuntimeProjectAttachmentService_GetRuntimeProjectAttachment_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 name of the API resource to retrieve. - * Format: - * `projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}` - */ - // const name = 'abc123' - - // Imports the Apihub library - const {RuntimeProjectAttachmentServiceClient} = require('@google-cloud/apihub').v1; - - // Instantiates a client - const apihubClient = new RuntimeProjectAttachmentServiceClient(); - - async function callGetRuntimeProjectAttachment() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await apihubClient.getRuntimeProjectAttachment(request); - console.log(response); - } - - callGetRuntimeProjectAttachment(); - // [END apihub_v1_generated_RuntimeProjectAttachmentService_GetRuntimeProjectAttachment_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/runtime_project_attachment_service.list_runtime_project_attachments.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/runtime_project_attachment_service.list_runtime_project_attachments.js deleted file mode 100644 index fc112de47b2..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/runtime_project_attachment_service.list_runtime_project_attachments.js +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright 2024 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 apihub_v1_generated_RuntimeProjectAttachmentService_ListRuntimeProjectAttachments_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 parent, which owns this collection of runtime project - * attachments. Format: `projects/{project}/locations/{location}` - */ - // const parent = 'abc123' - /** - * Optional. The maximum number of runtime project attachments to return. The - * service may return fewer than this value. If unspecified, at most 50 - * runtime project attachments will be returned. The maximum value is 1000; - * values above 1000 will be coerced to 1000. - */ - // const pageSize = 1234 - /** - * Optional. A page token, received from a previous - * `ListRuntimeProjectAttachments` call. Provide this to retrieve the - * subsequent page. - * When paginating, all other parameters (except page_size) provided to - * `ListRuntimeProjectAttachments` must match the call that provided the page - * token. - */ - // const pageToken = 'abc123' - /** - * Optional. An expression that filters the list of RuntimeProjectAttachments. - * A filter expression consists of a field name, a comparison - * operator, and a value for filtering. The value must be a string. All - * standard operators as documented at https://google.aip.dev/160 are - * supported. - * The following fields in the `RuntimeProjectAttachment` are eligible for - * filtering: - * * `name` - The name of the RuntimeProjectAttachment. - * * `create_time` - The time at which the RuntimeProjectAttachment was - * created. The value should be in the - * (RFC3339)https://tools.ietf.org/html/rfc3339 format. - * * `runtime_project` - The Google cloud project associated with the - * RuntimeProjectAttachment. - */ - // const filter = 'abc123' - /** - * Optional. Hint for how to order the results. - */ - // const orderBy = 'abc123' - - // Imports the Apihub library - const {RuntimeProjectAttachmentServiceClient} = require('@google-cloud/apihub').v1; - - // Instantiates a client - const apihubClient = new RuntimeProjectAttachmentServiceClient(); - - async function callListRuntimeProjectAttachments() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = apihubClient.listRuntimeProjectAttachmentsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListRuntimeProjectAttachments(); - // [END apihub_v1_generated_RuntimeProjectAttachmentService_ListRuntimeProjectAttachments_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/runtime_project_attachment_service.lookup_runtime_project_attachment.js b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/runtime_project_attachment_service.lookup_runtime_project_attachment.js deleted file mode 100644 index 0fb18901145..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/runtime_project_attachment_service.lookup_runtime_project_attachment.js +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2024 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 apihub_v1_generated_RuntimeProjectAttachmentService_LookupRuntimeProjectAttachment_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. Runtime project ID to look up runtime project attachment for. - * Lookup happens across all regions. Expected format: - * `projects/{project}/locations/{location}`. - */ - // const name = 'abc123' - - // Imports the Apihub library - const {RuntimeProjectAttachmentServiceClient} = require('@google-cloud/apihub').v1; - - // Instantiates a client - const apihubClient = new RuntimeProjectAttachmentServiceClient(); - - async function callLookupRuntimeProjectAttachment() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await apihubClient.lookupRuntimeProjectAttachment(request); - console.log(response); - } - - callLookupRuntimeProjectAttachment(); - // [END apihub_v1_generated_RuntimeProjectAttachmentService_LookupRuntimeProjectAttachment_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/snippet_metadata_google.cloud.apihub.v1.json b/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/snippet_metadata_google.cloud.apihub.v1.json deleted file mode 100644 index 9690b6949f7..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/samples/generated/v1/snippet_metadata_google.cloud.apihub.v1.json +++ /dev/null @@ -1,2595 +0,0 @@ -{ - "clientLibrary": { - "name": "nodejs-apihub", - "version": "0.1.0", - "language": "TYPESCRIPT", - "apis": [ - { - "id": "google.cloud.apihub.v1", - "version": "v1" - } - ] - }, - "snippets": [ - { - "regionTag": "apihub_v1_generated_ApiHub_CreateApi_async", - "title": "ApiHub createApi Sample", - "origin": "API_DEFINITION", - "description": " Create an API resource in the API hub. Once an API resource is created, versions can be added to it.", - "canonical": true, - "file": "api_hub.create_api.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 69, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateApi", - "fullName": "google.cloud.apihub.v1.ApiHub.CreateApi", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "api_id", - "type": "TYPE_STRING" - }, - { - "name": "api", - "type": ".google.cloud.apihub.v1.Api" - } - ], - "resultType": ".google.cloud.apihub.v1.Api", - "client": { - "shortName": "ApiHubClient", - "fullName": "google.cloud.apihub.v1.ApiHubClient" - }, - "method": { - "shortName": "CreateApi", - "fullName": "google.cloud.apihub.v1.ApiHub.CreateApi", - "service": { - "shortName": "ApiHub", - "fullName": "google.cloud.apihub.v1.ApiHub" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_ApiHub_GetApi_async", - "title": "ApiHub getApi Sample", - "origin": "API_DEFINITION", - "description": " Get API resource details including the API versions contained in it.", - "canonical": true, - "file": "api_hub.get_api.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetApi", - "fullName": "google.cloud.apihub.v1.ApiHub.GetApi", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.apihub.v1.Api", - "client": { - "shortName": "ApiHubClient", - "fullName": "google.cloud.apihub.v1.ApiHubClient" - }, - "method": { - "shortName": "GetApi", - "fullName": "google.cloud.apihub.v1.ApiHub.GetApi", - "service": { - "shortName": "ApiHub", - "fullName": "google.cloud.apihub.v1.ApiHub" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_ApiHub_ListApis_async", - "title": "ApiHub listApis Sample", - "origin": "API_DEFINITION", - "description": " List API resources in the API hub.", - "canonical": true, - "file": "api_hub.list_apis.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 138, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListApis", - "fullName": "google.cloud.apihub.v1.ApiHub.ListApis", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.apihub.v1.ListApisResponse", - "client": { - "shortName": "ApiHubClient", - "fullName": "google.cloud.apihub.v1.ApiHubClient" - }, - "method": { - "shortName": "ListApis", - "fullName": "google.cloud.apihub.v1.ApiHub.ListApis", - "service": { - "shortName": "ApiHub", - "fullName": "google.cloud.apihub.v1.ApiHub" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_ApiHub_UpdateApi_async", - "title": "ApiHub updateApi Sample", - "origin": "API_DEFINITION", - "description": " Update an API resource in the API hub. The following fields in the [API][] can be updated: * [display_name][google.cloud.apihub.v1.Api.display_name] * [description][google.cloud.apihub.v1.Api.description] * [owner][google.cloud.apihub.v1.Api.owner] * [documentation][google.cloud.apihub.v1.Api.documentation] * [target_user][google.cloud.apihub.v1.Api.target_user] * [team][google.cloud.apihub.v1.Api.team] * [business_unit][google.cloud.apihub.v1.Api.business_unit] * [maturity_level][google.cloud.apihub.v1.Api.maturity_level] * [attributes][google.cloud.apihub.v1.Api.attributes] The [update_mask][google.cloud.apihub.v1.UpdateApiRequest.update_mask] should be used to specify the fields being updated. Updating the owner field requires complete owner message and updates both owner and email fields.", - "canonical": true, - "file": "api_hub.update_api.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 61, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateApi", - "fullName": "google.cloud.apihub.v1.ApiHub.UpdateApi", - "async": true, - "parameters": [ - { - "name": "api", - "type": ".google.cloud.apihub.v1.Api" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.cloud.apihub.v1.Api", - "client": { - "shortName": "ApiHubClient", - "fullName": "google.cloud.apihub.v1.ApiHubClient" - }, - "method": { - "shortName": "UpdateApi", - "fullName": "google.cloud.apihub.v1.ApiHub.UpdateApi", - "service": { - "shortName": "ApiHub", - "fullName": "google.cloud.apihub.v1.ApiHub" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_ApiHub_DeleteApi_async", - "title": "ApiHub deleteApi Sample", - "origin": "API_DEFINITION", - "description": " Delete an API resource in the API hub. API can only be deleted if all underlying versions are deleted.", - "canonical": true, - "file": "api_hub.delete_api.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 59, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteApi", - "fullName": "google.cloud.apihub.v1.ApiHub.DeleteApi", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "force", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "ApiHubClient", - "fullName": "google.cloud.apihub.v1.ApiHubClient" - }, - "method": { - "shortName": "DeleteApi", - "fullName": "google.cloud.apihub.v1.ApiHub.DeleteApi", - "service": { - "shortName": "ApiHub", - "fullName": "google.cloud.apihub.v1.ApiHub" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_ApiHub_CreateVersion_async", - "title": "ApiHub createVersion Sample", - "origin": "API_DEFINITION", - "description": " Create an API version for an API resource in the API hub.", - "canonical": true, - "file": "api_hub.create_version.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 69, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateVersion", - "fullName": "google.cloud.apihub.v1.ApiHub.CreateVersion", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "version_id", - "type": "TYPE_STRING" - }, - { - "name": "version", - "type": ".google.cloud.apihub.v1.Version" - } - ], - "resultType": ".google.cloud.apihub.v1.Version", - "client": { - "shortName": "ApiHubClient", - "fullName": "google.cloud.apihub.v1.ApiHubClient" - }, - "method": { - "shortName": "CreateVersion", - "fullName": "google.cloud.apihub.v1.ApiHub.CreateVersion", - "service": { - "shortName": "ApiHub", - "fullName": "google.cloud.apihub.v1.ApiHub" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_ApiHub_GetVersion_async", - "title": "ApiHub getVersion Sample", - "origin": "API_DEFINITION", - "description": " Get details about the API version of an API resource. This will include information about the specs and operations present in the API version as well as the deployments linked to it.", - "canonical": true, - "file": "api_hub.get_version.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetVersion", - "fullName": "google.cloud.apihub.v1.ApiHub.GetVersion", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.apihub.v1.Version", - "client": { - "shortName": "ApiHubClient", - "fullName": "google.cloud.apihub.v1.ApiHubClient" - }, - "method": { - "shortName": "GetVersion", - "fullName": "google.cloud.apihub.v1.ApiHub.GetVersion", - "service": { - "shortName": "ApiHub", - "fullName": "google.cloud.apihub.v1.ApiHub" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_ApiHub_ListVersions_async", - "title": "ApiHub listVersions Sample", - "origin": "API_DEFINITION", - "description": " List API versions of an API resource in the API hub.", - "canonical": true, - "file": "api_hub.list_versions.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 126, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListVersions", - "fullName": "google.cloud.apihub.v1.ApiHub.ListVersions", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.apihub.v1.ListVersionsResponse", - "client": { - "shortName": "ApiHubClient", - "fullName": "google.cloud.apihub.v1.ApiHubClient" - }, - "method": { - "shortName": "ListVersions", - "fullName": "google.cloud.apihub.v1.ApiHub.ListVersions", - "service": { - "shortName": "ApiHub", - "fullName": "google.cloud.apihub.v1.ApiHub" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_ApiHub_UpdateVersion_async", - "title": "ApiHub updateVersion Sample", - "origin": "API_DEFINITION", - "description": " Update API version. The following fields in the [version][google.cloud.apihub.v1.Version] can be updated currently: * [display_name][google.cloud.apihub.v1.Version.display_name] * [description][google.cloud.apihub.v1.Version.description] * [documentation][google.cloud.apihub.v1.Version.documentation] * [deployments][google.cloud.apihub.v1.Version.deployments] * [lifecycle][google.cloud.apihub.v1.Version.lifecycle] * [compliance][google.cloud.apihub.v1.Version.compliance] * [accreditation][google.cloud.apihub.v1.Version.accreditation] * [attributes][google.cloud.apihub.v1.Version.attributes] The [update_mask][google.cloud.apihub.v1.UpdateVersionRequest.update_mask] should be used to specify the fields being updated.", - "canonical": true, - "file": "api_hub.update_version.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 61, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateVersion", - "fullName": "google.cloud.apihub.v1.ApiHub.UpdateVersion", - "async": true, - "parameters": [ - { - "name": "version", - "type": ".google.cloud.apihub.v1.Version" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.cloud.apihub.v1.Version", - "client": { - "shortName": "ApiHubClient", - "fullName": "google.cloud.apihub.v1.ApiHubClient" - }, - "method": { - "shortName": "UpdateVersion", - "fullName": "google.cloud.apihub.v1.ApiHub.UpdateVersion", - "service": { - "shortName": "ApiHub", - "fullName": "google.cloud.apihub.v1.ApiHub" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_ApiHub_DeleteVersion_async", - "title": "ApiHub deleteVersion Sample", - "origin": "API_DEFINITION", - "description": " Delete an API version. Version can only be deleted if all underlying specs, operations, definitions and linked deployments are deleted.", - "canonical": true, - "file": "api_hub.delete_version.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 60, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteVersion", - "fullName": "google.cloud.apihub.v1.ApiHub.DeleteVersion", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "force", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "ApiHubClient", - "fullName": "google.cloud.apihub.v1.ApiHubClient" - }, - "method": { - "shortName": "DeleteVersion", - "fullName": "google.cloud.apihub.v1.ApiHub.DeleteVersion", - "service": { - "shortName": "ApiHub", - "fullName": "google.cloud.apihub.v1.ApiHub" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_ApiHub_CreateSpec_async", - "title": "ApiHub createSpec Sample", - "origin": "API_DEFINITION", - "description": " Add a spec to an API version in the API hub. Multiple specs can be added to an API version. Note, while adding a spec, at least one of `contents` or `source_uri` must be provided. If `contents` is provided, then `spec_type` must also be provided. On adding a spec with contents to the version, the operations present in it will be added to the version.Note that the file contents in the spec should be of the same type as defined in the `projects/{project}/locations/{location}/attributes/system-spec-type` attribute associated with spec resource. Note that specs of various types can be uploaded, however parsing of details is supported for OpenAPI spec currently. In order to access the information parsed from the spec, use the [GetSpec][google.cloud.apihub.v1.ApiHub.GetSpec] method. In order to access the raw contents for a particular spec, use the [GetSpecContents][google.cloud.apihub.v1.ApiHub.GetSpecContents] method. In order to access the operations parsed from the spec, use the [ListAPIOperations][google.cloud.apihub.v1.ApiHub.ListApiOperations] method.", - "canonical": true, - "file": "api_hub.create_spec.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 71, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateSpec", - "fullName": "google.cloud.apihub.v1.ApiHub.CreateSpec", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "spec_id", - "type": "TYPE_STRING" - }, - { - "name": "spec", - "type": ".google.cloud.apihub.v1.Spec" - } - ], - "resultType": ".google.cloud.apihub.v1.Spec", - "client": { - "shortName": "ApiHubClient", - "fullName": "google.cloud.apihub.v1.ApiHubClient" - }, - "method": { - "shortName": "CreateSpec", - "fullName": "google.cloud.apihub.v1.ApiHub.CreateSpec", - "service": { - "shortName": "ApiHub", - "fullName": "google.cloud.apihub.v1.ApiHub" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_ApiHub_GetSpec_async", - "title": "ApiHub getSpec Sample", - "origin": "API_DEFINITION", - "description": " Get details about the information parsed from a spec. Note that this method does not return the raw spec contents. Use [GetSpecContents][google.cloud.apihub.v1.ApiHub.GetSpecContents] method to retrieve the same.", - "canonical": true, - "file": "api_hub.get_spec.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetSpec", - "fullName": "google.cloud.apihub.v1.ApiHub.GetSpec", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.apihub.v1.Spec", - "client": { - "shortName": "ApiHubClient", - "fullName": "google.cloud.apihub.v1.ApiHubClient" - }, - "method": { - "shortName": "GetSpec", - "fullName": "google.cloud.apihub.v1.ApiHub.GetSpec", - "service": { - "shortName": "ApiHub", - "fullName": "google.cloud.apihub.v1.ApiHub" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_ApiHub_GetSpecContents_async", - "title": "ApiHub getSpecContents Sample", - "origin": "API_DEFINITION", - "description": " Get spec contents.", - "canonical": true, - "file": "api_hub.get_spec_contents.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetSpecContents", - "fullName": "google.cloud.apihub.v1.ApiHub.GetSpecContents", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.apihub.v1.SpecContents", - "client": { - "shortName": "ApiHubClient", - "fullName": "google.cloud.apihub.v1.ApiHubClient" - }, - "method": { - "shortName": "GetSpecContents", - "fullName": "google.cloud.apihub.v1.ApiHub.GetSpecContents", - "service": { - "shortName": "ApiHub", - "fullName": "google.cloud.apihub.v1.ApiHub" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_ApiHub_ListSpecs_async", - "title": "ApiHub listSpecs Sample", - "origin": "API_DEFINITION", - "description": " List specs corresponding to a particular API resource.", - "canonical": true, - "file": "api_hub.list_specs.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 119, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListSpecs", - "fullName": "google.cloud.apihub.v1.ApiHub.ListSpecs", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.apihub.v1.ListSpecsResponse", - "client": { - "shortName": "ApiHubClient", - "fullName": "google.cloud.apihub.v1.ApiHubClient" - }, - "method": { - "shortName": "ListSpecs", - "fullName": "google.cloud.apihub.v1.ApiHub.ListSpecs", - "service": { - "shortName": "ApiHub", - "fullName": "google.cloud.apihub.v1.ApiHub" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_ApiHub_UpdateSpec_async", - "title": "ApiHub updateSpec Sample", - "origin": "API_DEFINITION", - "description": " Update spec. The following fields in the [spec][google.cloud.apihub.v1.Spec] can be updated: * [display_name][google.cloud.apihub.v1.Spec.display_name] * [source_uri][google.cloud.apihub.v1.Spec.source_uri] * [lint_response][google.cloud.apihub.v1.Spec.lint_response] * [attributes][google.cloud.apihub.v1.Spec.attributes] * [contents][google.cloud.apihub.v1.Spec.contents] * [spec_type][google.cloud.apihub.v1.Spec.spec_type] In case of an OAS spec, updating spec contents can lead to: 1. Creation, deletion and update of operations. 2. Creation, deletion and update of definitions. 3. Update of other info parsed out from the new spec. In case of contents or source_uri being present in update mask, spec_type must also be present. Also, spec_type can not be present in update mask if contents or source_uri is not present. The [update_mask][google.cloud.apihub.v1.UpdateSpecRequest.update_mask] should be used to specify the fields being updated.", - "canonical": true, - "file": "api_hub.update_spec.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 61, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateSpec", - "fullName": "google.cloud.apihub.v1.ApiHub.UpdateSpec", - "async": true, - "parameters": [ - { - "name": "spec", - "type": ".google.cloud.apihub.v1.Spec" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.cloud.apihub.v1.Spec", - "client": { - "shortName": "ApiHubClient", - "fullName": "google.cloud.apihub.v1.ApiHubClient" - }, - "method": { - "shortName": "UpdateSpec", - "fullName": "google.cloud.apihub.v1.ApiHub.UpdateSpec", - "service": { - "shortName": "ApiHub", - "fullName": "google.cloud.apihub.v1.ApiHub" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_ApiHub_DeleteSpec_async", - "title": "ApiHub deleteSpec Sample", - "origin": "API_DEFINITION", - "description": " Delete a spec. Deleting a spec will also delete the associated operations from the version.", - "canonical": true, - "file": "api_hub.delete_spec.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteSpec", - "fullName": "google.cloud.apihub.v1.ApiHub.DeleteSpec", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "ApiHubClient", - "fullName": "google.cloud.apihub.v1.ApiHubClient" - }, - "method": { - "shortName": "DeleteSpec", - "fullName": "google.cloud.apihub.v1.ApiHub.DeleteSpec", - "service": { - "shortName": "ApiHub", - "fullName": "google.cloud.apihub.v1.ApiHub" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_ApiHub_GetApiOperation_async", - "title": "ApiHub getApiOperation Sample", - "origin": "API_DEFINITION", - "description": " Get details about a particular operation in API version.", - "canonical": true, - "file": "api_hub.get_api_operation.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetApiOperation", - "fullName": "google.cloud.apihub.v1.ApiHub.GetApiOperation", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.apihub.v1.ApiOperation", - "client": { - "shortName": "ApiHubClient", - "fullName": "google.cloud.apihub.v1.ApiHubClient" - }, - "method": { - "shortName": "GetApiOperation", - "fullName": "google.cloud.apihub.v1.ApiHub.GetApiOperation", - "service": { - "shortName": "ApiHub", - "fullName": "google.cloud.apihub.v1.ApiHub" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_ApiHub_ListApiOperations_async", - "title": "ApiHub listApiOperations Sample", - "origin": "API_DEFINITION", - "description": " List operations in an API version.", - "canonical": true, - "file": "api_hub.list_api_operations.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 109, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListApiOperations", - "fullName": "google.cloud.apihub.v1.ApiHub.ListApiOperations", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.apihub.v1.ListApiOperationsResponse", - "client": { - "shortName": "ApiHubClient", - "fullName": "google.cloud.apihub.v1.ApiHubClient" - }, - "method": { - "shortName": "ListApiOperations", - "fullName": "google.cloud.apihub.v1.ApiHub.ListApiOperations", - "service": { - "shortName": "ApiHub", - "fullName": "google.cloud.apihub.v1.ApiHub" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_ApiHub_GetDefinition_async", - "title": "ApiHub getDefinition Sample", - "origin": "API_DEFINITION", - "description": " Get details about a definition in an API version.", - "canonical": true, - "file": "api_hub.get_definition.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetDefinition", - "fullName": "google.cloud.apihub.v1.ApiHub.GetDefinition", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.apihub.v1.Definition", - "client": { - "shortName": "ApiHubClient", - "fullName": "google.cloud.apihub.v1.ApiHubClient" - }, - "method": { - "shortName": "GetDefinition", - "fullName": "google.cloud.apihub.v1.ApiHub.GetDefinition", - "service": { - "shortName": "ApiHub", - "fullName": "google.cloud.apihub.v1.ApiHub" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_ApiHub_CreateDeployment_async", - "title": "ApiHub createDeployment Sample", - "origin": "API_DEFINITION", - "description": " Create a deployment resource in the API hub. Once a deployment resource is created, it can be associated with API versions.", - "canonical": true, - "file": "api_hub.create_deployment.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 70, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateDeployment", - "fullName": "google.cloud.apihub.v1.ApiHub.CreateDeployment", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "deployment_id", - "type": "TYPE_STRING" - }, - { - "name": "deployment", - "type": ".google.cloud.apihub.v1.Deployment" - } - ], - "resultType": ".google.cloud.apihub.v1.Deployment", - "client": { - "shortName": "ApiHubClient", - "fullName": "google.cloud.apihub.v1.ApiHubClient" - }, - "method": { - "shortName": "CreateDeployment", - "fullName": "google.cloud.apihub.v1.ApiHub.CreateDeployment", - "service": { - "shortName": "ApiHub", - "fullName": "google.cloud.apihub.v1.ApiHub" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_ApiHub_GetDeployment_async", - "title": "ApiHub getDeployment Sample", - "origin": "API_DEFINITION", - "description": " Get details about a deployment and the API versions linked to it.", - "canonical": true, - "file": "api_hub.get_deployment.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetDeployment", - "fullName": "google.cloud.apihub.v1.ApiHub.GetDeployment", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.apihub.v1.Deployment", - "client": { - "shortName": "ApiHubClient", - "fullName": "google.cloud.apihub.v1.ApiHubClient" - }, - "method": { - "shortName": "GetDeployment", - "fullName": "google.cloud.apihub.v1.ApiHub.GetDeployment", - "service": { - "shortName": "ApiHub", - "fullName": "google.cloud.apihub.v1.ApiHub" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_ApiHub_ListDeployments_async", - "title": "ApiHub listDeployments Sample", - "origin": "API_DEFINITION", - "description": " List deployment resources in the API hub.", - "canonical": true, - "file": "api_hub.list_deployments.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 125, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListDeployments", - "fullName": "google.cloud.apihub.v1.ApiHub.ListDeployments", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.apihub.v1.ListDeploymentsResponse", - "client": { - "shortName": "ApiHubClient", - "fullName": "google.cloud.apihub.v1.ApiHubClient" - }, - "method": { - "shortName": "ListDeployments", - "fullName": "google.cloud.apihub.v1.ApiHub.ListDeployments", - "service": { - "shortName": "ApiHub", - "fullName": "google.cloud.apihub.v1.ApiHub" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_ApiHub_UpdateDeployment_async", - "title": "ApiHub updateDeployment Sample", - "origin": "API_DEFINITION", - "description": " Update a deployment resource in the API hub. The following fields in the [deployment resource][google.cloud.apihub.v1.Deployment] can be updated: * [display_name][google.cloud.apihub.v1.Deployment.display_name] * [description][google.cloud.apihub.v1.Deployment.description] * [documentation][google.cloud.apihub.v1.Deployment.documentation] * [deployment_type][google.cloud.apihub.v1.Deployment.deployment_type] * [resource_uri][google.cloud.apihub.v1.Deployment.resource_uri] * [endpoints][google.cloud.apihub.v1.Deployment.endpoints] * [slo][google.cloud.apihub.v1.Deployment.slo] * [environment][google.cloud.apihub.v1.Deployment.environment] * [attributes][google.cloud.apihub.v1.Deployment.attributes] The [update_mask][google.cloud.apihub.v1.UpdateDeploymentRequest.update_mask] should be used to specify the fields being updated.", - "canonical": true, - "file": "api_hub.update_deployment.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 61, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateDeployment", - "fullName": "google.cloud.apihub.v1.ApiHub.UpdateDeployment", - "async": true, - "parameters": [ - { - "name": "deployment", - "type": ".google.cloud.apihub.v1.Deployment" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.cloud.apihub.v1.Deployment", - "client": { - "shortName": "ApiHubClient", - "fullName": "google.cloud.apihub.v1.ApiHubClient" - }, - "method": { - "shortName": "UpdateDeployment", - "fullName": "google.cloud.apihub.v1.ApiHub.UpdateDeployment", - "service": { - "shortName": "ApiHub", - "fullName": "google.cloud.apihub.v1.ApiHub" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_ApiHub_DeleteDeployment_async", - "title": "ApiHub deleteDeployment Sample", - "origin": "API_DEFINITION", - "description": " Delete a deployment resource in the API hub.", - "canonical": true, - "file": "api_hub.delete_deployment.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteDeployment", - "fullName": "google.cloud.apihub.v1.ApiHub.DeleteDeployment", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "ApiHubClient", - "fullName": "google.cloud.apihub.v1.ApiHubClient" - }, - "method": { - "shortName": "DeleteDeployment", - "fullName": "google.cloud.apihub.v1.ApiHub.DeleteDeployment", - "service": { - "shortName": "ApiHub", - "fullName": "google.cloud.apihub.v1.ApiHub" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_ApiHub_CreateAttribute_async", - "title": "ApiHub createAttribute Sample", - "origin": "API_DEFINITION", - "description": " Create a user defined attribute. Certain pre defined attributes are already created by the API hub. These attributes will have type as `SYSTEM_DEFINED` and can be listed via [ListAttributes][google.cloud.apihub.v1.ApiHub.ListAttributes] method. Allowed values for the same can be updated via [UpdateAttribute][google.cloud.apihub.v1.ApiHub.UpdateAttribute] method.", - "canonical": true, - "file": "api_hub.create_attribute.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 70, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateAttribute", - "fullName": "google.cloud.apihub.v1.ApiHub.CreateAttribute", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "attribute_id", - "type": "TYPE_STRING" - }, - { - "name": "attribute", - "type": ".google.cloud.apihub.v1.Attribute" - } - ], - "resultType": ".google.cloud.apihub.v1.Attribute", - "client": { - "shortName": "ApiHubClient", - "fullName": "google.cloud.apihub.v1.ApiHubClient" - }, - "method": { - "shortName": "CreateAttribute", - "fullName": "google.cloud.apihub.v1.ApiHub.CreateAttribute", - "service": { - "shortName": "ApiHub", - "fullName": "google.cloud.apihub.v1.ApiHub" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_ApiHub_GetAttribute_async", - "title": "ApiHub getAttribute Sample", - "origin": "API_DEFINITION", - "description": " Get details about the attribute.", - "canonical": true, - "file": "api_hub.get_attribute.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetAttribute", - "fullName": "google.cloud.apihub.v1.ApiHub.GetAttribute", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.apihub.v1.Attribute", - "client": { - "shortName": "ApiHubClient", - "fullName": "google.cloud.apihub.v1.ApiHubClient" - }, - "method": { - "shortName": "GetAttribute", - "fullName": "google.cloud.apihub.v1.ApiHub.GetAttribute", - "service": { - "shortName": "ApiHub", - "fullName": "google.cloud.apihub.v1.ApiHub" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_ApiHub_UpdateAttribute_async", - "title": "ApiHub updateAttribute Sample", - "origin": "API_DEFINITION", - "description": " Update the attribute. The following fields in the [Attribute resource][google.cloud.apihub.v1.Attribute] can be updated: * [display_name][google.cloud.apihub.v1.Attribute.display_name] The display name can be updated for user defined attributes only. * [description][google.cloud.apihub.v1.Attribute.description] The description can be updated for user defined attributes only. * [allowed_values][google.cloud.apihub.v1.Attribute.allowed_values] To update the list of allowed values, clients need to use the fetched list of allowed values and add or remove values to or from the same list. The mutable allowed values can be updated for both user defined and System defined attributes. The immutable allowed values cannot be updated or deleted. The updated list of allowed values cannot be empty. If an allowed value that is already used by some resource's attribute is deleted, then the association between the resource and the attribute value will also be deleted. * [cardinality][google.cloud.apihub.v1.Attribute.cardinality] The cardinality can be updated for user defined attributes only. Cardinality can only be increased during an update. The [update_mask][google.cloud.apihub.v1.UpdateAttributeRequest.update_mask] should be used to specify the fields being updated.", - "canonical": true, - "file": "api_hub.update_attribute.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 61, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateAttribute", - "fullName": "google.cloud.apihub.v1.ApiHub.UpdateAttribute", - "async": true, - "parameters": [ - { - "name": "attribute", - "type": ".google.cloud.apihub.v1.Attribute" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.cloud.apihub.v1.Attribute", - "client": { - "shortName": "ApiHubClient", - "fullName": "google.cloud.apihub.v1.ApiHubClient" - }, - "method": { - "shortName": "UpdateAttribute", - "fullName": "google.cloud.apihub.v1.ApiHub.UpdateAttribute", - "service": { - "shortName": "ApiHub", - "fullName": "google.cloud.apihub.v1.ApiHub" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_ApiHub_DeleteAttribute_async", - "title": "ApiHub deleteAttribute Sample", - "origin": "API_DEFINITION", - "description": " Delete an attribute. Note: System defined attributes cannot be deleted. All associations of the attribute being deleted with any API hub resource will also get deleted.", - "canonical": true, - "file": "api_hub.delete_attribute.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteAttribute", - "fullName": "google.cloud.apihub.v1.ApiHub.DeleteAttribute", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "ApiHubClient", - "fullName": "google.cloud.apihub.v1.ApiHubClient" - }, - "method": { - "shortName": "DeleteAttribute", - "fullName": "google.cloud.apihub.v1.ApiHub.DeleteAttribute", - "service": { - "shortName": "ApiHub", - "fullName": "google.cloud.apihub.v1.ApiHub" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_ApiHub_ListAttributes_async", - "title": "ApiHub listAttributes Sample", - "origin": "API_DEFINITION", - "description": " List all attributes.", - "canonical": true, - "file": "api_hub.list_attributes.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 110, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListAttributes", - "fullName": "google.cloud.apihub.v1.ApiHub.ListAttributes", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.apihub.v1.ListAttributesResponse", - "client": { - "shortName": "ApiHubClient", - "fullName": "google.cloud.apihub.v1.ApiHubClient" - }, - "method": { - "shortName": "ListAttributes", - "fullName": "google.cloud.apihub.v1.ApiHub.ListAttributes", - "service": { - "shortName": "ApiHub", - "fullName": "google.cloud.apihub.v1.ApiHub" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_ApiHub_SearchResources_async", - "title": "ApiHub searchResources Sample", - "origin": "API_DEFINITION", - "description": " Search across API-Hub resources.", - "canonical": true, - "file": "api_hub.search_resources.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 100, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SearchResources", - "fullName": "google.cloud.apihub.v1.ApiHub.SearchResources", - "async": true, - "parameters": [ - { - "name": "location", - "type": "TYPE_STRING" - }, - { - "name": "query", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.apihub.v1.SearchResourcesResponse", - "client": { - "shortName": "ApiHubClient", - "fullName": "google.cloud.apihub.v1.ApiHubClient" - }, - "method": { - "shortName": "SearchResources", - "fullName": "google.cloud.apihub.v1.ApiHub.SearchResources", - "service": { - "shortName": "ApiHub", - "fullName": "google.cloud.apihub.v1.ApiHub" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_ApiHub_CreateExternalApi_async", - "title": "ApiHub createExternalApi Sample", - "origin": "API_DEFINITION", - "description": " Create an External API resource in the API hub.", - "canonical": true, - "file": "api_hub.create_external_api.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 71, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateExternalApi", - "fullName": "google.cloud.apihub.v1.ApiHub.CreateExternalApi", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "external_api_id", - "type": "TYPE_STRING" - }, - { - "name": "external_api", - "type": ".google.cloud.apihub.v1.ExternalApi" - } - ], - "resultType": ".google.cloud.apihub.v1.ExternalApi", - "client": { - "shortName": "ApiHubClient", - "fullName": "google.cloud.apihub.v1.ApiHubClient" - }, - "method": { - "shortName": "CreateExternalApi", - "fullName": "google.cloud.apihub.v1.ApiHub.CreateExternalApi", - "service": { - "shortName": "ApiHub", - "fullName": "google.cloud.apihub.v1.ApiHub" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_ApiHub_GetExternalApi_async", - "title": "ApiHub getExternalApi Sample", - "origin": "API_DEFINITION", - "description": " Get details about an External API resource in the API hub.", - "canonical": true, - "file": "api_hub.get_external_api.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetExternalApi", - "fullName": "google.cloud.apihub.v1.ApiHub.GetExternalApi", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.apihub.v1.ExternalApi", - "client": { - "shortName": "ApiHubClient", - "fullName": "google.cloud.apihub.v1.ApiHubClient" - }, - "method": { - "shortName": "GetExternalApi", - "fullName": "google.cloud.apihub.v1.ApiHub.GetExternalApi", - "service": { - "shortName": "ApiHub", - "fullName": "google.cloud.apihub.v1.ApiHub" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_ApiHub_UpdateExternalApi_async", - "title": "ApiHub updateExternalApi Sample", - "origin": "API_DEFINITION", - "description": " Update an External API resource in the API hub. The following fields can be updated: * [display_name][google.cloud.apihub.v1.ExternalApi.display_name] * [description][google.cloud.apihub.v1.ExternalApi.description] * [documentation][google.cloud.apihub.v1.ExternalApi.documentation] * [endpoints][google.cloud.apihub.v1.ExternalApi.endpoints] * [paths][google.cloud.apihub.v1.ExternalApi.paths] The [update_mask][google.cloud.apihub.v1.UpdateExternalApiRequest.update_mask] should be used to specify the fields being updated.", - "canonical": true, - "file": "api_hub.update_external_api.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 61, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateExternalApi", - "fullName": "google.cloud.apihub.v1.ApiHub.UpdateExternalApi", - "async": true, - "parameters": [ - { - "name": "external_api", - "type": ".google.cloud.apihub.v1.ExternalApi" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.cloud.apihub.v1.ExternalApi", - "client": { - "shortName": "ApiHubClient", - "fullName": "google.cloud.apihub.v1.ApiHubClient" - }, - "method": { - "shortName": "UpdateExternalApi", - "fullName": "google.cloud.apihub.v1.ApiHub.UpdateExternalApi", - "service": { - "shortName": "ApiHub", - "fullName": "google.cloud.apihub.v1.ApiHub" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_ApiHub_DeleteExternalApi_async", - "title": "ApiHub deleteExternalApi Sample", - "origin": "API_DEFINITION", - "description": " Delete an External API resource in the API hub.", - "canonical": true, - "file": "api_hub.delete_external_api.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteExternalApi", - "fullName": "google.cloud.apihub.v1.ApiHub.DeleteExternalApi", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "ApiHubClient", - "fullName": "google.cloud.apihub.v1.ApiHubClient" - }, - "method": { - "shortName": "DeleteExternalApi", - "fullName": "google.cloud.apihub.v1.ApiHub.DeleteExternalApi", - "service": { - "shortName": "ApiHub", - "fullName": "google.cloud.apihub.v1.ApiHub" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_ApiHub_ListExternalApis_async", - "title": "ApiHub listExternalApis Sample", - "origin": "API_DEFINITION", - "description": " List External API resources in the API hub.", - "canonical": true, - "file": "api_hub.list_external_apis.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 70, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListExternalApis", - "fullName": "google.cloud.apihub.v1.ApiHub.ListExternalApis", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.apihub.v1.ListExternalApisResponse", - "client": { - "shortName": "ApiHubClient", - "fullName": "google.cloud.apihub.v1.ApiHubClient" - }, - "method": { - "shortName": "ListExternalApis", - "fullName": "google.cloud.apihub.v1.ApiHub.ListExternalApis", - "service": { - "shortName": "ApiHub", - "fullName": "google.cloud.apihub.v1.ApiHub" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_ApiHubDependencies_CreateDependency_async", - "title": "ApiHub createDependency Sample", - "origin": "API_DEFINITION", - "description": " Create a dependency between two entities in the API hub.", - "canonical": true, - "file": "api_hub_dependencies.create_dependency.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 69, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateDependency", - "fullName": "google.cloud.apihub.v1.ApiHubDependencies.CreateDependency", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "dependency_id", - "type": "TYPE_STRING" - }, - { - "name": "dependency", - "type": ".google.cloud.apihub.v1.Dependency" - } - ], - "resultType": ".google.cloud.apihub.v1.Dependency", - "client": { - "shortName": "ApiHubDependenciesClient", - "fullName": "google.cloud.apihub.v1.ApiHubDependenciesClient" - }, - "method": { - "shortName": "CreateDependency", - "fullName": "google.cloud.apihub.v1.ApiHubDependencies.CreateDependency", - "service": { - "shortName": "ApiHubDependencies", - "fullName": "google.cloud.apihub.v1.ApiHubDependencies" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_ApiHubDependencies_GetDependency_async", - "title": "ApiHub getDependency Sample", - "origin": "API_DEFINITION", - "description": " Get details about a dependency resource in the API hub.", - "canonical": true, - "file": "api_hub_dependencies.get_dependency.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetDependency", - "fullName": "google.cloud.apihub.v1.ApiHubDependencies.GetDependency", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.apihub.v1.Dependency", - "client": { - "shortName": "ApiHubDependenciesClient", - "fullName": "google.cloud.apihub.v1.ApiHubDependenciesClient" - }, - "method": { - "shortName": "GetDependency", - "fullName": "google.cloud.apihub.v1.ApiHubDependencies.GetDependency", - "service": { - "shortName": "ApiHubDependencies", - "fullName": "google.cloud.apihub.v1.ApiHubDependencies" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_ApiHubDependencies_UpdateDependency_async", - "title": "ApiHub updateDependency Sample", - "origin": "API_DEFINITION", - "description": " Update a dependency based on the [update_mask][google.cloud.apihub.v1.UpdateDependencyRequest.update_mask] provided in the request. The following fields in the [dependency][google.cloud.apihub.v1.Dependency] can be updated: * [description][google.cloud.apihub.v1.Dependency.description]", - "canonical": true, - "file": "api_hub_dependencies.update_dependency.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 60, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateDependency", - "fullName": "google.cloud.apihub.v1.ApiHubDependencies.UpdateDependency", - "async": true, - "parameters": [ - { - "name": "dependency", - "type": ".google.cloud.apihub.v1.Dependency" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.cloud.apihub.v1.Dependency", - "client": { - "shortName": "ApiHubDependenciesClient", - "fullName": "google.cloud.apihub.v1.ApiHubDependenciesClient" - }, - "method": { - "shortName": "UpdateDependency", - "fullName": "google.cloud.apihub.v1.ApiHubDependencies.UpdateDependency", - "service": { - "shortName": "ApiHubDependencies", - "fullName": "google.cloud.apihub.v1.ApiHubDependencies" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_ApiHubDependencies_DeleteDependency_async", - "title": "ApiHub deleteDependency Sample", - "origin": "API_DEFINITION", - "description": " Delete the dependency resource.", - "canonical": true, - "file": "api_hub_dependencies.delete_dependency.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteDependency", - "fullName": "google.cloud.apihub.v1.ApiHubDependencies.DeleteDependency", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "ApiHubDependenciesClient", - "fullName": "google.cloud.apihub.v1.ApiHubDependenciesClient" - }, - "method": { - "shortName": "DeleteDependency", - "fullName": "google.cloud.apihub.v1.ApiHubDependencies.DeleteDependency", - "service": { - "shortName": "ApiHubDependencies", - "fullName": "google.cloud.apihub.v1.ApiHubDependencies" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_ApiHubDependencies_ListDependencies_async", - "title": "ApiHub listDependencies Sample", - "origin": "API_DEFINITION", - "description": " List dependencies based on the provided filter and pagination parameters.", - "canonical": true, - "file": "api_hub_dependencies.list_dependencies.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 102, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListDependencies", - "fullName": "google.cloud.apihub.v1.ApiHubDependencies.ListDependencies", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.apihub.v1.ListDependenciesResponse", - "client": { - "shortName": "ApiHubDependenciesClient", - "fullName": "google.cloud.apihub.v1.ApiHubDependenciesClient" - }, - "method": { - "shortName": "ListDependencies", - "fullName": "google.cloud.apihub.v1.ApiHubDependencies.ListDependencies", - "service": { - "shortName": "ApiHubDependencies", - "fullName": "google.cloud.apihub.v1.ApiHubDependencies" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_ApiHubPlugin_GetPlugin_async", - "title": "ApiHub getPlugin Sample", - "origin": "API_DEFINITION", - "description": " Get details about an API Hub plugin.", - "canonical": true, - "file": "api_hub_plugin.get_plugin.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetPlugin", - "fullName": "google.cloud.apihub.v1.ApiHubPlugin.GetPlugin", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.apihub.v1.Plugin", - "client": { - "shortName": "ApiHubPluginClient", - "fullName": "google.cloud.apihub.v1.ApiHubPluginClient" - }, - "method": { - "shortName": "GetPlugin", - "fullName": "google.cloud.apihub.v1.ApiHubPlugin.GetPlugin", - "service": { - "shortName": "ApiHubPlugin", - "fullName": "google.cloud.apihub.v1.ApiHubPlugin" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_ApiHubPlugin_EnablePlugin_async", - "title": "ApiHub enablePlugin Sample", - "origin": "API_DEFINITION", - "description": " Enables a plugin. The `state` of the plugin after enabling is `ENABLED`", - "canonical": true, - "file": "api_hub_plugin.enable_plugin.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "EnablePlugin", - "fullName": "google.cloud.apihub.v1.ApiHubPlugin.EnablePlugin", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.apihub.v1.Plugin", - "client": { - "shortName": "ApiHubPluginClient", - "fullName": "google.cloud.apihub.v1.ApiHubPluginClient" - }, - "method": { - "shortName": "EnablePlugin", - "fullName": "google.cloud.apihub.v1.ApiHubPlugin.EnablePlugin", - "service": { - "shortName": "ApiHubPlugin", - "fullName": "google.cloud.apihub.v1.ApiHubPlugin" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_ApiHubPlugin_DisablePlugin_async", - "title": "ApiHub disablePlugin Sample", - "origin": "API_DEFINITION", - "description": " Disables a plugin. The `state` of the plugin after disabling is `DISABLED`", - "canonical": true, - "file": "api_hub_plugin.disable_plugin.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DisablePlugin", - "fullName": "google.cloud.apihub.v1.ApiHubPlugin.DisablePlugin", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.apihub.v1.Plugin", - "client": { - "shortName": "ApiHubPluginClient", - "fullName": "google.cloud.apihub.v1.ApiHubPluginClient" - }, - "method": { - "shortName": "DisablePlugin", - "fullName": "google.cloud.apihub.v1.ApiHubPlugin.DisablePlugin", - "service": { - "shortName": "ApiHubPlugin", - "fullName": "google.cloud.apihub.v1.ApiHubPlugin" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_HostProjectRegistrationService_CreateHostProjectRegistration_async", - "title": "ApiHub createHostProjectRegistration Sample", - "origin": "API_DEFINITION", - "description": " Create a host project registration. A Google cloud project can be registered as a host project if it is not attached as a runtime project to another host project. A project can be registered as a host project only once. Subsequent register calls for the same project will fail.", - "canonical": true, - "file": "host_project_registration_service.create_host_project_registration.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 67, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateHostProjectRegistration", - "fullName": "google.cloud.apihub.v1.HostProjectRegistrationService.CreateHostProjectRegistration", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "host_project_registration_id", - "type": "TYPE_STRING" - }, - { - "name": "host_project_registration", - "type": ".google.cloud.apihub.v1.HostProjectRegistration" - } - ], - "resultType": ".google.cloud.apihub.v1.HostProjectRegistration", - "client": { - "shortName": "HostProjectRegistrationServiceClient", - "fullName": "google.cloud.apihub.v1.HostProjectRegistrationServiceClient" - }, - "method": { - "shortName": "CreateHostProjectRegistration", - "fullName": "google.cloud.apihub.v1.HostProjectRegistrationService.CreateHostProjectRegistration", - "service": { - "shortName": "HostProjectRegistrationService", - "fullName": "google.cloud.apihub.v1.HostProjectRegistrationService" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_HostProjectRegistrationService_GetHostProjectRegistration_async", - "title": "ApiHub getHostProjectRegistration Sample", - "origin": "API_DEFINITION", - "description": " Get a host project registration.", - "canonical": true, - "file": "host_project_registration_service.get_host_project_registration.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetHostProjectRegistration", - "fullName": "google.cloud.apihub.v1.HostProjectRegistrationService.GetHostProjectRegistration", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.apihub.v1.HostProjectRegistration", - "client": { - "shortName": "HostProjectRegistrationServiceClient", - "fullName": "google.cloud.apihub.v1.HostProjectRegistrationServiceClient" - }, - "method": { - "shortName": "GetHostProjectRegistration", - "fullName": "google.cloud.apihub.v1.HostProjectRegistrationService.GetHostProjectRegistration", - "service": { - "shortName": "HostProjectRegistrationService", - "fullName": "google.cloud.apihub.v1.HostProjectRegistrationService" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_HostProjectRegistrationService_ListHostProjectRegistrations_async", - "title": "ApiHub listHostProjectRegistrations Sample", - "origin": "API_DEFINITION", - "description": " Lists host project registrations.", - "canonical": true, - "file": "host_project_registration_service.list_host_project_registrations.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 92, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListHostProjectRegistrations", - "fullName": "google.cloud.apihub.v1.HostProjectRegistrationService.ListHostProjectRegistrations", - "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" - } - ], - "resultType": ".google.cloud.apihub.v1.ListHostProjectRegistrationsResponse", - "client": { - "shortName": "HostProjectRegistrationServiceClient", - "fullName": "google.cloud.apihub.v1.HostProjectRegistrationServiceClient" - }, - "method": { - "shortName": "ListHostProjectRegistrations", - "fullName": "google.cloud.apihub.v1.HostProjectRegistrationService.ListHostProjectRegistrations", - "service": { - "shortName": "HostProjectRegistrationService", - "fullName": "google.cloud.apihub.v1.HostProjectRegistrationService" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_LintingService_GetStyleGuide_async", - "title": "ApiHub getStyleGuide Sample", - "origin": "API_DEFINITION", - "description": " Get the style guide being used for linting.", - "canonical": true, - "file": "linting_service.get_style_guide.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetStyleGuide", - "fullName": "google.cloud.apihub.v1.LintingService.GetStyleGuide", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.apihub.v1.StyleGuide", - "client": { - "shortName": "LintingServiceClient", - "fullName": "google.cloud.apihub.v1.LintingServiceClient" - }, - "method": { - "shortName": "GetStyleGuide", - "fullName": "google.cloud.apihub.v1.LintingService.GetStyleGuide", - "service": { - "shortName": "LintingService", - "fullName": "google.cloud.apihub.v1.LintingService" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_LintingService_UpdateStyleGuide_async", - "title": "ApiHub updateStyleGuide Sample", - "origin": "API_DEFINITION", - "description": " Update the styleGuide to be used for liniting in by API hub.", - "canonical": true, - "file": "linting_service.update_style_guide.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 57, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateStyleGuide", - "fullName": "google.cloud.apihub.v1.LintingService.UpdateStyleGuide", - "async": true, - "parameters": [ - { - "name": "style_guide", - "type": ".google.cloud.apihub.v1.StyleGuide" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.cloud.apihub.v1.StyleGuide", - "client": { - "shortName": "LintingServiceClient", - "fullName": "google.cloud.apihub.v1.LintingServiceClient" - }, - "method": { - "shortName": "UpdateStyleGuide", - "fullName": "google.cloud.apihub.v1.LintingService.UpdateStyleGuide", - "service": { - "shortName": "LintingService", - "fullName": "google.cloud.apihub.v1.LintingService" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_LintingService_GetStyleGuideContents_async", - "title": "ApiHub getStyleGuideContents Sample", - "origin": "API_DEFINITION", - "description": " Get the contents of the style guide.", - "canonical": true, - "file": "linting_service.get_style_guide_contents.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 56, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetStyleGuideContents", - "fullName": "google.cloud.apihub.v1.LintingService.GetStyleGuideContents", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.apihub.v1.StyleGuideContents", - "client": { - "shortName": "LintingServiceClient", - "fullName": "google.cloud.apihub.v1.LintingServiceClient" - }, - "method": { - "shortName": "GetStyleGuideContents", - "fullName": "google.cloud.apihub.v1.LintingService.GetStyleGuideContents", - "service": { - "shortName": "LintingService", - "fullName": "google.cloud.apihub.v1.LintingService" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_LintingService_LintSpec_async", - "title": "ApiHub lintSpec Sample", - "origin": "API_DEFINITION", - "description": " Lints the requested spec and updates the corresponding API Spec with the lint response. This lint response will be available in all subsequent Get and List Spec calls to Core service.", - "canonical": true, - "file": "linting_service.lint_spec.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "LintSpec", - "fullName": "google.cloud.apihub.v1.LintingService.LintSpec", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "LintingServiceClient", - "fullName": "google.cloud.apihub.v1.LintingServiceClient" - }, - "method": { - "shortName": "LintSpec", - "fullName": "google.cloud.apihub.v1.LintingService.LintSpec", - "service": { - "shortName": "LintingService", - "fullName": "google.cloud.apihub.v1.LintingService" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_Provisioning_CreateApiHubInstance_async", - "title": "ApiHub createApiHubInstance Sample", - "origin": "API_DEFINITION", - "description": " Provisions instance resources for the API Hub.", - "canonical": true, - "file": "provisioning.create_api_hub_instance.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 68, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateApiHubInstance", - "fullName": "google.cloud.apihub.v1.Provisioning.CreateApiHubInstance", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "api_hub_instance_id", - "type": "TYPE_STRING" - }, - { - "name": "api_hub_instance", - "type": ".google.cloud.apihub.v1.ApiHubInstance" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "ProvisioningClient", - "fullName": "google.cloud.apihub.v1.ProvisioningClient" - }, - "method": { - "shortName": "CreateApiHubInstance", - "fullName": "google.cloud.apihub.v1.Provisioning.CreateApiHubInstance", - "service": { - "shortName": "Provisioning", - "fullName": "google.cloud.apihub.v1.Provisioning" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_Provisioning_GetApiHubInstance_async", - "title": "ApiHub getApiHubInstance Sample", - "origin": "API_DEFINITION", - "description": " Gets details of a single API Hub instance.", - "canonical": true, - "file": "provisioning.get_api_hub_instance.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetApiHubInstance", - "fullName": "google.cloud.apihub.v1.Provisioning.GetApiHubInstance", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.apihub.v1.ApiHubInstance", - "client": { - "shortName": "ProvisioningClient", - "fullName": "google.cloud.apihub.v1.ProvisioningClient" - }, - "method": { - "shortName": "GetApiHubInstance", - "fullName": "google.cloud.apihub.v1.Provisioning.GetApiHubInstance", - "service": { - "shortName": "Provisioning", - "fullName": "google.cloud.apihub.v1.Provisioning" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_Provisioning_LookupApiHubInstance_async", - "title": "ApiHub lookupApiHubInstance Sample", - "origin": "API_DEFINITION", - "description": " Looks up an Api Hub instance in a given GCP project. There will always be only one Api Hub instance for a GCP project across all locations.", - "canonical": true, - "file": "provisioning.lookup_api_hub_instance.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 56, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "LookupApiHubInstance", - "fullName": "google.cloud.apihub.v1.Provisioning.LookupApiHubInstance", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.apihub.v1.LookupApiHubInstanceResponse", - "client": { - "shortName": "ProvisioningClient", - "fullName": "google.cloud.apihub.v1.ProvisioningClient" - }, - "method": { - "shortName": "LookupApiHubInstance", - "fullName": "google.cloud.apihub.v1.Provisioning.LookupApiHubInstance", - "service": { - "shortName": "Provisioning", - "fullName": "google.cloud.apihub.v1.Provisioning" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_RuntimeProjectAttachmentService_CreateRuntimeProjectAttachment_async", - "title": "ApiHub createRuntimeProjectAttachment Sample", - "origin": "API_DEFINITION", - "description": " Attaches a runtime project to the host project.", - "canonical": true, - "file": "runtime_project_attachment_service.create_runtime_project_attachment.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 67, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateRuntimeProjectAttachment", - "fullName": "google.cloud.apihub.v1.RuntimeProjectAttachmentService.CreateRuntimeProjectAttachment", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "runtime_project_attachment_id", - "type": "TYPE_STRING" - }, - { - "name": "runtime_project_attachment", - "type": ".google.cloud.apihub.v1.RuntimeProjectAttachment" - } - ], - "resultType": ".google.cloud.apihub.v1.RuntimeProjectAttachment", - "client": { - "shortName": "RuntimeProjectAttachmentServiceClient", - "fullName": "google.cloud.apihub.v1.RuntimeProjectAttachmentServiceClient" - }, - "method": { - "shortName": "CreateRuntimeProjectAttachment", - "fullName": "google.cloud.apihub.v1.RuntimeProjectAttachmentService.CreateRuntimeProjectAttachment", - "service": { - "shortName": "RuntimeProjectAttachmentService", - "fullName": "google.cloud.apihub.v1.RuntimeProjectAttachmentService" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_RuntimeProjectAttachmentService_GetRuntimeProjectAttachment_async", - "title": "ApiHub getRuntimeProjectAttachment Sample", - "origin": "API_DEFINITION", - "description": " Gets a runtime project attachment.", - "canonical": true, - "file": "runtime_project_attachment_service.get_runtime_project_attachment.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetRuntimeProjectAttachment", - "fullName": "google.cloud.apihub.v1.RuntimeProjectAttachmentService.GetRuntimeProjectAttachment", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.apihub.v1.RuntimeProjectAttachment", - "client": { - "shortName": "RuntimeProjectAttachmentServiceClient", - "fullName": "google.cloud.apihub.v1.RuntimeProjectAttachmentServiceClient" - }, - "method": { - "shortName": "GetRuntimeProjectAttachment", - "fullName": "google.cloud.apihub.v1.RuntimeProjectAttachmentService.GetRuntimeProjectAttachment", - "service": { - "shortName": "RuntimeProjectAttachmentService", - "fullName": "google.cloud.apihub.v1.RuntimeProjectAttachmentService" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_RuntimeProjectAttachmentService_ListRuntimeProjectAttachments_async", - "title": "ApiHub listRuntimeProjectAttachments Sample", - "origin": "API_DEFINITION", - "description": " List runtime projects attached to the host project.", - "canonical": true, - "file": "runtime_project_attachment_service.list_runtime_project_attachments.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 92, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListRuntimeProjectAttachments", - "fullName": "google.cloud.apihub.v1.RuntimeProjectAttachmentService.ListRuntimeProjectAttachments", - "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" - } - ], - "resultType": ".google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse", - "client": { - "shortName": "RuntimeProjectAttachmentServiceClient", - "fullName": "google.cloud.apihub.v1.RuntimeProjectAttachmentServiceClient" - }, - "method": { - "shortName": "ListRuntimeProjectAttachments", - "fullName": "google.cloud.apihub.v1.RuntimeProjectAttachmentService.ListRuntimeProjectAttachments", - "service": { - "shortName": "RuntimeProjectAttachmentService", - "fullName": "google.cloud.apihub.v1.RuntimeProjectAttachmentService" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_RuntimeProjectAttachmentService_DeleteRuntimeProjectAttachment_async", - "title": "ApiHub deleteRuntimeProjectAttachment Sample", - "origin": "API_DEFINITION", - "description": " Delete a runtime project attachment in the API Hub. This call will detach the runtime project from the host project.", - "canonical": true, - "file": "runtime_project_attachment_service.delete_runtime_project_attachment.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteRuntimeProjectAttachment", - "fullName": "google.cloud.apihub.v1.RuntimeProjectAttachmentService.DeleteRuntimeProjectAttachment", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "RuntimeProjectAttachmentServiceClient", - "fullName": "google.cloud.apihub.v1.RuntimeProjectAttachmentServiceClient" - }, - "method": { - "shortName": "DeleteRuntimeProjectAttachment", - "fullName": "google.cloud.apihub.v1.RuntimeProjectAttachmentService.DeleteRuntimeProjectAttachment", - "service": { - "shortName": "RuntimeProjectAttachmentService", - "fullName": "google.cloud.apihub.v1.RuntimeProjectAttachmentService" - } - } - } - }, - { - "regionTag": "apihub_v1_generated_RuntimeProjectAttachmentService_LookupRuntimeProjectAttachment_async", - "title": "ApiHub lookupRuntimeProjectAttachment Sample", - "origin": "API_DEFINITION", - "description": " Look up a runtime project attachment. This API can be called in the context of any project.", - "canonical": true, - "file": "runtime_project_attachment_service.lookup_runtime_project_attachment.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "LookupRuntimeProjectAttachment", - "fullName": "google.cloud.apihub.v1.RuntimeProjectAttachmentService.LookupRuntimeProjectAttachment", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse", - "client": { - "shortName": "RuntimeProjectAttachmentServiceClient", - "fullName": "google.cloud.apihub.v1.RuntimeProjectAttachmentServiceClient" - }, - "method": { - "shortName": "LookupRuntimeProjectAttachment", - "fullName": "google.cloud.apihub.v1.RuntimeProjectAttachmentService.LookupRuntimeProjectAttachment", - "service": { - "shortName": "RuntimeProjectAttachmentService", - "fullName": "google.cloud.apihub.v1.RuntimeProjectAttachmentService" - } - } - } - } - ] -} diff --git a/owl-bot-staging/google-cloud-apihub/v1/src/index.ts b/owl-bot-staging/google-cloud-apihub/v1/src/index.ts deleted file mode 100644 index dbd2cb2b100..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/src/index.ts +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright 2024 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 v1 from './v1'; -const ApiHubClient = v1.ApiHubClient; -type ApiHubClient = v1.ApiHubClient; -const ApiHubDependenciesClient = v1.ApiHubDependenciesClient; -type ApiHubDependenciesClient = v1.ApiHubDependenciesClient; -const ApiHubPluginClient = v1.ApiHubPluginClient; -type ApiHubPluginClient = v1.ApiHubPluginClient; -const HostProjectRegistrationServiceClient = v1.HostProjectRegistrationServiceClient; -type HostProjectRegistrationServiceClient = v1.HostProjectRegistrationServiceClient; -const LintingServiceClient = v1.LintingServiceClient; -type LintingServiceClient = v1.LintingServiceClient; -const ProvisioningClient = v1.ProvisioningClient; -type ProvisioningClient = v1.ProvisioningClient; -const RuntimeProjectAttachmentServiceClient = v1.RuntimeProjectAttachmentServiceClient; -type RuntimeProjectAttachmentServiceClient = v1.RuntimeProjectAttachmentServiceClient; -export {v1, ApiHubClient, ApiHubDependenciesClient, ApiHubPluginClient, HostProjectRegistrationServiceClient, LintingServiceClient, ProvisioningClient, RuntimeProjectAttachmentServiceClient}; -export default {v1, ApiHubClient, ApiHubDependenciesClient, ApiHubPluginClient, HostProjectRegistrationServiceClient, LintingServiceClient, ProvisioningClient, RuntimeProjectAttachmentServiceClient}; -import * as protos from '../protos/protos'; -export {protos} diff --git a/owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_client.ts b/owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_client.ts deleted file mode 100644 index e815e16fa10..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_client.ts +++ /dev/null @@ -1,6157 +0,0 @@ -// Copyright 2024 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, PaginationCallback, GaxCall, 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/api_hub_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './api_hub_client_config.json'; -const version = require('../../../package.json').version; - -/** - * This service provides all methods related to the API hub. - * @class - * @memberof v1 - */ -export class ApiHubClient { - 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}; - private _universeDomain: string; - private _servicePath: string; - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - locationsClient: LocationsClient; - pathTemplates: {[name: string]: gax.PathTemplate}; - apiHubStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of ApiHubClient. - * - * @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 ApiHubClient({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 ApiHubClient; - if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { - throw new Error('Please set either universe_domain or universeDomain, but not both.'); - } - const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; - this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; - this._servicePath = 'apihub.' + this._universeDomain; - const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; - this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); - const port = opts?.port || staticMembers.port; - const clientConfig = opts?.clientConfig ?? {}; - // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). - if (!opts) { - opts = {fallback: true}; - } else { - opts.fallback = opts.fallback ?? true; - } - 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 !== this._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 = this._servicePath; - - // Set the default scopes in auth client if needed. - if (servicePath === this._servicePath) { - this.auth.defaultScopes = staticMembers.scopes; - } - 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 === 'object' && '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 = { - apiPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apis/{api}' - ), - apiHubInstancePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apiHubInstances/{api_hub_instance}' - ), - apiOperationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}' - ), - attributePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/attributes/{attribute}' - ), - definitionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}' - ), - dependencyPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/dependencies/{dependency}' - ), - deploymentPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/deployments/{deployment}' - ), - externalApiPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/externalApis/{external_api}' - ), - hostProjectRegistrationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/hostProjectRegistrations/{host_project_registration}' - ), - locationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}' - ), - pluginPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/plugins/{plugin}' - ), - projectPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}' - ), - runtimeProjectAttachmentPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}' - ), - specPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}' - ), - styleGuidePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/plugins/{plugin}/styleGuide' - ), - versionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apis/{api}/versions/{version}' - ), - }; - - // 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 = { - listApis: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'apis'), - listVersions: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'versions'), - listSpecs: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'specs'), - listApiOperations: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'apiOperations'), - listDeployments: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'deployments'), - listAttributes: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'attributes'), - searchResources: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'searchResults'), - listExternalApis: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'externalApis') - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.apihub.v1.ApiHub', 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.apiHubStub) { - return this.apiHubStub; - } - - // Put together the "service stub" for - // google.cloud.apihub.v1.ApiHub. - this.apiHubStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.apihub.v1.ApiHub') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.apihub.v1.ApiHub, - 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 apiHubStubMethods = - ['createApi', 'getApi', 'listApis', 'updateApi', 'deleteApi', 'createVersion', 'getVersion', 'listVersions', 'updateVersion', 'deleteVersion', 'createSpec', 'getSpec', 'getSpecContents', 'listSpecs', 'updateSpec', 'deleteSpec', 'getApiOperation', 'listApiOperations', 'getDefinition', 'createDeployment', 'getDeployment', 'listDeployments', 'updateDeployment', 'deleteDeployment', 'createAttribute', 'getAttribute', 'updateAttribute', 'deleteAttribute', 'listAttributes', 'searchResources', 'createExternalApi', 'getExternalApi', 'updateExternalApi', 'deleteExternalApi', 'listExternalApis']; - for (const methodName of apiHubStubMethods) { - const callPromise = this.apiHubStub.then( - stub => (...args: Array<{}>) => { - if (this._terminated) { - return Promise.reject('The client has already been closed.'); - } - const func = stub[methodName]; - return func.apply(stub, args); - }, - (err: Error|null|undefined) => () => { - throw err; - }); - - const descriptor = - this.descriptors.page[methodName] || - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor, - this._opts.fallback - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.apiHubStub; - } - - /** - * The DNS address for this API service. - * @deprecated Use the apiEndpoint method of the client instance. - * @returns {string} The DNS address for this service. - */ - static get servicePath() { - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); - } - return 'apihub.googleapis.com'; - } - - /** - * The DNS address for this API service - same as servicePath. - * @deprecated Use the apiEndpoint method of the client instance. - * @returns {string} The DNS address for this service. - */ - static get apiEndpoint() { - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); - } - return 'apihub.googleapis.com'; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - get apiEndpoint() { - return this._servicePath; - } - - get universeDomain() { - return this._universeDomain; - } - - /** - * 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 -- - // ------------------- -/** - * Create an API resource in the API hub. - * Once an API resource is created, versions can be added to it. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource for the API resource. - * Format: `projects/{project}/locations/{location}` - * @param {string} [request.apiId] - * Optional. The ID to use for the API resource, which will become the final - * component of the API's resource name. This field is optional. - * - * * If provided, the same will be used. The service will throw an error if - * the specified id is already used by another API resource in the API hub. - * * If not provided, a system generated id will be used. - * - * This value should be 4-500 characters, and valid characters - * are /{@link protos.A-Z|a-z}[0-9]-_/. - * @param {google.cloud.apihub.v1.Api} request.api - * Required. The API resource to create. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.apihub.v1.Api|Api}. - * 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/api_hub.create_api.js - * region_tag:apihub_v1_generated_ApiHub_CreateApi_async - */ - createApi( - request?: protos.google.cloud.apihub.v1.ICreateApiRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apihub.v1.IApi, - protos.google.cloud.apihub.v1.ICreateApiRequest|undefined, {}|undefined - ]>; - createApi( - request: protos.google.cloud.apihub.v1.ICreateApiRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.apihub.v1.IApi, - protos.google.cloud.apihub.v1.ICreateApiRequest|null|undefined, - {}|null|undefined>): void; - createApi( - request: protos.google.cloud.apihub.v1.ICreateApiRequest, - callback: Callback< - protos.google.cloud.apihub.v1.IApi, - protos.google.cloud.apihub.v1.ICreateApiRequest|null|undefined, - {}|null|undefined>): void; - createApi( - request?: protos.google.cloud.apihub.v1.ICreateApiRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.apihub.v1.IApi, - protos.google.cloud.apihub.v1.ICreateApiRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.apihub.v1.IApi, - protos.google.cloud.apihub.v1.ICreateApiRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.apihub.v1.IApi, - protos.google.cloud.apihub.v1.ICreateApiRequest|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.createApi(request, options, callback); - } -/** - * Get API resource details including the API versions contained in it. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the API resource to retrieve. - * Format: `projects/{project}/locations/{location}/apis/{api}` - * @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.apihub.v1.Api|Api}. - * 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/api_hub.get_api.js - * region_tag:apihub_v1_generated_ApiHub_GetApi_async - */ - getApi( - request?: protos.google.cloud.apihub.v1.IGetApiRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apihub.v1.IApi, - protos.google.cloud.apihub.v1.IGetApiRequest|undefined, {}|undefined - ]>; - getApi( - request: protos.google.cloud.apihub.v1.IGetApiRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.apihub.v1.IApi, - protos.google.cloud.apihub.v1.IGetApiRequest|null|undefined, - {}|null|undefined>): void; - getApi( - request: protos.google.cloud.apihub.v1.IGetApiRequest, - callback: Callback< - protos.google.cloud.apihub.v1.IApi, - protos.google.cloud.apihub.v1.IGetApiRequest|null|undefined, - {}|null|undefined>): void; - getApi( - request?: protos.google.cloud.apihub.v1.IGetApiRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.apihub.v1.IApi, - protos.google.cloud.apihub.v1.IGetApiRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.apihub.v1.IApi, - protos.google.cloud.apihub.v1.IGetApiRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.apihub.v1.IApi, - protos.google.cloud.apihub.v1.IGetApiRequest|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.getApi(request, options, callback); - } -/** - * Update an API resource in the API hub. The following fields in the - * {@link protos.|API} can be updated: - * - * * {@link protos.google.cloud.apihub.v1.Api.display_name|display_name} - * * {@link protos.google.cloud.apihub.v1.Api.description|description} - * * {@link protos.google.cloud.apihub.v1.Api.owner|owner} - * * {@link protos.google.cloud.apihub.v1.Api.documentation|documentation} - * * {@link protos.google.cloud.apihub.v1.Api.target_user|target_user} - * * {@link protos.google.cloud.apihub.v1.Api.team|team} - * * {@link protos.google.cloud.apihub.v1.Api.business_unit|business_unit} - * * {@link protos.google.cloud.apihub.v1.Api.maturity_level|maturity_level} - * * {@link protos.google.cloud.apihub.v1.Api.attributes|attributes} - * - * The - * {@link protos.google.cloud.apihub.v1.UpdateApiRequest.update_mask|update_mask} - * should be used to specify the fields being updated. - * - * Updating the owner field requires complete owner message - * and updates both owner and email fields. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.apihub.v1.Api} request.api - * Required. The API resource to update. - * - * The API resource's `name` field is used to identify the API resource to - * update. - * Format: `projects/{project}/locations/{location}/apis/{api}` - * @param {google.protobuf.FieldMask} request.updateMask - * Required. The list of fields to update. - * @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.apihub.v1.Api|Api}. - * 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/api_hub.update_api.js - * region_tag:apihub_v1_generated_ApiHub_UpdateApi_async - */ - updateApi( - request?: protos.google.cloud.apihub.v1.IUpdateApiRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apihub.v1.IApi, - protos.google.cloud.apihub.v1.IUpdateApiRequest|undefined, {}|undefined - ]>; - updateApi( - request: protos.google.cloud.apihub.v1.IUpdateApiRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.apihub.v1.IApi, - protos.google.cloud.apihub.v1.IUpdateApiRequest|null|undefined, - {}|null|undefined>): void; - updateApi( - request: protos.google.cloud.apihub.v1.IUpdateApiRequest, - callback: Callback< - protos.google.cloud.apihub.v1.IApi, - protos.google.cloud.apihub.v1.IUpdateApiRequest|null|undefined, - {}|null|undefined>): void; - updateApi( - request?: protos.google.cloud.apihub.v1.IUpdateApiRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.apihub.v1.IApi, - protos.google.cloud.apihub.v1.IUpdateApiRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.apihub.v1.IApi, - protos.google.cloud.apihub.v1.IUpdateApiRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.apihub.v1.IApi, - protos.google.cloud.apihub.v1.IUpdateApiRequest|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({ - 'api.name': request.api!.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.updateApi(request, options, callback); - } -/** - * Delete an API resource in the API hub. API can only be deleted if all - * underlying versions are deleted. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the API resource to delete. - * Format: `projects/{project}/locations/{location}/apis/{api}` - * @param {boolean} [request.force] - * Optional. If set to true, any versions from this API will also be deleted. - * Otherwise, the request will only work if the API has no versions. - * @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.protobuf.Empty|Empty}. - * 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/api_hub.delete_api.js - * region_tag:apihub_v1_generated_ApiHub_DeleteApi_async - */ - deleteApi( - request?: protos.google.cloud.apihub.v1.IDeleteApiRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.IDeleteApiRequest|undefined, {}|undefined - ]>; - deleteApi( - request: protos.google.cloud.apihub.v1.IDeleteApiRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.IDeleteApiRequest|null|undefined, - {}|null|undefined>): void; - deleteApi( - request: protos.google.cloud.apihub.v1.IDeleteApiRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.IDeleteApiRequest|null|undefined, - {}|null|undefined>): void; - deleteApi( - request?: protos.google.cloud.apihub.v1.IDeleteApiRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.IDeleteApiRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.IDeleteApiRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.IDeleteApiRequest|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.deleteApi(request, options, callback); - } -/** - * Create an API version for an API resource in the API hub. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource for API version. - * Format: `projects/{project}/locations/{location}/apis/{api}` - * @param {string} [request.versionId] - * Optional. The ID to use for the API version, which will become the final - * component of the version's resource name. This field is optional. - * - * * If provided, the same will be used. The service will throw an error if - * the specified id is already used by another version in the API resource. - * * If not provided, a system generated id will be used. - * - * This value should be 4-500 characters, and valid characters - * are /{@link protos.A-Z|a-z}[0-9]-_/. - * @param {google.cloud.apihub.v1.Version} request.version - * Required. The version to create. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.apihub.v1.Version|Version}. - * 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/api_hub.create_version.js - * region_tag:apihub_v1_generated_ApiHub_CreateVersion_async - */ - createVersion( - request?: protos.google.cloud.apihub.v1.ICreateVersionRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apihub.v1.IVersion, - protos.google.cloud.apihub.v1.ICreateVersionRequest|undefined, {}|undefined - ]>; - createVersion( - request: protos.google.cloud.apihub.v1.ICreateVersionRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.apihub.v1.IVersion, - protos.google.cloud.apihub.v1.ICreateVersionRequest|null|undefined, - {}|null|undefined>): void; - createVersion( - request: protos.google.cloud.apihub.v1.ICreateVersionRequest, - callback: Callback< - protos.google.cloud.apihub.v1.IVersion, - protos.google.cloud.apihub.v1.ICreateVersionRequest|null|undefined, - {}|null|undefined>): void; - createVersion( - request?: protos.google.cloud.apihub.v1.ICreateVersionRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.apihub.v1.IVersion, - protos.google.cloud.apihub.v1.ICreateVersionRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.apihub.v1.IVersion, - protos.google.cloud.apihub.v1.ICreateVersionRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.apihub.v1.IVersion, - protos.google.cloud.apihub.v1.ICreateVersionRequest|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.createVersion(request, options, callback); - } -/** - * Get details about the API version of an API resource. This will include - * information about the specs and operations present in the API - * version as well as the deployments linked to it. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the API version to retrieve. - * Format: - * `projects/{project}/locations/{location}/apis/{api}/versions/{version}` - * @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.apihub.v1.Version|Version}. - * 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/api_hub.get_version.js - * region_tag:apihub_v1_generated_ApiHub_GetVersion_async - */ - getVersion( - request?: protos.google.cloud.apihub.v1.IGetVersionRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apihub.v1.IVersion, - protos.google.cloud.apihub.v1.IGetVersionRequest|undefined, {}|undefined - ]>; - getVersion( - request: protos.google.cloud.apihub.v1.IGetVersionRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.apihub.v1.IVersion, - protos.google.cloud.apihub.v1.IGetVersionRequest|null|undefined, - {}|null|undefined>): void; - getVersion( - request: protos.google.cloud.apihub.v1.IGetVersionRequest, - callback: Callback< - protos.google.cloud.apihub.v1.IVersion, - protos.google.cloud.apihub.v1.IGetVersionRequest|null|undefined, - {}|null|undefined>): void; - getVersion( - request?: protos.google.cloud.apihub.v1.IGetVersionRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.apihub.v1.IVersion, - protos.google.cloud.apihub.v1.IGetVersionRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.apihub.v1.IVersion, - protos.google.cloud.apihub.v1.IGetVersionRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.apihub.v1.IVersion, - protos.google.cloud.apihub.v1.IGetVersionRequest|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.getVersion(request, options, callback); - } -/** - * Update API version. The following fields in the - * {@link protos.google.cloud.apihub.v1.Version|version} can be updated currently: - * - * * {@link protos.google.cloud.apihub.v1.Version.display_name|display_name} - * * {@link protos.google.cloud.apihub.v1.Version.description|description} - * * {@link protos.google.cloud.apihub.v1.Version.documentation|documentation} - * * {@link protos.google.cloud.apihub.v1.Version.deployments|deployments} - * * {@link protos.google.cloud.apihub.v1.Version.lifecycle|lifecycle} - * * {@link protos.google.cloud.apihub.v1.Version.compliance|compliance} - * * {@link protos.google.cloud.apihub.v1.Version.accreditation|accreditation} - * * {@link protos.google.cloud.apihub.v1.Version.attributes|attributes} - * - * The - * {@link protos.google.cloud.apihub.v1.UpdateVersionRequest.update_mask|update_mask} - * should be used to specify the fields being updated. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.apihub.v1.Version} request.version - * Required. The API version to update. - * - * The version's `name` field is used to identify the API version to update. - * Format: - * `projects/{project}/locations/{location}/apis/{api}/versions/{version}` - * @param {google.protobuf.FieldMask} request.updateMask - * Required. The list of fields to update. - * @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.apihub.v1.Version|Version}. - * 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/api_hub.update_version.js - * region_tag:apihub_v1_generated_ApiHub_UpdateVersion_async - */ - updateVersion( - request?: protos.google.cloud.apihub.v1.IUpdateVersionRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apihub.v1.IVersion, - protos.google.cloud.apihub.v1.IUpdateVersionRequest|undefined, {}|undefined - ]>; - updateVersion( - request: protos.google.cloud.apihub.v1.IUpdateVersionRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.apihub.v1.IVersion, - protos.google.cloud.apihub.v1.IUpdateVersionRequest|null|undefined, - {}|null|undefined>): void; - updateVersion( - request: protos.google.cloud.apihub.v1.IUpdateVersionRequest, - callback: Callback< - protos.google.cloud.apihub.v1.IVersion, - protos.google.cloud.apihub.v1.IUpdateVersionRequest|null|undefined, - {}|null|undefined>): void; - updateVersion( - request?: protos.google.cloud.apihub.v1.IUpdateVersionRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.apihub.v1.IVersion, - protos.google.cloud.apihub.v1.IUpdateVersionRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.apihub.v1.IVersion, - protos.google.cloud.apihub.v1.IUpdateVersionRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.apihub.v1.IVersion, - protos.google.cloud.apihub.v1.IUpdateVersionRequest|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({ - 'version.name': request.version!.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.updateVersion(request, options, callback); - } -/** - * Delete an API version. Version can only be deleted if all underlying specs, - * operations, definitions and linked deployments are deleted. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the version to delete. - * Format: - * `projects/{project}/locations/{location}/apis/{api}/versions/{version}` - * @param {boolean} [request.force] - * Optional. If set to true, any specs from this version will also be deleted. - * Otherwise, the request will only work if the version has no specs. - * @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.protobuf.Empty|Empty}. - * 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/api_hub.delete_version.js - * region_tag:apihub_v1_generated_ApiHub_DeleteVersion_async - */ - deleteVersion( - request?: protos.google.cloud.apihub.v1.IDeleteVersionRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.IDeleteVersionRequest|undefined, {}|undefined - ]>; - deleteVersion( - request: protos.google.cloud.apihub.v1.IDeleteVersionRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.IDeleteVersionRequest|null|undefined, - {}|null|undefined>): void; - deleteVersion( - request: protos.google.cloud.apihub.v1.IDeleteVersionRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.IDeleteVersionRequest|null|undefined, - {}|null|undefined>): void; - deleteVersion( - request?: protos.google.cloud.apihub.v1.IDeleteVersionRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.IDeleteVersionRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.IDeleteVersionRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.IDeleteVersionRequest|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.deleteVersion(request, options, callback); - } -/** - * Add a spec to an API version in the API hub. - * Multiple specs can be added to an API version. - * Note, while adding a spec, at least one of `contents` or `source_uri` must - * be provided. If `contents` is provided, then `spec_type` must also be - * provided. - * - * On adding a spec with contents to the version, the operations present in it - * will be added to the version.Note that the file contents in the spec should - * be of the same type as defined in the - * `projects/{project}/locations/{location}/attributes/system-spec-type` - * attribute associated with spec resource. Note that specs of various types - * can be uploaded, however parsing of details is supported for OpenAPI spec - * currently. - * - * In order to access the information parsed from the spec, use the - * {@link protos.google.cloud.apihub.v1.ApiHub.GetSpec|GetSpec} method. - * In order to access the raw contents for a particular spec, use the - * {@link protos.google.cloud.apihub.v1.ApiHub.GetSpecContents|GetSpecContents} method. - * In order to access the operations parsed from the spec, use the - * {@link protos.google.cloud.apihub.v1.ApiHub.ListApiOperations|ListAPIOperations} - * method. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource for Spec. - * Format: - * `projects/{project}/locations/{location}/apis/{api}/versions/{version}` - * @param {string} [request.specId] - * Optional. The ID to use for the spec, which will become the final component - * of the spec's resource name. This field is optional. - * - * * If provided, the same will be used. The service will throw an error if - * the specified id is already used by another spec in the API - * resource. - * * If not provided, a system generated id will be used. - * - * This value should be 4-500 characters, and valid characters - * are /{@link protos.A-Z|a-z}[0-9]-_/. - * @param {google.cloud.apihub.v1.Spec} request.spec - * Required. The spec to create. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.apihub.v1.Spec|Spec}. - * 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/api_hub.create_spec.js - * region_tag:apihub_v1_generated_ApiHub_CreateSpec_async - */ - createSpec( - request?: protos.google.cloud.apihub.v1.ICreateSpecRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apihub.v1.ISpec, - protos.google.cloud.apihub.v1.ICreateSpecRequest|undefined, {}|undefined - ]>; - createSpec( - request: protos.google.cloud.apihub.v1.ICreateSpecRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.apihub.v1.ISpec, - protos.google.cloud.apihub.v1.ICreateSpecRequest|null|undefined, - {}|null|undefined>): void; - createSpec( - request: protos.google.cloud.apihub.v1.ICreateSpecRequest, - callback: Callback< - protos.google.cloud.apihub.v1.ISpec, - protos.google.cloud.apihub.v1.ICreateSpecRequest|null|undefined, - {}|null|undefined>): void; - createSpec( - request?: protos.google.cloud.apihub.v1.ICreateSpecRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.apihub.v1.ISpec, - protos.google.cloud.apihub.v1.ICreateSpecRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.apihub.v1.ISpec, - protos.google.cloud.apihub.v1.ICreateSpecRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.apihub.v1.ISpec, - protos.google.cloud.apihub.v1.ICreateSpecRequest|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.createSpec(request, options, callback); - } -/** - * Get details about the information parsed from a spec. - * Note that this method does not return the raw spec contents. - * Use {@link protos.google.cloud.apihub.v1.ApiHub.GetSpecContents|GetSpecContents} method - * to retrieve the same. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the spec to retrieve. - * Format: - * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}` - * @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.apihub.v1.Spec|Spec}. - * 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/api_hub.get_spec.js - * region_tag:apihub_v1_generated_ApiHub_GetSpec_async - */ - getSpec( - request?: protos.google.cloud.apihub.v1.IGetSpecRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apihub.v1.ISpec, - protos.google.cloud.apihub.v1.IGetSpecRequest|undefined, {}|undefined - ]>; - getSpec( - request: protos.google.cloud.apihub.v1.IGetSpecRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.apihub.v1.ISpec, - protos.google.cloud.apihub.v1.IGetSpecRequest|null|undefined, - {}|null|undefined>): void; - getSpec( - request: protos.google.cloud.apihub.v1.IGetSpecRequest, - callback: Callback< - protos.google.cloud.apihub.v1.ISpec, - protos.google.cloud.apihub.v1.IGetSpecRequest|null|undefined, - {}|null|undefined>): void; - getSpec( - request?: protos.google.cloud.apihub.v1.IGetSpecRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.apihub.v1.ISpec, - protos.google.cloud.apihub.v1.IGetSpecRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.apihub.v1.ISpec, - protos.google.cloud.apihub.v1.IGetSpecRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.apihub.v1.ISpec, - protos.google.cloud.apihub.v1.IGetSpecRequest|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.getSpec(request, options, callback); - } -/** - * Get spec contents. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the spec whose contents need to be retrieved. - * Format: - * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}` - * @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.apihub.v1.SpecContents|SpecContents}. - * 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/api_hub.get_spec_contents.js - * region_tag:apihub_v1_generated_ApiHub_GetSpecContents_async - */ - getSpecContents( - request?: protos.google.cloud.apihub.v1.IGetSpecContentsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apihub.v1.ISpecContents, - protos.google.cloud.apihub.v1.IGetSpecContentsRequest|undefined, {}|undefined - ]>; - getSpecContents( - request: protos.google.cloud.apihub.v1.IGetSpecContentsRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.apihub.v1.ISpecContents, - protos.google.cloud.apihub.v1.IGetSpecContentsRequest|null|undefined, - {}|null|undefined>): void; - getSpecContents( - request: protos.google.cloud.apihub.v1.IGetSpecContentsRequest, - callback: Callback< - protos.google.cloud.apihub.v1.ISpecContents, - protos.google.cloud.apihub.v1.IGetSpecContentsRequest|null|undefined, - {}|null|undefined>): void; - getSpecContents( - request?: protos.google.cloud.apihub.v1.IGetSpecContentsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.apihub.v1.ISpecContents, - protos.google.cloud.apihub.v1.IGetSpecContentsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.apihub.v1.ISpecContents, - protos.google.cloud.apihub.v1.IGetSpecContentsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.apihub.v1.ISpecContents, - protos.google.cloud.apihub.v1.IGetSpecContentsRequest|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.getSpecContents(request, options, callback); - } -/** - * Update spec. The following fields in the - * {@link protos.google.cloud.apihub.v1.Spec|spec} can be updated: - * - * * {@link protos.google.cloud.apihub.v1.Spec.display_name|display_name} - * * {@link protos.google.cloud.apihub.v1.Spec.source_uri|source_uri} - * * {@link protos.google.cloud.apihub.v1.Spec.lint_response|lint_response} - * * {@link protos.google.cloud.apihub.v1.Spec.attributes|attributes} - * * {@link protos.google.cloud.apihub.v1.Spec.contents|contents} - * * {@link protos.google.cloud.apihub.v1.Spec.spec_type|spec_type} - * - * In case of an OAS spec, updating spec contents can lead to: - * 1. Creation, deletion and update of operations. - * 2. Creation, deletion and update of definitions. - * 3. Update of other info parsed out from the new spec. - * - * In case of contents or source_uri being present in update mask, spec_type - * must also be present. Also, spec_type can not be present in update mask if - * contents or source_uri is not present. - * - * The - * {@link protos.google.cloud.apihub.v1.UpdateSpecRequest.update_mask|update_mask} - * should be used to specify the fields being updated. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.apihub.v1.Spec} request.spec - * Required. The spec to update. - * - * The spec's `name` field is used to identify the spec to - * update. Format: - * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}` - * @param {google.protobuf.FieldMask} request.updateMask - * Required. The list of fields to update. - * @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.apihub.v1.Spec|Spec}. - * 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/api_hub.update_spec.js - * region_tag:apihub_v1_generated_ApiHub_UpdateSpec_async - */ - updateSpec( - request?: protos.google.cloud.apihub.v1.IUpdateSpecRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apihub.v1.ISpec, - protos.google.cloud.apihub.v1.IUpdateSpecRequest|undefined, {}|undefined - ]>; - updateSpec( - request: protos.google.cloud.apihub.v1.IUpdateSpecRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.apihub.v1.ISpec, - protos.google.cloud.apihub.v1.IUpdateSpecRequest|null|undefined, - {}|null|undefined>): void; - updateSpec( - request: protos.google.cloud.apihub.v1.IUpdateSpecRequest, - callback: Callback< - protos.google.cloud.apihub.v1.ISpec, - protos.google.cloud.apihub.v1.IUpdateSpecRequest|null|undefined, - {}|null|undefined>): void; - updateSpec( - request?: protos.google.cloud.apihub.v1.IUpdateSpecRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.apihub.v1.ISpec, - protos.google.cloud.apihub.v1.IUpdateSpecRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.apihub.v1.ISpec, - protos.google.cloud.apihub.v1.IUpdateSpecRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.apihub.v1.ISpec, - protos.google.cloud.apihub.v1.IUpdateSpecRequest|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({ - 'spec.name': request.spec!.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.updateSpec(request, options, callback); - } -/** - * Delete a spec. - * Deleting a spec will also delete the associated operations from the - * version. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the spec to delete. - * Format: - * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}` - * @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.protobuf.Empty|Empty}. - * 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/api_hub.delete_spec.js - * region_tag:apihub_v1_generated_ApiHub_DeleteSpec_async - */ - deleteSpec( - request?: protos.google.cloud.apihub.v1.IDeleteSpecRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.IDeleteSpecRequest|undefined, {}|undefined - ]>; - deleteSpec( - request: protos.google.cloud.apihub.v1.IDeleteSpecRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.IDeleteSpecRequest|null|undefined, - {}|null|undefined>): void; - deleteSpec( - request: protos.google.cloud.apihub.v1.IDeleteSpecRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.IDeleteSpecRequest|null|undefined, - {}|null|undefined>): void; - deleteSpec( - request?: protos.google.cloud.apihub.v1.IDeleteSpecRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.IDeleteSpecRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.IDeleteSpecRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.IDeleteSpecRequest|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.deleteSpec(request, options, callback); - } -/** - * Get details about a particular operation in API version. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the operation to retrieve. - * Format: - * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}` - * @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.apihub.v1.ApiOperation|ApiOperation}. - * 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/api_hub.get_api_operation.js - * region_tag:apihub_v1_generated_ApiHub_GetApiOperation_async - */ - getApiOperation( - request?: protos.google.cloud.apihub.v1.IGetApiOperationRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apihub.v1.IApiOperation, - protos.google.cloud.apihub.v1.IGetApiOperationRequest|undefined, {}|undefined - ]>; - getApiOperation( - request: protos.google.cloud.apihub.v1.IGetApiOperationRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.apihub.v1.IApiOperation, - protos.google.cloud.apihub.v1.IGetApiOperationRequest|null|undefined, - {}|null|undefined>): void; - getApiOperation( - request: protos.google.cloud.apihub.v1.IGetApiOperationRequest, - callback: Callback< - protos.google.cloud.apihub.v1.IApiOperation, - protos.google.cloud.apihub.v1.IGetApiOperationRequest|null|undefined, - {}|null|undefined>): void; - getApiOperation( - request?: protos.google.cloud.apihub.v1.IGetApiOperationRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.apihub.v1.IApiOperation, - protos.google.cloud.apihub.v1.IGetApiOperationRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.apihub.v1.IApiOperation, - protos.google.cloud.apihub.v1.IGetApiOperationRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.apihub.v1.IApiOperation, - protos.google.cloud.apihub.v1.IGetApiOperationRequest|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.getApiOperation(request, options, callback); - } -/** - * Get details about a definition in an API version. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the definition to retrieve. - * Format: - * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}` - * @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.apihub.v1.Definition|Definition}. - * 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/api_hub.get_definition.js - * region_tag:apihub_v1_generated_ApiHub_GetDefinition_async - */ - getDefinition( - request?: protos.google.cloud.apihub.v1.IGetDefinitionRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apihub.v1.IDefinition, - protos.google.cloud.apihub.v1.IGetDefinitionRequest|undefined, {}|undefined - ]>; - getDefinition( - request: protos.google.cloud.apihub.v1.IGetDefinitionRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.apihub.v1.IDefinition, - protos.google.cloud.apihub.v1.IGetDefinitionRequest|null|undefined, - {}|null|undefined>): void; - getDefinition( - request: protos.google.cloud.apihub.v1.IGetDefinitionRequest, - callback: Callback< - protos.google.cloud.apihub.v1.IDefinition, - protos.google.cloud.apihub.v1.IGetDefinitionRequest|null|undefined, - {}|null|undefined>): void; - getDefinition( - request?: protos.google.cloud.apihub.v1.IGetDefinitionRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.apihub.v1.IDefinition, - protos.google.cloud.apihub.v1.IGetDefinitionRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.apihub.v1.IDefinition, - protos.google.cloud.apihub.v1.IGetDefinitionRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.apihub.v1.IDefinition, - protos.google.cloud.apihub.v1.IGetDefinitionRequest|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.getDefinition(request, options, callback); - } -/** - * Create a deployment resource in the API hub. - * Once a deployment resource is created, it can be associated with API - * versions. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource for the deployment resource. - * Format: `projects/{project}/locations/{location}` - * @param {string} [request.deploymentId] - * Optional. The ID to use for the deployment resource, which will become the - * final component of the deployment's resource name. This field is optional. - * - * * If provided, the same will be used. The service will throw an error if - * the specified id is already used by another deployment resource in the API - * hub. - * * If not provided, a system generated id will be used. - * - * This value should be 4-500 characters, and valid characters - * are /{@link protos.A-Z|a-z}[0-9]-_/. - * @param {google.cloud.apihub.v1.Deployment} request.deployment - * Required. The deployment resource to create. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.apihub.v1.Deployment|Deployment}. - * 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/api_hub.create_deployment.js - * region_tag:apihub_v1_generated_ApiHub_CreateDeployment_async - */ - createDeployment( - request?: protos.google.cloud.apihub.v1.ICreateDeploymentRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apihub.v1.IDeployment, - protos.google.cloud.apihub.v1.ICreateDeploymentRequest|undefined, {}|undefined - ]>; - createDeployment( - request: protos.google.cloud.apihub.v1.ICreateDeploymentRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.apihub.v1.IDeployment, - protos.google.cloud.apihub.v1.ICreateDeploymentRequest|null|undefined, - {}|null|undefined>): void; - createDeployment( - request: protos.google.cloud.apihub.v1.ICreateDeploymentRequest, - callback: Callback< - protos.google.cloud.apihub.v1.IDeployment, - protos.google.cloud.apihub.v1.ICreateDeploymentRequest|null|undefined, - {}|null|undefined>): void; - createDeployment( - request?: protos.google.cloud.apihub.v1.ICreateDeploymentRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.apihub.v1.IDeployment, - protos.google.cloud.apihub.v1.ICreateDeploymentRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.apihub.v1.IDeployment, - protos.google.cloud.apihub.v1.ICreateDeploymentRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.apihub.v1.IDeployment, - protos.google.cloud.apihub.v1.ICreateDeploymentRequest|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.createDeployment(request, options, callback); - } -/** - * Get details about a deployment and the API versions linked to it. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the deployment resource to retrieve. - * Format: `projects/{project}/locations/{location}/deployments/{deployment}` - * @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.apihub.v1.Deployment|Deployment}. - * 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/api_hub.get_deployment.js - * region_tag:apihub_v1_generated_ApiHub_GetDeployment_async - */ - getDeployment( - request?: protos.google.cloud.apihub.v1.IGetDeploymentRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apihub.v1.IDeployment, - protos.google.cloud.apihub.v1.IGetDeploymentRequest|undefined, {}|undefined - ]>; - getDeployment( - request: protos.google.cloud.apihub.v1.IGetDeploymentRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.apihub.v1.IDeployment, - protos.google.cloud.apihub.v1.IGetDeploymentRequest|null|undefined, - {}|null|undefined>): void; - getDeployment( - request: protos.google.cloud.apihub.v1.IGetDeploymentRequest, - callback: Callback< - protos.google.cloud.apihub.v1.IDeployment, - protos.google.cloud.apihub.v1.IGetDeploymentRequest|null|undefined, - {}|null|undefined>): void; - getDeployment( - request?: protos.google.cloud.apihub.v1.IGetDeploymentRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.apihub.v1.IDeployment, - protos.google.cloud.apihub.v1.IGetDeploymentRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.apihub.v1.IDeployment, - protos.google.cloud.apihub.v1.IGetDeploymentRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.apihub.v1.IDeployment, - protos.google.cloud.apihub.v1.IGetDeploymentRequest|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.getDeployment(request, options, callback); - } -/** - * Update a deployment resource in the API hub. The following fields in the - * {@link protos.google.cloud.apihub.v1.Deployment|deployment resource} can be - * updated: - * - * * {@link protos.google.cloud.apihub.v1.Deployment.display_name|display_name} - * * {@link protos.google.cloud.apihub.v1.Deployment.description|description} - * * {@link protos.google.cloud.apihub.v1.Deployment.documentation|documentation} - * * {@link protos.google.cloud.apihub.v1.Deployment.deployment_type|deployment_type} - * * {@link protos.google.cloud.apihub.v1.Deployment.resource_uri|resource_uri} - * * {@link protos.google.cloud.apihub.v1.Deployment.endpoints|endpoints} - * * {@link protos.google.cloud.apihub.v1.Deployment.slo|slo} - * * {@link protos.google.cloud.apihub.v1.Deployment.environment|environment} - * * {@link protos.google.cloud.apihub.v1.Deployment.attributes|attributes} - * - * The - * {@link protos.google.cloud.apihub.v1.UpdateDeploymentRequest.update_mask|update_mask} - * should be used to specify the fields being updated. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.apihub.v1.Deployment} request.deployment - * Required. The deployment resource to update. - * - * The deployment resource's `name` field is used to identify the deployment - * resource to update. - * Format: `projects/{project}/locations/{location}/deployments/{deployment}` - * @param {google.protobuf.FieldMask} request.updateMask - * Required. The list of fields to update. - * @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.apihub.v1.Deployment|Deployment}. - * 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/api_hub.update_deployment.js - * region_tag:apihub_v1_generated_ApiHub_UpdateDeployment_async - */ - updateDeployment( - request?: protos.google.cloud.apihub.v1.IUpdateDeploymentRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apihub.v1.IDeployment, - protos.google.cloud.apihub.v1.IUpdateDeploymentRequest|undefined, {}|undefined - ]>; - updateDeployment( - request: protos.google.cloud.apihub.v1.IUpdateDeploymentRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.apihub.v1.IDeployment, - protos.google.cloud.apihub.v1.IUpdateDeploymentRequest|null|undefined, - {}|null|undefined>): void; - updateDeployment( - request: protos.google.cloud.apihub.v1.IUpdateDeploymentRequest, - callback: Callback< - protos.google.cloud.apihub.v1.IDeployment, - protos.google.cloud.apihub.v1.IUpdateDeploymentRequest|null|undefined, - {}|null|undefined>): void; - updateDeployment( - request?: protos.google.cloud.apihub.v1.IUpdateDeploymentRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.apihub.v1.IDeployment, - protos.google.cloud.apihub.v1.IUpdateDeploymentRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.apihub.v1.IDeployment, - protos.google.cloud.apihub.v1.IUpdateDeploymentRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.apihub.v1.IDeployment, - protos.google.cloud.apihub.v1.IUpdateDeploymentRequest|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({ - 'deployment.name': request.deployment!.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.updateDeployment(request, options, callback); - } -/** - * Delete a deployment resource in the API hub. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the deployment resource to delete. - * Format: `projects/{project}/locations/{location}/deployments/{deployment}` - * @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.protobuf.Empty|Empty}. - * 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/api_hub.delete_deployment.js - * region_tag:apihub_v1_generated_ApiHub_DeleteDeployment_async - */ - deleteDeployment( - request?: protos.google.cloud.apihub.v1.IDeleteDeploymentRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.IDeleteDeploymentRequest|undefined, {}|undefined - ]>; - deleteDeployment( - request: protos.google.cloud.apihub.v1.IDeleteDeploymentRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.IDeleteDeploymentRequest|null|undefined, - {}|null|undefined>): void; - deleteDeployment( - request: protos.google.cloud.apihub.v1.IDeleteDeploymentRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.IDeleteDeploymentRequest|null|undefined, - {}|null|undefined>): void; - deleteDeployment( - request?: protos.google.cloud.apihub.v1.IDeleteDeploymentRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.IDeleteDeploymentRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.IDeleteDeploymentRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.IDeleteDeploymentRequest|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.deleteDeployment(request, options, callback); - } -/** - * Create a user defined attribute. - * - * Certain pre defined attributes are already created by the API hub. These - * attributes will have type as `SYSTEM_DEFINED` and can be listed via - * {@link protos.google.cloud.apihub.v1.ApiHub.ListAttributes|ListAttributes} method. - * Allowed values for the same can be updated via - * {@link protos.google.cloud.apihub.v1.ApiHub.UpdateAttribute|UpdateAttribute} method. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource for Attribute. - * Format: `projects/{project}/locations/{location}` - * @param {string} [request.attributeId] - * Optional. The ID to use for the attribute, which will become the final - * component of the attribute's resource name. This field is optional. - * - * * If provided, the same will be used. The service will throw an error if - * the specified id is already used by another attribute resource in the API - * hub. - * * If not provided, a system generated id will be used. - * - * This value should be 4-500 characters, and valid characters - * are /{@link protos.A-Z|a-z}[0-9]-_/. - * @param {google.cloud.apihub.v1.Attribute} request.attribute - * Required. The attribute to create. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.apihub.v1.Attribute|Attribute}. - * 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/api_hub.create_attribute.js - * region_tag:apihub_v1_generated_ApiHub_CreateAttribute_async - */ - createAttribute( - request?: protos.google.cloud.apihub.v1.ICreateAttributeRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apihub.v1.IAttribute, - protos.google.cloud.apihub.v1.ICreateAttributeRequest|undefined, {}|undefined - ]>; - createAttribute( - request: protos.google.cloud.apihub.v1.ICreateAttributeRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.apihub.v1.IAttribute, - protos.google.cloud.apihub.v1.ICreateAttributeRequest|null|undefined, - {}|null|undefined>): void; - createAttribute( - request: protos.google.cloud.apihub.v1.ICreateAttributeRequest, - callback: Callback< - protos.google.cloud.apihub.v1.IAttribute, - protos.google.cloud.apihub.v1.ICreateAttributeRequest|null|undefined, - {}|null|undefined>): void; - createAttribute( - request?: protos.google.cloud.apihub.v1.ICreateAttributeRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.apihub.v1.IAttribute, - protos.google.cloud.apihub.v1.ICreateAttributeRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.apihub.v1.IAttribute, - protos.google.cloud.apihub.v1.ICreateAttributeRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.apihub.v1.IAttribute, - protos.google.cloud.apihub.v1.ICreateAttributeRequest|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.createAttribute(request, options, callback); - } -/** - * Get details about the attribute. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the attribute to retrieve. - * Format: - * `projects/{project}/locations/{location}/attributes/{attribute}` - * @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.apihub.v1.Attribute|Attribute}. - * 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/api_hub.get_attribute.js - * region_tag:apihub_v1_generated_ApiHub_GetAttribute_async - */ - getAttribute( - request?: protos.google.cloud.apihub.v1.IGetAttributeRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apihub.v1.IAttribute, - protos.google.cloud.apihub.v1.IGetAttributeRequest|undefined, {}|undefined - ]>; - getAttribute( - request: protos.google.cloud.apihub.v1.IGetAttributeRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.apihub.v1.IAttribute, - protos.google.cloud.apihub.v1.IGetAttributeRequest|null|undefined, - {}|null|undefined>): void; - getAttribute( - request: protos.google.cloud.apihub.v1.IGetAttributeRequest, - callback: Callback< - protos.google.cloud.apihub.v1.IAttribute, - protos.google.cloud.apihub.v1.IGetAttributeRequest|null|undefined, - {}|null|undefined>): void; - getAttribute( - request?: protos.google.cloud.apihub.v1.IGetAttributeRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.apihub.v1.IAttribute, - protos.google.cloud.apihub.v1.IGetAttributeRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.apihub.v1.IAttribute, - protos.google.cloud.apihub.v1.IGetAttributeRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.apihub.v1.IAttribute, - protos.google.cloud.apihub.v1.IGetAttributeRequest|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.getAttribute(request, options, callback); - } -/** - * Update the attribute. The following fields in the - * {@link protos.google.cloud.apihub.v1.Attribute|Attribute resource} can be updated: - * - * * {@link protos.google.cloud.apihub.v1.Attribute.display_name|display_name} - * The display name can be updated for user defined attributes only. - * * {@link protos.google.cloud.apihub.v1.Attribute.description|description} - * The description can be updated for user defined attributes only. - * * {@link protos.google.cloud.apihub.v1.Attribute.allowed_values|allowed_values} - * To update the list of allowed values, clients need to use the fetched list - * of allowed values and add or remove values to or from the same list. - * The mutable allowed values can be updated for both user defined and System - * defined attributes. The immutable allowed values cannot be updated or - * deleted. The updated list of allowed values cannot be empty. If an allowed - * value that is already used by some resource's attribute is deleted, then - * the association between the resource and the attribute value will also be - * deleted. - * * {@link protos.google.cloud.apihub.v1.Attribute.cardinality|cardinality} - * The cardinality can be updated for user defined attributes only. - * Cardinality can only be increased during an update. - * - * The - * {@link protos.google.cloud.apihub.v1.UpdateAttributeRequest.update_mask|update_mask} - * should be used to specify the fields being updated. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.apihub.v1.Attribute} request.attribute - * Required. The attribute to update. - * - * The attribute's `name` field is used to identify the attribute to update. - * Format: - * `projects/{project}/locations/{location}/attributes/{attribute}` - * @param {google.protobuf.FieldMask} request.updateMask - * Required. The list of fields to update. - * @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.apihub.v1.Attribute|Attribute}. - * 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/api_hub.update_attribute.js - * region_tag:apihub_v1_generated_ApiHub_UpdateAttribute_async - */ - updateAttribute( - request?: protos.google.cloud.apihub.v1.IUpdateAttributeRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apihub.v1.IAttribute, - protos.google.cloud.apihub.v1.IUpdateAttributeRequest|undefined, {}|undefined - ]>; - updateAttribute( - request: protos.google.cloud.apihub.v1.IUpdateAttributeRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.apihub.v1.IAttribute, - protos.google.cloud.apihub.v1.IUpdateAttributeRequest|null|undefined, - {}|null|undefined>): void; - updateAttribute( - request: protos.google.cloud.apihub.v1.IUpdateAttributeRequest, - callback: Callback< - protos.google.cloud.apihub.v1.IAttribute, - protos.google.cloud.apihub.v1.IUpdateAttributeRequest|null|undefined, - {}|null|undefined>): void; - updateAttribute( - request?: protos.google.cloud.apihub.v1.IUpdateAttributeRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.apihub.v1.IAttribute, - protos.google.cloud.apihub.v1.IUpdateAttributeRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.apihub.v1.IAttribute, - protos.google.cloud.apihub.v1.IUpdateAttributeRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.apihub.v1.IAttribute, - protos.google.cloud.apihub.v1.IUpdateAttributeRequest|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({ - 'attribute.name': request.attribute!.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.updateAttribute(request, options, callback); - } -/** - * Delete an attribute. - * - * Note: System defined attributes cannot be deleted. All - * associations of the attribute being deleted with any API hub resource will - * also get deleted. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the attribute to delete. - * Format: - * `projects/{project}/locations/{location}/attributes/{attribute}` - * @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.protobuf.Empty|Empty}. - * 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/api_hub.delete_attribute.js - * region_tag:apihub_v1_generated_ApiHub_DeleteAttribute_async - */ - deleteAttribute( - request?: protos.google.cloud.apihub.v1.IDeleteAttributeRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.IDeleteAttributeRequest|undefined, {}|undefined - ]>; - deleteAttribute( - request: protos.google.cloud.apihub.v1.IDeleteAttributeRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.IDeleteAttributeRequest|null|undefined, - {}|null|undefined>): void; - deleteAttribute( - request: protos.google.cloud.apihub.v1.IDeleteAttributeRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.IDeleteAttributeRequest|null|undefined, - {}|null|undefined>): void; - deleteAttribute( - request?: protos.google.cloud.apihub.v1.IDeleteAttributeRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.IDeleteAttributeRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.IDeleteAttributeRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.IDeleteAttributeRequest|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.deleteAttribute(request, options, callback); - } -/** - * Create an External API resource in the API hub. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource for the External API resource. - * Format: `projects/{project}/locations/{location}` - * @param {string} [request.externalApiId] - * Optional. The ID to use for the External API resource, which will become - * the final component of the External API's resource name. This field is - * optional. - * - * * If provided, the same will be used. The service will throw an error if - * the specified id is already used by another External API resource in the - * API hub. - * * If not provided, a system generated id will be used. - * - * This value should be 4-500 characters, and valid characters - * are /{@link protos.A-Z|a-z}[0-9]-_/. - * @param {google.cloud.apihub.v1.ExternalApi} request.externalApi - * Required. The External API resource to create. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.apihub.v1.ExternalApi|ExternalApi}. - * 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/api_hub.create_external_api.js - * region_tag:apihub_v1_generated_ApiHub_CreateExternalApi_async - */ - createExternalApi( - request?: protos.google.cloud.apihub.v1.ICreateExternalApiRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apihub.v1.IExternalApi, - protos.google.cloud.apihub.v1.ICreateExternalApiRequest|undefined, {}|undefined - ]>; - createExternalApi( - request: protos.google.cloud.apihub.v1.ICreateExternalApiRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.apihub.v1.IExternalApi, - protos.google.cloud.apihub.v1.ICreateExternalApiRequest|null|undefined, - {}|null|undefined>): void; - createExternalApi( - request: protos.google.cloud.apihub.v1.ICreateExternalApiRequest, - callback: Callback< - protos.google.cloud.apihub.v1.IExternalApi, - protos.google.cloud.apihub.v1.ICreateExternalApiRequest|null|undefined, - {}|null|undefined>): void; - createExternalApi( - request?: protos.google.cloud.apihub.v1.ICreateExternalApiRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.apihub.v1.IExternalApi, - protos.google.cloud.apihub.v1.ICreateExternalApiRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.apihub.v1.IExternalApi, - protos.google.cloud.apihub.v1.ICreateExternalApiRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.apihub.v1.IExternalApi, - protos.google.cloud.apihub.v1.ICreateExternalApiRequest|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.createExternalApi(request, options, callback); - } -/** - * Get details about an External API resource in the API hub. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the External API resource to retrieve. - * Format: - * `projects/{project}/locations/{location}/externalApis/{externalApi}` - * @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.apihub.v1.ExternalApi|ExternalApi}. - * 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/api_hub.get_external_api.js - * region_tag:apihub_v1_generated_ApiHub_GetExternalApi_async - */ - getExternalApi( - request?: protos.google.cloud.apihub.v1.IGetExternalApiRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apihub.v1.IExternalApi, - protos.google.cloud.apihub.v1.IGetExternalApiRequest|undefined, {}|undefined - ]>; - getExternalApi( - request: protos.google.cloud.apihub.v1.IGetExternalApiRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.apihub.v1.IExternalApi, - protos.google.cloud.apihub.v1.IGetExternalApiRequest|null|undefined, - {}|null|undefined>): void; - getExternalApi( - request: protos.google.cloud.apihub.v1.IGetExternalApiRequest, - callback: Callback< - protos.google.cloud.apihub.v1.IExternalApi, - protos.google.cloud.apihub.v1.IGetExternalApiRequest|null|undefined, - {}|null|undefined>): void; - getExternalApi( - request?: protos.google.cloud.apihub.v1.IGetExternalApiRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.apihub.v1.IExternalApi, - protos.google.cloud.apihub.v1.IGetExternalApiRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.apihub.v1.IExternalApi, - protos.google.cloud.apihub.v1.IGetExternalApiRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.apihub.v1.IExternalApi, - protos.google.cloud.apihub.v1.IGetExternalApiRequest|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.getExternalApi(request, options, callback); - } -/** - * Update an External API resource in the API hub. The following fields can be - * updated: - * - * * {@link protos.google.cloud.apihub.v1.ExternalApi.display_name|display_name} - * * {@link protos.google.cloud.apihub.v1.ExternalApi.description|description} - * * {@link protos.google.cloud.apihub.v1.ExternalApi.documentation|documentation} - * * {@link protos.google.cloud.apihub.v1.ExternalApi.endpoints|endpoints} - * * {@link protos.google.cloud.apihub.v1.ExternalApi.paths|paths} - * - * The - * {@link protos.google.cloud.apihub.v1.UpdateExternalApiRequest.update_mask|update_mask} - * should be used to specify the fields being updated. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.apihub.v1.ExternalApi} request.externalApi - * Required. The External API resource to update. - * - * The External API resource's `name` field is used to identify the External - * API resource to update. Format: - * `projects/{project}/locations/{location}/externalApis/{externalApi}` - * @param {google.protobuf.FieldMask} request.updateMask - * Required. The list of fields to update. - * @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.apihub.v1.ExternalApi|ExternalApi}. - * 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/api_hub.update_external_api.js - * region_tag:apihub_v1_generated_ApiHub_UpdateExternalApi_async - */ - updateExternalApi( - request?: protos.google.cloud.apihub.v1.IUpdateExternalApiRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apihub.v1.IExternalApi, - protos.google.cloud.apihub.v1.IUpdateExternalApiRequest|undefined, {}|undefined - ]>; - updateExternalApi( - request: protos.google.cloud.apihub.v1.IUpdateExternalApiRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.apihub.v1.IExternalApi, - protos.google.cloud.apihub.v1.IUpdateExternalApiRequest|null|undefined, - {}|null|undefined>): void; - updateExternalApi( - request: protos.google.cloud.apihub.v1.IUpdateExternalApiRequest, - callback: Callback< - protos.google.cloud.apihub.v1.IExternalApi, - protos.google.cloud.apihub.v1.IUpdateExternalApiRequest|null|undefined, - {}|null|undefined>): void; - updateExternalApi( - request?: protos.google.cloud.apihub.v1.IUpdateExternalApiRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.apihub.v1.IExternalApi, - protos.google.cloud.apihub.v1.IUpdateExternalApiRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.apihub.v1.IExternalApi, - protos.google.cloud.apihub.v1.IUpdateExternalApiRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.apihub.v1.IExternalApi, - protos.google.cloud.apihub.v1.IUpdateExternalApiRequest|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({ - 'external_api.name': request.externalApi!.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.updateExternalApi(request, options, callback); - } -/** - * Delete an External API resource in the API hub. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the External API resource to delete. - * Format: - * `projects/{project}/locations/{location}/externalApis/{externalApi}` - * @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.protobuf.Empty|Empty}. - * 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/api_hub.delete_external_api.js - * region_tag:apihub_v1_generated_ApiHub_DeleteExternalApi_async - */ - deleteExternalApi( - request?: protos.google.cloud.apihub.v1.IDeleteExternalApiRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.IDeleteExternalApiRequest|undefined, {}|undefined - ]>; - deleteExternalApi( - request: protos.google.cloud.apihub.v1.IDeleteExternalApiRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.IDeleteExternalApiRequest|null|undefined, - {}|null|undefined>): void; - deleteExternalApi( - request: protos.google.cloud.apihub.v1.IDeleteExternalApiRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.IDeleteExternalApiRequest|null|undefined, - {}|null|undefined>): void; - deleteExternalApi( - request?: protos.google.cloud.apihub.v1.IDeleteExternalApiRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.IDeleteExternalApiRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.IDeleteExternalApiRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.IDeleteExternalApiRequest|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.deleteExternalApi(request, options, callback); - } - - /** - * List API resources in the API hub. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent, which owns this collection of API resources. - * Format: `projects/{project}/locations/{location}` - * @param {string} [request.filter] - * Optional. An expression that filters the list of ApiResources. - * - * A filter expression consists of a field name, a comparison - * operator, and a value for filtering. The value must be a string. The - * comparison operator must be one of: `<`, `>`, `:` or `=`. Filters are not - * case sensitive. - * - * The following fields in the `ApiResource` are eligible for filtering: - * - * * `owner.email` - The email of the team which owns the ApiResource. - * Allowed comparison operators: `=`. - * * `create_time` - The time at which the ApiResource was created. The - * value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] - * format. Allowed comparison operators: `>` and `<`. - * * `display_name` - The display name of the ApiResource. Allowed - * comparison operators: `=`. - * * `target_user.enum_values.values.id` - The allowed value id of the - * target users attribute associated with the ApiResource. Allowed - * comparison operator is `:`. - * * `target_user.enum_values.values.display_name` - The allowed value - * display name of the target users attribute associated with the - * ApiResource. Allowed comparison operator is `:`. - * * `team.enum_values.values.id` - The allowed value id of the team - * attribute associated with the ApiResource. Allowed comparison operator is - * `:`. - * * `team.enum_values.values.display_name` - The allowed value display name - * of the team attribute associated with the ApiResource. Allowed comparison - * operator is `:`. - * * `business_unit.enum_values.values.id` - The allowed value id of the - * business unit attribute associated with the ApiResource. Allowed - * comparison operator is `:`. - * * `business_unit.enum_values.values.display_name` - The allowed value - * display name of the business unit attribute associated with the - * ApiResource. Allowed comparison operator is `:`. - * * `maturity_level.enum_values.values.id` - The allowed value id of the - * maturity level attribute associated with the ApiResource. Allowed - * comparison operator is `:`. - * * `maturity_level.enum_values.values.display_name` - The allowed value - * display name of the maturity level attribute associated with the - * ApiResource. Allowed comparison operator is `:`. - * * `api_style.enum_values.values.id` - The allowed value id of the - * api style attribute associated with the ApiResource. Allowed - * comparison operator is `:`. - * * `api_style.enum_values.values.display_name` - The allowed value display - * name of the api style attribute associated with the ApiResource. Allowed - * comparison operator is `:`. - * - * Expressions are combined with either `AND` logic operator or `OR` logical - * operator but not both of them together i.e. only one of the `AND` or `OR` - * operator can be used throughout the filter string and both the operators - * cannot be used together. No other logical operators are supported. At most - * three filter fields are allowed in the filter string and if provided - * more than that then `INVALID_ARGUMENT` error is returned by the API. - * - * Here are a few examples: - * - * * `owner.email = \"apihub@google.com\"` - - The owner team email is - * _apihub@google.com_. - * * `owner.email = \"apihub@google.com\" AND create_time < - * \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - - * The owner team email is _apihub@google.com_ and the api was created - * before _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_. - * * `owner.email = \"apihub@google.com\" OR team.enum_values.values.id: - * apihub-team-id` - The filter string specifies the APIs where the owner - * team email is _apihub@google.com_ or the id of the allowed value - * associated with the team attribute is _apihub-team-id_. - * * `owner.email = \"apihub@google.com\" OR - * team.enum_values.values.display_name: ApiHub Team` - The filter string - * specifies the APIs where the owner team email is _apihub@google.com_ or - * the display name of the allowed value associated with the team attribute - * is `ApiHub Team`. - * @param {number} [request.pageSize] - * Optional. The maximum number of API resources to return. The service may - * return fewer than this value. If unspecified, at most 50 Apis will be - * returned. The maximum value is 1000; values above 1000 will be coerced to - * 1000. - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous `ListApis` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters (except page_size) provided to - * `ListApis` must match the call that provided the page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.cloud.apihub.v1.Api|Api}. - * 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 `listApisAsync()` - * 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. - */ - listApis( - request?: protos.google.cloud.apihub.v1.IListApisRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apihub.v1.IApi[], - protos.google.cloud.apihub.v1.IListApisRequest|null, - protos.google.cloud.apihub.v1.IListApisResponse - ]>; - listApis( - request: protos.google.cloud.apihub.v1.IListApisRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.apihub.v1.IListApisRequest, - protos.google.cloud.apihub.v1.IListApisResponse|null|undefined, - protos.google.cloud.apihub.v1.IApi>): void; - listApis( - request: protos.google.cloud.apihub.v1.IListApisRequest, - callback: PaginationCallback< - protos.google.cloud.apihub.v1.IListApisRequest, - protos.google.cloud.apihub.v1.IListApisResponse|null|undefined, - protos.google.cloud.apihub.v1.IApi>): void; - listApis( - request?: protos.google.cloud.apihub.v1.IListApisRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.apihub.v1.IListApisRequest, - protos.google.cloud.apihub.v1.IListApisResponse|null|undefined, - protos.google.cloud.apihub.v1.IApi>, - callback?: PaginationCallback< - protos.google.cloud.apihub.v1.IListApisRequest, - protos.google.cloud.apihub.v1.IListApisResponse|null|undefined, - protos.google.cloud.apihub.v1.IApi>): - Promise<[ - protos.google.cloud.apihub.v1.IApi[], - protos.google.cloud.apihub.v1.IListApisRequest|null, - protos.google.cloud.apihub.v1.IListApisResponse - ]>|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.listApis(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent, which owns this collection of API resources. - * Format: `projects/{project}/locations/{location}` - * @param {string} [request.filter] - * Optional. An expression that filters the list of ApiResources. - * - * A filter expression consists of a field name, a comparison - * operator, and a value for filtering. The value must be a string. The - * comparison operator must be one of: `<`, `>`, `:` or `=`. Filters are not - * case sensitive. - * - * The following fields in the `ApiResource` are eligible for filtering: - * - * * `owner.email` - The email of the team which owns the ApiResource. - * Allowed comparison operators: `=`. - * * `create_time` - The time at which the ApiResource was created. The - * value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] - * format. Allowed comparison operators: `>` and `<`. - * * `display_name` - The display name of the ApiResource. Allowed - * comparison operators: `=`. - * * `target_user.enum_values.values.id` - The allowed value id of the - * target users attribute associated with the ApiResource. Allowed - * comparison operator is `:`. - * * `target_user.enum_values.values.display_name` - The allowed value - * display name of the target users attribute associated with the - * ApiResource. Allowed comparison operator is `:`. - * * `team.enum_values.values.id` - The allowed value id of the team - * attribute associated with the ApiResource. Allowed comparison operator is - * `:`. - * * `team.enum_values.values.display_name` - The allowed value display name - * of the team attribute associated with the ApiResource. Allowed comparison - * operator is `:`. - * * `business_unit.enum_values.values.id` - The allowed value id of the - * business unit attribute associated with the ApiResource. Allowed - * comparison operator is `:`. - * * `business_unit.enum_values.values.display_name` - The allowed value - * display name of the business unit attribute associated with the - * ApiResource. Allowed comparison operator is `:`. - * * `maturity_level.enum_values.values.id` - The allowed value id of the - * maturity level attribute associated with the ApiResource. Allowed - * comparison operator is `:`. - * * `maturity_level.enum_values.values.display_name` - The allowed value - * display name of the maturity level attribute associated with the - * ApiResource. Allowed comparison operator is `:`. - * * `api_style.enum_values.values.id` - The allowed value id of the - * api style attribute associated with the ApiResource. Allowed - * comparison operator is `:`. - * * `api_style.enum_values.values.display_name` - The allowed value display - * name of the api style attribute associated with the ApiResource. Allowed - * comparison operator is `:`. - * - * Expressions are combined with either `AND` logic operator or `OR` logical - * operator but not both of them together i.e. only one of the `AND` or `OR` - * operator can be used throughout the filter string and both the operators - * cannot be used together. No other logical operators are supported. At most - * three filter fields are allowed in the filter string and if provided - * more than that then `INVALID_ARGUMENT` error is returned by the API. - * - * Here are a few examples: - * - * * `owner.email = \"apihub@google.com\"` - - The owner team email is - * _apihub@google.com_. - * * `owner.email = \"apihub@google.com\" AND create_time < - * \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - - * The owner team email is _apihub@google.com_ and the api was created - * before _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_. - * * `owner.email = \"apihub@google.com\" OR team.enum_values.values.id: - * apihub-team-id` - The filter string specifies the APIs where the owner - * team email is _apihub@google.com_ or the id of the allowed value - * associated with the team attribute is _apihub-team-id_. - * * `owner.email = \"apihub@google.com\" OR - * team.enum_values.values.display_name: ApiHub Team` - The filter string - * specifies the APIs where the owner team email is _apihub@google.com_ or - * the display name of the allowed value associated with the team attribute - * is `ApiHub Team`. - * @param {number} [request.pageSize] - * Optional. The maximum number of API resources to return. The service may - * return fewer than this value. If unspecified, at most 50 Apis will be - * returned. The maximum value is 1000; values above 1000 will be coerced to - * 1000. - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous `ListApis` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters (except page_size) provided to - * `ListApis` must match the call that provided the page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.cloud.apihub.v1.Api|Api} 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 `listApisAsync()` - * 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. - */ - listApisStream( - request?: protos.google.cloud.apihub.v1.IListApisRequest, - 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['listApis']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listApis.createStream( - this.innerApiCalls.listApis as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listApis`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent, which owns this collection of API resources. - * Format: `projects/{project}/locations/{location}` - * @param {string} [request.filter] - * Optional. An expression that filters the list of ApiResources. - * - * A filter expression consists of a field name, a comparison - * operator, and a value for filtering. The value must be a string. The - * comparison operator must be one of: `<`, `>`, `:` or `=`. Filters are not - * case sensitive. - * - * The following fields in the `ApiResource` are eligible for filtering: - * - * * `owner.email` - The email of the team which owns the ApiResource. - * Allowed comparison operators: `=`. - * * `create_time` - The time at which the ApiResource was created. The - * value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] - * format. Allowed comparison operators: `>` and `<`. - * * `display_name` - The display name of the ApiResource. Allowed - * comparison operators: `=`. - * * `target_user.enum_values.values.id` - The allowed value id of the - * target users attribute associated with the ApiResource. Allowed - * comparison operator is `:`. - * * `target_user.enum_values.values.display_name` - The allowed value - * display name of the target users attribute associated with the - * ApiResource. Allowed comparison operator is `:`. - * * `team.enum_values.values.id` - The allowed value id of the team - * attribute associated with the ApiResource. Allowed comparison operator is - * `:`. - * * `team.enum_values.values.display_name` - The allowed value display name - * of the team attribute associated with the ApiResource. Allowed comparison - * operator is `:`. - * * `business_unit.enum_values.values.id` - The allowed value id of the - * business unit attribute associated with the ApiResource. Allowed - * comparison operator is `:`. - * * `business_unit.enum_values.values.display_name` - The allowed value - * display name of the business unit attribute associated with the - * ApiResource. Allowed comparison operator is `:`. - * * `maturity_level.enum_values.values.id` - The allowed value id of the - * maturity level attribute associated with the ApiResource. Allowed - * comparison operator is `:`. - * * `maturity_level.enum_values.values.display_name` - The allowed value - * display name of the maturity level attribute associated with the - * ApiResource. Allowed comparison operator is `:`. - * * `api_style.enum_values.values.id` - The allowed value id of the - * api style attribute associated with the ApiResource. Allowed - * comparison operator is `:`. - * * `api_style.enum_values.values.display_name` - The allowed value display - * name of the api style attribute associated with the ApiResource. Allowed - * comparison operator is `:`. - * - * Expressions are combined with either `AND` logic operator or `OR` logical - * operator but not both of them together i.e. only one of the `AND` or `OR` - * operator can be used throughout the filter string and both the operators - * cannot be used together. No other logical operators are supported. At most - * three filter fields are allowed in the filter string and if provided - * more than that then `INVALID_ARGUMENT` error is returned by the API. - * - * Here are a few examples: - * - * * `owner.email = \"apihub@google.com\"` - - The owner team email is - * _apihub@google.com_. - * * `owner.email = \"apihub@google.com\" AND create_time < - * \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - - * The owner team email is _apihub@google.com_ and the api was created - * before _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_. - * * `owner.email = \"apihub@google.com\" OR team.enum_values.values.id: - * apihub-team-id` - The filter string specifies the APIs where the owner - * team email is _apihub@google.com_ or the id of the allowed value - * associated with the team attribute is _apihub-team-id_. - * * `owner.email = \"apihub@google.com\" OR - * team.enum_values.values.display_name: ApiHub Team` - The filter string - * specifies the APIs where the owner team email is _apihub@google.com_ or - * the display name of the allowed value associated with the team attribute - * is `ApiHub Team`. - * @param {number} [request.pageSize] - * Optional. The maximum number of API resources to return. The service may - * return fewer than this value. If unspecified, at most 50 Apis will be - * returned. The maximum value is 1000; values above 1000 will be coerced to - * 1000. - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous `ListApis` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters (except page_size) provided to - * `ListApis` must match the call that provided the page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@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.apihub.v1.Api|Api}. 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/api_hub.list_apis.js - * region_tag:apihub_v1_generated_ApiHub_ListApis_async - */ - listApisAsync( - request?: protos.google.cloud.apihub.v1.IListApisRequest, - 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['listApis']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listApis.asyncIterate( - this.innerApiCalls['listApis'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * List API versions of an API resource in the API hub. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent which owns this collection of API versions i.e., the - * API resource Format: `projects/{project}/locations/{location}/apis/{api}` - * @param {string} [request.filter] - * Optional. An expression that filters the list of Versions. - * - * A filter expression consists of a field name, a comparison - * operator, and a value for filtering. The value must be a string, a - * number, or a boolean. The comparison operator must be one of: `<`, `>` or - * `=`. Filters are not case sensitive. - * - * The following fields in the `Version` are eligible for filtering: - * - * * `display_name` - The display name of the Version. Allowed - * comparison operators: `=`. - * * `create_time` - The time at which the Version was created. The - * value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] - * format. Allowed comparison operators: `>` and `<`. - * * `lifecycle.enum_values.values.id` - The allowed value id of the - * lifecycle attribute associated with the Version. Allowed comparison - * operators: `:`. - * * `lifecycle.enum_values.values.display_name` - The allowed value display - * name of the lifecycle attribute associated with the Version. Allowed - * comparison operators: `:`. - * * `compliance.enum_values.values.id` - The allowed value id of the - * compliances attribute associated with the Version. Allowed comparison - * operators: `:`. - * * `compliance.enum_values.values.display_name` - The allowed value - * display name of the compliances attribute associated with the Version. - * Allowed comparison operators: `:`. - * * `accreditation.enum_values.values.id` - The allowed value id of the - * accreditations attribute associated with the Version. Allowed - * comparison operators: `:`. - * * `accreditation.enum_values.values.display_name` - The allowed value - * display name of the accreditations attribute associated with the Version. - * Allowed comparison operators: `:`. - * - * Expressions are combined with either `AND` logic operator or `OR` logical - * operator but not both of them together i.e. only one of the `AND` or `OR` - * operator can be used throughout the filter string and both the operators - * cannot be used together. No other logical operators are - * supported. At most three filter fields are allowed in the filter - * string and if provided more than that then `INVALID_ARGUMENT` error is - * returned by the API. - * - * Here are a few examples: - * - * * `lifecycle.enum_values.values.id: preview-id` - The filter string - * specifies that the id of the allowed value associated with the lifecycle - * attribute of the Version is _preview-id_. - * * `lifecycle.enum_values.values.display_name: \"Preview Display Name\"` - - * The filter string specifies that the display name of the allowed value - * associated with the lifecycle attribute of the Version is `Preview - * Display Name`. - * * `lifecycle.enum_values.values.id: preview-id AND create_time < - * \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - - * The id of the allowed value associated with the lifecycle attribute of - * the Version is _preview-id_ and it was created before _2021-08-15 - * 14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_. - * * `compliance.enum_values.values.id: gdpr-id OR - * compliance.enum_values.values.id: pci-dss-id` - * - The id of the allowed value associated with the compliance attribute is - * _gdpr-id_ or _pci-dss-id_. - * @param {number} [request.pageSize] - * Optional. The maximum number of versions to return. The service may return - * fewer than this value. If unspecified, at most 50 versions will be - * returned. The maximum value is 1000; values above 1000 will be coerced to - * 1000. - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous `ListVersions` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters (except page_size) provided to - * `ListVersions` must match the call that provided the page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.cloud.apihub.v1.Version|Version}. - * 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 `listVersionsAsync()` - * 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. - */ - listVersions( - request?: protos.google.cloud.apihub.v1.IListVersionsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apihub.v1.IVersion[], - protos.google.cloud.apihub.v1.IListVersionsRequest|null, - protos.google.cloud.apihub.v1.IListVersionsResponse - ]>; - listVersions( - request: protos.google.cloud.apihub.v1.IListVersionsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.apihub.v1.IListVersionsRequest, - protos.google.cloud.apihub.v1.IListVersionsResponse|null|undefined, - protos.google.cloud.apihub.v1.IVersion>): void; - listVersions( - request: protos.google.cloud.apihub.v1.IListVersionsRequest, - callback: PaginationCallback< - protos.google.cloud.apihub.v1.IListVersionsRequest, - protos.google.cloud.apihub.v1.IListVersionsResponse|null|undefined, - protos.google.cloud.apihub.v1.IVersion>): void; - listVersions( - request?: protos.google.cloud.apihub.v1.IListVersionsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.apihub.v1.IListVersionsRequest, - protos.google.cloud.apihub.v1.IListVersionsResponse|null|undefined, - protos.google.cloud.apihub.v1.IVersion>, - callback?: PaginationCallback< - protos.google.cloud.apihub.v1.IListVersionsRequest, - protos.google.cloud.apihub.v1.IListVersionsResponse|null|undefined, - protos.google.cloud.apihub.v1.IVersion>): - Promise<[ - protos.google.cloud.apihub.v1.IVersion[], - protos.google.cloud.apihub.v1.IListVersionsRequest|null, - protos.google.cloud.apihub.v1.IListVersionsResponse - ]>|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.listVersions(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent which owns this collection of API versions i.e., the - * API resource Format: `projects/{project}/locations/{location}/apis/{api}` - * @param {string} [request.filter] - * Optional. An expression that filters the list of Versions. - * - * A filter expression consists of a field name, a comparison - * operator, and a value for filtering. The value must be a string, a - * number, or a boolean. The comparison operator must be one of: `<`, `>` or - * `=`. Filters are not case sensitive. - * - * The following fields in the `Version` are eligible for filtering: - * - * * `display_name` - The display name of the Version. Allowed - * comparison operators: `=`. - * * `create_time` - The time at which the Version was created. The - * value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] - * format. Allowed comparison operators: `>` and `<`. - * * `lifecycle.enum_values.values.id` - The allowed value id of the - * lifecycle attribute associated with the Version. Allowed comparison - * operators: `:`. - * * `lifecycle.enum_values.values.display_name` - The allowed value display - * name of the lifecycle attribute associated with the Version. Allowed - * comparison operators: `:`. - * * `compliance.enum_values.values.id` - The allowed value id of the - * compliances attribute associated with the Version. Allowed comparison - * operators: `:`. - * * `compliance.enum_values.values.display_name` - The allowed value - * display name of the compliances attribute associated with the Version. - * Allowed comparison operators: `:`. - * * `accreditation.enum_values.values.id` - The allowed value id of the - * accreditations attribute associated with the Version. Allowed - * comparison operators: `:`. - * * `accreditation.enum_values.values.display_name` - The allowed value - * display name of the accreditations attribute associated with the Version. - * Allowed comparison operators: `:`. - * - * Expressions are combined with either `AND` logic operator or `OR` logical - * operator but not both of them together i.e. only one of the `AND` or `OR` - * operator can be used throughout the filter string and both the operators - * cannot be used together. No other logical operators are - * supported. At most three filter fields are allowed in the filter - * string and if provided more than that then `INVALID_ARGUMENT` error is - * returned by the API. - * - * Here are a few examples: - * - * * `lifecycle.enum_values.values.id: preview-id` - The filter string - * specifies that the id of the allowed value associated with the lifecycle - * attribute of the Version is _preview-id_. - * * `lifecycle.enum_values.values.display_name: \"Preview Display Name\"` - - * The filter string specifies that the display name of the allowed value - * associated with the lifecycle attribute of the Version is `Preview - * Display Name`. - * * `lifecycle.enum_values.values.id: preview-id AND create_time < - * \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - - * The id of the allowed value associated with the lifecycle attribute of - * the Version is _preview-id_ and it was created before _2021-08-15 - * 14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_. - * * `compliance.enum_values.values.id: gdpr-id OR - * compliance.enum_values.values.id: pci-dss-id` - * - The id of the allowed value associated with the compliance attribute is - * _gdpr-id_ or _pci-dss-id_. - * @param {number} [request.pageSize] - * Optional. The maximum number of versions to return. The service may return - * fewer than this value. If unspecified, at most 50 versions will be - * returned. The maximum value is 1000; values above 1000 will be coerced to - * 1000. - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous `ListVersions` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters (except page_size) provided to - * `ListVersions` must match the call that provided the page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.cloud.apihub.v1.Version|Version} 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 `listVersionsAsync()` - * 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. - */ - listVersionsStream( - request?: protos.google.cloud.apihub.v1.IListVersionsRequest, - 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['listVersions']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listVersions.createStream( - this.innerApiCalls.listVersions as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listVersions`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent which owns this collection of API versions i.e., the - * API resource Format: `projects/{project}/locations/{location}/apis/{api}` - * @param {string} [request.filter] - * Optional. An expression that filters the list of Versions. - * - * A filter expression consists of a field name, a comparison - * operator, and a value for filtering. The value must be a string, a - * number, or a boolean. The comparison operator must be one of: `<`, `>` or - * `=`. Filters are not case sensitive. - * - * The following fields in the `Version` are eligible for filtering: - * - * * `display_name` - The display name of the Version. Allowed - * comparison operators: `=`. - * * `create_time` - The time at which the Version was created. The - * value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] - * format. Allowed comparison operators: `>` and `<`. - * * `lifecycle.enum_values.values.id` - The allowed value id of the - * lifecycle attribute associated with the Version. Allowed comparison - * operators: `:`. - * * `lifecycle.enum_values.values.display_name` - The allowed value display - * name of the lifecycle attribute associated with the Version. Allowed - * comparison operators: `:`. - * * `compliance.enum_values.values.id` - The allowed value id of the - * compliances attribute associated with the Version. Allowed comparison - * operators: `:`. - * * `compliance.enum_values.values.display_name` - The allowed value - * display name of the compliances attribute associated with the Version. - * Allowed comparison operators: `:`. - * * `accreditation.enum_values.values.id` - The allowed value id of the - * accreditations attribute associated with the Version. Allowed - * comparison operators: `:`. - * * `accreditation.enum_values.values.display_name` - The allowed value - * display name of the accreditations attribute associated with the Version. - * Allowed comparison operators: `:`. - * - * Expressions are combined with either `AND` logic operator or `OR` logical - * operator but not both of them together i.e. only one of the `AND` or `OR` - * operator can be used throughout the filter string and both the operators - * cannot be used together. No other logical operators are - * supported. At most three filter fields are allowed in the filter - * string and if provided more than that then `INVALID_ARGUMENT` error is - * returned by the API. - * - * Here are a few examples: - * - * * `lifecycle.enum_values.values.id: preview-id` - The filter string - * specifies that the id of the allowed value associated with the lifecycle - * attribute of the Version is _preview-id_. - * * `lifecycle.enum_values.values.display_name: \"Preview Display Name\"` - - * The filter string specifies that the display name of the allowed value - * associated with the lifecycle attribute of the Version is `Preview - * Display Name`. - * * `lifecycle.enum_values.values.id: preview-id AND create_time < - * \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - - * The id of the allowed value associated with the lifecycle attribute of - * the Version is _preview-id_ and it was created before _2021-08-15 - * 14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_. - * * `compliance.enum_values.values.id: gdpr-id OR - * compliance.enum_values.values.id: pci-dss-id` - * - The id of the allowed value associated with the compliance attribute is - * _gdpr-id_ or _pci-dss-id_. - * @param {number} [request.pageSize] - * Optional. The maximum number of versions to return. The service may return - * fewer than this value. If unspecified, at most 50 versions will be - * returned. The maximum value is 1000; values above 1000 will be coerced to - * 1000. - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous `ListVersions` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters (except page_size) provided to - * `ListVersions` must match the call that provided the page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@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.apihub.v1.Version|Version}. 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/api_hub.list_versions.js - * region_tag:apihub_v1_generated_ApiHub_ListVersions_async - */ - listVersionsAsync( - request?: protos.google.cloud.apihub.v1.IListVersionsRequest, - 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['listVersions']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listVersions.asyncIterate( - this.innerApiCalls['listVersions'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * List specs corresponding to a particular API resource. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent, which owns this collection of specs. - * Format: - * `projects/{project}/locations/{location}/apis/{api}/versions/{version}` - * @param {string} [request.filter] - * Optional. An expression that filters the list of Specs. - * - * A filter expression consists of a field name, a comparison - * operator, and a value for filtering. The value must be a string. The - * comparison operator must be one of: `<`, `>`, `:` or `=`. Filters are not - * case sensitive. - * - * The following fields in the `Spec` are eligible for filtering: - * - * * `display_name` - The display name of the Spec. Allowed comparison - * operators: `=`. - * * `create_time` - The time at which the Spec was created. The - * value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] - * format. Allowed comparison operators: `>` and `<`. - * * `spec_type.enum_values.values.id` - The allowed value id of the - * spec_type attribute associated with the Spec. Allowed comparison - * operators: `:`. - * * `spec_type.enum_values.values.display_name` - The allowed value display - * name of the spec_type attribute associated with the Spec. Allowed - * comparison operators: `:`. - * * `lint_response.json_values.values` - The json value of the - * lint_response attribute associated with the Spec. Allowed comparison - * operators: `:`. - * * `mime_type` - The MIME type of the Spec. Allowed comparison - * operators: `=`. - * - * Expressions are combined with either `AND` logic operator or `OR` logical - * operator but not both of them together i.e. only one of the `AND` or `OR` - * operator can be used throughout the filter string and both the operators - * cannot be used together. No other logical operators are - * supported. At most three filter fields are allowed in the filter - * string and if provided more than that then `INVALID_ARGUMENT` error is - * returned by the API. - * - * Here are a few examples: - * - * * `spec_type.enum_values.values.id: rest-id` - The filter - * string specifies that the id of the allowed value associated with the - * spec_type attribute is _rest-id_. - * * `spec_type.enum_values.values.display_name: \"Rest Display Name\"` - - * The filter string specifies that the display name of the allowed value - * associated with the spec_type attribute is `Rest Display Name`. - * * `spec_type.enum_values.values.id: grpc-id AND create_time < - * \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - - * The id of the allowed value associated with the spec_type attribute is - * _grpc-id_ and the spec was created before _2021-08-15 14:50:00 UTC_ and - * after _2021-08-10 12:00:00 UTC_. - * * `spec_type.enum_values.values.id: rest-id OR - * spec_type.enum_values.values.id: grpc-id` - * - The id of the allowed value associated with the spec_type attribute is - * _rest-id_ or _grpc-id_. - * @param {number} [request.pageSize] - * Optional. The maximum number of specs to return. The service may return - * fewer than this value. If unspecified, at most 50 specs will be - * returned. The maximum value is 1000; values above 1000 will be coerced to - * 1000. - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous `ListSpecs` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to `ListSpecs` must - * match the call that provided the page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.cloud.apihub.v1.Spec|Spec}. - * 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 `listSpecsAsync()` - * 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. - */ - listSpecs( - request?: protos.google.cloud.apihub.v1.IListSpecsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apihub.v1.ISpec[], - protos.google.cloud.apihub.v1.IListSpecsRequest|null, - protos.google.cloud.apihub.v1.IListSpecsResponse - ]>; - listSpecs( - request: protos.google.cloud.apihub.v1.IListSpecsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.apihub.v1.IListSpecsRequest, - protos.google.cloud.apihub.v1.IListSpecsResponse|null|undefined, - protos.google.cloud.apihub.v1.ISpec>): void; - listSpecs( - request: protos.google.cloud.apihub.v1.IListSpecsRequest, - callback: PaginationCallback< - protos.google.cloud.apihub.v1.IListSpecsRequest, - protos.google.cloud.apihub.v1.IListSpecsResponse|null|undefined, - protos.google.cloud.apihub.v1.ISpec>): void; - listSpecs( - request?: protos.google.cloud.apihub.v1.IListSpecsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.apihub.v1.IListSpecsRequest, - protos.google.cloud.apihub.v1.IListSpecsResponse|null|undefined, - protos.google.cloud.apihub.v1.ISpec>, - callback?: PaginationCallback< - protos.google.cloud.apihub.v1.IListSpecsRequest, - protos.google.cloud.apihub.v1.IListSpecsResponse|null|undefined, - protos.google.cloud.apihub.v1.ISpec>): - Promise<[ - protos.google.cloud.apihub.v1.ISpec[], - protos.google.cloud.apihub.v1.IListSpecsRequest|null, - protos.google.cloud.apihub.v1.IListSpecsResponse - ]>|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.listSpecs(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent, which owns this collection of specs. - * Format: - * `projects/{project}/locations/{location}/apis/{api}/versions/{version}` - * @param {string} [request.filter] - * Optional. An expression that filters the list of Specs. - * - * A filter expression consists of a field name, a comparison - * operator, and a value for filtering. The value must be a string. The - * comparison operator must be one of: `<`, `>`, `:` or `=`. Filters are not - * case sensitive. - * - * The following fields in the `Spec` are eligible for filtering: - * - * * `display_name` - The display name of the Spec. Allowed comparison - * operators: `=`. - * * `create_time` - The time at which the Spec was created. The - * value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] - * format. Allowed comparison operators: `>` and `<`. - * * `spec_type.enum_values.values.id` - The allowed value id of the - * spec_type attribute associated with the Spec. Allowed comparison - * operators: `:`. - * * `spec_type.enum_values.values.display_name` - The allowed value display - * name of the spec_type attribute associated with the Spec. Allowed - * comparison operators: `:`. - * * `lint_response.json_values.values` - The json value of the - * lint_response attribute associated with the Spec. Allowed comparison - * operators: `:`. - * * `mime_type` - The MIME type of the Spec. Allowed comparison - * operators: `=`. - * - * Expressions are combined with either `AND` logic operator or `OR` logical - * operator but not both of them together i.e. only one of the `AND` or `OR` - * operator can be used throughout the filter string and both the operators - * cannot be used together. No other logical operators are - * supported. At most three filter fields are allowed in the filter - * string and if provided more than that then `INVALID_ARGUMENT` error is - * returned by the API. - * - * Here are a few examples: - * - * * `spec_type.enum_values.values.id: rest-id` - The filter - * string specifies that the id of the allowed value associated with the - * spec_type attribute is _rest-id_. - * * `spec_type.enum_values.values.display_name: \"Rest Display Name\"` - - * The filter string specifies that the display name of the allowed value - * associated with the spec_type attribute is `Rest Display Name`. - * * `spec_type.enum_values.values.id: grpc-id AND create_time < - * \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - - * The id of the allowed value associated with the spec_type attribute is - * _grpc-id_ and the spec was created before _2021-08-15 14:50:00 UTC_ and - * after _2021-08-10 12:00:00 UTC_. - * * `spec_type.enum_values.values.id: rest-id OR - * spec_type.enum_values.values.id: grpc-id` - * - The id of the allowed value associated with the spec_type attribute is - * _rest-id_ or _grpc-id_. - * @param {number} [request.pageSize] - * Optional. The maximum number of specs to return. The service may return - * fewer than this value. If unspecified, at most 50 specs will be - * returned. The maximum value is 1000; values above 1000 will be coerced to - * 1000. - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous `ListSpecs` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to `ListSpecs` must - * match the call that provided the page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.cloud.apihub.v1.Spec|Spec} 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 `listSpecsAsync()` - * 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. - */ - listSpecsStream( - request?: protos.google.cloud.apihub.v1.IListSpecsRequest, - 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['listSpecs']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listSpecs.createStream( - this.innerApiCalls.listSpecs as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listSpecs`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent, which owns this collection of specs. - * Format: - * `projects/{project}/locations/{location}/apis/{api}/versions/{version}` - * @param {string} [request.filter] - * Optional. An expression that filters the list of Specs. - * - * A filter expression consists of a field name, a comparison - * operator, and a value for filtering. The value must be a string. The - * comparison operator must be one of: `<`, `>`, `:` or `=`. Filters are not - * case sensitive. - * - * The following fields in the `Spec` are eligible for filtering: - * - * * `display_name` - The display name of the Spec. Allowed comparison - * operators: `=`. - * * `create_time` - The time at which the Spec was created. The - * value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] - * format. Allowed comparison operators: `>` and `<`. - * * `spec_type.enum_values.values.id` - The allowed value id of the - * spec_type attribute associated with the Spec. Allowed comparison - * operators: `:`. - * * `spec_type.enum_values.values.display_name` - The allowed value display - * name of the spec_type attribute associated with the Spec. Allowed - * comparison operators: `:`. - * * `lint_response.json_values.values` - The json value of the - * lint_response attribute associated with the Spec. Allowed comparison - * operators: `:`. - * * `mime_type` - The MIME type of the Spec. Allowed comparison - * operators: `=`. - * - * Expressions are combined with either `AND` logic operator or `OR` logical - * operator but not both of them together i.e. only one of the `AND` or `OR` - * operator can be used throughout the filter string and both the operators - * cannot be used together. No other logical operators are - * supported. At most three filter fields are allowed in the filter - * string and if provided more than that then `INVALID_ARGUMENT` error is - * returned by the API. - * - * Here are a few examples: - * - * * `spec_type.enum_values.values.id: rest-id` - The filter - * string specifies that the id of the allowed value associated with the - * spec_type attribute is _rest-id_. - * * `spec_type.enum_values.values.display_name: \"Rest Display Name\"` - - * The filter string specifies that the display name of the allowed value - * associated with the spec_type attribute is `Rest Display Name`. - * * `spec_type.enum_values.values.id: grpc-id AND create_time < - * \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - - * The id of the allowed value associated with the spec_type attribute is - * _grpc-id_ and the spec was created before _2021-08-15 14:50:00 UTC_ and - * after _2021-08-10 12:00:00 UTC_. - * * `spec_type.enum_values.values.id: rest-id OR - * spec_type.enum_values.values.id: grpc-id` - * - The id of the allowed value associated with the spec_type attribute is - * _rest-id_ or _grpc-id_. - * @param {number} [request.pageSize] - * Optional. The maximum number of specs to return. The service may return - * fewer than this value. If unspecified, at most 50 specs will be - * returned. The maximum value is 1000; values above 1000 will be coerced to - * 1000. - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous `ListSpecs` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to `ListSpecs` must - * match the call that provided the page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@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.apihub.v1.Spec|Spec}. 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/api_hub.list_specs.js - * region_tag:apihub_v1_generated_ApiHub_ListSpecs_async - */ - listSpecsAsync( - request?: protos.google.cloud.apihub.v1.IListSpecsRequest, - 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['listSpecs']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listSpecs.asyncIterate( - this.innerApiCalls['listSpecs'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * List operations in an API version. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent which owns this collection of operations i.e., the API - * version. Format: - * `projects/{project}/locations/{location}/apis/{api}/versions/{version}` - * @param {string} [request.filter] - * Optional. An expression that filters the list of ApiOperations. - * - * A filter expression consists of a field name, a comparison - * operator, and a value for filtering. The value must be a string or a - * boolean. The comparison operator must be one of: `<`, `>` or - * `=`. Filters are not case sensitive. - * - * The following fields in the `ApiOperation` are eligible for filtering: - * * `name` - The ApiOperation resource name. Allowed comparison - * operators: - * `=`. - * * `details.http_operation.path.path` - The http operation's complete path - * relative to server endpoint. Allowed comparison operators: `=`. - * * `details.http_operation.method` - The http operation method type. - * Allowed comparison operators: `=`. - * * `details.deprecated` - Indicates if the ApiOperation is deprecated. - * Allowed values are True / False indicating the deprycation status of the - * ApiOperation. Allowed comparison operators: `=`. - * * `create_time` - The time at which the ApiOperation was created. The - * value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] - * format. Allowed comparison operators: `>` and `<`. - * - * Expressions are combined with either `AND` logic operator or `OR` logical - * operator but not both of them together i.e. only one of the `AND` or `OR` - * operator can be used throughout the filter string and both the operators - * cannot be used together. No other logical operators are supported. At most - * three filter fields are allowed in the filter string and if provided - * more than that then `INVALID_ARGUMENT` error is returned by the API. - * - * Here are a few examples: - * - * * `details.deprecated = True` - The ApiOperation is deprecated. - * * `details.http_operation.method = GET AND create_time < - * \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - - * The method of the http operation of the ApiOperation is _GET_ and the - * spec was created before _2021-08-15 14:50:00 UTC_ and after _2021-08-10 - * 12:00:00 UTC_. - * * `details.http_operation.method = GET OR details.http_operation.method = - * POST`. - The http operation of the method of ApiOperation is _GET_ or - * _POST_. - * @param {number} [request.pageSize] - * Optional. The maximum number of operations to return. The service may - * return fewer than this value. If unspecified, at most 50 operations will be - * returned. The maximum value is 1000; values above 1000 will be coerced to - * 1000. - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous `ListApiOperations` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters (except page_size) provided to - * `ListApiOperations` must match the call that provided the page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.cloud.apihub.v1.ApiOperation|ApiOperation}. - * 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 `listApiOperationsAsync()` - * 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. - */ - listApiOperations( - request?: protos.google.cloud.apihub.v1.IListApiOperationsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apihub.v1.IApiOperation[], - protos.google.cloud.apihub.v1.IListApiOperationsRequest|null, - protos.google.cloud.apihub.v1.IListApiOperationsResponse - ]>; - listApiOperations( - request: protos.google.cloud.apihub.v1.IListApiOperationsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.apihub.v1.IListApiOperationsRequest, - protos.google.cloud.apihub.v1.IListApiOperationsResponse|null|undefined, - protos.google.cloud.apihub.v1.IApiOperation>): void; - listApiOperations( - request: protos.google.cloud.apihub.v1.IListApiOperationsRequest, - callback: PaginationCallback< - protos.google.cloud.apihub.v1.IListApiOperationsRequest, - protos.google.cloud.apihub.v1.IListApiOperationsResponse|null|undefined, - protos.google.cloud.apihub.v1.IApiOperation>): void; - listApiOperations( - request?: protos.google.cloud.apihub.v1.IListApiOperationsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.apihub.v1.IListApiOperationsRequest, - protos.google.cloud.apihub.v1.IListApiOperationsResponse|null|undefined, - protos.google.cloud.apihub.v1.IApiOperation>, - callback?: PaginationCallback< - protos.google.cloud.apihub.v1.IListApiOperationsRequest, - protos.google.cloud.apihub.v1.IListApiOperationsResponse|null|undefined, - protos.google.cloud.apihub.v1.IApiOperation>): - Promise<[ - protos.google.cloud.apihub.v1.IApiOperation[], - protos.google.cloud.apihub.v1.IListApiOperationsRequest|null, - protos.google.cloud.apihub.v1.IListApiOperationsResponse - ]>|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.listApiOperations(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent which owns this collection of operations i.e., the API - * version. Format: - * `projects/{project}/locations/{location}/apis/{api}/versions/{version}` - * @param {string} [request.filter] - * Optional. An expression that filters the list of ApiOperations. - * - * A filter expression consists of a field name, a comparison - * operator, and a value for filtering. The value must be a string or a - * boolean. The comparison operator must be one of: `<`, `>` or - * `=`. Filters are not case sensitive. - * - * The following fields in the `ApiOperation` are eligible for filtering: - * * `name` - The ApiOperation resource name. Allowed comparison - * operators: - * `=`. - * * `details.http_operation.path.path` - The http operation's complete path - * relative to server endpoint. Allowed comparison operators: `=`. - * * `details.http_operation.method` - The http operation method type. - * Allowed comparison operators: `=`. - * * `details.deprecated` - Indicates if the ApiOperation is deprecated. - * Allowed values are True / False indicating the deprycation status of the - * ApiOperation. Allowed comparison operators: `=`. - * * `create_time` - The time at which the ApiOperation was created. The - * value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] - * format. Allowed comparison operators: `>` and `<`. - * - * Expressions are combined with either `AND` logic operator or `OR` logical - * operator but not both of them together i.e. only one of the `AND` or `OR` - * operator can be used throughout the filter string and both the operators - * cannot be used together. No other logical operators are supported. At most - * three filter fields are allowed in the filter string and if provided - * more than that then `INVALID_ARGUMENT` error is returned by the API. - * - * Here are a few examples: - * - * * `details.deprecated = True` - The ApiOperation is deprecated. - * * `details.http_operation.method = GET AND create_time < - * \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - - * The method of the http operation of the ApiOperation is _GET_ and the - * spec was created before _2021-08-15 14:50:00 UTC_ and after _2021-08-10 - * 12:00:00 UTC_. - * * `details.http_operation.method = GET OR details.http_operation.method = - * POST`. - The http operation of the method of ApiOperation is _GET_ or - * _POST_. - * @param {number} [request.pageSize] - * Optional. The maximum number of operations to return. The service may - * return fewer than this value. If unspecified, at most 50 operations will be - * returned. The maximum value is 1000; values above 1000 will be coerced to - * 1000. - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous `ListApiOperations` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters (except page_size) provided to - * `ListApiOperations` must match the call that provided the page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.cloud.apihub.v1.ApiOperation|ApiOperation} 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 `listApiOperationsAsync()` - * 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. - */ - listApiOperationsStream( - request?: protos.google.cloud.apihub.v1.IListApiOperationsRequest, - 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['listApiOperations']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listApiOperations.createStream( - this.innerApiCalls.listApiOperations as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listApiOperations`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent which owns this collection of operations i.e., the API - * version. Format: - * `projects/{project}/locations/{location}/apis/{api}/versions/{version}` - * @param {string} [request.filter] - * Optional. An expression that filters the list of ApiOperations. - * - * A filter expression consists of a field name, a comparison - * operator, and a value for filtering. The value must be a string or a - * boolean. The comparison operator must be one of: `<`, `>` or - * `=`. Filters are not case sensitive. - * - * The following fields in the `ApiOperation` are eligible for filtering: - * * `name` - The ApiOperation resource name. Allowed comparison - * operators: - * `=`. - * * `details.http_operation.path.path` - The http operation's complete path - * relative to server endpoint. Allowed comparison operators: `=`. - * * `details.http_operation.method` - The http operation method type. - * Allowed comparison operators: `=`. - * * `details.deprecated` - Indicates if the ApiOperation is deprecated. - * Allowed values are True / False indicating the deprycation status of the - * ApiOperation. Allowed comparison operators: `=`. - * * `create_time` - The time at which the ApiOperation was created. The - * value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] - * format. Allowed comparison operators: `>` and `<`. - * - * Expressions are combined with either `AND` logic operator or `OR` logical - * operator but not both of them together i.e. only one of the `AND` or `OR` - * operator can be used throughout the filter string and both the operators - * cannot be used together. No other logical operators are supported. At most - * three filter fields are allowed in the filter string and if provided - * more than that then `INVALID_ARGUMENT` error is returned by the API. - * - * Here are a few examples: - * - * * `details.deprecated = True` - The ApiOperation is deprecated. - * * `details.http_operation.method = GET AND create_time < - * \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - - * The method of the http operation of the ApiOperation is _GET_ and the - * spec was created before _2021-08-15 14:50:00 UTC_ and after _2021-08-10 - * 12:00:00 UTC_. - * * `details.http_operation.method = GET OR details.http_operation.method = - * POST`. - The http operation of the method of ApiOperation is _GET_ or - * _POST_. - * @param {number} [request.pageSize] - * Optional. The maximum number of operations to return. The service may - * return fewer than this value. If unspecified, at most 50 operations will be - * returned. The maximum value is 1000; values above 1000 will be coerced to - * 1000. - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous `ListApiOperations` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters (except page_size) provided to - * `ListApiOperations` must match the call that provided the page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@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.apihub.v1.ApiOperation|ApiOperation}. 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/api_hub.list_api_operations.js - * region_tag:apihub_v1_generated_ApiHub_ListApiOperations_async - */ - listApiOperationsAsync( - request?: protos.google.cloud.apihub.v1.IListApiOperationsRequest, - 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['listApiOperations']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listApiOperations.asyncIterate( - this.innerApiCalls['listApiOperations'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * List deployment resources in the API hub. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent, which owns this collection of deployment resources. - * Format: `projects/{project}/locations/{location}` - * @param {string} [request.filter] - * Optional. An expression that filters the list of Deployments. - * - * A filter expression consists of a field name, a comparison - * operator, and a value for filtering. The value must be a string. The - * comparison operator must be one of: `<`, `>` or - * `=`. Filters are not case sensitive. - * - * The following fields in the `Deployments` are eligible for filtering: - * - * * `display_name` - The display name of the Deployment. Allowed - * comparison operators: `=`. - * * `create_time` - The time at which the Deployment was created. The - * value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] - * format. Allowed comparison operators: `>` and `<`. - * * `resource_uri` - A URI to the deployment resource. Allowed - * comparison operators: `=`. - * * `api_versions` - The API versions linked to this deployment. Allowed - * comparison operators: `:`. - * * `deployment_type.enum_values.values.id` - The allowed value id of the - * deployment_type attribute associated with the Deployment. Allowed - * comparison operators: `:`. - * * `deployment_type.enum_values.values.display_name` - The allowed value - * display name of the deployment_type attribute associated with the - * Deployment. Allowed comparison operators: `:`. - * * `slo.string_values.values` -The allowed string value of the slo - * attribute associated with the deployment. Allowed comparison - * operators: `:`. - * * `environment.enum_values.values.id` - The allowed value id of the - * environment attribute associated with the deployment. Allowed - * comparison operators: `:`. - * * `environment.enum_values.values.display_name` - The allowed value - * display name of the environment attribute associated with the deployment. - * Allowed comparison operators: `:`. - * - * Expressions are combined with either `AND` logic operator or `OR` logical - * operator but not both of them together i.e. only one of the `AND` or `OR` - * operator can be used throughout the filter string and both the operators - * cannot be used together. No other logical operators are supported. At most - * three filter fields are allowed in the filter string and if provided - * more than that then `INVALID_ARGUMENT` error is returned by the API. - * - * Here are a few examples: - * - * * `environment.enum_values.values.id: staging-id` - The allowed value id - * of the environment attribute associated with the Deployment is - * _staging-id_. - * * `environment.enum_values.values.display_name: \"Staging Deployment\"` - - * The allowed value display name of the environment attribute associated - * with the Deployment is `Staging Deployment`. - * * `environment.enum_values.values.id: production-id AND create_time < - * \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - - * The allowed value id of the environment attribute associated with the - * Deployment is _production-id_ and Deployment was created before - * _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_. - * * `environment.enum_values.values.id: production-id OR - * slo.string_values.values: \"99.99%\"` - * - The allowed value id of the environment attribute Deployment is - * _production-id_ or string value of the slo attribute is _99.99%_. - * @param {number} [request.pageSize] - * Optional. The maximum number of deployment resources to return. The service - * may return fewer than this value. If unspecified, at most 50 deployments - * will be returned. The maximum value is 1000; values above 1000 will be - * coerced to 1000. - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous `ListDeployments` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters (except page_size) provided to - * `ListDeployments` must match the call that provided the page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.cloud.apihub.v1.Deployment|Deployment}. - * 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 `listDeploymentsAsync()` - * 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. - */ - listDeployments( - request?: protos.google.cloud.apihub.v1.IListDeploymentsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apihub.v1.IDeployment[], - protos.google.cloud.apihub.v1.IListDeploymentsRequest|null, - protos.google.cloud.apihub.v1.IListDeploymentsResponse - ]>; - listDeployments( - request: protos.google.cloud.apihub.v1.IListDeploymentsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.apihub.v1.IListDeploymentsRequest, - protos.google.cloud.apihub.v1.IListDeploymentsResponse|null|undefined, - protos.google.cloud.apihub.v1.IDeployment>): void; - listDeployments( - request: protos.google.cloud.apihub.v1.IListDeploymentsRequest, - callback: PaginationCallback< - protos.google.cloud.apihub.v1.IListDeploymentsRequest, - protos.google.cloud.apihub.v1.IListDeploymentsResponse|null|undefined, - protos.google.cloud.apihub.v1.IDeployment>): void; - listDeployments( - request?: protos.google.cloud.apihub.v1.IListDeploymentsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.apihub.v1.IListDeploymentsRequest, - protos.google.cloud.apihub.v1.IListDeploymentsResponse|null|undefined, - protos.google.cloud.apihub.v1.IDeployment>, - callback?: PaginationCallback< - protos.google.cloud.apihub.v1.IListDeploymentsRequest, - protos.google.cloud.apihub.v1.IListDeploymentsResponse|null|undefined, - protos.google.cloud.apihub.v1.IDeployment>): - Promise<[ - protos.google.cloud.apihub.v1.IDeployment[], - protos.google.cloud.apihub.v1.IListDeploymentsRequest|null, - protos.google.cloud.apihub.v1.IListDeploymentsResponse - ]>|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.listDeployments(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent, which owns this collection of deployment resources. - * Format: `projects/{project}/locations/{location}` - * @param {string} [request.filter] - * Optional. An expression that filters the list of Deployments. - * - * A filter expression consists of a field name, a comparison - * operator, and a value for filtering. The value must be a string. The - * comparison operator must be one of: `<`, `>` or - * `=`. Filters are not case sensitive. - * - * The following fields in the `Deployments` are eligible for filtering: - * - * * `display_name` - The display name of the Deployment. Allowed - * comparison operators: `=`. - * * `create_time` - The time at which the Deployment was created. The - * value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] - * format. Allowed comparison operators: `>` and `<`. - * * `resource_uri` - A URI to the deployment resource. Allowed - * comparison operators: `=`. - * * `api_versions` - The API versions linked to this deployment. Allowed - * comparison operators: `:`. - * * `deployment_type.enum_values.values.id` - The allowed value id of the - * deployment_type attribute associated with the Deployment. Allowed - * comparison operators: `:`. - * * `deployment_type.enum_values.values.display_name` - The allowed value - * display name of the deployment_type attribute associated with the - * Deployment. Allowed comparison operators: `:`. - * * `slo.string_values.values` -The allowed string value of the slo - * attribute associated with the deployment. Allowed comparison - * operators: `:`. - * * `environment.enum_values.values.id` - The allowed value id of the - * environment attribute associated with the deployment. Allowed - * comparison operators: `:`. - * * `environment.enum_values.values.display_name` - The allowed value - * display name of the environment attribute associated with the deployment. - * Allowed comparison operators: `:`. - * - * Expressions are combined with either `AND` logic operator or `OR` logical - * operator but not both of them together i.e. only one of the `AND` or `OR` - * operator can be used throughout the filter string and both the operators - * cannot be used together. No other logical operators are supported. At most - * three filter fields are allowed in the filter string and if provided - * more than that then `INVALID_ARGUMENT` error is returned by the API. - * - * Here are a few examples: - * - * * `environment.enum_values.values.id: staging-id` - The allowed value id - * of the environment attribute associated with the Deployment is - * _staging-id_. - * * `environment.enum_values.values.display_name: \"Staging Deployment\"` - - * The allowed value display name of the environment attribute associated - * with the Deployment is `Staging Deployment`. - * * `environment.enum_values.values.id: production-id AND create_time < - * \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - - * The allowed value id of the environment attribute associated with the - * Deployment is _production-id_ and Deployment was created before - * _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_. - * * `environment.enum_values.values.id: production-id OR - * slo.string_values.values: \"99.99%\"` - * - The allowed value id of the environment attribute Deployment is - * _production-id_ or string value of the slo attribute is _99.99%_. - * @param {number} [request.pageSize] - * Optional. The maximum number of deployment resources to return. The service - * may return fewer than this value. If unspecified, at most 50 deployments - * will be returned. The maximum value is 1000; values above 1000 will be - * coerced to 1000. - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous `ListDeployments` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters (except page_size) provided to - * `ListDeployments` must match the call that provided the page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.cloud.apihub.v1.Deployment|Deployment} 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 `listDeploymentsAsync()` - * 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. - */ - listDeploymentsStream( - request?: protos.google.cloud.apihub.v1.IListDeploymentsRequest, - 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['listDeployments']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listDeployments.createStream( - this.innerApiCalls.listDeployments as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listDeployments`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent, which owns this collection of deployment resources. - * Format: `projects/{project}/locations/{location}` - * @param {string} [request.filter] - * Optional. An expression that filters the list of Deployments. - * - * A filter expression consists of a field name, a comparison - * operator, and a value for filtering. The value must be a string. The - * comparison operator must be one of: `<`, `>` or - * `=`. Filters are not case sensitive. - * - * The following fields in the `Deployments` are eligible for filtering: - * - * * `display_name` - The display name of the Deployment. Allowed - * comparison operators: `=`. - * * `create_time` - The time at which the Deployment was created. The - * value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] - * format. Allowed comparison operators: `>` and `<`. - * * `resource_uri` - A URI to the deployment resource. Allowed - * comparison operators: `=`. - * * `api_versions` - The API versions linked to this deployment. Allowed - * comparison operators: `:`. - * * `deployment_type.enum_values.values.id` - The allowed value id of the - * deployment_type attribute associated with the Deployment. Allowed - * comparison operators: `:`. - * * `deployment_type.enum_values.values.display_name` - The allowed value - * display name of the deployment_type attribute associated with the - * Deployment. Allowed comparison operators: `:`. - * * `slo.string_values.values` -The allowed string value of the slo - * attribute associated with the deployment. Allowed comparison - * operators: `:`. - * * `environment.enum_values.values.id` - The allowed value id of the - * environment attribute associated with the deployment. Allowed - * comparison operators: `:`. - * * `environment.enum_values.values.display_name` - The allowed value - * display name of the environment attribute associated with the deployment. - * Allowed comparison operators: `:`. - * - * Expressions are combined with either `AND` logic operator or `OR` logical - * operator but not both of them together i.e. only one of the `AND` or `OR` - * operator can be used throughout the filter string and both the operators - * cannot be used together. No other logical operators are supported. At most - * three filter fields are allowed in the filter string and if provided - * more than that then `INVALID_ARGUMENT` error is returned by the API. - * - * Here are a few examples: - * - * * `environment.enum_values.values.id: staging-id` - The allowed value id - * of the environment attribute associated with the Deployment is - * _staging-id_. - * * `environment.enum_values.values.display_name: \"Staging Deployment\"` - - * The allowed value display name of the environment attribute associated - * with the Deployment is `Staging Deployment`. - * * `environment.enum_values.values.id: production-id AND create_time < - * \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` - - * The allowed value id of the environment attribute associated with the - * Deployment is _production-id_ and Deployment was created before - * _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_. - * * `environment.enum_values.values.id: production-id OR - * slo.string_values.values: \"99.99%\"` - * - The allowed value id of the environment attribute Deployment is - * _production-id_ or string value of the slo attribute is _99.99%_. - * @param {number} [request.pageSize] - * Optional. The maximum number of deployment resources to return. The service - * may return fewer than this value. If unspecified, at most 50 deployments - * will be returned. The maximum value is 1000; values above 1000 will be - * coerced to 1000. - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous `ListDeployments` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters (except page_size) provided to - * `ListDeployments` must match the call that provided the page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@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.apihub.v1.Deployment|Deployment}. 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/api_hub.list_deployments.js - * region_tag:apihub_v1_generated_ApiHub_ListDeployments_async - */ - listDeploymentsAsync( - request?: protos.google.cloud.apihub.v1.IListDeploymentsRequest, - 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['listDeployments']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listDeployments.asyncIterate( - this.innerApiCalls['listDeployments'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * List all attributes. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource for Attribute. - * Format: `projects/{project}/locations/{location}` - * @param {string} [request.filter] - * Optional. An expression that filters the list of Attributes. - * - * A filter expression consists of a field name, a comparison - * operator, and a value for filtering. The value must be a string or a - * boolean. The comparison operator must be one of: `<`, `>` or - * `=`. Filters are not case sensitive. - * - * The following fields in the `Attribute` are eligible for filtering: - * - * * `display_name` - The display name of the Attribute. Allowed - * comparison operators: `=`. - * * `definition_type` - The definition type of the attribute. Allowed - * comparison operators: `=`. - * * `scope` - The scope of the attribute. Allowed comparison operators: - * `=`. - * * `data_type` - The type of the data of the attribute. Allowed - * comparison operators: `=`. - * * `mandatory` - Denotes whether the attribute is mandatory or not. - * Allowed comparison operators: `=`. - * * `create_time` - The time at which the Attribute was created. The - * value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] - * format. Allowed comparison operators: `>` and `<`. - * - * Expressions are combined with either `AND` logic operator or `OR` logical - * operator but not both of them together i.e. only one of the `AND` or `OR` - * operator can be used throughout the filter string and both the operators - * cannot be used together. No other logical operators are - * supported. At most three filter fields are allowed in the filter - * string and if provided more than that then `INVALID_ARGUMENT` error is - * returned by the API. - * - * Here are a few examples: - * - * * `display_name = production` - - The display name of the attribute is - * _production_. - * * `(display_name = production) AND (create_time < - * \"2021-08-15T14:50:00Z\") AND (create_time > \"2021-08-10T12:00:00Z\")` - - * The display name of the attribute is _production_ and the attribute was - * created before _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00 - * UTC_. - * * `display_name = production OR scope = api` - - * The attribute where the display name is _production_ or the scope is - * _api_. - * @param {number} [request.pageSize] - * Optional. The maximum number of attribute resources to return. The service - * may return fewer than this value. If unspecified, at most 50 attributes - * will be returned. The maximum value is 1000; values above 1000 will be - * coerced to 1000. - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous `ListAttributes` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to `ListAttributes` must - * match the call that provided the page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.cloud.apihub.v1.Attribute|Attribute}. - * 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 `listAttributesAsync()` - * 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. - */ - listAttributes( - request?: protos.google.cloud.apihub.v1.IListAttributesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apihub.v1.IAttribute[], - protos.google.cloud.apihub.v1.IListAttributesRequest|null, - protos.google.cloud.apihub.v1.IListAttributesResponse - ]>; - listAttributes( - request: protos.google.cloud.apihub.v1.IListAttributesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.apihub.v1.IListAttributesRequest, - protos.google.cloud.apihub.v1.IListAttributesResponse|null|undefined, - protos.google.cloud.apihub.v1.IAttribute>): void; - listAttributes( - request: protos.google.cloud.apihub.v1.IListAttributesRequest, - callback: PaginationCallback< - protos.google.cloud.apihub.v1.IListAttributesRequest, - protos.google.cloud.apihub.v1.IListAttributesResponse|null|undefined, - protos.google.cloud.apihub.v1.IAttribute>): void; - listAttributes( - request?: protos.google.cloud.apihub.v1.IListAttributesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.apihub.v1.IListAttributesRequest, - protos.google.cloud.apihub.v1.IListAttributesResponse|null|undefined, - protos.google.cloud.apihub.v1.IAttribute>, - callback?: PaginationCallback< - protos.google.cloud.apihub.v1.IListAttributesRequest, - protos.google.cloud.apihub.v1.IListAttributesResponse|null|undefined, - protos.google.cloud.apihub.v1.IAttribute>): - Promise<[ - protos.google.cloud.apihub.v1.IAttribute[], - protos.google.cloud.apihub.v1.IListAttributesRequest|null, - protos.google.cloud.apihub.v1.IListAttributesResponse - ]>|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.listAttributes(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource for Attribute. - * Format: `projects/{project}/locations/{location}` - * @param {string} [request.filter] - * Optional. An expression that filters the list of Attributes. - * - * A filter expression consists of a field name, a comparison - * operator, and a value for filtering. The value must be a string or a - * boolean. The comparison operator must be one of: `<`, `>` or - * `=`. Filters are not case sensitive. - * - * The following fields in the `Attribute` are eligible for filtering: - * - * * `display_name` - The display name of the Attribute. Allowed - * comparison operators: `=`. - * * `definition_type` - The definition type of the attribute. Allowed - * comparison operators: `=`. - * * `scope` - The scope of the attribute. Allowed comparison operators: - * `=`. - * * `data_type` - The type of the data of the attribute. Allowed - * comparison operators: `=`. - * * `mandatory` - Denotes whether the attribute is mandatory or not. - * Allowed comparison operators: `=`. - * * `create_time` - The time at which the Attribute was created. The - * value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] - * format. Allowed comparison operators: `>` and `<`. - * - * Expressions are combined with either `AND` logic operator or `OR` logical - * operator but not both of them together i.e. only one of the `AND` or `OR` - * operator can be used throughout the filter string and both the operators - * cannot be used together. No other logical operators are - * supported. At most three filter fields are allowed in the filter - * string and if provided more than that then `INVALID_ARGUMENT` error is - * returned by the API. - * - * Here are a few examples: - * - * * `display_name = production` - - The display name of the attribute is - * _production_. - * * `(display_name = production) AND (create_time < - * \"2021-08-15T14:50:00Z\") AND (create_time > \"2021-08-10T12:00:00Z\")` - - * The display name of the attribute is _production_ and the attribute was - * created before _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00 - * UTC_. - * * `display_name = production OR scope = api` - - * The attribute where the display name is _production_ or the scope is - * _api_. - * @param {number} [request.pageSize] - * Optional. The maximum number of attribute resources to return. The service - * may return fewer than this value. If unspecified, at most 50 attributes - * will be returned. The maximum value is 1000; values above 1000 will be - * coerced to 1000. - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous `ListAttributes` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to `ListAttributes` must - * match the call that provided the page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.cloud.apihub.v1.Attribute|Attribute} 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 `listAttributesAsync()` - * 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. - */ - listAttributesStream( - request?: protos.google.cloud.apihub.v1.IListAttributesRequest, - 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['listAttributes']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listAttributes.createStream( - this.innerApiCalls.listAttributes as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listAttributes`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource for Attribute. - * Format: `projects/{project}/locations/{location}` - * @param {string} [request.filter] - * Optional. An expression that filters the list of Attributes. - * - * A filter expression consists of a field name, a comparison - * operator, and a value for filtering. The value must be a string or a - * boolean. The comparison operator must be one of: `<`, `>` or - * `=`. Filters are not case sensitive. - * - * The following fields in the `Attribute` are eligible for filtering: - * - * * `display_name` - The display name of the Attribute. Allowed - * comparison operators: `=`. - * * `definition_type` - The definition type of the attribute. Allowed - * comparison operators: `=`. - * * `scope` - The scope of the attribute. Allowed comparison operators: - * `=`. - * * `data_type` - The type of the data of the attribute. Allowed - * comparison operators: `=`. - * * `mandatory` - Denotes whether the attribute is mandatory or not. - * Allowed comparison operators: `=`. - * * `create_time` - The time at which the Attribute was created. The - * value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] - * format. Allowed comparison operators: `>` and `<`. - * - * Expressions are combined with either `AND` logic operator or `OR` logical - * operator but not both of them together i.e. only one of the `AND` or `OR` - * operator can be used throughout the filter string and both the operators - * cannot be used together. No other logical operators are - * supported. At most three filter fields are allowed in the filter - * string and if provided more than that then `INVALID_ARGUMENT` error is - * returned by the API. - * - * Here are a few examples: - * - * * `display_name = production` - - The display name of the attribute is - * _production_. - * * `(display_name = production) AND (create_time < - * \"2021-08-15T14:50:00Z\") AND (create_time > \"2021-08-10T12:00:00Z\")` - - * The display name of the attribute is _production_ and the attribute was - * created before _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00 - * UTC_. - * * `display_name = production OR scope = api` - - * The attribute where the display name is _production_ or the scope is - * _api_. - * @param {number} [request.pageSize] - * Optional. The maximum number of attribute resources to return. The service - * may return fewer than this value. If unspecified, at most 50 attributes - * will be returned. The maximum value is 1000; values above 1000 will be - * coerced to 1000. - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous `ListAttributes` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to `ListAttributes` must - * match the call that provided the page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@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.apihub.v1.Attribute|Attribute}. 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/api_hub.list_attributes.js - * region_tag:apihub_v1_generated_ApiHub_ListAttributes_async - */ - listAttributesAsync( - request?: protos.google.cloud.apihub.v1.IListAttributesRequest, - 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['listAttributes']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listAttributes.asyncIterate( - this.innerApiCalls['listAttributes'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Search across API-Hub resources. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.location - * Required. The resource name of the location which will be of the type - * `projects/{project_id}/locations/{location_id}`. This field is used to - * identify the instance of API-Hub in which resources should be searched. - * @param {string} request.query - * Required. The free text search query. This query can contain keywords which - * could be related to any detail of the API-Hub resources such display names, - * descriptions, attributes etc. - * @param {string} [request.filter] - * Optional. An expression that filters the list of search results. - * - * A filter expression consists of a field name, a comparison operator, - * and a value for filtering. The value must be a string, a number, or a - * boolean. The comparison operator must be `=`. Filters are not case - * sensitive. - * - * The following field names are eligible for filtering: - * * `resource_type` - The type of resource in the search results. - * Must be one of the following: `Api`, `ApiOperation`, `Deployment`, - * `Definition`, `Spec` or `Version`. This field can only be specified once - * in the filter. - * - * Here are is an example: - * - * * `resource_type = Api` - The resource_type is _Api_. - * @param {number} [request.pageSize] - * Optional. The maximum number of search results to return. The service may - * return fewer than this value. If unspecified at most 10 search results will - * be returned. If value is negative then `INVALID_ARGUMENT` error is - * returned. The maximum value is 25; values above 25 will be coerced to 25. - * While paginating, you can specify a new page size parameter for each page - * of search results to be listed. - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous - * {@link protos.SearchResources|SearchResources} - * call. Specify this parameter to retrieve the next page of transactions. - * - * When paginating, you must specify the `page_token` parameter and all the - * other parameters except - * {@link protos.google.cloud.apihub.v1.SearchResourcesRequest.page_size|page_size} - * should be specified with the same value which was used in the previous - * call. If the other fields are set with a different value than the previous - * call then `INVALID_ARGUMENT` error is returned. - * @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.apihub.v1.SearchResult|SearchResult}. - * 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 `searchResourcesAsync()` - * 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. - */ - searchResources( - request?: protos.google.cloud.apihub.v1.ISearchResourcesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apihub.v1.ISearchResult[], - protos.google.cloud.apihub.v1.ISearchResourcesRequest|null, - protos.google.cloud.apihub.v1.ISearchResourcesResponse - ]>; - searchResources( - request: protos.google.cloud.apihub.v1.ISearchResourcesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.apihub.v1.ISearchResourcesRequest, - protos.google.cloud.apihub.v1.ISearchResourcesResponse|null|undefined, - protos.google.cloud.apihub.v1.ISearchResult>): void; - searchResources( - request: protos.google.cloud.apihub.v1.ISearchResourcesRequest, - callback: PaginationCallback< - protos.google.cloud.apihub.v1.ISearchResourcesRequest, - protos.google.cloud.apihub.v1.ISearchResourcesResponse|null|undefined, - protos.google.cloud.apihub.v1.ISearchResult>): void; - searchResources( - request?: protos.google.cloud.apihub.v1.ISearchResourcesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.apihub.v1.ISearchResourcesRequest, - protos.google.cloud.apihub.v1.ISearchResourcesResponse|null|undefined, - protos.google.cloud.apihub.v1.ISearchResult>, - callback?: PaginationCallback< - protos.google.cloud.apihub.v1.ISearchResourcesRequest, - protos.google.cloud.apihub.v1.ISearchResourcesResponse|null|undefined, - protos.google.cloud.apihub.v1.ISearchResult>): - Promise<[ - protos.google.cloud.apihub.v1.ISearchResult[], - protos.google.cloud.apihub.v1.ISearchResourcesRequest|null, - protos.google.cloud.apihub.v1.ISearchResourcesResponse - ]>|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({ - 'location': request.location ?? '', - }); - this.initialize(); - return this.innerApiCalls.searchResources(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.location - * Required. The resource name of the location which will be of the type - * `projects/{project_id}/locations/{location_id}`. This field is used to - * identify the instance of API-Hub in which resources should be searched. - * @param {string} request.query - * Required. The free text search query. This query can contain keywords which - * could be related to any detail of the API-Hub resources such display names, - * descriptions, attributes etc. - * @param {string} [request.filter] - * Optional. An expression that filters the list of search results. - * - * A filter expression consists of a field name, a comparison operator, - * and a value for filtering. The value must be a string, a number, or a - * boolean. The comparison operator must be `=`. Filters are not case - * sensitive. - * - * The following field names are eligible for filtering: - * * `resource_type` - The type of resource in the search results. - * Must be one of the following: `Api`, `ApiOperation`, `Deployment`, - * `Definition`, `Spec` or `Version`. This field can only be specified once - * in the filter. - * - * Here are is an example: - * - * * `resource_type = Api` - The resource_type is _Api_. - * @param {number} [request.pageSize] - * Optional. The maximum number of search results to return. The service may - * return fewer than this value. If unspecified at most 10 search results will - * be returned. If value is negative then `INVALID_ARGUMENT` error is - * returned. The maximum value is 25; values above 25 will be coerced to 25. - * While paginating, you can specify a new page size parameter for each page - * of search results to be listed. - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous - * {@link protos.SearchResources|SearchResources} - * call. Specify this parameter to retrieve the next page of transactions. - * - * When paginating, you must specify the `page_token` parameter and all the - * other parameters except - * {@link protos.google.cloud.apihub.v1.SearchResourcesRequest.page_size|page_size} - * should be specified with the same value which was used in the previous - * call. If the other fields are set with a different value than the previous - * call then `INVALID_ARGUMENT` error is returned. - * @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.apihub.v1.SearchResult|SearchResult} 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 `searchResourcesAsync()` - * 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. - */ - searchResourcesStream( - request?: protos.google.cloud.apihub.v1.ISearchResourcesRequest, - 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({ - 'location': request.location ?? '', - }); - const defaultCallSettings = this._defaults['searchResources']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.searchResources.createStream( - this.innerApiCalls.searchResources as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `searchResources`, 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.location - * Required. The resource name of the location which will be of the type - * `projects/{project_id}/locations/{location_id}`. This field is used to - * identify the instance of API-Hub in which resources should be searched. - * @param {string} request.query - * Required. The free text search query. This query can contain keywords which - * could be related to any detail of the API-Hub resources such display names, - * descriptions, attributes etc. - * @param {string} [request.filter] - * Optional. An expression that filters the list of search results. - * - * A filter expression consists of a field name, a comparison operator, - * and a value for filtering. The value must be a string, a number, or a - * boolean. The comparison operator must be `=`. Filters are not case - * sensitive. - * - * The following field names are eligible for filtering: - * * `resource_type` - The type of resource in the search results. - * Must be one of the following: `Api`, `ApiOperation`, `Deployment`, - * `Definition`, `Spec` or `Version`. This field can only be specified once - * in the filter. - * - * Here are is an example: - * - * * `resource_type = Api` - The resource_type is _Api_. - * @param {number} [request.pageSize] - * Optional. The maximum number of search results to return. The service may - * return fewer than this value. If unspecified at most 10 search results will - * be returned. If value is negative then `INVALID_ARGUMENT` error is - * returned. The maximum value is 25; values above 25 will be coerced to 25. - * While paginating, you can specify a new page size parameter for each page - * of search results to be listed. - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous - * {@link protos.SearchResources|SearchResources} - * call. Specify this parameter to retrieve the next page of transactions. - * - * When paginating, you must specify the `page_token` parameter and all the - * other parameters except - * {@link protos.google.cloud.apihub.v1.SearchResourcesRequest.page_size|page_size} - * should be specified with the same value which was used in the previous - * call. If the other fields are set with a different value than the previous - * call then `INVALID_ARGUMENT` error is returned. - * @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.apihub.v1.SearchResult|SearchResult}. 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/api_hub.search_resources.js - * region_tag:apihub_v1_generated_ApiHub_SearchResources_async - */ - searchResourcesAsync( - request?: protos.google.cloud.apihub.v1.ISearchResourcesRequest, - 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({ - 'location': request.location ?? '', - }); - const defaultCallSettings = this._defaults['searchResources']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.searchResources.asyncIterate( - this.innerApiCalls['searchResources'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * List External API resources in the API hub. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent, which owns this collection of External API resources. - * Format: `projects/{project}/locations/{location}` - * @param {number} [request.pageSize] - * Optional. The maximum number of External API resources to return. The - * service may return fewer than this value. If unspecified, at most 50 - * ExternalApis will be returned. The maximum value is 1000; values above 1000 - * will be coerced to 1000. - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous `ListExternalApis` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters (except page_size) provided to - * `ListExternalApis` must match the call that provided the page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.cloud.apihub.v1.ExternalApi|ExternalApi}. - * 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 `listExternalApisAsync()` - * 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. - */ - listExternalApis( - request?: protos.google.cloud.apihub.v1.IListExternalApisRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apihub.v1.IExternalApi[], - protos.google.cloud.apihub.v1.IListExternalApisRequest|null, - protos.google.cloud.apihub.v1.IListExternalApisResponse - ]>; - listExternalApis( - request: protos.google.cloud.apihub.v1.IListExternalApisRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.apihub.v1.IListExternalApisRequest, - protos.google.cloud.apihub.v1.IListExternalApisResponse|null|undefined, - protos.google.cloud.apihub.v1.IExternalApi>): void; - listExternalApis( - request: protos.google.cloud.apihub.v1.IListExternalApisRequest, - callback: PaginationCallback< - protos.google.cloud.apihub.v1.IListExternalApisRequest, - protos.google.cloud.apihub.v1.IListExternalApisResponse|null|undefined, - protos.google.cloud.apihub.v1.IExternalApi>): void; - listExternalApis( - request?: protos.google.cloud.apihub.v1.IListExternalApisRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.apihub.v1.IListExternalApisRequest, - protos.google.cloud.apihub.v1.IListExternalApisResponse|null|undefined, - protos.google.cloud.apihub.v1.IExternalApi>, - callback?: PaginationCallback< - protos.google.cloud.apihub.v1.IListExternalApisRequest, - protos.google.cloud.apihub.v1.IListExternalApisResponse|null|undefined, - protos.google.cloud.apihub.v1.IExternalApi>): - Promise<[ - protos.google.cloud.apihub.v1.IExternalApi[], - protos.google.cloud.apihub.v1.IListExternalApisRequest|null, - protos.google.cloud.apihub.v1.IListExternalApisResponse - ]>|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.listExternalApis(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent, which owns this collection of External API resources. - * Format: `projects/{project}/locations/{location}` - * @param {number} [request.pageSize] - * Optional. The maximum number of External API resources to return. The - * service may return fewer than this value. If unspecified, at most 50 - * ExternalApis will be returned. The maximum value is 1000; values above 1000 - * will be coerced to 1000. - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous `ListExternalApis` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters (except page_size) provided to - * `ListExternalApis` must match the call that provided the page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.cloud.apihub.v1.ExternalApi|ExternalApi} 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 `listExternalApisAsync()` - * 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. - */ - listExternalApisStream( - request?: protos.google.cloud.apihub.v1.IListExternalApisRequest, - 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['listExternalApis']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listExternalApis.createStream( - this.innerApiCalls.listExternalApis as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listExternalApis`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent, which owns this collection of External API resources. - * Format: `projects/{project}/locations/{location}` - * @param {number} [request.pageSize] - * Optional. The maximum number of External API resources to return. The - * service may return fewer than this value. If unspecified, at most 50 - * ExternalApis will be returned. The maximum value is 1000; values above 1000 - * will be coerced to 1000. - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous `ListExternalApis` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters (except page_size) provided to - * `ListExternalApis` must match the call that provided the page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@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.apihub.v1.ExternalApi|ExternalApi}. 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/api_hub.list_external_apis.js - * region_tag:apihub_v1_generated_ApiHub_ListExternalApis_async - */ - listExternalApisAsync( - request?: protos.google.cloud.apihub.v1.IListExternalApisRequest, - 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['listExternalApis']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listExternalApis.asyncIterate( - this.innerApiCalls['listExternalApis'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } -/** - * 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); - } - - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified api resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} api - * @returns {string} Resource name string. - */ - apiPath(project:string,location:string,api:string) { - return this.pathTemplates.apiPathTemplate.render({ - project: project, - location: location, - api: api, - }); - } - - /** - * Parse the project from Api resource. - * - * @param {string} apiName - * A fully-qualified path representing Api resource. - * @returns {string} A string representing the project. - */ - matchProjectFromApiName(apiName: string) { - return this.pathTemplates.apiPathTemplate.match(apiName).project; - } - - /** - * Parse the location from Api resource. - * - * @param {string} apiName - * A fully-qualified path representing Api resource. - * @returns {string} A string representing the location. - */ - matchLocationFromApiName(apiName: string) { - return this.pathTemplates.apiPathTemplate.match(apiName).location; - } - - /** - * Parse the api from Api resource. - * - * @param {string} apiName - * A fully-qualified path representing Api resource. - * @returns {string} A string representing the api. - */ - matchApiFromApiName(apiName: string) { - return this.pathTemplates.apiPathTemplate.match(apiName).api; - } - - /** - * Return a fully-qualified apiHubInstance resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} api_hub_instance - * @returns {string} Resource name string. - */ - apiHubInstancePath(project:string,location:string,apiHubInstance:string) { - return this.pathTemplates.apiHubInstancePathTemplate.render({ - project: project, - location: location, - api_hub_instance: apiHubInstance, - }); - } - - /** - * Parse the project from ApiHubInstance resource. - * - * @param {string} apiHubInstanceName - * A fully-qualified path representing ApiHubInstance resource. - * @returns {string} A string representing the project. - */ - matchProjectFromApiHubInstanceName(apiHubInstanceName: string) { - return this.pathTemplates.apiHubInstancePathTemplate.match(apiHubInstanceName).project; - } - - /** - * Parse the location from ApiHubInstance resource. - * - * @param {string} apiHubInstanceName - * A fully-qualified path representing ApiHubInstance resource. - * @returns {string} A string representing the location. - */ - matchLocationFromApiHubInstanceName(apiHubInstanceName: string) { - return this.pathTemplates.apiHubInstancePathTemplate.match(apiHubInstanceName).location; - } - - /** - * Parse the api_hub_instance from ApiHubInstance resource. - * - * @param {string} apiHubInstanceName - * A fully-qualified path representing ApiHubInstance resource. - * @returns {string} A string representing the api_hub_instance. - */ - matchApiHubInstanceFromApiHubInstanceName(apiHubInstanceName: string) { - return this.pathTemplates.apiHubInstancePathTemplate.match(apiHubInstanceName).api_hub_instance; - } - - /** - * Return a fully-qualified apiOperation resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} api - * @param {string} version - * @param {string} operation - * @returns {string} Resource name string. - */ - apiOperationPath(project:string,location:string,api:string,version:string,operation:string) { - return this.pathTemplates.apiOperationPathTemplate.render({ - project: project, - location: location, - api: api, - version: version, - operation: operation, - }); - } - - /** - * Parse the project from ApiOperation resource. - * - * @param {string} apiOperationName - * A fully-qualified path representing ApiOperation resource. - * @returns {string} A string representing the project. - */ - matchProjectFromApiOperationName(apiOperationName: string) { - return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).project; - } - - /** - * Parse the location from ApiOperation resource. - * - * @param {string} apiOperationName - * A fully-qualified path representing ApiOperation resource. - * @returns {string} A string representing the location. - */ - matchLocationFromApiOperationName(apiOperationName: string) { - return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).location; - } - - /** - * Parse the api from ApiOperation resource. - * - * @param {string} apiOperationName - * A fully-qualified path representing ApiOperation resource. - * @returns {string} A string representing the api. - */ - matchApiFromApiOperationName(apiOperationName: string) { - return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).api; - } - - /** - * Parse the version from ApiOperation resource. - * - * @param {string} apiOperationName - * A fully-qualified path representing ApiOperation resource. - * @returns {string} A string representing the version. - */ - matchVersionFromApiOperationName(apiOperationName: string) { - return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).version; - } - - /** - * Parse the operation from ApiOperation resource. - * - * @param {string} apiOperationName - * A fully-qualified path representing ApiOperation resource. - * @returns {string} A string representing the operation. - */ - matchOperationFromApiOperationName(apiOperationName: string) { - return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).operation; - } - - /** - * Return a fully-qualified attribute resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} attribute - * @returns {string} Resource name string. - */ - attributePath(project:string,location:string,attribute:string) { - return this.pathTemplates.attributePathTemplate.render({ - project: project, - location: location, - attribute: attribute, - }); - } - - /** - * Parse the project from Attribute resource. - * - * @param {string} attributeName - * A fully-qualified path representing Attribute resource. - * @returns {string} A string representing the project. - */ - matchProjectFromAttributeName(attributeName: string) { - return this.pathTemplates.attributePathTemplate.match(attributeName).project; - } - - /** - * Parse the location from Attribute resource. - * - * @param {string} attributeName - * A fully-qualified path representing Attribute resource. - * @returns {string} A string representing the location. - */ - matchLocationFromAttributeName(attributeName: string) { - return this.pathTemplates.attributePathTemplate.match(attributeName).location; - } - - /** - * Parse the attribute from Attribute resource. - * - * @param {string} attributeName - * A fully-qualified path representing Attribute resource. - * @returns {string} A string representing the attribute. - */ - matchAttributeFromAttributeName(attributeName: string) { - return this.pathTemplates.attributePathTemplate.match(attributeName).attribute; - } - - /** - * Return a fully-qualified definition resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} api - * @param {string} version - * @param {string} definition - * @returns {string} Resource name string. - */ - definitionPath(project:string,location:string,api:string,version:string,definition:string) { - return this.pathTemplates.definitionPathTemplate.render({ - project: project, - location: location, - api: api, - version: version, - definition: definition, - }); - } - - /** - * Parse the project from Definition resource. - * - * @param {string} definitionName - * A fully-qualified path representing Definition resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDefinitionName(definitionName: string) { - return this.pathTemplates.definitionPathTemplate.match(definitionName).project; - } - - /** - * Parse the location from Definition resource. - * - * @param {string} definitionName - * A fully-qualified path representing Definition resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDefinitionName(definitionName: string) { - return this.pathTemplates.definitionPathTemplate.match(definitionName).location; - } - - /** - * Parse the api from Definition resource. - * - * @param {string} definitionName - * A fully-qualified path representing Definition resource. - * @returns {string} A string representing the api. - */ - matchApiFromDefinitionName(definitionName: string) { - return this.pathTemplates.definitionPathTemplate.match(definitionName).api; - } - - /** - * Parse the version from Definition resource. - * - * @param {string} definitionName - * A fully-qualified path representing Definition resource. - * @returns {string} A string representing the version. - */ - matchVersionFromDefinitionName(definitionName: string) { - return this.pathTemplates.definitionPathTemplate.match(definitionName).version; - } - - /** - * Parse the definition from Definition resource. - * - * @param {string} definitionName - * A fully-qualified path representing Definition resource. - * @returns {string} A string representing the definition. - */ - matchDefinitionFromDefinitionName(definitionName: string) { - return this.pathTemplates.definitionPathTemplate.match(definitionName).definition; - } - - /** - * Return a fully-qualified dependency resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dependency - * @returns {string} Resource name string. - */ - dependencyPath(project:string,location:string,dependency:string) { - return this.pathTemplates.dependencyPathTemplate.render({ - project: project, - location: location, - dependency: dependency, - }); - } - - /** - * Parse the project from Dependency resource. - * - * @param {string} dependencyName - * A fully-qualified path representing Dependency resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDependencyName(dependencyName: string) { - return this.pathTemplates.dependencyPathTemplate.match(dependencyName).project; - } - - /** - * Parse the location from Dependency resource. - * - * @param {string} dependencyName - * A fully-qualified path representing Dependency resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDependencyName(dependencyName: string) { - return this.pathTemplates.dependencyPathTemplate.match(dependencyName).location; - } - - /** - * Parse the dependency from Dependency resource. - * - * @param {string} dependencyName - * A fully-qualified path representing Dependency resource. - * @returns {string} A string representing the dependency. - */ - matchDependencyFromDependencyName(dependencyName: string) { - return this.pathTemplates.dependencyPathTemplate.match(dependencyName).dependency; - } - - /** - * Return a fully-qualified deployment resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} deployment - * @returns {string} Resource name string. - */ - deploymentPath(project:string,location:string,deployment:string) { - return this.pathTemplates.deploymentPathTemplate.render({ - project: project, - location: location, - deployment: deployment, - }); - } - - /** - * Parse the project from Deployment resource. - * - * @param {string} deploymentName - * A fully-qualified path representing Deployment resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDeploymentName(deploymentName: string) { - return this.pathTemplates.deploymentPathTemplate.match(deploymentName).project; - } - - /** - * Parse the location from Deployment resource. - * - * @param {string} deploymentName - * A fully-qualified path representing Deployment resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDeploymentName(deploymentName: string) { - return this.pathTemplates.deploymentPathTemplate.match(deploymentName).location; - } - - /** - * Parse the deployment from Deployment resource. - * - * @param {string} deploymentName - * A fully-qualified path representing Deployment resource. - * @returns {string} A string representing the deployment. - */ - matchDeploymentFromDeploymentName(deploymentName: string) { - return this.pathTemplates.deploymentPathTemplate.match(deploymentName).deployment; - } - - /** - * Return a fully-qualified externalApi resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} external_api - * @returns {string} Resource name string. - */ - externalApiPath(project:string,location:string,externalApi:string) { - return this.pathTemplates.externalApiPathTemplate.render({ - project: project, - location: location, - external_api: externalApi, - }); - } - - /** - * Parse the project from ExternalApi resource. - * - * @param {string} externalApiName - * A fully-qualified path representing ExternalApi resource. - * @returns {string} A string representing the project. - */ - matchProjectFromExternalApiName(externalApiName: string) { - return this.pathTemplates.externalApiPathTemplate.match(externalApiName).project; - } - - /** - * Parse the location from ExternalApi resource. - * - * @param {string} externalApiName - * A fully-qualified path representing ExternalApi resource. - * @returns {string} A string representing the location. - */ - matchLocationFromExternalApiName(externalApiName: string) { - return this.pathTemplates.externalApiPathTemplate.match(externalApiName).location; - } - - /** - * Parse the external_api from ExternalApi resource. - * - * @param {string} externalApiName - * A fully-qualified path representing ExternalApi resource. - * @returns {string} A string representing the external_api. - */ - matchExternalApiFromExternalApiName(externalApiName: string) { - return this.pathTemplates.externalApiPathTemplate.match(externalApiName).external_api; - } - - /** - * Return a fully-qualified hostProjectRegistration resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} host_project_registration - * @returns {string} Resource name string. - */ - hostProjectRegistrationPath(project:string,location:string,hostProjectRegistration:string) { - return this.pathTemplates.hostProjectRegistrationPathTemplate.render({ - project: project, - location: location, - host_project_registration: hostProjectRegistration, - }); - } - - /** - * Parse the project from HostProjectRegistration resource. - * - * @param {string} hostProjectRegistrationName - * A fully-qualified path representing HostProjectRegistration resource. - * @returns {string} A string representing the project. - */ - matchProjectFromHostProjectRegistrationName(hostProjectRegistrationName: string) { - return this.pathTemplates.hostProjectRegistrationPathTemplate.match(hostProjectRegistrationName).project; - } - - /** - * Parse the location from HostProjectRegistration resource. - * - * @param {string} hostProjectRegistrationName - * A fully-qualified path representing HostProjectRegistration resource. - * @returns {string} A string representing the location. - */ - matchLocationFromHostProjectRegistrationName(hostProjectRegistrationName: string) { - return this.pathTemplates.hostProjectRegistrationPathTemplate.match(hostProjectRegistrationName).location; - } - - /** - * Parse the host_project_registration from HostProjectRegistration resource. - * - * @param {string} hostProjectRegistrationName - * A fully-qualified path representing HostProjectRegistration resource. - * @returns {string} A string representing the host_project_registration. - */ - matchHostProjectRegistrationFromHostProjectRegistrationName(hostProjectRegistrationName: string) { - return this.pathTemplates.hostProjectRegistrationPathTemplate.match(hostProjectRegistrationName).host_project_registration; - } - - /** - * Return a fully-qualified location resource name string. - * - * @param {string} project - * @param {string} location - * @returns {string} Resource name string. - */ - locationPath(project:string,location:string) { - return this.pathTemplates.locationPathTemplate.render({ - project: project, - location: location, - }); - } - - /** - * Parse the project from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the project. - */ - matchProjectFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).project; - } - - /** - * Parse the location from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the location. - */ - matchLocationFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).location; - } - - /** - * Return a fully-qualified plugin resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} plugin - * @returns {string} Resource name string. - */ - pluginPath(project:string,location:string,plugin:string) { - return this.pathTemplates.pluginPathTemplate.render({ - project: project, - location: location, - plugin: plugin, - }); - } - - /** - * Parse the project from Plugin resource. - * - * @param {string} pluginName - * A fully-qualified path representing Plugin resource. - * @returns {string} A string representing the project. - */ - matchProjectFromPluginName(pluginName: string) { - return this.pathTemplates.pluginPathTemplate.match(pluginName).project; - } - - /** - * Parse the location from Plugin resource. - * - * @param {string} pluginName - * A fully-qualified path representing Plugin resource. - * @returns {string} A string representing the location. - */ - matchLocationFromPluginName(pluginName: string) { - return this.pathTemplates.pluginPathTemplate.match(pluginName).location; - } - - /** - * Parse the plugin from Plugin resource. - * - * @param {string} pluginName - * A fully-qualified path representing Plugin resource. - * @returns {string} A string representing the plugin. - */ - matchPluginFromPluginName(pluginName: string) { - return this.pathTemplates.pluginPathTemplate.match(pluginName).plugin; - } - - /** - * Return a fully-qualified project resource name string. - * - * @param {string} project - * @returns {string} Resource name string. - */ - projectPath(project:string) { - return this.pathTemplates.projectPathTemplate.render({ - project: project, - }); - } - - /** - * Parse the project from Project resource. - * - * @param {string} projectName - * A fully-qualified path representing Project resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectName(projectName: string) { - return this.pathTemplates.projectPathTemplate.match(projectName).project; - } - - /** - * Return a fully-qualified runtimeProjectAttachment resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} runtime_project_attachment - * @returns {string} Resource name string. - */ - runtimeProjectAttachmentPath(project:string,location:string,runtimeProjectAttachment:string) { - return this.pathTemplates.runtimeProjectAttachmentPathTemplate.render({ - project: project, - location: location, - runtime_project_attachment: runtimeProjectAttachment, - }); - } - - /** - * Parse the project from RuntimeProjectAttachment resource. - * - * @param {string} runtimeProjectAttachmentName - * A fully-qualified path representing RuntimeProjectAttachment resource. - * @returns {string} A string representing the project. - */ - matchProjectFromRuntimeProjectAttachmentName(runtimeProjectAttachmentName: string) { - return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match(runtimeProjectAttachmentName).project; - } - - /** - * Parse the location from RuntimeProjectAttachment resource. - * - * @param {string} runtimeProjectAttachmentName - * A fully-qualified path representing RuntimeProjectAttachment resource. - * @returns {string} A string representing the location. - */ - matchLocationFromRuntimeProjectAttachmentName(runtimeProjectAttachmentName: string) { - return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match(runtimeProjectAttachmentName).location; - } - - /** - * Parse the runtime_project_attachment from RuntimeProjectAttachment resource. - * - * @param {string} runtimeProjectAttachmentName - * A fully-qualified path representing RuntimeProjectAttachment resource. - * @returns {string} A string representing the runtime_project_attachment. - */ - matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName(runtimeProjectAttachmentName: string) { - return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match(runtimeProjectAttachmentName).runtime_project_attachment; - } - - /** - * Return a fully-qualified spec resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} api - * @param {string} version - * @param {string} spec - * @returns {string} Resource name string. - */ - specPath(project:string,location:string,api:string,version:string,spec:string) { - return this.pathTemplates.specPathTemplate.render({ - project: project, - location: location, - api: api, - version: version, - spec: spec, - }); - } - - /** - * Parse the project from Spec resource. - * - * @param {string} specName - * A fully-qualified path representing Spec resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSpecName(specName: string) { - return this.pathTemplates.specPathTemplate.match(specName).project; - } - - /** - * Parse the location from Spec resource. - * - * @param {string} specName - * A fully-qualified path representing Spec resource. - * @returns {string} A string representing the location. - */ - matchLocationFromSpecName(specName: string) { - return this.pathTemplates.specPathTemplate.match(specName).location; - } - - /** - * Parse the api from Spec resource. - * - * @param {string} specName - * A fully-qualified path representing Spec resource. - * @returns {string} A string representing the api. - */ - matchApiFromSpecName(specName: string) { - return this.pathTemplates.specPathTemplate.match(specName).api; - } - - /** - * Parse the version from Spec resource. - * - * @param {string} specName - * A fully-qualified path representing Spec resource. - * @returns {string} A string representing the version. - */ - matchVersionFromSpecName(specName: string) { - return this.pathTemplates.specPathTemplate.match(specName).version; - } - - /** - * Parse the spec from Spec resource. - * - * @param {string} specName - * A fully-qualified path representing Spec resource. - * @returns {string} A string representing the spec. - */ - matchSpecFromSpecName(specName: string) { - return this.pathTemplates.specPathTemplate.match(specName).spec; - } - - /** - * Return a fully-qualified styleGuide resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} plugin - * @returns {string} Resource name string. - */ - styleGuidePath(project:string,location:string,plugin:string) { - return this.pathTemplates.styleGuidePathTemplate.render({ - project: project, - location: location, - plugin: plugin, - }); - } - - /** - * Parse the project from StyleGuide resource. - * - * @param {string} styleGuideName - * A fully-qualified path representing StyleGuide resource. - * @returns {string} A string representing the project. - */ - matchProjectFromStyleGuideName(styleGuideName: string) { - return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName).project; - } - - /** - * Parse the location from StyleGuide resource. - * - * @param {string} styleGuideName - * A fully-qualified path representing StyleGuide resource. - * @returns {string} A string representing the location. - */ - matchLocationFromStyleGuideName(styleGuideName: string) { - return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName).location; - } - - /** - * Parse the plugin from StyleGuide resource. - * - * @param {string} styleGuideName - * A fully-qualified path representing StyleGuide resource. - * @returns {string} A string representing the plugin. - */ - matchPluginFromStyleGuideName(styleGuideName: string) { - return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName).plugin; - } - - /** - * Return a fully-qualified version resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} api - * @param {string} version - * @returns {string} Resource name string. - */ - versionPath(project:string,location:string,api:string,version:string) { - return this.pathTemplates.versionPathTemplate.render({ - project: project, - location: location, - api: api, - version: version, - }); - } - - /** - * Parse the project from Version resource. - * - * @param {string} versionName - * A fully-qualified path representing Version resource. - * @returns {string} A string representing the project. - */ - matchProjectFromVersionName(versionName: string) { - return this.pathTemplates.versionPathTemplate.match(versionName).project; - } - - /** - * Parse the location from Version resource. - * - * @param {string} versionName - * A fully-qualified path representing Version resource. - * @returns {string} A string representing the location. - */ - matchLocationFromVersionName(versionName: string) { - return this.pathTemplates.versionPathTemplate.match(versionName).location; - } - - /** - * Parse the api from Version resource. - * - * @param {string} versionName - * A fully-qualified path representing Version resource. - * @returns {string} A string representing the api. - */ - matchApiFromVersionName(versionName: string) { - return this.pathTemplates.versionPathTemplate.match(versionName).api; - } - - /** - * Parse the version from Version resource. - * - * @param {string} versionName - * A fully-qualified path representing Version resource. - * @returns {string} A string representing the version. - */ - matchVersionFromVersionName(versionName: string) { - return this.pathTemplates.versionPathTemplate.match(versionName).version; - } - - /** - * 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.apiHubStub && !this._terminated) { - return this.apiHubStub.then(stub => { - this._terminated = true; - stub.close(); - this.locationsClient.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_client_config.json b/owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_client_config.json deleted file mode 100644 index d279d06d0ba..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_client_config.json +++ /dev/null @@ -1,213 +0,0 @@ -{ - "interfaces": { - "google.cloud.apihub.v1.ApiHub": { - "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": { - "CreateApi": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetApi": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "ListApis": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "UpdateApi": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteApi": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CreateVersion": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetVersion": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "ListVersions": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "UpdateVersion": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteVersion": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CreateSpec": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetSpec": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "GetSpecContents": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "ListSpecs": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "UpdateSpec": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteSpec": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetApiOperation": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "ListApiOperations": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "GetDefinition": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "CreateDeployment": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetDeployment": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "ListDeployments": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "UpdateDeployment": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteDeployment": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CreateAttribute": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetAttribute": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "UpdateAttribute": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteAttribute": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListAttributes": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "SearchResources": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "CreateExternalApi": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetExternalApi": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "UpdateExternalApi": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteExternalApi": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListExternalApis": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_dependencies_client.ts b/owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_dependencies_client.ts deleted file mode 100644 index 5cadcb4a302..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_dependencies_client.ts +++ /dev/null @@ -1,1933 +0,0 @@ -// Copyright 2024 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, PaginationCallback, GaxCall, 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/api_hub_dependencies_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './api_hub_dependencies_client_config.json'; -const version = require('../../../package.json').version; - -/** - * This service provides methods for various operations related to a - * {@link protos.google.cloud.apihub.v1.Dependency|Dependency} in the API hub. - * @class - * @memberof v1 - */ -export class ApiHubDependenciesClient { - 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}; - private _universeDomain: string; - private _servicePath: string; - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - locationsClient: LocationsClient; - pathTemplates: {[name: string]: gax.PathTemplate}; - apiHubDependenciesStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of ApiHubDependenciesClient. - * - * @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 ApiHubDependenciesClient({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 ApiHubDependenciesClient; - if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { - throw new Error('Please set either universe_domain or universeDomain, but not both.'); - } - const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; - this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; - this._servicePath = 'apihub.' + this._universeDomain; - const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; - this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); - const port = opts?.port || staticMembers.port; - const clientConfig = opts?.clientConfig ?? {}; - // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). - if (!opts) { - opts = {fallback: true}; - } else { - opts.fallback = opts.fallback ?? true; - } - 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 !== this._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 = this._servicePath; - - // Set the default scopes in auth client if needed. - if (servicePath === this._servicePath) { - this.auth.defaultScopes = staticMembers.scopes; - } - 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 === 'object' && '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 = { - apiPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apis/{api}' - ), - apiHubInstancePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apiHubInstances/{api_hub_instance}' - ), - apiOperationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}' - ), - attributePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/attributes/{attribute}' - ), - definitionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}' - ), - dependencyPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/dependencies/{dependency}' - ), - deploymentPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/deployments/{deployment}' - ), - externalApiPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/externalApis/{external_api}' - ), - hostProjectRegistrationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/hostProjectRegistrations/{host_project_registration}' - ), - locationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}' - ), - pluginPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/plugins/{plugin}' - ), - projectPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}' - ), - runtimeProjectAttachmentPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}' - ), - specPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}' - ), - styleGuidePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/plugins/{plugin}/styleGuide' - ), - versionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apis/{api}/versions/{version}' - ), - }; - - // 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 = { - listDependencies: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'dependencies') - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.apihub.v1.ApiHubDependencies', 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.apiHubDependenciesStub) { - return this.apiHubDependenciesStub; - } - - // Put together the "service stub" for - // google.cloud.apihub.v1.ApiHubDependencies. - this.apiHubDependenciesStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.apihub.v1.ApiHubDependencies') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.apihub.v1.ApiHubDependencies, - 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 apiHubDependenciesStubMethods = - ['createDependency', 'getDependency', 'updateDependency', 'deleteDependency', 'listDependencies']; - for (const methodName of apiHubDependenciesStubMethods) { - const callPromise = this.apiHubDependenciesStub.then( - stub => (...args: Array<{}>) => { - if (this._terminated) { - return Promise.reject('The client has already been closed.'); - } - const func = stub[methodName]; - return func.apply(stub, args); - }, - (err: Error|null|undefined) => () => { - throw err; - }); - - const descriptor = - this.descriptors.page[methodName] || - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor, - this._opts.fallback - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.apiHubDependenciesStub; - } - - /** - * The DNS address for this API service. - * @deprecated Use the apiEndpoint method of the client instance. - * @returns {string} The DNS address for this service. - */ - static get servicePath() { - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); - } - return 'apihub.googleapis.com'; - } - - /** - * The DNS address for this API service - same as servicePath. - * @deprecated Use the apiEndpoint method of the client instance. - * @returns {string} The DNS address for this service. - */ - static get apiEndpoint() { - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); - } - return 'apihub.googleapis.com'; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - get apiEndpoint() { - return this._servicePath; - } - - get universeDomain() { - return this._universeDomain; - } - - /** - * 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 -- - // ------------------- -/** - * Create a dependency between two entities in the API hub. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource for the dependency resource. - * Format: `projects/{project}/locations/{location}` - * @param {string} [request.dependencyId] - * Optional. The ID to use for the dependency resource, which will become the - * final component of the dependency's resource name. This field is optional. - * * If provided, the same will be used. The service will throw an error if - * duplicate id is provided by the client. - * * If not provided, a system generated id will be used. - * - * This value should be 4-500 characters, and valid characters - * are `{@link protos.A-Z|a-z}[0-9]-_`. - * @param {google.cloud.apihub.v1.Dependency} request.dependency - * Required. The dependency resource to create. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.apihub.v1.Dependency|Dependency}. - * 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/api_hub_dependencies.create_dependency.js - * region_tag:apihub_v1_generated_ApiHubDependencies_CreateDependency_async - */ - createDependency( - request?: protos.google.cloud.apihub.v1.ICreateDependencyRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apihub.v1.IDependency, - protos.google.cloud.apihub.v1.ICreateDependencyRequest|undefined, {}|undefined - ]>; - createDependency( - request: protos.google.cloud.apihub.v1.ICreateDependencyRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.apihub.v1.IDependency, - protos.google.cloud.apihub.v1.ICreateDependencyRequest|null|undefined, - {}|null|undefined>): void; - createDependency( - request: protos.google.cloud.apihub.v1.ICreateDependencyRequest, - callback: Callback< - protos.google.cloud.apihub.v1.IDependency, - protos.google.cloud.apihub.v1.ICreateDependencyRequest|null|undefined, - {}|null|undefined>): void; - createDependency( - request?: protos.google.cloud.apihub.v1.ICreateDependencyRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.apihub.v1.IDependency, - protos.google.cloud.apihub.v1.ICreateDependencyRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.apihub.v1.IDependency, - protos.google.cloud.apihub.v1.ICreateDependencyRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.apihub.v1.IDependency, - protos.google.cloud.apihub.v1.ICreateDependencyRequest|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.createDependency(request, options, callback); - } -/** - * Get details about a dependency resource in the API hub. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the dependency resource to retrieve. - * Format: `projects/{project}/locations/{location}/dependencies/{dependency}` - * @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.apihub.v1.Dependency|Dependency}. - * 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/api_hub_dependencies.get_dependency.js - * region_tag:apihub_v1_generated_ApiHubDependencies_GetDependency_async - */ - getDependency( - request?: protos.google.cloud.apihub.v1.IGetDependencyRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apihub.v1.IDependency, - protos.google.cloud.apihub.v1.IGetDependencyRequest|undefined, {}|undefined - ]>; - getDependency( - request: protos.google.cloud.apihub.v1.IGetDependencyRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.apihub.v1.IDependency, - protos.google.cloud.apihub.v1.IGetDependencyRequest|null|undefined, - {}|null|undefined>): void; - getDependency( - request: protos.google.cloud.apihub.v1.IGetDependencyRequest, - callback: Callback< - protos.google.cloud.apihub.v1.IDependency, - protos.google.cloud.apihub.v1.IGetDependencyRequest|null|undefined, - {}|null|undefined>): void; - getDependency( - request?: protos.google.cloud.apihub.v1.IGetDependencyRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.apihub.v1.IDependency, - protos.google.cloud.apihub.v1.IGetDependencyRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.apihub.v1.IDependency, - protos.google.cloud.apihub.v1.IGetDependencyRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.apihub.v1.IDependency, - protos.google.cloud.apihub.v1.IGetDependencyRequest|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.getDependency(request, options, callback); - } -/** - * Update a dependency based on the - * {@link protos.google.cloud.apihub.v1.UpdateDependencyRequest.update_mask|update_mask} - * provided in the request. - * - * The following fields in the {@link protos.google.cloud.apihub.v1.Dependency|dependency} - * can be updated: - * * {@link protos.google.cloud.apihub.v1.Dependency.description|description} - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.apihub.v1.Dependency} request.dependency - * Required. The dependency resource to update. - * - * The dependency's `name` field is used to identify the dependency to update. - * Format: `projects/{project}/locations/{location}/dependencies/{dependency}` - * @param {google.protobuf.FieldMask} request.updateMask - * Required. The list of fields to update. - * @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.apihub.v1.Dependency|Dependency}. - * 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/api_hub_dependencies.update_dependency.js - * region_tag:apihub_v1_generated_ApiHubDependencies_UpdateDependency_async - */ - updateDependency( - request?: protos.google.cloud.apihub.v1.IUpdateDependencyRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apihub.v1.IDependency, - protos.google.cloud.apihub.v1.IUpdateDependencyRequest|undefined, {}|undefined - ]>; - updateDependency( - request: protos.google.cloud.apihub.v1.IUpdateDependencyRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.apihub.v1.IDependency, - protos.google.cloud.apihub.v1.IUpdateDependencyRequest|null|undefined, - {}|null|undefined>): void; - updateDependency( - request: protos.google.cloud.apihub.v1.IUpdateDependencyRequest, - callback: Callback< - protos.google.cloud.apihub.v1.IDependency, - protos.google.cloud.apihub.v1.IUpdateDependencyRequest|null|undefined, - {}|null|undefined>): void; - updateDependency( - request?: protos.google.cloud.apihub.v1.IUpdateDependencyRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.apihub.v1.IDependency, - protos.google.cloud.apihub.v1.IUpdateDependencyRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.apihub.v1.IDependency, - protos.google.cloud.apihub.v1.IUpdateDependencyRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.apihub.v1.IDependency, - protos.google.cloud.apihub.v1.IUpdateDependencyRequest|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({ - 'dependency.name': request.dependency!.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.updateDependency(request, options, callback); - } -/** - * Delete the dependency resource. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the dependency resource to delete. - * Format: `projects/{project}/locations/{location}/dependencies/{dependency}` - * @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.protobuf.Empty|Empty}. - * 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/api_hub_dependencies.delete_dependency.js - * region_tag:apihub_v1_generated_ApiHubDependencies_DeleteDependency_async - */ - deleteDependency( - request?: protos.google.cloud.apihub.v1.IDeleteDependencyRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.IDeleteDependencyRequest|undefined, {}|undefined - ]>; - deleteDependency( - request: protos.google.cloud.apihub.v1.IDeleteDependencyRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.IDeleteDependencyRequest|null|undefined, - {}|null|undefined>): void; - deleteDependency( - request: protos.google.cloud.apihub.v1.IDeleteDependencyRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.IDeleteDependencyRequest|null|undefined, - {}|null|undefined>): void; - deleteDependency( - request?: protos.google.cloud.apihub.v1.IDeleteDependencyRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.IDeleteDependencyRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.IDeleteDependencyRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.IDeleteDependencyRequest|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.deleteDependency(request, options, callback); - } - - /** - * List dependencies based on the provided filter and pagination parameters. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent which owns this collection of dependency resources. - * Format: `projects/{project}/locations/{location}` - * @param {string} [request.filter] - * Optional. An expression that filters the list of Dependencies. - * - * A filter expression consists of a field name, a comparison operator, and - * a value for filtering. The value must be a string. Allowed comparison - * operator is `=`. Filters are not case sensitive. - * - * The following fields in the `Dependency` are eligible for filtering: - * - * * `consumer.operation_resource_name` - The operation resource name for - * the consumer entity involved in a dependency. Allowed comparison - * operators: `=`. - * * `consumer.external_api_resource_name` - The external api resource name - * for the consumer entity involved in a dependency. Allowed comparison - * operators: `=`. - * * `supplier.operation_resource_name` - The operation resource name for - * the supplier entity involved in a dependency. Allowed comparison - * operators: `=`. - * * `supplier.external_api_resource_name` - The external api resource name - * for the supplier entity involved in a dependency. Allowed comparison - * operators: `=`. - * - * Expressions are combined with either `AND` logic operator or `OR` logical - * operator but not both of them together i.e. only one of the `AND` or `OR` - * operator can be used throughout the filter string and both the operators - * cannot be used together. No other logical operators are supported. At most - * three filter fields are allowed in the filter string and if provided - * more than that then `INVALID_ARGUMENT` error is returned by the API. - * - * For example, `consumer.operation_resource_name = - * \"projects/p1/locations/global/apis/a1/versions/v1/operations/o1\" OR - * supplier.operation_resource_name = - * \"projects/p1/locations/global/apis/a1/versions/v1/operations/o1\"` - The - * dependencies with either consumer or supplier operation resource name as - * _projects/p1/locations/global/apis/a1/versions/v1/operations/o1_. - * @param {number} [request.pageSize] - * Optional. The maximum number of dependency resources to return. The service - * may return fewer than this value. If unspecified, at most 50 dependencies - * will be returned. The maximum value is 1000; values above 1000 will be - * coerced to 1000. - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous `ListDependencies` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to `ListDependencies` must - * match the call that provided the page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.cloud.apihub.v1.Dependency|Dependency}. - * 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 `listDependenciesAsync()` - * 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. - */ - listDependencies( - request?: protos.google.cloud.apihub.v1.IListDependenciesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apihub.v1.IDependency[], - protos.google.cloud.apihub.v1.IListDependenciesRequest|null, - protos.google.cloud.apihub.v1.IListDependenciesResponse - ]>; - listDependencies( - request: protos.google.cloud.apihub.v1.IListDependenciesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.apihub.v1.IListDependenciesRequest, - protos.google.cloud.apihub.v1.IListDependenciesResponse|null|undefined, - protos.google.cloud.apihub.v1.IDependency>): void; - listDependencies( - request: protos.google.cloud.apihub.v1.IListDependenciesRequest, - callback: PaginationCallback< - protos.google.cloud.apihub.v1.IListDependenciesRequest, - protos.google.cloud.apihub.v1.IListDependenciesResponse|null|undefined, - protos.google.cloud.apihub.v1.IDependency>): void; - listDependencies( - request?: protos.google.cloud.apihub.v1.IListDependenciesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.apihub.v1.IListDependenciesRequest, - protos.google.cloud.apihub.v1.IListDependenciesResponse|null|undefined, - protos.google.cloud.apihub.v1.IDependency>, - callback?: PaginationCallback< - protos.google.cloud.apihub.v1.IListDependenciesRequest, - protos.google.cloud.apihub.v1.IListDependenciesResponse|null|undefined, - protos.google.cloud.apihub.v1.IDependency>): - Promise<[ - protos.google.cloud.apihub.v1.IDependency[], - protos.google.cloud.apihub.v1.IListDependenciesRequest|null, - protos.google.cloud.apihub.v1.IListDependenciesResponse - ]>|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.listDependencies(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent which owns this collection of dependency resources. - * Format: `projects/{project}/locations/{location}` - * @param {string} [request.filter] - * Optional. An expression that filters the list of Dependencies. - * - * A filter expression consists of a field name, a comparison operator, and - * a value for filtering. The value must be a string. Allowed comparison - * operator is `=`. Filters are not case sensitive. - * - * The following fields in the `Dependency` are eligible for filtering: - * - * * `consumer.operation_resource_name` - The operation resource name for - * the consumer entity involved in a dependency. Allowed comparison - * operators: `=`. - * * `consumer.external_api_resource_name` - The external api resource name - * for the consumer entity involved in a dependency. Allowed comparison - * operators: `=`. - * * `supplier.operation_resource_name` - The operation resource name for - * the supplier entity involved in a dependency. Allowed comparison - * operators: `=`. - * * `supplier.external_api_resource_name` - The external api resource name - * for the supplier entity involved in a dependency. Allowed comparison - * operators: `=`. - * - * Expressions are combined with either `AND` logic operator or `OR` logical - * operator but not both of them together i.e. only one of the `AND` or `OR` - * operator can be used throughout the filter string and both the operators - * cannot be used together. No other logical operators are supported. At most - * three filter fields are allowed in the filter string and if provided - * more than that then `INVALID_ARGUMENT` error is returned by the API. - * - * For example, `consumer.operation_resource_name = - * \"projects/p1/locations/global/apis/a1/versions/v1/operations/o1\" OR - * supplier.operation_resource_name = - * \"projects/p1/locations/global/apis/a1/versions/v1/operations/o1\"` - The - * dependencies with either consumer or supplier operation resource name as - * _projects/p1/locations/global/apis/a1/versions/v1/operations/o1_. - * @param {number} [request.pageSize] - * Optional. The maximum number of dependency resources to return. The service - * may return fewer than this value. If unspecified, at most 50 dependencies - * will be returned. The maximum value is 1000; values above 1000 will be - * coerced to 1000. - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous `ListDependencies` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to `ListDependencies` must - * match the call that provided the page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.cloud.apihub.v1.Dependency|Dependency} 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 `listDependenciesAsync()` - * 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. - */ - listDependenciesStream( - request?: protos.google.cloud.apihub.v1.IListDependenciesRequest, - 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['listDependencies']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listDependencies.createStream( - this.innerApiCalls.listDependencies as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listDependencies`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent which owns this collection of dependency resources. - * Format: `projects/{project}/locations/{location}` - * @param {string} [request.filter] - * Optional. An expression that filters the list of Dependencies. - * - * A filter expression consists of a field name, a comparison operator, and - * a value for filtering. The value must be a string. Allowed comparison - * operator is `=`. Filters are not case sensitive. - * - * The following fields in the `Dependency` are eligible for filtering: - * - * * `consumer.operation_resource_name` - The operation resource name for - * the consumer entity involved in a dependency. Allowed comparison - * operators: `=`. - * * `consumer.external_api_resource_name` - The external api resource name - * for the consumer entity involved in a dependency. Allowed comparison - * operators: `=`. - * * `supplier.operation_resource_name` - The operation resource name for - * the supplier entity involved in a dependency. Allowed comparison - * operators: `=`. - * * `supplier.external_api_resource_name` - The external api resource name - * for the supplier entity involved in a dependency. Allowed comparison - * operators: `=`. - * - * Expressions are combined with either `AND` logic operator or `OR` logical - * operator but not both of them together i.e. only one of the `AND` or `OR` - * operator can be used throughout the filter string and both the operators - * cannot be used together. No other logical operators are supported. At most - * three filter fields are allowed in the filter string and if provided - * more than that then `INVALID_ARGUMENT` error is returned by the API. - * - * For example, `consumer.operation_resource_name = - * \"projects/p1/locations/global/apis/a1/versions/v1/operations/o1\" OR - * supplier.operation_resource_name = - * \"projects/p1/locations/global/apis/a1/versions/v1/operations/o1\"` - The - * dependencies with either consumer or supplier operation resource name as - * _projects/p1/locations/global/apis/a1/versions/v1/operations/o1_. - * @param {number} [request.pageSize] - * Optional. The maximum number of dependency resources to return. The service - * may return fewer than this value. If unspecified, at most 50 dependencies - * will be returned. The maximum value is 1000; values above 1000 will be - * coerced to 1000. - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous `ListDependencies` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to `ListDependencies` must - * match the call that provided the page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@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.apihub.v1.Dependency|Dependency}. 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/api_hub_dependencies.list_dependencies.js - * region_tag:apihub_v1_generated_ApiHubDependencies_ListDependencies_async - */ - listDependenciesAsync( - request?: protos.google.cloud.apihub.v1.IListDependenciesRequest, - 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['listDependencies']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listDependencies.asyncIterate( - this.innerApiCalls['listDependencies'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } -/** - * 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); - } - - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified api resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} api - * @returns {string} Resource name string. - */ - apiPath(project:string,location:string,api:string) { - return this.pathTemplates.apiPathTemplate.render({ - project: project, - location: location, - api: api, - }); - } - - /** - * Parse the project from Api resource. - * - * @param {string} apiName - * A fully-qualified path representing Api resource. - * @returns {string} A string representing the project. - */ - matchProjectFromApiName(apiName: string) { - return this.pathTemplates.apiPathTemplate.match(apiName).project; - } - - /** - * Parse the location from Api resource. - * - * @param {string} apiName - * A fully-qualified path representing Api resource. - * @returns {string} A string representing the location. - */ - matchLocationFromApiName(apiName: string) { - return this.pathTemplates.apiPathTemplate.match(apiName).location; - } - - /** - * Parse the api from Api resource. - * - * @param {string} apiName - * A fully-qualified path representing Api resource. - * @returns {string} A string representing the api. - */ - matchApiFromApiName(apiName: string) { - return this.pathTemplates.apiPathTemplate.match(apiName).api; - } - - /** - * Return a fully-qualified apiHubInstance resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} api_hub_instance - * @returns {string} Resource name string. - */ - apiHubInstancePath(project:string,location:string,apiHubInstance:string) { - return this.pathTemplates.apiHubInstancePathTemplate.render({ - project: project, - location: location, - api_hub_instance: apiHubInstance, - }); - } - - /** - * Parse the project from ApiHubInstance resource. - * - * @param {string} apiHubInstanceName - * A fully-qualified path representing ApiHubInstance resource. - * @returns {string} A string representing the project. - */ - matchProjectFromApiHubInstanceName(apiHubInstanceName: string) { - return this.pathTemplates.apiHubInstancePathTemplate.match(apiHubInstanceName).project; - } - - /** - * Parse the location from ApiHubInstance resource. - * - * @param {string} apiHubInstanceName - * A fully-qualified path representing ApiHubInstance resource. - * @returns {string} A string representing the location. - */ - matchLocationFromApiHubInstanceName(apiHubInstanceName: string) { - return this.pathTemplates.apiHubInstancePathTemplate.match(apiHubInstanceName).location; - } - - /** - * Parse the api_hub_instance from ApiHubInstance resource. - * - * @param {string} apiHubInstanceName - * A fully-qualified path representing ApiHubInstance resource. - * @returns {string} A string representing the api_hub_instance. - */ - matchApiHubInstanceFromApiHubInstanceName(apiHubInstanceName: string) { - return this.pathTemplates.apiHubInstancePathTemplate.match(apiHubInstanceName).api_hub_instance; - } - - /** - * Return a fully-qualified apiOperation resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} api - * @param {string} version - * @param {string} operation - * @returns {string} Resource name string. - */ - apiOperationPath(project:string,location:string,api:string,version:string,operation:string) { - return this.pathTemplates.apiOperationPathTemplate.render({ - project: project, - location: location, - api: api, - version: version, - operation: operation, - }); - } - - /** - * Parse the project from ApiOperation resource. - * - * @param {string} apiOperationName - * A fully-qualified path representing ApiOperation resource. - * @returns {string} A string representing the project. - */ - matchProjectFromApiOperationName(apiOperationName: string) { - return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).project; - } - - /** - * Parse the location from ApiOperation resource. - * - * @param {string} apiOperationName - * A fully-qualified path representing ApiOperation resource. - * @returns {string} A string representing the location. - */ - matchLocationFromApiOperationName(apiOperationName: string) { - return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).location; - } - - /** - * Parse the api from ApiOperation resource. - * - * @param {string} apiOperationName - * A fully-qualified path representing ApiOperation resource. - * @returns {string} A string representing the api. - */ - matchApiFromApiOperationName(apiOperationName: string) { - return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).api; - } - - /** - * Parse the version from ApiOperation resource. - * - * @param {string} apiOperationName - * A fully-qualified path representing ApiOperation resource. - * @returns {string} A string representing the version. - */ - matchVersionFromApiOperationName(apiOperationName: string) { - return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).version; - } - - /** - * Parse the operation from ApiOperation resource. - * - * @param {string} apiOperationName - * A fully-qualified path representing ApiOperation resource. - * @returns {string} A string representing the operation. - */ - matchOperationFromApiOperationName(apiOperationName: string) { - return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).operation; - } - - /** - * Return a fully-qualified attribute resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} attribute - * @returns {string} Resource name string. - */ - attributePath(project:string,location:string,attribute:string) { - return this.pathTemplates.attributePathTemplate.render({ - project: project, - location: location, - attribute: attribute, - }); - } - - /** - * Parse the project from Attribute resource. - * - * @param {string} attributeName - * A fully-qualified path representing Attribute resource. - * @returns {string} A string representing the project. - */ - matchProjectFromAttributeName(attributeName: string) { - return this.pathTemplates.attributePathTemplate.match(attributeName).project; - } - - /** - * Parse the location from Attribute resource. - * - * @param {string} attributeName - * A fully-qualified path representing Attribute resource. - * @returns {string} A string representing the location. - */ - matchLocationFromAttributeName(attributeName: string) { - return this.pathTemplates.attributePathTemplate.match(attributeName).location; - } - - /** - * Parse the attribute from Attribute resource. - * - * @param {string} attributeName - * A fully-qualified path representing Attribute resource. - * @returns {string} A string representing the attribute. - */ - matchAttributeFromAttributeName(attributeName: string) { - return this.pathTemplates.attributePathTemplate.match(attributeName).attribute; - } - - /** - * Return a fully-qualified definition resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} api - * @param {string} version - * @param {string} definition - * @returns {string} Resource name string. - */ - definitionPath(project:string,location:string,api:string,version:string,definition:string) { - return this.pathTemplates.definitionPathTemplate.render({ - project: project, - location: location, - api: api, - version: version, - definition: definition, - }); - } - - /** - * Parse the project from Definition resource. - * - * @param {string} definitionName - * A fully-qualified path representing Definition resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDefinitionName(definitionName: string) { - return this.pathTemplates.definitionPathTemplate.match(definitionName).project; - } - - /** - * Parse the location from Definition resource. - * - * @param {string} definitionName - * A fully-qualified path representing Definition resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDefinitionName(definitionName: string) { - return this.pathTemplates.definitionPathTemplate.match(definitionName).location; - } - - /** - * Parse the api from Definition resource. - * - * @param {string} definitionName - * A fully-qualified path representing Definition resource. - * @returns {string} A string representing the api. - */ - matchApiFromDefinitionName(definitionName: string) { - return this.pathTemplates.definitionPathTemplate.match(definitionName).api; - } - - /** - * Parse the version from Definition resource. - * - * @param {string} definitionName - * A fully-qualified path representing Definition resource. - * @returns {string} A string representing the version. - */ - matchVersionFromDefinitionName(definitionName: string) { - return this.pathTemplates.definitionPathTemplate.match(definitionName).version; - } - - /** - * Parse the definition from Definition resource. - * - * @param {string} definitionName - * A fully-qualified path representing Definition resource. - * @returns {string} A string representing the definition. - */ - matchDefinitionFromDefinitionName(definitionName: string) { - return this.pathTemplates.definitionPathTemplate.match(definitionName).definition; - } - - /** - * Return a fully-qualified dependency resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dependency - * @returns {string} Resource name string. - */ - dependencyPath(project:string,location:string,dependency:string) { - return this.pathTemplates.dependencyPathTemplate.render({ - project: project, - location: location, - dependency: dependency, - }); - } - - /** - * Parse the project from Dependency resource. - * - * @param {string} dependencyName - * A fully-qualified path representing Dependency resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDependencyName(dependencyName: string) { - return this.pathTemplates.dependencyPathTemplate.match(dependencyName).project; - } - - /** - * Parse the location from Dependency resource. - * - * @param {string} dependencyName - * A fully-qualified path representing Dependency resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDependencyName(dependencyName: string) { - return this.pathTemplates.dependencyPathTemplate.match(dependencyName).location; - } - - /** - * Parse the dependency from Dependency resource. - * - * @param {string} dependencyName - * A fully-qualified path representing Dependency resource. - * @returns {string} A string representing the dependency. - */ - matchDependencyFromDependencyName(dependencyName: string) { - return this.pathTemplates.dependencyPathTemplate.match(dependencyName).dependency; - } - - /** - * Return a fully-qualified deployment resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} deployment - * @returns {string} Resource name string. - */ - deploymentPath(project:string,location:string,deployment:string) { - return this.pathTemplates.deploymentPathTemplate.render({ - project: project, - location: location, - deployment: deployment, - }); - } - - /** - * Parse the project from Deployment resource. - * - * @param {string} deploymentName - * A fully-qualified path representing Deployment resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDeploymentName(deploymentName: string) { - return this.pathTemplates.deploymentPathTemplate.match(deploymentName).project; - } - - /** - * Parse the location from Deployment resource. - * - * @param {string} deploymentName - * A fully-qualified path representing Deployment resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDeploymentName(deploymentName: string) { - return this.pathTemplates.deploymentPathTemplate.match(deploymentName).location; - } - - /** - * Parse the deployment from Deployment resource. - * - * @param {string} deploymentName - * A fully-qualified path representing Deployment resource. - * @returns {string} A string representing the deployment. - */ - matchDeploymentFromDeploymentName(deploymentName: string) { - return this.pathTemplates.deploymentPathTemplate.match(deploymentName).deployment; - } - - /** - * Return a fully-qualified externalApi resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} external_api - * @returns {string} Resource name string. - */ - externalApiPath(project:string,location:string,externalApi:string) { - return this.pathTemplates.externalApiPathTemplate.render({ - project: project, - location: location, - external_api: externalApi, - }); - } - - /** - * Parse the project from ExternalApi resource. - * - * @param {string} externalApiName - * A fully-qualified path representing ExternalApi resource. - * @returns {string} A string representing the project. - */ - matchProjectFromExternalApiName(externalApiName: string) { - return this.pathTemplates.externalApiPathTemplate.match(externalApiName).project; - } - - /** - * Parse the location from ExternalApi resource. - * - * @param {string} externalApiName - * A fully-qualified path representing ExternalApi resource. - * @returns {string} A string representing the location. - */ - matchLocationFromExternalApiName(externalApiName: string) { - return this.pathTemplates.externalApiPathTemplate.match(externalApiName).location; - } - - /** - * Parse the external_api from ExternalApi resource. - * - * @param {string} externalApiName - * A fully-qualified path representing ExternalApi resource. - * @returns {string} A string representing the external_api. - */ - matchExternalApiFromExternalApiName(externalApiName: string) { - return this.pathTemplates.externalApiPathTemplate.match(externalApiName).external_api; - } - - /** - * Return a fully-qualified hostProjectRegistration resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} host_project_registration - * @returns {string} Resource name string. - */ - hostProjectRegistrationPath(project:string,location:string,hostProjectRegistration:string) { - return this.pathTemplates.hostProjectRegistrationPathTemplate.render({ - project: project, - location: location, - host_project_registration: hostProjectRegistration, - }); - } - - /** - * Parse the project from HostProjectRegistration resource. - * - * @param {string} hostProjectRegistrationName - * A fully-qualified path representing HostProjectRegistration resource. - * @returns {string} A string representing the project. - */ - matchProjectFromHostProjectRegistrationName(hostProjectRegistrationName: string) { - return this.pathTemplates.hostProjectRegistrationPathTemplate.match(hostProjectRegistrationName).project; - } - - /** - * Parse the location from HostProjectRegistration resource. - * - * @param {string} hostProjectRegistrationName - * A fully-qualified path representing HostProjectRegistration resource. - * @returns {string} A string representing the location. - */ - matchLocationFromHostProjectRegistrationName(hostProjectRegistrationName: string) { - return this.pathTemplates.hostProjectRegistrationPathTemplate.match(hostProjectRegistrationName).location; - } - - /** - * Parse the host_project_registration from HostProjectRegistration resource. - * - * @param {string} hostProjectRegistrationName - * A fully-qualified path representing HostProjectRegistration resource. - * @returns {string} A string representing the host_project_registration. - */ - matchHostProjectRegistrationFromHostProjectRegistrationName(hostProjectRegistrationName: string) { - return this.pathTemplates.hostProjectRegistrationPathTemplate.match(hostProjectRegistrationName).host_project_registration; - } - - /** - * Return a fully-qualified location resource name string. - * - * @param {string} project - * @param {string} location - * @returns {string} Resource name string. - */ - locationPath(project:string,location:string) { - return this.pathTemplates.locationPathTemplate.render({ - project: project, - location: location, - }); - } - - /** - * Parse the project from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the project. - */ - matchProjectFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).project; - } - - /** - * Parse the location from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the location. - */ - matchLocationFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).location; - } - - /** - * Return a fully-qualified plugin resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} plugin - * @returns {string} Resource name string. - */ - pluginPath(project:string,location:string,plugin:string) { - return this.pathTemplates.pluginPathTemplate.render({ - project: project, - location: location, - plugin: plugin, - }); - } - - /** - * Parse the project from Plugin resource. - * - * @param {string} pluginName - * A fully-qualified path representing Plugin resource. - * @returns {string} A string representing the project. - */ - matchProjectFromPluginName(pluginName: string) { - return this.pathTemplates.pluginPathTemplate.match(pluginName).project; - } - - /** - * Parse the location from Plugin resource. - * - * @param {string} pluginName - * A fully-qualified path representing Plugin resource. - * @returns {string} A string representing the location. - */ - matchLocationFromPluginName(pluginName: string) { - return this.pathTemplates.pluginPathTemplate.match(pluginName).location; - } - - /** - * Parse the plugin from Plugin resource. - * - * @param {string} pluginName - * A fully-qualified path representing Plugin resource. - * @returns {string} A string representing the plugin. - */ - matchPluginFromPluginName(pluginName: string) { - return this.pathTemplates.pluginPathTemplate.match(pluginName).plugin; - } - - /** - * Return a fully-qualified project resource name string. - * - * @param {string} project - * @returns {string} Resource name string. - */ - projectPath(project:string) { - return this.pathTemplates.projectPathTemplate.render({ - project: project, - }); - } - - /** - * Parse the project from Project resource. - * - * @param {string} projectName - * A fully-qualified path representing Project resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectName(projectName: string) { - return this.pathTemplates.projectPathTemplate.match(projectName).project; - } - - /** - * Return a fully-qualified runtimeProjectAttachment resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} runtime_project_attachment - * @returns {string} Resource name string. - */ - runtimeProjectAttachmentPath(project:string,location:string,runtimeProjectAttachment:string) { - return this.pathTemplates.runtimeProjectAttachmentPathTemplate.render({ - project: project, - location: location, - runtime_project_attachment: runtimeProjectAttachment, - }); - } - - /** - * Parse the project from RuntimeProjectAttachment resource. - * - * @param {string} runtimeProjectAttachmentName - * A fully-qualified path representing RuntimeProjectAttachment resource. - * @returns {string} A string representing the project. - */ - matchProjectFromRuntimeProjectAttachmentName(runtimeProjectAttachmentName: string) { - return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match(runtimeProjectAttachmentName).project; - } - - /** - * Parse the location from RuntimeProjectAttachment resource. - * - * @param {string} runtimeProjectAttachmentName - * A fully-qualified path representing RuntimeProjectAttachment resource. - * @returns {string} A string representing the location. - */ - matchLocationFromRuntimeProjectAttachmentName(runtimeProjectAttachmentName: string) { - return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match(runtimeProjectAttachmentName).location; - } - - /** - * Parse the runtime_project_attachment from RuntimeProjectAttachment resource. - * - * @param {string} runtimeProjectAttachmentName - * A fully-qualified path representing RuntimeProjectAttachment resource. - * @returns {string} A string representing the runtime_project_attachment. - */ - matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName(runtimeProjectAttachmentName: string) { - return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match(runtimeProjectAttachmentName).runtime_project_attachment; - } - - /** - * Return a fully-qualified spec resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} api - * @param {string} version - * @param {string} spec - * @returns {string} Resource name string. - */ - specPath(project:string,location:string,api:string,version:string,spec:string) { - return this.pathTemplates.specPathTemplate.render({ - project: project, - location: location, - api: api, - version: version, - spec: spec, - }); - } - - /** - * Parse the project from Spec resource. - * - * @param {string} specName - * A fully-qualified path representing Spec resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSpecName(specName: string) { - return this.pathTemplates.specPathTemplate.match(specName).project; - } - - /** - * Parse the location from Spec resource. - * - * @param {string} specName - * A fully-qualified path representing Spec resource. - * @returns {string} A string representing the location. - */ - matchLocationFromSpecName(specName: string) { - return this.pathTemplates.specPathTemplate.match(specName).location; - } - - /** - * Parse the api from Spec resource. - * - * @param {string} specName - * A fully-qualified path representing Spec resource. - * @returns {string} A string representing the api. - */ - matchApiFromSpecName(specName: string) { - return this.pathTemplates.specPathTemplate.match(specName).api; - } - - /** - * Parse the version from Spec resource. - * - * @param {string} specName - * A fully-qualified path representing Spec resource. - * @returns {string} A string representing the version. - */ - matchVersionFromSpecName(specName: string) { - return this.pathTemplates.specPathTemplate.match(specName).version; - } - - /** - * Parse the spec from Spec resource. - * - * @param {string} specName - * A fully-qualified path representing Spec resource. - * @returns {string} A string representing the spec. - */ - matchSpecFromSpecName(specName: string) { - return this.pathTemplates.specPathTemplate.match(specName).spec; - } - - /** - * Return a fully-qualified styleGuide resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} plugin - * @returns {string} Resource name string. - */ - styleGuidePath(project:string,location:string,plugin:string) { - return this.pathTemplates.styleGuidePathTemplate.render({ - project: project, - location: location, - plugin: plugin, - }); - } - - /** - * Parse the project from StyleGuide resource. - * - * @param {string} styleGuideName - * A fully-qualified path representing StyleGuide resource. - * @returns {string} A string representing the project. - */ - matchProjectFromStyleGuideName(styleGuideName: string) { - return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName).project; - } - - /** - * Parse the location from StyleGuide resource. - * - * @param {string} styleGuideName - * A fully-qualified path representing StyleGuide resource. - * @returns {string} A string representing the location. - */ - matchLocationFromStyleGuideName(styleGuideName: string) { - return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName).location; - } - - /** - * Parse the plugin from StyleGuide resource. - * - * @param {string} styleGuideName - * A fully-qualified path representing StyleGuide resource. - * @returns {string} A string representing the plugin. - */ - matchPluginFromStyleGuideName(styleGuideName: string) { - return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName).plugin; - } - - /** - * Return a fully-qualified version resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} api - * @param {string} version - * @returns {string} Resource name string. - */ - versionPath(project:string,location:string,api:string,version:string) { - return this.pathTemplates.versionPathTemplate.render({ - project: project, - location: location, - api: api, - version: version, - }); - } - - /** - * Parse the project from Version resource. - * - * @param {string} versionName - * A fully-qualified path representing Version resource. - * @returns {string} A string representing the project. - */ - matchProjectFromVersionName(versionName: string) { - return this.pathTemplates.versionPathTemplate.match(versionName).project; - } - - /** - * Parse the location from Version resource. - * - * @param {string} versionName - * A fully-qualified path representing Version resource. - * @returns {string} A string representing the location. - */ - matchLocationFromVersionName(versionName: string) { - return this.pathTemplates.versionPathTemplate.match(versionName).location; - } - - /** - * Parse the api from Version resource. - * - * @param {string} versionName - * A fully-qualified path representing Version resource. - * @returns {string} A string representing the api. - */ - matchApiFromVersionName(versionName: string) { - return this.pathTemplates.versionPathTemplate.match(versionName).api; - } - - /** - * Parse the version from Version resource. - * - * @param {string} versionName - * A fully-qualified path representing Version resource. - * @returns {string} A string representing the version. - */ - matchVersionFromVersionName(versionName: string) { - return this.pathTemplates.versionPathTemplate.match(versionName).version; - } - - /** - * 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.apiHubDependenciesStub && !this._terminated) { - return this.apiHubDependenciesStub.then(stub => { - this._terminated = true; - stub.close(); - this.locationsClient.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_dependencies_client_config.json b/owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_dependencies_client_config.json deleted file mode 100644 index eade2c78f29..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_dependencies_client_config.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "interfaces": { - "google.cloud.apihub.v1.ApiHubDependencies": { - "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": { - "CreateDependency": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetDependency": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "UpdateDependency": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteDependency": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListDependencies": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_dependencies_proto_list.json b/owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_dependencies_proto_list.json deleted file mode 100644 index 07e987f7fb3..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_dependencies_proto_list.json +++ /dev/null @@ -1,9 +0,0 @@ -[ - "../../protos/google/cloud/apihub/v1/apihub_service.proto", - "../../protos/google/cloud/apihub/v1/common_fields.proto", - "../../protos/google/cloud/apihub/v1/host_project_registration_service.proto", - "../../protos/google/cloud/apihub/v1/linting_service.proto", - "../../protos/google/cloud/apihub/v1/plugin_service.proto", - "../../protos/google/cloud/apihub/v1/provisioning_service.proto", - "../../protos/google/cloud/apihub/v1/runtime_project_attachment_service.proto" -] diff --git a/owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_plugin_client.ts b/owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_plugin_client.ts deleted file mode 100644 index 55eea0843ee..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_plugin_client.ts +++ /dev/null @@ -1,1469 +0,0 @@ -// Copyright 2024 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, LocationsClient, LocationProtos} from 'google-gax'; - -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); - -/** - * Client JSON configuration object, loaded from - * `src/v1/api_hub_plugin_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './api_hub_plugin_client_config.json'; -const version = require('../../../package.json').version; - -/** - * This service is used for managing plugins inside the API Hub. - * @class - * @memberof v1 - */ -export class ApiHubPluginClient { - 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}; - private _universeDomain: string; - private _servicePath: string; - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - locationsClient: LocationsClient; - pathTemplates: {[name: string]: gax.PathTemplate}; - apiHubPluginStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of ApiHubPluginClient. - * - * @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 ApiHubPluginClient({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 ApiHubPluginClient; - if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { - throw new Error('Please set either universe_domain or universeDomain, but not both.'); - } - const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; - this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; - this._servicePath = 'apihub.' + this._universeDomain; - const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; - this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); - const port = opts?.port || staticMembers.port; - const clientConfig = opts?.clientConfig ?? {}; - // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). - if (!opts) { - opts = {fallback: true}; - } else { - opts.fallback = opts.fallback ?? true; - } - 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 !== this._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 = this._servicePath; - - // Set the default scopes in auth client if needed. - if (servicePath === this._servicePath) { - this.auth.defaultScopes = staticMembers.scopes; - } - 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 === 'object' && '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 = { - apiPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apis/{api}' - ), - apiHubInstancePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apiHubInstances/{api_hub_instance}' - ), - apiOperationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}' - ), - attributePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/attributes/{attribute}' - ), - definitionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}' - ), - dependencyPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/dependencies/{dependency}' - ), - deploymentPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/deployments/{deployment}' - ), - externalApiPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/externalApis/{external_api}' - ), - hostProjectRegistrationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/hostProjectRegistrations/{host_project_registration}' - ), - pluginPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/plugins/{plugin}' - ), - runtimeProjectAttachmentPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}' - ), - specPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}' - ), - styleGuidePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/plugins/{plugin}/styleGuide' - ), - versionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apis/{api}/versions/{version}' - ), - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.apihub.v1.ApiHubPlugin', 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.apiHubPluginStub) { - return this.apiHubPluginStub; - } - - // Put together the "service stub" for - // google.cloud.apihub.v1.ApiHubPlugin. - this.apiHubPluginStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.apihub.v1.ApiHubPlugin') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.apihub.v1.ApiHubPlugin, - 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 apiHubPluginStubMethods = - ['getPlugin', 'enablePlugin', 'disablePlugin']; - for (const methodName of apiHubPluginStubMethods) { - const callPromise = this.apiHubPluginStub.then( - stub => (...args: Array<{}>) => { - if (this._terminated) { - return Promise.reject('The client has already been closed.'); - } - const func = stub[methodName]; - return func.apply(stub, args); - }, - (err: Error|null|undefined) => () => { - throw err; - }); - - const descriptor = - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor, - this._opts.fallback - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.apiHubPluginStub; - } - - /** - * The DNS address for this API service. - * @deprecated Use the apiEndpoint method of the client instance. - * @returns {string} The DNS address for this service. - */ - static get servicePath() { - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); - } - return 'apihub.googleapis.com'; - } - - /** - * The DNS address for this API service - same as servicePath. - * @deprecated Use the apiEndpoint method of the client instance. - * @returns {string} The DNS address for this service. - */ - static get apiEndpoint() { - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); - } - return 'apihub.googleapis.com'; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - get apiEndpoint() { - return this._servicePath; - } - - get universeDomain() { - return this._universeDomain; - } - - /** - * 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 -- - // ------------------- -/** - * Get details about an API Hub plugin. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the plugin to retrieve. - * Format: `projects/{project}/locations/{location}/plugins/{plugin}`. - * @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.apihub.v1.Plugin|Plugin}. - * 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/api_hub_plugin.get_plugin.js - * region_tag:apihub_v1_generated_ApiHubPlugin_GetPlugin_async - */ - getPlugin( - request?: protos.google.cloud.apihub.v1.IGetPluginRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apihub.v1.IPlugin, - protos.google.cloud.apihub.v1.IGetPluginRequest|undefined, {}|undefined - ]>; - getPlugin( - request: protos.google.cloud.apihub.v1.IGetPluginRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.apihub.v1.IPlugin, - protos.google.cloud.apihub.v1.IGetPluginRequest|null|undefined, - {}|null|undefined>): void; - getPlugin( - request: protos.google.cloud.apihub.v1.IGetPluginRequest, - callback: Callback< - protos.google.cloud.apihub.v1.IPlugin, - protos.google.cloud.apihub.v1.IGetPluginRequest|null|undefined, - {}|null|undefined>): void; - getPlugin( - request?: protos.google.cloud.apihub.v1.IGetPluginRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.apihub.v1.IPlugin, - protos.google.cloud.apihub.v1.IGetPluginRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.apihub.v1.IPlugin, - protos.google.cloud.apihub.v1.IGetPluginRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.apihub.v1.IPlugin, - protos.google.cloud.apihub.v1.IGetPluginRequest|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.getPlugin(request, options, callback); - } -/** - * Enables a plugin. - * The `state` of the plugin after enabling is `ENABLED` - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the plugin to enable. - * Format: `projects/{project}/locations/{location}/plugins/{plugin}`. - * @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.apihub.v1.Plugin|Plugin}. - * 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/api_hub_plugin.enable_plugin.js - * region_tag:apihub_v1_generated_ApiHubPlugin_EnablePlugin_async - */ - enablePlugin( - request?: protos.google.cloud.apihub.v1.IEnablePluginRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apihub.v1.IPlugin, - protos.google.cloud.apihub.v1.IEnablePluginRequest|undefined, {}|undefined - ]>; - enablePlugin( - request: protos.google.cloud.apihub.v1.IEnablePluginRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.apihub.v1.IPlugin, - protos.google.cloud.apihub.v1.IEnablePluginRequest|null|undefined, - {}|null|undefined>): void; - enablePlugin( - request: protos.google.cloud.apihub.v1.IEnablePluginRequest, - callback: Callback< - protos.google.cloud.apihub.v1.IPlugin, - protos.google.cloud.apihub.v1.IEnablePluginRequest|null|undefined, - {}|null|undefined>): void; - enablePlugin( - request?: protos.google.cloud.apihub.v1.IEnablePluginRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.apihub.v1.IPlugin, - protos.google.cloud.apihub.v1.IEnablePluginRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.apihub.v1.IPlugin, - protos.google.cloud.apihub.v1.IEnablePluginRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.apihub.v1.IPlugin, - protos.google.cloud.apihub.v1.IEnablePluginRequest|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.enablePlugin(request, options, callback); - } -/** - * Disables a plugin. - * The `state` of the plugin after disabling is `DISABLED` - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the plugin to disable. - * Format: `projects/{project}/locations/{location}/plugins/{plugin}`. - * @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.apihub.v1.Plugin|Plugin}. - * 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/api_hub_plugin.disable_plugin.js - * region_tag:apihub_v1_generated_ApiHubPlugin_DisablePlugin_async - */ - disablePlugin( - request?: protos.google.cloud.apihub.v1.IDisablePluginRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apihub.v1.IPlugin, - protos.google.cloud.apihub.v1.IDisablePluginRequest|undefined, {}|undefined - ]>; - disablePlugin( - request: protos.google.cloud.apihub.v1.IDisablePluginRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.apihub.v1.IPlugin, - protos.google.cloud.apihub.v1.IDisablePluginRequest|null|undefined, - {}|null|undefined>): void; - disablePlugin( - request: protos.google.cloud.apihub.v1.IDisablePluginRequest, - callback: Callback< - protos.google.cloud.apihub.v1.IPlugin, - protos.google.cloud.apihub.v1.IDisablePluginRequest|null|undefined, - {}|null|undefined>): void; - disablePlugin( - request?: protos.google.cloud.apihub.v1.IDisablePluginRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.apihub.v1.IPlugin, - protos.google.cloud.apihub.v1.IDisablePluginRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.apihub.v1.IPlugin, - protos.google.cloud.apihub.v1.IDisablePluginRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.apihub.v1.IPlugin, - protos.google.cloud.apihub.v1.IDisablePluginRequest|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.disablePlugin(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); - } - - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified api resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} api - * @returns {string} Resource name string. - */ - apiPath(project:string,location:string,api:string) { - return this.pathTemplates.apiPathTemplate.render({ - project: project, - location: location, - api: api, - }); - } - - /** - * Parse the project from Api resource. - * - * @param {string} apiName - * A fully-qualified path representing Api resource. - * @returns {string} A string representing the project. - */ - matchProjectFromApiName(apiName: string) { - return this.pathTemplates.apiPathTemplate.match(apiName).project; - } - - /** - * Parse the location from Api resource. - * - * @param {string} apiName - * A fully-qualified path representing Api resource. - * @returns {string} A string representing the location. - */ - matchLocationFromApiName(apiName: string) { - return this.pathTemplates.apiPathTemplate.match(apiName).location; - } - - /** - * Parse the api from Api resource. - * - * @param {string} apiName - * A fully-qualified path representing Api resource. - * @returns {string} A string representing the api. - */ - matchApiFromApiName(apiName: string) { - return this.pathTemplates.apiPathTemplate.match(apiName).api; - } - - /** - * Return a fully-qualified apiHubInstance resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} api_hub_instance - * @returns {string} Resource name string. - */ - apiHubInstancePath(project:string,location:string,apiHubInstance:string) { - return this.pathTemplates.apiHubInstancePathTemplate.render({ - project: project, - location: location, - api_hub_instance: apiHubInstance, - }); - } - - /** - * Parse the project from ApiHubInstance resource. - * - * @param {string} apiHubInstanceName - * A fully-qualified path representing ApiHubInstance resource. - * @returns {string} A string representing the project. - */ - matchProjectFromApiHubInstanceName(apiHubInstanceName: string) { - return this.pathTemplates.apiHubInstancePathTemplate.match(apiHubInstanceName).project; - } - - /** - * Parse the location from ApiHubInstance resource. - * - * @param {string} apiHubInstanceName - * A fully-qualified path representing ApiHubInstance resource. - * @returns {string} A string representing the location. - */ - matchLocationFromApiHubInstanceName(apiHubInstanceName: string) { - return this.pathTemplates.apiHubInstancePathTemplate.match(apiHubInstanceName).location; - } - - /** - * Parse the api_hub_instance from ApiHubInstance resource. - * - * @param {string} apiHubInstanceName - * A fully-qualified path representing ApiHubInstance resource. - * @returns {string} A string representing the api_hub_instance. - */ - matchApiHubInstanceFromApiHubInstanceName(apiHubInstanceName: string) { - return this.pathTemplates.apiHubInstancePathTemplate.match(apiHubInstanceName).api_hub_instance; - } - - /** - * Return a fully-qualified apiOperation resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} api - * @param {string} version - * @param {string} operation - * @returns {string} Resource name string. - */ - apiOperationPath(project:string,location:string,api:string,version:string,operation:string) { - return this.pathTemplates.apiOperationPathTemplate.render({ - project: project, - location: location, - api: api, - version: version, - operation: operation, - }); - } - - /** - * Parse the project from ApiOperation resource. - * - * @param {string} apiOperationName - * A fully-qualified path representing ApiOperation resource. - * @returns {string} A string representing the project. - */ - matchProjectFromApiOperationName(apiOperationName: string) { - return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).project; - } - - /** - * Parse the location from ApiOperation resource. - * - * @param {string} apiOperationName - * A fully-qualified path representing ApiOperation resource. - * @returns {string} A string representing the location. - */ - matchLocationFromApiOperationName(apiOperationName: string) { - return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).location; - } - - /** - * Parse the api from ApiOperation resource. - * - * @param {string} apiOperationName - * A fully-qualified path representing ApiOperation resource. - * @returns {string} A string representing the api. - */ - matchApiFromApiOperationName(apiOperationName: string) { - return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).api; - } - - /** - * Parse the version from ApiOperation resource. - * - * @param {string} apiOperationName - * A fully-qualified path representing ApiOperation resource. - * @returns {string} A string representing the version. - */ - matchVersionFromApiOperationName(apiOperationName: string) { - return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).version; - } - - /** - * Parse the operation from ApiOperation resource. - * - * @param {string} apiOperationName - * A fully-qualified path representing ApiOperation resource. - * @returns {string} A string representing the operation. - */ - matchOperationFromApiOperationName(apiOperationName: string) { - return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).operation; - } - - /** - * Return a fully-qualified attribute resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} attribute - * @returns {string} Resource name string. - */ - attributePath(project:string,location:string,attribute:string) { - return this.pathTemplates.attributePathTemplate.render({ - project: project, - location: location, - attribute: attribute, - }); - } - - /** - * Parse the project from Attribute resource. - * - * @param {string} attributeName - * A fully-qualified path representing Attribute resource. - * @returns {string} A string representing the project. - */ - matchProjectFromAttributeName(attributeName: string) { - return this.pathTemplates.attributePathTemplate.match(attributeName).project; - } - - /** - * Parse the location from Attribute resource. - * - * @param {string} attributeName - * A fully-qualified path representing Attribute resource. - * @returns {string} A string representing the location. - */ - matchLocationFromAttributeName(attributeName: string) { - return this.pathTemplates.attributePathTemplate.match(attributeName).location; - } - - /** - * Parse the attribute from Attribute resource. - * - * @param {string} attributeName - * A fully-qualified path representing Attribute resource. - * @returns {string} A string representing the attribute. - */ - matchAttributeFromAttributeName(attributeName: string) { - return this.pathTemplates.attributePathTemplate.match(attributeName).attribute; - } - - /** - * Return a fully-qualified definition resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} api - * @param {string} version - * @param {string} definition - * @returns {string} Resource name string. - */ - definitionPath(project:string,location:string,api:string,version:string,definition:string) { - return this.pathTemplates.definitionPathTemplate.render({ - project: project, - location: location, - api: api, - version: version, - definition: definition, - }); - } - - /** - * Parse the project from Definition resource. - * - * @param {string} definitionName - * A fully-qualified path representing Definition resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDefinitionName(definitionName: string) { - return this.pathTemplates.definitionPathTemplate.match(definitionName).project; - } - - /** - * Parse the location from Definition resource. - * - * @param {string} definitionName - * A fully-qualified path representing Definition resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDefinitionName(definitionName: string) { - return this.pathTemplates.definitionPathTemplate.match(definitionName).location; - } - - /** - * Parse the api from Definition resource. - * - * @param {string} definitionName - * A fully-qualified path representing Definition resource. - * @returns {string} A string representing the api. - */ - matchApiFromDefinitionName(definitionName: string) { - return this.pathTemplates.definitionPathTemplate.match(definitionName).api; - } - - /** - * Parse the version from Definition resource. - * - * @param {string} definitionName - * A fully-qualified path representing Definition resource. - * @returns {string} A string representing the version. - */ - matchVersionFromDefinitionName(definitionName: string) { - return this.pathTemplates.definitionPathTemplate.match(definitionName).version; - } - - /** - * Parse the definition from Definition resource. - * - * @param {string} definitionName - * A fully-qualified path representing Definition resource. - * @returns {string} A string representing the definition. - */ - matchDefinitionFromDefinitionName(definitionName: string) { - return this.pathTemplates.definitionPathTemplate.match(definitionName).definition; - } - - /** - * Return a fully-qualified dependency resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dependency - * @returns {string} Resource name string. - */ - dependencyPath(project:string,location:string,dependency:string) { - return this.pathTemplates.dependencyPathTemplate.render({ - project: project, - location: location, - dependency: dependency, - }); - } - - /** - * Parse the project from Dependency resource. - * - * @param {string} dependencyName - * A fully-qualified path representing Dependency resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDependencyName(dependencyName: string) { - return this.pathTemplates.dependencyPathTemplate.match(dependencyName).project; - } - - /** - * Parse the location from Dependency resource. - * - * @param {string} dependencyName - * A fully-qualified path representing Dependency resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDependencyName(dependencyName: string) { - return this.pathTemplates.dependencyPathTemplate.match(dependencyName).location; - } - - /** - * Parse the dependency from Dependency resource. - * - * @param {string} dependencyName - * A fully-qualified path representing Dependency resource. - * @returns {string} A string representing the dependency. - */ - matchDependencyFromDependencyName(dependencyName: string) { - return this.pathTemplates.dependencyPathTemplate.match(dependencyName).dependency; - } - - /** - * Return a fully-qualified deployment resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} deployment - * @returns {string} Resource name string. - */ - deploymentPath(project:string,location:string,deployment:string) { - return this.pathTemplates.deploymentPathTemplate.render({ - project: project, - location: location, - deployment: deployment, - }); - } - - /** - * Parse the project from Deployment resource. - * - * @param {string} deploymentName - * A fully-qualified path representing Deployment resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDeploymentName(deploymentName: string) { - return this.pathTemplates.deploymentPathTemplate.match(deploymentName).project; - } - - /** - * Parse the location from Deployment resource. - * - * @param {string} deploymentName - * A fully-qualified path representing Deployment resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDeploymentName(deploymentName: string) { - return this.pathTemplates.deploymentPathTemplate.match(deploymentName).location; - } - - /** - * Parse the deployment from Deployment resource. - * - * @param {string} deploymentName - * A fully-qualified path representing Deployment resource. - * @returns {string} A string representing the deployment. - */ - matchDeploymentFromDeploymentName(deploymentName: string) { - return this.pathTemplates.deploymentPathTemplate.match(deploymentName).deployment; - } - - /** - * Return a fully-qualified externalApi resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} external_api - * @returns {string} Resource name string. - */ - externalApiPath(project:string,location:string,externalApi:string) { - return this.pathTemplates.externalApiPathTemplate.render({ - project: project, - location: location, - external_api: externalApi, - }); - } - - /** - * Parse the project from ExternalApi resource. - * - * @param {string} externalApiName - * A fully-qualified path representing ExternalApi resource. - * @returns {string} A string representing the project. - */ - matchProjectFromExternalApiName(externalApiName: string) { - return this.pathTemplates.externalApiPathTemplate.match(externalApiName).project; - } - - /** - * Parse the location from ExternalApi resource. - * - * @param {string} externalApiName - * A fully-qualified path representing ExternalApi resource. - * @returns {string} A string representing the location. - */ - matchLocationFromExternalApiName(externalApiName: string) { - return this.pathTemplates.externalApiPathTemplate.match(externalApiName).location; - } - - /** - * Parse the external_api from ExternalApi resource. - * - * @param {string} externalApiName - * A fully-qualified path representing ExternalApi resource. - * @returns {string} A string representing the external_api. - */ - matchExternalApiFromExternalApiName(externalApiName: string) { - return this.pathTemplates.externalApiPathTemplate.match(externalApiName).external_api; - } - - /** - * Return a fully-qualified hostProjectRegistration resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} host_project_registration - * @returns {string} Resource name string. - */ - hostProjectRegistrationPath(project:string,location:string,hostProjectRegistration:string) { - return this.pathTemplates.hostProjectRegistrationPathTemplate.render({ - project: project, - location: location, - host_project_registration: hostProjectRegistration, - }); - } - - /** - * Parse the project from HostProjectRegistration resource. - * - * @param {string} hostProjectRegistrationName - * A fully-qualified path representing HostProjectRegistration resource. - * @returns {string} A string representing the project. - */ - matchProjectFromHostProjectRegistrationName(hostProjectRegistrationName: string) { - return this.pathTemplates.hostProjectRegistrationPathTemplate.match(hostProjectRegistrationName).project; - } - - /** - * Parse the location from HostProjectRegistration resource. - * - * @param {string} hostProjectRegistrationName - * A fully-qualified path representing HostProjectRegistration resource. - * @returns {string} A string representing the location. - */ - matchLocationFromHostProjectRegistrationName(hostProjectRegistrationName: string) { - return this.pathTemplates.hostProjectRegistrationPathTemplate.match(hostProjectRegistrationName).location; - } - - /** - * Parse the host_project_registration from HostProjectRegistration resource. - * - * @param {string} hostProjectRegistrationName - * A fully-qualified path representing HostProjectRegistration resource. - * @returns {string} A string representing the host_project_registration. - */ - matchHostProjectRegistrationFromHostProjectRegistrationName(hostProjectRegistrationName: string) { - return this.pathTemplates.hostProjectRegistrationPathTemplate.match(hostProjectRegistrationName).host_project_registration; - } - - /** - * Return a fully-qualified plugin resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} plugin - * @returns {string} Resource name string. - */ - pluginPath(project:string,location:string,plugin:string) { - return this.pathTemplates.pluginPathTemplate.render({ - project: project, - location: location, - plugin: plugin, - }); - } - - /** - * Parse the project from Plugin resource. - * - * @param {string} pluginName - * A fully-qualified path representing Plugin resource. - * @returns {string} A string representing the project. - */ - matchProjectFromPluginName(pluginName: string) { - return this.pathTemplates.pluginPathTemplate.match(pluginName).project; - } - - /** - * Parse the location from Plugin resource. - * - * @param {string} pluginName - * A fully-qualified path representing Plugin resource. - * @returns {string} A string representing the location. - */ - matchLocationFromPluginName(pluginName: string) { - return this.pathTemplates.pluginPathTemplate.match(pluginName).location; - } - - /** - * Parse the plugin from Plugin resource. - * - * @param {string} pluginName - * A fully-qualified path representing Plugin resource. - * @returns {string} A string representing the plugin. - */ - matchPluginFromPluginName(pluginName: string) { - return this.pathTemplates.pluginPathTemplate.match(pluginName).plugin; - } - - /** - * Return a fully-qualified runtimeProjectAttachment resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} runtime_project_attachment - * @returns {string} Resource name string. - */ - runtimeProjectAttachmentPath(project:string,location:string,runtimeProjectAttachment:string) { - return this.pathTemplates.runtimeProjectAttachmentPathTemplate.render({ - project: project, - location: location, - runtime_project_attachment: runtimeProjectAttachment, - }); - } - - /** - * Parse the project from RuntimeProjectAttachment resource. - * - * @param {string} runtimeProjectAttachmentName - * A fully-qualified path representing RuntimeProjectAttachment resource. - * @returns {string} A string representing the project. - */ - matchProjectFromRuntimeProjectAttachmentName(runtimeProjectAttachmentName: string) { - return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match(runtimeProjectAttachmentName).project; - } - - /** - * Parse the location from RuntimeProjectAttachment resource. - * - * @param {string} runtimeProjectAttachmentName - * A fully-qualified path representing RuntimeProjectAttachment resource. - * @returns {string} A string representing the location. - */ - matchLocationFromRuntimeProjectAttachmentName(runtimeProjectAttachmentName: string) { - return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match(runtimeProjectAttachmentName).location; - } - - /** - * Parse the runtime_project_attachment from RuntimeProjectAttachment resource. - * - * @param {string} runtimeProjectAttachmentName - * A fully-qualified path representing RuntimeProjectAttachment resource. - * @returns {string} A string representing the runtime_project_attachment. - */ - matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName(runtimeProjectAttachmentName: string) { - return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match(runtimeProjectAttachmentName).runtime_project_attachment; - } - - /** - * Return a fully-qualified spec resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} api - * @param {string} version - * @param {string} spec - * @returns {string} Resource name string. - */ - specPath(project:string,location:string,api:string,version:string,spec:string) { - return this.pathTemplates.specPathTemplate.render({ - project: project, - location: location, - api: api, - version: version, - spec: spec, - }); - } - - /** - * Parse the project from Spec resource. - * - * @param {string} specName - * A fully-qualified path representing Spec resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSpecName(specName: string) { - return this.pathTemplates.specPathTemplate.match(specName).project; - } - - /** - * Parse the location from Spec resource. - * - * @param {string} specName - * A fully-qualified path representing Spec resource. - * @returns {string} A string representing the location. - */ - matchLocationFromSpecName(specName: string) { - return this.pathTemplates.specPathTemplate.match(specName).location; - } - - /** - * Parse the api from Spec resource. - * - * @param {string} specName - * A fully-qualified path representing Spec resource. - * @returns {string} A string representing the api. - */ - matchApiFromSpecName(specName: string) { - return this.pathTemplates.specPathTemplate.match(specName).api; - } - - /** - * Parse the version from Spec resource. - * - * @param {string} specName - * A fully-qualified path representing Spec resource. - * @returns {string} A string representing the version. - */ - matchVersionFromSpecName(specName: string) { - return this.pathTemplates.specPathTemplate.match(specName).version; - } - - /** - * Parse the spec from Spec resource. - * - * @param {string} specName - * A fully-qualified path representing Spec resource. - * @returns {string} A string representing the spec. - */ - matchSpecFromSpecName(specName: string) { - return this.pathTemplates.specPathTemplate.match(specName).spec; - } - - /** - * Return a fully-qualified styleGuide resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} plugin - * @returns {string} Resource name string. - */ - styleGuidePath(project:string,location:string,plugin:string) { - return this.pathTemplates.styleGuidePathTemplate.render({ - project: project, - location: location, - plugin: plugin, - }); - } - - /** - * Parse the project from StyleGuide resource. - * - * @param {string} styleGuideName - * A fully-qualified path representing StyleGuide resource. - * @returns {string} A string representing the project. - */ - matchProjectFromStyleGuideName(styleGuideName: string) { - return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName).project; - } - - /** - * Parse the location from StyleGuide resource. - * - * @param {string} styleGuideName - * A fully-qualified path representing StyleGuide resource. - * @returns {string} A string representing the location. - */ - matchLocationFromStyleGuideName(styleGuideName: string) { - return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName).location; - } - - /** - * Parse the plugin from StyleGuide resource. - * - * @param {string} styleGuideName - * A fully-qualified path representing StyleGuide resource. - * @returns {string} A string representing the plugin. - */ - matchPluginFromStyleGuideName(styleGuideName: string) { - return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName).plugin; - } - - /** - * Return a fully-qualified version resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} api - * @param {string} version - * @returns {string} Resource name string. - */ - versionPath(project:string,location:string,api:string,version:string) { - return this.pathTemplates.versionPathTemplate.render({ - project: project, - location: location, - api: api, - version: version, - }); - } - - /** - * Parse the project from Version resource. - * - * @param {string} versionName - * A fully-qualified path representing Version resource. - * @returns {string} A string representing the project. - */ - matchProjectFromVersionName(versionName: string) { - return this.pathTemplates.versionPathTemplate.match(versionName).project; - } - - /** - * Parse the location from Version resource. - * - * @param {string} versionName - * A fully-qualified path representing Version resource. - * @returns {string} A string representing the location. - */ - matchLocationFromVersionName(versionName: string) { - return this.pathTemplates.versionPathTemplate.match(versionName).location; - } - - /** - * Parse the api from Version resource. - * - * @param {string} versionName - * A fully-qualified path representing Version resource. - * @returns {string} A string representing the api. - */ - matchApiFromVersionName(versionName: string) { - return this.pathTemplates.versionPathTemplate.match(versionName).api; - } - - /** - * Parse the version from Version resource. - * - * @param {string} versionName - * A fully-qualified path representing Version resource. - * @returns {string} A string representing the version. - */ - matchVersionFromVersionName(versionName: string) { - return this.pathTemplates.versionPathTemplate.match(versionName).version; - } - - /** - * 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.apiHubPluginStub && !this._terminated) { - return this.apiHubPluginStub.then(stub => { - this._terminated = true; - stub.close(); - this.locationsClient.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_plugin_client_config.json b/owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_plugin_client_config.json deleted file mode 100644 index 1627eceb991..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_plugin_client_config.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "interfaces": { - "google.cloud.apihub.v1.ApiHubPlugin": { - "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": { - "GetPlugin": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "EnablePlugin": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DisablePlugin": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_plugin_proto_list.json b/owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_plugin_proto_list.json deleted file mode 100644 index 07e987f7fb3..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_plugin_proto_list.json +++ /dev/null @@ -1,9 +0,0 @@ -[ - "../../protos/google/cloud/apihub/v1/apihub_service.proto", - "../../protos/google/cloud/apihub/v1/common_fields.proto", - "../../protos/google/cloud/apihub/v1/host_project_registration_service.proto", - "../../protos/google/cloud/apihub/v1/linting_service.proto", - "../../protos/google/cloud/apihub/v1/plugin_service.proto", - "../../protos/google/cloud/apihub/v1/provisioning_service.proto", - "../../protos/google/cloud/apihub/v1/runtime_project_attachment_service.proto" -] diff --git a/owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_proto_list.json b/owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_proto_list.json deleted file mode 100644 index 07e987f7fb3..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/src/v1/api_hub_proto_list.json +++ /dev/null @@ -1,9 +0,0 @@ -[ - "../../protos/google/cloud/apihub/v1/apihub_service.proto", - "../../protos/google/cloud/apihub/v1/common_fields.proto", - "../../protos/google/cloud/apihub/v1/host_project_registration_service.proto", - "../../protos/google/cloud/apihub/v1/linting_service.proto", - "../../protos/google/cloud/apihub/v1/plugin_service.proto", - "../../protos/google/cloud/apihub/v1/provisioning_service.proto", - "../../protos/google/cloud/apihub/v1/runtime_project_attachment_service.proto" -] diff --git a/owl-bot-staging/google-cloud-apihub/v1/src/v1/gapic_metadata.json b/owl-bot-staging/google-cloud-apihub/v1/src/v1/gapic_metadata.json deleted file mode 100644 index 54b63d3eaca..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/src/v1/gapic_metadata.json +++ /dev/null @@ -1,731 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "typescript", - "protoPackage": "google.cloud.apihub.v1", - "libraryPackage": "@google-cloud/apihub", - "services": { - "ApiHub": { - "clients": { - "grpc": { - "libraryClient": "ApiHubClient", - "rpcs": { - "CreateApi": { - "methods": [ - "createApi" - ] - }, - "GetApi": { - "methods": [ - "getApi" - ] - }, - "UpdateApi": { - "methods": [ - "updateApi" - ] - }, - "DeleteApi": { - "methods": [ - "deleteApi" - ] - }, - "CreateVersion": { - "methods": [ - "createVersion" - ] - }, - "GetVersion": { - "methods": [ - "getVersion" - ] - }, - "UpdateVersion": { - "methods": [ - "updateVersion" - ] - }, - "DeleteVersion": { - "methods": [ - "deleteVersion" - ] - }, - "CreateSpec": { - "methods": [ - "createSpec" - ] - }, - "GetSpec": { - "methods": [ - "getSpec" - ] - }, - "GetSpecContents": { - "methods": [ - "getSpecContents" - ] - }, - "UpdateSpec": { - "methods": [ - "updateSpec" - ] - }, - "DeleteSpec": { - "methods": [ - "deleteSpec" - ] - }, - "GetApiOperation": { - "methods": [ - "getApiOperation" - ] - }, - "GetDefinition": { - "methods": [ - "getDefinition" - ] - }, - "CreateDeployment": { - "methods": [ - "createDeployment" - ] - }, - "GetDeployment": { - "methods": [ - "getDeployment" - ] - }, - "UpdateDeployment": { - "methods": [ - "updateDeployment" - ] - }, - "DeleteDeployment": { - "methods": [ - "deleteDeployment" - ] - }, - "CreateAttribute": { - "methods": [ - "createAttribute" - ] - }, - "GetAttribute": { - "methods": [ - "getAttribute" - ] - }, - "UpdateAttribute": { - "methods": [ - "updateAttribute" - ] - }, - "DeleteAttribute": { - "methods": [ - "deleteAttribute" - ] - }, - "CreateExternalApi": { - "methods": [ - "createExternalApi" - ] - }, - "GetExternalApi": { - "methods": [ - "getExternalApi" - ] - }, - "UpdateExternalApi": { - "methods": [ - "updateExternalApi" - ] - }, - "DeleteExternalApi": { - "methods": [ - "deleteExternalApi" - ] - }, - "ListApis": { - "methods": [ - "listApis", - "listApisStream", - "listApisAsync" - ] - }, - "ListVersions": { - "methods": [ - "listVersions", - "listVersionsStream", - "listVersionsAsync" - ] - }, - "ListSpecs": { - "methods": [ - "listSpecs", - "listSpecsStream", - "listSpecsAsync" - ] - }, - "ListApiOperations": { - "methods": [ - "listApiOperations", - "listApiOperationsStream", - "listApiOperationsAsync" - ] - }, - "ListDeployments": { - "methods": [ - "listDeployments", - "listDeploymentsStream", - "listDeploymentsAsync" - ] - }, - "ListAttributes": { - "methods": [ - "listAttributes", - "listAttributesStream", - "listAttributesAsync" - ] - }, - "SearchResources": { - "methods": [ - "searchResources", - "searchResourcesStream", - "searchResourcesAsync" - ] - }, - "ListExternalApis": { - "methods": [ - "listExternalApis", - "listExternalApisStream", - "listExternalApisAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "ApiHubClient", - "rpcs": { - "CreateApi": { - "methods": [ - "createApi" - ] - }, - "GetApi": { - "methods": [ - "getApi" - ] - }, - "UpdateApi": { - "methods": [ - "updateApi" - ] - }, - "DeleteApi": { - "methods": [ - "deleteApi" - ] - }, - "CreateVersion": { - "methods": [ - "createVersion" - ] - }, - "GetVersion": { - "methods": [ - "getVersion" - ] - }, - "UpdateVersion": { - "methods": [ - "updateVersion" - ] - }, - "DeleteVersion": { - "methods": [ - "deleteVersion" - ] - }, - "CreateSpec": { - "methods": [ - "createSpec" - ] - }, - "GetSpec": { - "methods": [ - "getSpec" - ] - }, - "GetSpecContents": { - "methods": [ - "getSpecContents" - ] - }, - "UpdateSpec": { - "methods": [ - "updateSpec" - ] - }, - "DeleteSpec": { - "methods": [ - "deleteSpec" - ] - }, - "GetApiOperation": { - "methods": [ - "getApiOperation" - ] - }, - "GetDefinition": { - "methods": [ - "getDefinition" - ] - }, - "CreateDeployment": { - "methods": [ - "createDeployment" - ] - }, - "GetDeployment": { - "methods": [ - "getDeployment" - ] - }, - "UpdateDeployment": { - "methods": [ - "updateDeployment" - ] - }, - "DeleteDeployment": { - "methods": [ - "deleteDeployment" - ] - }, - "CreateAttribute": { - "methods": [ - "createAttribute" - ] - }, - "GetAttribute": { - "methods": [ - "getAttribute" - ] - }, - "UpdateAttribute": { - "methods": [ - "updateAttribute" - ] - }, - "DeleteAttribute": { - "methods": [ - "deleteAttribute" - ] - }, - "CreateExternalApi": { - "methods": [ - "createExternalApi" - ] - }, - "GetExternalApi": { - "methods": [ - "getExternalApi" - ] - }, - "UpdateExternalApi": { - "methods": [ - "updateExternalApi" - ] - }, - "DeleteExternalApi": { - "methods": [ - "deleteExternalApi" - ] - }, - "ListApis": { - "methods": [ - "listApis", - "listApisStream", - "listApisAsync" - ] - }, - "ListVersions": { - "methods": [ - "listVersions", - "listVersionsStream", - "listVersionsAsync" - ] - }, - "ListSpecs": { - "methods": [ - "listSpecs", - "listSpecsStream", - "listSpecsAsync" - ] - }, - "ListApiOperations": { - "methods": [ - "listApiOperations", - "listApiOperationsStream", - "listApiOperationsAsync" - ] - }, - "ListDeployments": { - "methods": [ - "listDeployments", - "listDeploymentsStream", - "listDeploymentsAsync" - ] - }, - "ListAttributes": { - "methods": [ - "listAttributes", - "listAttributesStream", - "listAttributesAsync" - ] - }, - "SearchResources": { - "methods": [ - "searchResources", - "searchResourcesStream", - "searchResourcesAsync" - ] - }, - "ListExternalApis": { - "methods": [ - "listExternalApis", - "listExternalApisStream", - "listExternalApisAsync" - ] - } - } - } - } - }, - "ApiHubDependencies": { - "clients": { - "grpc": { - "libraryClient": "ApiHubDependenciesClient", - "rpcs": { - "CreateDependency": { - "methods": [ - "createDependency" - ] - }, - "GetDependency": { - "methods": [ - "getDependency" - ] - }, - "UpdateDependency": { - "methods": [ - "updateDependency" - ] - }, - "DeleteDependency": { - "methods": [ - "deleteDependency" - ] - }, - "ListDependencies": { - "methods": [ - "listDependencies", - "listDependenciesStream", - "listDependenciesAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "ApiHubDependenciesClient", - "rpcs": { - "CreateDependency": { - "methods": [ - "createDependency" - ] - }, - "GetDependency": { - "methods": [ - "getDependency" - ] - }, - "UpdateDependency": { - "methods": [ - "updateDependency" - ] - }, - "DeleteDependency": { - "methods": [ - "deleteDependency" - ] - }, - "ListDependencies": { - "methods": [ - "listDependencies", - "listDependenciesStream", - "listDependenciesAsync" - ] - } - } - } - } - }, - "ApiHubPlugin": { - "clients": { - "grpc": { - "libraryClient": "ApiHubPluginClient", - "rpcs": { - "GetPlugin": { - "methods": [ - "getPlugin" - ] - }, - "EnablePlugin": { - "methods": [ - "enablePlugin" - ] - }, - "DisablePlugin": { - "methods": [ - "disablePlugin" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "ApiHubPluginClient", - "rpcs": { - "GetPlugin": { - "methods": [ - "getPlugin" - ] - }, - "EnablePlugin": { - "methods": [ - "enablePlugin" - ] - }, - "DisablePlugin": { - "methods": [ - "disablePlugin" - ] - } - } - } - } - }, - "HostProjectRegistrationService": { - "clients": { - "grpc": { - "libraryClient": "HostProjectRegistrationServiceClient", - "rpcs": { - "CreateHostProjectRegistration": { - "methods": [ - "createHostProjectRegistration" - ] - }, - "GetHostProjectRegistration": { - "methods": [ - "getHostProjectRegistration" - ] - }, - "ListHostProjectRegistrations": { - "methods": [ - "listHostProjectRegistrations", - "listHostProjectRegistrationsStream", - "listHostProjectRegistrationsAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "HostProjectRegistrationServiceClient", - "rpcs": { - "CreateHostProjectRegistration": { - "methods": [ - "createHostProjectRegistration" - ] - }, - "GetHostProjectRegistration": { - "methods": [ - "getHostProjectRegistration" - ] - }, - "ListHostProjectRegistrations": { - "methods": [ - "listHostProjectRegistrations", - "listHostProjectRegistrationsStream", - "listHostProjectRegistrationsAsync" - ] - } - } - } - } - }, - "LintingService": { - "clients": { - "grpc": { - "libraryClient": "LintingServiceClient", - "rpcs": { - "GetStyleGuide": { - "methods": [ - "getStyleGuide" - ] - }, - "UpdateStyleGuide": { - "methods": [ - "updateStyleGuide" - ] - }, - "GetStyleGuideContents": { - "methods": [ - "getStyleGuideContents" - ] - }, - "LintSpec": { - "methods": [ - "lintSpec" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "LintingServiceClient", - "rpcs": { - "GetStyleGuide": { - "methods": [ - "getStyleGuide" - ] - }, - "UpdateStyleGuide": { - "methods": [ - "updateStyleGuide" - ] - }, - "GetStyleGuideContents": { - "methods": [ - "getStyleGuideContents" - ] - }, - "LintSpec": { - "methods": [ - "lintSpec" - ] - } - } - } - } - }, - "Provisioning": { - "clients": { - "grpc": { - "libraryClient": "ProvisioningClient", - "rpcs": { - "GetApiHubInstance": { - "methods": [ - "getApiHubInstance" - ] - }, - "LookupApiHubInstance": { - "methods": [ - "lookupApiHubInstance" - ] - }, - "CreateApiHubInstance": { - "methods": [ - "createApiHubInstance" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "ProvisioningClient", - "rpcs": { - "GetApiHubInstance": { - "methods": [ - "getApiHubInstance" - ] - }, - "LookupApiHubInstance": { - "methods": [ - "lookupApiHubInstance" - ] - }, - "CreateApiHubInstance": { - "methods": [ - "createApiHubInstance" - ] - } - } - } - } - }, - "RuntimeProjectAttachmentService": { - "clients": { - "grpc": { - "libraryClient": "RuntimeProjectAttachmentServiceClient", - "rpcs": { - "CreateRuntimeProjectAttachment": { - "methods": [ - "createRuntimeProjectAttachment" - ] - }, - "GetRuntimeProjectAttachment": { - "methods": [ - "getRuntimeProjectAttachment" - ] - }, - "DeleteRuntimeProjectAttachment": { - "methods": [ - "deleteRuntimeProjectAttachment" - ] - }, - "LookupRuntimeProjectAttachment": { - "methods": [ - "lookupRuntimeProjectAttachment" - ] - }, - "ListRuntimeProjectAttachments": { - "methods": [ - "listRuntimeProjectAttachments", - "listRuntimeProjectAttachmentsStream", - "listRuntimeProjectAttachmentsAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "RuntimeProjectAttachmentServiceClient", - "rpcs": { - "CreateRuntimeProjectAttachment": { - "methods": [ - "createRuntimeProjectAttachment" - ] - }, - "GetRuntimeProjectAttachment": { - "methods": [ - "getRuntimeProjectAttachment" - ] - }, - "DeleteRuntimeProjectAttachment": { - "methods": [ - "deleteRuntimeProjectAttachment" - ] - }, - "LookupRuntimeProjectAttachment": { - "methods": [ - "lookupRuntimeProjectAttachment" - ] - }, - "ListRuntimeProjectAttachments": { - "methods": [ - "listRuntimeProjectAttachments", - "listRuntimeProjectAttachmentsStream", - "listRuntimeProjectAttachmentsAsync" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-apihub/v1/src/v1/host_project_registration_service_client.ts b/owl-bot-staging/google-cloud-apihub/v1/src/v1/host_project_registration_service_client.ts deleted file mode 100644 index e4781db5f63..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/src/v1/host_project_registration_service_client.ts +++ /dev/null @@ -1,1738 +0,0 @@ -// Copyright 2024 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, PaginationCallback, GaxCall, 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/host_project_registration_service_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './host_project_registration_service_client_config.json'; -const version = require('../../../package.json').version; - -/** - * This service is used for managing the host project registrations. - * @class - * @memberof v1 - */ -export class HostProjectRegistrationServiceClient { - 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}; - private _universeDomain: string; - private _servicePath: string; - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - locationsClient: LocationsClient; - pathTemplates: {[name: string]: gax.PathTemplate}; - hostProjectRegistrationServiceStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of HostProjectRegistrationServiceClient. - * - * @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 HostProjectRegistrationServiceClient({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 HostProjectRegistrationServiceClient; - if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { - throw new Error('Please set either universe_domain or universeDomain, but not both.'); - } - const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; - this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; - this._servicePath = 'apihub.' + this._universeDomain; - const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; - this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); - const port = opts?.port || staticMembers.port; - const clientConfig = opts?.clientConfig ?? {}; - // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). - if (!opts) { - opts = {fallback: true}; - } else { - opts.fallback = opts.fallback ?? true; - } - 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 !== this._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 = this._servicePath; - - // Set the default scopes in auth client if needed. - if (servicePath === this._servicePath) { - this.auth.defaultScopes = staticMembers.scopes; - } - 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 === 'object' && '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 = { - apiPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apis/{api}' - ), - apiHubInstancePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apiHubInstances/{api_hub_instance}' - ), - apiOperationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}' - ), - attributePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/attributes/{attribute}' - ), - definitionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}' - ), - dependencyPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/dependencies/{dependency}' - ), - deploymentPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/deployments/{deployment}' - ), - externalApiPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/externalApis/{external_api}' - ), - hostProjectRegistrationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/hostProjectRegistrations/{host_project_registration}' - ), - locationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}' - ), - pluginPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/plugins/{plugin}' - ), - projectPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}' - ), - runtimeProjectAttachmentPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}' - ), - specPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}' - ), - styleGuidePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/plugins/{plugin}/styleGuide' - ), - versionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apis/{api}/versions/{version}' - ), - }; - - // 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 = { - listHostProjectRegistrations: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'hostProjectRegistrations') - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.apihub.v1.HostProjectRegistrationService', 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.hostProjectRegistrationServiceStub) { - return this.hostProjectRegistrationServiceStub; - } - - // Put together the "service stub" for - // google.cloud.apihub.v1.HostProjectRegistrationService. - this.hostProjectRegistrationServiceStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.apihub.v1.HostProjectRegistrationService') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.apihub.v1.HostProjectRegistrationService, - 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 hostProjectRegistrationServiceStubMethods = - ['createHostProjectRegistration', 'getHostProjectRegistration', 'listHostProjectRegistrations']; - for (const methodName of hostProjectRegistrationServiceStubMethods) { - const callPromise = this.hostProjectRegistrationServiceStub.then( - stub => (...args: Array<{}>) => { - if (this._terminated) { - return Promise.reject('The client has already been closed.'); - } - const func = stub[methodName]; - return func.apply(stub, args); - }, - (err: Error|null|undefined) => () => { - throw err; - }); - - const descriptor = - this.descriptors.page[methodName] || - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor, - this._opts.fallback - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.hostProjectRegistrationServiceStub; - } - - /** - * The DNS address for this API service. - * @deprecated Use the apiEndpoint method of the client instance. - * @returns {string} The DNS address for this service. - */ - static get servicePath() { - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); - } - return 'apihub.googleapis.com'; - } - - /** - * The DNS address for this API service - same as servicePath. - * @deprecated Use the apiEndpoint method of the client instance. - * @returns {string} The DNS address for this service. - */ - static get apiEndpoint() { - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); - } - return 'apihub.googleapis.com'; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - get apiEndpoint() { - return this._servicePath; - } - - get universeDomain() { - return this._universeDomain; - } - - /** - * 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 -- - // ------------------- -/** - * Create a host project registration. - * A Google cloud project can be registered as a host project if it is not - * attached as a runtime project to another host project. - * A project can be registered as a host project only once. Subsequent - * register calls for the same project will fail. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource for the host project. - * Format: `projects/{project}/locations/{location}` - * @param {string} request.hostProjectRegistrationId - * Required. The ID to use for the Host Project Registration, which will - * become the final component of the host project registration's resource - * name. The ID must be the same as the Google cloud project specified in the - * host_project_registration.gcp_project field. - * @param {google.cloud.apihub.v1.HostProjectRegistration} request.hostProjectRegistration - * Required. The host project registration to register. - * @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.apihub.v1.HostProjectRegistration|HostProjectRegistration}. - * 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/host_project_registration_service.create_host_project_registration.js - * region_tag:apihub_v1_generated_HostProjectRegistrationService_CreateHostProjectRegistration_async - */ - createHostProjectRegistration( - request?: protos.google.cloud.apihub.v1.ICreateHostProjectRegistrationRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apihub.v1.IHostProjectRegistration, - protos.google.cloud.apihub.v1.ICreateHostProjectRegistrationRequest|undefined, {}|undefined - ]>; - createHostProjectRegistration( - request: protos.google.cloud.apihub.v1.ICreateHostProjectRegistrationRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.apihub.v1.IHostProjectRegistration, - protos.google.cloud.apihub.v1.ICreateHostProjectRegistrationRequest|null|undefined, - {}|null|undefined>): void; - createHostProjectRegistration( - request: protos.google.cloud.apihub.v1.ICreateHostProjectRegistrationRequest, - callback: Callback< - protos.google.cloud.apihub.v1.IHostProjectRegistration, - protos.google.cloud.apihub.v1.ICreateHostProjectRegistrationRequest|null|undefined, - {}|null|undefined>): void; - createHostProjectRegistration( - request?: protos.google.cloud.apihub.v1.ICreateHostProjectRegistrationRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.apihub.v1.IHostProjectRegistration, - protos.google.cloud.apihub.v1.ICreateHostProjectRegistrationRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.apihub.v1.IHostProjectRegistration, - protos.google.cloud.apihub.v1.ICreateHostProjectRegistrationRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.apihub.v1.IHostProjectRegistration, - protos.google.cloud.apihub.v1.ICreateHostProjectRegistrationRequest|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.createHostProjectRegistration(request, options, callback); - } -/** - * Get a host project registration. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Host project registration resource name. - * projects/{project}/locations/{location}/hostProjectRegistrations/{host_project_registration_id} - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.apihub.v1.HostProjectRegistration|HostProjectRegistration}. - * 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/host_project_registration_service.get_host_project_registration.js - * region_tag:apihub_v1_generated_HostProjectRegistrationService_GetHostProjectRegistration_async - */ - getHostProjectRegistration( - request?: protos.google.cloud.apihub.v1.IGetHostProjectRegistrationRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apihub.v1.IHostProjectRegistration, - protos.google.cloud.apihub.v1.IGetHostProjectRegistrationRequest|undefined, {}|undefined - ]>; - getHostProjectRegistration( - request: protos.google.cloud.apihub.v1.IGetHostProjectRegistrationRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.apihub.v1.IHostProjectRegistration, - protos.google.cloud.apihub.v1.IGetHostProjectRegistrationRequest|null|undefined, - {}|null|undefined>): void; - getHostProjectRegistration( - request: protos.google.cloud.apihub.v1.IGetHostProjectRegistrationRequest, - callback: Callback< - protos.google.cloud.apihub.v1.IHostProjectRegistration, - protos.google.cloud.apihub.v1.IGetHostProjectRegistrationRequest|null|undefined, - {}|null|undefined>): void; - getHostProjectRegistration( - request?: protos.google.cloud.apihub.v1.IGetHostProjectRegistrationRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.apihub.v1.IHostProjectRegistration, - protos.google.cloud.apihub.v1.IGetHostProjectRegistrationRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.apihub.v1.IHostProjectRegistration, - protos.google.cloud.apihub.v1.IGetHostProjectRegistrationRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.apihub.v1.IHostProjectRegistration, - protos.google.cloud.apihub.v1.IGetHostProjectRegistrationRequest|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.getHostProjectRegistration(request, options, callback); - } - - /** - * Lists host project registrations. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent, which owns this collection of host projects. - * Format: `projects/* /locations/*` - * @param {number} [request.pageSize] - * Optional. The maximum number of host project registrations to return. The - * service may return fewer than this value. If unspecified, at most 50 host - * project registrations will be returned. The maximum value is 1000; values - * above 1000 will be coerced to 1000. - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous - * `ListHostProjectRegistrations` call. Provide this to retrieve the - * subsequent page. - * - * When paginating, all other parameters (except page_size) provided to - * `ListHostProjectRegistrations` must match the call that provided the page - * token. - * @param {string} [request.filter] - * Optional. An expression that filters the list of HostProjectRegistrations. - * - * A filter expression consists of a field name, a comparison - * operator, and a value for filtering. The value must be a string. All - * standard operators as documented at https://google.aip.dev/160 are - * supported. - * - * The following fields in the `HostProjectRegistration` are eligible for - * filtering: - * - * * `name` - The name of the HostProjectRegistration. - * * `create_time` - The time at which the HostProjectRegistration was - * created. The value should be in the - * (RFC3339)[https://tools.ietf.org/html/rfc3339] format. - * * `gcp_project` - The Google cloud project associated with the - * HostProjectRegistration. - * @param {string} [request.orderBy] - * Optional. Hint for how to order the results. - * @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.apihub.v1.HostProjectRegistration|HostProjectRegistration}. - * 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 `listHostProjectRegistrationsAsync()` - * 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. - */ - listHostProjectRegistrations( - request?: protos.google.cloud.apihub.v1.IListHostProjectRegistrationsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apihub.v1.IHostProjectRegistration[], - protos.google.cloud.apihub.v1.IListHostProjectRegistrationsRequest|null, - protos.google.cloud.apihub.v1.IListHostProjectRegistrationsResponse - ]>; - listHostProjectRegistrations( - request: protos.google.cloud.apihub.v1.IListHostProjectRegistrationsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.apihub.v1.IListHostProjectRegistrationsRequest, - protos.google.cloud.apihub.v1.IListHostProjectRegistrationsResponse|null|undefined, - protos.google.cloud.apihub.v1.IHostProjectRegistration>): void; - listHostProjectRegistrations( - request: protos.google.cloud.apihub.v1.IListHostProjectRegistrationsRequest, - callback: PaginationCallback< - protos.google.cloud.apihub.v1.IListHostProjectRegistrationsRequest, - protos.google.cloud.apihub.v1.IListHostProjectRegistrationsResponse|null|undefined, - protos.google.cloud.apihub.v1.IHostProjectRegistration>): void; - listHostProjectRegistrations( - request?: protos.google.cloud.apihub.v1.IListHostProjectRegistrationsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.apihub.v1.IListHostProjectRegistrationsRequest, - protos.google.cloud.apihub.v1.IListHostProjectRegistrationsResponse|null|undefined, - protos.google.cloud.apihub.v1.IHostProjectRegistration>, - callback?: PaginationCallback< - protos.google.cloud.apihub.v1.IListHostProjectRegistrationsRequest, - protos.google.cloud.apihub.v1.IListHostProjectRegistrationsResponse|null|undefined, - protos.google.cloud.apihub.v1.IHostProjectRegistration>): - Promise<[ - protos.google.cloud.apihub.v1.IHostProjectRegistration[], - protos.google.cloud.apihub.v1.IListHostProjectRegistrationsRequest|null, - protos.google.cloud.apihub.v1.IListHostProjectRegistrationsResponse - ]>|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.listHostProjectRegistrations(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent, which owns this collection of host projects. - * Format: `projects/* /locations/*` - * @param {number} [request.pageSize] - * Optional. The maximum number of host project registrations to return. The - * service may return fewer than this value. If unspecified, at most 50 host - * project registrations will be returned. The maximum value is 1000; values - * above 1000 will be coerced to 1000. - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous - * `ListHostProjectRegistrations` call. Provide this to retrieve the - * subsequent page. - * - * When paginating, all other parameters (except page_size) provided to - * `ListHostProjectRegistrations` must match the call that provided the page - * token. - * @param {string} [request.filter] - * Optional. An expression that filters the list of HostProjectRegistrations. - * - * A filter expression consists of a field name, a comparison - * operator, and a value for filtering. The value must be a string. All - * standard operators as documented at https://google.aip.dev/160 are - * supported. - * - * The following fields in the `HostProjectRegistration` are eligible for - * filtering: - * - * * `name` - The name of the HostProjectRegistration. - * * `create_time` - The time at which the HostProjectRegistration was - * created. The value should be in the - * (RFC3339)[https://tools.ietf.org/html/rfc3339] format. - * * `gcp_project` - The Google cloud project associated with the - * HostProjectRegistration. - * @param {string} [request.orderBy] - * Optional. Hint for how to order the results. - * @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.apihub.v1.HostProjectRegistration|HostProjectRegistration} 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 `listHostProjectRegistrationsAsync()` - * 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. - */ - listHostProjectRegistrationsStream( - request?: protos.google.cloud.apihub.v1.IListHostProjectRegistrationsRequest, - 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['listHostProjectRegistrations']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listHostProjectRegistrations.createStream( - this.innerApiCalls.listHostProjectRegistrations as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listHostProjectRegistrations`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent, which owns this collection of host projects. - * Format: `projects/* /locations/*` - * @param {number} [request.pageSize] - * Optional. The maximum number of host project registrations to return. The - * service may return fewer than this value. If unspecified, at most 50 host - * project registrations will be returned. The maximum value is 1000; values - * above 1000 will be coerced to 1000. - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous - * `ListHostProjectRegistrations` call. Provide this to retrieve the - * subsequent page. - * - * When paginating, all other parameters (except page_size) provided to - * `ListHostProjectRegistrations` must match the call that provided the page - * token. - * @param {string} [request.filter] - * Optional. An expression that filters the list of HostProjectRegistrations. - * - * A filter expression consists of a field name, a comparison - * operator, and a value for filtering. The value must be a string. All - * standard operators as documented at https://google.aip.dev/160 are - * supported. - * - * The following fields in the `HostProjectRegistration` are eligible for - * filtering: - * - * * `name` - The name of the HostProjectRegistration. - * * `create_time` - The time at which the HostProjectRegistration was - * created. The value should be in the - * (RFC3339)[https://tools.ietf.org/html/rfc3339] format. - * * `gcp_project` - The Google cloud project associated with the - * HostProjectRegistration. - * @param {string} [request.orderBy] - * Optional. Hint for how to order the results. - * @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.apihub.v1.HostProjectRegistration|HostProjectRegistration}. 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/host_project_registration_service.list_host_project_registrations.js - * region_tag:apihub_v1_generated_HostProjectRegistrationService_ListHostProjectRegistrations_async - */ - listHostProjectRegistrationsAsync( - request?: protos.google.cloud.apihub.v1.IListHostProjectRegistrationsRequest, - 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['listHostProjectRegistrations']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listHostProjectRegistrations.asyncIterate( - this.innerApiCalls['listHostProjectRegistrations'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } -/** - * 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); - } - - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified api resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} api - * @returns {string} Resource name string. - */ - apiPath(project:string,location:string,api:string) { - return this.pathTemplates.apiPathTemplate.render({ - project: project, - location: location, - api: api, - }); - } - - /** - * Parse the project from Api resource. - * - * @param {string} apiName - * A fully-qualified path representing Api resource. - * @returns {string} A string representing the project. - */ - matchProjectFromApiName(apiName: string) { - return this.pathTemplates.apiPathTemplate.match(apiName).project; - } - - /** - * Parse the location from Api resource. - * - * @param {string} apiName - * A fully-qualified path representing Api resource. - * @returns {string} A string representing the location. - */ - matchLocationFromApiName(apiName: string) { - return this.pathTemplates.apiPathTemplate.match(apiName).location; - } - - /** - * Parse the api from Api resource. - * - * @param {string} apiName - * A fully-qualified path representing Api resource. - * @returns {string} A string representing the api. - */ - matchApiFromApiName(apiName: string) { - return this.pathTemplates.apiPathTemplate.match(apiName).api; - } - - /** - * Return a fully-qualified apiHubInstance resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} api_hub_instance - * @returns {string} Resource name string. - */ - apiHubInstancePath(project:string,location:string,apiHubInstance:string) { - return this.pathTemplates.apiHubInstancePathTemplate.render({ - project: project, - location: location, - api_hub_instance: apiHubInstance, - }); - } - - /** - * Parse the project from ApiHubInstance resource. - * - * @param {string} apiHubInstanceName - * A fully-qualified path representing ApiHubInstance resource. - * @returns {string} A string representing the project. - */ - matchProjectFromApiHubInstanceName(apiHubInstanceName: string) { - return this.pathTemplates.apiHubInstancePathTemplate.match(apiHubInstanceName).project; - } - - /** - * Parse the location from ApiHubInstance resource. - * - * @param {string} apiHubInstanceName - * A fully-qualified path representing ApiHubInstance resource. - * @returns {string} A string representing the location. - */ - matchLocationFromApiHubInstanceName(apiHubInstanceName: string) { - return this.pathTemplates.apiHubInstancePathTemplate.match(apiHubInstanceName).location; - } - - /** - * Parse the api_hub_instance from ApiHubInstance resource. - * - * @param {string} apiHubInstanceName - * A fully-qualified path representing ApiHubInstance resource. - * @returns {string} A string representing the api_hub_instance. - */ - matchApiHubInstanceFromApiHubInstanceName(apiHubInstanceName: string) { - return this.pathTemplates.apiHubInstancePathTemplate.match(apiHubInstanceName).api_hub_instance; - } - - /** - * Return a fully-qualified apiOperation resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} api - * @param {string} version - * @param {string} operation - * @returns {string} Resource name string. - */ - apiOperationPath(project:string,location:string,api:string,version:string,operation:string) { - return this.pathTemplates.apiOperationPathTemplate.render({ - project: project, - location: location, - api: api, - version: version, - operation: operation, - }); - } - - /** - * Parse the project from ApiOperation resource. - * - * @param {string} apiOperationName - * A fully-qualified path representing ApiOperation resource. - * @returns {string} A string representing the project. - */ - matchProjectFromApiOperationName(apiOperationName: string) { - return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).project; - } - - /** - * Parse the location from ApiOperation resource. - * - * @param {string} apiOperationName - * A fully-qualified path representing ApiOperation resource. - * @returns {string} A string representing the location. - */ - matchLocationFromApiOperationName(apiOperationName: string) { - return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).location; - } - - /** - * Parse the api from ApiOperation resource. - * - * @param {string} apiOperationName - * A fully-qualified path representing ApiOperation resource. - * @returns {string} A string representing the api. - */ - matchApiFromApiOperationName(apiOperationName: string) { - return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).api; - } - - /** - * Parse the version from ApiOperation resource. - * - * @param {string} apiOperationName - * A fully-qualified path representing ApiOperation resource. - * @returns {string} A string representing the version. - */ - matchVersionFromApiOperationName(apiOperationName: string) { - return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).version; - } - - /** - * Parse the operation from ApiOperation resource. - * - * @param {string} apiOperationName - * A fully-qualified path representing ApiOperation resource. - * @returns {string} A string representing the operation. - */ - matchOperationFromApiOperationName(apiOperationName: string) { - return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).operation; - } - - /** - * Return a fully-qualified attribute resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} attribute - * @returns {string} Resource name string. - */ - attributePath(project:string,location:string,attribute:string) { - return this.pathTemplates.attributePathTemplate.render({ - project: project, - location: location, - attribute: attribute, - }); - } - - /** - * Parse the project from Attribute resource. - * - * @param {string} attributeName - * A fully-qualified path representing Attribute resource. - * @returns {string} A string representing the project. - */ - matchProjectFromAttributeName(attributeName: string) { - return this.pathTemplates.attributePathTemplate.match(attributeName).project; - } - - /** - * Parse the location from Attribute resource. - * - * @param {string} attributeName - * A fully-qualified path representing Attribute resource. - * @returns {string} A string representing the location. - */ - matchLocationFromAttributeName(attributeName: string) { - return this.pathTemplates.attributePathTemplate.match(attributeName).location; - } - - /** - * Parse the attribute from Attribute resource. - * - * @param {string} attributeName - * A fully-qualified path representing Attribute resource. - * @returns {string} A string representing the attribute. - */ - matchAttributeFromAttributeName(attributeName: string) { - return this.pathTemplates.attributePathTemplate.match(attributeName).attribute; - } - - /** - * Return a fully-qualified definition resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} api - * @param {string} version - * @param {string} definition - * @returns {string} Resource name string. - */ - definitionPath(project:string,location:string,api:string,version:string,definition:string) { - return this.pathTemplates.definitionPathTemplate.render({ - project: project, - location: location, - api: api, - version: version, - definition: definition, - }); - } - - /** - * Parse the project from Definition resource. - * - * @param {string} definitionName - * A fully-qualified path representing Definition resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDefinitionName(definitionName: string) { - return this.pathTemplates.definitionPathTemplate.match(definitionName).project; - } - - /** - * Parse the location from Definition resource. - * - * @param {string} definitionName - * A fully-qualified path representing Definition resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDefinitionName(definitionName: string) { - return this.pathTemplates.definitionPathTemplate.match(definitionName).location; - } - - /** - * Parse the api from Definition resource. - * - * @param {string} definitionName - * A fully-qualified path representing Definition resource. - * @returns {string} A string representing the api. - */ - matchApiFromDefinitionName(definitionName: string) { - return this.pathTemplates.definitionPathTemplate.match(definitionName).api; - } - - /** - * Parse the version from Definition resource. - * - * @param {string} definitionName - * A fully-qualified path representing Definition resource. - * @returns {string} A string representing the version. - */ - matchVersionFromDefinitionName(definitionName: string) { - return this.pathTemplates.definitionPathTemplate.match(definitionName).version; - } - - /** - * Parse the definition from Definition resource. - * - * @param {string} definitionName - * A fully-qualified path representing Definition resource. - * @returns {string} A string representing the definition. - */ - matchDefinitionFromDefinitionName(definitionName: string) { - return this.pathTemplates.definitionPathTemplate.match(definitionName).definition; - } - - /** - * Return a fully-qualified dependency resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dependency - * @returns {string} Resource name string. - */ - dependencyPath(project:string,location:string,dependency:string) { - return this.pathTemplates.dependencyPathTemplate.render({ - project: project, - location: location, - dependency: dependency, - }); - } - - /** - * Parse the project from Dependency resource. - * - * @param {string} dependencyName - * A fully-qualified path representing Dependency resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDependencyName(dependencyName: string) { - return this.pathTemplates.dependencyPathTemplate.match(dependencyName).project; - } - - /** - * Parse the location from Dependency resource. - * - * @param {string} dependencyName - * A fully-qualified path representing Dependency resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDependencyName(dependencyName: string) { - return this.pathTemplates.dependencyPathTemplate.match(dependencyName).location; - } - - /** - * Parse the dependency from Dependency resource. - * - * @param {string} dependencyName - * A fully-qualified path representing Dependency resource. - * @returns {string} A string representing the dependency. - */ - matchDependencyFromDependencyName(dependencyName: string) { - return this.pathTemplates.dependencyPathTemplate.match(dependencyName).dependency; - } - - /** - * Return a fully-qualified deployment resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} deployment - * @returns {string} Resource name string. - */ - deploymentPath(project:string,location:string,deployment:string) { - return this.pathTemplates.deploymentPathTemplate.render({ - project: project, - location: location, - deployment: deployment, - }); - } - - /** - * Parse the project from Deployment resource. - * - * @param {string} deploymentName - * A fully-qualified path representing Deployment resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDeploymentName(deploymentName: string) { - return this.pathTemplates.deploymentPathTemplate.match(deploymentName).project; - } - - /** - * Parse the location from Deployment resource. - * - * @param {string} deploymentName - * A fully-qualified path representing Deployment resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDeploymentName(deploymentName: string) { - return this.pathTemplates.deploymentPathTemplate.match(deploymentName).location; - } - - /** - * Parse the deployment from Deployment resource. - * - * @param {string} deploymentName - * A fully-qualified path representing Deployment resource. - * @returns {string} A string representing the deployment. - */ - matchDeploymentFromDeploymentName(deploymentName: string) { - return this.pathTemplates.deploymentPathTemplate.match(deploymentName).deployment; - } - - /** - * Return a fully-qualified externalApi resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} external_api - * @returns {string} Resource name string. - */ - externalApiPath(project:string,location:string,externalApi:string) { - return this.pathTemplates.externalApiPathTemplate.render({ - project: project, - location: location, - external_api: externalApi, - }); - } - - /** - * Parse the project from ExternalApi resource. - * - * @param {string} externalApiName - * A fully-qualified path representing ExternalApi resource. - * @returns {string} A string representing the project. - */ - matchProjectFromExternalApiName(externalApiName: string) { - return this.pathTemplates.externalApiPathTemplate.match(externalApiName).project; - } - - /** - * Parse the location from ExternalApi resource. - * - * @param {string} externalApiName - * A fully-qualified path representing ExternalApi resource. - * @returns {string} A string representing the location. - */ - matchLocationFromExternalApiName(externalApiName: string) { - return this.pathTemplates.externalApiPathTemplate.match(externalApiName).location; - } - - /** - * Parse the external_api from ExternalApi resource. - * - * @param {string} externalApiName - * A fully-qualified path representing ExternalApi resource. - * @returns {string} A string representing the external_api. - */ - matchExternalApiFromExternalApiName(externalApiName: string) { - return this.pathTemplates.externalApiPathTemplate.match(externalApiName).external_api; - } - - /** - * Return a fully-qualified hostProjectRegistration resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} host_project_registration - * @returns {string} Resource name string. - */ - hostProjectRegistrationPath(project:string,location:string,hostProjectRegistration:string) { - return this.pathTemplates.hostProjectRegistrationPathTemplate.render({ - project: project, - location: location, - host_project_registration: hostProjectRegistration, - }); - } - - /** - * Parse the project from HostProjectRegistration resource. - * - * @param {string} hostProjectRegistrationName - * A fully-qualified path representing HostProjectRegistration resource. - * @returns {string} A string representing the project. - */ - matchProjectFromHostProjectRegistrationName(hostProjectRegistrationName: string) { - return this.pathTemplates.hostProjectRegistrationPathTemplate.match(hostProjectRegistrationName).project; - } - - /** - * Parse the location from HostProjectRegistration resource. - * - * @param {string} hostProjectRegistrationName - * A fully-qualified path representing HostProjectRegistration resource. - * @returns {string} A string representing the location. - */ - matchLocationFromHostProjectRegistrationName(hostProjectRegistrationName: string) { - return this.pathTemplates.hostProjectRegistrationPathTemplate.match(hostProjectRegistrationName).location; - } - - /** - * Parse the host_project_registration from HostProjectRegistration resource. - * - * @param {string} hostProjectRegistrationName - * A fully-qualified path representing HostProjectRegistration resource. - * @returns {string} A string representing the host_project_registration. - */ - matchHostProjectRegistrationFromHostProjectRegistrationName(hostProjectRegistrationName: string) { - return this.pathTemplates.hostProjectRegistrationPathTemplate.match(hostProjectRegistrationName).host_project_registration; - } - - /** - * Return a fully-qualified location resource name string. - * - * @param {string} project - * @param {string} location - * @returns {string} Resource name string. - */ - locationPath(project:string,location:string) { - return this.pathTemplates.locationPathTemplate.render({ - project: project, - location: location, - }); - } - - /** - * Parse the project from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the project. - */ - matchProjectFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).project; - } - - /** - * Parse the location from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the location. - */ - matchLocationFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).location; - } - - /** - * Return a fully-qualified plugin resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} plugin - * @returns {string} Resource name string. - */ - pluginPath(project:string,location:string,plugin:string) { - return this.pathTemplates.pluginPathTemplate.render({ - project: project, - location: location, - plugin: plugin, - }); - } - - /** - * Parse the project from Plugin resource. - * - * @param {string} pluginName - * A fully-qualified path representing Plugin resource. - * @returns {string} A string representing the project. - */ - matchProjectFromPluginName(pluginName: string) { - return this.pathTemplates.pluginPathTemplate.match(pluginName).project; - } - - /** - * Parse the location from Plugin resource. - * - * @param {string} pluginName - * A fully-qualified path representing Plugin resource. - * @returns {string} A string representing the location. - */ - matchLocationFromPluginName(pluginName: string) { - return this.pathTemplates.pluginPathTemplate.match(pluginName).location; - } - - /** - * Parse the plugin from Plugin resource. - * - * @param {string} pluginName - * A fully-qualified path representing Plugin resource. - * @returns {string} A string representing the plugin. - */ - matchPluginFromPluginName(pluginName: string) { - return this.pathTemplates.pluginPathTemplate.match(pluginName).plugin; - } - - /** - * Return a fully-qualified project resource name string. - * - * @param {string} project - * @returns {string} Resource name string. - */ - projectPath(project:string) { - return this.pathTemplates.projectPathTemplate.render({ - project: project, - }); - } - - /** - * Parse the project from Project resource. - * - * @param {string} projectName - * A fully-qualified path representing Project resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectName(projectName: string) { - return this.pathTemplates.projectPathTemplate.match(projectName).project; - } - - /** - * Return a fully-qualified runtimeProjectAttachment resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} runtime_project_attachment - * @returns {string} Resource name string. - */ - runtimeProjectAttachmentPath(project:string,location:string,runtimeProjectAttachment:string) { - return this.pathTemplates.runtimeProjectAttachmentPathTemplate.render({ - project: project, - location: location, - runtime_project_attachment: runtimeProjectAttachment, - }); - } - - /** - * Parse the project from RuntimeProjectAttachment resource. - * - * @param {string} runtimeProjectAttachmentName - * A fully-qualified path representing RuntimeProjectAttachment resource. - * @returns {string} A string representing the project. - */ - matchProjectFromRuntimeProjectAttachmentName(runtimeProjectAttachmentName: string) { - return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match(runtimeProjectAttachmentName).project; - } - - /** - * Parse the location from RuntimeProjectAttachment resource. - * - * @param {string} runtimeProjectAttachmentName - * A fully-qualified path representing RuntimeProjectAttachment resource. - * @returns {string} A string representing the location. - */ - matchLocationFromRuntimeProjectAttachmentName(runtimeProjectAttachmentName: string) { - return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match(runtimeProjectAttachmentName).location; - } - - /** - * Parse the runtime_project_attachment from RuntimeProjectAttachment resource. - * - * @param {string} runtimeProjectAttachmentName - * A fully-qualified path representing RuntimeProjectAttachment resource. - * @returns {string} A string representing the runtime_project_attachment. - */ - matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName(runtimeProjectAttachmentName: string) { - return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match(runtimeProjectAttachmentName).runtime_project_attachment; - } - - /** - * Return a fully-qualified spec resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} api - * @param {string} version - * @param {string} spec - * @returns {string} Resource name string. - */ - specPath(project:string,location:string,api:string,version:string,spec:string) { - return this.pathTemplates.specPathTemplate.render({ - project: project, - location: location, - api: api, - version: version, - spec: spec, - }); - } - - /** - * Parse the project from Spec resource. - * - * @param {string} specName - * A fully-qualified path representing Spec resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSpecName(specName: string) { - return this.pathTemplates.specPathTemplate.match(specName).project; - } - - /** - * Parse the location from Spec resource. - * - * @param {string} specName - * A fully-qualified path representing Spec resource. - * @returns {string} A string representing the location. - */ - matchLocationFromSpecName(specName: string) { - return this.pathTemplates.specPathTemplate.match(specName).location; - } - - /** - * Parse the api from Spec resource. - * - * @param {string} specName - * A fully-qualified path representing Spec resource. - * @returns {string} A string representing the api. - */ - matchApiFromSpecName(specName: string) { - return this.pathTemplates.specPathTemplate.match(specName).api; - } - - /** - * Parse the version from Spec resource. - * - * @param {string} specName - * A fully-qualified path representing Spec resource. - * @returns {string} A string representing the version. - */ - matchVersionFromSpecName(specName: string) { - return this.pathTemplates.specPathTemplate.match(specName).version; - } - - /** - * Parse the spec from Spec resource. - * - * @param {string} specName - * A fully-qualified path representing Spec resource. - * @returns {string} A string representing the spec. - */ - matchSpecFromSpecName(specName: string) { - return this.pathTemplates.specPathTemplate.match(specName).spec; - } - - /** - * Return a fully-qualified styleGuide resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} plugin - * @returns {string} Resource name string. - */ - styleGuidePath(project:string,location:string,plugin:string) { - return this.pathTemplates.styleGuidePathTemplate.render({ - project: project, - location: location, - plugin: plugin, - }); - } - - /** - * Parse the project from StyleGuide resource. - * - * @param {string} styleGuideName - * A fully-qualified path representing StyleGuide resource. - * @returns {string} A string representing the project. - */ - matchProjectFromStyleGuideName(styleGuideName: string) { - return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName).project; - } - - /** - * Parse the location from StyleGuide resource. - * - * @param {string} styleGuideName - * A fully-qualified path representing StyleGuide resource. - * @returns {string} A string representing the location. - */ - matchLocationFromStyleGuideName(styleGuideName: string) { - return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName).location; - } - - /** - * Parse the plugin from StyleGuide resource. - * - * @param {string} styleGuideName - * A fully-qualified path representing StyleGuide resource. - * @returns {string} A string representing the plugin. - */ - matchPluginFromStyleGuideName(styleGuideName: string) { - return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName).plugin; - } - - /** - * Return a fully-qualified version resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} api - * @param {string} version - * @returns {string} Resource name string. - */ - versionPath(project:string,location:string,api:string,version:string) { - return this.pathTemplates.versionPathTemplate.render({ - project: project, - location: location, - api: api, - version: version, - }); - } - - /** - * Parse the project from Version resource. - * - * @param {string} versionName - * A fully-qualified path representing Version resource. - * @returns {string} A string representing the project. - */ - matchProjectFromVersionName(versionName: string) { - return this.pathTemplates.versionPathTemplate.match(versionName).project; - } - - /** - * Parse the location from Version resource. - * - * @param {string} versionName - * A fully-qualified path representing Version resource. - * @returns {string} A string representing the location. - */ - matchLocationFromVersionName(versionName: string) { - return this.pathTemplates.versionPathTemplate.match(versionName).location; - } - - /** - * Parse the api from Version resource. - * - * @param {string} versionName - * A fully-qualified path representing Version resource. - * @returns {string} A string representing the api. - */ - matchApiFromVersionName(versionName: string) { - return this.pathTemplates.versionPathTemplate.match(versionName).api; - } - - /** - * Parse the version from Version resource. - * - * @param {string} versionName - * A fully-qualified path representing Version resource. - * @returns {string} A string representing the version. - */ - matchVersionFromVersionName(versionName: string) { - return this.pathTemplates.versionPathTemplate.match(versionName).version; - } - - /** - * 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.hostProjectRegistrationServiceStub && !this._terminated) { - return this.hostProjectRegistrationServiceStub.then(stub => { - this._terminated = true; - stub.close(); - this.locationsClient.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/owl-bot-staging/google-cloud-apihub/v1/src/v1/host_project_registration_service_client_config.json b/owl-bot-staging/google-cloud-apihub/v1/src/v1/host_project_registration_service_client_config.json deleted file mode 100644 index 8daddd428c6..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/src/v1/host_project_registration_service_client_config.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "interfaces": { - "google.cloud.apihub.v1.HostProjectRegistrationService": { - "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": { - "CreateHostProjectRegistration": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetHostProjectRegistration": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "ListHostProjectRegistrations": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-apihub/v1/src/v1/host_project_registration_service_proto_list.json b/owl-bot-staging/google-cloud-apihub/v1/src/v1/host_project_registration_service_proto_list.json deleted file mode 100644 index 07e987f7fb3..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/src/v1/host_project_registration_service_proto_list.json +++ /dev/null @@ -1,9 +0,0 @@ -[ - "../../protos/google/cloud/apihub/v1/apihub_service.proto", - "../../protos/google/cloud/apihub/v1/common_fields.proto", - "../../protos/google/cloud/apihub/v1/host_project_registration_service.proto", - "../../protos/google/cloud/apihub/v1/linting_service.proto", - "../../protos/google/cloud/apihub/v1/plugin_service.proto", - "../../protos/google/cloud/apihub/v1/provisioning_service.proto", - "../../protos/google/cloud/apihub/v1/runtime_project_attachment_service.proto" -] diff --git a/owl-bot-staging/google-cloud-apihub/v1/src/v1/index.ts b/owl-bot-staging/google-cloud-apihub/v1/src/v1/index.ts deleted file mode 100644 index ea67cfcd904..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/src/v1/index.ts +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2024 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 {ApiHubClient} from './api_hub_client'; -export {ApiHubDependenciesClient} from './api_hub_dependencies_client'; -export {ApiHubPluginClient} from './api_hub_plugin_client'; -export {HostProjectRegistrationServiceClient} from './host_project_registration_service_client'; -export {LintingServiceClient} from './linting_service_client'; -export {ProvisioningClient} from './provisioning_client'; -export {RuntimeProjectAttachmentServiceClient} from './runtime_project_attachment_service_client'; diff --git a/owl-bot-staging/google-cloud-apihub/v1/src/v1/linting_service_client.ts b/owl-bot-staging/google-cloud-apihub/v1/src/v1/linting_service_client.ts deleted file mode 100644 index 3e2a0e0cd44..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/src/v1/linting_service_client.ts +++ /dev/null @@ -1,1545 +0,0 @@ -// Copyright 2024 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, LocationsClient, LocationProtos} from 'google-gax'; - -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); - -/** - * Client JSON configuration object, loaded from - * `src/v1/linting_service_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './linting_service_client_config.json'; -const version = require('../../../package.json').version; - -/** - * This service provides all methods related to the 1p Linter. - * @class - * @memberof v1 - */ -export class LintingServiceClient { - 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}; - private _universeDomain: string; - private _servicePath: string; - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - locationsClient: LocationsClient; - pathTemplates: {[name: string]: gax.PathTemplate}; - lintingServiceStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of LintingServiceClient. - * - * @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 LintingServiceClient({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 LintingServiceClient; - if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { - throw new Error('Please set either universe_domain or universeDomain, but not both.'); - } - const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; - this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; - this._servicePath = 'apihub.' + this._universeDomain; - const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; - this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); - const port = opts?.port || staticMembers.port; - const clientConfig = opts?.clientConfig ?? {}; - // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). - if (!opts) { - opts = {fallback: true}; - } else { - opts.fallback = opts.fallback ?? true; - } - 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 !== this._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 = this._servicePath; - - // Set the default scopes in auth client if needed. - if (servicePath === this._servicePath) { - this.auth.defaultScopes = staticMembers.scopes; - } - 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 === 'object' && '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 = { - apiPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apis/{api}' - ), - apiHubInstancePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apiHubInstances/{api_hub_instance}' - ), - apiOperationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}' - ), - attributePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/attributes/{attribute}' - ), - definitionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}' - ), - dependencyPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/dependencies/{dependency}' - ), - deploymentPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/deployments/{deployment}' - ), - externalApiPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/externalApis/{external_api}' - ), - hostProjectRegistrationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/hostProjectRegistrations/{host_project_registration}' - ), - pluginPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/plugins/{plugin}' - ), - runtimeProjectAttachmentPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}' - ), - specPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}' - ), - styleGuidePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/plugins/{plugin}/styleGuide' - ), - versionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apis/{api}/versions/{version}' - ), - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.apihub.v1.LintingService', 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.lintingServiceStub) { - return this.lintingServiceStub; - } - - // Put together the "service stub" for - // google.cloud.apihub.v1.LintingService. - this.lintingServiceStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.apihub.v1.LintingService') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.apihub.v1.LintingService, - 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 lintingServiceStubMethods = - ['getStyleGuide', 'updateStyleGuide', 'getStyleGuideContents', 'lintSpec']; - for (const methodName of lintingServiceStubMethods) { - const callPromise = this.lintingServiceStub.then( - stub => (...args: Array<{}>) => { - if (this._terminated) { - return Promise.reject('The client has already been closed.'); - } - const func = stub[methodName]; - return func.apply(stub, args); - }, - (err: Error|null|undefined) => () => { - throw err; - }); - - const descriptor = - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor, - this._opts.fallback - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.lintingServiceStub; - } - - /** - * The DNS address for this API service. - * @deprecated Use the apiEndpoint method of the client instance. - * @returns {string} The DNS address for this service. - */ - static get servicePath() { - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); - } - return 'apihub.googleapis.com'; - } - - /** - * The DNS address for this API service - same as servicePath. - * @deprecated Use the apiEndpoint method of the client instance. - * @returns {string} The DNS address for this service. - */ - static get apiEndpoint() { - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); - } - return 'apihub.googleapis.com'; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - get apiEndpoint() { - return this._servicePath; - } - - get universeDomain() { - return this._universeDomain; - } - - /** - * 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 -- - // ------------------- -/** - * Get the style guide being used for linting. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the spec to retrieve. - * Format: - * `projects/{project}/locations/{location}/plugins/{plugin}/styleGuide`. - * @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.apihub.v1.StyleGuide|StyleGuide}. - * 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/linting_service.get_style_guide.js - * region_tag:apihub_v1_generated_LintingService_GetStyleGuide_async - */ - getStyleGuide( - request?: protos.google.cloud.apihub.v1.IGetStyleGuideRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apihub.v1.IStyleGuide, - protos.google.cloud.apihub.v1.IGetStyleGuideRequest|undefined, {}|undefined - ]>; - getStyleGuide( - request: protos.google.cloud.apihub.v1.IGetStyleGuideRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.apihub.v1.IStyleGuide, - protos.google.cloud.apihub.v1.IGetStyleGuideRequest|null|undefined, - {}|null|undefined>): void; - getStyleGuide( - request: protos.google.cloud.apihub.v1.IGetStyleGuideRequest, - callback: Callback< - protos.google.cloud.apihub.v1.IStyleGuide, - protos.google.cloud.apihub.v1.IGetStyleGuideRequest|null|undefined, - {}|null|undefined>): void; - getStyleGuide( - request?: protos.google.cloud.apihub.v1.IGetStyleGuideRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.apihub.v1.IStyleGuide, - protos.google.cloud.apihub.v1.IGetStyleGuideRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.apihub.v1.IStyleGuide, - protos.google.cloud.apihub.v1.IGetStyleGuideRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.apihub.v1.IStyleGuide, - protos.google.cloud.apihub.v1.IGetStyleGuideRequest|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.getStyleGuide(request, options, callback); - } -/** - * Update the styleGuide to be used for liniting in by API hub. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.apihub.v1.StyleGuide} request.styleGuide - * Required. The Style guide resource to update. - * @param {google.protobuf.FieldMask} [request.updateMask] - * Optional. The list of fields to update. - * @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.apihub.v1.StyleGuide|StyleGuide}. - * 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/linting_service.update_style_guide.js - * region_tag:apihub_v1_generated_LintingService_UpdateStyleGuide_async - */ - updateStyleGuide( - request?: protos.google.cloud.apihub.v1.IUpdateStyleGuideRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apihub.v1.IStyleGuide, - protos.google.cloud.apihub.v1.IUpdateStyleGuideRequest|undefined, {}|undefined - ]>; - updateStyleGuide( - request: protos.google.cloud.apihub.v1.IUpdateStyleGuideRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.apihub.v1.IStyleGuide, - protos.google.cloud.apihub.v1.IUpdateStyleGuideRequest|null|undefined, - {}|null|undefined>): void; - updateStyleGuide( - request: protos.google.cloud.apihub.v1.IUpdateStyleGuideRequest, - callback: Callback< - protos.google.cloud.apihub.v1.IStyleGuide, - protos.google.cloud.apihub.v1.IUpdateStyleGuideRequest|null|undefined, - {}|null|undefined>): void; - updateStyleGuide( - request?: protos.google.cloud.apihub.v1.IUpdateStyleGuideRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.apihub.v1.IStyleGuide, - protos.google.cloud.apihub.v1.IUpdateStyleGuideRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.apihub.v1.IStyleGuide, - protos.google.cloud.apihub.v1.IUpdateStyleGuideRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.apihub.v1.IStyleGuide, - protos.google.cloud.apihub.v1.IUpdateStyleGuideRequest|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({ - 'style_guide.name': request.styleGuide!.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.updateStyleGuide(request, options, callback); - } -/** - * Get the contents of the style guide. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the StyleGuide whose contents need to be retrieved. - * There is exactly one style guide resource per project per location. - * The expected format is - * `projects/{project}/locations/{location}/plugins/{plugin}/styleGuide`. - * @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.apihub.v1.StyleGuideContents|StyleGuideContents}. - * 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/linting_service.get_style_guide_contents.js - * region_tag:apihub_v1_generated_LintingService_GetStyleGuideContents_async - */ - getStyleGuideContents( - request?: protos.google.cloud.apihub.v1.IGetStyleGuideContentsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apihub.v1.IStyleGuideContents, - protos.google.cloud.apihub.v1.IGetStyleGuideContentsRequest|undefined, {}|undefined - ]>; - getStyleGuideContents( - request: protos.google.cloud.apihub.v1.IGetStyleGuideContentsRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.apihub.v1.IStyleGuideContents, - protos.google.cloud.apihub.v1.IGetStyleGuideContentsRequest|null|undefined, - {}|null|undefined>): void; - getStyleGuideContents( - request: protos.google.cloud.apihub.v1.IGetStyleGuideContentsRequest, - callback: Callback< - protos.google.cloud.apihub.v1.IStyleGuideContents, - protos.google.cloud.apihub.v1.IGetStyleGuideContentsRequest|null|undefined, - {}|null|undefined>): void; - getStyleGuideContents( - request?: protos.google.cloud.apihub.v1.IGetStyleGuideContentsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.apihub.v1.IStyleGuideContents, - protos.google.cloud.apihub.v1.IGetStyleGuideContentsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.apihub.v1.IStyleGuideContents, - protos.google.cloud.apihub.v1.IGetStyleGuideContentsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.apihub.v1.IStyleGuideContents, - protos.google.cloud.apihub.v1.IGetStyleGuideContentsRequest|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.getStyleGuideContents(request, options, callback); - } -/** - * Lints the requested spec and updates the corresponding API Spec with the - * lint response. This lint response will be available in all subsequent - * Get and List Spec calls to Core service. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the spec to be linted. - * Format: - * `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}` - * @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.protobuf.Empty|Empty}. - * 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/linting_service.lint_spec.js - * region_tag:apihub_v1_generated_LintingService_LintSpec_async - */ - lintSpec( - request?: protos.google.cloud.apihub.v1.ILintSpecRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.ILintSpecRequest|undefined, {}|undefined - ]>; - lintSpec( - request: protos.google.cloud.apihub.v1.ILintSpecRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.ILintSpecRequest|null|undefined, - {}|null|undefined>): void; - lintSpec( - request: protos.google.cloud.apihub.v1.ILintSpecRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.ILintSpecRequest|null|undefined, - {}|null|undefined>): void; - lintSpec( - request?: protos.google.cloud.apihub.v1.ILintSpecRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.ILintSpecRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.ILintSpecRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.ILintSpecRequest|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.lintSpec(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); - } - - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified api resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} api - * @returns {string} Resource name string. - */ - apiPath(project:string,location:string,api:string) { - return this.pathTemplates.apiPathTemplate.render({ - project: project, - location: location, - api: api, - }); - } - - /** - * Parse the project from Api resource. - * - * @param {string} apiName - * A fully-qualified path representing Api resource. - * @returns {string} A string representing the project. - */ - matchProjectFromApiName(apiName: string) { - return this.pathTemplates.apiPathTemplate.match(apiName).project; - } - - /** - * Parse the location from Api resource. - * - * @param {string} apiName - * A fully-qualified path representing Api resource. - * @returns {string} A string representing the location. - */ - matchLocationFromApiName(apiName: string) { - return this.pathTemplates.apiPathTemplate.match(apiName).location; - } - - /** - * Parse the api from Api resource. - * - * @param {string} apiName - * A fully-qualified path representing Api resource. - * @returns {string} A string representing the api. - */ - matchApiFromApiName(apiName: string) { - return this.pathTemplates.apiPathTemplate.match(apiName).api; - } - - /** - * Return a fully-qualified apiHubInstance resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} api_hub_instance - * @returns {string} Resource name string. - */ - apiHubInstancePath(project:string,location:string,apiHubInstance:string) { - return this.pathTemplates.apiHubInstancePathTemplate.render({ - project: project, - location: location, - api_hub_instance: apiHubInstance, - }); - } - - /** - * Parse the project from ApiHubInstance resource. - * - * @param {string} apiHubInstanceName - * A fully-qualified path representing ApiHubInstance resource. - * @returns {string} A string representing the project. - */ - matchProjectFromApiHubInstanceName(apiHubInstanceName: string) { - return this.pathTemplates.apiHubInstancePathTemplate.match(apiHubInstanceName).project; - } - - /** - * Parse the location from ApiHubInstance resource. - * - * @param {string} apiHubInstanceName - * A fully-qualified path representing ApiHubInstance resource. - * @returns {string} A string representing the location. - */ - matchLocationFromApiHubInstanceName(apiHubInstanceName: string) { - return this.pathTemplates.apiHubInstancePathTemplate.match(apiHubInstanceName).location; - } - - /** - * Parse the api_hub_instance from ApiHubInstance resource. - * - * @param {string} apiHubInstanceName - * A fully-qualified path representing ApiHubInstance resource. - * @returns {string} A string representing the api_hub_instance. - */ - matchApiHubInstanceFromApiHubInstanceName(apiHubInstanceName: string) { - return this.pathTemplates.apiHubInstancePathTemplate.match(apiHubInstanceName).api_hub_instance; - } - - /** - * Return a fully-qualified apiOperation resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} api - * @param {string} version - * @param {string} operation - * @returns {string} Resource name string. - */ - apiOperationPath(project:string,location:string,api:string,version:string,operation:string) { - return this.pathTemplates.apiOperationPathTemplate.render({ - project: project, - location: location, - api: api, - version: version, - operation: operation, - }); - } - - /** - * Parse the project from ApiOperation resource. - * - * @param {string} apiOperationName - * A fully-qualified path representing ApiOperation resource. - * @returns {string} A string representing the project. - */ - matchProjectFromApiOperationName(apiOperationName: string) { - return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).project; - } - - /** - * Parse the location from ApiOperation resource. - * - * @param {string} apiOperationName - * A fully-qualified path representing ApiOperation resource. - * @returns {string} A string representing the location. - */ - matchLocationFromApiOperationName(apiOperationName: string) { - return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).location; - } - - /** - * Parse the api from ApiOperation resource. - * - * @param {string} apiOperationName - * A fully-qualified path representing ApiOperation resource. - * @returns {string} A string representing the api. - */ - matchApiFromApiOperationName(apiOperationName: string) { - return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).api; - } - - /** - * Parse the version from ApiOperation resource. - * - * @param {string} apiOperationName - * A fully-qualified path representing ApiOperation resource. - * @returns {string} A string representing the version. - */ - matchVersionFromApiOperationName(apiOperationName: string) { - return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).version; - } - - /** - * Parse the operation from ApiOperation resource. - * - * @param {string} apiOperationName - * A fully-qualified path representing ApiOperation resource. - * @returns {string} A string representing the operation. - */ - matchOperationFromApiOperationName(apiOperationName: string) { - return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).operation; - } - - /** - * Return a fully-qualified attribute resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} attribute - * @returns {string} Resource name string. - */ - attributePath(project:string,location:string,attribute:string) { - return this.pathTemplates.attributePathTemplate.render({ - project: project, - location: location, - attribute: attribute, - }); - } - - /** - * Parse the project from Attribute resource. - * - * @param {string} attributeName - * A fully-qualified path representing Attribute resource. - * @returns {string} A string representing the project. - */ - matchProjectFromAttributeName(attributeName: string) { - return this.pathTemplates.attributePathTemplate.match(attributeName).project; - } - - /** - * Parse the location from Attribute resource. - * - * @param {string} attributeName - * A fully-qualified path representing Attribute resource. - * @returns {string} A string representing the location. - */ - matchLocationFromAttributeName(attributeName: string) { - return this.pathTemplates.attributePathTemplate.match(attributeName).location; - } - - /** - * Parse the attribute from Attribute resource. - * - * @param {string} attributeName - * A fully-qualified path representing Attribute resource. - * @returns {string} A string representing the attribute. - */ - matchAttributeFromAttributeName(attributeName: string) { - return this.pathTemplates.attributePathTemplate.match(attributeName).attribute; - } - - /** - * Return a fully-qualified definition resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} api - * @param {string} version - * @param {string} definition - * @returns {string} Resource name string. - */ - definitionPath(project:string,location:string,api:string,version:string,definition:string) { - return this.pathTemplates.definitionPathTemplate.render({ - project: project, - location: location, - api: api, - version: version, - definition: definition, - }); - } - - /** - * Parse the project from Definition resource. - * - * @param {string} definitionName - * A fully-qualified path representing Definition resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDefinitionName(definitionName: string) { - return this.pathTemplates.definitionPathTemplate.match(definitionName).project; - } - - /** - * Parse the location from Definition resource. - * - * @param {string} definitionName - * A fully-qualified path representing Definition resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDefinitionName(definitionName: string) { - return this.pathTemplates.definitionPathTemplate.match(definitionName).location; - } - - /** - * Parse the api from Definition resource. - * - * @param {string} definitionName - * A fully-qualified path representing Definition resource. - * @returns {string} A string representing the api. - */ - matchApiFromDefinitionName(definitionName: string) { - return this.pathTemplates.definitionPathTemplate.match(definitionName).api; - } - - /** - * Parse the version from Definition resource. - * - * @param {string} definitionName - * A fully-qualified path representing Definition resource. - * @returns {string} A string representing the version. - */ - matchVersionFromDefinitionName(definitionName: string) { - return this.pathTemplates.definitionPathTemplate.match(definitionName).version; - } - - /** - * Parse the definition from Definition resource. - * - * @param {string} definitionName - * A fully-qualified path representing Definition resource. - * @returns {string} A string representing the definition. - */ - matchDefinitionFromDefinitionName(definitionName: string) { - return this.pathTemplates.definitionPathTemplate.match(definitionName).definition; - } - - /** - * Return a fully-qualified dependency resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dependency - * @returns {string} Resource name string. - */ - dependencyPath(project:string,location:string,dependency:string) { - return this.pathTemplates.dependencyPathTemplate.render({ - project: project, - location: location, - dependency: dependency, - }); - } - - /** - * Parse the project from Dependency resource. - * - * @param {string} dependencyName - * A fully-qualified path representing Dependency resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDependencyName(dependencyName: string) { - return this.pathTemplates.dependencyPathTemplate.match(dependencyName).project; - } - - /** - * Parse the location from Dependency resource. - * - * @param {string} dependencyName - * A fully-qualified path representing Dependency resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDependencyName(dependencyName: string) { - return this.pathTemplates.dependencyPathTemplate.match(dependencyName).location; - } - - /** - * Parse the dependency from Dependency resource. - * - * @param {string} dependencyName - * A fully-qualified path representing Dependency resource. - * @returns {string} A string representing the dependency. - */ - matchDependencyFromDependencyName(dependencyName: string) { - return this.pathTemplates.dependencyPathTemplate.match(dependencyName).dependency; - } - - /** - * Return a fully-qualified deployment resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} deployment - * @returns {string} Resource name string. - */ - deploymentPath(project:string,location:string,deployment:string) { - return this.pathTemplates.deploymentPathTemplate.render({ - project: project, - location: location, - deployment: deployment, - }); - } - - /** - * Parse the project from Deployment resource. - * - * @param {string} deploymentName - * A fully-qualified path representing Deployment resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDeploymentName(deploymentName: string) { - return this.pathTemplates.deploymentPathTemplate.match(deploymentName).project; - } - - /** - * Parse the location from Deployment resource. - * - * @param {string} deploymentName - * A fully-qualified path representing Deployment resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDeploymentName(deploymentName: string) { - return this.pathTemplates.deploymentPathTemplate.match(deploymentName).location; - } - - /** - * Parse the deployment from Deployment resource. - * - * @param {string} deploymentName - * A fully-qualified path representing Deployment resource. - * @returns {string} A string representing the deployment. - */ - matchDeploymentFromDeploymentName(deploymentName: string) { - return this.pathTemplates.deploymentPathTemplate.match(deploymentName).deployment; - } - - /** - * Return a fully-qualified externalApi resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} external_api - * @returns {string} Resource name string. - */ - externalApiPath(project:string,location:string,externalApi:string) { - return this.pathTemplates.externalApiPathTemplate.render({ - project: project, - location: location, - external_api: externalApi, - }); - } - - /** - * Parse the project from ExternalApi resource. - * - * @param {string} externalApiName - * A fully-qualified path representing ExternalApi resource. - * @returns {string} A string representing the project. - */ - matchProjectFromExternalApiName(externalApiName: string) { - return this.pathTemplates.externalApiPathTemplate.match(externalApiName).project; - } - - /** - * Parse the location from ExternalApi resource. - * - * @param {string} externalApiName - * A fully-qualified path representing ExternalApi resource. - * @returns {string} A string representing the location. - */ - matchLocationFromExternalApiName(externalApiName: string) { - return this.pathTemplates.externalApiPathTemplate.match(externalApiName).location; - } - - /** - * Parse the external_api from ExternalApi resource. - * - * @param {string} externalApiName - * A fully-qualified path representing ExternalApi resource. - * @returns {string} A string representing the external_api. - */ - matchExternalApiFromExternalApiName(externalApiName: string) { - return this.pathTemplates.externalApiPathTemplate.match(externalApiName).external_api; - } - - /** - * Return a fully-qualified hostProjectRegistration resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} host_project_registration - * @returns {string} Resource name string. - */ - hostProjectRegistrationPath(project:string,location:string,hostProjectRegistration:string) { - return this.pathTemplates.hostProjectRegistrationPathTemplate.render({ - project: project, - location: location, - host_project_registration: hostProjectRegistration, - }); - } - - /** - * Parse the project from HostProjectRegistration resource. - * - * @param {string} hostProjectRegistrationName - * A fully-qualified path representing HostProjectRegistration resource. - * @returns {string} A string representing the project. - */ - matchProjectFromHostProjectRegistrationName(hostProjectRegistrationName: string) { - return this.pathTemplates.hostProjectRegistrationPathTemplate.match(hostProjectRegistrationName).project; - } - - /** - * Parse the location from HostProjectRegistration resource. - * - * @param {string} hostProjectRegistrationName - * A fully-qualified path representing HostProjectRegistration resource. - * @returns {string} A string representing the location. - */ - matchLocationFromHostProjectRegistrationName(hostProjectRegistrationName: string) { - return this.pathTemplates.hostProjectRegistrationPathTemplate.match(hostProjectRegistrationName).location; - } - - /** - * Parse the host_project_registration from HostProjectRegistration resource. - * - * @param {string} hostProjectRegistrationName - * A fully-qualified path representing HostProjectRegistration resource. - * @returns {string} A string representing the host_project_registration. - */ - matchHostProjectRegistrationFromHostProjectRegistrationName(hostProjectRegistrationName: string) { - return this.pathTemplates.hostProjectRegistrationPathTemplate.match(hostProjectRegistrationName).host_project_registration; - } - - /** - * Return a fully-qualified plugin resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} plugin - * @returns {string} Resource name string. - */ - pluginPath(project:string,location:string,plugin:string) { - return this.pathTemplates.pluginPathTemplate.render({ - project: project, - location: location, - plugin: plugin, - }); - } - - /** - * Parse the project from Plugin resource. - * - * @param {string} pluginName - * A fully-qualified path representing Plugin resource. - * @returns {string} A string representing the project. - */ - matchProjectFromPluginName(pluginName: string) { - return this.pathTemplates.pluginPathTemplate.match(pluginName).project; - } - - /** - * Parse the location from Plugin resource. - * - * @param {string} pluginName - * A fully-qualified path representing Plugin resource. - * @returns {string} A string representing the location. - */ - matchLocationFromPluginName(pluginName: string) { - return this.pathTemplates.pluginPathTemplate.match(pluginName).location; - } - - /** - * Parse the plugin from Plugin resource. - * - * @param {string} pluginName - * A fully-qualified path representing Plugin resource. - * @returns {string} A string representing the plugin. - */ - matchPluginFromPluginName(pluginName: string) { - return this.pathTemplates.pluginPathTemplate.match(pluginName).plugin; - } - - /** - * Return a fully-qualified runtimeProjectAttachment resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} runtime_project_attachment - * @returns {string} Resource name string. - */ - runtimeProjectAttachmentPath(project:string,location:string,runtimeProjectAttachment:string) { - return this.pathTemplates.runtimeProjectAttachmentPathTemplate.render({ - project: project, - location: location, - runtime_project_attachment: runtimeProjectAttachment, - }); - } - - /** - * Parse the project from RuntimeProjectAttachment resource. - * - * @param {string} runtimeProjectAttachmentName - * A fully-qualified path representing RuntimeProjectAttachment resource. - * @returns {string} A string representing the project. - */ - matchProjectFromRuntimeProjectAttachmentName(runtimeProjectAttachmentName: string) { - return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match(runtimeProjectAttachmentName).project; - } - - /** - * Parse the location from RuntimeProjectAttachment resource. - * - * @param {string} runtimeProjectAttachmentName - * A fully-qualified path representing RuntimeProjectAttachment resource. - * @returns {string} A string representing the location. - */ - matchLocationFromRuntimeProjectAttachmentName(runtimeProjectAttachmentName: string) { - return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match(runtimeProjectAttachmentName).location; - } - - /** - * Parse the runtime_project_attachment from RuntimeProjectAttachment resource. - * - * @param {string} runtimeProjectAttachmentName - * A fully-qualified path representing RuntimeProjectAttachment resource. - * @returns {string} A string representing the runtime_project_attachment. - */ - matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName(runtimeProjectAttachmentName: string) { - return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match(runtimeProjectAttachmentName).runtime_project_attachment; - } - - /** - * Return a fully-qualified spec resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} api - * @param {string} version - * @param {string} spec - * @returns {string} Resource name string. - */ - specPath(project:string,location:string,api:string,version:string,spec:string) { - return this.pathTemplates.specPathTemplate.render({ - project: project, - location: location, - api: api, - version: version, - spec: spec, - }); - } - - /** - * Parse the project from Spec resource. - * - * @param {string} specName - * A fully-qualified path representing Spec resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSpecName(specName: string) { - return this.pathTemplates.specPathTemplate.match(specName).project; - } - - /** - * Parse the location from Spec resource. - * - * @param {string} specName - * A fully-qualified path representing Spec resource. - * @returns {string} A string representing the location. - */ - matchLocationFromSpecName(specName: string) { - return this.pathTemplates.specPathTemplate.match(specName).location; - } - - /** - * Parse the api from Spec resource. - * - * @param {string} specName - * A fully-qualified path representing Spec resource. - * @returns {string} A string representing the api. - */ - matchApiFromSpecName(specName: string) { - return this.pathTemplates.specPathTemplate.match(specName).api; - } - - /** - * Parse the version from Spec resource. - * - * @param {string} specName - * A fully-qualified path representing Spec resource. - * @returns {string} A string representing the version. - */ - matchVersionFromSpecName(specName: string) { - return this.pathTemplates.specPathTemplate.match(specName).version; - } - - /** - * Parse the spec from Spec resource. - * - * @param {string} specName - * A fully-qualified path representing Spec resource. - * @returns {string} A string representing the spec. - */ - matchSpecFromSpecName(specName: string) { - return this.pathTemplates.specPathTemplate.match(specName).spec; - } - - /** - * Return a fully-qualified styleGuide resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} plugin - * @returns {string} Resource name string. - */ - styleGuidePath(project:string,location:string,plugin:string) { - return this.pathTemplates.styleGuidePathTemplate.render({ - project: project, - location: location, - plugin: plugin, - }); - } - - /** - * Parse the project from StyleGuide resource. - * - * @param {string} styleGuideName - * A fully-qualified path representing StyleGuide resource. - * @returns {string} A string representing the project. - */ - matchProjectFromStyleGuideName(styleGuideName: string) { - return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName).project; - } - - /** - * Parse the location from StyleGuide resource. - * - * @param {string} styleGuideName - * A fully-qualified path representing StyleGuide resource. - * @returns {string} A string representing the location. - */ - matchLocationFromStyleGuideName(styleGuideName: string) { - return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName).location; - } - - /** - * Parse the plugin from StyleGuide resource. - * - * @param {string} styleGuideName - * A fully-qualified path representing StyleGuide resource. - * @returns {string} A string representing the plugin. - */ - matchPluginFromStyleGuideName(styleGuideName: string) { - return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName).plugin; - } - - /** - * Return a fully-qualified version resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} api - * @param {string} version - * @returns {string} Resource name string. - */ - versionPath(project:string,location:string,api:string,version:string) { - return this.pathTemplates.versionPathTemplate.render({ - project: project, - location: location, - api: api, - version: version, - }); - } - - /** - * Parse the project from Version resource. - * - * @param {string} versionName - * A fully-qualified path representing Version resource. - * @returns {string} A string representing the project. - */ - matchProjectFromVersionName(versionName: string) { - return this.pathTemplates.versionPathTemplate.match(versionName).project; - } - - /** - * Parse the location from Version resource. - * - * @param {string} versionName - * A fully-qualified path representing Version resource. - * @returns {string} A string representing the location. - */ - matchLocationFromVersionName(versionName: string) { - return this.pathTemplates.versionPathTemplate.match(versionName).location; - } - - /** - * Parse the api from Version resource. - * - * @param {string} versionName - * A fully-qualified path representing Version resource. - * @returns {string} A string representing the api. - */ - matchApiFromVersionName(versionName: string) { - return this.pathTemplates.versionPathTemplate.match(versionName).api; - } - - /** - * Parse the version from Version resource. - * - * @param {string} versionName - * A fully-qualified path representing Version resource. - * @returns {string} A string representing the version. - */ - matchVersionFromVersionName(versionName: string) { - return this.pathTemplates.versionPathTemplate.match(versionName).version; - } - - /** - * 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.lintingServiceStub && !this._terminated) { - return this.lintingServiceStub.then(stub => { - this._terminated = true; - stub.close(); - this.locationsClient.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/owl-bot-staging/google-cloud-apihub/v1/src/v1/linting_service_client_config.json b/owl-bot-staging/google-cloud-apihub/v1/src/v1/linting_service_client_config.json deleted file mode 100644 index 83c20bac98a..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/src/v1/linting_service_client_config.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "interfaces": { - "google.cloud.apihub.v1.LintingService": { - "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": { - "GetStyleGuide": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "UpdateStyleGuide": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetStyleGuideContents": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "LintSpec": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-apihub/v1/src/v1/linting_service_proto_list.json b/owl-bot-staging/google-cloud-apihub/v1/src/v1/linting_service_proto_list.json deleted file mode 100644 index 07e987f7fb3..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/src/v1/linting_service_proto_list.json +++ /dev/null @@ -1,9 +0,0 @@ -[ - "../../protos/google/cloud/apihub/v1/apihub_service.proto", - "../../protos/google/cloud/apihub/v1/common_fields.proto", - "../../protos/google/cloud/apihub/v1/host_project_registration_service.proto", - "../../protos/google/cloud/apihub/v1/linting_service.proto", - "../../protos/google/cloud/apihub/v1/plugin_service.proto", - "../../protos/google/cloud/apihub/v1/provisioning_service.proto", - "../../protos/google/cloud/apihub/v1/runtime_project_attachment_service.proto" -] diff --git a/owl-bot-staging/google-cloud-apihub/v1/src/v1/provisioning_client.ts b/owl-bot-staging/google-cloud-apihub/v1/src/v1/provisioning_client.ts deleted file mode 100644 index 6bed4d9bb76..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/src/v1/provisioning_client.ts +++ /dev/null @@ -1,1767 +0,0 @@ -// Copyright 2024 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, LocationsClient, LocationProtos} from 'google-gax'; - -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); - -/** - * Client JSON configuration object, loaded from - * `src/v1/provisioning_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './provisioning_client_config.json'; -const version = require('../../../package.json').version; - -/** - * This service is used for managing the data plane provisioning of the API hub. - * @class - * @memberof v1 - */ -export class ProvisioningClient { - 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}; - private _universeDomain: string; - private _servicePath: string; - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - locationsClient: LocationsClient; - pathTemplates: {[name: string]: gax.PathTemplate}; - operationsClient: gax.OperationsClient; - provisioningStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of ProvisioningClient. - * - * @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 ProvisioningClient({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 ProvisioningClient; - if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { - throw new Error('Please set either universe_domain or universeDomain, but not both.'); - } - const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; - this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; - this._servicePath = 'apihub.' + this._universeDomain; - const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; - this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); - const port = opts?.port || staticMembers.port; - const clientConfig = opts?.clientConfig ?? {}; - // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). - if (!opts) { - opts = {fallback: true}; - } else { - opts.fallback = opts.fallback ?? true; - } - 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 !== this._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 = this._servicePath; - - // Set the default scopes in auth client if needed. - if (servicePath === this._servicePath) { - this.auth.defaultScopes = staticMembers.scopes; - } - 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 === 'object' && '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 = { - apiPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apis/{api}' - ), - apiHubInstancePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apiHubInstances/{api_hub_instance}' - ), - apiOperationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}' - ), - attributePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/attributes/{attribute}' - ), - definitionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}' - ), - dependencyPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/dependencies/{dependency}' - ), - deploymentPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/deployments/{deployment}' - ), - externalApiPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/externalApis/{external_api}' - ), - hostProjectRegistrationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/hostProjectRegistrations/{host_project_registration}' - ), - locationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}' - ), - pluginPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/plugins/{plugin}' - ), - projectPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}' - ), - runtimeProjectAttachmentPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}' - ), - specPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}' - ), - styleGuidePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/plugins/{plugin}/styleGuide' - ), - versionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apis/{api}/versions/{version}' - ), - }; - - 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.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 createApiHubInstanceResponse = protoFilesRoot.lookup( - '.google.cloud.apihub.v1.ApiHubInstance') as gax.protobuf.Type; - const createApiHubInstanceMetadata = protoFilesRoot.lookup( - '.google.cloud.apihub.v1.OperationMetadata') as gax.protobuf.Type; - - this.descriptors.longrunning = { - createApiHubInstance: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - createApiHubInstanceResponse.decode.bind(createApiHubInstanceResponse), - createApiHubInstanceMetadata.decode.bind(createApiHubInstanceMetadata)) - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.apihub.v1.Provisioning', 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.provisioningStub) { - return this.provisioningStub; - } - - // Put together the "service stub" for - // google.cloud.apihub.v1.Provisioning. - this.provisioningStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.apihub.v1.Provisioning') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.apihub.v1.Provisioning, - 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 provisioningStubMethods = - ['createApiHubInstance', 'getApiHubInstance', 'lookupApiHubInstance']; - for (const methodName of provisioningStubMethods) { - const callPromise = this.provisioningStub.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.longrunning[methodName] || - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor, - this._opts.fallback - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.provisioningStub; - } - - /** - * The DNS address for this API service. - * @deprecated Use the apiEndpoint method of the client instance. - * @returns {string} The DNS address for this service. - */ - static get servicePath() { - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); - } - return 'apihub.googleapis.com'; - } - - /** - * The DNS address for this API service - same as servicePath. - * @deprecated Use the apiEndpoint method of the client instance. - * @returns {string} The DNS address for this service. - */ - static get apiEndpoint() { - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); - } - return 'apihub.googleapis.com'; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - get apiEndpoint() { - return this._servicePath; - } - - get universeDomain() { - return this._universeDomain; - } - - /** - * 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 API Hub instance. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the Api Hub instance to retrieve. - * Format: - * `projects/{project}/locations/{location}/apiHubInstances/{apiHubInstance}`. - * @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.apihub.v1.ApiHubInstance|ApiHubInstance}. - * 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/provisioning.get_api_hub_instance.js - * region_tag:apihub_v1_generated_Provisioning_GetApiHubInstance_async - */ - getApiHubInstance( - request?: protos.google.cloud.apihub.v1.IGetApiHubInstanceRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apihub.v1.IApiHubInstance, - protos.google.cloud.apihub.v1.IGetApiHubInstanceRequest|undefined, {}|undefined - ]>; - getApiHubInstance( - request: protos.google.cloud.apihub.v1.IGetApiHubInstanceRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.apihub.v1.IApiHubInstance, - protos.google.cloud.apihub.v1.IGetApiHubInstanceRequest|null|undefined, - {}|null|undefined>): void; - getApiHubInstance( - request: protos.google.cloud.apihub.v1.IGetApiHubInstanceRequest, - callback: Callback< - protos.google.cloud.apihub.v1.IApiHubInstance, - protos.google.cloud.apihub.v1.IGetApiHubInstanceRequest|null|undefined, - {}|null|undefined>): void; - getApiHubInstance( - request?: protos.google.cloud.apihub.v1.IGetApiHubInstanceRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.apihub.v1.IApiHubInstance, - protos.google.cloud.apihub.v1.IGetApiHubInstanceRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.apihub.v1.IApiHubInstance, - protos.google.cloud.apihub.v1.IGetApiHubInstanceRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.apihub.v1.IApiHubInstance, - protos.google.cloud.apihub.v1.IGetApiHubInstanceRequest|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.getApiHubInstance(request, options, callback); - } -/** - * Looks up an Api Hub instance in a given GCP project. There will always be - * only one Api Hub instance for a GCP project across all locations. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. There will always be only one Api Hub instance for a GCP project - * across all locations. - * The parent resource for the Api Hub instance resource. - * Format: `projects/{project}/locations/{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 protos.google.cloud.apihub.v1.LookupApiHubInstanceResponse|LookupApiHubInstanceResponse}. - * 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/provisioning.lookup_api_hub_instance.js - * region_tag:apihub_v1_generated_Provisioning_LookupApiHubInstance_async - */ - lookupApiHubInstance( - request?: protos.google.cloud.apihub.v1.ILookupApiHubInstanceRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apihub.v1.ILookupApiHubInstanceResponse, - protos.google.cloud.apihub.v1.ILookupApiHubInstanceRequest|undefined, {}|undefined - ]>; - lookupApiHubInstance( - request: protos.google.cloud.apihub.v1.ILookupApiHubInstanceRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.apihub.v1.ILookupApiHubInstanceResponse, - protos.google.cloud.apihub.v1.ILookupApiHubInstanceRequest|null|undefined, - {}|null|undefined>): void; - lookupApiHubInstance( - request: protos.google.cloud.apihub.v1.ILookupApiHubInstanceRequest, - callback: Callback< - protos.google.cloud.apihub.v1.ILookupApiHubInstanceResponse, - protos.google.cloud.apihub.v1.ILookupApiHubInstanceRequest|null|undefined, - {}|null|undefined>): void; - lookupApiHubInstance( - request?: protos.google.cloud.apihub.v1.ILookupApiHubInstanceRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.apihub.v1.ILookupApiHubInstanceResponse, - protos.google.cloud.apihub.v1.ILookupApiHubInstanceRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.apihub.v1.ILookupApiHubInstanceResponse, - protos.google.cloud.apihub.v1.ILookupApiHubInstanceRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.apihub.v1.ILookupApiHubInstanceResponse, - protos.google.cloud.apihub.v1.ILookupApiHubInstanceRequest|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.lookupApiHubInstance(request, options, callback); - } - -/** - * Provisions instance resources for the API Hub. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource for the Api Hub instance resource. - * Format: `projects/{project}/locations/{location}` - * @param {string} [request.apiHubInstanceId] - * Optional. Identifier to assign to the Api Hub instance. Must be unique - * within scope of the parent resource. If the field is not provided, system - * generated id will be used. - * - * This value should be 4-40 characters, and valid characters - * are `/{@link protos.A-Z|a-z}[0-9]-_/`. - * @param {google.cloud.apihub.v1.ApiHubInstance} request.apiHubInstance - * Required. The ApiHub instance. - * @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/provisioning.create_api_hub_instance.js - * region_tag:apihub_v1_generated_Provisioning_CreateApiHubInstance_async - */ - createApiHubInstance( - request?: protos.google.cloud.apihub.v1.ICreateApiHubInstanceRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - createApiHubInstance( - request: protos.google.cloud.apihub.v1.ICreateApiHubInstanceRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createApiHubInstance( - request: protos.google.cloud.apihub.v1.ICreateApiHubInstanceRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createApiHubInstance( - request?: protos.google.cloud.apihub.v1.ICreateApiHubInstanceRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - 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.createApiHubInstance(request, options, callback); - } -/** - * Check the status of the long running operation returned by `createApiHubInstance()`. - * @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/provisioning.create_api_hub_instance.js - * region_tag:apihub_v1_generated_Provisioning_CreateApiHubInstance_async - */ - async checkCreateApiHubInstanceProgress(name: string): Promise>{ - 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.createApiHubInstance, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * 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 api resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} api - * @returns {string} Resource name string. - */ - apiPath(project:string,location:string,api:string) { - return this.pathTemplates.apiPathTemplate.render({ - project: project, - location: location, - api: api, - }); - } - - /** - * Parse the project from Api resource. - * - * @param {string} apiName - * A fully-qualified path representing Api resource. - * @returns {string} A string representing the project. - */ - matchProjectFromApiName(apiName: string) { - return this.pathTemplates.apiPathTemplate.match(apiName).project; - } - - /** - * Parse the location from Api resource. - * - * @param {string} apiName - * A fully-qualified path representing Api resource. - * @returns {string} A string representing the location. - */ - matchLocationFromApiName(apiName: string) { - return this.pathTemplates.apiPathTemplate.match(apiName).location; - } - - /** - * Parse the api from Api resource. - * - * @param {string} apiName - * A fully-qualified path representing Api resource. - * @returns {string} A string representing the api. - */ - matchApiFromApiName(apiName: string) { - return this.pathTemplates.apiPathTemplate.match(apiName).api; - } - - /** - * Return a fully-qualified apiHubInstance resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} api_hub_instance - * @returns {string} Resource name string. - */ - apiHubInstancePath(project:string,location:string,apiHubInstance:string) { - return this.pathTemplates.apiHubInstancePathTemplate.render({ - project: project, - location: location, - api_hub_instance: apiHubInstance, - }); - } - - /** - * Parse the project from ApiHubInstance resource. - * - * @param {string} apiHubInstanceName - * A fully-qualified path representing ApiHubInstance resource. - * @returns {string} A string representing the project. - */ - matchProjectFromApiHubInstanceName(apiHubInstanceName: string) { - return this.pathTemplates.apiHubInstancePathTemplate.match(apiHubInstanceName).project; - } - - /** - * Parse the location from ApiHubInstance resource. - * - * @param {string} apiHubInstanceName - * A fully-qualified path representing ApiHubInstance resource. - * @returns {string} A string representing the location. - */ - matchLocationFromApiHubInstanceName(apiHubInstanceName: string) { - return this.pathTemplates.apiHubInstancePathTemplate.match(apiHubInstanceName).location; - } - - /** - * Parse the api_hub_instance from ApiHubInstance resource. - * - * @param {string} apiHubInstanceName - * A fully-qualified path representing ApiHubInstance resource. - * @returns {string} A string representing the api_hub_instance. - */ - matchApiHubInstanceFromApiHubInstanceName(apiHubInstanceName: string) { - return this.pathTemplates.apiHubInstancePathTemplate.match(apiHubInstanceName).api_hub_instance; - } - - /** - * Return a fully-qualified apiOperation resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} api - * @param {string} version - * @param {string} operation - * @returns {string} Resource name string. - */ - apiOperationPath(project:string,location:string,api:string,version:string,operation:string) { - return this.pathTemplates.apiOperationPathTemplate.render({ - project: project, - location: location, - api: api, - version: version, - operation: operation, - }); - } - - /** - * Parse the project from ApiOperation resource. - * - * @param {string} apiOperationName - * A fully-qualified path representing ApiOperation resource. - * @returns {string} A string representing the project. - */ - matchProjectFromApiOperationName(apiOperationName: string) { - return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).project; - } - - /** - * Parse the location from ApiOperation resource. - * - * @param {string} apiOperationName - * A fully-qualified path representing ApiOperation resource. - * @returns {string} A string representing the location. - */ - matchLocationFromApiOperationName(apiOperationName: string) { - return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).location; - } - - /** - * Parse the api from ApiOperation resource. - * - * @param {string} apiOperationName - * A fully-qualified path representing ApiOperation resource. - * @returns {string} A string representing the api. - */ - matchApiFromApiOperationName(apiOperationName: string) { - return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).api; - } - - /** - * Parse the version from ApiOperation resource. - * - * @param {string} apiOperationName - * A fully-qualified path representing ApiOperation resource. - * @returns {string} A string representing the version. - */ - matchVersionFromApiOperationName(apiOperationName: string) { - return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).version; - } - - /** - * Parse the operation from ApiOperation resource. - * - * @param {string} apiOperationName - * A fully-qualified path representing ApiOperation resource. - * @returns {string} A string representing the operation. - */ - matchOperationFromApiOperationName(apiOperationName: string) { - return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).operation; - } - - /** - * Return a fully-qualified attribute resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} attribute - * @returns {string} Resource name string. - */ - attributePath(project:string,location:string,attribute:string) { - return this.pathTemplates.attributePathTemplate.render({ - project: project, - location: location, - attribute: attribute, - }); - } - - /** - * Parse the project from Attribute resource. - * - * @param {string} attributeName - * A fully-qualified path representing Attribute resource. - * @returns {string} A string representing the project. - */ - matchProjectFromAttributeName(attributeName: string) { - return this.pathTemplates.attributePathTemplate.match(attributeName).project; - } - - /** - * Parse the location from Attribute resource. - * - * @param {string} attributeName - * A fully-qualified path representing Attribute resource. - * @returns {string} A string representing the location. - */ - matchLocationFromAttributeName(attributeName: string) { - return this.pathTemplates.attributePathTemplate.match(attributeName).location; - } - - /** - * Parse the attribute from Attribute resource. - * - * @param {string} attributeName - * A fully-qualified path representing Attribute resource. - * @returns {string} A string representing the attribute. - */ - matchAttributeFromAttributeName(attributeName: string) { - return this.pathTemplates.attributePathTemplate.match(attributeName).attribute; - } - - /** - * Return a fully-qualified definition resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} api - * @param {string} version - * @param {string} definition - * @returns {string} Resource name string. - */ - definitionPath(project:string,location:string,api:string,version:string,definition:string) { - return this.pathTemplates.definitionPathTemplate.render({ - project: project, - location: location, - api: api, - version: version, - definition: definition, - }); - } - - /** - * Parse the project from Definition resource. - * - * @param {string} definitionName - * A fully-qualified path representing Definition resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDefinitionName(definitionName: string) { - return this.pathTemplates.definitionPathTemplate.match(definitionName).project; - } - - /** - * Parse the location from Definition resource. - * - * @param {string} definitionName - * A fully-qualified path representing Definition resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDefinitionName(definitionName: string) { - return this.pathTemplates.definitionPathTemplate.match(definitionName).location; - } - - /** - * Parse the api from Definition resource. - * - * @param {string} definitionName - * A fully-qualified path representing Definition resource. - * @returns {string} A string representing the api. - */ - matchApiFromDefinitionName(definitionName: string) { - return this.pathTemplates.definitionPathTemplate.match(definitionName).api; - } - - /** - * Parse the version from Definition resource. - * - * @param {string} definitionName - * A fully-qualified path representing Definition resource. - * @returns {string} A string representing the version. - */ - matchVersionFromDefinitionName(definitionName: string) { - return this.pathTemplates.definitionPathTemplate.match(definitionName).version; - } - - /** - * Parse the definition from Definition resource. - * - * @param {string} definitionName - * A fully-qualified path representing Definition resource. - * @returns {string} A string representing the definition. - */ - matchDefinitionFromDefinitionName(definitionName: string) { - return this.pathTemplates.definitionPathTemplate.match(definitionName).definition; - } - - /** - * Return a fully-qualified dependency resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dependency - * @returns {string} Resource name string. - */ - dependencyPath(project:string,location:string,dependency:string) { - return this.pathTemplates.dependencyPathTemplate.render({ - project: project, - location: location, - dependency: dependency, - }); - } - - /** - * Parse the project from Dependency resource. - * - * @param {string} dependencyName - * A fully-qualified path representing Dependency resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDependencyName(dependencyName: string) { - return this.pathTemplates.dependencyPathTemplate.match(dependencyName).project; - } - - /** - * Parse the location from Dependency resource. - * - * @param {string} dependencyName - * A fully-qualified path representing Dependency resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDependencyName(dependencyName: string) { - return this.pathTemplates.dependencyPathTemplate.match(dependencyName).location; - } - - /** - * Parse the dependency from Dependency resource. - * - * @param {string} dependencyName - * A fully-qualified path representing Dependency resource. - * @returns {string} A string representing the dependency. - */ - matchDependencyFromDependencyName(dependencyName: string) { - return this.pathTemplates.dependencyPathTemplate.match(dependencyName).dependency; - } - - /** - * Return a fully-qualified deployment resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} deployment - * @returns {string} Resource name string. - */ - deploymentPath(project:string,location:string,deployment:string) { - return this.pathTemplates.deploymentPathTemplate.render({ - project: project, - location: location, - deployment: deployment, - }); - } - - /** - * Parse the project from Deployment resource. - * - * @param {string} deploymentName - * A fully-qualified path representing Deployment resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDeploymentName(deploymentName: string) { - return this.pathTemplates.deploymentPathTemplate.match(deploymentName).project; - } - - /** - * Parse the location from Deployment resource. - * - * @param {string} deploymentName - * A fully-qualified path representing Deployment resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDeploymentName(deploymentName: string) { - return this.pathTemplates.deploymentPathTemplate.match(deploymentName).location; - } - - /** - * Parse the deployment from Deployment resource. - * - * @param {string} deploymentName - * A fully-qualified path representing Deployment resource. - * @returns {string} A string representing the deployment. - */ - matchDeploymentFromDeploymentName(deploymentName: string) { - return this.pathTemplates.deploymentPathTemplate.match(deploymentName).deployment; - } - - /** - * Return a fully-qualified externalApi resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} external_api - * @returns {string} Resource name string. - */ - externalApiPath(project:string,location:string,externalApi:string) { - return this.pathTemplates.externalApiPathTemplate.render({ - project: project, - location: location, - external_api: externalApi, - }); - } - - /** - * Parse the project from ExternalApi resource. - * - * @param {string} externalApiName - * A fully-qualified path representing ExternalApi resource. - * @returns {string} A string representing the project. - */ - matchProjectFromExternalApiName(externalApiName: string) { - return this.pathTemplates.externalApiPathTemplate.match(externalApiName).project; - } - - /** - * Parse the location from ExternalApi resource. - * - * @param {string} externalApiName - * A fully-qualified path representing ExternalApi resource. - * @returns {string} A string representing the location. - */ - matchLocationFromExternalApiName(externalApiName: string) { - return this.pathTemplates.externalApiPathTemplate.match(externalApiName).location; - } - - /** - * Parse the external_api from ExternalApi resource. - * - * @param {string} externalApiName - * A fully-qualified path representing ExternalApi resource. - * @returns {string} A string representing the external_api. - */ - matchExternalApiFromExternalApiName(externalApiName: string) { - return this.pathTemplates.externalApiPathTemplate.match(externalApiName).external_api; - } - - /** - * Return a fully-qualified hostProjectRegistration resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} host_project_registration - * @returns {string} Resource name string. - */ - hostProjectRegistrationPath(project:string,location:string,hostProjectRegistration:string) { - return this.pathTemplates.hostProjectRegistrationPathTemplate.render({ - project: project, - location: location, - host_project_registration: hostProjectRegistration, - }); - } - - /** - * Parse the project from HostProjectRegistration resource. - * - * @param {string} hostProjectRegistrationName - * A fully-qualified path representing HostProjectRegistration resource. - * @returns {string} A string representing the project. - */ - matchProjectFromHostProjectRegistrationName(hostProjectRegistrationName: string) { - return this.pathTemplates.hostProjectRegistrationPathTemplate.match(hostProjectRegistrationName).project; - } - - /** - * Parse the location from HostProjectRegistration resource. - * - * @param {string} hostProjectRegistrationName - * A fully-qualified path representing HostProjectRegistration resource. - * @returns {string} A string representing the location. - */ - matchLocationFromHostProjectRegistrationName(hostProjectRegistrationName: string) { - return this.pathTemplates.hostProjectRegistrationPathTemplate.match(hostProjectRegistrationName).location; - } - - /** - * Parse the host_project_registration from HostProjectRegistration resource. - * - * @param {string} hostProjectRegistrationName - * A fully-qualified path representing HostProjectRegistration resource. - * @returns {string} A string representing the host_project_registration. - */ - matchHostProjectRegistrationFromHostProjectRegistrationName(hostProjectRegistrationName: string) { - return this.pathTemplates.hostProjectRegistrationPathTemplate.match(hostProjectRegistrationName).host_project_registration; - } - - /** - * Return a fully-qualified location resource name string. - * - * @param {string} project - * @param {string} location - * @returns {string} Resource name string. - */ - locationPath(project:string,location:string) { - return this.pathTemplates.locationPathTemplate.render({ - project: project, - location: location, - }); - } - - /** - * Parse the project from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the project. - */ - matchProjectFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).project; - } - - /** - * Parse the location from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the location. - */ - matchLocationFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).location; - } - - /** - * Return a fully-qualified plugin resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} plugin - * @returns {string} Resource name string. - */ - pluginPath(project:string,location:string,plugin:string) { - return this.pathTemplates.pluginPathTemplate.render({ - project: project, - location: location, - plugin: plugin, - }); - } - - /** - * Parse the project from Plugin resource. - * - * @param {string} pluginName - * A fully-qualified path representing Plugin resource. - * @returns {string} A string representing the project. - */ - matchProjectFromPluginName(pluginName: string) { - return this.pathTemplates.pluginPathTemplate.match(pluginName).project; - } - - /** - * Parse the location from Plugin resource. - * - * @param {string} pluginName - * A fully-qualified path representing Plugin resource. - * @returns {string} A string representing the location. - */ - matchLocationFromPluginName(pluginName: string) { - return this.pathTemplates.pluginPathTemplate.match(pluginName).location; - } - - /** - * Parse the plugin from Plugin resource. - * - * @param {string} pluginName - * A fully-qualified path representing Plugin resource. - * @returns {string} A string representing the plugin. - */ - matchPluginFromPluginName(pluginName: string) { - return this.pathTemplates.pluginPathTemplate.match(pluginName).plugin; - } - - /** - * Return a fully-qualified project resource name string. - * - * @param {string} project - * @returns {string} Resource name string. - */ - projectPath(project:string) { - return this.pathTemplates.projectPathTemplate.render({ - project: project, - }); - } - - /** - * Parse the project from Project resource. - * - * @param {string} projectName - * A fully-qualified path representing Project resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectName(projectName: string) { - return this.pathTemplates.projectPathTemplate.match(projectName).project; - } - - /** - * Return a fully-qualified runtimeProjectAttachment resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} runtime_project_attachment - * @returns {string} Resource name string. - */ - runtimeProjectAttachmentPath(project:string,location:string,runtimeProjectAttachment:string) { - return this.pathTemplates.runtimeProjectAttachmentPathTemplate.render({ - project: project, - location: location, - runtime_project_attachment: runtimeProjectAttachment, - }); - } - - /** - * Parse the project from RuntimeProjectAttachment resource. - * - * @param {string} runtimeProjectAttachmentName - * A fully-qualified path representing RuntimeProjectAttachment resource. - * @returns {string} A string representing the project. - */ - matchProjectFromRuntimeProjectAttachmentName(runtimeProjectAttachmentName: string) { - return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match(runtimeProjectAttachmentName).project; - } - - /** - * Parse the location from RuntimeProjectAttachment resource. - * - * @param {string} runtimeProjectAttachmentName - * A fully-qualified path representing RuntimeProjectAttachment resource. - * @returns {string} A string representing the location. - */ - matchLocationFromRuntimeProjectAttachmentName(runtimeProjectAttachmentName: string) { - return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match(runtimeProjectAttachmentName).location; - } - - /** - * Parse the runtime_project_attachment from RuntimeProjectAttachment resource. - * - * @param {string} runtimeProjectAttachmentName - * A fully-qualified path representing RuntimeProjectAttachment resource. - * @returns {string} A string representing the runtime_project_attachment. - */ - matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName(runtimeProjectAttachmentName: string) { - return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match(runtimeProjectAttachmentName).runtime_project_attachment; - } - - /** - * Return a fully-qualified spec resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} api - * @param {string} version - * @param {string} spec - * @returns {string} Resource name string. - */ - specPath(project:string,location:string,api:string,version:string,spec:string) { - return this.pathTemplates.specPathTemplate.render({ - project: project, - location: location, - api: api, - version: version, - spec: spec, - }); - } - - /** - * Parse the project from Spec resource. - * - * @param {string} specName - * A fully-qualified path representing Spec resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSpecName(specName: string) { - return this.pathTemplates.specPathTemplate.match(specName).project; - } - - /** - * Parse the location from Spec resource. - * - * @param {string} specName - * A fully-qualified path representing Spec resource. - * @returns {string} A string representing the location. - */ - matchLocationFromSpecName(specName: string) { - return this.pathTemplates.specPathTemplate.match(specName).location; - } - - /** - * Parse the api from Spec resource. - * - * @param {string} specName - * A fully-qualified path representing Spec resource. - * @returns {string} A string representing the api. - */ - matchApiFromSpecName(specName: string) { - return this.pathTemplates.specPathTemplate.match(specName).api; - } - - /** - * Parse the version from Spec resource. - * - * @param {string} specName - * A fully-qualified path representing Spec resource. - * @returns {string} A string representing the version. - */ - matchVersionFromSpecName(specName: string) { - return this.pathTemplates.specPathTemplate.match(specName).version; - } - - /** - * Parse the spec from Spec resource. - * - * @param {string} specName - * A fully-qualified path representing Spec resource. - * @returns {string} A string representing the spec. - */ - matchSpecFromSpecName(specName: string) { - return this.pathTemplates.specPathTemplate.match(specName).spec; - } - - /** - * Return a fully-qualified styleGuide resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} plugin - * @returns {string} Resource name string. - */ - styleGuidePath(project:string,location:string,plugin:string) { - return this.pathTemplates.styleGuidePathTemplate.render({ - project: project, - location: location, - plugin: plugin, - }); - } - - /** - * Parse the project from StyleGuide resource. - * - * @param {string} styleGuideName - * A fully-qualified path representing StyleGuide resource. - * @returns {string} A string representing the project. - */ - matchProjectFromStyleGuideName(styleGuideName: string) { - return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName).project; - } - - /** - * Parse the location from StyleGuide resource. - * - * @param {string} styleGuideName - * A fully-qualified path representing StyleGuide resource. - * @returns {string} A string representing the location. - */ - matchLocationFromStyleGuideName(styleGuideName: string) { - return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName).location; - } - - /** - * Parse the plugin from StyleGuide resource. - * - * @param {string} styleGuideName - * A fully-qualified path representing StyleGuide resource. - * @returns {string} A string representing the plugin. - */ - matchPluginFromStyleGuideName(styleGuideName: string) { - return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName).plugin; - } - - /** - * Return a fully-qualified version resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} api - * @param {string} version - * @returns {string} Resource name string. - */ - versionPath(project:string,location:string,api:string,version:string) { - return this.pathTemplates.versionPathTemplate.render({ - project: project, - location: location, - api: api, - version: version, - }); - } - - /** - * Parse the project from Version resource. - * - * @param {string} versionName - * A fully-qualified path representing Version resource. - * @returns {string} A string representing the project. - */ - matchProjectFromVersionName(versionName: string) { - return this.pathTemplates.versionPathTemplate.match(versionName).project; - } - - /** - * Parse the location from Version resource. - * - * @param {string} versionName - * A fully-qualified path representing Version resource. - * @returns {string} A string representing the location. - */ - matchLocationFromVersionName(versionName: string) { - return this.pathTemplates.versionPathTemplate.match(versionName).location; - } - - /** - * Parse the api from Version resource. - * - * @param {string} versionName - * A fully-qualified path representing Version resource. - * @returns {string} A string representing the api. - */ - matchApiFromVersionName(versionName: string) { - return this.pathTemplates.versionPathTemplate.match(versionName).api; - } - - /** - * Parse the version from Version resource. - * - * @param {string} versionName - * A fully-qualified path representing Version resource. - * @returns {string} A string representing the version. - */ - matchVersionFromVersionName(versionName: string) { - return this.pathTemplates.versionPathTemplate.match(versionName).version; - } - - /** - * 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.provisioningStub && !this._terminated) { - return this.provisioningStub.then(stub => { - this._terminated = true; - stub.close(); - this.locationsClient.close(); - this.operationsClient.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/owl-bot-staging/google-cloud-apihub/v1/src/v1/provisioning_client_config.json b/owl-bot-staging/google-cloud-apihub/v1/src/v1/provisioning_client_config.json deleted file mode 100644 index 828739a1214..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/src/v1/provisioning_client_config.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "interfaces": { - "google.cloud.apihub.v1.Provisioning": { - "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": { - "CreateApiHubInstance": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetApiHubInstance": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "LookupApiHubInstance": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-apihub/v1/src/v1/provisioning_proto_list.json b/owl-bot-staging/google-cloud-apihub/v1/src/v1/provisioning_proto_list.json deleted file mode 100644 index 07e987f7fb3..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/src/v1/provisioning_proto_list.json +++ /dev/null @@ -1,9 +0,0 @@ -[ - "../../protos/google/cloud/apihub/v1/apihub_service.proto", - "../../protos/google/cloud/apihub/v1/common_fields.proto", - "../../protos/google/cloud/apihub/v1/host_project_registration_service.proto", - "../../protos/google/cloud/apihub/v1/linting_service.proto", - "../../protos/google/cloud/apihub/v1/plugin_service.proto", - "../../protos/google/cloud/apihub/v1/provisioning_service.proto", - "../../protos/google/cloud/apihub/v1/runtime_project_attachment_service.proto" -] diff --git a/owl-bot-staging/google-cloud-apihub/v1/src/v1/runtime_project_attachment_service_client.ts b/owl-bot-staging/google-cloud-apihub/v1/src/v1/runtime_project_attachment_service_client.ts deleted file mode 100644 index 0593b85e83e..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/src/v1/runtime_project_attachment_service_client.ts +++ /dev/null @@ -1,1881 +0,0 @@ -// Copyright 2024 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, PaginationCallback, GaxCall, 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/runtime_project_attachment_service_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './runtime_project_attachment_service_client_config.json'; -const version = require('../../../package.json').version; - -/** - * This service is used for managing the runtime project attachments. - * @class - * @memberof v1 - */ -export class RuntimeProjectAttachmentServiceClient { - 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}; - private _universeDomain: string; - private _servicePath: string; - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - locationsClient: LocationsClient; - pathTemplates: {[name: string]: gax.PathTemplate}; - runtimeProjectAttachmentServiceStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of RuntimeProjectAttachmentServiceClient. - * - * @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 RuntimeProjectAttachmentServiceClient({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 RuntimeProjectAttachmentServiceClient; - if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { - throw new Error('Please set either universe_domain or universeDomain, but not both.'); - } - const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; - this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; - this._servicePath = 'apihub.' + this._universeDomain; - const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; - this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); - const port = opts?.port || staticMembers.port; - const clientConfig = opts?.clientConfig ?? {}; - // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). - if (!opts) { - opts = {fallback: true}; - } else { - opts.fallback = opts.fallback ?? true; - } - 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 !== this._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 = this._servicePath; - - // Set the default scopes in auth client if needed. - if (servicePath === this._servicePath) { - this.auth.defaultScopes = staticMembers.scopes; - } - 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 === 'object' && '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 = { - apiPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apis/{api}' - ), - apiHubInstancePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apiHubInstances/{api_hub_instance}' - ), - apiOperationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}' - ), - attributePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/attributes/{attribute}' - ), - definitionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}' - ), - dependencyPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/dependencies/{dependency}' - ), - deploymentPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/deployments/{deployment}' - ), - externalApiPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/externalApis/{external_api}' - ), - hostProjectRegistrationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/hostProjectRegistrations/{host_project_registration}' - ), - locationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}' - ), - pluginPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/plugins/{plugin}' - ), - projectPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}' - ), - runtimeProjectAttachmentPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}' - ), - specPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}' - ), - styleGuidePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/plugins/{plugin}/styleGuide' - ), - versionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apis/{api}/versions/{version}' - ), - }; - - // 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 = { - listRuntimeProjectAttachments: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'runtimeProjectAttachments') - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.apihub.v1.RuntimeProjectAttachmentService', 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.runtimeProjectAttachmentServiceStub) { - return this.runtimeProjectAttachmentServiceStub; - } - - // Put together the "service stub" for - // google.cloud.apihub.v1.RuntimeProjectAttachmentService. - this.runtimeProjectAttachmentServiceStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.apihub.v1.RuntimeProjectAttachmentService') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.apihub.v1.RuntimeProjectAttachmentService, - 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 runtimeProjectAttachmentServiceStubMethods = - ['createRuntimeProjectAttachment', 'getRuntimeProjectAttachment', 'listRuntimeProjectAttachments', 'deleteRuntimeProjectAttachment', 'lookupRuntimeProjectAttachment']; - for (const methodName of runtimeProjectAttachmentServiceStubMethods) { - const callPromise = this.runtimeProjectAttachmentServiceStub.then( - stub => (...args: Array<{}>) => { - if (this._terminated) { - return Promise.reject('The client has already been closed.'); - } - const func = stub[methodName]; - return func.apply(stub, args); - }, - (err: Error|null|undefined) => () => { - throw err; - }); - - const descriptor = - this.descriptors.page[methodName] || - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor, - this._opts.fallback - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.runtimeProjectAttachmentServiceStub; - } - - /** - * The DNS address for this API service. - * @deprecated Use the apiEndpoint method of the client instance. - * @returns {string} The DNS address for this service. - */ - static get servicePath() { - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); - } - return 'apihub.googleapis.com'; - } - - /** - * The DNS address for this API service - same as servicePath. - * @deprecated Use the apiEndpoint method of the client instance. - * @returns {string} The DNS address for this service. - */ - static get apiEndpoint() { - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); - } - return 'apihub.googleapis.com'; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - get apiEndpoint() { - return this._servicePath; - } - - get universeDomain() { - return this._universeDomain; - } - - /** - * 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 -- - // ------------------- -/** - * Attaches a runtime project to the host project. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource for the Runtime Project Attachment. - * Format: `projects/{project}/locations/{location}` - * @param {string} request.runtimeProjectAttachmentId - * Required. The ID to use for the Runtime Project Attachment, which will - * become the final component of the Runtime Project Attachment's name. The ID - * must be the same as the project ID of the Google cloud project specified in - * the runtime_project_attachment.runtime_project field. - * @param {google.cloud.apihub.v1.RuntimeProjectAttachment} request.runtimeProjectAttachment - * Required. The Runtime Project Attachment to create. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.apihub.v1.RuntimeProjectAttachment|RuntimeProjectAttachment}. - * 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/runtime_project_attachment_service.create_runtime_project_attachment.js - * region_tag:apihub_v1_generated_RuntimeProjectAttachmentService_CreateRuntimeProjectAttachment_async - */ - createRuntimeProjectAttachment( - request?: protos.google.cloud.apihub.v1.ICreateRuntimeProjectAttachmentRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apihub.v1.IRuntimeProjectAttachment, - protos.google.cloud.apihub.v1.ICreateRuntimeProjectAttachmentRequest|undefined, {}|undefined - ]>; - createRuntimeProjectAttachment( - request: protos.google.cloud.apihub.v1.ICreateRuntimeProjectAttachmentRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.apihub.v1.IRuntimeProjectAttachment, - protos.google.cloud.apihub.v1.ICreateRuntimeProjectAttachmentRequest|null|undefined, - {}|null|undefined>): void; - createRuntimeProjectAttachment( - request: protos.google.cloud.apihub.v1.ICreateRuntimeProjectAttachmentRequest, - callback: Callback< - protos.google.cloud.apihub.v1.IRuntimeProjectAttachment, - protos.google.cloud.apihub.v1.ICreateRuntimeProjectAttachmentRequest|null|undefined, - {}|null|undefined>): void; - createRuntimeProjectAttachment( - request?: protos.google.cloud.apihub.v1.ICreateRuntimeProjectAttachmentRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.apihub.v1.IRuntimeProjectAttachment, - protos.google.cloud.apihub.v1.ICreateRuntimeProjectAttachmentRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.apihub.v1.IRuntimeProjectAttachment, - protos.google.cloud.apihub.v1.ICreateRuntimeProjectAttachmentRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.apihub.v1.IRuntimeProjectAttachment, - protos.google.cloud.apihub.v1.ICreateRuntimeProjectAttachmentRequest|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.createRuntimeProjectAttachment(request, options, callback); - } -/** - * Gets a runtime project attachment. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the API resource to retrieve. - * Format: - * `projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}` - * @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.apihub.v1.RuntimeProjectAttachment|RuntimeProjectAttachment}. - * 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/runtime_project_attachment_service.get_runtime_project_attachment.js - * region_tag:apihub_v1_generated_RuntimeProjectAttachmentService_GetRuntimeProjectAttachment_async - */ - getRuntimeProjectAttachment( - request?: protos.google.cloud.apihub.v1.IGetRuntimeProjectAttachmentRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apihub.v1.IRuntimeProjectAttachment, - protos.google.cloud.apihub.v1.IGetRuntimeProjectAttachmentRequest|undefined, {}|undefined - ]>; - getRuntimeProjectAttachment( - request: protos.google.cloud.apihub.v1.IGetRuntimeProjectAttachmentRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.apihub.v1.IRuntimeProjectAttachment, - protos.google.cloud.apihub.v1.IGetRuntimeProjectAttachmentRequest|null|undefined, - {}|null|undefined>): void; - getRuntimeProjectAttachment( - request: protos.google.cloud.apihub.v1.IGetRuntimeProjectAttachmentRequest, - callback: Callback< - protos.google.cloud.apihub.v1.IRuntimeProjectAttachment, - protos.google.cloud.apihub.v1.IGetRuntimeProjectAttachmentRequest|null|undefined, - {}|null|undefined>): void; - getRuntimeProjectAttachment( - request?: protos.google.cloud.apihub.v1.IGetRuntimeProjectAttachmentRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.apihub.v1.IRuntimeProjectAttachment, - protos.google.cloud.apihub.v1.IGetRuntimeProjectAttachmentRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.apihub.v1.IRuntimeProjectAttachment, - protos.google.cloud.apihub.v1.IGetRuntimeProjectAttachmentRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.apihub.v1.IRuntimeProjectAttachment, - protos.google.cloud.apihub.v1.IGetRuntimeProjectAttachmentRequest|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.getRuntimeProjectAttachment(request, options, callback); - } -/** - * Delete a runtime project attachment in the API Hub. This call will detach - * the runtime project from the host project. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the Runtime Project Attachment to delete. - * Format: - * `projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}` - * @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.protobuf.Empty|Empty}. - * 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/runtime_project_attachment_service.delete_runtime_project_attachment.js - * region_tag:apihub_v1_generated_RuntimeProjectAttachmentService_DeleteRuntimeProjectAttachment_async - */ - deleteRuntimeProjectAttachment( - request?: protos.google.cloud.apihub.v1.IDeleteRuntimeProjectAttachmentRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.IDeleteRuntimeProjectAttachmentRequest|undefined, {}|undefined - ]>; - deleteRuntimeProjectAttachment( - request: protos.google.cloud.apihub.v1.IDeleteRuntimeProjectAttachmentRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.IDeleteRuntimeProjectAttachmentRequest|null|undefined, - {}|null|undefined>): void; - deleteRuntimeProjectAttachment( - request: protos.google.cloud.apihub.v1.IDeleteRuntimeProjectAttachmentRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.IDeleteRuntimeProjectAttachmentRequest|null|undefined, - {}|null|undefined>): void; - deleteRuntimeProjectAttachment( - request?: protos.google.cloud.apihub.v1.IDeleteRuntimeProjectAttachmentRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.IDeleteRuntimeProjectAttachmentRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.IDeleteRuntimeProjectAttachmentRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.apihub.v1.IDeleteRuntimeProjectAttachmentRequest|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.deleteRuntimeProjectAttachment(request, options, callback); - } -/** - * Look up a runtime project attachment. This API can be called in the context - * of any project. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Runtime project ID to look up runtime project attachment for. - * Lookup happens across all regions. Expected format: - * `projects/{project}/locations/{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 protos.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse|LookupRuntimeProjectAttachmentResponse}. - * 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/runtime_project_attachment_service.lookup_runtime_project_attachment.js - * region_tag:apihub_v1_generated_RuntimeProjectAttachmentService_LookupRuntimeProjectAttachment_async - */ - lookupRuntimeProjectAttachment( - request?: protos.google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentResponse, - protos.google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentRequest|undefined, {}|undefined - ]>; - lookupRuntimeProjectAttachment( - request: protos.google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentResponse, - protos.google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentRequest|null|undefined, - {}|null|undefined>): void; - lookupRuntimeProjectAttachment( - request: protos.google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentRequest, - callback: Callback< - protos.google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentResponse, - protos.google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentRequest|null|undefined, - {}|null|undefined>): void; - lookupRuntimeProjectAttachment( - request?: protos.google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentResponse, - protos.google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentResponse, - protos.google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentResponse, - protos.google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentRequest|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.lookupRuntimeProjectAttachment(request, options, callback); - } - - /** - * List runtime projects attached to the host project. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent, which owns this collection of runtime project - * attachments. Format: `projects/{project}/locations/{location}` - * @param {number} [request.pageSize] - * Optional. The maximum number of runtime project attachments to return. The - * service may return fewer than this value. If unspecified, at most 50 - * runtime project attachments will be returned. The maximum value is 1000; - * values above 1000 will be coerced to 1000. - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous - * `ListRuntimeProjectAttachments` call. Provide this to retrieve the - * subsequent page. - * - * When paginating, all other parameters (except page_size) provided to - * `ListRuntimeProjectAttachments` must match the call that provided the page - * token. - * @param {string} [request.filter] - * Optional. An expression that filters the list of RuntimeProjectAttachments. - * - * A filter expression consists of a field name, a comparison - * operator, and a value for filtering. The value must be a string. All - * standard operators as documented at https://google.aip.dev/160 are - * supported. - * - * The following fields in the `RuntimeProjectAttachment` are eligible for - * filtering: - * - * * `name` - The name of the RuntimeProjectAttachment. - * * `create_time` - The time at which the RuntimeProjectAttachment was - * created. The value should be in the - * (RFC3339)[https://tools.ietf.org/html/rfc3339] format. - * * `runtime_project` - The Google cloud project associated with the - * RuntimeProjectAttachment. - * @param {string} [request.orderBy] - * Optional. Hint for how to order the results. - * @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.apihub.v1.RuntimeProjectAttachment|RuntimeProjectAttachment}. - * 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 `listRuntimeProjectAttachmentsAsync()` - * 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. - */ - listRuntimeProjectAttachments( - request?: protos.google.cloud.apihub.v1.IListRuntimeProjectAttachmentsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apihub.v1.IRuntimeProjectAttachment[], - protos.google.cloud.apihub.v1.IListRuntimeProjectAttachmentsRequest|null, - protos.google.cloud.apihub.v1.IListRuntimeProjectAttachmentsResponse - ]>; - listRuntimeProjectAttachments( - request: protos.google.cloud.apihub.v1.IListRuntimeProjectAttachmentsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.apihub.v1.IListRuntimeProjectAttachmentsRequest, - protos.google.cloud.apihub.v1.IListRuntimeProjectAttachmentsResponse|null|undefined, - protos.google.cloud.apihub.v1.IRuntimeProjectAttachment>): void; - listRuntimeProjectAttachments( - request: protos.google.cloud.apihub.v1.IListRuntimeProjectAttachmentsRequest, - callback: PaginationCallback< - protos.google.cloud.apihub.v1.IListRuntimeProjectAttachmentsRequest, - protos.google.cloud.apihub.v1.IListRuntimeProjectAttachmentsResponse|null|undefined, - protos.google.cloud.apihub.v1.IRuntimeProjectAttachment>): void; - listRuntimeProjectAttachments( - request?: protos.google.cloud.apihub.v1.IListRuntimeProjectAttachmentsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.apihub.v1.IListRuntimeProjectAttachmentsRequest, - protos.google.cloud.apihub.v1.IListRuntimeProjectAttachmentsResponse|null|undefined, - protos.google.cloud.apihub.v1.IRuntimeProjectAttachment>, - callback?: PaginationCallback< - protos.google.cloud.apihub.v1.IListRuntimeProjectAttachmentsRequest, - protos.google.cloud.apihub.v1.IListRuntimeProjectAttachmentsResponse|null|undefined, - protos.google.cloud.apihub.v1.IRuntimeProjectAttachment>): - Promise<[ - protos.google.cloud.apihub.v1.IRuntimeProjectAttachment[], - protos.google.cloud.apihub.v1.IListRuntimeProjectAttachmentsRequest|null, - protos.google.cloud.apihub.v1.IListRuntimeProjectAttachmentsResponse - ]>|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.listRuntimeProjectAttachments(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent, which owns this collection of runtime project - * attachments. Format: `projects/{project}/locations/{location}` - * @param {number} [request.pageSize] - * Optional. The maximum number of runtime project attachments to return. The - * service may return fewer than this value. If unspecified, at most 50 - * runtime project attachments will be returned. The maximum value is 1000; - * values above 1000 will be coerced to 1000. - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous - * `ListRuntimeProjectAttachments` call. Provide this to retrieve the - * subsequent page. - * - * When paginating, all other parameters (except page_size) provided to - * `ListRuntimeProjectAttachments` must match the call that provided the page - * token. - * @param {string} [request.filter] - * Optional. An expression that filters the list of RuntimeProjectAttachments. - * - * A filter expression consists of a field name, a comparison - * operator, and a value for filtering. The value must be a string. All - * standard operators as documented at https://google.aip.dev/160 are - * supported. - * - * The following fields in the `RuntimeProjectAttachment` are eligible for - * filtering: - * - * * `name` - The name of the RuntimeProjectAttachment. - * * `create_time` - The time at which the RuntimeProjectAttachment was - * created. The value should be in the - * (RFC3339)[https://tools.ietf.org/html/rfc3339] format. - * * `runtime_project` - The Google cloud project associated with the - * RuntimeProjectAttachment. - * @param {string} [request.orderBy] - * Optional. Hint for how to order the results. - * @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.apihub.v1.RuntimeProjectAttachment|RuntimeProjectAttachment} 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 `listRuntimeProjectAttachmentsAsync()` - * 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. - */ - listRuntimeProjectAttachmentsStream( - request?: protos.google.cloud.apihub.v1.IListRuntimeProjectAttachmentsRequest, - 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['listRuntimeProjectAttachments']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listRuntimeProjectAttachments.createStream( - this.innerApiCalls.listRuntimeProjectAttachments as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listRuntimeProjectAttachments`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent, which owns this collection of runtime project - * attachments. Format: `projects/{project}/locations/{location}` - * @param {number} [request.pageSize] - * Optional. The maximum number of runtime project attachments to return. The - * service may return fewer than this value. If unspecified, at most 50 - * runtime project attachments will be returned. The maximum value is 1000; - * values above 1000 will be coerced to 1000. - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous - * `ListRuntimeProjectAttachments` call. Provide this to retrieve the - * subsequent page. - * - * When paginating, all other parameters (except page_size) provided to - * `ListRuntimeProjectAttachments` must match the call that provided the page - * token. - * @param {string} [request.filter] - * Optional. An expression that filters the list of RuntimeProjectAttachments. - * - * A filter expression consists of a field name, a comparison - * operator, and a value for filtering. The value must be a string. All - * standard operators as documented at https://google.aip.dev/160 are - * supported. - * - * The following fields in the `RuntimeProjectAttachment` are eligible for - * filtering: - * - * * `name` - The name of the RuntimeProjectAttachment. - * * `create_time` - The time at which the RuntimeProjectAttachment was - * created. The value should be in the - * (RFC3339)[https://tools.ietf.org/html/rfc3339] format. - * * `runtime_project` - The Google cloud project associated with the - * RuntimeProjectAttachment. - * @param {string} [request.orderBy] - * Optional. Hint for how to order the results. - * @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.apihub.v1.RuntimeProjectAttachment|RuntimeProjectAttachment}. 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/runtime_project_attachment_service.list_runtime_project_attachments.js - * region_tag:apihub_v1_generated_RuntimeProjectAttachmentService_ListRuntimeProjectAttachments_async - */ - listRuntimeProjectAttachmentsAsync( - request?: protos.google.cloud.apihub.v1.IListRuntimeProjectAttachmentsRequest, - 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['listRuntimeProjectAttachments']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listRuntimeProjectAttachments.asyncIterate( - this.innerApiCalls['listRuntimeProjectAttachments'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } -/** - * 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); - } - - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified api resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} api - * @returns {string} Resource name string. - */ - apiPath(project:string,location:string,api:string) { - return this.pathTemplates.apiPathTemplate.render({ - project: project, - location: location, - api: api, - }); - } - - /** - * Parse the project from Api resource. - * - * @param {string} apiName - * A fully-qualified path representing Api resource. - * @returns {string} A string representing the project. - */ - matchProjectFromApiName(apiName: string) { - return this.pathTemplates.apiPathTemplate.match(apiName).project; - } - - /** - * Parse the location from Api resource. - * - * @param {string} apiName - * A fully-qualified path representing Api resource. - * @returns {string} A string representing the location. - */ - matchLocationFromApiName(apiName: string) { - return this.pathTemplates.apiPathTemplate.match(apiName).location; - } - - /** - * Parse the api from Api resource. - * - * @param {string} apiName - * A fully-qualified path representing Api resource. - * @returns {string} A string representing the api. - */ - matchApiFromApiName(apiName: string) { - return this.pathTemplates.apiPathTemplate.match(apiName).api; - } - - /** - * Return a fully-qualified apiHubInstance resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} api_hub_instance - * @returns {string} Resource name string. - */ - apiHubInstancePath(project:string,location:string,apiHubInstance:string) { - return this.pathTemplates.apiHubInstancePathTemplate.render({ - project: project, - location: location, - api_hub_instance: apiHubInstance, - }); - } - - /** - * Parse the project from ApiHubInstance resource. - * - * @param {string} apiHubInstanceName - * A fully-qualified path representing ApiHubInstance resource. - * @returns {string} A string representing the project. - */ - matchProjectFromApiHubInstanceName(apiHubInstanceName: string) { - return this.pathTemplates.apiHubInstancePathTemplate.match(apiHubInstanceName).project; - } - - /** - * Parse the location from ApiHubInstance resource. - * - * @param {string} apiHubInstanceName - * A fully-qualified path representing ApiHubInstance resource. - * @returns {string} A string representing the location. - */ - matchLocationFromApiHubInstanceName(apiHubInstanceName: string) { - return this.pathTemplates.apiHubInstancePathTemplate.match(apiHubInstanceName).location; - } - - /** - * Parse the api_hub_instance from ApiHubInstance resource. - * - * @param {string} apiHubInstanceName - * A fully-qualified path representing ApiHubInstance resource. - * @returns {string} A string representing the api_hub_instance. - */ - matchApiHubInstanceFromApiHubInstanceName(apiHubInstanceName: string) { - return this.pathTemplates.apiHubInstancePathTemplate.match(apiHubInstanceName).api_hub_instance; - } - - /** - * Return a fully-qualified apiOperation resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} api - * @param {string} version - * @param {string} operation - * @returns {string} Resource name string. - */ - apiOperationPath(project:string,location:string,api:string,version:string,operation:string) { - return this.pathTemplates.apiOperationPathTemplate.render({ - project: project, - location: location, - api: api, - version: version, - operation: operation, - }); - } - - /** - * Parse the project from ApiOperation resource. - * - * @param {string} apiOperationName - * A fully-qualified path representing ApiOperation resource. - * @returns {string} A string representing the project. - */ - matchProjectFromApiOperationName(apiOperationName: string) { - return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).project; - } - - /** - * Parse the location from ApiOperation resource. - * - * @param {string} apiOperationName - * A fully-qualified path representing ApiOperation resource. - * @returns {string} A string representing the location. - */ - matchLocationFromApiOperationName(apiOperationName: string) { - return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).location; - } - - /** - * Parse the api from ApiOperation resource. - * - * @param {string} apiOperationName - * A fully-qualified path representing ApiOperation resource. - * @returns {string} A string representing the api. - */ - matchApiFromApiOperationName(apiOperationName: string) { - return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).api; - } - - /** - * Parse the version from ApiOperation resource. - * - * @param {string} apiOperationName - * A fully-qualified path representing ApiOperation resource. - * @returns {string} A string representing the version. - */ - matchVersionFromApiOperationName(apiOperationName: string) { - return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).version; - } - - /** - * Parse the operation from ApiOperation resource. - * - * @param {string} apiOperationName - * A fully-qualified path representing ApiOperation resource. - * @returns {string} A string representing the operation. - */ - matchOperationFromApiOperationName(apiOperationName: string) { - return this.pathTemplates.apiOperationPathTemplate.match(apiOperationName).operation; - } - - /** - * Return a fully-qualified attribute resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} attribute - * @returns {string} Resource name string. - */ - attributePath(project:string,location:string,attribute:string) { - return this.pathTemplates.attributePathTemplate.render({ - project: project, - location: location, - attribute: attribute, - }); - } - - /** - * Parse the project from Attribute resource. - * - * @param {string} attributeName - * A fully-qualified path representing Attribute resource. - * @returns {string} A string representing the project. - */ - matchProjectFromAttributeName(attributeName: string) { - return this.pathTemplates.attributePathTemplate.match(attributeName).project; - } - - /** - * Parse the location from Attribute resource. - * - * @param {string} attributeName - * A fully-qualified path representing Attribute resource. - * @returns {string} A string representing the location. - */ - matchLocationFromAttributeName(attributeName: string) { - return this.pathTemplates.attributePathTemplate.match(attributeName).location; - } - - /** - * Parse the attribute from Attribute resource. - * - * @param {string} attributeName - * A fully-qualified path representing Attribute resource. - * @returns {string} A string representing the attribute. - */ - matchAttributeFromAttributeName(attributeName: string) { - return this.pathTemplates.attributePathTemplate.match(attributeName).attribute; - } - - /** - * Return a fully-qualified definition resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} api - * @param {string} version - * @param {string} definition - * @returns {string} Resource name string. - */ - definitionPath(project:string,location:string,api:string,version:string,definition:string) { - return this.pathTemplates.definitionPathTemplate.render({ - project: project, - location: location, - api: api, - version: version, - definition: definition, - }); - } - - /** - * Parse the project from Definition resource. - * - * @param {string} definitionName - * A fully-qualified path representing Definition resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDefinitionName(definitionName: string) { - return this.pathTemplates.definitionPathTemplate.match(definitionName).project; - } - - /** - * Parse the location from Definition resource. - * - * @param {string} definitionName - * A fully-qualified path representing Definition resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDefinitionName(definitionName: string) { - return this.pathTemplates.definitionPathTemplate.match(definitionName).location; - } - - /** - * Parse the api from Definition resource. - * - * @param {string} definitionName - * A fully-qualified path representing Definition resource. - * @returns {string} A string representing the api. - */ - matchApiFromDefinitionName(definitionName: string) { - return this.pathTemplates.definitionPathTemplate.match(definitionName).api; - } - - /** - * Parse the version from Definition resource. - * - * @param {string} definitionName - * A fully-qualified path representing Definition resource. - * @returns {string} A string representing the version. - */ - matchVersionFromDefinitionName(definitionName: string) { - return this.pathTemplates.definitionPathTemplate.match(definitionName).version; - } - - /** - * Parse the definition from Definition resource. - * - * @param {string} definitionName - * A fully-qualified path representing Definition resource. - * @returns {string} A string representing the definition. - */ - matchDefinitionFromDefinitionName(definitionName: string) { - return this.pathTemplates.definitionPathTemplate.match(definitionName).definition; - } - - /** - * Return a fully-qualified dependency resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dependency - * @returns {string} Resource name string. - */ - dependencyPath(project:string,location:string,dependency:string) { - return this.pathTemplates.dependencyPathTemplate.render({ - project: project, - location: location, - dependency: dependency, - }); - } - - /** - * Parse the project from Dependency resource. - * - * @param {string} dependencyName - * A fully-qualified path representing Dependency resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDependencyName(dependencyName: string) { - return this.pathTemplates.dependencyPathTemplate.match(dependencyName).project; - } - - /** - * Parse the location from Dependency resource. - * - * @param {string} dependencyName - * A fully-qualified path representing Dependency resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDependencyName(dependencyName: string) { - return this.pathTemplates.dependencyPathTemplate.match(dependencyName).location; - } - - /** - * Parse the dependency from Dependency resource. - * - * @param {string} dependencyName - * A fully-qualified path representing Dependency resource. - * @returns {string} A string representing the dependency. - */ - matchDependencyFromDependencyName(dependencyName: string) { - return this.pathTemplates.dependencyPathTemplate.match(dependencyName).dependency; - } - - /** - * Return a fully-qualified deployment resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} deployment - * @returns {string} Resource name string. - */ - deploymentPath(project:string,location:string,deployment:string) { - return this.pathTemplates.deploymentPathTemplate.render({ - project: project, - location: location, - deployment: deployment, - }); - } - - /** - * Parse the project from Deployment resource. - * - * @param {string} deploymentName - * A fully-qualified path representing Deployment resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDeploymentName(deploymentName: string) { - return this.pathTemplates.deploymentPathTemplate.match(deploymentName).project; - } - - /** - * Parse the location from Deployment resource. - * - * @param {string} deploymentName - * A fully-qualified path representing Deployment resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDeploymentName(deploymentName: string) { - return this.pathTemplates.deploymentPathTemplate.match(deploymentName).location; - } - - /** - * Parse the deployment from Deployment resource. - * - * @param {string} deploymentName - * A fully-qualified path representing Deployment resource. - * @returns {string} A string representing the deployment. - */ - matchDeploymentFromDeploymentName(deploymentName: string) { - return this.pathTemplates.deploymentPathTemplate.match(deploymentName).deployment; - } - - /** - * Return a fully-qualified externalApi resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} external_api - * @returns {string} Resource name string. - */ - externalApiPath(project:string,location:string,externalApi:string) { - return this.pathTemplates.externalApiPathTemplate.render({ - project: project, - location: location, - external_api: externalApi, - }); - } - - /** - * Parse the project from ExternalApi resource. - * - * @param {string} externalApiName - * A fully-qualified path representing ExternalApi resource. - * @returns {string} A string representing the project. - */ - matchProjectFromExternalApiName(externalApiName: string) { - return this.pathTemplates.externalApiPathTemplate.match(externalApiName).project; - } - - /** - * Parse the location from ExternalApi resource. - * - * @param {string} externalApiName - * A fully-qualified path representing ExternalApi resource. - * @returns {string} A string representing the location. - */ - matchLocationFromExternalApiName(externalApiName: string) { - return this.pathTemplates.externalApiPathTemplate.match(externalApiName).location; - } - - /** - * Parse the external_api from ExternalApi resource. - * - * @param {string} externalApiName - * A fully-qualified path representing ExternalApi resource. - * @returns {string} A string representing the external_api. - */ - matchExternalApiFromExternalApiName(externalApiName: string) { - return this.pathTemplates.externalApiPathTemplate.match(externalApiName).external_api; - } - - /** - * Return a fully-qualified hostProjectRegistration resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} host_project_registration - * @returns {string} Resource name string. - */ - hostProjectRegistrationPath(project:string,location:string,hostProjectRegistration:string) { - return this.pathTemplates.hostProjectRegistrationPathTemplate.render({ - project: project, - location: location, - host_project_registration: hostProjectRegistration, - }); - } - - /** - * Parse the project from HostProjectRegistration resource. - * - * @param {string} hostProjectRegistrationName - * A fully-qualified path representing HostProjectRegistration resource. - * @returns {string} A string representing the project. - */ - matchProjectFromHostProjectRegistrationName(hostProjectRegistrationName: string) { - return this.pathTemplates.hostProjectRegistrationPathTemplate.match(hostProjectRegistrationName).project; - } - - /** - * Parse the location from HostProjectRegistration resource. - * - * @param {string} hostProjectRegistrationName - * A fully-qualified path representing HostProjectRegistration resource. - * @returns {string} A string representing the location. - */ - matchLocationFromHostProjectRegistrationName(hostProjectRegistrationName: string) { - return this.pathTemplates.hostProjectRegistrationPathTemplate.match(hostProjectRegistrationName).location; - } - - /** - * Parse the host_project_registration from HostProjectRegistration resource. - * - * @param {string} hostProjectRegistrationName - * A fully-qualified path representing HostProjectRegistration resource. - * @returns {string} A string representing the host_project_registration. - */ - matchHostProjectRegistrationFromHostProjectRegistrationName(hostProjectRegistrationName: string) { - return this.pathTemplates.hostProjectRegistrationPathTemplate.match(hostProjectRegistrationName).host_project_registration; - } - - /** - * Return a fully-qualified location resource name string. - * - * @param {string} project - * @param {string} location - * @returns {string} Resource name string. - */ - locationPath(project:string,location:string) { - return this.pathTemplates.locationPathTemplate.render({ - project: project, - location: location, - }); - } - - /** - * Parse the project from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the project. - */ - matchProjectFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).project; - } - - /** - * Parse the location from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the location. - */ - matchLocationFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).location; - } - - /** - * Return a fully-qualified plugin resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} plugin - * @returns {string} Resource name string. - */ - pluginPath(project:string,location:string,plugin:string) { - return this.pathTemplates.pluginPathTemplate.render({ - project: project, - location: location, - plugin: plugin, - }); - } - - /** - * Parse the project from Plugin resource. - * - * @param {string} pluginName - * A fully-qualified path representing Plugin resource. - * @returns {string} A string representing the project. - */ - matchProjectFromPluginName(pluginName: string) { - return this.pathTemplates.pluginPathTemplate.match(pluginName).project; - } - - /** - * Parse the location from Plugin resource. - * - * @param {string} pluginName - * A fully-qualified path representing Plugin resource. - * @returns {string} A string representing the location. - */ - matchLocationFromPluginName(pluginName: string) { - return this.pathTemplates.pluginPathTemplate.match(pluginName).location; - } - - /** - * Parse the plugin from Plugin resource. - * - * @param {string} pluginName - * A fully-qualified path representing Plugin resource. - * @returns {string} A string representing the plugin. - */ - matchPluginFromPluginName(pluginName: string) { - return this.pathTemplates.pluginPathTemplate.match(pluginName).plugin; - } - - /** - * Return a fully-qualified project resource name string. - * - * @param {string} project - * @returns {string} Resource name string. - */ - projectPath(project:string) { - return this.pathTemplates.projectPathTemplate.render({ - project: project, - }); - } - - /** - * Parse the project from Project resource. - * - * @param {string} projectName - * A fully-qualified path representing Project resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectName(projectName: string) { - return this.pathTemplates.projectPathTemplate.match(projectName).project; - } - - /** - * Return a fully-qualified runtimeProjectAttachment resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} runtime_project_attachment - * @returns {string} Resource name string. - */ - runtimeProjectAttachmentPath(project:string,location:string,runtimeProjectAttachment:string) { - return this.pathTemplates.runtimeProjectAttachmentPathTemplate.render({ - project: project, - location: location, - runtime_project_attachment: runtimeProjectAttachment, - }); - } - - /** - * Parse the project from RuntimeProjectAttachment resource. - * - * @param {string} runtimeProjectAttachmentName - * A fully-qualified path representing RuntimeProjectAttachment resource. - * @returns {string} A string representing the project. - */ - matchProjectFromRuntimeProjectAttachmentName(runtimeProjectAttachmentName: string) { - return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match(runtimeProjectAttachmentName).project; - } - - /** - * Parse the location from RuntimeProjectAttachment resource. - * - * @param {string} runtimeProjectAttachmentName - * A fully-qualified path representing RuntimeProjectAttachment resource. - * @returns {string} A string representing the location. - */ - matchLocationFromRuntimeProjectAttachmentName(runtimeProjectAttachmentName: string) { - return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match(runtimeProjectAttachmentName).location; - } - - /** - * Parse the runtime_project_attachment from RuntimeProjectAttachment resource. - * - * @param {string} runtimeProjectAttachmentName - * A fully-qualified path representing RuntimeProjectAttachment resource. - * @returns {string} A string representing the runtime_project_attachment. - */ - matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName(runtimeProjectAttachmentName: string) { - return this.pathTemplates.runtimeProjectAttachmentPathTemplate.match(runtimeProjectAttachmentName).runtime_project_attachment; - } - - /** - * Return a fully-qualified spec resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} api - * @param {string} version - * @param {string} spec - * @returns {string} Resource name string. - */ - specPath(project:string,location:string,api:string,version:string,spec:string) { - return this.pathTemplates.specPathTemplate.render({ - project: project, - location: location, - api: api, - version: version, - spec: spec, - }); - } - - /** - * Parse the project from Spec resource. - * - * @param {string} specName - * A fully-qualified path representing Spec resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSpecName(specName: string) { - return this.pathTemplates.specPathTemplate.match(specName).project; - } - - /** - * Parse the location from Spec resource. - * - * @param {string} specName - * A fully-qualified path representing Spec resource. - * @returns {string} A string representing the location. - */ - matchLocationFromSpecName(specName: string) { - return this.pathTemplates.specPathTemplate.match(specName).location; - } - - /** - * Parse the api from Spec resource. - * - * @param {string} specName - * A fully-qualified path representing Spec resource. - * @returns {string} A string representing the api. - */ - matchApiFromSpecName(specName: string) { - return this.pathTemplates.specPathTemplate.match(specName).api; - } - - /** - * Parse the version from Spec resource. - * - * @param {string} specName - * A fully-qualified path representing Spec resource. - * @returns {string} A string representing the version. - */ - matchVersionFromSpecName(specName: string) { - return this.pathTemplates.specPathTemplate.match(specName).version; - } - - /** - * Parse the spec from Spec resource. - * - * @param {string} specName - * A fully-qualified path representing Spec resource. - * @returns {string} A string representing the spec. - */ - matchSpecFromSpecName(specName: string) { - return this.pathTemplates.specPathTemplate.match(specName).spec; - } - - /** - * Return a fully-qualified styleGuide resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} plugin - * @returns {string} Resource name string. - */ - styleGuidePath(project:string,location:string,plugin:string) { - return this.pathTemplates.styleGuidePathTemplate.render({ - project: project, - location: location, - plugin: plugin, - }); - } - - /** - * Parse the project from StyleGuide resource. - * - * @param {string} styleGuideName - * A fully-qualified path representing StyleGuide resource. - * @returns {string} A string representing the project. - */ - matchProjectFromStyleGuideName(styleGuideName: string) { - return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName).project; - } - - /** - * Parse the location from StyleGuide resource. - * - * @param {string} styleGuideName - * A fully-qualified path representing StyleGuide resource. - * @returns {string} A string representing the location. - */ - matchLocationFromStyleGuideName(styleGuideName: string) { - return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName).location; - } - - /** - * Parse the plugin from StyleGuide resource. - * - * @param {string} styleGuideName - * A fully-qualified path representing StyleGuide resource. - * @returns {string} A string representing the plugin. - */ - matchPluginFromStyleGuideName(styleGuideName: string) { - return this.pathTemplates.styleGuidePathTemplate.match(styleGuideName).plugin; - } - - /** - * Return a fully-qualified version resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} api - * @param {string} version - * @returns {string} Resource name string. - */ - versionPath(project:string,location:string,api:string,version:string) { - return this.pathTemplates.versionPathTemplate.render({ - project: project, - location: location, - api: api, - version: version, - }); - } - - /** - * Parse the project from Version resource. - * - * @param {string} versionName - * A fully-qualified path representing Version resource. - * @returns {string} A string representing the project. - */ - matchProjectFromVersionName(versionName: string) { - return this.pathTemplates.versionPathTemplate.match(versionName).project; - } - - /** - * Parse the location from Version resource. - * - * @param {string} versionName - * A fully-qualified path representing Version resource. - * @returns {string} A string representing the location. - */ - matchLocationFromVersionName(versionName: string) { - return this.pathTemplates.versionPathTemplate.match(versionName).location; - } - - /** - * Parse the api from Version resource. - * - * @param {string} versionName - * A fully-qualified path representing Version resource. - * @returns {string} A string representing the api. - */ - matchApiFromVersionName(versionName: string) { - return this.pathTemplates.versionPathTemplate.match(versionName).api; - } - - /** - * Parse the version from Version resource. - * - * @param {string} versionName - * A fully-qualified path representing Version resource. - * @returns {string} A string representing the version. - */ - matchVersionFromVersionName(versionName: string) { - return this.pathTemplates.versionPathTemplate.match(versionName).version; - } - - /** - * 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.runtimeProjectAttachmentServiceStub && !this._terminated) { - return this.runtimeProjectAttachmentServiceStub.then(stub => { - this._terminated = true; - stub.close(); - this.locationsClient.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/owl-bot-staging/google-cloud-apihub/v1/src/v1/runtime_project_attachment_service_client_config.json b/owl-bot-staging/google-cloud-apihub/v1/src/v1/runtime_project_attachment_service_client_config.json deleted file mode 100644 index fd774c04498..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/src/v1/runtime_project_attachment_service_client_config.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "interfaces": { - "google.cloud.apihub.v1.RuntimeProjectAttachmentService": { - "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": { - "CreateRuntimeProjectAttachment": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetRuntimeProjectAttachment": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "ListRuntimeProjectAttachments": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "DeleteRuntimeProjectAttachment": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "LookupRuntimeProjectAttachment": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-apihub/v1/src/v1/runtime_project_attachment_service_proto_list.json b/owl-bot-staging/google-cloud-apihub/v1/src/v1/runtime_project_attachment_service_proto_list.json deleted file mode 100644 index 07e987f7fb3..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/src/v1/runtime_project_attachment_service_proto_list.json +++ /dev/null @@ -1,9 +0,0 @@ -[ - "../../protos/google/cloud/apihub/v1/apihub_service.proto", - "../../protos/google/cloud/apihub/v1/common_fields.proto", - "../../protos/google/cloud/apihub/v1/host_project_registration_service.proto", - "../../protos/google/cloud/apihub/v1/linting_service.proto", - "../../protos/google/cloud/apihub/v1/plugin_service.proto", - "../../protos/google/cloud/apihub/v1/provisioning_service.proto", - "../../protos/google/cloud/apihub/v1/runtime_project_attachment_service.proto" -] diff --git a/owl-bot-staging/google-cloud-apihub/v1/system-test/fixtures/sample/src/index.js b/owl-bot-staging/google-cloud-apihub/v1/system-test/fixtures/sample/src/index.js deleted file mode 100644 index f0e98e48ab9..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/system-test/fixtures/sample/src/index.js +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2024 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 apihub = require('@google-cloud/apihub'); - -function main() { - const apiHubClient = new apihub.ApiHubClient(); - const apiHubDependenciesClient = new apihub.ApiHubDependenciesClient(); - const apiHubPluginClient = new apihub.ApiHubPluginClient(); - const hostProjectRegistrationServiceClient = new apihub.HostProjectRegistrationServiceClient(); - const lintingServiceClient = new apihub.LintingServiceClient(); - const provisioningClient = new apihub.ProvisioningClient(); - const runtimeProjectAttachmentServiceClient = new apihub.RuntimeProjectAttachmentServiceClient(); -} - -main(); diff --git a/owl-bot-staging/google-cloud-apihub/v1/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/google-cloud-apihub/v1/system-test/fixtures/sample/src/index.ts deleted file mode 100644 index 15cbcb831c6..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/system-test/fixtures/sample/src/index.ts +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright 2024 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 {ApiHubClient, ApiHubDependenciesClient, ApiHubPluginClient, HostProjectRegistrationServiceClient, LintingServiceClient, ProvisioningClient, RuntimeProjectAttachmentServiceClient} from '@google-cloud/apihub'; - -// check that the client class type name can be used -function doStuffWithApiHubClient(client: ApiHubClient) { - client.close(); -} -function doStuffWithApiHubDependenciesClient(client: ApiHubDependenciesClient) { - client.close(); -} -function doStuffWithApiHubPluginClient(client: ApiHubPluginClient) { - client.close(); -} -function doStuffWithHostProjectRegistrationServiceClient(client: HostProjectRegistrationServiceClient) { - client.close(); -} -function doStuffWithLintingServiceClient(client: LintingServiceClient) { - client.close(); -} -function doStuffWithProvisioningClient(client: ProvisioningClient) { - client.close(); -} -function doStuffWithRuntimeProjectAttachmentServiceClient(client: RuntimeProjectAttachmentServiceClient) { - client.close(); -} - -function main() { - // check that the client instance can be created - const apiHubClient = new ApiHubClient(); - doStuffWithApiHubClient(apiHubClient); - // check that the client instance can be created - const apiHubDependenciesClient = new ApiHubDependenciesClient(); - doStuffWithApiHubDependenciesClient(apiHubDependenciesClient); - // check that the client instance can be created - const apiHubPluginClient = new ApiHubPluginClient(); - doStuffWithApiHubPluginClient(apiHubPluginClient); - // check that the client instance can be created - const hostProjectRegistrationServiceClient = new HostProjectRegistrationServiceClient(); - doStuffWithHostProjectRegistrationServiceClient(hostProjectRegistrationServiceClient); - // check that the client instance can be created - const lintingServiceClient = new LintingServiceClient(); - doStuffWithLintingServiceClient(lintingServiceClient); - // check that the client instance can be created - const provisioningClient = new ProvisioningClient(); - doStuffWithProvisioningClient(provisioningClient); - // check that the client instance can be created - const runtimeProjectAttachmentServiceClient = new RuntimeProjectAttachmentServiceClient(); - doStuffWithRuntimeProjectAttachmentServiceClient(runtimeProjectAttachmentServiceClient); -} - -main(); diff --git a/owl-bot-staging/google-cloud-apihub/v1/system-test/install.ts b/owl-bot-staging/google-cloud-apihub/v1/system-test/install.ts deleted file mode 100644 index fd5bfdc71d5..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/system-test/install.ts +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2024 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/owl-bot-staging/google-cloud-apihub/v1/test/gapic_api_hub_dependencies_v1.ts b/owl-bot-staging/google-cloud-apihub/v1/test/gapic_api_hub_dependencies_v1.ts deleted file mode 100644 index b5b1fb6fa6a..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/test/gapic_api_hub_dependencies_v1.ts +++ /dev/null @@ -1,1890 +0,0 @@ -// Copyright 2024 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, beforeEach, afterEach} from 'mocha'; -import * as apihubdependenciesModule from '../src'; - -import {PassThrough} from 'stream'; - -import {GoogleAuth, protobuf, 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 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.ApiHubDependenciesClient', () => { - let googleAuth: GoogleAuth; - beforeEach(() => { - googleAuth = { - getClient: sinon.stub().resolves({ - getRequestHeaders: sinon.stub().resolves({Authorization: 'Bearer SOME_TOKEN'}), - }) - } as unknown as GoogleAuth; - }); - afterEach(() => { - sinon.restore(); - }); - describe('Common methods', () => { - it('has apiEndpoint', () => { - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient(); - const apiEndpoint = client.apiEndpoint; - assert.strictEqual(apiEndpoint, 'apihub.googleapis.com'); - }); - - it('has universeDomain', () => { - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient(); - const universeDomain = client.universeDomain; - assert.strictEqual(universeDomain, "googleapis.com"); - }); - - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - it('throws DeprecationWarning if static servicePath is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const servicePath = apihubdependenciesModule.v1.ApiHubDependenciesClient.servicePath; - assert.strictEqual(servicePath, 'apihub.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - - it('throws DeprecationWarning if static apiEndpoint is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const apiEndpoint = apihubdependenciesModule.v1.ApiHubDependenciesClient.apiEndpoint; - assert.strictEqual(apiEndpoint, 'apihub.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - } - it('sets apiEndpoint according to universe domain camelCase', () => { - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({universeDomain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'apihub.example.com'); - }); - - it('sets apiEndpoint according to universe domain snakeCase', () => { - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({universe_domain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'apihub.example.com'); - }); - - if (typeof process === 'object' && 'env' in process) { - describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { - it('sets apiEndpoint from environment variable', () => { - const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient(); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'apihub.example.com'); - if (saved) { - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; - } else { - delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - } - }); - - it('value configured in code has priority over environment variable', () => { - const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({universeDomain: 'configured.example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'apihub.configured.example.com'); - if (saved) { - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; - } else { - delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - } - }); - }); - } - it('does not allow setting both universeDomain and universe_domain', () => { - assert.throws(() => { new apihubdependenciesModule.v1.ApiHubDependenciesClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); - }); - - it('has port', () => { - const port = apihubdependenciesModule.v1.ApiHubDependenciesClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - auth: googleAuth, - projectId: 'bogus', - }); - assert.strictEqual(client.apiHubDependenciesStub, undefined); - await client.initialize(); - assert(client.apiHubDependenciesStub); - }); - - it('has close method for the initialized client', done => { - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - assert(client.apiHubDependenciesStub); - client.close().then(() => { - done(); - }); - }); - - it('has close method for the non-initialized client', done => { - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - auth: googleAuth, - projectId: 'bogus', - }); - assert.strictEqual(client.apiHubDependenciesStub, undefined); - client.close().then(() => { - done(); - }); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - auth: googleAuth, - 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 apihubdependenciesModule.v1.ApiHubDependenciesClient({ - auth: googleAuth, - 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('createDependency', () => { - it('invokes createDependency without error', async () => { - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.CreateDependencyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.CreateDependencyRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.Dependency() - ); - client.innerApiCalls.createDependency = stubSimpleCall(expectedResponse); - const [response] = await client.createDependency(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createDependency as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createDependency as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createDependency without error using callback', async () => { - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.CreateDependencyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.CreateDependencyRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.Dependency() - ); - client.innerApiCalls.createDependency = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createDependency( - request, - (err?: Error|null, result?: protos.google.cloud.apihub.v1.IDependency|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createDependency as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createDependency as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createDependency with error', async () => { - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.CreateDependencyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.CreateDependencyRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createDependency = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createDependency(request), expectedError); - const actualRequest = (client.innerApiCalls.createDependency as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createDependency as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createDependency with closed client', async () => { - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.CreateDependencyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.CreateDependencyRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createDependency(request), expectedError); - }); - }); - - describe('getDependency', () => { - it('invokes getDependency without error', async () => { - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetDependencyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetDependencyRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.Dependency() - ); - client.innerApiCalls.getDependency = stubSimpleCall(expectedResponse); - const [response] = await client.getDependency(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getDependency as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getDependency as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getDependency without error using callback', async () => { - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetDependencyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetDependencyRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.Dependency() - ); - client.innerApiCalls.getDependency = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getDependency( - request, - (err?: Error|null, result?: protos.google.cloud.apihub.v1.IDependency|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getDependency as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getDependency as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getDependency with error', async () => { - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetDependencyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetDependencyRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getDependency = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getDependency(request), expectedError); - const actualRequest = (client.innerApiCalls.getDependency as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getDependency as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getDependency with closed client', async () => { - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetDependencyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetDependencyRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getDependency(request), expectedError); - }); - }); - - describe('updateDependency', () => { - it('invokes updateDependency without error', async () => { - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.UpdateDependencyRequest() - ); - request.dependency ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.UpdateDependencyRequest', ['dependency', 'name']); - request.dependency.name = defaultValue1; - const expectedHeaderRequestParams = `dependency.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.Dependency() - ); - client.innerApiCalls.updateDependency = stubSimpleCall(expectedResponse); - const [response] = await client.updateDependency(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateDependency as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateDependency as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateDependency without error using callback', async () => { - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.UpdateDependencyRequest() - ); - request.dependency ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.UpdateDependencyRequest', ['dependency', 'name']); - request.dependency.name = defaultValue1; - const expectedHeaderRequestParams = `dependency.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.Dependency() - ); - client.innerApiCalls.updateDependency = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateDependency( - request, - (err?: Error|null, result?: protos.google.cloud.apihub.v1.IDependency|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateDependency as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateDependency as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateDependency with error', async () => { - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.UpdateDependencyRequest() - ); - request.dependency ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.UpdateDependencyRequest', ['dependency', 'name']); - request.dependency.name = defaultValue1; - const expectedHeaderRequestParams = `dependency.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateDependency = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateDependency(request), expectedError); - const actualRequest = (client.innerApiCalls.updateDependency as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateDependency as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateDependency with closed client', async () => { - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.UpdateDependencyRequest() - ); - request.dependency ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.UpdateDependencyRequest', ['dependency', 'name']); - request.dependency.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateDependency(request), expectedError); - }); - }); - - describe('deleteDependency', () => { - it('invokes deleteDependency without error', async () => { - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.DeleteDependencyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.DeleteDependencyRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteDependency = stubSimpleCall(expectedResponse); - const [response] = await client.deleteDependency(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteDependency as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteDependency as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteDependency without error using callback', async () => { - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.DeleteDependencyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.DeleteDependencyRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteDependency = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteDependency( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteDependency as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteDependency as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteDependency with error', async () => { - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.DeleteDependencyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.DeleteDependencyRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteDependency = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteDependency(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteDependency as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteDependency as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteDependency with closed client', async () => { - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.DeleteDependencyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.DeleteDependencyRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.deleteDependency(request), expectedError); - }); - }); - - describe('listDependencies', () => { - it('invokes listDependencies without error', async () => { - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListDependenciesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListDependenciesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apihub.v1.Dependency()), - generateSampleMessage(new protos.google.cloud.apihub.v1.Dependency()), - generateSampleMessage(new protos.google.cloud.apihub.v1.Dependency()), - ]; - client.innerApiCalls.listDependencies = stubSimpleCall(expectedResponse); - const [response] = await client.listDependencies(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listDependencies as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listDependencies as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listDependencies without error using callback', async () => { - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListDependenciesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListDependenciesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apihub.v1.Dependency()), - generateSampleMessage(new protos.google.cloud.apihub.v1.Dependency()), - generateSampleMessage(new protos.google.cloud.apihub.v1.Dependency()), - ]; - client.innerApiCalls.listDependencies = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listDependencies( - request, - (err?: Error|null, result?: protos.google.cloud.apihub.v1.IDependency[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listDependencies as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listDependencies as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listDependencies with error', async () => { - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListDependenciesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListDependenciesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listDependencies = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listDependencies(request), expectedError); - const actualRequest = (client.innerApiCalls.listDependencies as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listDependencies as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listDependenciesStream without error', async () => { - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListDependenciesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListDependenciesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apihub.v1.Dependency()), - generateSampleMessage(new protos.google.cloud.apihub.v1.Dependency()), - generateSampleMessage(new protos.google.cloud.apihub.v1.Dependency()), - ]; - client.descriptors.page.listDependencies.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listDependenciesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.apihub.v1.Dependency[] = []; - stream.on('data', (response: protos.google.cloud.apihub.v1.Dependency) => { - 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.listDependencies.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listDependencies, request)); - assert( - (client.descriptors.page.listDependencies.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listDependenciesStream with error', async () => { - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListDependenciesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListDependenciesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listDependencies.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listDependenciesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.apihub.v1.Dependency[] = []; - stream.on('data', (response: protos.google.cloud.apihub.v1.Dependency) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listDependencies.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listDependencies, request)); - assert( - (client.descriptors.page.listDependencies.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listDependencies without error', async () => { - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListDependenciesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListDependenciesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apihub.v1.Dependency()), - generateSampleMessage(new protos.google.cloud.apihub.v1.Dependency()), - generateSampleMessage(new protos.google.cloud.apihub.v1.Dependency()), - ]; - client.descriptors.page.listDependencies.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.apihub.v1.IDependency[] = []; - const iterable = client.listDependenciesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listDependencies.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listDependencies.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listDependencies with error', async () => { - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListDependenciesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListDependenciesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listDependencies.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listDependenciesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.apihub.v1.IDependency[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listDependencies.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listDependencies.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getLocation', () => { - it('invokes getLocation without error', async () => { - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - auth: googleAuth, - 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 apihubdependenciesModule.v1.ApiHubDependenciesClient({ - auth: googleAuth, - 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 apihubdependenciesModule.v1.ApiHubDependenciesClient({ - auth: googleAuth, - 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 apihubdependenciesModule.v1.ApiHubDependenciesClient({ - auth: googleAuth, - 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 apihubdependenciesModule.v1.ApiHubDependenciesClient({ - 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('Path templates', () => { - - describe('api', () => { - const fakePath = "/rendered/path/api"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - api: "apiValue", - }; - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.apiPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.apiPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('apiPath', () => { - const result = client.apiPath("projectValue", "locationValue", "apiValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.apiPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromApiName', () => { - const result = client.matchProjectFromApiName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.apiPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromApiName', () => { - const result = client.matchLocationFromApiName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.apiPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchApiFromApiName', () => { - const result = client.matchApiFromApiName(fakePath); - assert.strictEqual(result, "apiValue"); - assert((client.pathTemplates.apiPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('apiHubInstance', () => { - const fakePath = "/rendered/path/apiHubInstance"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - api_hub_instance: "apiHubInstanceValue", - }; - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.apiHubInstancePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.apiHubInstancePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('apiHubInstancePath', () => { - const result = client.apiHubInstancePath("projectValue", "locationValue", "apiHubInstanceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.apiHubInstancePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromApiHubInstanceName', () => { - const result = client.matchProjectFromApiHubInstanceName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromApiHubInstanceName', () => { - const result = client.matchLocationFromApiHubInstanceName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchApiHubInstanceFromApiHubInstanceName', () => { - const result = client.matchApiHubInstanceFromApiHubInstanceName(fakePath); - assert.strictEqual(result, "apiHubInstanceValue"); - assert((client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('apiOperation', () => { - const fakePath = "/rendered/path/apiOperation"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - api: "apiValue", - version: "versionValue", - operation: "operationValue", - }; - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.apiOperationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.apiOperationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('apiOperationPath', () => { - const result = client.apiOperationPath("projectValue", "locationValue", "apiValue", "versionValue", "operationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.apiOperationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromApiOperationName', () => { - const result = client.matchProjectFromApiOperationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromApiOperationName', () => { - const result = client.matchLocationFromApiOperationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchApiFromApiOperationName', () => { - const result = client.matchApiFromApiOperationName(fakePath); - assert.strictEqual(result, "apiValue"); - assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchVersionFromApiOperationName', () => { - const result = client.matchVersionFromApiOperationName(fakePath); - assert.strictEqual(result, "versionValue"); - assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchOperationFromApiOperationName', () => { - const result = client.matchOperationFromApiOperationName(fakePath); - assert.strictEqual(result, "operationValue"); - assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('attribute', () => { - const fakePath = "/rendered/path/attribute"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - attribute: "attributeValue", - }; - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.attributePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.attributePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('attributePath', () => { - const result = client.attributePath("projectValue", "locationValue", "attributeValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.attributePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromAttributeName', () => { - const result = client.matchProjectFromAttributeName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.attributePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromAttributeName', () => { - const result = client.matchLocationFromAttributeName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.attributePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAttributeFromAttributeName', () => { - const result = client.matchAttributeFromAttributeName(fakePath); - assert.strictEqual(result, "attributeValue"); - assert((client.pathTemplates.attributePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('definition', () => { - const fakePath = "/rendered/path/definition"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - api: "apiValue", - version: "versionValue", - definition: "definitionValue", - }; - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.definitionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.definitionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('definitionPath', () => { - const result = client.definitionPath("projectValue", "locationValue", "apiValue", "versionValue", "definitionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.definitionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDefinitionName', () => { - const result = client.matchProjectFromDefinitionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDefinitionName', () => { - const result = client.matchLocationFromDefinitionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchApiFromDefinitionName', () => { - const result = client.matchApiFromDefinitionName(fakePath); - assert.strictEqual(result, "apiValue"); - assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchVersionFromDefinitionName', () => { - const result = client.matchVersionFromDefinitionName(fakePath); - assert.strictEqual(result, "versionValue"); - assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDefinitionFromDefinitionName', () => { - const result = client.matchDefinitionFromDefinitionName(fakePath); - assert.strictEqual(result, "definitionValue"); - assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dependency', () => { - const fakePath = "/rendered/path/dependency"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dependency: "dependencyValue", - }; - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.dependencyPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.dependencyPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('dependencyPath', () => { - const result = client.dependencyPath("projectValue", "locationValue", "dependencyValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.dependencyPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDependencyName', () => { - const result = client.matchProjectFromDependencyName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.dependencyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDependencyName', () => { - const result = client.matchLocationFromDependencyName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.dependencyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDependencyFromDependencyName', () => { - const result = client.matchDependencyFromDependencyName(fakePath); - assert.strictEqual(result, "dependencyValue"); - assert((client.pathTemplates.dependencyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('deployment', () => { - const fakePath = "/rendered/path/deployment"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - deployment: "deploymentValue", - }; - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.deploymentPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.deploymentPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('deploymentPath', () => { - const result = client.deploymentPath("projectValue", "locationValue", "deploymentValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.deploymentPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDeploymentName', () => { - const result = client.matchProjectFromDeploymentName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDeploymentName', () => { - const result = client.matchLocationFromDeploymentName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDeploymentFromDeploymentName', () => { - const result = client.matchDeploymentFromDeploymentName(fakePath); - assert.strictEqual(result, "deploymentValue"); - assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('externalApi', () => { - const fakePath = "/rendered/path/externalApi"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - external_api: "externalApiValue", - }; - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.externalApiPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.externalApiPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('externalApiPath', () => { - const result = client.externalApiPath("projectValue", "locationValue", "externalApiValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.externalApiPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromExternalApiName', () => { - const result = client.matchProjectFromExternalApiName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.externalApiPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromExternalApiName', () => { - const result = client.matchLocationFromExternalApiName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.externalApiPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExternalApiFromExternalApiName', () => { - const result = client.matchExternalApiFromExternalApiName(fakePath); - assert.strictEqual(result, "externalApiValue"); - assert((client.pathTemplates.externalApiPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('hostProjectRegistration', () => { - const fakePath = "/rendered/path/hostProjectRegistration"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - host_project_registration: "hostProjectRegistrationValue", - }; - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.hostProjectRegistrationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.hostProjectRegistrationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('hostProjectRegistrationPath', () => { - const result = client.hostProjectRegistrationPath("projectValue", "locationValue", "hostProjectRegistrationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.hostProjectRegistrationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromHostProjectRegistrationName', () => { - const result = client.matchProjectFromHostProjectRegistrationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.hostProjectRegistrationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromHostProjectRegistrationName', () => { - const result = client.matchLocationFromHostProjectRegistrationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.hostProjectRegistrationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchHostProjectRegistrationFromHostProjectRegistrationName', () => { - const result = client.matchHostProjectRegistrationFromHostProjectRegistrationName(fakePath); - assert.strictEqual(result, "hostProjectRegistrationValue"); - assert((client.pathTemplates.hostProjectRegistrationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('location', () => { - const fakePath = "/rendered/path/location"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - }; - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.locationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.locationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('locationPath', () => { - const result = client.locationPath("projectValue", "locationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.locationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromLocationName', () => { - const result = client.matchProjectFromLocationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromLocationName', () => { - const result = client.matchLocationFromLocationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('plugin', () => { - const fakePath = "/rendered/path/plugin"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - plugin: "pluginValue", - }; - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.pluginPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.pluginPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('pluginPath', () => { - const result = client.pluginPath("projectValue", "locationValue", "pluginValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.pluginPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromPluginName', () => { - const result = client.matchProjectFromPluginName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.pluginPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromPluginName', () => { - const result = client.matchLocationFromPluginName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.pluginPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchPluginFromPluginName', () => { - const result = client.matchPluginFromPluginName(fakePath); - assert.strictEqual(result, "pluginValue"); - assert((client.pathTemplates.pluginPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('project', () => { - const fakePath = "/rendered/path/project"; - const expectedParameters = { - project: "projectValue", - }; - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.projectPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectPath', () => { - const result = client.projectPath("projectValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectName', () => { - const result = client.matchProjectFromProjectName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('runtimeProjectAttachment', () => { - const fakePath = "/rendered/path/runtimeProjectAttachment"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - runtime_project_attachment: "runtimeProjectAttachmentValue", - }; - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.runtimeProjectAttachmentPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.runtimeProjectAttachmentPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('runtimeProjectAttachmentPath', () => { - const result = client.runtimeProjectAttachmentPath("projectValue", "locationValue", "runtimeProjectAttachmentValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromRuntimeProjectAttachmentName', () => { - const result = client.matchProjectFromRuntimeProjectAttachmentName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromRuntimeProjectAttachmentName', () => { - const result = client.matchLocationFromRuntimeProjectAttachmentName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName', () => { - const result = client.matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName(fakePath); - assert.strictEqual(result, "runtimeProjectAttachmentValue"); - assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('spec', () => { - const fakePath = "/rendered/path/spec"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - api: "apiValue", - version: "versionValue", - spec: "specValue", - }; - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.specPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.specPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('specPath', () => { - const result = client.specPath("projectValue", "locationValue", "apiValue", "versionValue", "specValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.specPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSpecName', () => { - const result = client.matchProjectFromSpecName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.specPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSpecName', () => { - const result = client.matchLocationFromSpecName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.specPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchApiFromSpecName', () => { - const result = client.matchApiFromSpecName(fakePath); - assert.strictEqual(result, "apiValue"); - assert((client.pathTemplates.specPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchVersionFromSpecName', () => { - const result = client.matchVersionFromSpecName(fakePath); - assert.strictEqual(result, "versionValue"); - assert((client.pathTemplates.specPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSpecFromSpecName', () => { - const result = client.matchSpecFromSpecName(fakePath); - assert.strictEqual(result, "specValue"); - assert((client.pathTemplates.specPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('styleGuide', () => { - const fakePath = "/rendered/path/styleGuide"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - plugin: "pluginValue", - }; - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.styleGuidePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.styleGuidePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('styleGuidePath', () => { - const result = client.styleGuidePath("projectValue", "locationValue", "pluginValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.styleGuidePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromStyleGuideName', () => { - const result = client.matchProjectFromStyleGuideName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.styleGuidePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromStyleGuideName', () => { - const result = client.matchLocationFromStyleGuideName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.styleGuidePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchPluginFromStyleGuideName', () => { - const result = client.matchPluginFromStyleGuideName(fakePath); - assert.strictEqual(result, "pluginValue"); - assert((client.pathTemplates.styleGuidePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('version', () => { - const fakePath = "/rendered/path/version"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - api: "apiValue", - version: "versionValue", - }; - const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.versionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.versionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('versionPath', () => { - const result = client.versionPath("projectValue", "locationValue", "apiValue", "versionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.versionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromVersionName', () => { - const result = client.matchProjectFromVersionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.versionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromVersionName', () => { - const result = client.matchLocationFromVersionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.versionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchApiFromVersionName', () => { - const result = client.matchApiFromVersionName(fakePath); - assert.strictEqual(result, "apiValue"); - assert((client.pathTemplates.versionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchVersionFromVersionName', () => { - const result = client.matchVersionFromVersionName(fakePath); - assert.strictEqual(result, "versionValue"); - assert((client.pathTemplates.versionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/google-cloud-apihub/v1/test/gapic_api_hub_plugin_v1.ts b/owl-bot-staging/google-cloud-apihub/v1/test/gapic_api_hub_plugin_v1.ts deleted file mode 100644 index 19735625663..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/test/gapic_api_hub_plugin_v1.ts +++ /dev/null @@ -1,1438 +0,0 @@ -// Copyright 2024 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, beforeEach, afterEach} from 'mocha'; -import * as apihubpluginModule from '../src'; - -import {GoogleAuth, protobuf, 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 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.ApiHubPluginClient', () => { - let googleAuth: GoogleAuth; - beforeEach(() => { - googleAuth = { - getClient: sinon.stub().resolves({ - getRequestHeaders: sinon.stub().resolves({Authorization: 'Bearer SOME_TOKEN'}), - }) - } as unknown as GoogleAuth; - }); - afterEach(() => { - sinon.restore(); - }); - describe('Common methods', () => { - it('has apiEndpoint', () => { - const client = new apihubpluginModule.v1.ApiHubPluginClient(); - const apiEndpoint = client.apiEndpoint; - assert.strictEqual(apiEndpoint, 'apihub.googleapis.com'); - }); - - it('has universeDomain', () => { - const client = new apihubpluginModule.v1.ApiHubPluginClient(); - const universeDomain = client.universeDomain; - assert.strictEqual(universeDomain, "googleapis.com"); - }); - - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - it('throws DeprecationWarning if static servicePath is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const servicePath = apihubpluginModule.v1.ApiHubPluginClient.servicePath; - assert.strictEqual(servicePath, 'apihub.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - - it('throws DeprecationWarning if static apiEndpoint is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const apiEndpoint = apihubpluginModule.v1.ApiHubPluginClient.apiEndpoint; - assert.strictEqual(apiEndpoint, 'apihub.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - } - it('sets apiEndpoint according to universe domain camelCase', () => { - const client = new apihubpluginModule.v1.ApiHubPluginClient({universeDomain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'apihub.example.com'); - }); - - it('sets apiEndpoint according to universe domain snakeCase', () => { - const client = new apihubpluginModule.v1.ApiHubPluginClient({universe_domain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'apihub.example.com'); - }); - - if (typeof process === 'object' && 'env' in process) { - describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { - it('sets apiEndpoint from environment variable', () => { - const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; - const client = new apihubpluginModule.v1.ApiHubPluginClient(); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'apihub.example.com'); - if (saved) { - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; - } else { - delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - } - }); - - it('value configured in code has priority over environment variable', () => { - const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; - const client = new apihubpluginModule.v1.ApiHubPluginClient({universeDomain: 'configured.example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'apihub.configured.example.com'); - if (saved) { - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; - } else { - delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - } - }); - }); - } - it('does not allow setting both universeDomain and universe_domain', () => { - assert.throws(() => { new apihubpluginModule.v1.ApiHubPluginClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); - }); - - it('has port', () => { - const port = apihubpluginModule.v1.ApiHubPluginClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new apihubpluginModule.v1.ApiHubPluginClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new apihubpluginModule.v1.ApiHubPluginClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new apihubpluginModule.v1.ApiHubPluginClient({ - auth: googleAuth, - projectId: 'bogus', - }); - assert.strictEqual(client.apiHubPluginStub, undefined); - await client.initialize(); - assert(client.apiHubPluginStub); - }); - - it('has close method for the initialized client', done => { - const client = new apihubpluginModule.v1.ApiHubPluginClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - assert(client.apiHubPluginStub); - client.close().then(() => { - done(); - }); - }); - - it('has close method for the non-initialized client', done => { - const client = new apihubpluginModule.v1.ApiHubPluginClient({ - auth: googleAuth, - projectId: 'bogus', - }); - assert.strictEqual(client.apiHubPluginStub, undefined); - client.close().then(() => { - done(); - }); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new apihubpluginModule.v1.ApiHubPluginClient({ - auth: googleAuth, - 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 apihubpluginModule.v1.ApiHubPluginClient({ - auth: googleAuth, - 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('getPlugin', () => { - it('invokes getPlugin without error', async () => { - const client = new apihubpluginModule.v1.ApiHubPluginClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetPluginRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetPluginRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.Plugin() - ); - client.innerApiCalls.getPlugin = stubSimpleCall(expectedResponse); - const [response] = await client.getPlugin(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getPlugin as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getPlugin as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getPlugin without error using callback', async () => { - const client = new apihubpluginModule.v1.ApiHubPluginClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetPluginRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetPluginRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.Plugin() - ); - client.innerApiCalls.getPlugin = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getPlugin( - request, - (err?: Error|null, result?: protos.google.cloud.apihub.v1.IPlugin|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getPlugin as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getPlugin as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getPlugin with error', async () => { - const client = new apihubpluginModule.v1.ApiHubPluginClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetPluginRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetPluginRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getPlugin = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getPlugin(request), expectedError); - const actualRequest = (client.innerApiCalls.getPlugin as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getPlugin as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getPlugin with closed client', async () => { - const client = new apihubpluginModule.v1.ApiHubPluginClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetPluginRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetPluginRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getPlugin(request), expectedError); - }); - }); - - describe('enablePlugin', () => { - it('invokes enablePlugin without error', async () => { - const client = new apihubpluginModule.v1.ApiHubPluginClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.EnablePluginRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.EnablePluginRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.Plugin() - ); - client.innerApiCalls.enablePlugin = stubSimpleCall(expectedResponse); - const [response] = await client.enablePlugin(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.enablePlugin as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.enablePlugin as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes enablePlugin without error using callback', async () => { - const client = new apihubpluginModule.v1.ApiHubPluginClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.EnablePluginRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.EnablePluginRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.Plugin() - ); - client.innerApiCalls.enablePlugin = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.enablePlugin( - request, - (err?: Error|null, result?: protos.google.cloud.apihub.v1.IPlugin|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.enablePlugin as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.enablePlugin as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes enablePlugin with error', async () => { - const client = new apihubpluginModule.v1.ApiHubPluginClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.EnablePluginRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.EnablePluginRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.enablePlugin = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.enablePlugin(request), expectedError); - const actualRequest = (client.innerApiCalls.enablePlugin as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.enablePlugin as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes enablePlugin with closed client', async () => { - const client = new apihubpluginModule.v1.ApiHubPluginClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.EnablePluginRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.EnablePluginRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.enablePlugin(request), expectedError); - }); - }); - - describe('disablePlugin', () => { - it('invokes disablePlugin without error', async () => { - const client = new apihubpluginModule.v1.ApiHubPluginClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.DisablePluginRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.DisablePluginRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.Plugin() - ); - client.innerApiCalls.disablePlugin = stubSimpleCall(expectedResponse); - const [response] = await client.disablePlugin(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.disablePlugin as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.disablePlugin as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes disablePlugin without error using callback', async () => { - const client = new apihubpluginModule.v1.ApiHubPluginClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.DisablePluginRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.DisablePluginRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.Plugin() - ); - client.innerApiCalls.disablePlugin = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.disablePlugin( - request, - (err?: Error|null, result?: protos.google.cloud.apihub.v1.IPlugin|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.disablePlugin as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.disablePlugin as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes disablePlugin with error', async () => { - const client = new apihubpluginModule.v1.ApiHubPluginClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.DisablePluginRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.DisablePluginRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.disablePlugin = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.disablePlugin(request), expectedError); - const actualRequest = (client.innerApiCalls.disablePlugin as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.disablePlugin as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes disablePlugin with closed client', async () => { - const client = new apihubpluginModule.v1.ApiHubPluginClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.DisablePluginRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.DisablePluginRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.disablePlugin(request), expectedError); - }); - }); - describe('getLocation', () => { - it('invokes getLocation without error', async () => { - const client = new apihubpluginModule.v1.ApiHubPluginClient({ - auth: googleAuth, - 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 apihubpluginModule.v1.ApiHubPluginClient({ - auth: googleAuth, - 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 apihubpluginModule.v1.ApiHubPluginClient({ - auth: googleAuth, - 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 apihubpluginModule.v1.ApiHubPluginClient({ - auth: googleAuth, - 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 apihubpluginModule.v1.ApiHubPluginClient({ - 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('Path templates', () => { - - describe('api', () => { - const fakePath = "/rendered/path/api"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - api: "apiValue", - }; - const client = new apihubpluginModule.v1.ApiHubPluginClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.apiPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.apiPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('apiPath', () => { - const result = client.apiPath("projectValue", "locationValue", "apiValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.apiPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromApiName', () => { - const result = client.matchProjectFromApiName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.apiPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromApiName', () => { - const result = client.matchLocationFromApiName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.apiPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchApiFromApiName', () => { - const result = client.matchApiFromApiName(fakePath); - assert.strictEqual(result, "apiValue"); - assert((client.pathTemplates.apiPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('apiHubInstance', () => { - const fakePath = "/rendered/path/apiHubInstance"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - api_hub_instance: "apiHubInstanceValue", - }; - const client = new apihubpluginModule.v1.ApiHubPluginClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.apiHubInstancePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.apiHubInstancePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('apiHubInstancePath', () => { - const result = client.apiHubInstancePath("projectValue", "locationValue", "apiHubInstanceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.apiHubInstancePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromApiHubInstanceName', () => { - const result = client.matchProjectFromApiHubInstanceName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromApiHubInstanceName', () => { - const result = client.matchLocationFromApiHubInstanceName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchApiHubInstanceFromApiHubInstanceName', () => { - const result = client.matchApiHubInstanceFromApiHubInstanceName(fakePath); - assert.strictEqual(result, "apiHubInstanceValue"); - assert((client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('apiOperation', () => { - const fakePath = "/rendered/path/apiOperation"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - api: "apiValue", - version: "versionValue", - operation: "operationValue", - }; - const client = new apihubpluginModule.v1.ApiHubPluginClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.apiOperationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.apiOperationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('apiOperationPath', () => { - const result = client.apiOperationPath("projectValue", "locationValue", "apiValue", "versionValue", "operationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.apiOperationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromApiOperationName', () => { - const result = client.matchProjectFromApiOperationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromApiOperationName', () => { - const result = client.matchLocationFromApiOperationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchApiFromApiOperationName', () => { - const result = client.matchApiFromApiOperationName(fakePath); - assert.strictEqual(result, "apiValue"); - assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchVersionFromApiOperationName', () => { - const result = client.matchVersionFromApiOperationName(fakePath); - assert.strictEqual(result, "versionValue"); - assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchOperationFromApiOperationName', () => { - const result = client.matchOperationFromApiOperationName(fakePath); - assert.strictEqual(result, "operationValue"); - assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('attribute', () => { - const fakePath = "/rendered/path/attribute"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - attribute: "attributeValue", - }; - const client = new apihubpluginModule.v1.ApiHubPluginClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.attributePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.attributePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('attributePath', () => { - const result = client.attributePath("projectValue", "locationValue", "attributeValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.attributePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromAttributeName', () => { - const result = client.matchProjectFromAttributeName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.attributePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromAttributeName', () => { - const result = client.matchLocationFromAttributeName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.attributePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAttributeFromAttributeName', () => { - const result = client.matchAttributeFromAttributeName(fakePath); - assert.strictEqual(result, "attributeValue"); - assert((client.pathTemplates.attributePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('definition', () => { - const fakePath = "/rendered/path/definition"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - api: "apiValue", - version: "versionValue", - definition: "definitionValue", - }; - const client = new apihubpluginModule.v1.ApiHubPluginClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.definitionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.definitionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('definitionPath', () => { - const result = client.definitionPath("projectValue", "locationValue", "apiValue", "versionValue", "definitionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.definitionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDefinitionName', () => { - const result = client.matchProjectFromDefinitionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDefinitionName', () => { - const result = client.matchLocationFromDefinitionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchApiFromDefinitionName', () => { - const result = client.matchApiFromDefinitionName(fakePath); - assert.strictEqual(result, "apiValue"); - assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchVersionFromDefinitionName', () => { - const result = client.matchVersionFromDefinitionName(fakePath); - assert.strictEqual(result, "versionValue"); - assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDefinitionFromDefinitionName', () => { - const result = client.matchDefinitionFromDefinitionName(fakePath); - assert.strictEqual(result, "definitionValue"); - assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dependency', () => { - const fakePath = "/rendered/path/dependency"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dependency: "dependencyValue", - }; - const client = new apihubpluginModule.v1.ApiHubPluginClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.dependencyPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.dependencyPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('dependencyPath', () => { - const result = client.dependencyPath("projectValue", "locationValue", "dependencyValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.dependencyPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDependencyName', () => { - const result = client.matchProjectFromDependencyName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.dependencyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDependencyName', () => { - const result = client.matchLocationFromDependencyName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.dependencyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDependencyFromDependencyName', () => { - const result = client.matchDependencyFromDependencyName(fakePath); - assert.strictEqual(result, "dependencyValue"); - assert((client.pathTemplates.dependencyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('deployment', () => { - const fakePath = "/rendered/path/deployment"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - deployment: "deploymentValue", - }; - const client = new apihubpluginModule.v1.ApiHubPluginClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.deploymentPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.deploymentPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('deploymentPath', () => { - const result = client.deploymentPath("projectValue", "locationValue", "deploymentValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.deploymentPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDeploymentName', () => { - const result = client.matchProjectFromDeploymentName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDeploymentName', () => { - const result = client.matchLocationFromDeploymentName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDeploymentFromDeploymentName', () => { - const result = client.matchDeploymentFromDeploymentName(fakePath); - assert.strictEqual(result, "deploymentValue"); - assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('externalApi', () => { - const fakePath = "/rendered/path/externalApi"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - external_api: "externalApiValue", - }; - const client = new apihubpluginModule.v1.ApiHubPluginClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.externalApiPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.externalApiPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('externalApiPath', () => { - const result = client.externalApiPath("projectValue", "locationValue", "externalApiValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.externalApiPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromExternalApiName', () => { - const result = client.matchProjectFromExternalApiName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.externalApiPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromExternalApiName', () => { - const result = client.matchLocationFromExternalApiName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.externalApiPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExternalApiFromExternalApiName', () => { - const result = client.matchExternalApiFromExternalApiName(fakePath); - assert.strictEqual(result, "externalApiValue"); - assert((client.pathTemplates.externalApiPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('hostProjectRegistration', () => { - const fakePath = "/rendered/path/hostProjectRegistration"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - host_project_registration: "hostProjectRegistrationValue", - }; - const client = new apihubpluginModule.v1.ApiHubPluginClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.hostProjectRegistrationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.hostProjectRegistrationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('hostProjectRegistrationPath', () => { - const result = client.hostProjectRegistrationPath("projectValue", "locationValue", "hostProjectRegistrationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.hostProjectRegistrationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromHostProjectRegistrationName', () => { - const result = client.matchProjectFromHostProjectRegistrationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.hostProjectRegistrationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromHostProjectRegistrationName', () => { - const result = client.matchLocationFromHostProjectRegistrationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.hostProjectRegistrationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchHostProjectRegistrationFromHostProjectRegistrationName', () => { - const result = client.matchHostProjectRegistrationFromHostProjectRegistrationName(fakePath); - assert.strictEqual(result, "hostProjectRegistrationValue"); - assert((client.pathTemplates.hostProjectRegistrationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('plugin', () => { - const fakePath = "/rendered/path/plugin"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - plugin: "pluginValue", - }; - const client = new apihubpluginModule.v1.ApiHubPluginClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.pluginPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.pluginPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('pluginPath', () => { - const result = client.pluginPath("projectValue", "locationValue", "pluginValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.pluginPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromPluginName', () => { - const result = client.matchProjectFromPluginName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.pluginPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromPluginName', () => { - const result = client.matchLocationFromPluginName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.pluginPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchPluginFromPluginName', () => { - const result = client.matchPluginFromPluginName(fakePath); - assert.strictEqual(result, "pluginValue"); - assert((client.pathTemplates.pluginPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('runtimeProjectAttachment', () => { - const fakePath = "/rendered/path/runtimeProjectAttachment"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - runtime_project_attachment: "runtimeProjectAttachmentValue", - }; - const client = new apihubpluginModule.v1.ApiHubPluginClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.runtimeProjectAttachmentPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.runtimeProjectAttachmentPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('runtimeProjectAttachmentPath', () => { - const result = client.runtimeProjectAttachmentPath("projectValue", "locationValue", "runtimeProjectAttachmentValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromRuntimeProjectAttachmentName', () => { - const result = client.matchProjectFromRuntimeProjectAttachmentName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromRuntimeProjectAttachmentName', () => { - const result = client.matchLocationFromRuntimeProjectAttachmentName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName', () => { - const result = client.matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName(fakePath); - assert.strictEqual(result, "runtimeProjectAttachmentValue"); - assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('spec', () => { - const fakePath = "/rendered/path/spec"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - api: "apiValue", - version: "versionValue", - spec: "specValue", - }; - const client = new apihubpluginModule.v1.ApiHubPluginClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.specPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.specPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('specPath', () => { - const result = client.specPath("projectValue", "locationValue", "apiValue", "versionValue", "specValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.specPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSpecName', () => { - const result = client.matchProjectFromSpecName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.specPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSpecName', () => { - const result = client.matchLocationFromSpecName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.specPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchApiFromSpecName', () => { - const result = client.matchApiFromSpecName(fakePath); - assert.strictEqual(result, "apiValue"); - assert((client.pathTemplates.specPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchVersionFromSpecName', () => { - const result = client.matchVersionFromSpecName(fakePath); - assert.strictEqual(result, "versionValue"); - assert((client.pathTemplates.specPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSpecFromSpecName', () => { - const result = client.matchSpecFromSpecName(fakePath); - assert.strictEqual(result, "specValue"); - assert((client.pathTemplates.specPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('styleGuide', () => { - const fakePath = "/rendered/path/styleGuide"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - plugin: "pluginValue", - }; - const client = new apihubpluginModule.v1.ApiHubPluginClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.styleGuidePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.styleGuidePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('styleGuidePath', () => { - const result = client.styleGuidePath("projectValue", "locationValue", "pluginValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.styleGuidePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromStyleGuideName', () => { - const result = client.matchProjectFromStyleGuideName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.styleGuidePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromStyleGuideName', () => { - const result = client.matchLocationFromStyleGuideName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.styleGuidePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchPluginFromStyleGuideName', () => { - const result = client.matchPluginFromStyleGuideName(fakePath); - assert.strictEqual(result, "pluginValue"); - assert((client.pathTemplates.styleGuidePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('version', () => { - const fakePath = "/rendered/path/version"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - api: "apiValue", - version: "versionValue", - }; - const client = new apihubpluginModule.v1.ApiHubPluginClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.versionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.versionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('versionPath', () => { - const result = client.versionPath("projectValue", "locationValue", "apiValue", "versionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.versionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromVersionName', () => { - const result = client.matchProjectFromVersionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.versionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromVersionName', () => { - const result = client.matchLocationFromVersionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.versionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchApiFromVersionName', () => { - const result = client.matchApiFromVersionName(fakePath); - assert.strictEqual(result, "apiValue"); - assert((client.pathTemplates.versionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchVersionFromVersionName', () => { - const result = client.matchVersionFromVersionName(fakePath); - assert.strictEqual(result, "versionValue"); - assert((client.pathTemplates.versionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/google-cloud-apihub/v1/test/gapic_api_hub_v1.ts b/owl-bot-staging/google-cloud-apihub/v1/test/gapic_api_hub_v1.ts deleted file mode 100644 index c0ac312408c..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/test/gapic_api_hub_v1.ts +++ /dev/null @@ -1,6109 +0,0 @@ -// Copyright 2024 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, beforeEach, afterEach} from 'mocha'; -import * as apihubModule from '../src'; - -import {PassThrough} from 'stream'; - -import {GoogleAuth, protobuf, 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 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.ApiHubClient', () => { - let googleAuth: GoogleAuth; - beforeEach(() => { - googleAuth = { - getClient: sinon.stub().resolves({ - getRequestHeaders: sinon.stub().resolves({Authorization: 'Bearer SOME_TOKEN'}), - }) - } as unknown as GoogleAuth; - }); - afterEach(() => { - sinon.restore(); - }); - describe('Common methods', () => { - it('has apiEndpoint', () => { - const client = new apihubModule.v1.ApiHubClient(); - const apiEndpoint = client.apiEndpoint; - assert.strictEqual(apiEndpoint, 'apihub.googleapis.com'); - }); - - it('has universeDomain', () => { - const client = new apihubModule.v1.ApiHubClient(); - const universeDomain = client.universeDomain; - assert.strictEqual(universeDomain, "googleapis.com"); - }); - - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - it('throws DeprecationWarning if static servicePath is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const servicePath = apihubModule.v1.ApiHubClient.servicePath; - assert.strictEqual(servicePath, 'apihub.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - - it('throws DeprecationWarning if static apiEndpoint is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const apiEndpoint = apihubModule.v1.ApiHubClient.apiEndpoint; - assert.strictEqual(apiEndpoint, 'apihub.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - } - it('sets apiEndpoint according to universe domain camelCase', () => { - const client = new apihubModule.v1.ApiHubClient({universeDomain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'apihub.example.com'); - }); - - it('sets apiEndpoint according to universe domain snakeCase', () => { - const client = new apihubModule.v1.ApiHubClient({universe_domain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'apihub.example.com'); - }); - - if (typeof process === 'object' && 'env' in process) { - describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { - it('sets apiEndpoint from environment variable', () => { - const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; - const client = new apihubModule.v1.ApiHubClient(); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'apihub.example.com'); - if (saved) { - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; - } else { - delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - } - }); - - it('value configured in code has priority over environment variable', () => { - const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; - const client = new apihubModule.v1.ApiHubClient({universeDomain: 'configured.example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'apihub.configured.example.com'); - if (saved) { - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; - } else { - delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - } - }); - }); - } - it('does not allow setting both universeDomain and universe_domain', () => { - assert.throws(() => { new apihubModule.v1.ApiHubClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); - }); - - it('has port', () => { - const port = apihubModule.v1.ApiHubClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new apihubModule.v1.ApiHubClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new apihubModule.v1.ApiHubClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - assert.strictEqual(client.apiHubStub, undefined); - await client.initialize(); - assert(client.apiHubStub); - }); - - it('has close method for the initialized client', done => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - assert(client.apiHubStub); - client.close().then(() => { - done(); - }); - }); - - it('has close method for the non-initialized client', done => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - assert.strictEqual(client.apiHubStub, undefined); - client.close().then(() => { - done(); - }); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - 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 apihubModule.v1.ApiHubClient({ - auth: googleAuth, - 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('createApi', () => { - it('invokes createApi without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.CreateApiRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.CreateApiRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.Api() - ); - client.innerApiCalls.createApi = stubSimpleCall(expectedResponse); - const [response] = await client.createApi(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createApi as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createApi as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createApi without error using callback', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.CreateApiRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.CreateApiRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.Api() - ); - client.innerApiCalls.createApi = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createApi( - request, - (err?: Error|null, result?: protos.google.cloud.apihub.v1.IApi|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createApi as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createApi as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createApi with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.CreateApiRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.CreateApiRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createApi = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createApi(request), expectedError); - const actualRequest = (client.innerApiCalls.createApi as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createApi as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createApi with closed client', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.CreateApiRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.CreateApiRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createApi(request), expectedError); - }); - }); - - describe('getApi', () => { - it('invokes getApi without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetApiRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetApiRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.Api() - ); - client.innerApiCalls.getApi = stubSimpleCall(expectedResponse); - const [response] = await client.getApi(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getApi as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getApi as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getApi without error using callback', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetApiRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetApiRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.Api() - ); - client.innerApiCalls.getApi = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getApi( - request, - (err?: Error|null, result?: protos.google.cloud.apihub.v1.IApi|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getApi as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getApi as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getApi with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetApiRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetApiRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getApi = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getApi(request), expectedError); - const actualRequest = (client.innerApiCalls.getApi as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getApi as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getApi with closed client', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetApiRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetApiRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getApi(request), expectedError); - }); - }); - - describe('updateApi', () => { - it('invokes updateApi without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.UpdateApiRequest() - ); - request.api ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.UpdateApiRequest', ['api', 'name']); - request.api.name = defaultValue1; - const expectedHeaderRequestParams = `api.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.Api() - ); - client.innerApiCalls.updateApi = stubSimpleCall(expectedResponse); - const [response] = await client.updateApi(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateApi as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateApi as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateApi without error using callback', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.UpdateApiRequest() - ); - request.api ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.UpdateApiRequest', ['api', 'name']); - request.api.name = defaultValue1; - const expectedHeaderRequestParams = `api.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.Api() - ); - client.innerApiCalls.updateApi = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateApi( - request, - (err?: Error|null, result?: protos.google.cloud.apihub.v1.IApi|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateApi as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateApi as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateApi with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.UpdateApiRequest() - ); - request.api ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.UpdateApiRequest', ['api', 'name']); - request.api.name = defaultValue1; - const expectedHeaderRequestParams = `api.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateApi = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateApi(request), expectedError); - const actualRequest = (client.innerApiCalls.updateApi as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateApi as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateApi with closed client', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.UpdateApiRequest() - ); - request.api ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.UpdateApiRequest', ['api', 'name']); - request.api.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateApi(request), expectedError); - }); - }); - - describe('deleteApi', () => { - it('invokes deleteApi without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.DeleteApiRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.DeleteApiRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteApi = stubSimpleCall(expectedResponse); - const [response] = await client.deleteApi(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteApi as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteApi as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteApi without error using callback', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.DeleteApiRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.DeleteApiRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteApi = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteApi( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteApi as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteApi as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteApi with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.DeleteApiRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.DeleteApiRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteApi = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteApi(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteApi as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteApi as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteApi with closed client', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.DeleteApiRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.DeleteApiRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.deleteApi(request), expectedError); - }); - }); - - describe('createVersion', () => { - it('invokes createVersion without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.CreateVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.CreateVersionRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.Version() - ); - client.innerApiCalls.createVersion = stubSimpleCall(expectedResponse); - const [response] = await client.createVersion(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createVersion without error using callback', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.CreateVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.CreateVersionRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.Version() - ); - client.innerApiCalls.createVersion = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createVersion( - request, - (err?: Error|null, result?: protos.google.cloud.apihub.v1.IVersion|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createVersion with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.CreateVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.CreateVersionRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createVersion = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createVersion(request), expectedError); - const actualRequest = (client.innerApiCalls.createVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createVersion with closed client', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.CreateVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.CreateVersionRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createVersion(request), expectedError); - }); - }); - - describe('getVersion', () => { - it('invokes getVersion without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetVersionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.Version() - ); - client.innerApiCalls.getVersion = stubSimpleCall(expectedResponse); - const [response] = await client.getVersion(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getVersion without error using callback', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetVersionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.Version() - ); - client.innerApiCalls.getVersion = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getVersion( - request, - (err?: Error|null, result?: protos.google.cloud.apihub.v1.IVersion|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getVersion with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetVersionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getVersion = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getVersion(request), expectedError); - const actualRequest = (client.innerApiCalls.getVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getVersion with closed client', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetVersionRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getVersion(request), expectedError); - }); - }); - - describe('updateVersion', () => { - it('invokes updateVersion without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.UpdateVersionRequest() - ); - request.version ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.UpdateVersionRequest', ['version', 'name']); - request.version.name = defaultValue1; - const expectedHeaderRequestParams = `version.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.Version() - ); - client.innerApiCalls.updateVersion = stubSimpleCall(expectedResponse); - const [response] = await client.updateVersion(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateVersion without error using callback', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.UpdateVersionRequest() - ); - request.version ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.UpdateVersionRequest', ['version', 'name']); - request.version.name = defaultValue1; - const expectedHeaderRequestParams = `version.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.Version() - ); - client.innerApiCalls.updateVersion = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateVersion( - request, - (err?: Error|null, result?: protos.google.cloud.apihub.v1.IVersion|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateVersion with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.UpdateVersionRequest() - ); - request.version ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.UpdateVersionRequest', ['version', 'name']); - request.version.name = defaultValue1; - const expectedHeaderRequestParams = `version.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateVersion = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateVersion(request), expectedError); - const actualRequest = (client.innerApiCalls.updateVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateVersion with closed client', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.UpdateVersionRequest() - ); - request.version ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.UpdateVersionRequest', ['version', 'name']); - request.version.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateVersion(request), expectedError); - }); - }); - - describe('deleteVersion', () => { - it('invokes deleteVersion without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.DeleteVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.DeleteVersionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteVersion = stubSimpleCall(expectedResponse); - const [response] = await client.deleteVersion(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteVersion without error using callback', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.DeleteVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.DeleteVersionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteVersion = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteVersion( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteVersion with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.DeleteVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.DeleteVersionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteVersion = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteVersion(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteVersion with closed client', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.DeleteVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.DeleteVersionRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.deleteVersion(request), expectedError); - }); - }); - - describe('createSpec', () => { - it('invokes createSpec without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.CreateSpecRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.CreateSpecRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.Spec() - ); - client.innerApiCalls.createSpec = stubSimpleCall(expectedResponse); - const [response] = await client.createSpec(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createSpec as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createSpec as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createSpec without error using callback', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.CreateSpecRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.CreateSpecRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.Spec() - ); - client.innerApiCalls.createSpec = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createSpec( - request, - (err?: Error|null, result?: protos.google.cloud.apihub.v1.ISpec|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createSpec as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createSpec as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createSpec with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.CreateSpecRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.CreateSpecRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createSpec = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createSpec(request), expectedError); - const actualRequest = (client.innerApiCalls.createSpec as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createSpec as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createSpec with closed client', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.CreateSpecRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.CreateSpecRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createSpec(request), expectedError); - }); - }); - - describe('getSpec', () => { - it('invokes getSpec without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetSpecRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetSpecRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.Spec() - ); - client.innerApiCalls.getSpec = stubSimpleCall(expectedResponse); - const [response] = await client.getSpec(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getSpec as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getSpec as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getSpec without error using callback', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetSpecRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetSpecRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.Spec() - ); - client.innerApiCalls.getSpec = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getSpec( - request, - (err?: Error|null, result?: protos.google.cloud.apihub.v1.ISpec|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getSpec as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getSpec as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getSpec with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetSpecRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetSpecRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getSpec = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getSpec(request), expectedError); - const actualRequest = (client.innerApiCalls.getSpec as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getSpec as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getSpec with closed client', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetSpecRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetSpecRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getSpec(request), expectedError); - }); - }); - - describe('getSpecContents', () => { - it('invokes getSpecContents without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetSpecContentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetSpecContentsRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.SpecContents() - ); - client.innerApiCalls.getSpecContents = stubSimpleCall(expectedResponse); - const [response] = await client.getSpecContents(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getSpecContents as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getSpecContents as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getSpecContents without error using callback', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetSpecContentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetSpecContentsRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.SpecContents() - ); - client.innerApiCalls.getSpecContents = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getSpecContents( - request, - (err?: Error|null, result?: protos.google.cloud.apihub.v1.ISpecContents|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getSpecContents as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getSpecContents as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getSpecContents with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetSpecContentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetSpecContentsRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getSpecContents = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getSpecContents(request), expectedError); - const actualRequest = (client.innerApiCalls.getSpecContents as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getSpecContents as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getSpecContents with closed client', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetSpecContentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetSpecContentsRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getSpecContents(request), expectedError); - }); - }); - - describe('updateSpec', () => { - it('invokes updateSpec without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.UpdateSpecRequest() - ); - request.spec ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.UpdateSpecRequest', ['spec', 'name']); - request.spec.name = defaultValue1; - const expectedHeaderRequestParams = `spec.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.Spec() - ); - client.innerApiCalls.updateSpec = stubSimpleCall(expectedResponse); - const [response] = await client.updateSpec(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateSpec as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateSpec as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateSpec without error using callback', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.UpdateSpecRequest() - ); - request.spec ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.UpdateSpecRequest', ['spec', 'name']); - request.spec.name = defaultValue1; - const expectedHeaderRequestParams = `spec.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.Spec() - ); - client.innerApiCalls.updateSpec = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateSpec( - request, - (err?: Error|null, result?: protos.google.cloud.apihub.v1.ISpec|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateSpec as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateSpec as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateSpec with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.UpdateSpecRequest() - ); - request.spec ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.UpdateSpecRequest', ['spec', 'name']); - request.spec.name = defaultValue1; - const expectedHeaderRequestParams = `spec.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateSpec = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateSpec(request), expectedError); - const actualRequest = (client.innerApiCalls.updateSpec as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateSpec as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateSpec with closed client', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.UpdateSpecRequest() - ); - request.spec ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.UpdateSpecRequest', ['spec', 'name']); - request.spec.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateSpec(request), expectedError); - }); - }); - - describe('deleteSpec', () => { - it('invokes deleteSpec without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.DeleteSpecRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.DeleteSpecRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteSpec = stubSimpleCall(expectedResponse); - const [response] = await client.deleteSpec(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteSpec as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteSpec as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteSpec without error using callback', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.DeleteSpecRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.DeleteSpecRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteSpec = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteSpec( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteSpec as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteSpec as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteSpec with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.DeleteSpecRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.DeleteSpecRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteSpec = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteSpec(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteSpec as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteSpec as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteSpec with closed client', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.DeleteSpecRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.DeleteSpecRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.deleteSpec(request), expectedError); - }); - }); - - describe('getApiOperation', () => { - it('invokes getApiOperation without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetApiOperationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetApiOperationRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.ApiOperation() - ); - client.innerApiCalls.getApiOperation = stubSimpleCall(expectedResponse); - const [response] = await client.getApiOperation(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getApiOperation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getApiOperation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getApiOperation without error using callback', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetApiOperationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetApiOperationRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.ApiOperation() - ); - client.innerApiCalls.getApiOperation = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getApiOperation( - request, - (err?: Error|null, result?: protos.google.cloud.apihub.v1.IApiOperation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getApiOperation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getApiOperation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getApiOperation with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetApiOperationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetApiOperationRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getApiOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getApiOperation(request), expectedError); - const actualRequest = (client.innerApiCalls.getApiOperation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getApiOperation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getApiOperation with closed client', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetApiOperationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetApiOperationRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getApiOperation(request), expectedError); - }); - }); - - describe('getDefinition', () => { - it('invokes getDefinition without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetDefinitionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetDefinitionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.Definition() - ); - client.innerApiCalls.getDefinition = stubSimpleCall(expectedResponse); - const [response] = await client.getDefinition(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getDefinition as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getDefinition as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getDefinition without error using callback', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetDefinitionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetDefinitionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.Definition() - ); - client.innerApiCalls.getDefinition = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getDefinition( - request, - (err?: Error|null, result?: protos.google.cloud.apihub.v1.IDefinition|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getDefinition as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getDefinition as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getDefinition with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetDefinitionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetDefinitionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getDefinition = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getDefinition(request), expectedError); - const actualRequest = (client.innerApiCalls.getDefinition as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getDefinition as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getDefinition with closed client', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetDefinitionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetDefinitionRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getDefinition(request), expectedError); - }); - }); - - describe('createDeployment', () => { - it('invokes createDeployment without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.CreateDeploymentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.CreateDeploymentRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.Deployment() - ); - client.innerApiCalls.createDeployment = stubSimpleCall(expectedResponse); - const [response] = await client.createDeployment(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createDeployment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createDeployment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createDeployment without error using callback', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.CreateDeploymentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.CreateDeploymentRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.Deployment() - ); - client.innerApiCalls.createDeployment = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createDeployment( - request, - (err?: Error|null, result?: protos.google.cloud.apihub.v1.IDeployment|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createDeployment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createDeployment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createDeployment with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.CreateDeploymentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.CreateDeploymentRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createDeployment = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createDeployment(request), expectedError); - const actualRequest = (client.innerApiCalls.createDeployment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createDeployment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createDeployment with closed client', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.CreateDeploymentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.CreateDeploymentRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createDeployment(request), expectedError); - }); - }); - - describe('getDeployment', () => { - it('invokes getDeployment without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetDeploymentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetDeploymentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.Deployment() - ); - client.innerApiCalls.getDeployment = stubSimpleCall(expectedResponse); - const [response] = await client.getDeployment(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getDeployment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getDeployment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getDeployment without error using callback', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetDeploymentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetDeploymentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.Deployment() - ); - client.innerApiCalls.getDeployment = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getDeployment( - request, - (err?: Error|null, result?: protos.google.cloud.apihub.v1.IDeployment|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getDeployment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getDeployment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getDeployment with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetDeploymentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetDeploymentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getDeployment = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getDeployment(request), expectedError); - const actualRequest = (client.innerApiCalls.getDeployment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getDeployment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getDeployment with closed client', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetDeploymentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetDeploymentRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getDeployment(request), expectedError); - }); - }); - - describe('updateDeployment', () => { - it('invokes updateDeployment without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.UpdateDeploymentRequest() - ); - request.deployment ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.UpdateDeploymentRequest', ['deployment', 'name']); - request.deployment.name = defaultValue1; - const expectedHeaderRequestParams = `deployment.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.Deployment() - ); - client.innerApiCalls.updateDeployment = stubSimpleCall(expectedResponse); - const [response] = await client.updateDeployment(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateDeployment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateDeployment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateDeployment without error using callback', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.UpdateDeploymentRequest() - ); - request.deployment ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.UpdateDeploymentRequest', ['deployment', 'name']); - request.deployment.name = defaultValue1; - const expectedHeaderRequestParams = `deployment.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.Deployment() - ); - client.innerApiCalls.updateDeployment = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateDeployment( - request, - (err?: Error|null, result?: protos.google.cloud.apihub.v1.IDeployment|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateDeployment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateDeployment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateDeployment with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.UpdateDeploymentRequest() - ); - request.deployment ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.UpdateDeploymentRequest', ['deployment', 'name']); - request.deployment.name = defaultValue1; - const expectedHeaderRequestParams = `deployment.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateDeployment = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateDeployment(request), expectedError); - const actualRequest = (client.innerApiCalls.updateDeployment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateDeployment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateDeployment with closed client', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.UpdateDeploymentRequest() - ); - request.deployment ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.UpdateDeploymentRequest', ['deployment', 'name']); - request.deployment.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateDeployment(request), expectedError); - }); - }); - - describe('deleteDeployment', () => { - it('invokes deleteDeployment without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.DeleteDeploymentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.DeleteDeploymentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteDeployment = stubSimpleCall(expectedResponse); - const [response] = await client.deleteDeployment(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteDeployment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteDeployment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteDeployment without error using callback', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.DeleteDeploymentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.DeleteDeploymentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteDeployment = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteDeployment( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteDeployment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteDeployment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteDeployment with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.DeleteDeploymentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.DeleteDeploymentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteDeployment = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteDeployment(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteDeployment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteDeployment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteDeployment with closed client', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.DeleteDeploymentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.DeleteDeploymentRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.deleteDeployment(request), expectedError); - }); - }); - - describe('createAttribute', () => { - it('invokes createAttribute without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.CreateAttributeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.CreateAttributeRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.Attribute() - ); - client.innerApiCalls.createAttribute = stubSimpleCall(expectedResponse); - const [response] = await client.createAttribute(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createAttribute as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createAttribute as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createAttribute without error using callback', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.CreateAttributeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.CreateAttributeRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.Attribute() - ); - client.innerApiCalls.createAttribute = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createAttribute( - request, - (err?: Error|null, result?: protos.google.cloud.apihub.v1.IAttribute|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createAttribute as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createAttribute as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createAttribute with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.CreateAttributeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.CreateAttributeRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createAttribute = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createAttribute(request), expectedError); - const actualRequest = (client.innerApiCalls.createAttribute as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createAttribute as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createAttribute with closed client', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.CreateAttributeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.CreateAttributeRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createAttribute(request), expectedError); - }); - }); - - describe('getAttribute', () => { - it('invokes getAttribute without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetAttributeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetAttributeRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.Attribute() - ); - client.innerApiCalls.getAttribute = stubSimpleCall(expectedResponse); - const [response] = await client.getAttribute(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getAttribute as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getAttribute as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getAttribute without error using callback', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetAttributeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetAttributeRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.Attribute() - ); - client.innerApiCalls.getAttribute = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getAttribute( - request, - (err?: Error|null, result?: protos.google.cloud.apihub.v1.IAttribute|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getAttribute as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getAttribute as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getAttribute with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetAttributeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetAttributeRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getAttribute = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getAttribute(request), expectedError); - const actualRequest = (client.innerApiCalls.getAttribute as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getAttribute as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getAttribute with closed client', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetAttributeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetAttributeRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getAttribute(request), expectedError); - }); - }); - - describe('updateAttribute', () => { - it('invokes updateAttribute without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.UpdateAttributeRequest() - ); - request.attribute ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.UpdateAttributeRequest', ['attribute', 'name']); - request.attribute.name = defaultValue1; - const expectedHeaderRequestParams = `attribute.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.Attribute() - ); - client.innerApiCalls.updateAttribute = stubSimpleCall(expectedResponse); - const [response] = await client.updateAttribute(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateAttribute as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateAttribute as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateAttribute without error using callback', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.UpdateAttributeRequest() - ); - request.attribute ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.UpdateAttributeRequest', ['attribute', 'name']); - request.attribute.name = defaultValue1; - const expectedHeaderRequestParams = `attribute.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.Attribute() - ); - client.innerApiCalls.updateAttribute = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateAttribute( - request, - (err?: Error|null, result?: protos.google.cloud.apihub.v1.IAttribute|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateAttribute as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateAttribute as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateAttribute with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.UpdateAttributeRequest() - ); - request.attribute ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.UpdateAttributeRequest', ['attribute', 'name']); - request.attribute.name = defaultValue1; - const expectedHeaderRequestParams = `attribute.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateAttribute = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateAttribute(request), expectedError); - const actualRequest = (client.innerApiCalls.updateAttribute as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateAttribute as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateAttribute with closed client', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.UpdateAttributeRequest() - ); - request.attribute ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.UpdateAttributeRequest', ['attribute', 'name']); - request.attribute.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateAttribute(request), expectedError); - }); - }); - - describe('deleteAttribute', () => { - it('invokes deleteAttribute without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.DeleteAttributeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.DeleteAttributeRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteAttribute = stubSimpleCall(expectedResponse); - const [response] = await client.deleteAttribute(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteAttribute as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteAttribute as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteAttribute without error using callback', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.DeleteAttributeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.DeleteAttributeRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteAttribute = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteAttribute( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteAttribute as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteAttribute as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteAttribute with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.DeleteAttributeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.DeleteAttributeRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteAttribute = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteAttribute(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteAttribute as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteAttribute as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteAttribute with closed client', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.DeleteAttributeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.DeleteAttributeRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.deleteAttribute(request), expectedError); - }); - }); - - describe('createExternalApi', () => { - it('invokes createExternalApi without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.CreateExternalApiRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.CreateExternalApiRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.ExternalApi() - ); - client.innerApiCalls.createExternalApi = stubSimpleCall(expectedResponse); - const [response] = await client.createExternalApi(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createExternalApi as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createExternalApi as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createExternalApi without error using callback', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.CreateExternalApiRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.CreateExternalApiRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.ExternalApi() - ); - client.innerApiCalls.createExternalApi = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createExternalApi( - request, - (err?: Error|null, result?: protos.google.cloud.apihub.v1.IExternalApi|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createExternalApi as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createExternalApi as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createExternalApi with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.CreateExternalApiRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.CreateExternalApiRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createExternalApi = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createExternalApi(request), expectedError); - const actualRequest = (client.innerApiCalls.createExternalApi as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createExternalApi as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createExternalApi with closed client', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.CreateExternalApiRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.CreateExternalApiRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createExternalApi(request), expectedError); - }); - }); - - describe('getExternalApi', () => { - it('invokes getExternalApi without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetExternalApiRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetExternalApiRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.ExternalApi() - ); - client.innerApiCalls.getExternalApi = stubSimpleCall(expectedResponse); - const [response] = await client.getExternalApi(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getExternalApi as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getExternalApi as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getExternalApi without error using callback', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetExternalApiRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetExternalApiRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.ExternalApi() - ); - client.innerApiCalls.getExternalApi = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getExternalApi( - request, - (err?: Error|null, result?: protos.google.cloud.apihub.v1.IExternalApi|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getExternalApi as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getExternalApi as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getExternalApi with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetExternalApiRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetExternalApiRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getExternalApi = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getExternalApi(request), expectedError); - const actualRequest = (client.innerApiCalls.getExternalApi as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getExternalApi as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getExternalApi with closed client', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetExternalApiRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetExternalApiRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getExternalApi(request), expectedError); - }); - }); - - describe('updateExternalApi', () => { - it('invokes updateExternalApi without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.UpdateExternalApiRequest() - ); - request.externalApi ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.UpdateExternalApiRequest', ['externalApi', 'name']); - request.externalApi.name = defaultValue1; - const expectedHeaderRequestParams = `external_api.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.ExternalApi() - ); - client.innerApiCalls.updateExternalApi = stubSimpleCall(expectedResponse); - const [response] = await client.updateExternalApi(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateExternalApi as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateExternalApi as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateExternalApi without error using callback', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.UpdateExternalApiRequest() - ); - request.externalApi ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.UpdateExternalApiRequest', ['externalApi', 'name']); - request.externalApi.name = defaultValue1; - const expectedHeaderRequestParams = `external_api.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.ExternalApi() - ); - client.innerApiCalls.updateExternalApi = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateExternalApi( - request, - (err?: Error|null, result?: protos.google.cloud.apihub.v1.IExternalApi|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateExternalApi as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateExternalApi as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateExternalApi with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.UpdateExternalApiRequest() - ); - request.externalApi ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.UpdateExternalApiRequest', ['externalApi', 'name']); - request.externalApi.name = defaultValue1; - const expectedHeaderRequestParams = `external_api.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateExternalApi = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateExternalApi(request), expectedError); - const actualRequest = (client.innerApiCalls.updateExternalApi as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateExternalApi as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateExternalApi with closed client', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.UpdateExternalApiRequest() - ); - request.externalApi ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.UpdateExternalApiRequest', ['externalApi', 'name']); - request.externalApi.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateExternalApi(request), expectedError); - }); - }); - - describe('deleteExternalApi', () => { - it('invokes deleteExternalApi without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.DeleteExternalApiRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.DeleteExternalApiRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteExternalApi = stubSimpleCall(expectedResponse); - const [response] = await client.deleteExternalApi(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteExternalApi as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteExternalApi as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteExternalApi without error using callback', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.DeleteExternalApiRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.DeleteExternalApiRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteExternalApi = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteExternalApi( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteExternalApi as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteExternalApi as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteExternalApi with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.DeleteExternalApiRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.DeleteExternalApiRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteExternalApi = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteExternalApi(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteExternalApi as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteExternalApi as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteExternalApi with closed client', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.DeleteExternalApiRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.DeleteExternalApiRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.deleteExternalApi(request), expectedError); - }); - }); - - describe('listApis', () => { - it('invokes listApis without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListApisRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListApisRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apihub.v1.Api()), - generateSampleMessage(new protos.google.cloud.apihub.v1.Api()), - generateSampleMessage(new protos.google.cloud.apihub.v1.Api()), - ]; - client.innerApiCalls.listApis = stubSimpleCall(expectedResponse); - const [response] = await client.listApis(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listApis as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listApis as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listApis without error using callback', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListApisRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListApisRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apihub.v1.Api()), - generateSampleMessage(new protos.google.cloud.apihub.v1.Api()), - generateSampleMessage(new protos.google.cloud.apihub.v1.Api()), - ]; - client.innerApiCalls.listApis = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listApis( - request, - (err?: Error|null, result?: protos.google.cloud.apihub.v1.IApi[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listApis as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listApis as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listApis with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListApisRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListApisRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listApis = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listApis(request), expectedError); - const actualRequest = (client.innerApiCalls.listApis as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listApis as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listApisStream without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListApisRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListApisRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apihub.v1.Api()), - generateSampleMessage(new protos.google.cloud.apihub.v1.Api()), - generateSampleMessage(new protos.google.cloud.apihub.v1.Api()), - ]; - client.descriptors.page.listApis.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listApisStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.apihub.v1.Api[] = []; - stream.on('data', (response: protos.google.cloud.apihub.v1.Api) => { - 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.listApis.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listApis, request)); - assert( - (client.descriptors.page.listApis.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listApisStream with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListApisRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListApisRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listApis.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listApisStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.apihub.v1.Api[] = []; - stream.on('data', (response: protos.google.cloud.apihub.v1.Api) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listApis.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listApis, request)); - assert( - (client.descriptors.page.listApis.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listApis without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListApisRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListApisRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apihub.v1.Api()), - generateSampleMessage(new protos.google.cloud.apihub.v1.Api()), - generateSampleMessage(new protos.google.cloud.apihub.v1.Api()), - ]; - client.descriptors.page.listApis.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.apihub.v1.IApi[] = []; - const iterable = client.listApisAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listApis.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listApis.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listApis with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListApisRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListApisRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listApis.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listApisAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.apihub.v1.IApi[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listApis.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listApis.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listVersions', () => { - it('invokes listVersions without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListVersionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListVersionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apihub.v1.Version()), - generateSampleMessage(new protos.google.cloud.apihub.v1.Version()), - generateSampleMessage(new protos.google.cloud.apihub.v1.Version()), - ]; - client.innerApiCalls.listVersions = stubSimpleCall(expectedResponse); - const [response] = await client.listVersions(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listVersions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listVersions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listVersions without error using callback', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListVersionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListVersionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apihub.v1.Version()), - generateSampleMessage(new protos.google.cloud.apihub.v1.Version()), - generateSampleMessage(new protos.google.cloud.apihub.v1.Version()), - ]; - client.innerApiCalls.listVersions = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listVersions( - request, - (err?: Error|null, result?: protos.google.cloud.apihub.v1.IVersion[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listVersions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listVersions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listVersions with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListVersionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListVersionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listVersions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listVersions(request), expectedError); - const actualRequest = (client.innerApiCalls.listVersions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listVersions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listVersionsStream without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListVersionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListVersionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apihub.v1.Version()), - generateSampleMessage(new protos.google.cloud.apihub.v1.Version()), - generateSampleMessage(new protos.google.cloud.apihub.v1.Version()), - ]; - client.descriptors.page.listVersions.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listVersionsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.apihub.v1.Version[] = []; - stream.on('data', (response: protos.google.cloud.apihub.v1.Version) => { - 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.listVersions.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listVersions, request)); - assert( - (client.descriptors.page.listVersions.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listVersionsStream with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListVersionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListVersionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listVersions.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listVersionsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.apihub.v1.Version[] = []; - stream.on('data', (response: protos.google.cloud.apihub.v1.Version) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listVersions.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listVersions, request)); - assert( - (client.descriptors.page.listVersions.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listVersions without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListVersionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListVersionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apihub.v1.Version()), - generateSampleMessage(new protos.google.cloud.apihub.v1.Version()), - generateSampleMessage(new protos.google.cloud.apihub.v1.Version()), - ]; - client.descriptors.page.listVersions.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.apihub.v1.IVersion[] = []; - const iterable = client.listVersionsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listVersions.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listVersions.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listVersions with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListVersionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListVersionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listVersions.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listVersionsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.apihub.v1.IVersion[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listVersions.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listVersions.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listSpecs', () => { - it('invokes listSpecs without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListSpecsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListSpecsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apihub.v1.Spec()), - generateSampleMessage(new protos.google.cloud.apihub.v1.Spec()), - generateSampleMessage(new protos.google.cloud.apihub.v1.Spec()), - ]; - client.innerApiCalls.listSpecs = stubSimpleCall(expectedResponse); - const [response] = await client.listSpecs(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listSpecs as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listSpecs as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listSpecs without error using callback', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListSpecsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListSpecsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apihub.v1.Spec()), - generateSampleMessage(new protos.google.cloud.apihub.v1.Spec()), - generateSampleMessage(new protos.google.cloud.apihub.v1.Spec()), - ]; - client.innerApiCalls.listSpecs = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listSpecs( - request, - (err?: Error|null, result?: protos.google.cloud.apihub.v1.ISpec[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listSpecs as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listSpecs as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listSpecs with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListSpecsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListSpecsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listSpecs = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listSpecs(request), expectedError); - const actualRequest = (client.innerApiCalls.listSpecs as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listSpecs as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listSpecsStream without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListSpecsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListSpecsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apihub.v1.Spec()), - generateSampleMessage(new protos.google.cloud.apihub.v1.Spec()), - generateSampleMessage(new protos.google.cloud.apihub.v1.Spec()), - ]; - client.descriptors.page.listSpecs.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listSpecsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.apihub.v1.Spec[] = []; - stream.on('data', (response: protos.google.cloud.apihub.v1.Spec) => { - 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.listSpecs.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listSpecs, request)); - assert( - (client.descriptors.page.listSpecs.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listSpecsStream with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListSpecsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListSpecsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listSpecs.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listSpecsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.apihub.v1.Spec[] = []; - stream.on('data', (response: protos.google.cloud.apihub.v1.Spec) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listSpecs.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listSpecs, request)); - assert( - (client.descriptors.page.listSpecs.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listSpecs without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListSpecsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListSpecsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apihub.v1.Spec()), - generateSampleMessage(new protos.google.cloud.apihub.v1.Spec()), - generateSampleMessage(new protos.google.cloud.apihub.v1.Spec()), - ]; - client.descriptors.page.listSpecs.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.apihub.v1.ISpec[] = []; - const iterable = client.listSpecsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listSpecs.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listSpecs.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listSpecs with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListSpecsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListSpecsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listSpecs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listSpecsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.apihub.v1.ISpec[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listSpecs.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listSpecs.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listApiOperations', () => { - it('invokes listApiOperations without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListApiOperationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListApiOperationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apihub.v1.ApiOperation()), - generateSampleMessage(new protos.google.cloud.apihub.v1.ApiOperation()), - generateSampleMessage(new protos.google.cloud.apihub.v1.ApiOperation()), - ]; - client.innerApiCalls.listApiOperations = stubSimpleCall(expectedResponse); - const [response] = await client.listApiOperations(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listApiOperations as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listApiOperations as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listApiOperations without error using callback', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListApiOperationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListApiOperationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apihub.v1.ApiOperation()), - generateSampleMessage(new protos.google.cloud.apihub.v1.ApiOperation()), - generateSampleMessage(new protos.google.cloud.apihub.v1.ApiOperation()), - ]; - client.innerApiCalls.listApiOperations = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listApiOperations( - request, - (err?: Error|null, result?: protos.google.cloud.apihub.v1.IApiOperation[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listApiOperations as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listApiOperations as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listApiOperations with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListApiOperationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListApiOperationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listApiOperations = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listApiOperations(request), expectedError); - const actualRequest = (client.innerApiCalls.listApiOperations as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listApiOperations as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listApiOperationsStream without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListApiOperationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListApiOperationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apihub.v1.ApiOperation()), - generateSampleMessage(new protos.google.cloud.apihub.v1.ApiOperation()), - generateSampleMessage(new protos.google.cloud.apihub.v1.ApiOperation()), - ]; - client.descriptors.page.listApiOperations.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listApiOperationsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.apihub.v1.ApiOperation[] = []; - stream.on('data', (response: protos.google.cloud.apihub.v1.ApiOperation) => { - 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.listApiOperations.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listApiOperations, request)); - assert( - (client.descriptors.page.listApiOperations.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listApiOperationsStream with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListApiOperationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListApiOperationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listApiOperations.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listApiOperationsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.apihub.v1.ApiOperation[] = []; - stream.on('data', (response: protos.google.cloud.apihub.v1.ApiOperation) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listApiOperations.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listApiOperations, request)); - assert( - (client.descriptors.page.listApiOperations.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listApiOperations without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListApiOperationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListApiOperationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apihub.v1.ApiOperation()), - generateSampleMessage(new protos.google.cloud.apihub.v1.ApiOperation()), - generateSampleMessage(new protos.google.cloud.apihub.v1.ApiOperation()), - ]; - client.descriptors.page.listApiOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.apihub.v1.IApiOperation[] = []; - const iterable = client.listApiOperationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listApiOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listApiOperations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listApiOperations with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListApiOperationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListApiOperationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listApiOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listApiOperationsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.apihub.v1.IApiOperation[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listApiOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listApiOperations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listDeployments', () => { - it('invokes listDeployments without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListDeploymentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListDeploymentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apihub.v1.Deployment()), - generateSampleMessage(new protos.google.cloud.apihub.v1.Deployment()), - generateSampleMessage(new protos.google.cloud.apihub.v1.Deployment()), - ]; - client.innerApiCalls.listDeployments = stubSimpleCall(expectedResponse); - const [response] = await client.listDeployments(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listDeployments as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listDeployments as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listDeployments without error using callback', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListDeploymentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListDeploymentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apihub.v1.Deployment()), - generateSampleMessage(new protos.google.cloud.apihub.v1.Deployment()), - generateSampleMessage(new protos.google.cloud.apihub.v1.Deployment()), - ]; - client.innerApiCalls.listDeployments = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listDeployments( - request, - (err?: Error|null, result?: protos.google.cloud.apihub.v1.IDeployment[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listDeployments as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listDeployments as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listDeployments with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListDeploymentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListDeploymentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listDeployments = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listDeployments(request), expectedError); - const actualRequest = (client.innerApiCalls.listDeployments as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listDeployments as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listDeploymentsStream without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListDeploymentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListDeploymentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apihub.v1.Deployment()), - generateSampleMessage(new protos.google.cloud.apihub.v1.Deployment()), - generateSampleMessage(new protos.google.cloud.apihub.v1.Deployment()), - ]; - client.descriptors.page.listDeployments.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listDeploymentsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.apihub.v1.Deployment[] = []; - stream.on('data', (response: protos.google.cloud.apihub.v1.Deployment) => { - 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.listDeployments.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listDeployments, request)); - assert( - (client.descriptors.page.listDeployments.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listDeploymentsStream with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListDeploymentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListDeploymentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listDeployments.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listDeploymentsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.apihub.v1.Deployment[] = []; - stream.on('data', (response: protos.google.cloud.apihub.v1.Deployment) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listDeployments.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listDeployments, request)); - assert( - (client.descriptors.page.listDeployments.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listDeployments without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListDeploymentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListDeploymentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apihub.v1.Deployment()), - generateSampleMessage(new protos.google.cloud.apihub.v1.Deployment()), - generateSampleMessage(new protos.google.cloud.apihub.v1.Deployment()), - ]; - client.descriptors.page.listDeployments.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.apihub.v1.IDeployment[] = []; - const iterable = client.listDeploymentsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listDeployments.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listDeployments.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listDeployments with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListDeploymentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListDeploymentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listDeployments.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listDeploymentsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.apihub.v1.IDeployment[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listDeployments.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listDeployments.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listAttributes', () => { - it('invokes listAttributes without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListAttributesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListAttributesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apihub.v1.Attribute()), - generateSampleMessage(new protos.google.cloud.apihub.v1.Attribute()), - generateSampleMessage(new protos.google.cloud.apihub.v1.Attribute()), - ]; - client.innerApiCalls.listAttributes = stubSimpleCall(expectedResponse); - const [response] = await client.listAttributes(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listAttributes as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listAttributes as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listAttributes without error using callback', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListAttributesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListAttributesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apihub.v1.Attribute()), - generateSampleMessage(new protos.google.cloud.apihub.v1.Attribute()), - generateSampleMessage(new protos.google.cloud.apihub.v1.Attribute()), - ]; - client.innerApiCalls.listAttributes = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listAttributes( - request, - (err?: Error|null, result?: protos.google.cloud.apihub.v1.IAttribute[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listAttributes as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listAttributes as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listAttributes with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListAttributesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListAttributesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listAttributes = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listAttributes(request), expectedError); - const actualRequest = (client.innerApiCalls.listAttributes as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listAttributes as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listAttributesStream without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListAttributesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListAttributesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apihub.v1.Attribute()), - generateSampleMessage(new protos.google.cloud.apihub.v1.Attribute()), - generateSampleMessage(new protos.google.cloud.apihub.v1.Attribute()), - ]; - client.descriptors.page.listAttributes.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listAttributesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.apihub.v1.Attribute[] = []; - stream.on('data', (response: protos.google.cloud.apihub.v1.Attribute) => { - 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.listAttributes.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listAttributes, request)); - assert( - (client.descriptors.page.listAttributes.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listAttributesStream with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListAttributesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListAttributesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listAttributes.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listAttributesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.apihub.v1.Attribute[] = []; - stream.on('data', (response: protos.google.cloud.apihub.v1.Attribute) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listAttributes.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listAttributes, request)); - assert( - (client.descriptors.page.listAttributes.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listAttributes without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListAttributesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListAttributesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apihub.v1.Attribute()), - generateSampleMessage(new protos.google.cloud.apihub.v1.Attribute()), - generateSampleMessage(new protos.google.cloud.apihub.v1.Attribute()), - ]; - client.descriptors.page.listAttributes.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.apihub.v1.IAttribute[] = []; - const iterable = client.listAttributesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listAttributes.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listAttributes.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listAttributes with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListAttributesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListAttributesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listAttributes.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listAttributesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.apihub.v1.IAttribute[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listAttributes.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listAttributes.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('searchResources', () => { - it('invokes searchResources without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.SearchResourcesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.SearchResourcesRequest', ['location']); - request.location = defaultValue1; - const expectedHeaderRequestParams = `location=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apihub.v1.SearchResult()), - generateSampleMessage(new protos.google.cloud.apihub.v1.SearchResult()), - generateSampleMessage(new protos.google.cloud.apihub.v1.SearchResult()), - ]; - client.innerApiCalls.searchResources = stubSimpleCall(expectedResponse); - const [response] = await client.searchResources(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.searchResources as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.searchResources as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes searchResources without error using callback', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.SearchResourcesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.SearchResourcesRequest', ['location']); - request.location = defaultValue1; - const expectedHeaderRequestParams = `location=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apihub.v1.SearchResult()), - generateSampleMessage(new protos.google.cloud.apihub.v1.SearchResult()), - generateSampleMessage(new protos.google.cloud.apihub.v1.SearchResult()), - ]; - client.innerApiCalls.searchResources = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.searchResources( - request, - (err?: Error|null, result?: protos.google.cloud.apihub.v1.ISearchResult[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.searchResources as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.searchResources as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes searchResources with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.SearchResourcesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.SearchResourcesRequest', ['location']); - request.location = defaultValue1; - const expectedHeaderRequestParams = `location=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.searchResources = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.searchResources(request), expectedError); - const actualRequest = (client.innerApiCalls.searchResources as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.searchResources as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes searchResourcesStream without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.SearchResourcesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.SearchResourcesRequest', ['location']); - request.location = defaultValue1; - const expectedHeaderRequestParams = `location=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apihub.v1.SearchResult()), - generateSampleMessage(new protos.google.cloud.apihub.v1.SearchResult()), - generateSampleMessage(new protos.google.cloud.apihub.v1.SearchResult()), - ]; - client.descriptors.page.searchResources.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.searchResourcesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.apihub.v1.SearchResult[] = []; - stream.on('data', (response: protos.google.cloud.apihub.v1.SearchResult) => { - 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.searchResources.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.searchResources, request)); - assert( - (client.descriptors.page.searchResources.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes searchResourcesStream with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.SearchResourcesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.SearchResourcesRequest', ['location']); - request.location = defaultValue1; - const expectedHeaderRequestParams = `location=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.searchResources.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.searchResourcesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.apihub.v1.SearchResult[] = []; - stream.on('data', (response: protos.google.cloud.apihub.v1.SearchResult) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.searchResources.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.searchResources, request)); - assert( - (client.descriptors.page.searchResources.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with searchResources without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.SearchResourcesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.SearchResourcesRequest', ['location']); - request.location = defaultValue1; - const expectedHeaderRequestParams = `location=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apihub.v1.SearchResult()), - generateSampleMessage(new protos.google.cloud.apihub.v1.SearchResult()), - generateSampleMessage(new protos.google.cloud.apihub.v1.SearchResult()), - ]; - client.descriptors.page.searchResources.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.apihub.v1.ISearchResult[] = []; - const iterable = client.searchResourcesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.searchResources.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.searchResources.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with searchResources with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.SearchResourcesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.SearchResourcesRequest', ['location']); - request.location = defaultValue1; - const expectedHeaderRequestParams = `location=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.searchResources.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.searchResourcesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.apihub.v1.ISearchResult[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.searchResources.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.searchResources.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listExternalApis', () => { - it('invokes listExternalApis without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListExternalApisRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListExternalApisRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apihub.v1.ExternalApi()), - generateSampleMessage(new protos.google.cloud.apihub.v1.ExternalApi()), - generateSampleMessage(new protos.google.cloud.apihub.v1.ExternalApi()), - ]; - client.innerApiCalls.listExternalApis = stubSimpleCall(expectedResponse); - const [response] = await client.listExternalApis(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listExternalApis as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listExternalApis as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listExternalApis without error using callback', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListExternalApisRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListExternalApisRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apihub.v1.ExternalApi()), - generateSampleMessage(new protos.google.cloud.apihub.v1.ExternalApi()), - generateSampleMessage(new protos.google.cloud.apihub.v1.ExternalApi()), - ]; - client.innerApiCalls.listExternalApis = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listExternalApis( - request, - (err?: Error|null, result?: protos.google.cloud.apihub.v1.IExternalApi[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listExternalApis as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listExternalApis as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listExternalApis with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListExternalApisRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListExternalApisRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listExternalApis = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listExternalApis(request), expectedError); - const actualRequest = (client.innerApiCalls.listExternalApis as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listExternalApis as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listExternalApisStream without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListExternalApisRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListExternalApisRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apihub.v1.ExternalApi()), - generateSampleMessage(new protos.google.cloud.apihub.v1.ExternalApi()), - generateSampleMessage(new protos.google.cloud.apihub.v1.ExternalApi()), - ]; - client.descriptors.page.listExternalApis.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listExternalApisStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.apihub.v1.ExternalApi[] = []; - stream.on('data', (response: protos.google.cloud.apihub.v1.ExternalApi) => { - 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.listExternalApis.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listExternalApis, request)); - assert( - (client.descriptors.page.listExternalApis.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listExternalApisStream with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListExternalApisRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListExternalApisRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listExternalApis.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listExternalApisStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.apihub.v1.ExternalApi[] = []; - stream.on('data', (response: protos.google.cloud.apihub.v1.ExternalApi) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listExternalApis.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listExternalApis, request)); - assert( - (client.descriptors.page.listExternalApis.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listExternalApis without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListExternalApisRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListExternalApisRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apihub.v1.ExternalApi()), - generateSampleMessage(new protos.google.cloud.apihub.v1.ExternalApi()), - generateSampleMessage(new protos.google.cloud.apihub.v1.ExternalApi()), - ]; - client.descriptors.page.listExternalApis.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.apihub.v1.IExternalApi[] = []; - const iterable = client.listExternalApisAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listExternalApis.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listExternalApis.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listExternalApis with error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListExternalApisRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListExternalApisRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listExternalApis.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listExternalApisAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.apihub.v1.IExternalApi[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listExternalApis.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listExternalApis.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getLocation', () => { - it('invokes getLocation without error', async () => { - const client = new apihubModule.v1.ApiHubClient({ - auth: googleAuth, - 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 apihubModule.v1.ApiHubClient({ - auth: googleAuth, - 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 apihubModule.v1.ApiHubClient({ - auth: googleAuth, - 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 apihubModule.v1.ApiHubClient({ - auth: googleAuth, - 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 apihubModule.v1.ApiHubClient({ - 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('Path templates', () => { - - describe('api', () => { - const fakePath = "/rendered/path/api"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - api: "apiValue", - }; - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.apiPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.apiPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('apiPath', () => { - const result = client.apiPath("projectValue", "locationValue", "apiValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.apiPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromApiName', () => { - const result = client.matchProjectFromApiName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.apiPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromApiName', () => { - const result = client.matchLocationFromApiName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.apiPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchApiFromApiName', () => { - const result = client.matchApiFromApiName(fakePath); - assert.strictEqual(result, "apiValue"); - assert((client.pathTemplates.apiPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('apiHubInstance', () => { - const fakePath = "/rendered/path/apiHubInstance"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - api_hub_instance: "apiHubInstanceValue", - }; - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.apiHubInstancePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.apiHubInstancePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('apiHubInstancePath', () => { - const result = client.apiHubInstancePath("projectValue", "locationValue", "apiHubInstanceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.apiHubInstancePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromApiHubInstanceName', () => { - const result = client.matchProjectFromApiHubInstanceName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromApiHubInstanceName', () => { - const result = client.matchLocationFromApiHubInstanceName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchApiHubInstanceFromApiHubInstanceName', () => { - const result = client.matchApiHubInstanceFromApiHubInstanceName(fakePath); - assert.strictEqual(result, "apiHubInstanceValue"); - assert((client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('apiOperation', () => { - const fakePath = "/rendered/path/apiOperation"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - api: "apiValue", - version: "versionValue", - operation: "operationValue", - }; - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.apiOperationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.apiOperationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('apiOperationPath', () => { - const result = client.apiOperationPath("projectValue", "locationValue", "apiValue", "versionValue", "operationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.apiOperationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromApiOperationName', () => { - const result = client.matchProjectFromApiOperationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromApiOperationName', () => { - const result = client.matchLocationFromApiOperationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchApiFromApiOperationName', () => { - const result = client.matchApiFromApiOperationName(fakePath); - assert.strictEqual(result, "apiValue"); - assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchVersionFromApiOperationName', () => { - const result = client.matchVersionFromApiOperationName(fakePath); - assert.strictEqual(result, "versionValue"); - assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchOperationFromApiOperationName', () => { - const result = client.matchOperationFromApiOperationName(fakePath); - assert.strictEqual(result, "operationValue"); - assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('attribute', () => { - const fakePath = "/rendered/path/attribute"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - attribute: "attributeValue", - }; - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.attributePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.attributePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('attributePath', () => { - const result = client.attributePath("projectValue", "locationValue", "attributeValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.attributePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromAttributeName', () => { - const result = client.matchProjectFromAttributeName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.attributePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromAttributeName', () => { - const result = client.matchLocationFromAttributeName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.attributePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAttributeFromAttributeName', () => { - const result = client.matchAttributeFromAttributeName(fakePath); - assert.strictEqual(result, "attributeValue"); - assert((client.pathTemplates.attributePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('definition', () => { - const fakePath = "/rendered/path/definition"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - api: "apiValue", - version: "versionValue", - definition: "definitionValue", - }; - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.definitionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.definitionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('definitionPath', () => { - const result = client.definitionPath("projectValue", "locationValue", "apiValue", "versionValue", "definitionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.definitionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDefinitionName', () => { - const result = client.matchProjectFromDefinitionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDefinitionName', () => { - const result = client.matchLocationFromDefinitionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchApiFromDefinitionName', () => { - const result = client.matchApiFromDefinitionName(fakePath); - assert.strictEqual(result, "apiValue"); - assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchVersionFromDefinitionName', () => { - const result = client.matchVersionFromDefinitionName(fakePath); - assert.strictEqual(result, "versionValue"); - assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDefinitionFromDefinitionName', () => { - const result = client.matchDefinitionFromDefinitionName(fakePath); - assert.strictEqual(result, "definitionValue"); - assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dependency', () => { - const fakePath = "/rendered/path/dependency"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dependency: "dependencyValue", - }; - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.dependencyPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.dependencyPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('dependencyPath', () => { - const result = client.dependencyPath("projectValue", "locationValue", "dependencyValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.dependencyPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDependencyName', () => { - const result = client.matchProjectFromDependencyName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.dependencyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDependencyName', () => { - const result = client.matchLocationFromDependencyName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.dependencyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDependencyFromDependencyName', () => { - const result = client.matchDependencyFromDependencyName(fakePath); - assert.strictEqual(result, "dependencyValue"); - assert((client.pathTemplates.dependencyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('deployment', () => { - const fakePath = "/rendered/path/deployment"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - deployment: "deploymentValue", - }; - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.deploymentPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.deploymentPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('deploymentPath', () => { - const result = client.deploymentPath("projectValue", "locationValue", "deploymentValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.deploymentPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDeploymentName', () => { - const result = client.matchProjectFromDeploymentName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDeploymentName', () => { - const result = client.matchLocationFromDeploymentName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDeploymentFromDeploymentName', () => { - const result = client.matchDeploymentFromDeploymentName(fakePath); - assert.strictEqual(result, "deploymentValue"); - assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('externalApi', () => { - const fakePath = "/rendered/path/externalApi"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - external_api: "externalApiValue", - }; - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.externalApiPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.externalApiPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('externalApiPath', () => { - const result = client.externalApiPath("projectValue", "locationValue", "externalApiValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.externalApiPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromExternalApiName', () => { - const result = client.matchProjectFromExternalApiName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.externalApiPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromExternalApiName', () => { - const result = client.matchLocationFromExternalApiName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.externalApiPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExternalApiFromExternalApiName', () => { - const result = client.matchExternalApiFromExternalApiName(fakePath); - assert.strictEqual(result, "externalApiValue"); - assert((client.pathTemplates.externalApiPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('hostProjectRegistration', () => { - const fakePath = "/rendered/path/hostProjectRegistration"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - host_project_registration: "hostProjectRegistrationValue", - }; - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.hostProjectRegistrationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.hostProjectRegistrationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('hostProjectRegistrationPath', () => { - const result = client.hostProjectRegistrationPath("projectValue", "locationValue", "hostProjectRegistrationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.hostProjectRegistrationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromHostProjectRegistrationName', () => { - const result = client.matchProjectFromHostProjectRegistrationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.hostProjectRegistrationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromHostProjectRegistrationName', () => { - const result = client.matchLocationFromHostProjectRegistrationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.hostProjectRegistrationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchHostProjectRegistrationFromHostProjectRegistrationName', () => { - const result = client.matchHostProjectRegistrationFromHostProjectRegistrationName(fakePath); - assert.strictEqual(result, "hostProjectRegistrationValue"); - assert((client.pathTemplates.hostProjectRegistrationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('location', () => { - const fakePath = "/rendered/path/location"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - }; - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.locationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.locationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('locationPath', () => { - const result = client.locationPath("projectValue", "locationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.locationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromLocationName', () => { - const result = client.matchProjectFromLocationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromLocationName', () => { - const result = client.matchLocationFromLocationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('plugin', () => { - const fakePath = "/rendered/path/plugin"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - plugin: "pluginValue", - }; - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.pluginPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.pluginPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('pluginPath', () => { - const result = client.pluginPath("projectValue", "locationValue", "pluginValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.pluginPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromPluginName', () => { - const result = client.matchProjectFromPluginName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.pluginPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromPluginName', () => { - const result = client.matchLocationFromPluginName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.pluginPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchPluginFromPluginName', () => { - const result = client.matchPluginFromPluginName(fakePath); - assert.strictEqual(result, "pluginValue"); - assert((client.pathTemplates.pluginPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('project', () => { - const fakePath = "/rendered/path/project"; - const expectedParameters = { - project: "projectValue", - }; - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.projectPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectPath', () => { - const result = client.projectPath("projectValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectName', () => { - const result = client.matchProjectFromProjectName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('runtimeProjectAttachment', () => { - const fakePath = "/rendered/path/runtimeProjectAttachment"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - runtime_project_attachment: "runtimeProjectAttachmentValue", - }; - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.runtimeProjectAttachmentPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.runtimeProjectAttachmentPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('runtimeProjectAttachmentPath', () => { - const result = client.runtimeProjectAttachmentPath("projectValue", "locationValue", "runtimeProjectAttachmentValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromRuntimeProjectAttachmentName', () => { - const result = client.matchProjectFromRuntimeProjectAttachmentName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromRuntimeProjectAttachmentName', () => { - const result = client.matchLocationFromRuntimeProjectAttachmentName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName', () => { - const result = client.matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName(fakePath); - assert.strictEqual(result, "runtimeProjectAttachmentValue"); - assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('spec', () => { - const fakePath = "/rendered/path/spec"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - api: "apiValue", - version: "versionValue", - spec: "specValue", - }; - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.specPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.specPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('specPath', () => { - const result = client.specPath("projectValue", "locationValue", "apiValue", "versionValue", "specValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.specPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSpecName', () => { - const result = client.matchProjectFromSpecName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.specPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSpecName', () => { - const result = client.matchLocationFromSpecName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.specPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchApiFromSpecName', () => { - const result = client.matchApiFromSpecName(fakePath); - assert.strictEqual(result, "apiValue"); - assert((client.pathTemplates.specPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchVersionFromSpecName', () => { - const result = client.matchVersionFromSpecName(fakePath); - assert.strictEqual(result, "versionValue"); - assert((client.pathTemplates.specPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSpecFromSpecName', () => { - const result = client.matchSpecFromSpecName(fakePath); - assert.strictEqual(result, "specValue"); - assert((client.pathTemplates.specPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('styleGuide', () => { - const fakePath = "/rendered/path/styleGuide"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - plugin: "pluginValue", - }; - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.styleGuidePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.styleGuidePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('styleGuidePath', () => { - const result = client.styleGuidePath("projectValue", "locationValue", "pluginValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.styleGuidePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromStyleGuideName', () => { - const result = client.matchProjectFromStyleGuideName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.styleGuidePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromStyleGuideName', () => { - const result = client.matchLocationFromStyleGuideName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.styleGuidePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchPluginFromStyleGuideName', () => { - const result = client.matchPluginFromStyleGuideName(fakePath); - assert.strictEqual(result, "pluginValue"); - assert((client.pathTemplates.styleGuidePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('version', () => { - const fakePath = "/rendered/path/version"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - api: "apiValue", - version: "versionValue", - }; - const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.versionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.versionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('versionPath', () => { - const result = client.versionPath("projectValue", "locationValue", "apiValue", "versionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.versionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromVersionName', () => { - const result = client.matchProjectFromVersionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.versionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromVersionName', () => { - const result = client.matchLocationFromVersionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.versionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchApiFromVersionName', () => { - const result = client.matchApiFromVersionName(fakePath); - assert.strictEqual(result, "apiValue"); - assert((client.pathTemplates.versionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchVersionFromVersionName', () => { - const result = client.matchVersionFromVersionName(fakePath); - assert.strictEqual(result, "versionValue"); - assert((client.pathTemplates.versionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/google-cloud-apihub/v1/test/gapic_host_project_registration_service_v1.ts b/owl-bot-staging/google-cloud-apihub/v1/test/gapic_host_project_registration_service_v1.ts deleted file mode 100644 index cd39a1696b7..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/test/gapic_host_project_registration_service_v1.ts +++ /dev/null @@ -1,1670 +0,0 @@ -// Copyright 2024 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, beforeEach, afterEach} from 'mocha'; -import * as hostprojectregistrationserviceModule from '../src'; - -import {PassThrough} from 'stream'; - -import {GoogleAuth, protobuf, 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 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.HostProjectRegistrationServiceClient', () => { - let googleAuth: GoogleAuth; - beforeEach(() => { - googleAuth = { - getClient: sinon.stub().resolves({ - getRequestHeaders: sinon.stub().resolves({Authorization: 'Bearer SOME_TOKEN'}), - }) - } as unknown as GoogleAuth; - }); - afterEach(() => { - sinon.restore(); - }); - describe('Common methods', () => { - it('has apiEndpoint', () => { - const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient(); - const apiEndpoint = client.apiEndpoint; - assert.strictEqual(apiEndpoint, 'apihub.googleapis.com'); - }); - - it('has universeDomain', () => { - const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient(); - const universeDomain = client.universeDomain; - assert.strictEqual(universeDomain, "googleapis.com"); - }); - - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - it('throws DeprecationWarning if static servicePath is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const servicePath = hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient.servicePath; - assert.strictEqual(servicePath, 'apihub.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - - it('throws DeprecationWarning if static apiEndpoint is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const apiEndpoint = hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient.apiEndpoint; - assert.strictEqual(apiEndpoint, 'apihub.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - } - it('sets apiEndpoint according to universe domain camelCase', () => { - const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({universeDomain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'apihub.example.com'); - }); - - it('sets apiEndpoint according to universe domain snakeCase', () => { - const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({universe_domain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'apihub.example.com'); - }); - - if (typeof process === 'object' && 'env' in process) { - describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { - it('sets apiEndpoint from environment variable', () => { - const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; - const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient(); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'apihub.example.com'); - if (saved) { - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; - } else { - delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - } - }); - - it('value configured in code has priority over environment variable', () => { - const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; - const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({universeDomain: 'configured.example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'apihub.configured.example.com'); - if (saved) { - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; - } else { - delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - } - }); - }); - } - it('does not allow setting both universeDomain and universe_domain', () => { - assert.throws(() => { new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); - }); - - it('has port', () => { - const port = hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ - auth: googleAuth, - projectId: 'bogus', - }); - assert.strictEqual(client.hostProjectRegistrationServiceStub, undefined); - await client.initialize(); - assert(client.hostProjectRegistrationServiceStub); - }); - - it('has close method for the initialized client', done => { - const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - assert(client.hostProjectRegistrationServiceStub); - client.close().then(() => { - done(); - }); - }); - - it('has close method for the non-initialized client', done => { - const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ - auth: googleAuth, - projectId: 'bogus', - }); - assert.strictEqual(client.hostProjectRegistrationServiceStub, undefined); - client.close().then(() => { - done(); - }); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ - auth: googleAuth, - 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 hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ - auth: googleAuth, - 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('createHostProjectRegistration', () => { - it('invokes createHostProjectRegistration without error', async () => { - const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.CreateHostProjectRegistrationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.CreateHostProjectRegistrationRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.HostProjectRegistration() - ); - client.innerApiCalls.createHostProjectRegistration = stubSimpleCall(expectedResponse); - const [response] = await client.createHostProjectRegistration(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createHostProjectRegistration as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createHostProjectRegistration as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createHostProjectRegistration without error using callback', async () => { - const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.CreateHostProjectRegistrationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.CreateHostProjectRegistrationRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.HostProjectRegistration() - ); - client.innerApiCalls.createHostProjectRegistration = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createHostProjectRegistration( - request, - (err?: Error|null, result?: protos.google.cloud.apihub.v1.IHostProjectRegistration|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createHostProjectRegistration as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createHostProjectRegistration as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createHostProjectRegistration with error', async () => { - const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.CreateHostProjectRegistrationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.CreateHostProjectRegistrationRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createHostProjectRegistration = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createHostProjectRegistration(request), expectedError); - const actualRequest = (client.innerApiCalls.createHostProjectRegistration as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createHostProjectRegistration as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createHostProjectRegistration with closed client', async () => { - const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.CreateHostProjectRegistrationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.CreateHostProjectRegistrationRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createHostProjectRegistration(request), expectedError); - }); - }); - - describe('getHostProjectRegistration', () => { - it('invokes getHostProjectRegistration without error', async () => { - const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetHostProjectRegistrationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetHostProjectRegistrationRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.HostProjectRegistration() - ); - client.innerApiCalls.getHostProjectRegistration = stubSimpleCall(expectedResponse); - const [response] = await client.getHostProjectRegistration(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getHostProjectRegistration as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getHostProjectRegistration as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getHostProjectRegistration without error using callback', async () => { - const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetHostProjectRegistrationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetHostProjectRegistrationRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.HostProjectRegistration() - ); - client.innerApiCalls.getHostProjectRegistration = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getHostProjectRegistration( - request, - (err?: Error|null, result?: protos.google.cloud.apihub.v1.IHostProjectRegistration|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getHostProjectRegistration as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getHostProjectRegistration as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getHostProjectRegistration with error', async () => { - const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetHostProjectRegistrationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetHostProjectRegistrationRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getHostProjectRegistration = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getHostProjectRegistration(request), expectedError); - const actualRequest = (client.innerApiCalls.getHostProjectRegistration as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getHostProjectRegistration as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getHostProjectRegistration with closed client', async () => { - const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetHostProjectRegistrationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetHostProjectRegistrationRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getHostProjectRegistration(request), expectedError); - }); - }); - - describe('listHostProjectRegistrations', () => { - it('invokes listHostProjectRegistrations without error', async () => { - const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apihub.v1.HostProjectRegistration()), - generateSampleMessage(new protos.google.cloud.apihub.v1.HostProjectRegistration()), - generateSampleMessage(new protos.google.cloud.apihub.v1.HostProjectRegistration()), - ]; - client.innerApiCalls.listHostProjectRegistrations = stubSimpleCall(expectedResponse); - const [response] = await client.listHostProjectRegistrations(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listHostProjectRegistrations as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listHostProjectRegistrations as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listHostProjectRegistrations without error using callback', async () => { - const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apihub.v1.HostProjectRegistration()), - generateSampleMessage(new protos.google.cloud.apihub.v1.HostProjectRegistration()), - generateSampleMessage(new protos.google.cloud.apihub.v1.HostProjectRegistration()), - ]; - client.innerApiCalls.listHostProjectRegistrations = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listHostProjectRegistrations( - request, - (err?: Error|null, result?: protos.google.cloud.apihub.v1.IHostProjectRegistration[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listHostProjectRegistrations as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listHostProjectRegistrations as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listHostProjectRegistrations with error', async () => { - const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listHostProjectRegistrations = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listHostProjectRegistrations(request), expectedError); - const actualRequest = (client.innerApiCalls.listHostProjectRegistrations as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listHostProjectRegistrations as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listHostProjectRegistrationsStream without error', async () => { - const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apihub.v1.HostProjectRegistration()), - generateSampleMessage(new protos.google.cloud.apihub.v1.HostProjectRegistration()), - generateSampleMessage(new protos.google.cloud.apihub.v1.HostProjectRegistration()), - ]; - client.descriptors.page.listHostProjectRegistrations.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listHostProjectRegistrationsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.apihub.v1.HostProjectRegistration[] = []; - stream.on('data', (response: protos.google.cloud.apihub.v1.HostProjectRegistration) => { - 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.listHostProjectRegistrations.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listHostProjectRegistrations, request)); - assert( - (client.descriptors.page.listHostProjectRegistrations.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listHostProjectRegistrationsStream with error', async () => { - const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listHostProjectRegistrations.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listHostProjectRegistrationsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.apihub.v1.HostProjectRegistration[] = []; - stream.on('data', (response: protos.google.cloud.apihub.v1.HostProjectRegistration) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listHostProjectRegistrations.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listHostProjectRegistrations, request)); - assert( - (client.descriptors.page.listHostProjectRegistrations.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listHostProjectRegistrations without error', async () => { - const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apihub.v1.HostProjectRegistration()), - generateSampleMessage(new protos.google.cloud.apihub.v1.HostProjectRegistration()), - generateSampleMessage(new protos.google.cloud.apihub.v1.HostProjectRegistration()), - ]; - client.descriptors.page.listHostProjectRegistrations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.apihub.v1.IHostProjectRegistration[] = []; - const iterable = client.listHostProjectRegistrationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listHostProjectRegistrations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listHostProjectRegistrations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listHostProjectRegistrations with error', async () => { - const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListHostProjectRegistrationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listHostProjectRegistrations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listHostProjectRegistrationsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.apihub.v1.IHostProjectRegistration[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listHostProjectRegistrations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listHostProjectRegistrations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getLocation', () => { - it('invokes getLocation without error', async () => { - const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ - auth: googleAuth, - 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 hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ - auth: googleAuth, - 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 hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ - auth: googleAuth, - 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 hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ - auth: googleAuth, - 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 hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ - 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('Path templates', () => { - - describe('api', () => { - const fakePath = "/rendered/path/api"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - api: "apiValue", - }; - const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.apiPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.apiPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('apiPath', () => { - const result = client.apiPath("projectValue", "locationValue", "apiValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.apiPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromApiName', () => { - const result = client.matchProjectFromApiName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.apiPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromApiName', () => { - const result = client.matchLocationFromApiName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.apiPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchApiFromApiName', () => { - const result = client.matchApiFromApiName(fakePath); - assert.strictEqual(result, "apiValue"); - assert((client.pathTemplates.apiPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('apiHubInstance', () => { - const fakePath = "/rendered/path/apiHubInstance"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - api_hub_instance: "apiHubInstanceValue", - }; - const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.apiHubInstancePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.apiHubInstancePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('apiHubInstancePath', () => { - const result = client.apiHubInstancePath("projectValue", "locationValue", "apiHubInstanceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.apiHubInstancePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromApiHubInstanceName', () => { - const result = client.matchProjectFromApiHubInstanceName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromApiHubInstanceName', () => { - const result = client.matchLocationFromApiHubInstanceName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchApiHubInstanceFromApiHubInstanceName', () => { - const result = client.matchApiHubInstanceFromApiHubInstanceName(fakePath); - assert.strictEqual(result, "apiHubInstanceValue"); - assert((client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('apiOperation', () => { - const fakePath = "/rendered/path/apiOperation"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - api: "apiValue", - version: "versionValue", - operation: "operationValue", - }; - const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.apiOperationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.apiOperationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('apiOperationPath', () => { - const result = client.apiOperationPath("projectValue", "locationValue", "apiValue", "versionValue", "operationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.apiOperationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromApiOperationName', () => { - const result = client.matchProjectFromApiOperationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromApiOperationName', () => { - const result = client.matchLocationFromApiOperationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchApiFromApiOperationName', () => { - const result = client.matchApiFromApiOperationName(fakePath); - assert.strictEqual(result, "apiValue"); - assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchVersionFromApiOperationName', () => { - const result = client.matchVersionFromApiOperationName(fakePath); - assert.strictEqual(result, "versionValue"); - assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchOperationFromApiOperationName', () => { - const result = client.matchOperationFromApiOperationName(fakePath); - assert.strictEqual(result, "operationValue"); - assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('attribute', () => { - const fakePath = "/rendered/path/attribute"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - attribute: "attributeValue", - }; - const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.attributePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.attributePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('attributePath', () => { - const result = client.attributePath("projectValue", "locationValue", "attributeValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.attributePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromAttributeName', () => { - const result = client.matchProjectFromAttributeName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.attributePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromAttributeName', () => { - const result = client.matchLocationFromAttributeName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.attributePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAttributeFromAttributeName', () => { - const result = client.matchAttributeFromAttributeName(fakePath); - assert.strictEqual(result, "attributeValue"); - assert((client.pathTemplates.attributePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('definition', () => { - const fakePath = "/rendered/path/definition"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - api: "apiValue", - version: "versionValue", - definition: "definitionValue", - }; - const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.definitionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.definitionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('definitionPath', () => { - const result = client.definitionPath("projectValue", "locationValue", "apiValue", "versionValue", "definitionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.definitionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDefinitionName', () => { - const result = client.matchProjectFromDefinitionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDefinitionName', () => { - const result = client.matchLocationFromDefinitionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchApiFromDefinitionName', () => { - const result = client.matchApiFromDefinitionName(fakePath); - assert.strictEqual(result, "apiValue"); - assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchVersionFromDefinitionName', () => { - const result = client.matchVersionFromDefinitionName(fakePath); - assert.strictEqual(result, "versionValue"); - assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDefinitionFromDefinitionName', () => { - const result = client.matchDefinitionFromDefinitionName(fakePath); - assert.strictEqual(result, "definitionValue"); - assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dependency', () => { - const fakePath = "/rendered/path/dependency"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dependency: "dependencyValue", - }; - const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.dependencyPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.dependencyPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('dependencyPath', () => { - const result = client.dependencyPath("projectValue", "locationValue", "dependencyValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.dependencyPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDependencyName', () => { - const result = client.matchProjectFromDependencyName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.dependencyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDependencyName', () => { - const result = client.matchLocationFromDependencyName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.dependencyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDependencyFromDependencyName', () => { - const result = client.matchDependencyFromDependencyName(fakePath); - assert.strictEqual(result, "dependencyValue"); - assert((client.pathTemplates.dependencyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('deployment', () => { - const fakePath = "/rendered/path/deployment"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - deployment: "deploymentValue", - }; - const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.deploymentPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.deploymentPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('deploymentPath', () => { - const result = client.deploymentPath("projectValue", "locationValue", "deploymentValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.deploymentPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDeploymentName', () => { - const result = client.matchProjectFromDeploymentName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDeploymentName', () => { - const result = client.matchLocationFromDeploymentName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDeploymentFromDeploymentName', () => { - const result = client.matchDeploymentFromDeploymentName(fakePath); - assert.strictEqual(result, "deploymentValue"); - assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('externalApi', () => { - const fakePath = "/rendered/path/externalApi"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - external_api: "externalApiValue", - }; - const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.externalApiPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.externalApiPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('externalApiPath', () => { - const result = client.externalApiPath("projectValue", "locationValue", "externalApiValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.externalApiPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromExternalApiName', () => { - const result = client.matchProjectFromExternalApiName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.externalApiPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromExternalApiName', () => { - const result = client.matchLocationFromExternalApiName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.externalApiPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExternalApiFromExternalApiName', () => { - const result = client.matchExternalApiFromExternalApiName(fakePath); - assert.strictEqual(result, "externalApiValue"); - assert((client.pathTemplates.externalApiPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('hostProjectRegistration', () => { - const fakePath = "/rendered/path/hostProjectRegistration"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - host_project_registration: "hostProjectRegistrationValue", - }; - const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.hostProjectRegistrationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.hostProjectRegistrationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('hostProjectRegistrationPath', () => { - const result = client.hostProjectRegistrationPath("projectValue", "locationValue", "hostProjectRegistrationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.hostProjectRegistrationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromHostProjectRegistrationName', () => { - const result = client.matchProjectFromHostProjectRegistrationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.hostProjectRegistrationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromHostProjectRegistrationName', () => { - const result = client.matchLocationFromHostProjectRegistrationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.hostProjectRegistrationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchHostProjectRegistrationFromHostProjectRegistrationName', () => { - const result = client.matchHostProjectRegistrationFromHostProjectRegistrationName(fakePath); - assert.strictEqual(result, "hostProjectRegistrationValue"); - assert((client.pathTemplates.hostProjectRegistrationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('location', () => { - const fakePath = "/rendered/path/location"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - }; - const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.locationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.locationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('locationPath', () => { - const result = client.locationPath("projectValue", "locationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.locationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromLocationName', () => { - const result = client.matchProjectFromLocationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromLocationName', () => { - const result = client.matchLocationFromLocationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('plugin', () => { - const fakePath = "/rendered/path/plugin"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - plugin: "pluginValue", - }; - const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.pluginPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.pluginPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('pluginPath', () => { - const result = client.pluginPath("projectValue", "locationValue", "pluginValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.pluginPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromPluginName', () => { - const result = client.matchProjectFromPluginName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.pluginPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromPluginName', () => { - const result = client.matchLocationFromPluginName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.pluginPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchPluginFromPluginName', () => { - const result = client.matchPluginFromPluginName(fakePath); - assert.strictEqual(result, "pluginValue"); - assert((client.pathTemplates.pluginPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('project', () => { - const fakePath = "/rendered/path/project"; - const expectedParameters = { - project: "projectValue", - }; - const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.projectPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectPath', () => { - const result = client.projectPath("projectValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectName', () => { - const result = client.matchProjectFromProjectName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('runtimeProjectAttachment', () => { - const fakePath = "/rendered/path/runtimeProjectAttachment"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - runtime_project_attachment: "runtimeProjectAttachmentValue", - }; - const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.runtimeProjectAttachmentPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.runtimeProjectAttachmentPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('runtimeProjectAttachmentPath', () => { - const result = client.runtimeProjectAttachmentPath("projectValue", "locationValue", "runtimeProjectAttachmentValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromRuntimeProjectAttachmentName', () => { - const result = client.matchProjectFromRuntimeProjectAttachmentName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromRuntimeProjectAttachmentName', () => { - const result = client.matchLocationFromRuntimeProjectAttachmentName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName', () => { - const result = client.matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName(fakePath); - assert.strictEqual(result, "runtimeProjectAttachmentValue"); - assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('spec', () => { - const fakePath = "/rendered/path/spec"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - api: "apiValue", - version: "versionValue", - spec: "specValue", - }; - const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.specPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.specPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('specPath', () => { - const result = client.specPath("projectValue", "locationValue", "apiValue", "versionValue", "specValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.specPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSpecName', () => { - const result = client.matchProjectFromSpecName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.specPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSpecName', () => { - const result = client.matchLocationFromSpecName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.specPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchApiFromSpecName', () => { - const result = client.matchApiFromSpecName(fakePath); - assert.strictEqual(result, "apiValue"); - assert((client.pathTemplates.specPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchVersionFromSpecName', () => { - const result = client.matchVersionFromSpecName(fakePath); - assert.strictEqual(result, "versionValue"); - assert((client.pathTemplates.specPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSpecFromSpecName', () => { - const result = client.matchSpecFromSpecName(fakePath); - assert.strictEqual(result, "specValue"); - assert((client.pathTemplates.specPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('styleGuide', () => { - const fakePath = "/rendered/path/styleGuide"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - plugin: "pluginValue", - }; - const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.styleGuidePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.styleGuidePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('styleGuidePath', () => { - const result = client.styleGuidePath("projectValue", "locationValue", "pluginValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.styleGuidePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromStyleGuideName', () => { - const result = client.matchProjectFromStyleGuideName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.styleGuidePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromStyleGuideName', () => { - const result = client.matchLocationFromStyleGuideName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.styleGuidePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchPluginFromStyleGuideName', () => { - const result = client.matchPluginFromStyleGuideName(fakePath); - assert.strictEqual(result, "pluginValue"); - assert((client.pathTemplates.styleGuidePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('version', () => { - const fakePath = "/rendered/path/version"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - api: "apiValue", - version: "versionValue", - }; - const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.versionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.versionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('versionPath', () => { - const result = client.versionPath("projectValue", "locationValue", "apiValue", "versionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.versionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromVersionName', () => { - const result = client.matchProjectFromVersionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.versionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromVersionName', () => { - const result = client.matchLocationFromVersionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.versionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchApiFromVersionName', () => { - const result = client.matchApiFromVersionName(fakePath); - assert.strictEqual(result, "apiValue"); - assert((client.pathTemplates.versionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchVersionFromVersionName', () => { - const result = client.matchVersionFromVersionName(fakePath); - assert.strictEqual(result, "versionValue"); - assert((client.pathTemplates.versionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/google-cloud-apihub/v1/test/gapic_linting_service_v1.ts b/owl-bot-staging/google-cloud-apihub/v1/test/gapic_linting_service_v1.ts deleted file mode 100644 index 6c5ed0b34ac..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/test/gapic_linting_service_v1.ts +++ /dev/null @@ -1,1550 +0,0 @@ -// Copyright 2024 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, beforeEach, afterEach} from 'mocha'; -import * as lintingserviceModule from '../src'; - -import {GoogleAuth, protobuf, 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 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.LintingServiceClient', () => { - let googleAuth: GoogleAuth; - beforeEach(() => { - googleAuth = { - getClient: sinon.stub().resolves({ - getRequestHeaders: sinon.stub().resolves({Authorization: 'Bearer SOME_TOKEN'}), - }) - } as unknown as GoogleAuth; - }); - afterEach(() => { - sinon.restore(); - }); - describe('Common methods', () => { - it('has apiEndpoint', () => { - const client = new lintingserviceModule.v1.LintingServiceClient(); - const apiEndpoint = client.apiEndpoint; - assert.strictEqual(apiEndpoint, 'apihub.googleapis.com'); - }); - - it('has universeDomain', () => { - const client = new lintingserviceModule.v1.LintingServiceClient(); - const universeDomain = client.universeDomain; - assert.strictEqual(universeDomain, "googleapis.com"); - }); - - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - it('throws DeprecationWarning if static servicePath is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const servicePath = lintingserviceModule.v1.LintingServiceClient.servicePath; - assert.strictEqual(servicePath, 'apihub.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - - it('throws DeprecationWarning if static apiEndpoint is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const apiEndpoint = lintingserviceModule.v1.LintingServiceClient.apiEndpoint; - assert.strictEqual(apiEndpoint, 'apihub.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - } - it('sets apiEndpoint according to universe domain camelCase', () => { - const client = new lintingserviceModule.v1.LintingServiceClient({universeDomain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'apihub.example.com'); - }); - - it('sets apiEndpoint according to universe domain snakeCase', () => { - const client = new lintingserviceModule.v1.LintingServiceClient({universe_domain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'apihub.example.com'); - }); - - if (typeof process === 'object' && 'env' in process) { - describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { - it('sets apiEndpoint from environment variable', () => { - const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; - const client = new lintingserviceModule.v1.LintingServiceClient(); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'apihub.example.com'); - if (saved) { - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; - } else { - delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - } - }); - - it('value configured in code has priority over environment variable', () => { - const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; - const client = new lintingserviceModule.v1.LintingServiceClient({universeDomain: 'configured.example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'apihub.configured.example.com'); - if (saved) { - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; - } else { - delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - } - }); - }); - } - it('does not allow setting both universeDomain and universe_domain', () => { - assert.throws(() => { new lintingserviceModule.v1.LintingServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); - }); - - it('has port', () => { - const port = lintingserviceModule.v1.LintingServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new lintingserviceModule.v1.LintingServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new lintingserviceModule.v1.LintingServiceClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new lintingserviceModule.v1.LintingServiceClient({ - auth: googleAuth, - projectId: 'bogus', - }); - assert.strictEqual(client.lintingServiceStub, undefined); - await client.initialize(); - assert(client.lintingServiceStub); - }); - - it('has close method for the initialized client', done => { - const client = new lintingserviceModule.v1.LintingServiceClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - assert(client.lintingServiceStub); - client.close().then(() => { - done(); - }); - }); - - it('has close method for the non-initialized client', done => { - const client = new lintingserviceModule.v1.LintingServiceClient({ - auth: googleAuth, - projectId: 'bogus', - }); - assert.strictEqual(client.lintingServiceStub, undefined); - client.close().then(() => { - done(); - }); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new lintingserviceModule.v1.LintingServiceClient({ - auth: googleAuth, - 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 lintingserviceModule.v1.LintingServiceClient({ - auth: googleAuth, - 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('getStyleGuide', () => { - it('invokes getStyleGuide without error', async () => { - const client = new lintingserviceModule.v1.LintingServiceClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetStyleGuideRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetStyleGuideRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.StyleGuide() - ); - client.innerApiCalls.getStyleGuide = stubSimpleCall(expectedResponse); - const [response] = await client.getStyleGuide(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getStyleGuide as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getStyleGuide as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getStyleGuide without error using callback', async () => { - const client = new lintingserviceModule.v1.LintingServiceClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetStyleGuideRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetStyleGuideRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.StyleGuide() - ); - client.innerApiCalls.getStyleGuide = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getStyleGuide( - request, - (err?: Error|null, result?: protos.google.cloud.apihub.v1.IStyleGuide|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getStyleGuide as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getStyleGuide as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getStyleGuide with error', async () => { - const client = new lintingserviceModule.v1.LintingServiceClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetStyleGuideRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetStyleGuideRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getStyleGuide = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getStyleGuide(request), expectedError); - const actualRequest = (client.innerApiCalls.getStyleGuide as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getStyleGuide as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getStyleGuide with closed client', async () => { - const client = new lintingserviceModule.v1.LintingServiceClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetStyleGuideRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetStyleGuideRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getStyleGuide(request), expectedError); - }); - }); - - describe('updateStyleGuide', () => { - it('invokes updateStyleGuide without error', async () => { - const client = new lintingserviceModule.v1.LintingServiceClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.UpdateStyleGuideRequest() - ); - request.styleGuide ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.UpdateStyleGuideRequest', ['styleGuide', 'name']); - request.styleGuide.name = defaultValue1; - const expectedHeaderRequestParams = `style_guide.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.StyleGuide() - ); - client.innerApiCalls.updateStyleGuide = stubSimpleCall(expectedResponse); - const [response] = await client.updateStyleGuide(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateStyleGuide as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateStyleGuide as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateStyleGuide without error using callback', async () => { - const client = new lintingserviceModule.v1.LintingServiceClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.UpdateStyleGuideRequest() - ); - request.styleGuide ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.UpdateStyleGuideRequest', ['styleGuide', 'name']); - request.styleGuide.name = defaultValue1; - const expectedHeaderRequestParams = `style_guide.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.StyleGuide() - ); - client.innerApiCalls.updateStyleGuide = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateStyleGuide( - request, - (err?: Error|null, result?: protos.google.cloud.apihub.v1.IStyleGuide|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateStyleGuide as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateStyleGuide as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateStyleGuide with error', async () => { - const client = new lintingserviceModule.v1.LintingServiceClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.UpdateStyleGuideRequest() - ); - request.styleGuide ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.UpdateStyleGuideRequest', ['styleGuide', 'name']); - request.styleGuide.name = defaultValue1; - const expectedHeaderRequestParams = `style_guide.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateStyleGuide = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateStyleGuide(request), expectedError); - const actualRequest = (client.innerApiCalls.updateStyleGuide as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateStyleGuide as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateStyleGuide with closed client', async () => { - const client = new lintingserviceModule.v1.LintingServiceClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.UpdateStyleGuideRequest() - ); - request.styleGuide ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.UpdateStyleGuideRequest', ['styleGuide', 'name']); - request.styleGuide.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateStyleGuide(request), expectedError); - }); - }); - - describe('getStyleGuideContents', () => { - it('invokes getStyleGuideContents without error', async () => { - const client = new lintingserviceModule.v1.LintingServiceClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetStyleGuideContentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetStyleGuideContentsRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.StyleGuideContents() - ); - client.innerApiCalls.getStyleGuideContents = stubSimpleCall(expectedResponse); - const [response] = await client.getStyleGuideContents(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getStyleGuideContents as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getStyleGuideContents as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getStyleGuideContents without error using callback', async () => { - const client = new lintingserviceModule.v1.LintingServiceClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetStyleGuideContentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetStyleGuideContentsRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.StyleGuideContents() - ); - client.innerApiCalls.getStyleGuideContents = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getStyleGuideContents( - request, - (err?: Error|null, result?: protos.google.cloud.apihub.v1.IStyleGuideContents|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getStyleGuideContents as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getStyleGuideContents as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getStyleGuideContents with error', async () => { - const client = new lintingserviceModule.v1.LintingServiceClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetStyleGuideContentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetStyleGuideContentsRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getStyleGuideContents = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getStyleGuideContents(request), expectedError); - const actualRequest = (client.innerApiCalls.getStyleGuideContents as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getStyleGuideContents as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getStyleGuideContents with closed client', async () => { - const client = new lintingserviceModule.v1.LintingServiceClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetStyleGuideContentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetStyleGuideContentsRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getStyleGuideContents(request), expectedError); - }); - }); - - describe('lintSpec', () => { - it('invokes lintSpec without error', async () => { - const client = new lintingserviceModule.v1.LintingServiceClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.LintSpecRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.LintSpecRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.lintSpec = stubSimpleCall(expectedResponse); - const [response] = await client.lintSpec(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.lintSpec as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.lintSpec as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes lintSpec without error using callback', async () => { - const client = new lintingserviceModule.v1.LintingServiceClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.LintSpecRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.LintSpecRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.lintSpec = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.lintSpec( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.lintSpec as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.lintSpec as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes lintSpec with error', async () => { - const client = new lintingserviceModule.v1.LintingServiceClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.LintSpecRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.LintSpecRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.lintSpec = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.lintSpec(request), expectedError); - const actualRequest = (client.innerApiCalls.lintSpec as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.lintSpec as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes lintSpec with closed client', async () => { - const client = new lintingserviceModule.v1.LintingServiceClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.LintSpecRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.LintSpecRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.lintSpec(request), expectedError); - }); - }); - describe('getLocation', () => { - it('invokes getLocation without error', async () => { - const client = new lintingserviceModule.v1.LintingServiceClient({ - auth: googleAuth, - 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 lintingserviceModule.v1.LintingServiceClient({ - auth: googleAuth, - 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 lintingserviceModule.v1.LintingServiceClient({ - auth: googleAuth, - 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 lintingserviceModule.v1.LintingServiceClient({ - auth: googleAuth, - 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 lintingserviceModule.v1.LintingServiceClient({ - 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('Path templates', () => { - - describe('api', () => { - const fakePath = "/rendered/path/api"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - api: "apiValue", - }; - const client = new lintingserviceModule.v1.LintingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.apiPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.apiPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('apiPath', () => { - const result = client.apiPath("projectValue", "locationValue", "apiValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.apiPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromApiName', () => { - const result = client.matchProjectFromApiName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.apiPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromApiName', () => { - const result = client.matchLocationFromApiName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.apiPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchApiFromApiName', () => { - const result = client.matchApiFromApiName(fakePath); - assert.strictEqual(result, "apiValue"); - assert((client.pathTemplates.apiPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('apiHubInstance', () => { - const fakePath = "/rendered/path/apiHubInstance"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - api_hub_instance: "apiHubInstanceValue", - }; - const client = new lintingserviceModule.v1.LintingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.apiHubInstancePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.apiHubInstancePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('apiHubInstancePath', () => { - const result = client.apiHubInstancePath("projectValue", "locationValue", "apiHubInstanceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.apiHubInstancePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromApiHubInstanceName', () => { - const result = client.matchProjectFromApiHubInstanceName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromApiHubInstanceName', () => { - const result = client.matchLocationFromApiHubInstanceName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchApiHubInstanceFromApiHubInstanceName', () => { - const result = client.matchApiHubInstanceFromApiHubInstanceName(fakePath); - assert.strictEqual(result, "apiHubInstanceValue"); - assert((client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('apiOperation', () => { - const fakePath = "/rendered/path/apiOperation"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - api: "apiValue", - version: "versionValue", - operation: "operationValue", - }; - const client = new lintingserviceModule.v1.LintingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.apiOperationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.apiOperationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('apiOperationPath', () => { - const result = client.apiOperationPath("projectValue", "locationValue", "apiValue", "versionValue", "operationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.apiOperationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromApiOperationName', () => { - const result = client.matchProjectFromApiOperationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromApiOperationName', () => { - const result = client.matchLocationFromApiOperationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchApiFromApiOperationName', () => { - const result = client.matchApiFromApiOperationName(fakePath); - assert.strictEqual(result, "apiValue"); - assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchVersionFromApiOperationName', () => { - const result = client.matchVersionFromApiOperationName(fakePath); - assert.strictEqual(result, "versionValue"); - assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchOperationFromApiOperationName', () => { - const result = client.matchOperationFromApiOperationName(fakePath); - assert.strictEqual(result, "operationValue"); - assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('attribute', () => { - const fakePath = "/rendered/path/attribute"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - attribute: "attributeValue", - }; - const client = new lintingserviceModule.v1.LintingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.attributePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.attributePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('attributePath', () => { - const result = client.attributePath("projectValue", "locationValue", "attributeValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.attributePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromAttributeName', () => { - const result = client.matchProjectFromAttributeName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.attributePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromAttributeName', () => { - const result = client.matchLocationFromAttributeName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.attributePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAttributeFromAttributeName', () => { - const result = client.matchAttributeFromAttributeName(fakePath); - assert.strictEqual(result, "attributeValue"); - assert((client.pathTemplates.attributePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('definition', () => { - const fakePath = "/rendered/path/definition"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - api: "apiValue", - version: "versionValue", - definition: "definitionValue", - }; - const client = new lintingserviceModule.v1.LintingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.definitionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.definitionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('definitionPath', () => { - const result = client.definitionPath("projectValue", "locationValue", "apiValue", "versionValue", "definitionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.definitionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDefinitionName', () => { - const result = client.matchProjectFromDefinitionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDefinitionName', () => { - const result = client.matchLocationFromDefinitionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchApiFromDefinitionName', () => { - const result = client.matchApiFromDefinitionName(fakePath); - assert.strictEqual(result, "apiValue"); - assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchVersionFromDefinitionName', () => { - const result = client.matchVersionFromDefinitionName(fakePath); - assert.strictEqual(result, "versionValue"); - assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDefinitionFromDefinitionName', () => { - const result = client.matchDefinitionFromDefinitionName(fakePath); - assert.strictEqual(result, "definitionValue"); - assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dependency', () => { - const fakePath = "/rendered/path/dependency"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dependency: "dependencyValue", - }; - const client = new lintingserviceModule.v1.LintingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.dependencyPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.dependencyPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('dependencyPath', () => { - const result = client.dependencyPath("projectValue", "locationValue", "dependencyValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.dependencyPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDependencyName', () => { - const result = client.matchProjectFromDependencyName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.dependencyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDependencyName', () => { - const result = client.matchLocationFromDependencyName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.dependencyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDependencyFromDependencyName', () => { - const result = client.matchDependencyFromDependencyName(fakePath); - assert.strictEqual(result, "dependencyValue"); - assert((client.pathTemplates.dependencyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('deployment', () => { - const fakePath = "/rendered/path/deployment"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - deployment: "deploymentValue", - }; - const client = new lintingserviceModule.v1.LintingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.deploymentPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.deploymentPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('deploymentPath', () => { - const result = client.deploymentPath("projectValue", "locationValue", "deploymentValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.deploymentPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDeploymentName', () => { - const result = client.matchProjectFromDeploymentName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDeploymentName', () => { - const result = client.matchLocationFromDeploymentName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDeploymentFromDeploymentName', () => { - const result = client.matchDeploymentFromDeploymentName(fakePath); - assert.strictEqual(result, "deploymentValue"); - assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('externalApi', () => { - const fakePath = "/rendered/path/externalApi"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - external_api: "externalApiValue", - }; - const client = new lintingserviceModule.v1.LintingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.externalApiPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.externalApiPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('externalApiPath', () => { - const result = client.externalApiPath("projectValue", "locationValue", "externalApiValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.externalApiPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromExternalApiName', () => { - const result = client.matchProjectFromExternalApiName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.externalApiPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromExternalApiName', () => { - const result = client.matchLocationFromExternalApiName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.externalApiPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExternalApiFromExternalApiName', () => { - const result = client.matchExternalApiFromExternalApiName(fakePath); - assert.strictEqual(result, "externalApiValue"); - assert((client.pathTemplates.externalApiPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('hostProjectRegistration', () => { - const fakePath = "/rendered/path/hostProjectRegistration"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - host_project_registration: "hostProjectRegistrationValue", - }; - const client = new lintingserviceModule.v1.LintingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.hostProjectRegistrationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.hostProjectRegistrationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('hostProjectRegistrationPath', () => { - const result = client.hostProjectRegistrationPath("projectValue", "locationValue", "hostProjectRegistrationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.hostProjectRegistrationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromHostProjectRegistrationName', () => { - const result = client.matchProjectFromHostProjectRegistrationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.hostProjectRegistrationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromHostProjectRegistrationName', () => { - const result = client.matchLocationFromHostProjectRegistrationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.hostProjectRegistrationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchHostProjectRegistrationFromHostProjectRegistrationName', () => { - const result = client.matchHostProjectRegistrationFromHostProjectRegistrationName(fakePath); - assert.strictEqual(result, "hostProjectRegistrationValue"); - assert((client.pathTemplates.hostProjectRegistrationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('plugin', () => { - const fakePath = "/rendered/path/plugin"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - plugin: "pluginValue", - }; - const client = new lintingserviceModule.v1.LintingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.pluginPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.pluginPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('pluginPath', () => { - const result = client.pluginPath("projectValue", "locationValue", "pluginValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.pluginPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromPluginName', () => { - const result = client.matchProjectFromPluginName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.pluginPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromPluginName', () => { - const result = client.matchLocationFromPluginName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.pluginPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchPluginFromPluginName', () => { - const result = client.matchPluginFromPluginName(fakePath); - assert.strictEqual(result, "pluginValue"); - assert((client.pathTemplates.pluginPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('runtimeProjectAttachment', () => { - const fakePath = "/rendered/path/runtimeProjectAttachment"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - runtime_project_attachment: "runtimeProjectAttachmentValue", - }; - const client = new lintingserviceModule.v1.LintingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.runtimeProjectAttachmentPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.runtimeProjectAttachmentPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('runtimeProjectAttachmentPath', () => { - const result = client.runtimeProjectAttachmentPath("projectValue", "locationValue", "runtimeProjectAttachmentValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromRuntimeProjectAttachmentName', () => { - const result = client.matchProjectFromRuntimeProjectAttachmentName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromRuntimeProjectAttachmentName', () => { - const result = client.matchLocationFromRuntimeProjectAttachmentName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName', () => { - const result = client.matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName(fakePath); - assert.strictEqual(result, "runtimeProjectAttachmentValue"); - assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('spec', () => { - const fakePath = "/rendered/path/spec"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - api: "apiValue", - version: "versionValue", - spec: "specValue", - }; - const client = new lintingserviceModule.v1.LintingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.specPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.specPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('specPath', () => { - const result = client.specPath("projectValue", "locationValue", "apiValue", "versionValue", "specValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.specPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSpecName', () => { - const result = client.matchProjectFromSpecName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.specPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSpecName', () => { - const result = client.matchLocationFromSpecName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.specPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchApiFromSpecName', () => { - const result = client.matchApiFromSpecName(fakePath); - assert.strictEqual(result, "apiValue"); - assert((client.pathTemplates.specPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchVersionFromSpecName', () => { - const result = client.matchVersionFromSpecName(fakePath); - assert.strictEqual(result, "versionValue"); - assert((client.pathTemplates.specPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSpecFromSpecName', () => { - const result = client.matchSpecFromSpecName(fakePath); - assert.strictEqual(result, "specValue"); - assert((client.pathTemplates.specPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('styleGuide', () => { - const fakePath = "/rendered/path/styleGuide"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - plugin: "pluginValue", - }; - const client = new lintingserviceModule.v1.LintingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.styleGuidePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.styleGuidePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('styleGuidePath', () => { - const result = client.styleGuidePath("projectValue", "locationValue", "pluginValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.styleGuidePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromStyleGuideName', () => { - const result = client.matchProjectFromStyleGuideName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.styleGuidePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromStyleGuideName', () => { - const result = client.matchLocationFromStyleGuideName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.styleGuidePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchPluginFromStyleGuideName', () => { - const result = client.matchPluginFromStyleGuideName(fakePath); - assert.strictEqual(result, "pluginValue"); - assert((client.pathTemplates.styleGuidePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('version', () => { - const fakePath = "/rendered/path/version"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - api: "apiValue", - version: "versionValue", - }; - const client = new lintingserviceModule.v1.LintingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.versionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.versionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('versionPath', () => { - const result = client.versionPath("projectValue", "locationValue", "apiValue", "versionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.versionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromVersionName', () => { - const result = client.matchProjectFromVersionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.versionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromVersionName', () => { - const result = client.matchLocationFromVersionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.versionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchApiFromVersionName', () => { - const result = client.matchApiFromVersionName(fakePath); - assert.strictEqual(result, "apiValue"); - assert((client.pathTemplates.versionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchVersionFromVersionName', () => { - const result = client.matchVersionFromVersionName(fakePath); - assert.strictEqual(result, "versionValue"); - assert((client.pathTemplates.versionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/google-cloud-apihub/v1/test/gapic_provisioning_v1.ts b/owl-bot-staging/google-cloud-apihub/v1/test/gapic_provisioning_v1.ts deleted file mode 100644 index 94980fa3be7..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/test/gapic_provisioning_v1.ts +++ /dev/null @@ -1,1823 +0,0 @@ -// Copyright 2024 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, beforeEach, afterEach} from 'mocha'; -import * as provisioningModule from '../src'; - -import {GoogleAuth, protobuf, LROperation, operationsProtos, 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 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.ProvisioningClient', () => { - let googleAuth: GoogleAuth; - beforeEach(() => { - googleAuth = { - getClient: sinon.stub().resolves({ - getRequestHeaders: sinon.stub().resolves({Authorization: 'Bearer SOME_TOKEN'}), - }) - } as unknown as GoogleAuth; - }); - afterEach(() => { - sinon.restore(); - }); - describe('Common methods', () => { - it('has apiEndpoint', () => { - const client = new provisioningModule.v1.ProvisioningClient(); - const apiEndpoint = client.apiEndpoint; - assert.strictEqual(apiEndpoint, 'apihub.googleapis.com'); - }); - - it('has universeDomain', () => { - const client = new provisioningModule.v1.ProvisioningClient(); - const universeDomain = client.universeDomain; - assert.strictEqual(universeDomain, "googleapis.com"); - }); - - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - it('throws DeprecationWarning if static servicePath is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const servicePath = provisioningModule.v1.ProvisioningClient.servicePath; - assert.strictEqual(servicePath, 'apihub.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - - it('throws DeprecationWarning if static apiEndpoint is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const apiEndpoint = provisioningModule.v1.ProvisioningClient.apiEndpoint; - assert.strictEqual(apiEndpoint, 'apihub.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - } - it('sets apiEndpoint according to universe domain camelCase', () => { - const client = new provisioningModule.v1.ProvisioningClient({universeDomain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'apihub.example.com'); - }); - - it('sets apiEndpoint according to universe domain snakeCase', () => { - const client = new provisioningModule.v1.ProvisioningClient({universe_domain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'apihub.example.com'); - }); - - if (typeof process === 'object' && 'env' in process) { - describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { - it('sets apiEndpoint from environment variable', () => { - const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; - const client = new provisioningModule.v1.ProvisioningClient(); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'apihub.example.com'); - if (saved) { - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; - } else { - delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - } - }); - - it('value configured in code has priority over environment variable', () => { - const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; - const client = new provisioningModule.v1.ProvisioningClient({universeDomain: 'configured.example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'apihub.configured.example.com'); - if (saved) { - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; - } else { - delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - } - }); - }); - } - it('does not allow setting both universeDomain and universe_domain', () => { - assert.throws(() => { new provisioningModule.v1.ProvisioningClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); - }); - - it('has port', () => { - const port = provisioningModule.v1.ProvisioningClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new provisioningModule.v1.ProvisioningClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new provisioningModule.v1.ProvisioningClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new provisioningModule.v1.ProvisioningClient({ - auth: googleAuth, - projectId: 'bogus', - }); - assert.strictEqual(client.provisioningStub, undefined); - await client.initialize(); - assert(client.provisioningStub); - }); - - it('has close method for the initialized client', done => { - const client = new provisioningModule.v1.ProvisioningClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - assert(client.provisioningStub); - client.close().then(() => { - done(); - }); - }); - - it('has close method for the non-initialized client', done => { - const client = new provisioningModule.v1.ProvisioningClient({ - auth: googleAuth, - projectId: 'bogus', - }); - assert.strictEqual(client.provisioningStub, undefined); - client.close().then(() => { - done(); - }); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new provisioningModule.v1.ProvisioningClient({ - auth: googleAuth, - 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 provisioningModule.v1.ProvisioningClient({ - auth: googleAuth, - 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('getApiHubInstance', () => { - it('invokes getApiHubInstance without error', async () => { - const client = new provisioningModule.v1.ProvisioningClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetApiHubInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetApiHubInstanceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.ApiHubInstance() - ); - client.innerApiCalls.getApiHubInstance = stubSimpleCall(expectedResponse); - const [response] = await client.getApiHubInstance(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getApiHubInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getApiHubInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getApiHubInstance without error using callback', async () => { - const client = new provisioningModule.v1.ProvisioningClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetApiHubInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetApiHubInstanceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.ApiHubInstance() - ); - client.innerApiCalls.getApiHubInstance = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getApiHubInstance( - request, - (err?: Error|null, result?: protos.google.cloud.apihub.v1.IApiHubInstance|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getApiHubInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getApiHubInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getApiHubInstance with error', async () => { - const client = new provisioningModule.v1.ProvisioningClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetApiHubInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetApiHubInstanceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getApiHubInstance = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getApiHubInstance(request), expectedError); - const actualRequest = (client.innerApiCalls.getApiHubInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getApiHubInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getApiHubInstance with closed client', async () => { - const client = new provisioningModule.v1.ProvisioningClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetApiHubInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetApiHubInstanceRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getApiHubInstance(request), expectedError); - }); - }); - - describe('lookupApiHubInstance', () => { - it('invokes lookupApiHubInstance without error', async () => { - const client = new provisioningModule.v1.ProvisioningClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.LookupApiHubInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.LookupApiHubInstanceRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.LookupApiHubInstanceResponse() - ); - client.innerApiCalls.lookupApiHubInstance = stubSimpleCall(expectedResponse); - const [response] = await client.lookupApiHubInstance(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.lookupApiHubInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.lookupApiHubInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes lookupApiHubInstance without error using callback', async () => { - const client = new provisioningModule.v1.ProvisioningClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.LookupApiHubInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.LookupApiHubInstanceRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.LookupApiHubInstanceResponse() - ); - client.innerApiCalls.lookupApiHubInstance = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.lookupApiHubInstance( - request, - (err?: Error|null, result?: protos.google.cloud.apihub.v1.ILookupApiHubInstanceResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.lookupApiHubInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.lookupApiHubInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes lookupApiHubInstance with error', async () => { - const client = new provisioningModule.v1.ProvisioningClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.LookupApiHubInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.LookupApiHubInstanceRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.lookupApiHubInstance = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.lookupApiHubInstance(request), expectedError); - const actualRequest = (client.innerApiCalls.lookupApiHubInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.lookupApiHubInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes lookupApiHubInstance with closed client', async () => { - const client = new provisioningModule.v1.ProvisioningClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.LookupApiHubInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.LookupApiHubInstanceRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.lookupApiHubInstance(request), expectedError); - }); - }); - - describe('createApiHubInstance', () => { - it('invokes createApiHubInstance without error', async () => { - const client = new provisioningModule.v1.ProvisioningClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.CreateApiHubInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.CreateApiHubInstanceRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createApiHubInstance = stubLongRunningCall(expectedResponse); - const [operation] = await client.createApiHubInstance(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createApiHubInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createApiHubInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createApiHubInstance without error using callback', async () => { - const client = new provisioningModule.v1.ProvisioningClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.CreateApiHubInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.CreateApiHubInstanceRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createApiHubInstance = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createApiHubInstance( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createApiHubInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createApiHubInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createApiHubInstance with call error', async () => { - const client = new provisioningModule.v1.ProvisioningClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.CreateApiHubInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.CreateApiHubInstanceRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createApiHubInstance = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.createApiHubInstance(request), expectedError); - const actualRequest = (client.innerApiCalls.createApiHubInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createApiHubInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createApiHubInstance with LRO error', async () => { - const client = new provisioningModule.v1.ProvisioningClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.CreateApiHubInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.CreateApiHubInstanceRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createApiHubInstance = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createApiHubInstance(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.createApiHubInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createApiHubInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkCreateApiHubInstanceProgress without error', async () => { - const client = new provisioningModule.v1.ProvisioningClient({ - auth: googleAuth, - 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.checkCreateApiHubInstanceProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkCreateApiHubInstanceProgress with error', async () => { - const client = new provisioningModule.v1.ProvisioningClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkCreateApiHubInstanceProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - describe('getLocation', () => { - it('invokes getLocation without error', async () => { - const client = new provisioningModule.v1.ProvisioningClient({ - auth: googleAuth, - 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 provisioningModule.v1.ProvisioningClient({ - auth: googleAuth, - 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 provisioningModule.v1.ProvisioningClient({ - auth: googleAuth, - 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 provisioningModule.v1.ProvisioningClient({ - auth: googleAuth, - 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 provisioningModule.v1.ProvisioningClient({ - 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 provisioningModule.v1.ProvisioningClient({ - auth: googleAuth, - 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 provisioningModule.v1.ProvisioningClient({ - auth: googleAuth, - 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 provisioningModule.v1.ProvisioningClient({ - auth: googleAuth, - 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 provisioningModule.v1.ProvisioningClient({ - auth: googleAuth, - 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 provisioningModule.v1.ProvisioningClient({ - auth: googleAuth, - 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 provisioningModule.v1.ProvisioningClient({ - auth: googleAuth, - 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 provisioningModule.v1.ProvisioningClient({ - auth: googleAuth, - 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 provisioningModule.v1.ProvisioningClient({ - auth: googleAuth, - 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 provisioningModule.v1.ProvisioningClient({ - auth: googleAuth, - 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 provisioningModule.v1.ProvisioningClient({ - auth: googleAuth, - 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 provisioningModule.v1.ProvisioningClient({ - 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('api', () => { - const fakePath = "/rendered/path/api"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - api: "apiValue", - }; - const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.apiPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.apiPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('apiPath', () => { - const result = client.apiPath("projectValue", "locationValue", "apiValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.apiPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromApiName', () => { - const result = client.matchProjectFromApiName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.apiPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromApiName', () => { - const result = client.matchLocationFromApiName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.apiPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchApiFromApiName', () => { - const result = client.matchApiFromApiName(fakePath); - assert.strictEqual(result, "apiValue"); - assert((client.pathTemplates.apiPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('apiHubInstance', () => { - const fakePath = "/rendered/path/apiHubInstance"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - api_hub_instance: "apiHubInstanceValue", - }; - const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.apiHubInstancePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.apiHubInstancePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('apiHubInstancePath', () => { - const result = client.apiHubInstancePath("projectValue", "locationValue", "apiHubInstanceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.apiHubInstancePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromApiHubInstanceName', () => { - const result = client.matchProjectFromApiHubInstanceName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromApiHubInstanceName', () => { - const result = client.matchLocationFromApiHubInstanceName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchApiHubInstanceFromApiHubInstanceName', () => { - const result = client.matchApiHubInstanceFromApiHubInstanceName(fakePath); - assert.strictEqual(result, "apiHubInstanceValue"); - assert((client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('apiOperation', () => { - const fakePath = "/rendered/path/apiOperation"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - api: "apiValue", - version: "versionValue", - operation: "operationValue", - }; - const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.apiOperationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.apiOperationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('apiOperationPath', () => { - const result = client.apiOperationPath("projectValue", "locationValue", "apiValue", "versionValue", "operationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.apiOperationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromApiOperationName', () => { - const result = client.matchProjectFromApiOperationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromApiOperationName', () => { - const result = client.matchLocationFromApiOperationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchApiFromApiOperationName', () => { - const result = client.matchApiFromApiOperationName(fakePath); - assert.strictEqual(result, "apiValue"); - assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchVersionFromApiOperationName', () => { - const result = client.matchVersionFromApiOperationName(fakePath); - assert.strictEqual(result, "versionValue"); - assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchOperationFromApiOperationName', () => { - const result = client.matchOperationFromApiOperationName(fakePath); - assert.strictEqual(result, "operationValue"); - assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('attribute', () => { - const fakePath = "/rendered/path/attribute"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - attribute: "attributeValue", - }; - const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.attributePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.attributePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('attributePath', () => { - const result = client.attributePath("projectValue", "locationValue", "attributeValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.attributePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromAttributeName', () => { - const result = client.matchProjectFromAttributeName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.attributePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromAttributeName', () => { - const result = client.matchLocationFromAttributeName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.attributePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAttributeFromAttributeName', () => { - const result = client.matchAttributeFromAttributeName(fakePath); - assert.strictEqual(result, "attributeValue"); - assert((client.pathTemplates.attributePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('definition', () => { - const fakePath = "/rendered/path/definition"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - api: "apiValue", - version: "versionValue", - definition: "definitionValue", - }; - const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.definitionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.definitionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('definitionPath', () => { - const result = client.definitionPath("projectValue", "locationValue", "apiValue", "versionValue", "definitionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.definitionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDefinitionName', () => { - const result = client.matchProjectFromDefinitionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDefinitionName', () => { - const result = client.matchLocationFromDefinitionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchApiFromDefinitionName', () => { - const result = client.matchApiFromDefinitionName(fakePath); - assert.strictEqual(result, "apiValue"); - assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchVersionFromDefinitionName', () => { - const result = client.matchVersionFromDefinitionName(fakePath); - assert.strictEqual(result, "versionValue"); - assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDefinitionFromDefinitionName', () => { - const result = client.matchDefinitionFromDefinitionName(fakePath); - assert.strictEqual(result, "definitionValue"); - assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dependency', () => { - const fakePath = "/rendered/path/dependency"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dependency: "dependencyValue", - }; - const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.dependencyPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.dependencyPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('dependencyPath', () => { - const result = client.dependencyPath("projectValue", "locationValue", "dependencyValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.dependencyPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDependencyName', () => { - const result = client.matchProjectFromDependencyName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.dependencyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDependencyName', () => { - const result = client.matchLocationFromDependencyName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.dependencyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDependencyFromDependencyName', () => { - const result = client.matchDependencyFromDependencyName(fakePath); - assert.strictEqual(result, "dependencyValue"); - assert((client.pathTemplates.dependencyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('deployment', () => { - const fakePath = "/rendered/path/deployment"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - deployment: "deploymentValue", - }; - const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.deploymentPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.deploymentPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('deploymentPath', () => { - const result = client.deploymentPath("projectValue", "locationValue", "deploymentValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.deploymentPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDeploymentName', () => { - const result = client.matchProjectFromDeploymentName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDeploymentName', () => { - const result = client.matchLocationFromDeploymentName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDeploymentFromDeploymentName', () => { - const result = client.matchDeploymentFromDeploymentName(fakePath); - assert.strictEqual(result, "deploymentValue"); - assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('externalApi', () => { - const fakePath = "/rendered/path/externalApi"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - external_api: "externalApiValue", - }; - const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.externalApiPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.externalApiPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('externalApiPath', () => { - const result = client.externalApiPath("projectValue", "locationValue", "externalApiValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.externalApiPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromExternalApiName', () => { - const result = client.matchProjectFromExternalApiName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.externalApiPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromExternalApiName', () => { - const result = client.matchLocationFromExternalApiName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.externalApiPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExternalApiFromExternalApiName', () => { - const result = client.matchExternalApiFromExternalApiName(fakePath); - assert.strictEqual(result, "externalApiValue"); - assert((client.pathTemplates.externalApiPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('hostProjectRegistration', () => { - const fakePath = "/rendered/path/hostProjectRegistration"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - host_project_registration: "hostProjectRegistrationValue", - }; - const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.hostProjectRegistrationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.hostProjectRegistrationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('hostProjectRegistrationPath', () => { - const result = client.hostProjectRegistrationPath("projectValue", "locationValue", "hostProjectRegistrationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.hostProjectRegistrationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromHostProjectRegistrationName', () => { - const result = client.matchProjectFromHostProjectRegistrationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.hostProjectRegistrationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromHostProjectRegistrationName', () => { - const result = client.matchLocationFromHostProjectRegistrationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.hostProjectRegistrationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchHostProjectRegistrationFromHostProjectRegistrationName', () => { - const result = client.matchHostProjectRegistrationFromHostProjectRegistrationName(fakePath); - assert.strictEqual(result, "hostProjectRegistrationValue"); - assert((client.pathTemplates.hostProjectRegistrationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('location', () => { - const fakePath = "/rendered/path/location"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - }; - const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.locationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.locationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('locationPath', () => { - const result = client.locationPath("projectValue", "locationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.locationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromLocationName', () => { - const result = client.matchProjectFromLocationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromLocationName', () => { - const result = client.matchLocationFromLocationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('plugin', () => { - const fakePath = "/rendered/path/plugin"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - plugin: "pluginValue", - }; - const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.pluginPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.pluginPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('pluginPath', () => { - const result = client.pluginPath("projectValue", "locationValue", "pluginValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.pluginPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromPluginName', () => { - const result = client.matchProjectFromPluginName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.pluginPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromPluginName', () => { - const result = client.matchLocationFromPluginName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.pluginPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchPluginFromPluginName', () => { - const result = client.matchPluginFromPluginName(fakePath); - assert.strictEqual(result, "pluginValue"); - assert((client.pathTemplates.pluginPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('project', () => { - const fakePath = "/rendered/path/project"; - const expectedParameters = { - project: "projectValue", - }; - const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.projectPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectPath', () => { - const result = client.projectPath("projectValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectName', () => { - const result = client.matchProjectFromProjectName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('runtimeProjectAttachment', () => { - const fakePath = "/rendered/path/runtimeProjectAttachment"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - runtime_project_attachment: "runtimeProjectAttachmentValue", - }; - const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.runtimeProjectAttachmentPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.runtimeProjectAttachmentPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('runtimeProjectAttachmentPath', () => { - const result = client.runtimeProjectAttachmentPath("projectValue", "locationValue", "runtimeProjectAttachmentValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromRuntimeProjectAttachmentName', () => { - const result = client.matchProjectFromRuntimeProjectAttachmentName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromRuntimeProjectAttachmentName', () => { - const result = client.matchLocationFromRuntimeProjectAttachmentName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName', () => { - const result = client.matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName(fakePath); - assert.strictEqual(result, "runtimeProjectAttachmentValue"); - assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('spec', () => { - const fakePath = "/rendered/path/spec"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - api: "apiValue", - version: "versionValue", - spec: "specValue", - }; - const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.specPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.specPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('specPath', () => { - const result = client.specPath("projectValue", "locationValue", "apiValue", "versionValue", "specValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.specPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSpecName', () => { - const result = client.matchProjectFromSpecName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.specPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSpecName', () => { - const result = client.matchLocationFromSpecName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.specPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchApiFromSpecName', () => { - const result = client.matchApiFromSpecName(fakePath); - assert.strictEqual(result, "apiValue"); - assert((client.pathTemplates.specPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchVersionFromSpecName', () => { - const result = client.matchVersionFromSpecName(fakePath); - assert.strictEqual(result, "versionValue"); - assert((client.pathTemplates.specPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSpecFromSpecName', () => { - const result = client.matchSpecFromSpecName(fakePath); - assert.strictEqual(result, "specValue"); - assert((client.pathTemplates.specPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('styleGuide', () => { - const fakePath = "/rendered/path/styleGuide"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - plugin: "pluginValue", - }; - const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.styleGuidePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.styleGuidePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('styleGuidePath', () => { - const result = client.styleGuidePath("projectValue", "locationValue", "pluginValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.styleGuidePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromStyleGuideName', () => { - const result = client.matchProjectFromStyleGuideName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.styleGuidePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromStyleGuideName', () => { - const result = client.matchLocationFromStyleGuideName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.styleGuidePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchPluginFromStyleGuideName', () => { - const result = client.matchPluginFromStyleGuideName(fakePath); - assert.strictEqual(result, "pluginValue"); - assert((client.pathTemplates.styleGuidePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('version', () => { - const fakePath = "/rendered/path/version"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - api: "apiValue", - version: "versionValue", - }; - const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.versionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.versionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('versionPath', () => { - const result = client.versionPath("projectValue", "locationValue", "apiValue", "versionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.versionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromVersionName', () => { - const result = client.matchProjectFromVersionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.versionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromVersionName', () => { - const result = client.matchLocationFromVersionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.versionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchApiFromVersionName', () => { - const result = client.matchApiFromVersionName(fakePath); - assert.strictEqual(result, "apiValue"); - assert((client.pathTemplates.versionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchVersionFromVersionName', () => { - const result = client.matchVersionFromVersionName(fakePath); - assert.strictEqual(result, "versionValue"); - assert((client.pathTemplates.versionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/google-cloud-apihub/v1/test/gapic_runtime_project_attachment_service_v1.ts b/owl-bot-staging/google-cloud-apihub/v1/test/gapic_runtime_project_attachment_service_v1.ts deleted file mode 100644 index 763ccfe58d6..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/test/gapic_runtime_project_attachment_service_v1.ts +++ /dev/null @@ -1,1886 +0,0 @@ -// Copyright 2024 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, beforeEach, afterEach} from 'mocha'; -import * as runtimeprojectattachmentserviceModule from '../src'; - -import {PassThrough} from 'stream'; - -import {GoogleAuth, protobuf, 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 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.RuntimeProjectAttachmentServiceClient', () => { - let googleAuth: GoogleAuth; - beforeEach(() => { - googleAuth = { - getClient: sinon.stub().resolves({ - getRequestHeaders: sinon.stub().resolves({Authorization: 'Bearer SOME_TOKEN'}), - }) - } as unknown as GoogleAuth; - }); - afterEach(() => { - sinon.restore(); - }); - describe('Common methods', () => { - it('has apiEndpoint', () => { - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient(); - const apiEndpoint = client.apiEndpoint; - assert.strictEqual(apiEndpoint, 'apihub.googleapis.com'); - }); - - it('has universeDomain', () => { - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient(); - const universeDomain = client.universeDomain; - assert.strictEqual(universeDomain, "googleapis.com"); - }); - - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - it('throws DeprecationWarning if static servicePath is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const servicePath = runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient.servicePath; - assert.strictEqual(servicePath, 'apihub.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - - it('throws DeprecationWarning if static apiEndpoint is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const apiEndpoint = runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient.apiEndpoint; - assert.strictEqual(apiEndpoint, 'apihub.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - } - it('sets apiEndpoint according to universe domain camelCase', () => { - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({universeDomain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'apihub.example.com'); - }); - - it('sets apiEndpoint according to universe domain snakeCase', () => { - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({universe_domain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'apihub.example.com'); - }); - - if (typeof process === 'object' && 'env' in process) { - describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { - it('sets apiEndpoint from environment variable', () => { - const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient(); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'apihub.example.com'); - if (saved) { - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; - } else { - delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - } - }); - - it('value configured in code has priority over environment variable', () => { - const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({universeDomain: 'configured.example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'apihub.configured.example.com'); - if (saved) { - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; - } else { - delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - } - }); - }); - } - it('does not allow setting both universeDomain and universe_domain', () => { - assert.throws(() => { new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); - }); - - it('has port', () => { - const port = runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ - auth: googleAuth, - projectId: 'bogus', - }); - assert.strictEqual(client.runtimeProjectAttachmentServiceStub, undefined); - await client.initialize(); - assert(client.runtimeProjectAttachmentServiceStub); - }); - - it('has close method for the initialized client', done => { - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - assert(client.runtimeProjectAttachmentServiceStub); - client.close().then(() => { - done(); - }); - }); - - it('has close method for the non-initialized client', done => { - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ - auth: googleAuth, - projectId: 'bogus', - }); - assert.strictEqual(client.runtimeProjectAttachmentServiceStub, undefined); - client.close().then(() => { - done(); - }); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ - auth: googleAuth, - 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 runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ - auth: googleAuth, - 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('createRuntimeProjectAttachment', () => { - it('invokes createRuntimeProjectAttachment without error', async () => { - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.RuntimeProjectAttachment() - ); - client.innerApiCalls.createRuntimeProjectAttachment = stubSimpleCall(expectedResponse); - const [response] = await client.createRuntimeProjectAttachment(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createRuntimeProjectAttachment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createRuntimeProjectAttachment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createRuntimeProjectAttachment without error using callback', async () => { - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.RuntimeProjectAttachment() - ); - client.innerApiCalls.createRuntimeProjectAttachment = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createRuntimeProjectAttachment( - request, - (err?: Error|null, result?: protos.google.cloud.apihub.v1.IRuntimeProjectAttachment|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createRuntimeProjectAttachment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createRuntimeProjectAttachment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createRuntimeProjectAttachment with error', async () => { - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createRuntimeProjectAttachment = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createRuntimeProjectAttachment(request), expectedError); - const actualRequest = (client.innerApiCalls.createRuntimeProjectAttachment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createRuntimeProjectAttachment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createRuntimeProjectAttachment with closed client', async () => { - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createRuntimeProjectAttachment(request), expectedError); - }); - }); - - describe('getRuntimeProjectAttachment', () => { - it('invokes getRuntimeProjectAttachment without error', async () => { - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.RuntimeProjectAttachment() - ); - client.innerApiCalls.getRuntimeProjectAttachment = stubSimpleCall(expectedResponse); - const [response] = await client.getRuntimeProjectAttachment(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getRuntimeProjectAttachment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getRuntimeProjectAttachment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getRuntimeProjectAttachment without error using callback', async () => { - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.RuntimeProjectAttachment() - ); - client.innerApiCalls.getRuntimeProjectAttachment = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getRuntimeProjectAttachment( - request, - (err?: Error|null, result?: protos.google.cloud.apihub.v1.IRuntimeProjectAttachment|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getRuntimeProjectAttachment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getRuntimeProjectAttachment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getRuntimeProjectAttachment with error', async () => { - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getRuntimeProjectAttachment = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getRuntimeProjectAttachment(request), expectedError); - const actualRequest = (client.innerApiCalls.getRuntimeProjectAttachment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getRuntimeProjectAttachment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getRuntimeProjectAttachment with closed client', async () => { - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getRuntimeProjectAttachment(request), expectedError); - }); - }); - - describe('deleteRuntimeProjectAttachment', () => { - it('invokes deleteRuntimeProjectAttachment without error', async () => { - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteRuntimeProjectAttachment = stubSimpleCall(expectedResponse); - const [response] = await client.deleteRuntimeProjectAttachment(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteRuntimeProjectAttachment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteRuntimeProjectAttachment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteRuntimeProjectAttachment without error using callback', async () => { - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteRuntimeProjectAttachment = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteRuntimeProjectAttachment( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteRuntimeProjectAttachment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteRuntimeProjectAttachment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteRuntimeProjectAttachment with error', async () => { - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteRuntimeProjectAttachment = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteRuntimeProjectAttachment(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteRuntimeProjectAttachment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteRuntimeProjectAttachment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteRuntimeProjectAttachment with closed client', async () => { - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.deleteRuntimeProjectAttachment(request), expectedError); - }); - }); - - describe('lookupRuntimeProjectAttachment', () => { - it('invokes lookupRuntimeProjectAttachment without error', async () => { - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse() - ); - client.innerApiCalls.lookupRuntimeProjectAttachment = stubSimpleCall(expectedResponse); - const [response] = await client.lookupRuntimeProjectAttachment(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.lookupRuntimeProjectAttachment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.lookupRuntimeProjectAttachment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes lookupRuntimeProjectAttachment without error using callback', async () => { - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse() - ); - client.innerApiCalls.lookupRuntimeProjectAttachment = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.lookupRuntimeProjectAttachment( - request, - (err?: Error|null, result?: protos.google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.lookupRuntimeProjectAttachment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.lookupRuntimeProjectAttachment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes lookupRuntimeProjectAttachment with error', async () => { - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.lookupRuntimeProjectAttachment = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.lookupRuntimeProjectAttachment(request), expectedError); - const actualRequest = (client.innerApiCalls.lookupRuntimeProjectAttachment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.lookupRuntimeProjectAttachment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes lookupRuntimeProjectAttachment with closed client', async () => { - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.lookupRuntimeProjectAttachment(request), expectedError); - }); - }); - - describe('listRuntimeProjectAttachments', () => { - it('invokes listRuntimeProjectAttachments without error', async () => { - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apihub.v1.RuntimeProjectAttachment()), - generateSampleMessage(new protos.google.cloud.apihub.v1.RuntimeProjectAttachment()), - generateSampleMessage(new protos.google.cloud.apihub.v1.RuntimeProjectAttachment()), - ]; - client.innerApiCalls.listRuntimeProjectAttachments = stubSimpleCall(expectedResponse); - const [response] = await client.listRuntimeProjectAttachments(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listRuntimeProjectAttachments as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listRuntimeProjectAttachments as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listRuntimeProjectAttachments without error using callback', async () => { - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apihub.v1.RuntimeProjectAttachment()), - generateSampleMessage(new protos.google.cloud.apihub.v1.RuntimeProjectAttachment()), - generateSampleMessage(new protos.google.cloud.apihub.v1.RuntimeProjectAttachment()), - ]; - client.innerApiCalls.listRuntimeProjectAttachments = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listRuntimeProjectAttachments( - request, - (err?: Error|null, result?: protos.google.cloud.apihub.v1.IRuntimeProjectAttachment[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listRuntimeProjectAttachments as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listRuntimeProjectAttachments as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listRuntimeProjectAttachments with error', async () => { - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listRuntimeProjectAttachments = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listRuntimeProjectAttachments(request), expectedError); - const actualRequest = (client.innerApiCalls.listRuntimeProjectAttachments as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listRuntimeProjectAttachments as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listRuntimeProjectAttachmentsStream without error', async () => { - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apihub.v1.RuntimeProjectAttachment()), - generateSampleMessage(new protos.google.cloud.apihub.v1.RuntimeProjectAttachment()), - generateSampleMessage(new protos.google.cloud.apihub.v1.RuntimeProjectAttachment()), - ]; - client.descriptors.page.listRuntimeProjectAttachments.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listRuntimeProjectAttachmentsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.apihub.v1.RuntimeProjectAttachment[] = []; - stream.on('data', (response: protos.google.cloud.apihub.v1.RuntimeProjectAttachment) => { - 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.listRuntimeProjectAttachments.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listRuntimeProjectAttachments, request)); - assert( - (client.descriptors.page.listRuntimeProjectAttachments.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listRuntimeProjectAttachmentsStream with error', async () => { - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listRuntimeProjectAttachments.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listRuntimeProjectAttachmentsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.apihub.v1.RuntimeProjectAttachment[] = []; - stream.on('data', (response: protos.google.cloud.apihub.v1.RuntimeProjectAttachment) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listRuntimeProjectAttachments.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listRuntimeProjectAttachments, request)); - assert( - (client.descriptors.page.listRuntimeProjectAttachments.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listRuntimeProjectAttachments without error', async () => { - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ - auth: googleAuth, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apihub.v1.RuntimeProjectAttachment()), - generateSampleMessage(new protos.google.cloud.apihub.v1.RuntimeProjectAttachment()), - generateSampleMessage(new protos.google.cloud.apihub.v1.RuntimeProjectAttachment()), - ]; - client.descriptors.page.listRuntimeProjectAttachments.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.apihub.v1.IRuntimeProjectAttachment[] = []; - const iterable = client.listRuntimeProjectAttachmentsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listRuntimeProjectAttachments.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listRuntimeProjectAttachments.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listRuntimeProjectAttachments with error', async () => { - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listRuntimeProjectAttachments.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listRuntimeProjectAttachmentsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.apihub.v1.IRuntimeProjectAttachment[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listRuntimeProjectAttachments.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listRuntimeProjectAttachments.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getLocation', () => { - it('invokes getLocation without error', async () => { - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ - auth: googleAuth, - 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 runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ - auth: googleAuth, - 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 runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ - auth: googleAuth, - 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 runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ - auth: googleAuth, - 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 runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ - 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('Path templates', () => { - - describe('api', () => { - const fakePath = "/rendered/path/api"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - api: "apiValue", - }; - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.apiPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.apiPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('apiPath', () => { - const result = client.apiPath("projectValue", "locationValue", "apiValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.apiPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromApiName', () => { - const result = client.matchProjectFromApiName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.apiPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromApiName', () => { - const result = client.matchLocationFromApiName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.apiPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchApiFromApiName', () => { - const result = client.matchApiFromApiName(fakePath); - assert.strictEqual(result, "apiValue"); - assert((client.pathTemplates.apiPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('apiHubInstance', () => { - const fakePath = "/rendered/path/apiHubInstance"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - api_hub_instance: "apiHubInstanceValue", - }; - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.apiHubInstancePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.apiHubInstancePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('apiHubInstancePath', () => { - const result = client.apiHubInstancePath("projectValue", "locationValue", "apiHubInstanceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.apiHubInstancePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromApiHubInstanceName', () => { - const result = client.matchProjectFromApiHubInstanceName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromApiHubInstanceName', () => { - const result = client.matchLocationFromApiHubInstanceName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchApiHubInstanceFromApiHubInstanceName', () => { - const result = client.matchApiHubInstanceFromApiHubInstanceName(fakePath); - assert.strictEqual(result, "apiHubInstanceValue"); - assert((client.pathTemplates.apiHubInstancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('apiOperation', () => { - const fakePath = "/rendered/path/apiOperation"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - api: "apiValue", - version: "versionValue", - operation: "operationValue", - }; - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.apiOperationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.apiOperationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('apiOperationPath', () => { - const result = client.apiOperationPath("projectValue", "locationValue", "apiValue", "versionValue", "operationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.apiOperationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromApiOperationName', () => { - const result = client.matchProjectFromApiOperationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromApiOperationName', () => { - const result = client.matchLocationFromApiOperationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchApiFromApiOperationName', () => { - const result = client.matchApiFromApiOperationName(fakePath); - assert.strictEqual(result, "apiValue"); - assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchVersionFromApiOperationName', () => { - const result = client.matchVersionFromApiOperationName(fakePath); - assert.strictEqual(result, "versionValue"); - assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchOperationFromApiOperationName', () => { - const result = client.matchOperationFromApiOperationName(fakePath); - assert.strictEqual(result, "operationValue"); - assert((client.pathTemplates.apiOperationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('attribute', () => { - const fakePath = "/rendered/path/attribute"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - attribute: "attributeValue", - }; - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.attributePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.attributePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('attributePath', () => { - const result = client.attributePath("projectValue", "locationValue", "attributeValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.attributePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromAttributeName', () => { - const result = client.matchProjectFromAttributeName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.attributePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromAttributeName', () => { - const result = client.matchLocationFromAttributeName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.attributePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAttributeFromAttributeName', () => { - const result = client.matchAttributeFromAttributeName(fakePath); - assert.strictEqual(result, "attributeValue"); - assert((client.pathTemplates.attributePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('definition', () => { - const fakePath = "/rendered/path/definition"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - api: "apiValue", - version: "versionValue", - definition: "definitionValue", - }; - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.definitionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.definitionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('definitionPath', () => { - const result = client.definitionPath("projectValue", "locationValue", "apiValue", "versionValue", "definitionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.definitionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDefinitionName', () => { - const result = client.matchProjectFromDefinitionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDefinitionName', () => { - const result = client.matchLocationFromDefinitionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchApiFromDefinitionName', () => { - const result = client.matchApiFromDefinitionName(fakePath); - assert.strictEqual(result, "apiValue"); - assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchVersionFromDefinitionName', () => { - const result = client.matchVersionFromDefinitionName(fakePath); - assert.strictEqual(result, "versionValue"); - assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDefinitionFromDefinitionName', () => { - const result = client.matchDefinitionFromDefinitionName(fakePath); - assert.strictEqual(result, "definitionValue"); - assert((client.pathTemplates.definitionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dependency', () => { - const fakePath = "/rendered/path/dependency"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dependency: "dependencyValue", - }; - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.dependencyPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.dependencyPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('dependencyPath', () => { - const result = client.dependencyPath("projectValue", "locationValue", "dependencyValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.dependencyPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDependencyName', () => { - const result = client.matchProjectFromDependencyName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.dependencyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDependencyName', () => { - const result = client.matchLocationFromDependencyName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.dependencyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDependencyFromDependencyName', () => { - const result = client.matchDependencyFromDependencyName(fakePath); - assert.strictEqual(result, "dependencyValue"); - assert((client.pathTemplates.dependencyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('deployment', () => { - const fakePath = "/rendered/path/deployment"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - deployment: "deploymentValue", - }; - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.deploymentPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.deploymentPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('deploymentPath', () => { - const result = client.deploymentPath("projectValue", "locationValue", "deploymentValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.deploymentPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDeploymentName', () => { - const result = client.matchProjectFromDeploymentName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDeploymentName', () => { - const result = client.matchLocationFromDeploymentName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDeploymentFromDeploymentName', () => { - const result = client.matchDeploymentFromDeploymentName(fakePath); - assert.strictEqual(result, "deploymentValue"); - assert((client.pathTemplates.deploymentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('externalApi', () => { - const fakePath = "/rendered/path/externalApi"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - external_api: "externalApiValue", - }; - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.externalApiPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.externalApiPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('externalApiPath', () => { - const result = client.externalApiPath("projectValue", "locationValue", "externalApiValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.externalApiPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromExternalApiName', () => { - const result = client.matchProjectFromExternalApiName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.externalApiPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromExternalApiName', () => { - const result = client.matchLocationFromExternalApiName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.externalApiPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExternalApiFromExternalApiName', () => { - const result = client.matchExternalApiFromExternalApiName(fakePath); - assert.strictEqual(result, "externalApiValue"); - assert((client.pathTemplates.externalApiPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('hostProjectRegistration', () => { - const fakePath = "/rendered/path/hostProjectRegistration"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - host_project_registration: "hostProjectRegistrationValue", - }; - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.hostProjectRegistrationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.hostProjectRegistrationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('hostProjectRegistrationPath', () => { - const result = client.hostProjectRegistrationPath("projectValue", "locationValue", "hostProjectRegistrationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.hostProjectRegistrationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromHostProjectRegistrationName', () => { - const result = client.matchProjectFromHostProjectRegistrationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.hostProjectRegistrationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromHostProjectRegistrationName', () => { - const result = client.matchLocationFromHostProjectRegistrationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.hostProjectRegistrationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchHostProjectRegistrationFromHostProjectRegistrationName', () => { - const result = client.matchHostProjectRegistrationFromHostProjectRegistrationName(fakePath); - assert.strictEqual(result, "hostProjectRegistrationValue"); - assert((client.pathTemplates.hostProjectRegistrationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('location', () => { - const fakePath = "/rendered/path/location"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - }; - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.locationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.locationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('locationPath', () => { - const result = client.locationPath("projectValue", "locationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.locationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromLocationName', () => { - const result = client.matchProjectFromLocationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromLocationName', () => { - const result = client.matchLocationFromLocationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('plugin', () => { - const fakePath = "/rendered/path/plugin"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - plugin: "pluginValue", - }; - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.pluginPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.pluginPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('pluginPath', () => { - const result = client.pluginPath("projectValue", "locationValue", "pluginValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.pluginPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromPluginName', () => { - const result = client.matchProjectFromPluginName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.pluginPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromPluginName', () => { - const result = client.matchLocationFromPluginName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.pluginPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchPluginFromPluginName', () => { - const result = client.matchPluginFromPluginName(fakePath); - assert.strictEqual(result, "pluginValue"); - assert((client.pathTemplates.pluginPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('project', () => { - const fakePath = "/rendered/path/project"; - const expectedParameters = { - project: "projectValue", - }; - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.projectPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectPath', () => { - const result = client.projectPath("projectValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectName', () => { - const result = client.matchProjectFromProjectName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('runtimeProjectAttachment', () => { - const fakePath = "/rendered/path/runtimeProjectAttachment"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - runtime_project_attachment: "runtimeProjectAttachmentValue", - }; - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.runtimeProjectAttachmentPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.runtimeProjectAttachmentPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('runtimeProjectAttachmentPath', () => { - const result = client.runtimeProjectAttachmentPath("projectValue", "locationValue", "runtimeProjectAttachmentValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromRuntimeProjectAttachmentName', () => { - const result = client.matchProjectFromRuntimeProjectAttachmentName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromRuntimeProjectAttachmentName', () => { - const result = client.matchLocationFromRuntimeProjectAttachmentName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName', () => { - const result = client.matchRuntimeProjectAttachmentFromRuntimeProjectAttachmentName(fakePath); - assert.strictEqual(result, "runtimeProjectAttachmentValue"); - assert((client.pathTemplates.runtimeProjectAttachmentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('spec', () => { - const fakePath = "/rendered/path/spec"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - api: "apiValue", - version: "versionValue", - spec: "specValue", - }; - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.specPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.specPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('specPath', () => { - const result = client.specPath("projectValue", "locationValue", "apiValue", "versionValue", "specValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.specPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSpecName', () => { - const result = client.matchProjectFromSpecName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.specPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSpecName', () => { - const result = client.matchLocationFromSpecName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.specPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchApiFromSpecName', () => { - const result = client.matchApiFromSpecName(fakePath); - assert.strictEqual(result, "apiValue"); - assert((client.pathTemplates.specPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchVersionFromSpecName', () => { - const result = client.matchVersionFromSpecName(fakePath); - assert.strictEqual(result, "versionValue"); - assert((client.pathTemplates.specPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSpecFromSpecName', () => { - const result = client.matchSpecFromSpecName(fakePath); - assert.strictEqual(result, "specValue"); - assert((client.pathTemplates.specPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('styleGuide', () => { - const fakePath = "/rendered/path/styleGuide"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - plugin: "pluginValue", - }; - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.styleGuidePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.styleGuidePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('styleGuidePath', () => { - const result = client.styleGuidePath("projectValue", "locationValue", "pluginValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.styleGuidePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromStyleGuideName', () => { - const result = client.matchProjectFromStyleGuideName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.styleGuidePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromStyleGuideName', () => { - const result = client.matchLocationFromStyleGuideName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.styleGuidePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchPluginFromStyleGuideName', () => { - const result = client.matchPluginFromStyleGuideName(fakePath); - assert.strictEqual(result, "pluginValue"); - assert((client.pathTemplates.styleGuidePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('version', () => { - const fakePath = "/rendered/path/version"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - api: "apiValue", - version: "versionValue", - }; - const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.versionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.versionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('versionPath', () => { - const result = client.versionPath("projectValue", "locationValue", "apiValue", "versionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.versionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromVersionName', () => { - const result = client.matchProjectFromVersionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.versionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromVersionName', () => { - const result = client.matchLocationFromVersionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.versionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchApiFromVersionName', () => { - const result = client.matchApiFromVersionName(fakePath); - assert.strictEqual(result, "apiValue"); - assert((client.pathTemplates.versionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchVersionFromVersionName', () => { - const result = client.matchVersionFromVersionName(fakePath); - assert.strictEqual(result, "versionValue"); - assert((client.pathTemplates.versionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/google-cloud-apihub/v1/tsconfig.json b/owl-bot-staging/google-cloud-apihub/v1/tsconfig.json deleted file mode 100644 index c78f1c884ef..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/tsconfig.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "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/owl-bot-staging/google-cloud-apihub/v1/webpack.config.js b/owl-bot-staging/google-cloud-apihub/v1/webpack.config.js deleted file mode 100644 index 6b83a6f3e3f..00000000000 --- a/owl-bot-staging/google-cloud-apihub/v1/webpack.config.js +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -const path = require('path'); - -module.exports = { - entry: './src/index.ts', - output: { - library: 'ApiHub', - filename: './api-hub.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/packages/google-cloud-apihub/src/v1/api_hub_client.ts b/packages/google-cloud-apihub/src/v1/api_hub_client.ts index 55f3952267c..0b00d390aed 100644 --- a/packages/google-cloud-apihub/src/v1/api_hub_client.ts +++ b/packages/google-cloud-apihub/src/v1/api_hub_client.ts @@ -139,6 +139,12 @@ export class ApiHubClient { ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). + if (!opts) { + opts = {fallback: true}; + } else { + opts.fallback = opts.fallback ?? true; + } const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); diff --git a/packages/google-cloud-apihub/src/v1/api_hub_dependencies_client.ts b/packages/google-cloud-apihub/src/v1/api_hub_dependencies_client.ts index 9dda80c20e9..48d5848d85d 100644 --- a/packages/google-cloud-apihub/src/v1/api_hub_dependencies_client.ts +++ b/packages/google-cloud-apihub/src/v1/api_hub_dependencies_client.ts @@ -140,6 +140,12 @@ export class ApiHubDependenciesClient { ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). + if (!opts) { + opts = {fallback: true}; + } else { + opts.fallback = opts.fallback ?? true; + } const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); diff --git a/packages/google-cloud-apihub/src/v1/api_hub_plugin_client.ts b/packages/google-cloud-apihub/src/v1/api_hub_plugin_client.ts index fdbc7e544ef..c932a804085 100644 --- a/packages/google-cloud-apihub/src/v1/api_hub_plugin_client.ts +++ b/packages/google-cloud-apihub/src/v1/api_hub_plugin_client.ts @@ -137,6 +137,12 @@ export class ApiHubPluginClient { ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). + if (!opts) { + opts = {fallback: true}; + } else { + opts.fallback = opts.fallback ?? true; + } const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); diff --git a/packages/google-cloud-apihub/src/v1/host_project_registration_service_client.ts b/packages/google-cloud-apihub/src/v1/host_project_registration_service_client.ts index d8f6732c15f..5bfdc3b277f 100644 --- a/packages/google-cloud-apihub/src/v1/host_project_registration_service_client.ts +++ b/packages/google-cloud-apihub/src/v1/host_project_registration_service_client.ts @@ -140,6 +140,12 @@ export class HostProjectRegistrationServiceClient { ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). + if (!opts) { + opts = {fallback: true}; + } else { + opts.fallback = opts.fallback ?? true; + } const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); diff --git a/packages/google-cloud-apihub/src/v1/linting_service_client.ts b/packages/google-cloud-apihub/src/v1/linting_service_client.ts index a2fe507ff9d..4ef2ba4234d 100644 --- a/packages/google-cloud-apihub/src/v1/linting_service_client.ts +++ b/packages/google-cloud-apihub/src/v1/linting_service_client.ts @@ -137,6 +137,12 @@ export class LintingServiceClient { ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). + if (!opts) { + opts = {fallback: true}; + } else { + opts.fallback = opts.fallback ?? true; + } const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); diff --git a/packages/google-cloud-apihub/src/v1/provisioning_client.ts b/packages/google-cloud-apihub/src/v1/provisioning_client.ts index 3df543eb37d..8e0a3fda51b 100644 --- a/packages/google-cloud-apihub/src/v1/provisioning_client.ts +++ b/packages/google-cloud-apihub/src/v1/provisioning_client.ts @@ -140,6 +140,12 @@ export class ProvisioningClient { ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). + if (!opts) { + opts = {fallback: true}; + } else { + opts.fallback = opts.fallback ?? true; + } const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); diff --git a/packages/google-cloud-apihub/src/v1/runtime_project_attachment_service_client.ts b/packages/google-cloud-apihub/src/v1/runtime_project_attachment_service_client.ts index c69ef2da2c5..ec4d2e0859b 100644 --- a/packages/google-cloud-apihub/src/v1/runtime_project_attachment_service_client.ts +++ b/packages/google-cloud-apihub/src/v1/runtime_project_attachment_service_client.ts @@ -140,6 +140,12 @@ export class RuntimeProjectAttachmentServiceClient { ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; + // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute). + if (!opts) { + opts = {fallback: true}; + } else { + opts.fallback = opts.fallback ?? true; + } const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); diff --git a/packages/google-cloud-apihub/test/gapic_api_hub_dependencies_v1.ts b/packages/google-cloud-apihub/test/gapic_api_hub_dependencies_v1.ts index ae748ad1921..d67b32e4cff 100644 --- a/packages/google-cloud-apihub/test/gapic_api_hub_dependencies_v1.ts +++ b/packages/google-cloud-apihub/test/gapic_api_hub_dependencies_v1.ts @@ -20,12 +20,12 @@ import * as protos from '../protos/protos'; import * as assert from 'assert'; import * as sinon from 'sinon'; import {SinonStub} from 'sinon'; -import {describe, it} from 'mocha'; +import {describe, it, beforeEach, afterEach} from 'mocha'; import * as apihubdependenciesModule from '../src'; import {PassThrough} from 'stream'; -import {protobuf, LocationProtos} from 'google-gax'; +import {GoogleAuth, protobuf, LocationProtos} from 'google-gax'; // Dynamically loaded proto JSON is needed to get the type information // to fill in default values for request objects @@ -128,6 +128,19 @@ function stubAsyncIterationCall( } describe('v1.ApiHubDependenciesClient', () => { + let googleAuth: GoogleAuth; + beforeEach(() => { + googleAuth = { + getClient: sinon.stub().resolves({ + getRequestHeaders: sinon + .stub() + .resolves({Authorization: 'Bearer SOME_TOKEN'}), + }), + } as unknown as GoogleAuth; + }); + afterEach(() => { + sinon.restore(); + }); describe('Common methods', () => { it('has apiEndpoint', () => { const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient(); @@ -241,7 +254,7 @@ describe('v1.ApiHubDependenciesClient', () => { it('has initialize method and supports deferred initialization', async () => { const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); assert.strictEqual(client.apiHubDependenciesStub, undefined); @@ -251,7 +264,7 @@ describe('v1.ApiHubDependenciesClient', () => { it('has close method for the initialized client', done => { const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -263,7 +276,7 @@ describe('v1.ApiHubDependenciesClient', () => { it('has close method for the non-initialized client', done => { const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); assert.strictEqual(client.apiHubDependenciesStub, undefined); @@ -275,7 +288,7 @@ describe('v1.ApiHubDependenciesClient', () => { it('has getProjectId method', async () => { const fakeProjectId = 'fake-project-id'; const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); @@ -287,7 +300,7 @@ describe('v1.ApiHubDependenciesClient', () => { it('has getProjectId method with callback', async () => { const fakeProjectId = 'fake-project-id'; const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.auth.getProjectId = sinon @@ -310,7 +323,7 @@ describe('v1.ApiHubDependenciesClient', () => { describe('createDependency', () => { it('invokes createDependency without error', async () => { const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -341,7 +354,7 @@ describe('v1.ApiHubDependenciesClient', () => { it('invokes createDependency without error using callback', async () => { const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -388,7 +401,7 @@ describe('v1.ApiHubDependenciesClient', () => { it('invokes createDependency with error', async () => { const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -419,7 +432,7 @@ describe('v1.ApiHubDependenciesClient', () => { it('invokes createDependency with closed client', async () => { const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -440,7 +453,7 @@ describe('v1.ApiHubDependenciesClient', () => { describe('getDependency', () => { it('invokes getDependency without error', async () => { const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -471,7 +484,7 @@ describe('v1.ApiHubDependenciesClient', () => { it('invokes getDependency without error using callback', async () => { const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -518,7 +531,7 @@ describe('v1.ApiHubDependenciesClient', () => { it('invokes getDependency with error', async () => { const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -549,7 +562,7 @@ describe('v1.ApiHubDependenciesClient', () => { it('invokes getDependency with closed client', async () => { const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -570,7 +583,7 @@ describe('v1.ApiHubDependenciesClient', () => { describe('updateDependency', () => { it('invokes updateDependency without error', async () => { const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -602,7 +615,7 @@ describe('v1.ApiHubDependenciesClient', () => { it('invokes updateDependency without error using callback', async () => { const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -650,7 +663,7 @@ describe('v1.ApiHubDependenciesClient', () => { it('invokes updateDependency with error', async () => { const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -682,7 +695,7 @@ describe('v1.ApiHubDependenciesClient', () => { it('invokes updateDependency with closed client', async () => { const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -704,7 +717,7 @@ describe('v1.ApiHubDependenciesClient', () => { describe('deleteDependency', () => { it('invokes deleteDependency without error', async () => { const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -735,7 +748,7 @@ describe('v1.ApiHubDependenciesClient', () => { it('invokes deleteDependency without error using callback', async () => { const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -782,7 +795,7 @@ describe('v1.ApiHubDependenciesClient', () => { it('invokes deleteDependency with error', async () => { const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -813,7 +826,7 @@ describe('v1.ApiHubDependenciesClient', () => { it('invokes deleteDependency with closed client', async () => { const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -1050,7 +1063,7 @@ describe('v1.ApiHubDependenciesClient', () => { it('uses async iteration with listDependencies without error', async () => { const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -1134,7 +1147,7 @@ describe('v1.ApiHubDependenciesClient', () => { describe('getLocation', () => { it('invokes getLocation without error', async () => { const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -1164,7 +1177,7 @@ describe('v1.ApiHubDependenciesClient', () => { }); it('invokes getLocation without error using callback', async () => { const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -1208,7 +1221,7 @@ describe('v1.ApiHubDependenciesClient', () => { }); it('invokes getLocation with error', async () => { const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -1243,7 +1256,7 @@ describe('v1.ApiHubDependenciesClient', () => { describe('listLocationsAsync', () => { it('uses async iteration with listLocations without error', async () => { const client = new apihubdependenciesModule.v1.ApiHubDependenciesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); diff --git a/packages/google-cloud-apihub/test/gapic_api_hub_plugin_v1.ts b/packages/google-cloud-apihub/test/gapic_api_hub_plugin_v1.ts index d0a92b2fa23..286e4e25c2a 100644 --- a/packages/google-cloud-apihub/test/gapic_api_hub_plugin_v1.ts +++ b/packages/google-cloud-apihub/test/gapic_api_hub_plugin_v1.ts @@ -20,10 +20,10 @@ import * as protos from '../protos/protos'; import * as assert from 'assert'; import * as sinon from 'sinon'; import {SinonStub} from 'sinon'; -import {describe, it} from 'mocha'; +import {describe, it, beforeEach, afterEach} from 'mocha'; import * as apihubpluginModule from '../src'; -import {protobuf, LocationProtos} from 'google-gax'; +import {GoogleAuth, protobuf, LocationProtos} from 'google-gax'; // Dynamically loaded proto JSON is needed to get the type information // to fill in default values for request objects @@ -88,6 +88,19 @@ function stubAsyncIterationCall( } describe('v1.ApiHubPluginClient', () => { + let googleAuth: GoogleAuth; + beforeEach(() => { + googleAuth = { + getClient: sinon.stub().resolves({ + getRequestHeaders: sinon + .stub() + .resolves({Authorization: 'Bearer SOME_TOKEN'}), + }), + } as unknown as GoogleAuth; + }); + afterEach(() => { + sinon.restore(); + }); describe('Common methods', () => { it('has apiEndpoint', () => { const client = new apihubpluginModule.v1.ApiHubPluginClient(); @@ -199,7 +212,7 @@ describe('v1.ApiHubPluginClient', () => { it('has initialize method and supports deferred initialization', async () => { const client = new apihubpluginModule.v1.ApiHubPluginClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); assert.strictEqual(client.apiHubPluginStub, undefined); @@ -209,7 +222,7 @@ describe('v1.ApiHubPluginClient', () => { it('has close method for the initialized client', done => { const client = new apihubpluginModule.v1.ApiHubPluginClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -221,7 +234,7 @@ describe('v1.ApiHubPluginClient', () => { it('has close method for the non-initialized client', done => { const client = new apihubpluginModule.v1.ApiHubPluginClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); assert.strictEqual(client.apiHubPluginStub, undefined); @@ -233,7 +246,7 @@ describe('v1.ApiHubPluginClient', () => { it('has getProjectId method', async () => { const fakeProjectId = 'fake-project-id'; const client = new apihubpluginModule.v1.ApiHubPluginClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); @@ -245,7 +258,7 @@ describe('v1.ApiHubPluginClient', () => { it('has getProjectId method with callback', async () => { const fakeProjectId = 'fake-project-id'; const client = new apihubpluginModule.v1.ApiHubPluginClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.auth.getProjectId = sinon @@ -268,7 +281,7 @@ describe('v1.ApiHubPluginClient', () => { describe('getPlugin', () => { it('invokes getPlugin without error', async () => { const client = new apihubpluginModule.v1.ApiHubPluginClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -299,7 +312,7 @@ describe('v1.ApiHubPluginClient', () => { it('invokes getPlugin without error using callback', async () => { const client = new apihubpluginModule.v1.ApiHubPluginClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -346,7 +359,7 @@ describe('v1.ApiHubPluginClient', () => { it('invokes getPlugin with error', async () => { const client = new apihubpluginModule.v1.ApiHubPluginClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -374,7 +387,7 @@ describe('v1.ApiHubPluginClient', () => { it('invokes getPlugin with closed client', async () => { const client = new apihubpluginModule.v1.ApiHubPluginClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -395,7 +408,7 @@ describe('v1.ApiHubPluginClient', () => { describe('enablePlugin', () => { it('invokes enablePlugin without error', async () => { const client = new apihubpluginModule.v1.ApiHubPluginClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -426,7 +439,7 @@ describe('v1.ApiHubPluginClient', () => { it('invokes enablePlugin without error using callback', async () => { const client = new apihubpluginModule.v1.ApiHubPluginClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -473,7 +486,7 @@ describe('v1.ApiHubPluginClient', () => { it('invokes enablePlugin with error', async () => { const client = new apihubpluginModule.v1.ApiHubPluginClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -504,7 +517,7 @@ describe('v1.ApiHubPluginClient', () => { it('invokes enablePlugin with closed client', async () => { const client = new apihubpluginModule.v1.ApiHubPluginClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -525,7 +538,7 @@ describe('v1.ApiHubPluginClient', () => { describe('disablePlugin', () => { it('invokes disablePlugin without error', async () => { const client = new apihubpluginModule.v1.ApiHubPluginClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -556,7 +569,7 @@ describe('v1.ApiHubPluginClient', () => { it('invokes disablePlugin without error using callback', async () => { const client = new apihubpluginModule.v1.ApiHubPluginClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -603,7 +616,7 @@ describe('v1.ApiHubPluginClient', () => { it('invokes disablePlugin with error', async () => { const client = new apihubpluginModule.v1.ApiHubPluginClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -634,7 +647,7 @@ describe('v1.ApiHubPluginClient', () => { it('invokes disablePlugin with closed client', async () => { const client = new apihubpluginModule.v1.ApiHubPluginClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -654,7 +667,7 @@ describe('v1.ApiHubPluginClient', () => { describe('getLocation', () => { it('invokes getLocation without error', async () => { const client = new apihubpluginModule.v1.ApiHubPluginClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -684,7 +697,7 @@ describe('v1.ApiHubPluginClient', () => { }); it('invokes getLocation without error using callback', async () => { const client = new apihubpluginModule.v1.ApiHubPluginClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -728,7 +741,7 @@ describe('v1.ApiHubPluginClient', () => { }); it('invokes getLocation with error', async () => { const client = new apihubpluginModule.v1.ApiHubPluginClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -763,7 +776,7 @@ describe('v1.ApiHubPluginClient', () => { describe('listLocationsAsync', () => { it('uses async iteration with listLocations without error', async () => { const client = new apihubpluginModule.v1.ApiHubPluginClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); diff --git a/packages/google-cloud-apihub/test/gapic_api_hub_v1.ts b/packages/google-cloud-apihub/test/gapic_api_hub_v1.ts index 45e66ae29e2..b51c68d4537 100644 --- a/packages/google-cloud-apihub/test/gapic_api_hub_v1.ts +++ b/packages/google-cloud-apihub/test/gapic_api_hub_v1.ts @@ -20,12 +20,12 @@ import * as protos from '../protos/protos'; import * as assert from 'assert'; import * as sinon from 'sinon'; import {SinonStub} from 'sinon'; -import {describe, it} from 'mocha'; +import {describe, it, beforeEach, afterEach} from 'mocha'; import * as apihubModule from '../src'; import {PassThrough} from 'stream'; -import {protobuf, LocationProtos} from 'google-gax'; +import {GoogleAuth, protobuf, LocationProtos} from 'google-gax'; // Dynamically loaded proto JSON is needed to get the type information // to fill in default values for request objects @@ -128,6 +128,19 @@ function stubAsyncIterationCall( } describe('v1.ApiHubClient', () => { + let googleAuth: GoogleAuth; + beforeEach(() => { + googleAuth = { + getClient: sinon.stub().resolves({ + getRequestHeaders: sinon + .stub() + .resolves({Authorization: 'Bearer SOME_TOKEN'}), + }), + } as unknown as GoogleAuth; + }); + afterEach(() => { + sinon.restore(); + }); describe('Common methods', () => { it('has apiEndpoint', () => { const client = new apihubModule.v1.ApiHubClient(); @@ -237,7 +250,7 @@ describe('v1.ApiHubClient', () => { it('has initialize method and supports deferred initialization', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); assert.strictEqual(client.apiHubStub, undefined); @@ -247,7 +260,7 @@ describe('v1.ApiHubClient', () => { it('has close method for the initialized client', done => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -259,7 +272,7 @@ describe('v1.ApiHubClient', () => { it('has close method for the non-initialized client', done => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); assert.strictEqual(client.apiHubStub, undefined); @@ -271,7 +284,7 @@ describe('v1.ApiHubClient', () => { it('has getProjectId method', async () => { const fakeProjectId = 'fake-project-id'; const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); @@ -283,7 +296,7 @@ describe('v1.ApiHubClient', () => { it('has getProjectId method with callback', async () => { const fakeProjectId = 'fake-project-id'; const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.auth.getProjectId = sinon @@ -306,7 +319,7 @@ describe('v1.ApiHubClient', () => { describe('createApi', () => { it('invokes createApi without error', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -337,7 +350,7 @@ describe('v1.ApiHubClient', () => { it('invokes createApi without error using callback', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -384,7 +397,7 @@ describe('v1.ApiHubClient', () => { it('invokes createApi with error', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -412,7 +425,7 @@ describe('v1.ApiHubClient', () => { it('invokes createApi with closed client', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -433,7 +446,7 @@ describe('v1.ApiHubClient', () => { describe('getApi', () => { it('invokes getApi without error', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -464,7 +477,7 @@ describe('v1.ApiHubClient', () => { it('invokes getApi without error using callback', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -511,7 +524,7 @@ describe('v1.ApiHubClient', () => { it('invokes getApi with error', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -539,7 +552,7 @@ describe('v1.ApiHubClient', () => { it('invokes getApi with closed client', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -560,7 +573,7 @@ describe('v1.ApiHubClient', () => { describe('updateApi', () => { it('invokes updateApi without error', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -592,7 +605,7 @@ describe('v1.ApiHubClient', () => { it('invokes updateApi without error using callback', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -640,7 +653,7 @@ describe('v1.ApiHubClient', () => { it('invokes updateApi with error', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -669,7 +682,7 @@ describe('v1.ApiHubClient', () => { it('invokes updateApi with closed client', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -691,7 +704,7 @@ describe('v1.ApiHubClient', () => { describe('deleteApi', () => { it('invokes deleteApi without error', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -722,7 +735,7 @@ describe('v1.ApiHubClient', () => { it('invokes deleteApi without error using callback', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -769,7 +782,7 @@ describe('v1.ApiHubClient', () => { it('invokes deleteApi with error', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -797,7 +810,7 @@ describe('v1.ApiHubClient', () => { it('invokes deleteApi with closed client', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -818,7 +831,7 @@ describe('v1.ApiHubClient', () => { describe('createVersion', () => { it('invokes createVersion without error', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -849,7 +862,7 @@ describe('v1.ApiHubClient', () => { it('invokes createVersion without error using callback', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -896,7 +909,7 @@ describe('v1.ApiHubClient', () => { it('invokes createVersion with error', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -927,7 +940,7 @@ describe('v1.ApiHubClient', () => { it('invokes createVersion with closed client', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -948,7 +961,7 @@ describe('v1.ApiHubClient', () => { describe('getVersion', () => { it('invokes getVersion without error', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -979,7 +992,7 @@ describe('v1.ApiHubClient', () => { it('invokes getVersion without error using callback', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -1026,7 +1039,7 @@ describe('v1.ApiHubClient', () => { it('invokes getVersion with error', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -1057,7 +1070,7 @@ describe('v1.ApiHubClient', () => { it('invokes getVersion with closed client', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -1078,7 +1091,7 @@ describe('v1.ApiHubClient', () => { describe('updateVersion', () => { it('invokes updateVersion without error', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -1110,7 +1123,7 @@ describe('v1.ApiHubClient', () => { it('invokes updateVersion without error using callback', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -1158,7 +1171,7 @@ describe('v1.ApiHubClient', () => { it('invokes updateVersion with error', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -1190,7 +1203,7 @@ describe('v1.ApiHubClient', () => { it('invokes updateVersion with closed client', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -1212,7 +1225,7 @@ describe('v1.ApiHubClient', () => { describe('deleteVersion', () => { it('invokes deleteVersion without error', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -1243,7 +1256,7 @@ describe('v1.ApiHubClient', () => { it('invokes deleteVersion without error using callback', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -1290,7 +1303,7 @@ describe('v1.ApiHubClient', () => { it('invokes deleteVersion with error', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -1321,7 +1334,7 @@ describe('v1.ApiHubClient', () => { it('invokes deleteVersion with closed client', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -1342,7 +1355,7 @@ describe('v1.ApiHubClient', () => { describe('createSpec', () => { it('invokes createSpec without error', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -1373,7 +1386,7 @@ describe('v1.ApiHubClient', () => { it('invokes createSpec without error using callback', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -1420,7 +1433,7 @@ describe('v1.ApiHubClient', () => { it('invokes createSpec with error', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -1451,7 +1464,7 @@ describe('v1.ApiHubClient', () => { it('invokes createSpec with closed client', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -1472,7 +1485,7 @@ describe('v1.ApiHubClient', () => { describe('getSpec', () => { it('invokes getSpec without error', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -1503,7 +1516,7 @@ describe('v1.ApiHubClient', () => { it('invokes getSpec without error using callback', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -1550,7 +1563,7 @@ describe('v1.ApiHubClient', () => { it('invokes getSpec with error', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -1578,7 +1591,7 @@ describe('v1.ApiHubClient', () => { it('invokes getSpec with closed client', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -1599,7 +1612,7 @@ describe('v1.ApiHubClient', () => { describe('getSpecContents', () => { it('invokes getSpecContents without error', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -1630,7 +1643,7 @@ describe('v1.ApiHubClient', () => { it('invokes getSpecContents without error using callback', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -1677,7 +1690,7 @@ describe('v1.ApiHubClient', () => { it('invokes getSpecContents with error', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -1708,7 +1721,7 @@ describe('v1.ApiHubClient', () => { it('invokes getSpecContents with closed client', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -1729,7 +1742,7 @@ describe('v1.ApiHubClient', () => { describe('updateSpec', () => { it('invokes updateSpec without error', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -1761,7 +1774,7 @@ describe('v1.ApiHubClient', () => { it('invokes updateSpec without error using callback', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -1809,7 +1822,7 @@ describe('v1.ApiHubClient', () => { it('invokes updateSpec with error', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -1841,7 +1854,7 @@ describe('v1.ApiHubClient', () => { it('invokes updateSpec with closed client', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -1863,7 +1876,7 @@ describe('v1.ApiHubClient', () => { describe('deleteSpec', () => { it('invokes deleteSpec without error', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -1894,7 +1907,7 @@ describe('v1.ApiHubClient', () => { it('invokes deleteSpec without error using callback', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -1941,7 +1954,7 @@ describe('v1.ApiHubClient', () => { it('invokes deleteSpec with error', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -1972,7 +1985,7 @@ describe('v1.ApiHubClient', () => { it('invokes deleteSpec with closed client', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -1993,7 +2006,7 @@ describe('v1.ApiHubClient', () => { describe('getApiOperation', () => { it('invokes getApiOperation without error', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -2024,7 +2037,7 @@ describe('v1.ApiHubClient', () => { it('invokes getApiOperation without error using callback', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -2071,7 +2084,7 @@ describe('v1.ApiHubClient', () => { it('invokes getApiOperation with error', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -2102,7 +2115,7 @@ describe('v1.ApiHubClient', () => { it('invokes getApiOperation with closed client', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -2123,7 +2136,7 @@ describe('v1.ApiHubClient', () => { describe('getDefinition', () => { it('invokes getDefinition without error', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -2154,7 +2167,7 @@ describe('v1.ApiHubClient', () => { it('invokes getDefinition without error using callback', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -2201,7 +2214,7 @@ describe('v1.ApiHubClient', () => { it('invokes getDefinition with error', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -2232,7 +2245,7 @@ describe('v1.ApiHubClient', () => { it('invokes getDefinition with closed client', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -2253,7 +2266,7 @@ describe('v1.ApiHubClient', () => { describe('createDeployment', () => { it('invokes createDeployment without error', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -2284,7 +2297,7 @@ describe('v1.ApiHubClient', () => { it('invokes createDeployment without error using callback', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -2331,7 +2344,7 @@ describe('v1.ApiHubClient', () => { it('invokes createDeployment with error', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -2362,7 +2375,7 @@ describe('v1.ApiHubClient', () => { it('invokes createDeployment with closed client', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -2383,7 +2396,7 @@ describe('v1.ApiHubClient', () => { describe('getDeployment', () => { it('invokes getDeployment without error', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -2414,7 +2427,7 @@ describe('v1.ApiHubClient', () => { it('invokes getDeployment without error using callback', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -2461,7 +2474,7 @@ describe('v1.ApiHubClient', () => { it('invokes getDeployment with error', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -2492,7 +2505,7 @@ describe('v1.ApiHubClient', () => { it('invokes getDeployment with closed client', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -2513,7 +2526,7 @@ describe('v1.ApiHubClient', () => { describe('updateDeployment', () => { it('invokes updateDeployment without error', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -2545,7 +2558,7 @@ describe('v1.ApiHubClient', () => { it('invokes updateDeployment without error using callback', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -2593,7 +2606,7 @@ describe('v1.ApiHubClient', () => { it('invokes updateDeployment with error', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -2625,7 +2638,7 @@ describe('v1.ApiHubClient', () => { it('invokes updateDeployment with closed client', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -2647,7 +2660,7 @@ describe('v1.ApiHubClient', () => { describe('deleteDeployment', () => { it('invokes deleteDeployment without error', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -2678,7 +2691,7 @@ describe('v1.ApiHubClient', () => { it('invokes deleteDeployment without error using callback', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -2725,7 +2738,7 @@ describe('v1.ApiHubClient', () => { it('invokes deleteDeployment with error', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -2756,7 +2769,7 @@ describe('v1.ApiHubClient', () => { it('invokes deleteDeployment with closed client', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -2777,7 +2790,7 @@ describe('v1.ApiHubClient', () => { describe('createAttribute', () => { it('invokes createAttribute without error', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -2808,7 +2821,7 @@ describe('v1.ApiHubClient', () => { it('invokes createAttribute without error using callback', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -2855,7 +2868,7 @@ describe('v1.ApiHubClient', () => { it('invokes createAttribute with error', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -2886,7 +2899,7 @@ describe('v1.ApiHubClient', () => { it('invokes createAttribute with closed client', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -2907,7 +2920,7 @@ describe('v1.ApiHubClient', () => { describe('getAttribute', () => { it('invokes getAttribute without error', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -2938,7 +2951,7 @@ describe('v1.ApiHubClient', () => { it('invokes getAttribute without error using callback', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -2985,7 +2998,7 @@ describe('v1.ApiHubClient', () => { it('invokes getAttribute with error', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -3016,7 +3029,7 @@ describe('v1.ApiHubClient', () => { it('invokes getAttribute with closed client', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -3037,7 +3050,7 @@ describe('v1.ApiHubClient', () => { describe('updateAttribute', () => { it('invokes updateAttribute without error', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -3069,7 +3082,7 @@ describe('v1.ApiHubClient', () => { it('invokes updateAttribute without error using callback', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -3117,7 +3130,7 @@ describe('v1.ApiHubClient', () => { it('invokes updateAttribute with error', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -3149,7 +3162,7 @@ describe('v1.ApiHubClient', () => { it('invokes updateAttribute with closed client', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -3171,7 +3184,7 @@ describe('v1.ApiHubClient', () => { describe('deleteAttribute', () => { it('invokes deleteAttribute without error', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -3202,7 +3215,7 @@ describe('v1.ApiHubClient', () => { it('invokes deleteAttribute without error using callback', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -3249,7 +3262,7 @@ describe('v1.ApiHubClient', () => { it('invokes deleteAttribute with error', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -3280,7 +3293,7 @@ describe('v1.ApiHubClient', () => { it('invokes deleteAttribute with closed client', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -3301,7 +3314,7 @@ describe('v1.ApiHubClient', () => { describe('createExternalApi', () => { it('invokes createExternalApi without error', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -3332,7 +3345,7 @@ describe('v1.ApiHubClient', () => { it('invokes createExternalApi without error using callback', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -3379,7 +3392,7 @@ describe('v1.ApiHubClient', () => { it('invokes createExternalApi with error', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -3410,7 +3423,7 @@ describe('v1.ApiHubClient', () => { it('invokes createExternalApi with closed client', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -3431,7 +3444,7 @@ describe('v1.ApiHubClient', () => { describe('getExternalApi', () => { it('invokes getExternalApi without error', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -3462,7 +3475,7 @@ describe('v1.ApiHubClient', () => { it('invokes getExternalApi without error using callback', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -3509,7 +3522,7 @@ describe('v1.ApiHubClient', () => { it('invokes getExternalApi with error', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -3540,7 +3553,7 @@ describe('v1.ApiHubClient', () => { it('invokes getExternalApi with closed client', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -3561,7 +3574,7 @@ describe('v1.ApiHubClient', () => { describe('updateExternalApi', () => { it('invokes updateExternalApi without error', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -3593,7 +3606,7 @@ describe('v1.ApiHubClient', () => { it('invokes updateExternalApi without error using callback', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -3641,7 +3654,7 @@ describe('v1.ApiHubClient', () => { it('invokes updateExternalApi with error', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -3673,7 +3686,7 @@ describe('v1.ApiHubClient', () => { it('invokes updateExternalApi with closed client', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -3695,7 +3708,7 @@ describe('v1.ApiHubClient', () => { describe('deleteExternalApi', () => { it('invokes deleteExternalApi without error', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -3726,7 +3739,7 @@ describe('v1.ApiHubClient', () => { it('invokes deleteExternalApi without error using callback', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -3773,7 +3786,7 @@ describe('v1.ApiHubClient', () => { it('invokes deleteExternalApi with error', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -3804,7 +3817,7 @@ describe('v1.ApiHubClient', () => { it('invokes deleteExternalApi with closed client', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -4034,7 +4047,7 @@ describe('v1.ApiHubClient', () => { it('uses async iteration with listApis without error', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -4331,7 +4344,7 @@ describe('v1.ApiHubClient', () => { it('uses async iteration with listVersions without error', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -4625,7 +4638,7 @@ describe('v1.ApiHubClient', () => { it('uses async iteration with listSpecs without error', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -4926,7 +4939,7 @@ describe('v1.ApiHubClient', () => { it('uses async iteration with listApiOperations without error', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -5227,7 +5240,7 @@ describe('v1.ApiHubClient', () => { it('uses async iteration with listDeployments without error', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -5528,7 +5541,7 @@ describe('v1.ApiHubClient', () => { it('uses async iteration with listAttributes without error', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -5829,7 +5842,7 @@ describe('v1.ApiHubClient', () => { it('uses async iteration with searchResources without error', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -6130,7 +6143,7 @@ describe('v1.ApiHubClient', () => { it('uses async iteration with listExternalApis without error', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -6214,7 +6227,7 @@ describe('v1.ApiHubClient', () => { describe('getLocation', () => { it('invokes getLocation without error', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -6244,7 +6257,7 @@ describe('v1.ApiHubClient', () => { }); it('invokes getLocation without error using callback', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -6288,7 +6301,7 @@ describe('v1.ApiHubClient', () => { }); it('invokes getLocation with error', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -6323,7 +6336,7 @@ describe('v1.ApiHubClient', () => { describe('listLocationsAsync', () => { it('uses async iteration with listLocations without error', async () => { const client = new apihubModule.v1.ApiHubClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); diff --git a/packages/google-cloud-apihub/test/gapic_host_project_registration_service_v1.ts b/packages/google-cloud-apihub/test/gapic_host_project_registration_service_v1.ts index a7ef4f96b49..d8483880fd4 100644 --- a/packages/google-cloud-apihub/test/gapic_host_project_registration_service_v1.ts +++ b/packages/google-cloud-apihub/test/gapic_host_project_registration_service_v1.ts @@ -20,12 +20,12 @@ import * as protos from '../protos/protos'; import * as assert from 'assert'; import * as sinon from 'sinon'; import {SinonStub} from 'sinon'; -import {describe, it} from 'mocha'; +import {describe, it, beforeEach, afterEach} from 'mocha'; import * as hostprojectregistrationserviceModule from '../src'; import {PassThrough} from 'stream'; -import {protobuf, LocationProtos} from 'google-gax'; +import {GoogleAuth, protobuf, LocationProtos} from 'google-gax'; // Dynamically loaded proto JSON is needed to get the type information // to fill in default values for request objects @@ -128,6 +128,19 @@ function stubAsyncIterationCall( } describe('v1.HostProjectRegistrationServiceClient', () => { + let googleAuth: GoogleAuth; + beforeEach(() => { + googleAuth = { + getClient: sinon.stub().resolves({ + getRequestHeaders: sinon + .stub() + .resolves({Authorization: 'Bearer SOME_TOKEN'}), + }), + } as unknown as GoogleAuth; + }); + afterEach(() => { + sinon.restore(); + }); describe('Common methods', () => { it('has apiEndpoint', () => { const client = @@ -254,7 +267,7 @@ describe('v1.HostProjectRegistrationServiceClient', () => { const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient( { - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', } ); @@ -267,7 +280,7 @@ describe('v1.HostProjectRegistrationServiceClient', () => { const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient( { - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', } ); @@ -282,7 +295,7 @@ describe('v1.HostProjectRegistrationServiceClient', () => { const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient( { - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', } ); @@ -297,7 +310,7 @@ describe('v1.HostProjectRegistrationServiceClient', () => { const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient( { - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', } ); @@ -312,7 +325,7 @@ describe('v1.HostProjectRegistrationServiceClient', () => { const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient( { - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', } ); @@ -338,7 +351,7 @@ describe('v1.HostProjectRegistrationServiceClient', () => { const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient( { - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', } ); @@ -373,7 +386,7 @@ describe('v1.HostProjectRegistrationServiceClient', () => { const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient( { - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', } ); @@ -423,7 +436,7 @@ describe('v1.HostProjectRegistrationServiceClient', () => { const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient( { - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', } ); @@ -460,7 +473,7 @@ describe('v1.HostProjectRegistrationServiceClient', () => { const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient( { - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', } ); @@ -487,7 +500,7 @@ describe('v1.HostProjectRegistrationServiceClient', () => { const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient( { - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', } ); @@ -522,7 +535,7 @@ describe('v1.HostProjectRegistrationServiceClient', () => { const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient( { - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', } ); @@ -572,7 +585,7 @@ describe('v1.HostProjectRegistrationServiceClient', () => { const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient( { - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', } ); @@ -609,7 +622,7 @@ describe('v1.HostProjectRegistrationServiceClient', () => { const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient( { - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', } ); @@ -911,7 +924,7 @@ describe('v1.HostProjectRegistrationServiceClient', () => { const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient( { - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', } ); @@ -1017,7 +1030,7 @@ describe('v1.HostProjectRegistrationServiceClient', () => { const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient( { - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', } ); @@ -1050,7 +1063,7 @@ describe('v1.HostProjectRegistrationServiceClient', () => { const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient( { - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', } ); @@ -1097,7 +1110,7 @@ describe('v1.HostProjectRegistrationServiceClient', () => { const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient( { - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', } ); @@ -1135,7 +1148,7 @@ describe('v1.HostProjectRegistrationServiceClient', () => { const client = new hostprojectregistrationserviceModule.v1.HostProjectRegistrationServiceClient( { - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', } ); diff --git a/packages/google-cloud-apihub/test/gapic_linting_service_v1.ts b/packages/google-cloud-apihub/test/gapic_linting_service_v1.ts index 2088a3bdd4c..3d9401ec9a6 100644 --- a/packages/google-cloud-apihub/test/gapic_linting_service_v1.ts +++ b/packages/google-cloud-apihub/test/gapic_linting_service_v1.ts @@ -20,10 +20,10 @@ import * as protos from '../protos/protos'; import * as assert from 'assert'; import * as sinon from 'sinon'; import {SinonStub} from 'sinon'; -import {describe, it} from 'mocha'; +import {describe, it, beforeEach, afterEach} from 'mocha'; import * as lintingserviceModule from '../src'; -import {protobuf, LocationProtos} from 'google-gax'; +import {GoogleAuth, protobuf, LocationProtos} from 'google-gax'; // Dynamically loaded proto JSON is needed to get the type information // to fill in default values for request objects @@ -88,6 +88,19 @@ function stubAsyncIterationCall( } describe('v1.LintingServiceClient', () => { + let googleAuth: GoogleAuth; + beforeEach(() => { + googleAuth = { + getClient: sinon.stub().resolves({ + getRequestHeaders: sinon + .stub() + .resolves({Authorization: 'Bearer SOME_TOKEN'}), + }), + } as unknown as GoogleAuth; + }); + afterEach(() => { + sinon.restore(); + }); describe('Common methods', () => { it('has apiEndpoint', () => { const client = new lintingserviceModule.v1.LintingServiceClient(); @@ -199,7 +212,7 @@ describe('v1.LintingServiceClient', () => { it('has initialize method and supports deferred initialization', async () => { const client = new lintingserviceModule.v1.LintingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); assert.strictEqual(client.lintingServiceStub, undefined); @@ -209,7 +222,7 @@ describe('v1.LintingServiceClient', () => { it('has close method for the initialized client', done => { const client = new lintingserviceModule.v1.LintingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -221,7 +234,7 @@ describe('v1.LintingServiceClient', () => { it('has close method for the non-initialized client', done => { const client = new lintingserviceModule.v1.LintingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); assert.strictEqual(client.lintingServiceStub, undefined); @@ -233,7 +246,7 @@ describe('v1.LintingServiceClient', () => { it('has getProjectId method', async () => { const fakeProjectId = 'fake-project-id'; const client = new lintingserviceModule.v1.LintingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); @@ -245,7 +258,7 @@ describe('v1.LintingServiceClient', () => { it('has getProjectId method with callback', async () => { const fakeProjectId = 'fake-project-id'; const client = new lintingserviceModule.v1.LintingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.auth.getProjectId = sinon @@ -268,7 +281,7 @@ describe('v1.LintingServiceClient', () => { describe('getStyleGuide', () => { it('invokes getStyleGuide without error', async () => { const client = new lintingserviceModule.v1.LintingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -299,7 +312,7 @@ describe('v1.LintingServiceClient', () => { it('invokes getStyleGuide without error using callback', async () => { const client = new lintingserviceModule.v1.LintingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -346,7 +359,7 @@ describe('v1.LintingServiceClient', () => { it('invokes getStyleGuide with error', async () => { const client = new lintingserviceModule.v1.LintingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -377,7 +390,7 @@ describe('v1.LintingServiceClient', () => { it('invokes getStyleGuide with closed client', async () => { const client = new lintingserviceModule.v1.LintingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -398,7 +411,7 @@ describe('v1.LintingServiceClient', () => { describe('updateStyleGuide', () => { it('invokes updateStyleGuide without error', async () => { const client = new lintingserviceModule.v1.LintingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -430,7 +443,7 @@ describe('v1.LintingServiceClient', () => { it('invokes updateStyleGuide without error using callback', async () => { const client = new lintingserviceModule.v1.LintingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -478,7 +491,7 @@ describe('v1.LintingServiceClient', () => { it('invokes updateStyleGuide with error', async () => { const client = new lintingserviceModule.v1.LintingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -510,7 +523,7 @@ describe('v1.LintingServiceClient', () => { it('invokes updateStyleGuide with closed client', async () => { const client = new lintingserviceModule.v1.LintingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -532,7 +545,7 @@ describe('v1.LintingServiceClient', () => { describe('getStyleGuideContents', () => { it('invokes getStyleGuideContents without error', async () => { const client = new lintingserviceModule.v1.LintingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -564,7 +577,7 @@ describe('v1.LintingServiceClient', () => { it('invokes getStyleGuideContents without error using callback', async () => { const client = new lintingserviceModule.v1.LintingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -611,7 +624,7 @@ describe('v1.LintingServiceClient', () => { it('invokes getStyleGuideContents with error', async () => { const client = new lintingserviceModule.v1.LintingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -645,7 +658,7 @@ describe('v1.LintingServiceClient', () => { it('invokes getStyleGuideContents with closed client', async () => { const client = new lintingserviceModule.v1.LintingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -669,7 +682,7 @@ describe('v1.LintingServiceClient', () => { describe('lintSpec', () => { it('invokes lintSpec without error', async () => { const client = new lintingserviceModule.v1.LintingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -700,7 +713,7 @@ describe('v1.LintingServiceClient', () => { it('invokes lintSpec without error using callback', async () => { const client = new lintingserviceModule.v1.LintingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -747,7 +760,7 @@ describe('v1.LintingServiceClient', () => { it('invokes lintSpec with error', async () => { const client = new lintingserviceModule.v1.LintingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -775,7 +788,7 @@ describe('v1.LintingServiceClient', () => { it('invokes lintSpec with closed client', async () => { const client = new lintingserviceModule.v1.LintingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -795,7 +808,7 @@ describe('v1.LintingServiceClient', () => { describe('getLocation', () => { it('invokes getLocation without error', async () => { const client = new lintingserviceModule.v1.LintingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -825,7 +838,7 @@ describe('v1.LintingServiceClient', () => { }); it('invokes getLocation without error using callback', async () => { const client = new lintingserviceModule.v1.LintingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -869,7 +882,7 @@ describe('v1.LintingServiceClient', () => { }); it('invokes getLocation with error', async () => { const client = new lintingserviceModule.v1.LintingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -904,7 +917,7 @@ describe('v1.LintingServiceClient', () => { describe('listLocationsAsync', () => { it('uses async iteration with listLocations without error', async () => { const client = new lintingserviceModule.v1.LintingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); diff --git a/packages/google-cloud-apihub/test/gapic_provisioning_v1.ts b/packages/google-cloud-apihub/test/gapic_provisioning_v1.ts index b1aa6b16e94..ed8efd43f0d 100644 --- a/packages/google-cloud-apihub/test/gapic_provisioning_v1.ts +++ b/packages/google-cloud-apihub/test/gapic_provisioning_v1.ts @@ -20,10 +20,11 @@ import * as protos from '../protos/protos'; import * as assert from 'assert'; import * as sinon from 'sinon'; import {SinonStub} from 'sinon'; -import {describe, it} from 'mocha'; +import {describe, it, beforeEach, afterEach} from 'mocha'; import * as provisioningModule from '../src'; import { + GoogleAuth, protobuf, LROperation, operationsProtos, @@ -125,6 +126,19 @@ function stubAsyncIterationCall( } describe('v1.ProvisioningClient', () => { + let googleAuth: GoogleAuth; + beforeEach(() => { + googleAuth = { + getClient: sinon.stub().resolves({ + getRequestHeaders: sinon + .stub() + .resolves({Authorization: 'Bearer SOME_TOKEN'}), + }), + } as unknown as GoogleAuth; + }); + afterEach(() => { + sinon.restore(); + }); describe('Common methods', () => { it('has apiEndpoint', () => { const client = new provisioningModule.v1.ProvisioningClient(); @@ -236,7 +250,7 @@ describe('v1.ProvisioningClient', () => { it('has initialize method and supports deferred initialization', async () => { const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); assert.strictEqual(client.provisioningStub, undefined); @@ -246,7 +260,7 @@ describe('v1.ProvisioningClient', () => { it('has close method for the initialized client', done => { const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -258,7 +272,7 @@ describe('v1.ProvisioningClient', () => { it('has close method for the non-initialized client', done => { const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); assert.strictEqual(client.provisioningStub, undefined); @@ -270,7 +284,7 @@ describe('v1.ProvisioningClient', () => { it('has getProjectId method', async () => { const fakeProjectId = 'fake-project-id'; const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); @@ -282,7 +296,7 @@ describe('v1.ProvisioningClient', () => { it('has getProjectId method with callback', async () => { const fakeProjectId = 'fake-project-id'; const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.auth.getProjectId = sinon @@ -305,7 +319,7 @@ describe('v1.ProvisioningClient', () => { describe('getApiHubInstance', () => { it('invokes getApiHubInstance without error', async () => { const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -336,7 +350,7 @@ describe('v1.ProvisioningClient', () => { it('invokes getApiHubInstance without error using callback', async () => { const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -383,7 +397,7 @@ describe('v1.ProvisioningClient', () => { it('invokes getApiHubInstance with error', async () => { const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -414,7 +428,7 @@ describe('v1.ProvisioningClient', () => { it('invokes getApiHubInstance with closed client', async () => { const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -435,7 +449,7 @@ describe('v1.ProvisioningClient', () => { describe('lookupApiHubInstance', () => { it('invokes lookupApiHubInstance without error', async () => { const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -467,7 +481,7 @@ describe('v1.ProvisioningClient', () => { it('invokes lookupApiHubInstance without error using callback', async () => { const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -514,7 +528,7 @@ describe('v1.ProvisioningClient', () => { it('invokes lookupApiHubInstance with error', async () => { const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -545,7 +559,7 @@ describe('v1.ProvisioningClient', () => { it('invokes lookupApiHubInstance with closed client', async () => { const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -566,7 +580,7 @@ describe('v1.ProvisioningClient', () => { describe('createApiHubInstance', () => { it('invokes createApiHubInstance without error', async () => { const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -599,7 +613,7 @@ describe('v1.ProvisioningClient', () => { it('invokes createApiHubInstance without error using callback', async () => { const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -653,7 +667,7 @@ describe('v1.ProvisioningClient', () => { it('invokes createApiHubInstance with call error', async () => { const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -684,7 +698,7 @@ describe('v1.ProvisioningClient', () => { it('invokes createApiHubInstance with LRO error', async () => { const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -717,7 +731,7 @@ describe('v1.ProvisioningClient', () => { it('invokes checkCreateApiHubInstanceProgress without error', async () => { const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -739,7 +753,7 @@ describe('v1.ProvisioningClient', () => { it('invokes checkCreateApiHubInstanceProgress with error', async () => { const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -759,7 +773,7 @@ describe('v1.ProvisioningClient', () => { describe('getLocation', () => { it('invokes getLocation without error', async () => { const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -789,7 +803,7 @@ describe('v1.ProvisioningClient', () => { }); it('invokes getLocation without error using callback', async () => { const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -833,7 +847,7 @@ describe('v1.ProvisioningClient', () => { }); it('invokes getLocation with error', async () => { const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -868,7 +882,7 @@ describe('v1.ProvisioningClient', () => { describe('listLocationsAsync', () => { it('uses async iteration with listLocations without error', async () => { const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -957,7 +971,7 @@ describe('v1.ProvisioningClient', () => { describe('getOperation', () => { it('invokes getOperation without error', async () => { const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -978,7 +992,7 @@ describe('v1.ProvisioningClient', () => { }); it('invokes getOperation without error using callback', async () => { const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); const request = generateSampleMessage( @@ -1012,7 +1026,7 @@ describe('v1.ProvisioningClient', () => { }); it('invokes getOperation with error', async () => { const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); const request = generateSampleMessage( @@ -1036,7 +1050,7 @@ describe('v1.ProvisioningClient', () => { describe('cancelOperation', () => { it('invokes cancelOperation without error', async () => { const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -1058,7 +1072,7 @@ describe('v1.ProvisioningClient', () => { }); it('invokes cancelOperation without error using callback', async () => { const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); const request = generateSampleMessage( @@ -1092,7 +1106,7 @@ describe('v1.ProvisioningClient', () => { }); it('invokes cancelOperation with error', async () => { const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); const request = generateSampleMessage( @@ -1116,7 +1130,7 @@ describe('v1.ProvisioningClient', () => { describe('deleteOperation', () => { it('invokes deleteOperation without error', async () => { const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); client.initialize(); @@ -1138,7 +1152,7 @@ describe('v1.ProvisioningClient', () => { }); it('invokes deleteOperation without error using callback', async () => { const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); const request = generateSampleMessage( @@ -1172,7 +1186,7 @@ describe('v1.ProvisioningClient', () => { }); it('invokes deleteOperation with error', async () => { const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); const request = generateSampleMessage( @@ -1196,7 +1210,7 @@ describe('v1.ProvisioningClient', () => { describe('listOperationsAsync', () => { it('uses async iteration with listOperations without error', async () => { const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', }); const request = generateSampleMessage( diff --git a/packages/google-cloud-apihub/test/gapic_runtime_project_attachment_service_v1.ts b/packages/google-cloud-apihub/test/gapic_runtime_project_attachment_service_v1.ts index 6044652b764..4376b9ceca3 100644 --- a/packages/google-cloud-apihub/test/gapic_runtime_project_attachment_service_v1.ts +++ b/packages/google-cloud-apihub/test/gapic_runtime_project_attachment_service_v1.ts @@ -20,12 +20,12 @@ import * as protos from '../protos/protos'; import * as assert from 'assert'; import * as sinon from 'sinon'; import {SinonStub} from 'sinon'; -import {describe, it} from 'mocha'; +import {describe, it, beforeEach, afterEach} from 'mocha'; import * as runtimeprojectattachmentserviceModule from '../src'; import {PassThrough} from 'stream'; -import {protobuf, LocationProtos} from 'google-gax'; +import {GoogleAuth, protobuf, LocationProtos} from 'google-gax'; // Dynamically loaded proto JSON is needed to get the type information // to fill in default values for request objects @@ -128,6 +128,19 @@ function stubAsyncIterationCall( } describe('v1.RuntimeProjectAttachmentServiceClient', () => { + let googleAuth: GoogleAuth; + beforeEach(() => { + googleAuth = { + getClient: sinon.stub().resolves({ + getRequestHeaders: sinon + .stub() + .resolves({Authorization: 'Bearer SOME_TOKEN'}), + }), + } as unknown as GoogleAuth; + }); + afterEach(() => { + sinon.restore(); + }); describe('Common methods', () => { it('has apiEndpoint', () => { const client = @@ -254,7 +267,7 @@ describe('v1.RuntimeProjectAttachmentServiceClient', () => { const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient( { - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', } ); @@ -267,7 +280,7 @@ describe('v1.RuntimeProjectAttachmentServiceClient', () => { const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient( { - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', } ); @@ -282,7 +295,7 @@ describe('v1.RuntimeProjectAttachmentServiceClient', () => { const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient( { - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', } ); @@ -297,7 +310,7 @@ describe('v1.RuntimeProjectAttachmentServiceClient', () => { const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient( { - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', } ); @@ -312,7 +325,7 @@ describe('v1.RuntimeProjectAttachmentServiceClient', () => { const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient( { - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', } ); @@ -338,7 +351,7 @@ describe('v1.RuntimeProjectAttachmentServiceClient', () => { const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient( { - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', } ); @@ -373,7 +386,7 @@ describe('v1.RuntimeProjectAttachmentServiceClient', () => { const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient( { - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', } ); @@ -423,7 +436,7 @@ describe('v1.RuntimeProjectAttachmentServiceClient', () => { const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient( { - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', } ); @@ -460,7 +473,7 @@ describe('v1.RuntimeProjectAttachmentServiceClient', () => { const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient( { - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', } ); @@ -487,7 +500,7 @@ describe('v1.RuntimeProjectAttachmentServiceClient', () => { const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient( { - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', } ); @@ -522,7 +535,7 @@ describe('v1.RuntimeProjectAttachmentServiceClient', () => { const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient( { - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', } ); @@ -572,7 +585,7 @@ describe('v1.RuntimeProjectAttachmentServiceClient', () => { const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient( { - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', } ); @@ -609,7 +622,7 @@ describe('v1.RuntimeProjectAttachmentServiceClient', () => { const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient( { - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', } ); @@ -636,7 +649,7 @@ describe('v1.RuntimeProjectAttachmentServiceClient', () => { const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient( { - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', } ); @@ -671,7 +684,7 @@ describe('v1.RuntimeProjectAttachmentServiceClient', () => { const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient( { - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', } ); @@ -721,7 +734,7 @@ describe('v1.RuntimeProjectAttachmentServiceClient', () => { const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient( { - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', } ); @@ -758,7 +771,7 @@ describe('v1.RuntimeProjectAttachmentServiceClient', () => { const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient( { - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', } ); @@ -785,7 +798,7 @@ describe('v1.RuntimeProjectAttachmentServiceClient', () => { const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient( { - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', } ); @@ -820,7 +833,7 @@ describe('v1.RuntimeProjectAttachmentServiceClient', () => { const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient( { - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', } ); @@ -870,7 +883,7 @@ describe('v1.RuntimeProjectAttachmentServiceClient', () => { const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient( { - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', } ); @@ -907,7 +920,7 @@ describe('v1.RuntimeProjectAttachmentServiceClient', () => { const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient( { - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', } ); @@ -1213,7 +1226,7 @@ describe('v1.RuntimeProjectAttachmentServiceClient', () => { const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient( { - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', } ); @@ -1319,7 +1332,7 @@ describe('v1.RuntimeProjectAttachmentServiceClient', () => { const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient( { - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', } ); @@ -1352,7 +1365,7 @@ describe('v1.RuntimeProjectAttachmentServiceClient', () => { const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient( { - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', } ); @@ -1399,7 +1412,7 @@ describe('v1.RuntimeProjectAttachmentServiceClient', () => { const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient( { - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', } ); @@ -1437,7 +1450,7 @@ describe('v1.RuntimeProjectAttachmentServiceClient', () => { const client = new runtimeprojectattachmentserviceModule.v1.RuntimeProjectAttachmentServiceClient( { - credentials: {client_email: 'bogus', private_key: 'bogus'}, + auth: googleAuth, projectId: 'bogus', } ); From de613501785b89574552dde9f9f9653f1524d2ef Mon Sep 17 00:00:00 2001 From: sofisl <55454395+sofisl@users.noreply.github.com> Date: Wed, 4 Sep 2024 14:58:34 -0700 Subject: [PATCH 09/11] Update quickstart.js --- packages/google-cloud-apihub/samples/quickstart.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-apihub/samples/quickstart.js b/packages/google-cloud-apihub/samples/quickstart.js index 61765374b9f..9ec12d490bb 100644 --- a/packages/google-cloud-apihub/samples/quickstart.js +++ b/packages/google-cloud-apihub/samples/quickstart.js @@ -105,7 +105,7 @@ function main(parent) { const {ApiHubClient} = require('@google-cloud/apihub').v1; // Instantiates a client - const apihubClient = new ApiHubClient(); + const apihubClient = new ApiHubClient({fallback: 'rest'}); async function callListDeployments() { // Construct request From 16799385fe119d217cb12c51112bc4bcab9d86ca Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Wed, 4 Sep 2024 22:06:24 +0000 Subject: [PATCH 10/11] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20?= =?UTF-8?q?post-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- packages/google-cloud-apihub/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-apihub/README.md b/packages/google-cloud-apihub/README.md index 37fc57a5575..7371729fb4c 100644 --- a/packages/google-cloud-apihub/README.md +++ b/packages/google-cloud-apihub/README.md @@ -142,7 +142,7 @@ npm install @google-cloud/apihub const {ApiHubClient} = require('@google-cloud/apihub').v1; // Instantiates a client -const apihubClient = new ApiHubClient(); +const apihubClient = new ApiHubClient({fallback: 'rest'}); async function callListDeployments() { // Construct request From 886051648aa18dbaade1b2e0a704ddbbb134e543 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Wed, 4 Sep 2024 22:06:28 +0000 Subject: [PATCH 11/11] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20?= =?UTF-8?q?post-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- packages/google-cloud-apihub/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-apihub/README.md b/packages/google-cloud-apihub/README.md index 37fc57a5575..7371729fb4c 100644 --- a/packages/google-cloud-apihub/README.md +++ b/packages/google-cloud-apihub/README.md @@ -142,7 +142,7 @@ npm install @google-cloud/apihub const {ApiHubClient} = require('@google-cloud/apihub').v1; // Instantiates a client -const apihubClient = new ApiHubClient(); +const apihubClient = new ApiHubClient({fallback: 'rest'}); async function callListDeployments() { // Construct request